@wenathlan/devthink 2.0.12 → 2.0.14
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/CHANGELOG.md +20 -0
- package/accounts.ts +2087 -0
- package/agent.ts +2331 -0
- package/antigravity.ts +2139 -0
- package/apifreeze.ts +4146 -0
- package/auth.ts +642 -0
- package/background.ts +16837 -0
- package/bridge.ts +2080 -0
- package/build.ts +54 -0
- package/bun.ts +26 -0
- package/capture.ts +1614 -0
- package/checksecrets.ts +72 -0
- package/cjs.ts +9 -0
- package/cli.ts +3500 -0
- package/commands.ts +1101 -0
- package/companion.ts +450 -0
- package/compatibility.ts +37 -0
- package/config.ts +3137 -0
- package/constants.ts +943 -0
- package/core.ts +1473 -0
- package/crossbrowser.ts +1359 -0
- package/dashdone.ts +605 -0
- package/data.ts +943 -0
- package/database.ts +133 -0
- package/debug.ts +850 -0
- package/deno.ts +27 -0
- package/devthink.ts +707 -0
- package/dist/accounts.d.ts +409 -0
- package/dist/agent.d.ts +837 -0
- package/dist/antigravity.d.ts +380 -0
- package/dist/apifreeze.d.ts +113 -0
- package/dist/auth.d.ts +224 -0
- package/{bridge.d.ts → dist/bridge.d.ts} +1 -1
- package/dist/capture.d.ts +595 -0
- package/dist/cjs.d.ts +6 -0
- package/{cli.js → dist/cli.js} +2 -2
- package/dist/commands.d.ts +310 -0
- package/dist/compatibility.d.ts +17 -0
- package/dist/config.d.ts +1853 -0
- package/dist/constants.d.ts +637 -0
- package/dist/core.d.ts +361 -0
- package/dist/data.d.ts +330 -0
- package/dist/database.d.ts +24 -0
- package/dist/debug.d.ts +270 -0
- package/dist/engine.d.ts +74 -0
- package/dist/environments.d.ts +244 -0
- package/dist/evidence.d.ts +277 -0
- package/dist/export.d.ts +311 -0
- package/dist/fingerprint.d.ts +594 -0
- package/dist/flow.d.ts +300 -0
- package/dist/gates.d.ts +103 -0
- package/dist/identity.d.ts +51 -0
- package/dist/ids.d.ts +7 -0
- package/dist/llm.d.ts +652 -0
- package/dist/models.d.ts +1807 -0
- package/dist/net.d.ts +325 -0
- package/dist/neutral.d.ts +41 -0
- package/dist/oauth.d.ts +703 -0
- package/dist/page.d.ts +1166 -0
- package/dist/perf.d.ts +481 -0
- package/dist/plan.d.ts +134 -0
- package/dist/project.d.ts +395 -0
- package/dist/providers.d.ts +37 -0
- package/dist/quota.d.ts +453 -0
- package/dist/recovery.d.ts +621 -0
- package/dist/request.d.ts +1492 -0
- package/dist/run.d.ts +779 -0
- package/dist/runtime.d.ts +212 -0
- package/dist/search.d.ts +375 -0
- package/dist/security.d.ts +534 -0
- package/dist/serve.d.ts +136 -0
- package/dist/session.d.ts +296 -0
- package/dist/storage.d.ts +53 -0
- package/dist/streaming.d.ts +1119 -0
- package/dist/swarm.d.ts +328 -0
- package/dist/tools.d.ts +170 -0
- package/dist/types.d.ts +8357 -0
- package/dist/utils.d.ts +82 -0
- package/dist/version.d.ts +7 -0
- package/dist/versionregistry.d.ts +406 -0
- package/dist/views.d.ts +579 -0
- package/dist/workbenchsession.d.ts +69 -0
- package/dist/workflow.d.ts +649 -0
- package/docs/readme.md +92 -0
- package/docs/schemas/antigravity.json +192 -0
- package/engine.ts +1524 -0
- package/environments.ts +1005 -0
- package/evidence.ts +643 -0
- package/export.ts +889 -0
- package/fingerprint.ts +1458 -0
- package/flow.ts +1190 -0
- package/gates.ts +307 -0
- package/gateway.ts +34 -0
- package/hardening.ts +191 -0
- package/headless.ts +369 -0
- package/http.ts +2110 -0
- package/identity.ts +246 -0
- package/ids.ts +26 -0
- package/index.ts +369 -0
- package/llm.ts +2682 -0
- package/mcp.ts +1835 -0
- package/{memory.js → memory.ts} +3834 -2310
- package/models.ts +3805 -0
- package/modes.ts +43 -0
- package/net.ts +1214 -0
- package/neutral.ts +362 -0
- package/node.ts +26 -0
- package/oauth.ts +2216 -0
- package/offscreen.ts +170 -0
- package/pack.ts +956 -0
- package/package.json +175 -82
- package/page.ts +7824 -0
- package/pagebridge.ts +1116 -0
- package/perf.ts +957 -0
- package/plan.ts +672 -0
- package/plugin.ts +76 -0
- package/{policy.js → policy.ts} +5073 -4679
- package/prisma.config.ts +27 -0
- package/progress.ts +1308 -0
- package/project.ts +1291 -0
- package/protocol.ts +4187 -0
- package/providers.ts +246 -0
- package/quota.ts +1887 -0
- package/recovery.ts +2433 -0
- package/request.ts +4482 -0
- package/run.ts +2135 -0
- package/runtime.ts +526 -0
- package/search.ts +1760 -0
- package/security.ts +1673 -0
- package/serve.ts +419 -0
- package/server.ts +5538 -0
- package/session.ts +1162 -0
- package/storage.ts +182 -0
- package/streaming.ts +4101 -0
- package/swarm.ts +884 -0
- package/sync.ts +56 -0
- package/tests/agentcert.test.ts +128 -0
- package/tests/agentfleet.test.ts +214 -0
- package/tests/agentreview.test.ts +241 -0
- package/tests/agentstream.test.ts +335 -0
- package/tests/agentwork.test.ts +356 -0
- package/tests/apifreeze.test.ts +290 -0
- package/tests/apimap.test.ts +112 -0
- package/tests/approvalgate.test.ts +175 -0
- package/tests/artifactmanifest.test.ts +204 -0
- package/tests/attentionfeed.test.ts +163 -0
- package/tests/backgroundruns.test.ts +100 -0
- package/tests/batchscheduling.test.ts +131 -0
- package/tests/blackboard.test.ts +238 -0
- package/tests/bridge.test.ts +1088 -0
- package/tests/browsercoverage.test.ts +134 -0
- package/tests/browserpolyfills.test.ts +124 -0
- package/tests/build.mjs +1260 -0
- package/tests/clientauth.test.ts +223 -0
- package/tests/clitools.test.ts +578 -0
- package/tests/confirmgates.test.ts +190 -0
- package/tests/containerpack.test.ts +143 -0
- package/tests/controlflow.test.ts +2120 -0
- package/tests/coordination.test.ts +345 -0
- package/tests/copyscreen.test.ts +139 -0
- package/tests/core.test.ts +417 -0
- package/tests/costcert.test.ts +95 -0
- package/tests/crossbrowser.test.ts +115 -0
- package/tests/cspaudit.test.ts +79 -0
- package/tests/dashdone.test.ts +615 -0
- package/tests/datagrid.test.ts +137 -0
- package/tests/doccheck.test.ts +107 -0
- package/tests/dombatch.test.ts +109 -0
- package/tests/emulation.test.ts +282 -0
- package/tests/environments.test.ts +259 -0
- package/tests/evidenceviews.test.ts +88 -0
- package/tests/exporttools.test.ts +185 -0
- package/tests/firefoxprep.test.ts +134 -0
- package/tests/flowlibrary.test.ts +242 -0
- package/tests/flowrun.test.ts +303 -0
- package/tests/forensics.test.ts +439 -0
- package/tests/gateway.test.ts +939 -0
- package/tests/headlesslib.test.ts +171 -0
- package/tests/httpstream.test.ts +277 -0
- package/tests/immutablelog.test.ts +157 -0
- package/tests/inboundguard.test.ts +177 -0
- package/tests/lazyload.test.ts +72 -0
- package/tests/librarymodes.test.ts +623 -0
- package/tests/llm.test.ts +696 -0
- package/tests/manifest.test.ts +226 -0
- package/tests/maskinputs.test.ts +150 -0
- package/tests/matrixverify.test.ts +111 -0
- package/tests/mavenpack.test.ts +75 -0
- package/tests/mcpserver.test.ts +704 -0
- package/tests/memory.test.ts +4155 -0
- package/tests/memorycare.test.ts +230 -0
- package/tests/migrateplan.test.ts +349 -0
- package/tests/minimization.test.ts +414 -0
- package/tests/modelroute.test.ts +112 -0
- package/tests/multiagent.test.ts +440 -0
- package/tests/nativebridge.test.ts +807 -0
- package/tests/navigation.test.ts +284 -0
- package/tests/nugetpack.test.ts +83 -0
- package/tests/orchestration.test.ts +449 -0
- package/tests/originpolicy.test.ts +405 -0
- package/tests/outputcompare.test.ts +97 -0
- package/tests/package.test.ts +91 -0
- package/tests/pagebridge.test.ts +5909 -0
- package/tests/pentest.test.ts +75 -0
- package/tests/perfrecords.test.ts +257 -0
- package/tests/permdiff.test.ts +85 -0
- package/tests/phishguard.test.ts +128 -0
- package/tests/pickerviews.test.ts +155 -0
- package/tests/pipelines.test.ts +381 -0
- package/tests/planlint.test.ts +240 -0
- package/tests/planreview.test.ts +383 -0
- package/tests/platformtargets.test.ts +56 -0
- package/tests/policy.test.ts +8284 -0
- package/tests/portability.test.ts +96 -0
- package/tests/progress.test.ts +1036 -0
- package/tests/promptlibrary.test.ts +116 -0
- package/tests/protocol.test.ts +4793 -0
- package/tests/publishingpipeline.test.ts +314 -0
- package/tests/quickactions.test.ts +164 -0
- package/tests/readiness.test.ts +78 -0
- package/tests/recipes.test.ts +163 -0
- package/tests/redactshots.test.ts +216 -0
- package/tests/registernvidiakeys.ts +51 -0
- package/tests/relayserve.test.ts +304 -0
- package/tests/releasenotes.test.ts +276 -0
- package/tests/resilience.test.ts +467 -0
- package/tests/resourceaware.test.ts +187 -0
- package/tests/runbudget.test.ts +125 -0
- package/tests/runhistory.test.ts +299 -0
- package/tests/runreplay.test.ts +113 -0
- package/tests/runresume.test.ts +184 -0
- package/tests/runstate.test.ts +288 -0
- package/tests/runtimeadapters.test.ts +251 -0
- package/tests/safariskeleton.test.ts +115 -0
- package/tests/sandboxframe.test.ts +196 -0
- package/tests/sbom.test.ts +105 -0
- package/tests/secretvault.test.ts +188 -0
- package/tests/selcache.test.ts +111 -0
- package/tests/sessioninterface.test.ts +791 -0
- package/tests/sessions.test.ts +591 -0
- package/tests/siteprefs.test.ts +228 -0
- package/tests/snapshotdelta.test.ts +165 -0
- package/tests/statusviews.test.ts +237 -0
- package/tests/stepmeter.test.ts +200 -0
- package/tests/streamparse.test.ts +163 -0
- package/tests/stylepruning.test.ts +90 -0
- package/tests/surfaces.test.ts +282 -0
- package/tests/sweep.test.ts +78 -0
- package/tests/syncbridge.test.ts +164 -0
- package/tests/taskqueue.test.ts +206 -0
- package/tests/toolcalls.test.ts +336 -0
- package/tests/toolcatalog.test.ts +201 -0
- package/tests/torture-agent.test.ts +706 -0
- package/tests/torture-auth.test.ts +461 -0
- package/tests/torture-commands.test.ts +895 -0
- package/tests/torture-data.test.ts +923 -0
- package/tests/torture-environments.test.ts +285 -0
- package/tests/torture-export.test.ts +263 -0
- package/tests/torture-http.test.ts +1379 -0
- package/tests/torture-llm.test.ts +808 -0
- package/tests/torture-memory.test.ts +1084 -0
- package/tests/torture-plan.test.ts +829 -0
- package/tests/torture-run.test.ts +626 -0
- package/tests/torture-session.test.ts +928 -0
- package/tests/torture-swarm.test.ts +1245 -0
- package/tests/torture-tools.test.ts +964 -0
- package/tests/torture-workflow.test.ts +2354 -0
- package/tests/tourviews.test.ts +52 -0
- package/tests/transparency.test.ts +147 -0
- package/tests/trigger.test.ts +941 -0
- package/tests/v1sunset.test.ts +428 -0
- package/tests/virtlist.test.ts +94 -0
- package/tests/vision.test.ts +540 -0
- package/tests/vsixpack.test.ts +145 -0
- package/tests/webapi.test.ts +523 -0
- package/tests/workflow.test.ts +1785 -0
- package/tests/workfloweditor.test.ts +759 -0
- package/tests/xpipack.test.ts +128 -0
- package/tools.ts +734 -0
- package/types.ts +9908 -0
- package/umd.ts +9 -0
- package/utils.ts +249 -0
- package/version.ts +8 -0
- package/versionregistry.ts +1310 -0
- package/views.ts +2153 -0
- package/vitest.config.ts +12 -0
- package/web/App.tsx +78 -0
- package/web/README.md +47 -0
- package/web/capacitor.config.ts +46 -0
- package/web/const.ts +19 -0
- package/web/control.shell.tsx +66 -0
- package/web/dashboardpage.ts +554 -0
- package/web/db.ts +493 -0
- package/web/design.html +541 -0
- package/web/gatewayview/Gateway.tsx +345 -0
- package/web/gatewayview/config.ts +1042 -0
- package/web/gatewayview/definition.ts +174 -0
- package/web/icons.ts +15 -0
- package/{manifest.json → web/manifest.json} +1 -1
- package/web/optionspage.ts +691 -0
- package/web/popup.ts +1651 -0
- package/web/schema.prisma +176 -0
- package/web/sidepanel.ts +7941 -0
- package/web/sitemanifest.json +13 -0
- package/web/terminal-ui.tsx +622 -0
- package/web/transparencypage.ts +541 -0
- package/web/vite.config.ts +39 -0
- package/web/workspace.ts +23 -0
- package/workbenchmemory.ts +104 -0
- package/workbenchsession.ts +304 -0
- package/workflow.ts +4495 -0
- package/bridge.d.ts.map +0 -1
- package/bridge.js +0 -1877
- package/bun.d.ts.map +0 -1
- package/bun.js +0 -52329
- package/caps/background.json +0 -712
- package/caps/cli.json +0 -360
- package/caps/library.json +0 -3611
- package/caps/mcp.json +0 -126
- package/caps/pagebridge.json +0 -377
- package/caps/popup.json +0 -51
- package/caps/sidepanel.json +0 -522
- package/checksums.txt +0 -142
- package/cli.d.ts.map +0 -1
- package/companion.d.ts.map +0 -1
- package/companion.js +0 -389
- package/crossbrowser.d.ts.map +0 -1
- package/crossbrowser.js +0 -1191
- package/dashdone.d.ts.map +0 -1
- package/dashdone.js +0 -368
- package/deno.d.ts.map +0 -1
- package/deno.js +0 -52325
- package/devthink.umd.js +0 -52346
- package/fixtures/bun.ts +0 -7
- package/fixtures/cjs.js +0 -6
- package/fixtures/deno.ts +0 -6
- package/fixtures/example-org-pagestate.json +0 -22
- package/fixtures/importers/automa-workflow.json +0 -18
- package/fixtures/importers/selenium-side.json +0 -20
- package/fixtures/importers/tabular-plan.csv +0 -7
- package/fixtures/importers/uivision-macro.json +0 -10
- package/fixtures/importers/v1-plan.json +0 -13
- package/fixtures/mcp-client.mjs +0 -14
- package/fixtures/pages/checkout.html +0 -192
- package/fixtures/pages/dashboard.html +0 -110
- package/fixtures/pages/feed.html +0 -113
- package/fixtures/pages/product-grid.html +0 -150
- package/fixtures/plans/form-inventory-plan.json +0 -11
- package/fixtures/plans/release-notes-plan.json +0 -11
- package/fixtures/recipes/agentscompete.json +0 -11
- package/fixtures/recipes/agentsforms.json +0 -11
- package/fixtures/recipes/agentsmonitor.json +0 -11
- package/fixtures/recipes/agentsreview.json +0 -29
- package/fixtures/recipes/agentswarm.json +0 -11
- package/fixtures/recipes/fillcalendar.json +0 -12
- package/fixtures/recipes/fillcheckout.json +0 -13
- package/fixtures/recipes/filldependentdropdowns.json +0 -12
- package/fixtures/recipes/fillfromcsv.json +0 -13
- package/fixtures/recipes/fillloginform.json +0 -12
- package/fixtures/recipes/fillmultistepwizard.json +0 -13
- package/fixtures/recipes/fillregistration.json +0 -12
- package/fixtures/recipes/fillsearchfilters.json +0 -12
- package/fixtures/recipes/filltypeahead.json +0 -11
- package/fixtures/recipes/monitoralerts.json +0 -12
- package/fixtures/recipes/monitoravailability.json +0 -11
- package/fixtures/recipes/monitornetworkquiet.json +0 -12
- package/fixtures/recipes/monitorpagechanges.json +0 -11
- package/fixtures/recipes/monitorpricechange.json +0 -11
- package/fixtures/recipes/monitorschedule.json +0 -12
- package/fixtures/recipes/scrapedynamicprices.json +0 -13
- package/fixtures/recipes/scrapeimagegallery.json +0 -12
- package/fixtures/recipes/scrapeinfinitefeed.json +0 -13
- package/fixtures/recipes/scrapenestedlists.json +0 -12
- package/fixtures/recipes/scrapeproductgrid.json +0 -12
- package/fixtures/recipes/scrapereviews.json +0 -12
- package/fixtures/recipes/scrapesearchresults.json +0 -12
- package/fixtures/recipes/scrapetablepagination.json +0 -12
- package/fixtures/recipes/testaccessibility.json +0 -34
- package/fixtures/recipes/testconsoleerrors.json +0 -12
- package/fixtures/recipes/testdeeplinks.json +0 -12
- package/fixtures/recipes/testformvalidation.json +0 -13
- package/fixtures/recipes/testlayoutshift.json +0 -12
- package/fixtures/recipes/testlinkcheck.json +0 -12
- package/fixtures/recipes/testloadtiming.json +0 -12
- package/fixtures/recipes/testvisualdiff.json +0 -12
- package/fixtures/workflows/changelog-digest-workflow.json +0 -13
- package/fixtures/workflows/form-survey-workflow.json +0 -13
- package/gallery.json +0 -706
- package/hardening.d.ts.map +0 -1
- package/hardening.js +0 -188
- package/headless.d.ts.map +0 -1
- package/headless.js +0 -11522
- package/http.d.ts.map +0 -1
- package/http.js +0 -2165
- package/index.cjs +0 -54682
- package/index.d.ts.map +0 -1
- package/index.js +0 -52310
- package/index.neutral.js +0 -46343
- package/mcp.d.ts.map +0 -1
- package/mcp.js +0 -20515
- package/memory.d.ts.map +0 -1
- package/nativehost.template.json +0 -10
- package/node.cjs +0 -54686
- package/node.d.ts.map +0 -1
- package/pack.d.ts.map +0 -1
- package/pack.js +0 -805
- package/policy.d.ts.map +0 -1
- package/progress.d.ts.map +0 -1
- package/progress.js +0 -645
- package/protocol.d.ts.map +0 -1
- package/protocol.js +0 -8334
- package/schemas/audit.schema.json +0 -226
- package/schemas/capability.schema.json +0 -113
- package/schemas/envelope.schema.json +0 -162
- package/schemas/memory.schema.json +0 -51
- package/schemas/observation.schema.json +0 -113
- package/schemas/plan.schema.json +0 -208
- package/schemas/progress.schema.json +0 -126
- package/schemas/proposal.schema.json +0 -68
- package/schemas/session.schema.json +0 -82
- package/schemas/tool.schema.json +0 -94
- package/server.d.ts.map +0 -1
- package/server.js +0 -28877
- package/umd-example.html +0 -18
- package/umd.d.ts.map +0 -1
- /package/{bun.d.ts → dist/bun.d.ts} +0 -0
- /package/{cli.d.ts → dist/cli.d.ts} +0 -0
- /package/{companion.d.ts → dist/companion.d.ts} +0 -0
- /package/{crossbrowser.d.ts → dist/crossbrowser.d.ts} +0 -0
- /package/{dashdone.d.ts → dist/dashdone.d.ts} +0 -0
- /package/{deno.d.ts → dist/deno.d.ts} +0 -0
- /package/{hardening.d.ts → dist/hardening.d.ts} +0 -0
- /package/{headless.d.ts → dist/headless.d.ts} +0 -0
- /package/{http.d.ts → dist/http.d.ts} +0 -0
- /package/{index.d.ts → dist/index.d.ts} +0 -0
- /package/{mcp.d.ts → dist/mcp.d.ts} +0 -0
- /package/{memory.d.ts → dist/memory.d.ts} +0 -0
- /package/{node.d.ts → dist/node.d.ts} +0 -0
- /package/{pack.d.ts → dist/pack.d.ts} +0 -0
- /package/{policy.d.ts → dist/policy.d.ts} +0 -0
- /package/{progress.d.ts → dist/progress.d.ts} +0 -0
- /package/{protocol.d.ts → dist/protocol.d.ts} +0 -0
- /package/{server.d.ts → dist/server.d.ts} +0 -0
- /package/{umd.d.ts → dist/umd.d.ts} +0 -0
package/dist/page.d.ts
ADDED
|
@@ -0,0 +1,1166 @@
|
|
|
1
|
+
/** The page module of the 1.1.88 consolidation: every correlated variation of the page logic interned in this one file, so the module family carries one surface without duplicate variations. */
|
|
2
|
+
import type { capabilityreport, toolstep, keyholdstate, columnspec, datasetrow, sourceref, transformrule, loglevel, bannerreport, listpattern, dialogpolicy, fielderror, fieldkind, fieldmatch, formrecord, formentry, retryrule, navtarget, urlpattern, waitprofile, authrecord, curatedlink, redirectchain, ratelimit, ratelimitstate, safetyverdict, a11ynode, readerarticle, pointpath, speedprofile, clickablemap, resolvedtarget, targetmode, diffentry, jsonstate, mutationevent, mutationwatch, selectorcandidate, wizardstate } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Browser-level command surface for reviewed steps.
|
|
5
|
+
* Every correlated rule for tab, window, zoom, snapshot and download actions plus capability negotiation lives in this file.
|
|
6
|
+
*/
|
|
7
|
+
export type browserresult = {
|
|
8
|
+
ok: boolean;
|
|
9
|
+
summary: string;
|
|
10
|
+
details?: Record<string, unknown>;
|
|
11
|
+
};
|
|
12
|
+
/** True when the kind executes against browser-level surfaces instead of the page. */
|
|
13
|
+
export declare function isbrowserkind(kind: string): boolean;
|
|
14
|
+
/** Builds the live capability report from the optional permissions the user granted. */
|
|
15
|
+
export declare function readcapabilities(): Promise<capabilityreport>;
|
|
16
|
+
/** Executes one reviewed browser-level action kind against the live browser. */
|
|
17
|
+
export declare function runbrowseraction(step: toolstep, sessiontabid: number, windowid: number): Promise<browserresult>;
|
|
18
|
+
/**
|
|
19
|
+
* Mutating page interactions for reviewed steps.
|
|
20
|
+
* Every correlated rule for pointer, key, drag, upload, form, attribute, storage and evaluation actions lives in this file.
|
|
21
|
+
*/
|
|
22
|
+
export type stepresult = {
|
|
23
|
+
ok: boolean;
|
|
24
|
+
summary: string;
|
|
25
|
+
details?: Record<string, unknown>;
|
|
26
|
+
};
|
|
27
|
+
/** Runs one mutating page action after the background policy gate and a fresh target check. */
|
|
28
|
+
export declare function runpageaction(step: toolstep, target: Element | null): stepresult | Promise<stepresult>;
|
|
29
|
+
/**
|
|
30
|
+
* Field and control interactions for reviewed steps.
|
|
31
|
+
* Every correlated rule for timed typing, value setting, key holds, search submission, multi selects, radio choices, sliders, dates, colors, details sections and the hold registry lives in this file.
|
|
32
|
+
*/
|
|
33
|
+
/** Builds the per keystroke schedule of one reviewed typetime step. */
|
|
34
|
+
export declare function typetimeschedule(text: string, delay: number): Array<{
|
|
35
|
+
key: string;
|
|
36
|
+
delay: number;
|
|
37
|
+
}>;
|
|
38
|
+
/** Appends reviewed text to the current field value. */
|
|
39
|
+
export declare function appendvalue(current: string, addition: string): string;
|
|
40
|
+
/** Event order delivered after one reviewed value change. */
|
|
41
|
+
export declare function valueevents(): string[];
|
|
42
|
+
/** Splits reviewed multi select values into present and missing entries against the declared options. */
|
|
43
|
+
export declare function multichoices(values: string[], options: Array<{
|
|
44
|
+
value: string;
|
|
45
|
+
label: string;
|
|
46
|
+
}>): {
|
|
47
|
+
present: string[];
|
|
48
|
+
missing: string[];
|
|
49
|
+
};
|
|
50
|
+
/** Picks the reviewed radio input by value or label from one radio group; the index of the match or minus one. */
|
|
51
|
+
export declare function radiochoice(inputs: Array<{
|
|
52
|
+
value: string;
|
|
53
|
+
label: string;
|
|
54
|
+
}>, choice: string): number;
|
|
55
|
+
/** Clamps one reviewed slider value to the declared range and step grid. */
|
|
56
|
+
export declare function slidervalue(requested: number, min: number, max: number, step: number): number;
|
|
57
|
+
/** Validates and normalizes one reviewed yyyy-mm-dd date. */
|
|
58
|
+
export declare function datevalue(requested: string): string | null;
|
|
59
|
+
/** Validates and normalizes one reviewed #rrggbb color. */
|
|
60
|
+
export declare function colorvalue(requested: string): string | null;
|
|
61
|
+
/** Decides whether one reviewed details section still needs opening. */
|
|
62
|
+
export declare function expandstate(open: boolean): {
|
|
63
|
+
open: boolean;
|
|
64
|
+
changed: boolean;
|
|
65
|
+
};
|
|
66
|
+
/** Records one held key under its hold id; a repeated active hold id is refused. */
|
|
67
|
+
export declare function presshold(holds: keyholdstate[], hold: keyholdstate): {
|
|
68
|
+
holds: keyholdstate[];
|
|
69
|
+
ok: boolean;
|
|
70
|
+
};
|
|
71
|
+
/** Releases one held key by hold id, keeping the release timestamp. */
|
|
72
|
+
export declare function releasehold(holds: keyholdstate[], holdid: string, releasedat: number): {
|
|
73
|
+
holds: keyholdstate[];
|
|
74
|
+
released?: keyholdstate;
|
|
75
|
+
};
|
|
76
|
+
/** Returns the keys currently held, optionally filtered to one tab. */
|
|
77
|
+
export declare function heldkeys(holds: keyholdstate[], tabid?: number): keyholdstate[];
|
|
78
|
+
/** Runs one reviewed control interaction after the background policy gate and a fresh target check; frame routed steps receive their frame document as the root. */
|
|
79
|
+
export declare function runpagecontrol(step: toolstep, target: Element | null, root?: Document): stepresult | Promise<stepresult>;
|
|
80
|
+
/**
|
|
81
|
+
* Table and dataset logics for reviewed steps.
|
|
82
|
+
* Every correlated rule for header normalization, span expansion, nested table walking, pagination following, row hashing, transform expressions, dataset merging, row sampling and csv, json and excel serialization lives in this file.
|
|
83
|
+
*/
|
|
84
|
+
/** One raw table cell with its text, header flag, span geometry and an optional nested table. */
|
|
85
|
+
export interface cellshape {
|
|
86
|
+
text: string;
|
|
87
|
+
header: boolean;
|
|
88
|
+
rowspan: number;
|
|
89
|
+
colspan: number;
|
|
90
|
+
nested?: {
|
|
91
|
+
selector: string;
|
|
92
|
+
rows: rowshape[];
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/** One raw table row of span carrying cells. */
|
|
96
|
+
export interface rowshape {
|
|
97
|
+
cells: cellshape[];
|
|
98
|
+
header: boolean;
|
|
99
|
+
}
|
|
100
|
+
/** One nested child table linked to the body row it belongs to. */
|
|
101
|
+
export interface childtable {
|
|
102
|
+
parentrow: number;
|
|
103
|
+
selector: string;
|
|
104
|
+
columns: columnspec[];
|
|
105
|
+
rows: datasetrow[];
|
|
106
|
+
}
|
|
107
|
+
/** Result of the table reader: normalized column specs, keyed body rows and child datasets. */
|
|
108
|
+
export interface gridresult {
|
|
109
|
+
columns: columnspec[];
|
|
110
|
+
rows: datasetrow[];
|
|
111
|
+
children: childtable[];
|
|
112
|
+
}
|
|
113
|
+
/** Trims, lowercases and slugifies one header cell into a stable column key. */
|
|
114
|
+
export declare function normalizeheader(label: string): string;
|
|
115
|
+
/** Builds one column spec from a header label with a unique stable key and the normalized name. */
|
|
116
|
+
export declare function columnspecof(label: string, used?: Set<string>): columnspec;
|
|
117
|
+
/** Classifies a column as number only when every non-empty value parses as a number. */
|
|
118
|
+
export declare function classifycolumn(values: string[]): "text" | "number";
|
|
119
|
+
/** Expands rowspan and colspan cells into a filled rectangular grid of values. */
|
|
120
|
+
export declare function expandspans(rows: rowshape[]): string[][];
|
|
121
|
+
/** Reads header and body rows into normalized column specs and keyed body rows, extracting nested tables into child datasets. */
|
|
122
|
+
export declare function readgrid(rows: rowshape[]): gridresult;
|
|
123
|
+
/** Resolves the next pagination control from numbered page entries: the entry after the current one or a next word control. */
|
|
124
|
+
export declare function nextcontrol(entries: Array<{
|
|
125
|
+
text: string;
|
|
126
|
+
selector: string;
|
|
127
|
+
current: boolean;
|
|
128
|
+
}>): string | undefined;
|
|
129
|
+
/** True when the current row set contains at least one row the previous set did not carry. */
|
|
130
|
+
export declare function rowsfresh(previous: datasetrow[], current: datasetrow[]): boolean;
|
|
131
|
+
/** Computes a stable row hash over the reviewed keys; an empty key list hashes every column. */
|
|
132
|
+
export declare function rowhash(row: datasetrow, keys: string[]): string;
|
|
133
|
+
/** Deduplicates rows by reviewed keys, keeping the first occurrence of every key set. */
|
|
134
|
+
export declare function dedupebykeys(rows: datasetrow[], keys: string[]): {
|
|
135
|
+
kept: datasetrow[];
|
|
136
|
+
removed: number;
|
|
137
|
+
};
|
|
138
|
+
/** Applies one reviewed transform expression to a value; unsupported expressions are refused. */
|
|
139
|
+
export declare function applyexpression(value: string, expression: string): string;
|
|
140
|
+
/** Applies reviewed transform rules to dataset rows, surfacing per rule errors and keeping the original values on failure. */
|
|
141
|
+
export declare function transformrows(rows: datasetrow[], rules: transformrule[]): {
|
|
142
|
+
rows: datasetrow[];
|
|
143
|
+
errors: string[];
|
|
144
|
+
};
|
|
145
|
+
/** Merges datasets across pages: columns align by key with gaps filled empty and rows concatenate in page order. */
|
|
146
|
+
export declare function mergedatasets(datasets: Array<{
|
|
147
|
+
columns: columnspec[];
|
|
148
|
+
rows: datasetrow[];
|
|
149
|
+
}>): {
|
|
150
|
+
columns: columnspec[];
|
|
151
|
+
rows: datasetrow[];
|
|
152
|
+
};
|
|
153
|
+
/** Attaches the source url, timestamp and step ref to every row and returns the matching source refs. */
|
|
154
|
+
export declare function samplerows(rows: datasetrow[], url: string, stepid: string, at: number): {
|
|
155
|
+
rows: datasetrow[];
|
|
156
|
+
sources: sourceref[];
|
|
157
|
+
};
|
|
158
|
+
/** Serializes columns and rows into csv text. */
|
|
159
|
+
export declare function tocsv(columns: columnspec[], rows: datasetrow[], delimiter?: string): string;
|
|
160
|
+
/** Parses csv text into headers and raw rows, honoring quoted fields and escaped quotes. */
|
|
161
|
+
export declare function parsecsv(text: string, delimiter?: string): {
|
|
162
|
+
headers: string[];
|
|
163
|
+
rows: string[][];
|
|
164
|
+
};
|
|
165
|
+
/** Maps parsed csv headers onto dataset column specs through a reviewed mapping of csv names to target keys. */
|
|
166
|
+
export declare function mapcolumns(headers: string[], mapping?: Record<string, string>): columnspec[];
|
|
167
|
+
/** Serializes columns and rows into a json dataset payload. */
|
|
168
|
+
export declare function tojson(columns: columnspec[], rows: datasetrow[]): string;
|
|
169
|
+
/** Serializes columns and rows into an Excel SpreadsheetML 2003 workbook that Excel opens natively. */
|
|
170
|
+
export declare function toexcel(columns: columnspec[], rows: datasetrow[], name: string): string;
|
|
171
|
+
/** Runs one reviewed data step on the page: table scraping into datasets and pagination following with fresh row waits. */
|
|
172
|
+
export declare function runpagedata(step: toolstep, target: Element | null, root?: Document): Promise<stepresult>;
|
|
173
|
+
/** Exposes the pagination entries of the current document so plan review can suggest next controls. */
|
|
174
|
+
export declare function pagepagination(root?: Document): Array<{
|
|
175
|
+
text: string;
|
|
176
|
+
selector: string;
|
|
177
|
+
current: boolean;
|
|
178
|
+
}>;
|
|
179
|
+
/** Queues one console line of the 1.1.78 forensic family for the next step completion flush; the line keeps its level, its masked text and its capture time. */
|
|
180
|
+
export declare function queueconsoleentry(entry: {
|
|
181
|
+
level: loglevel;
|
|
182
|
+
text: string;
|
|
183
|
+
at: number;
|
|
184
|
+
reload?: number;
|
|
185
|
+
}): void;
|
|
186
|
+
/** Flushes the pending console entries of the 1.1.78 forensic family on step completion: the buffered console lines return once and the buffer empties, so the background consoletimeline stamps their run wide sequence numbers in capture order across page reloads. */
|
|
187
|
+
export declare function flushconsole(): Array<{
|
|
188
|
+
level: string;
|
|
189
|
+
text: string;
|
|
190
|
+
source: string;
|
|
191
|
+
at: number;
|
|
192
|
+
reload?: number;
|
|
193
|
+
}>;
|
|
194
|
+
/** Parsed cdp step options: the enabled domains, the teardown plan, the raw command, the event rules with the watch window, the breakpoint, the step mode, the watch expression and the script override. */
|
|
195
|
+
export interface cdpstepoptions {
|
|
196
|
+
domains: string[];
|
|
197
|
+
teardown?: {
|
|
198
|
+
revertsteps: string[];
|
|
199
|
+
resumepolicy: string;
|
|
200
|
+
};
|
|
201
|
+
command?: {
|
|
202
|
+
method: string;
|
|
203
|
+
params?: Record<string, unknown>;
|
|
204
|
+
resultpath?: string;
|
|
205
|
+
};
|
|
206
|
+
events?: Array<{
|
|
207
|
+
domain: string;
|
|
208
|
+
event: string;
|
|
209
|
+
match?: string;
|
|
210
|
+
}>;
|
|
211
|
+
watchwindow: number;
|
|
212
|
+
breakpoint?: {
|
|
213
|
+
url: string;
|
|
214
|
+
line: number;
|
|
215
|
+
column?: number;
|
|
216
|
+
condition?: string;
|
|
217
|
+
};
|
|
218
|
+
mode?: string;
|
|
219
|
+
expression?: {
|
|
220
|
+
expression: string;
|
|
221
|
+
scope: string;
|
|
222
|
+
};
|
|
223
|
+
override?: {
|
|
224
|
+
urlpattern: string;
|
|
225
|
+
source: string;
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
/** Parses the reviewed cdp options of one devtools protocol step through the shared cdpbus normalizers. */
|
|
229
|
+
export declare function cdpstepoptions(step: toolstep): cdpstepoptions;
|
|
230
|
+
/** Runs one reviewed devtools protocol step inside the page through the instrumented harness: the harness attaches and detaches cleanly, raw commands of the instrumented surface run with duration and error class, domain events observe through the console and navigation hooks, breakpoints pause instrumented probes, stepping advances the pause, watch expressions evaluate in the pause scope and script overrides apply the reviewed fixture. */
|
|
231
|
+
export declare function runcdpstep(step: toolstep): Promise<stepresult>;
|
|
232
|
+
/** Parsed debug watch options: the window, level floor, serialization depth, redaction patterns, spam rule, rotation rule and long task threshold. */
|
|
233
|
+
export interface debugwatchoptions {
|
|
234
|
+
window: number;
|
|
235
|
+
level?: loglevel;
|
|
236
|
+
depth: number;
|
|
237
|
+
redact: string[];
|
|
238
|
+
spam?: {
|
|
239
|
+
pattern: string;
|
|
240
|
+
windowsize: number;
|
|
241
|
+
collapse: number;
|
|
242
|
+
};
|
|
243
|
+
rotation?: {
|
|
244
|
+
maxentries: number;
|
|
245
|
+
overflowtarget: string;
|
|
246
|
+
};
|
|
247
|
+
threshold: number;
|
|
248
|
+
}
|
|
249
|
+
/** Parses the reviewed debug watch options of one watch step; absent windows watch nothing and the depth bound defaults shallow. */
|
|
250
|
+
export declare function debugwatchoptions(step: toolstep): debugwatchoptions;
|
|
251
|
+
/** Runs one reviewed debugging watch inside the page: console methods are hooked, error and rejection listeners installed and the longtask buffer observed for the reviewed window; every hook detaches cleanly at the end. */
|
|
252
|
+
export declare function rundebugwatch(step: toolstep): Promise<stepresult>;
|
|
253
|
+
/**
|
|
254
|
+
* Page shape detection for reviewed steps.
|
|
255
|
+
* Every correlated rule for repeated list detection, table shape normalization, pagination estimates, infinite scroll ranges, virtualization, lazy images, sticky overlays, scroll locks, consent banner shapes, template classification, section fingerprints and scroll positions lives in this file.
|
|
256
|
+
*/
|
|
257
|
+
/** Serializable sibling sample of one container element used by the list detector. */
|
|
258
|
+
export interface siblingsample {
|
|
259
|
+
container: string;
|
|
260
|
+
children: Array<{
|
|
261
|
+
tag: string;
|
|
262
|
+
classes: string;
|
|
263
|
+
text: string;
|
|
264
|
+
selector: string;
|
|
265
|
+
}>;
|
|
266
|
+
}
|
|
267
|
+
/** Finds repeated item lists with a shared item selector from sibling samples. */
|
|
268
|
+
export declare function detectlistpatterns(samples: siblingsample[]): listpattern[];
|
|
269
|
+
/** Normalizes one table row structure into header row, column specs and caption. */
|
|
270
|
+
export declare function normalizetable(rows: Array<{
|
|
271
|
+
cells: string[];
|
|
272
|
+
header: boolean;
|
|
273
|
+
}>, caption: string): {
|
|
274
|
+
headers: string[];
|
|
275
|
+
columns: Array<{
|
|
276
|
+
label: string;
|
|
277
|
+
cells: number;
|
|
278
|
+
}>;
|
|
279
|
+
rows: number;
|
|
280
|
+
caption: string;
|
|
281
|
+
};
|
|
282
|
+
/** Counts pagination entries and estimates the total page count from the numbers they carry. */
|
|
283
|
+
export declare function paginationestimate(entries: Array<{
|
|
284
|
+
text: string;
|
|
285
|
+
selector: string;
|
|
286
|
+
current: boolean;
|
|
287
|
+
}>): {
|
|
288
|
+
current: number;
|
|
289
|
+
total: number;
|
|
290
|
+
links: number;
|
|
291
|
+
pages: number[];
|
|
292
|
+
};
|
|
293
|
+
/** Serializable scroll range input of one scrollable container. */
|
|
294
|
+
export interface scrollrangeshape {
|
|
295
|
+
selector: string;
|
|
296
|
+
scrollheight: number;
|
|
297
|
+
clientheight: number;
|
|
298
|
+
triggers: string[];
|
|
299
|
+
}
|
|
300
|
+
/** Flags infinite scroll containers from measured scroll ranges and their load more triggers. */
|
|
301
|
+
export declare function infinitescrollranges(ranges: scrollrangeshape[]): Array<{
|
|
302
|
+
selector: string;
|
|
303
|
+
scrollrange: number;
|
|
304
|
+
triggers: string[];
|
|
305
|
+
}>;
|
|
306
|
+
/** Detects virtualized lists whose uniform rendered rows do not fill the measured scroll range. */
|
|
307
|
+
export declare function virtualizedcontainers(containers: Array<{
|
|
308
|
+
selector: string;
|
|
309
|
+
scrollheight: number;
|
|
310
|
+
rows: Array<{
|
|
311
|
+
selector: string;
|
|
312
|
+
height: number;
|
|
313
|
+
classes: string;
|
|
314
|
+
}>;
|
|
315
|
+
}>): Array<{
|
|
316
|
+
selector: string;
|
|
317
|
+
rendered: number;
|
|
318
|
+
estimated: number;
|
|
319
|
+
}>;
|
|
320
|
+
/** Serializable image shape used by the lazy detector. */
|
|
321
|
+
export interface imageshape {
|
|
322
|
+
selector: string;
|
|
323
|
+
src: string;
|
|
324
|
+
datasrc: string;
|
|
325
|
+
loading: string;
|
|
326
|
+
width: number;
|
|
327
|
+
height: number;
|
|
328
|
+
}
|
|
329
|
+
/** Detects lazy loaded images from loading attributes and deferred sources, and placeholder states from inline data or empty sources. */
|
|
330
|
+
export declare function lazysurvey(images: imageshape[]): {
|
|
331
|
+
lazy: Array<{
|
|
332
|
+
selector: string;
|
|
333
|
+
reason: string;
|
|
334
|
+
}>;
|
|
335
|
+
placeholders: Array<{
|
|
336
|
+
selector: string;
|
|
337
|
+
reason: string;
|
|
338
|
+
}>;
|
|
339
|
+
};
|
|
340
|
+
/** Detects sticky headers and overlays from fixed and sticky geometry measured against the viewport. */
|
|
341
|
+
export declare function overlaygeometry(elements: Array<{
|
|
342
|
+
selector: string;
|
|
343
|
+
position: string;
|
|
344
|
+
top: number;
|
|
345
|
+
height: number;
|
|
346
|
+
width: number;
|
|
347
|
+
}>, viewport: {
|
|
348
|
+
width: number;
|
|
349
|
+
height: number;
|
|
350
|
+
}): Array<{
|
|
351
|
+
selector: string;
|
|
352
|
+
position: string;
|
|
353
|
+
coverage: number;
|
|
354
|
+
hides: boolean;
|
|
355
|
+
}>;
|
|
356
|
+
/** Detects scroll locks and modal states from body overflow, body position and modal presence signals. */
|
|
357
|
+
export declare function scrolllockstate(signals: {
|
|
358
|
+
bodyoverflow: string;
|
|
359
|
+
htmloverflow: string;
|
|
360
|
+
bodyposition: string;
|
|
361
|
+
modal: boolean;
|
|
362
|
+
scrollable: boolean;
|
|
363
|
+
}): {
|
|
364
|
+
locked: boolean;
|
|
365
|
+
reasons: string[];
|
|
366
|
+
scrollable: boolean;
|
|
367
|
+
};
|
|
368
|
+
/** Serializable consent banner candidate collected by the banner watcher glue. */
|
|
369
|
+
export interface bannercandidate {
|
|
370
|
+
selector: string;
|
|
371
|
+
id: string;
|
|
372
|
+
classes: string[];
|
|
373
|
+
text: string;
|
|
374
|
+
controls: string[];
|
|
375
|
+
}
|
|
376
|
+
/** Consent banner keywords the shape matcher recognizes across locales. */
|
|
377
|
+
export declare const consentkeywords: string[];
|
|
378
|
+
/** Matches consent banner shapes against the known keyword vocabulary and reports their controls. */
|
|
379
|
+
export declare function bannermatches(candidates: bannercandidate[], at: number): bannerreport[];
|
|
380
|
+
/** Classifies the page template from its dominant structural signals. */
|
|
381
|
+
export declare function classifytemplate(signals: {
|
|
382
|
+
paragraphs: number;
|
|
383
|
+
headings: number;
|
|
384
|
+
lists: number;
|
|
385
|
+
tables: number;
|
|
386
|
+
forms: number;
|
|
387
|
+
inputs: number;
|
|
388
|
+
password: boolean;
|
|
389
|
+
}): string;
|
|
390
|
+
/** Computes a stable structural fingerprint of one page section from its tag, attributes, child count and text length. */
|
|
391
|
+
export declare function sectionfingerprint(section: {
|
|
392
|
+
tag: string;
|
|
393
|
+
attributes: Record<string, string>;
|
|
394
|
+
children: number;
|
|
395
|
+
textlength: number;
|
|
396
|
+
}): string;
|
|
397
|
+
/** Normalizes the scroll position of the window and its scrollable containers with edge flags. */
|
|
398
|
+
export declare function scrollreport(window: {
|
|
399
|
+
scrollx: number;
|
|
400
|
+
scrolly: number;
|
|
401
|
+
scrollheight: number;
|
|
402
|
+
clientheight: number;
|
|
403
|
+
}, containers: Array<{
|
|
404
|
+
selector: string;
|
|
405
|
+
scrolltop: number;
|
|
406
|
+
scrollleft: number;
|
|
407
|
+
scrollheight: number;
|
|
408
|
+
clientheight: number;
|
|
409
|
+
}>): {
|
|
410
|
+
window: {
|
|
411
|
+
x: number;
|
|
412
|
+
y: number;
|
|
413
|
+
attop: boolean;
|
|
414
|
+
atbottom: boolean;
|
|
415
|
+
height: number;
|
|
416
|
+
};
|
|
417
|
+
containers: Array<{
|
|
418
|
+
selector: string;
|
|
419
|
+
scrolltop: number;
|
|
420
|
+
scrollleft: number;
|
|
421
|
+
scrollrange: number;
|
|
422
|
+
atbottom: boolean;
|
|
423
|
+
}>;
|
|
424
|
+
};
|
|
425
|
+
/** Collects the sibling samples of one document for the list detector. */
|
|
426
|
+
export declare function collectsiblings(root: Document): siblingsample[];
|
|
427
|
+
/** Collects the data table structures of one document for the table shape normalizer. */
|
|
428
|
+
export declare function collecttables(root: Document): Array<{
|
|
429
|
+
selector: string;
|
|
430
|
+
rows: Array<{
|
|
431
|
+
cells: string[];
|
|
432
|
+
header: boolean;
|
|
433
|
+
}>;
|
|
434
|
+
caption: string;
|
|
435
|
+
}>;
|
|
436
|
+
/** Collects the consent banner candidates of one document for the banner shape matcher. */
|
|
437
|
+
export declare function collectbannercandidates(root: Document): bannercandidate[];
|
|
438
|
+
/** Runs one page shape detection after the background policy gate; frame routed steps receive their frame document as the root. */
|
|
439
|
+
export declare function runpagedetection(step: toolstep, target: Element | null, root?: Document): stepresult | Promise<stepresult>;
|
|
440
|
+
/**
|
|
441
|
+
* Dialog policy logics for reviewed steps.
|
|
442
|
+
* Every correlated rule for policy parsing, dialog answers, main world handler installation and observed dialog harvesting lives in this file.
|
|
443
|
+
* The isolated world cannot override window.confirm, window.alert or window.prompt, so the background installs these wrappers through the scripting api in the main world.
|
|
444
|
+
*/
|
|
445
|
+
/** One dialog observed by the main world handler, recorded on the shared document. */
|
|
446
|
+
export interface observeddialog {
|
|
447
|
+
dialog: string;
|
|
448
|
+
text: string;
|
|
449
|
+
result: string | boolean | null;
|
|
450
|
+
at: number;
|
|
451
|
+
}
|
|
452
|
+
/** Parses the reviewed dialog policy from step options; prompts need a reviewed answer. */
|
|
453
|
+
export declare function parsedialogpolicy(step: toolstep): dialogpolicy | null;
|
|
454
|
+
/** Decides how the reviewed policy answers one dialog kind; a prompt without a reviewed answer is dismissed. */
|
|
455
|
+
export declare function dialoganswer(policy: dialogpolicy, dialog: "confirm" | "alert" | "prompt"): {
|
|
456
|
+
accept: boolean;
|
|
457
|
+
answer?: string;
|
|
458
|
+
};
|
|
459
|
+
/** Reads and clears the dialog log the main world handler recorded on the shared document. */
|
|
460
|
+
export declare function harvestdialoglog(root: Document): observeddialog[];
|
|
461
|
+
/** Installs confirm, alert and prompt wrappers in the page main world answering per the reviewed policy; runs through chrome.scripting with world main. */
|
|
462
|
+
export declare function installdialoghandler(accept: boolean, answer: string, persistent: boolean): void;
|
|
463
|
+
/** Returns the active blackbox patterns of the page registry for the stack capture filters. */
|
|
464
|
+
export declare function activeblackboxpatterns(): string[];
|
|
465
|
+
/** Runs one reviewed emulation step inside the page: the family of the kind decides the mask, the prior state is captured for the exact revert and the honest derivation note stays beside the result. */
|
|
466
|
+
export declare function runemulationstep(step: toolstep): Promise<stepresult>;
|
|
467
|
+
/** Reverts one emulation layer inside the page by restoring the captured prior state; the revert is idempotent for a context the navigation already destroyed. */
|
|
468
|
+
export declare function revertemulationlayer(family: string, prior: Record<string, unknown> | undefined): {
|
|
469
|
+
ok: boolean;
|
|
470
|
+
summary: string;
|
|
471
|
+
};
|
|
472
|
+
/**
|
|
473
|
+
* Form field logics for reviewed steps.
|
|
474
|
+
* Every correlated rule for field matching, field kind classification, seeded value generation, native value fills, honeypot detection, login and template detection, error association and form record parsing lives in this file.
|
|
475
|
+
*/
|
|
476
|
+
/** One serializable form field shape resolved against the page controls. */
|
|
477
|
+
export interface fieldshape {
|
|
478
|
+
selector: string;
|
|
479
|
+
tag: string;
|
|
480
|
+
type: string;
|
|
481
|
+
name: string;
|
|
482
|
+
label: string;
|
|
483
|
+
placeholder: string;
|
|
484
|
+
arialabel: string;
|
|
485
|
+
autocomplete: string;
|
|
486
|
+
options?: string[];
|
|
487
|
+
}
|
|
488
|
+
/** One surveyed field shape carrying the visibility, geometry and timing evidence the honeypot detector reads. */
|
|
489
|
+
export interface fieldsurvey extends fieldshape {
|
|
490
|
+
hidden: boolean;
|
|
491
|
+
offscreen: boolean;
|
|
492
|
+
createdat?: number;
|
|
493
|
+
}
|
|
494
|
+
/** One honeypot field flagged by hidden, offscreen or time trap evidence. */
|
|
495
|
+
export interface honeypotevidence {
|
|
496
|
+
selector: string;
|
|
497
|
+
reason: "hidden" | "offscreen" | "timetrap";
|
|
498
|
+
}
|
|
499
|
+
/** One surveyed field with the aria describedby ref and the sibling message texts the error reader associates. */
|
|
500
|
+
export interface errorcontext extends fieldshape {
|
|
501
|
+
describedby?: string;
|
|
502
|
+
siblings: string[];
|
|
503
|
+
}
|
|
504
|
+
/** Resolves controls by label, placeholder, aria label and name attributes; matches are case insensitive substrings. */
|
|
505
|
+
export declare function matchfield(fields: fieldshape[], match: fieldmatch): fieldshape[];
|
|
506
|
+
/** Infers the field kind of one control from its input type, autocomplete hint and label text. */
|
|
507
|
+
export declare function classifyfield(input: {
|
|
508
|
+
type: string;
|
|
509
|
+
autocomplete: string;
|
|
510
|
+
label: string;
|
|
511
|
+
}): fieldkind;
|
|
512
|
+
/** Generates one realistic value for a field kind, deterministically seeded and locale aware for names, emails and phones. */
|
|
513
|
+
export declare function generatevalue(kind: fieldkind, rule: {
|
|
514
|
+
locale?: string;
|
|
515
|
+
seed?: number;
|
|
516
|
+
}): string;
|
|
517
|
+
/** Builds a deterministic values hash of the reviewed field values a submission ticket records. */
|
|
518
|
+
export declare function valueshash(values: Array<{
|
|
519
|
+
label: string;
|
|
520
|
+
value: string;
|
|
521
|
+
}>): string;
|
|
522
|
+
/** Parses the reviewed structured form record of a step; null when the step reviews none or the shape is invalid. */
|
|
523
|
+
export declare function parseformrecord(value: unknown): formrecord | null;
|
|
524
|
+
/** Builds form record entries from reviewed label or placeholder value pairs. */
|
|
525
|
+
export declare function pairentries(pairs: Array<{
|
|
526
|
+
label?: string;
|
|
527
|
+
placeholder?: string;
|
|
528
|
+
value: string;
|
|
529
|
+
}>, mode: "label" | "placeholder"): formrecord;
|
|
530
|
+
/** One fill operation outcome: the entry, the matched control, the honeypot skip flag or the refusal reason. */
|
|
531
|
+
export interface filloutcome {
|
|
532
|
+
entry: formentry;
|
|
533
|
+
matched?: fieldshape;
|
|
534
|
+
skipped?: boolean;
|
|
535
|
+
reason?: string;
|
|
536
|
+
}
|
|
537
|
+
/** Resolves every entry of a form record against the surveyed fields, skipping honeypots and refusing unmatched or ambiguous entries. */
|
|
538
|
+
export declare function filloperations(record: formrecord, fields: fieldshape[], skippedselectors?: string[]): filloutcome[];
|
|
539
|
+
/** Masks one card segment so side panels can render card fills without exposing the full value. */
|
|
540
|
+
export declare function cardmask(value: string): string;
|
|
541
|
+
/** Flags hidden, offscreen and time trap fields so fill steps skip them instead of tripping anti bot defenses. */
|
|
542
|
+
export declare function detecthoneypots(surveys: fieldsurvey[], loadedat: number): honeypotevidence[];
|
|
543
|
+
/** Detects a login form: a password field plus an identifier field with session links nearby. */
|
|
544
|
+
export declare function detectlogin(fields: fieldshape[], links: string[]): {
|
|
545
|
+
login: boolean;
|
|
546
|
+
markers: string[];
|
|
547
|
+
};
|
|
548
|
+
/** Detects signup and checkout templates by matching the field labels, autocompletes and page text against known markers. */
|
|
549
|
+
export declare function detecttemplate(fields: fieldshape[], text: string): {
|
|
550
|
+
template: "signup" | "checkout" | "unknown";
|
|
551
|
+
markers: string[];
|
|
552
|
+
};
|
|
553
|
+
/** Associates validation messages with fields through aria describedby refs and the sibling text next to each field. */
|
|
554
|
+
export declare function associateerrors(contexts: errorcontext[], messages: Array<{
|
|
555
|
+
id?: string;
|
|
556
|
+
text: string;
|
|
557
|
+
}>): fielderror[];
|
|
558
|
+
/** Resolves one reviewed artifact name against the run store before a file input is filled. */
|
|
559
|
+
export declare function attachplan(name: string, artifacts: Array<{
|
|
560
|
+
id: string;
|
|
561
|
+
name: string;
|
|
562
|
+
kind: string;
|
|
563
|
+
}>): {
|
|
564
|
+
artifact?: {
|
|
565
|
+
id: string;
|
|
566
|
+
name: string;
|
|
567
|
+
kind: string;
|
|
568
|
+
};
|
|
569
|
+
reason?: string;
|
|
570
|
+
};
|
|
571
|
+
/** Selectors the captcha detector probes; a hit hands control back to the user instead of forcing the page. */
|
|
572
|
+
export declare const captchamarkers: string[];
|
|
573
|
+
/** True when any captcha marker matched, so the plan pauses and hands control to the user. */
|
|
574
|
+
export declare function captchadetected(matched: string[]): boolean;
|
|
575
|
+
/** Fills one control through the native setter with input and change eventsforms; checks, radios and selects use their own grammar. */
|
|
576
|
+
export declare function fillcontrol(element: Element, entry: formentry): boolean;
|
|
577
|
+
/** Runs one reviewed forms and data step inside the page: fills, surveys, detects and reads errors without leaving the form scope. */
|
|
578
|
+
export declare function runpageform(step: toolstep, target: Element | null, root?: Document): stepresult | Promise<stepresult>;
|
|
579
|
+
/** Extracts the reviewed inner step of a retry or frame wrapper from its inline options. */
|
|
580
|
+
export declare function innerstep(step: toolstep): toolstep | null;
|
|
581
|
+
export interface retryoutcomeplan {
|
|
582
|
+
ok: boolean;
|
|
583
|
+
attempts: number;
|
|
584
|
+
movement: number;
|
|
585
|
+
summary: string;
|
|
586
|
+
}
|
|
587
|
+
/** Runs the reviewed retry loop: each failed attempt waits the settle window, revalidates the target geometry and reruns only when the element moved beyond the tolerance. */
|
|
588
|
+
export declare function runretries(rule: retryrule, probe: () => Promise<{
|
|
589
|
+
x: number;
|
|
590
|
+
y: number;
|
|
591
|
+
} | null>, execute: (attempt: number) => Promise<{
|
|
592
|
+
ok: boolean;
|
|
593
|
+
summary: string;
|
|
594
|
+
}>): Promise<retryoutcomeplan>;
|
|
595
|
+
/** Runs one resolution driven interaction: text, aria and name clicks, shadow piercing and frame routing. */
|
|
596
|
+
export declare function runinteractstep(step: toolstep, expectedorigin: string, dispatch: (inner: toolstep, origin: string, root?: Document) => stepresult | Promise<stepresult>): stepresult | Promise<stepresult>;
|
|
597
|
+
/**
|
|
598
|
+
* Page navigation logics for reviewed steps.
|
|
599
|
+
* Every correlated rule for navigation targets, container resolution, waitnav profiles, url patterns, link following, spa routing, query rewriting, deep links and recent tabs lives in this file.
|
|
600
|
+
*/
|
|
601
|
+
/** One link shape matched by followlink and spanav, serializable for fixtures. */
|
|
602
|
+
export interface linkshape {
|
|
603
|
+
text: string;
|
|
604
|
+
href: string;
|
|
605
|
+
selector: string;
|
|
606
|
+
}
|
|
607
|
+
/** One collected load signal sample with the signals that held true at its time. */
|
|
608
|
+
export interface signalsample {
|
|
609
|
+
at: number;
|
|
610
|
+
signals: string[];
|
|
611
|
+
}
|
|
612
|
+
/** Resolved container plan of one navigation target across tabs, windows and private profiles. */
|
|
613
|
+
export interface containerplan {
|
|
614
|
+
kind: "current" | "tab" | "window" | "private";
|
|
615
|
+
incognito: boolean;
|
|
616
|
+
windowid?: number;
|
|
617
|
+
position: "adjacent" | "end";
|
|
618
|
+
}
|
|
619
|
+
/** Reads the reviewed navtarget of a navigation step; null when the step reviews none. */
|
|
620
|
+
export declare function parsenavtarget(step: toolstep): navtarget | null;
|
|
621
|
+
/** Resolves the container plan of one navigation target: the current task tab, a new tab, a new window or a private window profile separated from normal windows. */
|
|
622
|
+
export declare function resolvecontainer(target: navtarget, windows: Array<{
|
|
623
|
+
id: number;
|
|
624
|
+
incognito: boolean;
|
|
625
|
+
focused: boolean;
|
|
626
|
+
}>): containerplan;
|
|
627
|
+
/** Reads the reviewed waitprofile of a navprofile step; null when the step reviews none. */
|
|
628
|
+
export declare function parsewaitprofile(step: toolstep): waitprofile | null;
|
|
629
|
+
/** Resolves the effective signals and thresholds of one waitnav profile for an origin by folding the per origin overrides in. */
|
|
630
|
+
export declare function profilefororigin(profile: waitprofile, origin: string): {
|
|
631
|
+
signals: string[];
|
|
632
|
+
idle: number;
|
|
633
|
+
timeout: number;
|
|
634
|
+
};
|
|
635
|
+
/** Maps a document ready state onto the live navigation load phase. */
|
|
636
|
+
export declare function loadphase(readystate: string): "loading" | "interactive" | "complete";
|
|
637
|
+
/** Decides the waitnav outcome of a waitnav profile from collected load signal samples: every required signal must hold in the latest sample inside the timeout. */
|
|
638
|
+
export declare function evaluatesignals(required: string[], samples: signalsample[], timeout: number): {
|
|
639
|
+
ok: boolean;
|
|
640
|
+
satisfied: string[];
|
|
641
|
+
waited: number;
|
|
642
|
+
samples: number;
|
|
643
|
+
};
|
|
644
|
+
/** Reads the reviewed urlpattern of a waiturl, spanav or spawait step; null when the step reviews none. */
|
|
645
|
+
export declare function parseurlpattern(step: toolstep, key?: string): urlpattern | null;
|
|
646
|
+
/** Matches one url against a reviewed urlpattern by mode plus required query and fragment parts. */
|
|
647
|
+
export declare function urlmatches(url: string, pattern: urlpattern): boolean;
|
|
648
|
+
/** Result of one query rewrite with the parameters read, written and the new url. */
|
|
649
|
+
export interface queryrewriteoutcome {
|
|
650
|
+
url: string;
|
|
651
|
+
before: Record<string, string>;
|
|
652
|
+
after: Record<string, string>;
|
|
653
|
+
set: string[];
|
|
654
|
+
removed: string[];
|
|
655
|
+
}
|
|
656
|
+
/** Rewrites the query parameters of one url: reviewed values are set, reviewed names removed and the rest preserved. */
|
|
657
|
+
export declare function rewritequeryurl(url: string, set: Record<string, string>, remove: string[]): queryrewriteoutcome;
|
|
658
|
+
/** Applies one reviewed fragment to a url, keeping every other part untouched. */
|
|
659
|
+
export declare function fragmenturl(url: string, fragment: string): string;
|
|
660
|
+
/** Matches links by their visible text, case insensitively, refusing ambiguity through multiple matches. */
|
|
661
|
+
export declare function matchlinktext(links: linkshape[], text: string): linkshape[];
|
|
662
|
+
/** Matches links by their href fragment when the reviewed option asks for fragment resolution. */
|
|
663
|
+
export declare function matchlinkfragment(links: linkshape[], fragment: string): linkshape[];
|
|
664
|
+
/** Builds a deep link into a common web app from a reviewed app pattern and its string params; unknown apps are refused. */
|
|
665
|
+
export declare function deeplinkurl(app: string, params: Record<string, string>): string | null;
|
|
666
|
+
/** True when the current url of a single page app changed without a reload, keeping the origin. */
|
|
667
|
+
export declare function spauroutechanged(previousurl: string, currenturl: string): boolean;
|
|
668
|
+
/** Picks the most recently closed tab whose url is no longer open; null when every recent tab is already restored. */
|
|
669
|
+
export declare function pickrecenttab(recenttabs: Array<{
|
|
670
|
+
url: string;
|
|
671
|
+
tabid: number;
|
|
672
|
+
closedat: number;
|
|
673
|
+
}>, openurls: string[]): {
|
|
674
|
+
url: string;
|
|
675
|
+
tabid: number;
|
|
676
|
+
closedat: number;
|
|
677
|
+
} | null;
|
|
678
|
+
/** Runs one reviewed page navigation kind inside the page world. */
|
|
679
|
+
export declare function runpagenav(step: toolstep, root?: Document): stepresult | Promise<stepresult>;
|
|
680
|
+
/**
|
|
681
|
+
* Navigation network state logics for reviewed steps.
|
|
682
|
+
* Every correlated rule for redirect chain assembly, http error and interstitial classification, per domain rate limit windows, url safety verdicts, curated batch lists, prefetch verification, preconnect origins and basic auth credential gating lives in this file.
|
|
683
|
+
*/
|
|
684
|
+
/** One navigation watch event as observed from browser navigation listeners, serializable for fixtures. */
|
|
685
|
+
export interface navwatchevent {
|
|
686
|
+
event: "beforenavigate" | "committed" | "completed" | "error" | "urlchange";
|
|
687
|
+
url: string;
|
|
688
|
+
timestamp: number;
|
|
689
|
+
status?: number;
|
|
690
|
+
redirect?: boolean;
|
|
691
|
+
error?: string;
|
|
692
|
+
}
|
|
693
|
+
/** Assembles one redirect chain from navigation watch events: successive url changes become hops with statuses and timing, and the chain closes on completion or error. */
|
|
694
|
+
export declare function buildredirectchain(events: navwatchevent[]): redirectchain;
|
|
695
|
+
/** Returns the final url of a redirect chain: the url of its last hop. */
|
|
696
|
+
export declare function finalurl(chain: redirectchain): string;
|
|
697
|
+
/** Counts the redirect hops of a chain, ignoring the first and the final urls when no intermediary hop exists. */
|
|
698
|
+
export declare function redirectcount(chain: redirectchain): number;
|
|
699
|
+
/** Classifies a navigation url change: a full load, a spa route change without reload, a reload or no change. */
|
|
700
|
+
export declare function classifynavchange(previousurl: string, currenturl: string, status: string | undefined): "load" | "route" | "reload" | "none";
|
|
701
|
+
/** One classified http state of a navigation: http error, offline and certificate interstitial flags with reasons. */
|
|
702
|
+
export interface httpstate {
|
|
703
|
+
httperror: boolean;
|
|
704
|
+
offline: boolean;
|
|
705
|
+
certificate: boolean;
|
|
706
|
+
reasons: string[];
|
|
707
|
+
}
|
|
708
|
+
/** Detects the http error, offline and certificate interstitial states from the offline flag, error strings and observed statuses. */
|
|
709
|
+
export declare function detecthttpstate(input: {
|
|
710
|
+
offline: boolean;
|
|
711
|
+
errors?: string[];
|
|
712
|
+
statuses?: number[];
|
|
713
|
+
}): httpstate;
|
|
714
|
+
/** Applies the certificate interstitial policy: interstitials are reported for review, never bypassed. */
|
|
715
|
+
export declare function interstitialpolicy(state: httpstate): {
|
|
716
|
+
interstitial: boolean;
|
|
717
|
+
bypass: boolean;
|
|
718
|
+
guidance: string;
|
|
719
|
+
};
|
|
720
|
+
/** Reads the reviewed ratelimit of a navrate step; null when the step reviews none. */
|
|
721
|
+
export declare function parseratelimit(step: toolstep): ratelimit | null;
|
|
722
|
+
/** Reads the domain of a url for rate limit accounting. */
|
|
723
|
+
export declare function domainof(url: string): string;
|
|
724
|
+
/** Returns the live rate limit window state of one domain, opening a fresh window when the reviewed window has elapsed. */
|
|
725
|
+
export declare function ratewindow(state: ratelimitstate | undefined, limit: ratelimit, now: number): ratelimitstate;
|
|
726
|
+
/** Decides whether one more navigation fits inside the reviewed per domain rate limit window. */
|
|
727
|
+
export declare function rateallows(state: ratelimitstate, now: number): {
|
|
728
|
+
allowed: boolean;
|
|
729
|
+
remaining: number;
|
|
730
|
+
retryafter: number;
|
|
731
|
+
};
|
|
732
|
+
/** Records one navigation hit inside the live rate limit window of a domain. */
|
|
733
|
+
export declare function recordratehit(state: ratelimitstate, now: number): ratelimitstate;
|
|
734
|
+
/** Verifies one url for safety: HTTPS only, no embedded credentials and no private network or raw ip targets. */
|
|
735
|
+
export declare function checksafe(url: string): safetyverdict;
|
|
736
|
+
/** Builds the curated link list of a batchopen step from per url safety verdicts. */
|
|
737
|
+
export declare function curatelinks(urls: string[], verifier: (url: string) => safetyverdict): curatedlink[];
|
|
738
|
+
/** Splits a curated link list into the urls batch opening may open and the unsafe ones it refuses. */
|
|
739
|
+
export declare function batchopenset(links: curatedlink[]): {
|
|
740
|
+
open: string[];
|
|
741
|
+
refused: Array<{
|
|
742
|
+
url: string;
|
|
743
|
+
reasons: string[];
|
|
744
|
+
}>;
|
|
745
|
+
};
|
|
746
|
+
/** Verifies prefetch candidates against the session grants: only granted urls may be prefetched. */
|
|
747
|
+
export declare function prefetchcandidates(urls: string[], grants: string[]): {
|
|
748
|
+
allowed: string[];
|
|
749
|
+
refused: string[];
|
|
750
|
+
};
|
|
751
|
+
/** Deduplicates the preconnect origins of one preconnect step. */
|
|
752
|
+
export declare function preconnectorigins(origins: string[]): string[];
|
|
753
|
+
/** Finds the reviewed basic auth credentials of one origin; the auth flow refuses to run without them. */
|
|
754
|
+
export declare function authfor(auths: authrecord[], url: string): authrecord | undefined;
|
|
755
|
+
/**
|
|
756
|
+
* Semantic page observation for reviewed steps.
|
|
757
|
+
* Every correlated rule for the shadow and frame piercing walker, the accessibility tree, visible text, the reader heuristic, the heading outline, the selection read, open graph extraction, language detection and the shadow and frame inventories lives in this file.
|
|
758
|
+
*/
|
|
759
|
+
/** Serializable page node used by the observation engine; the live glue attaches the element. */
|
|
760
|
+
export interface pagenode {
|
|
761
|
+
tag: string;
|
|
762
|
+
selector: string;
|
|
763
|
+
id: string;
|
|
764
|
+
classes: string[];
|
|
765
|
+
role: string;
|
|
766
|
+
name: string;
|
|
767
|
+
text: string;
|
|
768
|
+
value: string;
|
|
769
|
+
states: string[];
|
|
770
|
+
hidden: boolean;
|
|
771
|
+
children: pagenode[];
|
|
772
|
+
element?: Element;
|
|
773
|
+
}
|
|
774
|
+
/** Builds the serializable page node tree, piercing open shadow roots and same origin iframes. */
|
|
775
|
+
export declare function buildpagetree(scope: ParentNode): pagenode;
|
|
776
|
+
/** Converts one page node tree into the accessibility tree with roles, names, states and child refs; hidden subtrees stay excluded. */
|
|
777
|
+
export declare function builda11ytree(node: pagenode): a11ynode;
|
|
778
|
+
/** Returns the rendered text of each visible element; hidden nodes and their subtrees stay excluded. */
|
|
779
|
+
export declare function visibleentries(node: pagenode): Array<{
|
|
780
|
+
selector: string;
|
|
781
|
+
text: string;
|
|
782
|
+
}>;
|
|
783
|
+
/** Joins the rendered text of every visible node into one stream. */
|
|
784
|
+
export declare function visibletext(node: pagenode): string;
|
|
785
|
+
/** Scores page nodes by text density and splits the densest article region into reader blocks, separating them from page chrome. */
|
|
786
|
+
export declare function buildreader(root: pagenode, title: string): readerarticle;
|
|
787
|
+
/** Returns the title and headings outline of the page. */
|
|
788
|
+
export declare function pageoutline(root: pagenode, title: string): {
|
|
789
|
+
title: string;
|
|
790
|
+
headings: Array<{
|
|
791
|
+
level: number;
|
|
792
|
+
text: string;
|
|
793
|
+
}>;
|
|
794
|
+
};
|
|
795
|
+
/** Reads the text of the current user selection through the document selection api. */
|
|
796
|
+
export declare function captureselection(root: {
|
|
797
|
+
getSelection?: () => {
|
|
798
|
+
toString(): string;
|
|
799
|
+
} | null;
|
|
800
|
+
}): {
|
|
801
|
+
text: string;
|
|
802
|
+
length: number;
|
|
803
|
+
};
|
|
804
|
+
/** Extracts open graph meta properties and structured data payloads; malformed structured payloads are refused and counted. */
|
|
805
|
+
export declare function opengraphfields(meta: Array<{
|
|
806
|
+
property: string;
|
|
807
|
+
name: string;
|
|
808
|
+
content: string;
|
|
809
|
+
}>, jsonld: string[]): {
|
|
810
|
+
graph: Record<string, string>;
|
|
811
|
+
structured: unknown[];
|
|
812
|
+
refused: number;
|
|
813
|
+
};
|
|
814
|
+
/** Detects the language of extracted text from stopword frequency; an undetermined text returns an empty code. */
|
|
815
|
+
export declare function detecttextlanguage(text: string): string;
|
|
816
|
+
/** Tags extracted text with its detected language code, routing it to the matching language stream. */
|
|
817
|
+
export declare function taglanguage(text: string): {
|
|
818
|
+
text: string;
|
|
819
|
+
language: string;
|
|
820
|
+
};
|
|
821
|
+
/** Resolves the page language from the document lang attribute, the content language meta and the content signals, in that order. */
|
|
822
|
+
export declare function documentlanguage(signals: {
|
|
823
|
+
lang: string;
|
|
824
|
+
meta: string;
|
|
825
|
+
text: string;
|
|
826
|
+
}): {
|
|
827
|
+
language: string;
|
|
828
|
+
source: string;
|
|
829
|
+
};
|
|
830
|
+
/** Lists the host paths of every open shadow root nested inside one scope tree. */
|
|
831
|
+
export declare function shadowpaths(scope: scopetree<candidatefields>): string[];
|
|
832
|
+
/** Enumerates the iframes of one document with their origins and sizes; cross origin frames report no origin. */
|
|
833
|
+
export declare function framelist(root: Document): Array<{
|
|
834
|
+
index: number;
|
|
835
|
+
origin: string;
|
|
836
|
+
sameorigin: boolean;
|
|
837
|
+
width: number;
|
|
838
|
+
height: number;
|
|
839
|
+
}>;
|
|
840
|
+
/** Runs one passive page observation after the background policy gate; frame routed steps receive their frame document as the root. */
|
|
841
|
+
export declare function runpageobservation(step: toolstep, target: Element | null, root?: Document): stepresult | Promise<stepresult>;
|
|
842
|
+
/**
|
|
843
|
+
* Pointer path and coordinate click logics for reviewed steps.
|
|
844
|
+
* Every correlated rule for waypoint interpolation, easing, jitter, hop settling, pointer sequences and coordinate clicks lives in this file.
|
|
845
|
+
*/
|
|
846
|
+
/** One interpolated pointer position with the settlepointer delay before it is dispatched. */
|
|
847
|
+
export interface pointerhop {
|
|
848
|
+
x: number;
|
|
849
|
+
y: number;
|
|
850
|
+
delay: number;
|
|
851
|
+
}
|
|
852
|
+
/** One planned pointer or mouse event of a coordinate click sequence. */
|
|
853
|
+
export interface plannedevent {
|
|
854
|
+
type: string;
|
|
855
|
+
eventkind: "pointer" | "mouse";
|
|
856
|
+
x: number;
|
|
857
|
+
y: number;
|
|
858
|
+
shift: boolean;
|
|
859
|
+
}
|
|
860
|
+
/** Interpolates one reviewed pointer path into settlepointer-delimited hops, honoring the reviewed easing, peak velocity and jitter window. */
|
|
861
|
+
export declare function pathhops(path: pointpath, profile: speedprofile | undefined, random?: () => number, cadence?: number): pointerhop[];
|
|
862
|
+
/** Builds the pointer event sequence around a reviewed path: pointerover, one pointermove per hop, then pointerout. */
|
|
863
|
+
export declare function pointersequence(hopcount: number): string[];
|
|
864
|
+
/** Builds the full pointer click sequence for reviewed coordinates and modifiers. */
|
|
865
|
+
export declare function clickplan(x: number, y: number, modifiers: string[]): plannedevent[];
|
|
866
|
+
/** Dispatches the full pointer click sequence on one element with the reviewed modifiers. */
|
|
867
|
+
export declare function dispatchclick(element: HTMLElement, modifiers?: string[]): void;
|
|
868
|
+
/** Scrolls one target into view before any pointer interaction. */
|
|
869
|
+
export declare function ensurevisible(element: HTMLElement): void;
|
|
870
|
+
/** Runs one reviewed pointer step: movepointer paths, clickpoint coordinate clicks and shiftclick modified clicks. */
|
|
871
|
+
export declare function runpointerstep(step: toolstep, resolution: stepresolution): stepresult | Promise<stepresult>;
|
|
872
|
+
/**
|
|
873
|
+
* Page-side profiling capture for the reviewed 1.1.47 steps.
|
|
874
|
+
* Correlated rules for the profiling option parsing live here while the flow, heap, cpu, shift, trace and source map math lives in the root profilers module: performance marks carry the step windows of the flow spec, the paint, navigation, longtask, layout shift and event buffers are observed for the reviewed window only, heap samples derive from the page performance memory buffer and the dom node count, and source map declarations are read from the loaded same origin scripts.
|
|
875
|
+
* Every measurement derives from the performance timeline buffers and the injected instrumentation probes through the scripting api, so no debugger permission exists anywhere in the manifest.
|
|
876
|
+
*/
|
|
877
|
+
/** Parses the reviewed profiling options of one profiling step; absent windows watch nothing and the depth of capture stays the reviewed window only. */
|
|
878
|
+
export declare function profilestepoptions(step: toolstep): {
|
|
879
|
+
flow?: {
|
|
880
|
+
prefix: string;
|
|
881
|
+
steps: string[];
|
|
882
|
+
metrics: string[];
|
|
883
|
+
};
|
|
884
|
+
watchwindow: number;
|
|
885
|
+
heapinterval: number;
|
|
886
|
+
growth?: {
|
|
887
|
+
slope: number;
|
|
888
|
+
interval: number;
|
|
889
|
+
};
|
|
890
|
+
duration: number;
|
|
891
|
+
threshold: number;
|
|
892
|
+
categories: string[];
|
|
893
|
+
exporttarget?: string;
|
|
894
|
+
traceid?: string;
|
|
895
|
+
scripts: string[];
|
|
896
|
+
};
|
|
897
|
+
declare function waitprofile(milliseconds: number): Promise<void>;
|
|
898
|
+
/** Runs one reviewed profiling step inside the page: the flow spec marks the start and end of every step in the window while the performance buffers feed the metric math of the root profilers module, the heap snapshot reads the memory buffer and the node count, the cpu window observes the long task and event timing samples, the layout shift watch scores the shifts of the window with their impacted selectors, the trace record categorizes the observed entries of the reviewed categories, and the source map capture reads the sourceMappingURL declarations of the loaded same origin scripts. */
|
|
899
|
+
export declare function runprofilestep(step: toolstep): Promise<stepresult>;
|
|
900
|
+
/** Runs one read-only page observation after the background policy gate. */
|
|
901
|
+
export declare function runpageread(step: toolstep, target: Element | null, root?: Document): stepresult | Promise<stepresult>;
|
|
902
|
+
/**
|
|
903
|
+
* Target resolution engine for reviewed steps.
|
|
904
|
+
* Every correlated rule for element summaries, targetref modes, ambiguity reports, shadow piercing, frame walking and the numbered clickable map lives in this file.
|
|
905
|
+
*/
|
|
906
|
+
/** Descriptive fields shared by every resolution candidate; the live dom glue attaches the element. */
|
|
907
|
+
export interface candidatefields {
|
|
908
|
+
tag: string;
|
|
909
|
+
id: string;
|
|
910
|
+
role: string;
|
|
911
|
+
name: string;
|
|
912
|
+
label: string;
|
|
913
|
+
text: string;
|
|
914
|
+
selector: string;
|
|
915
|
+
}
|
|
916
|
+
/** One live dom candidate: descriptive fields plus the element itself. */
|
|
917
|
+
export interface livecandidate extends candidatefields {
|
|
918
|
+
element: Element;
|
|
919
|
+
}
|
|
920
|
+
/** Serializable description of one document with nested frames; the glue attaches the live document. */
|
|
921
|
+
export interface framedescription {
|
|
922
|
+
frames: frameentry[];
|
|
923
|
+
live?: Document;
|
|
924
|
+
}
|
|
925
|
+
/** One nested frame: same origin frames expose their document, cross origin frames do not. */
|
|
926
|
+
export interface frameentry {
|
|
927
|
+
sameorigin: boolean;
|
|
928
|
+
document?: framedescription;
|
|
929
|
+
}
|
|
930
|
+
/** Serializable scope tree: one scope's candidates plus the open shadow scopes nested inside it. */
|
|
931
|
+
export interface scopetree<T extends candidatefields = livecandidate> {
|
|
932
|
+
host?: T;
|
|
933
|
+
candidates: T[];
|
|
934
|
+
shadows: scopetree<T>[];
|
|
935
|
+
}
|
|
936
|
+
export declare function clean(value: string): string;
|
|
937
|
+
/** Computes the accessible style label of an element from aria hints, linked labels, title and content. */
|
|
938
|
+
export declare function elementlabel(element: Element): string;
|
|
939
|
+
/** Computes the implicit aria role of common elements when no explicit role attribute exists. */
|
|
940
|
+
export declare function implicitrole(element: Element): string;
|
|
941
|
+
/** Builds the css selector that re-finds one element inside its document. */
|
|
942
|
+
export declare function elementselector(element: Element): string;
|
|
943
|
+
/** Own text of an element: only its direct text nodes, so parents do not shadow their children. */
|
|
944
|
+
export declare function owntext(element: Element): string;
|
|
945
|
+
/** Summarizes one live element into the candidate shape used by every resolution mode. */
|
|
946
|
+
export declare function summarize(element: Element): livecandidate;
|
|
947
|
+
/** Collects every clickable candidate in document order. */
|
|
948
|
+
export declare function collectclickable(root: ParentNode): livecandidate[];
|
|
949
|
+
/** Collects every element as a resolution candidate in document order. */
|
|
950
|
+
export declare function collectcandidates(root: ParentNode): livecandidate[];
|
|
951
|
+
/** Matches candidates whose visible own text or label equals or contains the reviewed text. */
|
|
952
|
+
export declare function matchtext<T extends candidatefields>(candidates: T[], text: string): T[];
|
|
953
|
+
/** Matches candidates by the aria role and accessible name pair. */
|
|
954
|
+
export declare function matcharia<T extends candidatefields>(candidates: T[], role: string, name: string): T[];
|
|
955
|
+
/** Matches candidates by accessible name, preferring clickable elements when several share one name. */
|
|
956
|
+
export declare function matchname<T extends candidatefields>(candidates: T[], name: string, clickable?: (candidate: T) => boolean): T[];
|
|
957
|
+
/** Matches one clickable map number; map numbers are one based and stable inside one observation version. */
|
|
958
|
+
export declare function matchindex<T extends candidatefields>(candidates: T[], index: number): T[];
|
|
959
|
+
/** Builds the numbered clickable map from clickable candidates in document order. */
|
|
960
|
+
export declare function buildclickablemap<T extends candidatefields>(candidates: T[], version: number, builtat?: number): clickablemap;
|
|
961
|
+
/** Describes the nested frame structure of one live document; cross origin frames stay opaque. */
|
|
962
|
+
export declare function describeframes(root: Document): framedescription;
|
|
963
|
+
/** Walks a reviewed frame path through same origin frames and refuses cross origin or absent hops. */
|
|
964
|
+
export declare function walkframepath(root: framedescription, path: number[]): {
|
|
965
|
+
ok: true;
|
|
966
|
+
document: framedescription;
|
|
967
|
+
} | {
|
|
968
|
+
ok: false;
|
|
969
|
+
reason: string;
|
|
970
|
+
};
|
|
971
|
+
/** Describes one document or shadow root scope with every nested open shadow scope. */
|
|
972
|
+
export declare function describescopes(root: ParentNode): scopetree;
|
|
973
|
+
/** Searches one scope tree depth first for candidates matching the predicate, piercing open shadow scopes recursively. */
|
|
974
|
+
export declare function piercescopes<T extends candidatefields>(scope: scopetree<T>, match: (candidate: T) => boolean): T[];
|
|
975
|
+
/** Resolves a reviewed selector chain through open shadow roots: each selector resolves inside the previous scope. */
|
|
976
|
+
export declare function queryshadowchain(root: ParentNode, selectors: string[]): Element | null;
|
|
977
|
+
/** Finds the first element matching a selector in the scope or any nested open shadow root. */
|
|
978
|
+
export declare function queryscoped(root: ParentNode, selector: string): Element | null;
|
|
979
|
+
/** Builds the matched element summary attached to step results for review. */
|
|
980
|
+
export declare function targetsummary(mode: targetmode, element: HTMLElement): resolvedtarget;
|
|
981
|
+
export type stepresolution = {
|
|
982
|
+
status: "none";
|
|
983
|
+
} | {
|
|
984
|
+
status: "resolved";
|
|
985
|
+
element: HTMLElement;
|
|
986
|
+
target: resolvedtarget;
|
|
987
|
+
} | {
|
|
988
|
+
status: "ambiguous";
|
|
989
|
+
mode: targetmode;
|
|
990
|
+
candidates: string[];
|
|
991
|
+
} | {
|
|
992
|
+
status: "absent";
|
|
993
|
+
mode?: targetmode;
|
|
994
|
+
};
|
|
995
|
+
/** Resolves the reviewed target of a step: the options targetref when present, otherwise the css target. */
|
|
996
|
+
export declare function resolvestep(step: toolstep, root: Document): stepresolution;
|
|
997
|
+
/**
|
|
998
|
+
* Page seam of the 1.1.49 session memory family: per tab scroll position, form state, local storage and cookie name capture plus the scroll and form restore.
|
|
999
|
+
* Every function stays self contained so the scripting api can serialize it into any granted tab; password fields never join a capture and cookie values never leave the page.
|
|
1000
|
+
*/
|
|
1001
|
+
/** Captures the reviewed sections of one tab: the scroll position, the form state of non password fields, the local storage pairs and the cookie names. */
|
|
1002
|
+
export declare function capturepagestate(sections: string[]): {
|
|
1003
|
+
scrollx: number;
|
|
1004
|
+
scrolly: number;
|
|
1005
|
+
forms: Array<{
|
|
1006
|
+
selector: string;
|
|
1007
|
+
value: string;
|
|
1008
|
+
}>;
|
|
1009
|
+
storagekeys: string[];
|
|
1010
|
+
storagevalues: string[];
|
|
1011
|
+
cookienames: string[];
|
|
1012
|
+
};
|
|
1013
|
+
/** Restores the scroll position and the form state of one reopened tab; the restore only touches the captured selectors of the saved record. */
|
|
1014
|
+
export declare function restorepagestate(state: {
|
|
1015
|
+
scrollx: number;
|
|
1016
|
+
scrolly: number;
|
|
1017
|
+
forms: Array<{
|
|
1018
|
+
selector: string;
|
|
1019
|
+
value: string;
|
|
1020
|
+
}>;
|
|
1021
|
+
}): {
|
|
1022
|
+
restored: number;
|
|
1023
|
+
summary: string;
|
|
1024
|
+
};
|
|
1025
|
+
/** Parsed watch options of one watch step: the mutationwatch fields plus the poll interval. */
|
|
1026
|
+
export type watchoptions = mutationwatch & {
|
|
1027
|
+
watchid: string;
|
|
1028
|
+
poll: number;
|
|
1029
|
+
};
|
|
1030
|
+
/** Parses the reviewed watch options of one watch step into its mutationwatch shape with a poll interval. */
|
|
1031
|
+
export declare function parsewatchoptions(step: toolstep, fallbackid: string): watchoptions;
|
|
1032
|
+
/** Batches mutation records so records arriving inside one throttle window flush to the bridge together. */
|
|
1033
|
+
export declare function batchmutations(records: mutationevent[], windowms: number): mutationevent[][];
|
|
1034
|
+
/** Measures how long the network has stayed quiet from the resource timing entries completed so far. */
|
|
1035
|
+
export declare function quietfor(entries: Array<{
|
|
1036
|
+
responseend: number;
|
|
1037
|
+
}>, now: number): number;
|
|
1038
|
+
/** Decides the network quiet outcome from collected probe samples against the reviewed idle threshold and timeout. */
|
|
1039
|
+
export declare function quietresolution(samples: Array<{
|
|
1040
|
+
at: number;
|
|
1041
|
+
quietfor: number;
|
|
1042
|
+
}>, idle: number, timeout: number): {
|
|
1043
|
+
ok: boolean;
|
|
1044
|
+
quietfor: number;
|
|
1045
|
+
waited: number;
|
|
1046
|
+
samples: number;
|
|
1047
|
+
};
|
|
1048
|
+
/** Serializable node summary the diff engine compares between observation versions. */
|
|
1049
|
+
export interface nodesummary {
|
|
1050
|
+
selector: string;
|
|
1051
|
+
tag: string;
|
|
1052
|
+
text: string;
|
|
1053
|
+
attributes: Record<string, string>;
|
|
1054
|
+
}
|
|
1055
|
+
/** Hashes one node summary into a stable digest used by the diff engine. */
|
|
1056
|
+
export declare function nodehash(summary: nodesummary): string;
|
|
1057
|
+
/** Diffs two node summary sets into added, removed and changed entries by hashing node summaries. */
|
|
1058
|
+
export declare function diffsummaries(base: nodesummary[], target: nodesummary[]): {
|
|
1059
|
+
added: diffentry[];
|
|
1060
|
+
removed: diffentry[];
|
|
1061
|
+
changed: diffentry[];
|
|
1062
|
+
};
|
|
1063
|
+
/** Scans inline script payloads for embedded json state; malformed payloads are refused and counted. */
|
|
1064
|
+
export declare function scanjson(scripts: Array<{
|
|
1065
|
+
src: string;
|
|
1066
|
+
type: string;
|
|
1067
|
+
id: string;
|
|
1068
|
+
content: string;
|
|
1069
|
+
}>): {
|
|
1070
|
+
states: jsonstate[];
|
|
1071
|
+
refused: number;
|
|
1072
|
+
};
|
|
1073
|
+
/** Ranks selector candidates of one element shape by stability: id, attribute, text and structural strategies. */
|
|
1074
|
+
export declare function rankselectors(shape: {
|
|
1075
|
+
id: string;
|
|
1076
|
+
tag: string;
|
|
1077
|
+
attributes: Record<string, string>;
|
|
1078
|
+
text: string;
|
|
1079
|
+
index: number;
|
|
1080
|
+
siblings: number;
|
|
1081
|
+
}): selectorcandidate[];
|
|
1082
|
+
/** Runs one watched observation after the background policy gate; the reviewed lifetime window bounds every watch. */
|
|
1083
|
+
export declare function runpagewatch(step: toolstep, target: Element | null, root?: Document): stepresult | Promise<stepresult>;
|
|
1084
|
+
/**
|
|
1085
|
+
* Wizard, dependent control and payment field logics for reviewed steps.
|
|
1086
|
+
* Every correlated rule for wizard tracking, dependent option waits, typeahead picks, calendar navigation, card segment typing, one time code sources and submission retry backoff lives in this file.
|
|
1087
|
+
*/
|
|
1088
|
+
/** Advances one wizard step, recording the completion signal of the executed step and the new step index. */
|
|
1089
|
+
export declare function wizardadvance(state: wizardstate, completed: boolean, at: number): wizardstate;
|
|
1090
|
+
/** True when the dependent child options finished loading after a parent selection changed their count. */
|
|
1091
|
+
export declare function dependentloaded(previouscount: number, currentcount: number): boolean;
|
|
1092
|
+
/** Picks the reviewed suggestion entry from a typeahead list, case insensitive; undefined when the entry is absent. */
|
|
1093
|
+
export declare function typeaheadpick(suggestions: string[], pick: string): string | undefined;
|
|
1094
|
+
/** Parses one reviewed yyyy-mm-dd date into its year, month and day parts; null when the form is invalid. */
|
|
1095
|
+
export declare function parsedateparts(value: string): {
|
|
1096
|
+
year: number;
|
|
1097
|
+
month: number;
|
|
1098
|
+
day: number;
|
|
1099
|
+
} | null;
|
|
1100
|
+
/** Plans the calendar navigation to the reviewed date: the month delta and the day cell to click. */
|
|
1101
|
+
export declare function calendarplan(view: {
|
|
1102
|
+
year: number;
|
|
1103
|
+
month: number;
|
|
1104
|
+
}, date: {
|
|
1105
|
+
year: number;
|
|
1106
|
+
month: number;
|
|
1107
|
+
day: number;
|
|
1108
|
+
}): {
|
|
1109
|
+
months: number;
|
|
1110
|
+
day: number;
|
|
1111
|
+
};
|
|
1112
|
+
/** Splits one card number into its typed groups so the filler pauses between groups. */
|
|
1113
|
+
export declare function cardgroups(number: string): string[];
|
|
1114
|
+
/** True when the reviewed one time code source is ready to deliver the code before typing. */
|
|
1115
|
+
export declare function codeready(source: string, value: string | undefined): boolean;
|
|
1116
|
+
/** One reviewed retry backoff rule with an attempt count, a waitwizards window and a growth factor, all user configured. */
|
|
1117
|
+
export interface backoffrule {
|
|
1118
|
+
attempts: number;
|
|
1119
|
+
wait: number;
|
|
1120
|
+
factor: number;
|
|
1121
|
+
}
|
|
1122
|
+
/** Parses the reviewed backoff rule of a retryform step; null when the step reviews none. */
|
|
1123
|
+
export declare function parsebackoff(step: toolstep): backoffrule | null;
|
|
1124
|
+
/** Computes the reviewed backoff windows between submission retries; no code ceiling applies. */
|
|
1125
|
+
export declare function backoffwaits(attempts: number, wait: number, factor: number): number[];
|
|
1126
|
+
/** Runs one reviewed wizard or payment field step inside the page, from multi step wizards to card segments and one time codes. */
|
|
1127
|
+
export declare function runpagewizard(step: toolstep, target: Element | null, root?: Document): stepresult | Promise<stepresult>;
|
|
1128
|
+
/**
|
|
1129
|
+
* Xpath resolution subset for reviewed steps.
|
|
1130
|
+
* Every correlated rule for expression parsing, node trees and evaluation of the supported xpath grammar lives in this file.
|
|
1131
|
+
* The engine supports absolute and descendant steps, tag or wildcard names, attribute predicates, text predicates and positional predicates.
|
|
1132
|
+
*/
|
|
1133
|
+
/** Serializable dom node used by the xpath engine; the live glue attaches the element. */
|
|
1134
|
+
export interface xnode {
|
|
1135
|
+
tag: string;
|
|
1136
|
+
attributes: Record<string, string>;
|
|
1137
|
+
text: string;
|
|
1138
|
+
children: xnode[];
|
|
1139
|
+
element?: Element;
|
|
1140
|
+
}
|
|
1141
|
+
type xpathpredicate = {
|
|
1142
|
+
kind: "attr";
|
|
1143
|
+
name: string;
|
|
1144
|
+
value?: string;
|
|
1145
|
+
contains?: boolean;
|
|
1146
|
+
} | {
|
|
1147
|
+
kind: "text";
|
|
1148
|
+
value: string;
|
|
1149
|
+
contains?: boolean;
|
|
1150
|
+
} | {
|
|
1151
|
+
kind: "position";
|
|
1152
|
+
index: number;
|
|
1153
|
+
};
|
|
1154
|
+
interface xpathstep {
|
|
1155
|
+
descendant: boolean;
|
|
1156
|
+
tag: string;
|
|
1157
|
+
predicates: xpathpredicate[];
|
|
1158
|
+
}
|
|
1159
|
+
/** Builds the serializable node tree of one live document for the xpath engine. */
|
|
1160
|
+
export declare function buildxtree(root: Document): xnode;
|
|
1161
|
+
/** Parses the reviewed xpath expression into evaluation steps; unsupported syntax is refused. */
|
|
1162
|
+
export declare function parsexpath(expression: string): xpathstep[];
|
|
1163
|
+
/** Evaluates the supported xpath subset against a serializable node tree and returns every matched node in document order. */
|
|
1164
|
+
export declare function evaluatexpath(root: xnode, expression: string): xnode[];
|
|
1165
|
+
export {};
|
|
1166
|
+
//# sourceMappingURL=page.d.ts.map
|