@webability/core 1.13.0 → 1.15.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/dom.cjs +33 -33
- package/dist/dom.js +33 -33
- package/dist/engine.cjs +34 -34
- package/dist/engine.d.cts +35 -1
- package/dist/engine.d.ts +35 -1
- package/dist/engine.js +34 -34
- package/dist/hostedFixJudge-DXYes7X1.d.cts +62 -0
- package/dist/hostedFixJudge-DXYes7X1.d.ts +62 -0
- package/dist/index.cjs +42 -42
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +42 -42
- package/dist/playwright.cjs +33 -33
- package/dist/playwright.js +33 -33
- package/package.json +1 -1
package/dist/engine.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { c as ScanIssue, m as JudgeOptions, I as InternalBug, q as JudgedEntry, P as PageLike } from './types-gjAJ8j0I.cjs';
|
|
2
|
+
import { d as FixJudgeTransport, f as FixJudgeVerdictKind } from './hostedFixJudge-DXYes7X1.cjs';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Visitor HTML (`input: { html, baseURL }`): what the page may fetch while the
|
|
@@ -217,6 +218,25 @@ interface EngineOptions {
|
|
|
217
218
|
* structural fixes, `verification` absent.
|
|
218
219
|
*/
|
|
219
220
|
verify?: boolean;
|
|
221
|
+
/**
|
|
222
|
+
* Hosted fix judge: the fixes the engine emits are sent to this injected
|
|
223
|
+
* transport (see `hostedFixJudgeTransport`) and come back as
|
|
224
|
+
* `EngineResult.judgedFixes`, one verdict per fix. The judge runs behind the
|
|
225
|
+
* transport, never in core. `fixes` itself is unchanged: the caller decides
|
|
226
|
+
* what an `apply: false` verdict means. Only for a page the engine loaded by
|
|
227
|
+
* URL (`{ url }` or `{ loaded: true }`): the judge loads that public URL
|
|
228
|
+
* itself, so html/snapshot input is skipped with a warning. `timeoutMs` bounds
|
|
229
|
+
* each call (up to ceil(fixes / 20) sequential calls), not the whole stage;
|
|
230
|
+
* default 160 s.
|
|
231
|
+
*/
|
|
232
|
+
fixJudge?: {
|
|
233
|
+
transport: FixJudgeTransport;
|
|
234
|
+
viewport?: {
|
|
235
|
+
width: number;
|
|
236
|
+
height: number;
|
|
237
|
+
};
|
|
238
|
+
timeoutMs?: number;
|
|
239
|
+
};
|
|
220
240
|
/** Axe runs verification may spend isolating regressions. Default 40. */
|
|
221
241
|
verifyMaxAxeRuns?: number;
|
|
222
242
|
/** HTTP status of the main document when the caller navigated. */
|
|
@@ -384,6 +404,18 @@ interface EngineStats {
|
|
|
384
404
|
/** Capabilities the injected Page lacked and what was skipped because of it. */
|
|
385
405
|
warnings: string[];
|
|
386
406
|
}
|
|
407
|
+
/** One emitted fix with the hosted judge's verdict. `apply` is true only for `correct_needed`; every failure is `unclear` + `apply: false`. */
|
|
408
|
+
interface JudgedFix {
|
|
409
|
+
sel: string;
|
|
410
|
+
attr: string;
|
|
411
|
+
val: string;
|
|
412
|
+
issueType: string;
|
|
413
|
+
verdict: FixJudgeVerdictKind;
|
|
414
|
+
apply: boolean;
|
|
415
|
+
/** wrong_value only: the value the judge says would be right. */
|
|
416
|
+
suggestedValue?: string;
|
|
417
|
+
reason: string;
|
|
418
|
+
}
|
|
387
419
|
interface EngineResult {
|
|
388
420
|
url: string;
|
|
389
421
|
issues: EngineIssue[];
|
|
@@ -393,6 +425,8 @@ interface EngineResult {
|
|
|
393
425
|
findings: EngineFinding[];
|
|
394
426
|
internal_bugs: InternalBug[];
|
|
395
427
|
stats: EngineStats;
|
|
428
|
+
/** The hosted fix judge's verdict on each emitted fix, in `fixes` order (`opts.fixJudge`). Absent when no judge was set or it was skipped (see `stats.warnings`). */
|
|
429
|
+
judgedFixes?: JudgedFix[];
|
|
396
430
|
/** Verdicts of core's in-scan judge (`opts.scan.judge`) on findings the engines could not decide. */
|
|
397
431
|
judged?: JudgedEntry[];
|
|
398
432
|
/** Set when the target was a bot challenge, auth wall or HTTP error: nothing real was scanned. */
|
|
@@ -843,4 +877,4 @@ interface SelectorQualityResult {
|
|
|
843
877
|
declare const BARE_TAGS: Set<string>;
|
|
844
878
|
declare function scoreSelectorQuality(selector: string): SelectorQualityResult;
|
|
845
879
|
|
|
846
|
-
export { BARE_TAGS, type EngineFinding, type EngineFix, type EngineInput, type EngineIssue, type EngineOptions, type EngineResult, type EngineStats, FORM_CONTROL_ROLES, type HazardElementView, type HtmlDecision, type HtmlRequest, type HtmlRequestPolicy, InternalBug, LABEL_IN_NAME_JS, type Model, type ModelRequest, type ModelResponse, type Page, type PlaywrightPageLike, type ProtectedScope, type PuppeteerPageLike, SERVED_FIX_KEYS, TOKEN_QUERY_KEY, classifyFixRisk, detectPageLanguage, dropHazardousHidingFixes, foldContains, foldLabel, fromPlaywright, fromPuppeteer, htmlRequestPolicy, isHidingFix, isHtmlLangFix, isInteractiveOrContainsFocusable, isLabelText, labelContainsText, labelInNameCheck, languageFromText, languageFromUrl, loadSnapshot, normalizeVisibleText, parseContext, primaryLanguage, runEngine, scoreSelectorQuality, selectorParses, toPageLike, validateAttribute, validateFix, validateRoleValue, validateSelector, validateSelectorForAttribute, validateTextValue };
|
|
880
|
+
export { BARE_TAGS, type EngineFinding, type EngineFix, type EngineInput, type EngineIssue, type EngineOptions, type EngineResult, type EngineStats, FORM_CONTROL_ROLES, type HazardElementView, type HtmlDecision, type HtmlRequest, type HtmlRequestPolicy, InternalBug, type JudgedFix, LABEL_IN_NAME_JS, type Model, type ModelRequest, type ModelResponse, type Page, type PlaywrightPageLike, type ProtectedScope, type PuppeteerPageLike, SERVED_FIX_KEYS, TOKEN_QUERY_KEY, classifyFixRisk, detectPageLanguage, dropHazardousHidingFixes, foldContains, foldLabel, fromPlaywright, fromPuppeteer, htmlRequestPolicy, isHidingFix, isHtmlLangFix, isInteractiveOrContainsFocusable, isLabelText, labelContainsText, labelInNameCheck, languageFromText, languageFromUrl, loadSnapshot, normalizeVisibleText, parseContext, primaryLanguage, runEngine, scoreSelectorQuality, selectorParses, toPageLike, validateAttribute, validateFix, validateRoleValue, validateSelector, validateSelectorForAttribute, validateTextValue };
|
package/dist/engine.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { c as ScanIssue, m as JudgeOptions, I as InternalBug, q as JudgedEntry, P as PageLike } from './types-gjAJ8j0I.js';
|
|
2
|
+
import { d as FixJudgeTransport, f as FixJudgeVerdictKind } from './hostedFixJudge-DXYes7X1.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Visitor HTML (`input: { html, baseURL }`): what the page may fetch while the
|
|
@@ -217,6 +218,25 @@ interface EngineOptions {
|
|
|
217
218
|
* structural fixes, `verification` absent.
|
|
218
219
|
*/
|
|
219
220
|
verify?: boolean;
|
|
221
|
+
/**
|
|
222
|
+
* Hosted fix judge: the fixes the engine emits are sent to this injected
|
|
223
|
+
* transport (see `hostedFixJudgeTransport`) and come back as
|
|
224
|
+
* `EngineResult.judgedFixes`, one verdict per fix. The judge runs behind the
|
|
225
|
+
* transport, never in core. `fixes` itself is unchanged: the caller decides
|
|
226
|
+
* what an `apply: false` verdict means. Only for a page the engine loaded by
|
|
227
|
+
* URL (`{ url }` or `{ loaded: true }`): the judge loads that public URL
|
|
228
|
+
* itself, so html/snapshot input is skipped with a warning. `timeoutMs` bounds
|
|
229
|
+
* each call (up to ceil(fixes / 20) sequential calls), not the whole stage;
|
|
230
|
+
* default 160 s.
|
|
231
|
+
*/
|
|
232
|
+
fixJudge?: {
|
|
233
|
+
transport: FixJudgeTransport;
|
|
234
|
+
viewport?: {
|
|
235
|
+
width: number;
|
|
236
|
+
height: number;
|
|
237
|
+
};
|
|
238
|
+
timeoutMs?: number;
|
|
239
|
+
};
|
|
220
240
|
/** Axe runs verification may spend isolating regressions. Default 40. */
|
|
221
241
|
verifyMaxAxeRuns?: number;
|
|
222
242
|
/** HTTP status of the main document when the caller navigated. */
|
|
@@ -384,6 +404,18 @@ interface EngineStats {
|
|
|
384
404
|
/** Capabilities the injected Page lacked and what was skipped because of it. */
|
|
385
405
|
warnings: string[];
|
|
386
406
|
}
|
|
407
|
+
/** One emitted fix with the hosted judge's verdict. `apply` is true only for `correct_needed`; every failure is `unclear` + `apply: false`. */
|
|
408
|
+
interface JudgedFix {
|
|
409
|
+
sel: string;
|
|
410
|
+
attr: string;
|
|
411
|
+
val: string;
|
|
412
|
+
issueType: string;
|
|
413
|
+
verdict: FixJudgeVerdictKind;
|
|
414
|
+
apply: boolean;
|
|
415
|
+
/** wrong_value only: the value the judge says would be right. */
|
|
416
|
+
suggestedValue?: string;
|
|
417
|
+
reason: string;
|
|
418
|
+
}
|
|
387
419
|
interface EngineResult {
|
|
388
420
|
url: string;
|
|
389
421
|
issues: EngineIssue[];
|
|
@@ -393,6 +425,8 @@ interface EngineResult {
|
|
|
393
425
|
findings: EngineFinding[];
|
|
394
426
|
internal_bugs: InternalBug[];
|
|
395
427
|
stats: EngineStats;
|
|
428
|
+
/** The hosted fix judge's verdict on each emitted fix, in `fixes` order (`opts.fixJudge`). Absent when no judge was set or it was skipped (see `stats.warnings`). */
|
|
429
|
+
judgedFixes?: JudgedFix[];
|
|
396
430
|
/** Verdicts of core's in-scan judge (`opts.scan.judge`) on findings the engines could not decide. */
|
|
397
431
|
judged?: JudgedEntry[];
|
|
398
432
|
/** Set when the target was a bot challenge, auth wall or HTTP error: nothing real was scanned. */
|
|
@@ -843,4 +877,4 @@ interface SelectorQualityResult {
|
|
|
843
877
|
declare const BARE_TAGS: Set<string>;
|
|
844
878
|
declare function scoreSelectorQuality(selector: string): SelectorQualityResult;
|
|
845
879
|
|
|
846
|
-
export { BARE_TAGS, type EngineFinding, type EngineFix, type EngineInput, type EngineIssue, type EngineOptions, type EngineResult, type EngineStats, FORM_CONTROL_ROLES, type HazardElementView, type HtmlDecision, type HtmlRequest, type HtmlRequestPolicy, InternalBug, LABEL_IN_NAME_JS, type Model, type ModelRequest, type ModelResponse, type Page, type PlaywrightPageLike, type ProtectedScope, type PuppeteerPageLike, SERVED_FIX_KEYS, TOKEN_QUERY_KEY, classifyFixRisk, detectPageLanguage, dropHazardousHidingFixes, foldContains, foldLabel, fromPlaywright, fromPuppeteer, htmlRequestPolicy, isHidingFix, isHtmlLangFix, isInteractiveOrContainsFocusable, isLabelText, labelContainsText, labelInNameCheck, languageFromText, languageFromUrl, loadSnapshot, normalizeVisibleText, parseContext, primaryLanguage, runEngine, scoreSelectorQuality, selectorParses, toPageLike, validateAttribute, validateFix, validateRoleValue, validateSelector, validateSelectorForAttribute, validateTextValue };
|
|
880
|
+
export { BARE_TAGS, type EngineFinding, type EngineFix, type EngineInput, type EngineIssue, type EngineOptions, type EngineResult, type EngineStats, FORM_CONTROL_ROLES, type HazardElementView, type HtmlDecision, type HtmlRequest, type HtmlRequestPolicy, InternalBug, type JudgedFix, LABEL_IN_NAME_JS, type Model, type ModelRequest, type ModelResponse, type Page, type PlaywrightPageLike, type ProtectedScope, type PuppeteerPageLike, SERVED_FIX_KEYS, TOKEN_QUERY_KEY, classifyFixRisk, detectPageLanguage, dropHazardousHidingFixes, foldContains, foldLabel, fromPlaywright, fromPuppeteer, htmlRequestPolicy, isHidingFix, isHtmlLangFix, isInteractiveOrContainsFocusable, isLabelText, labelContainsText, labelInNameCheck, languageFromText, languageFromUrl, loadSnapshot, normalizeVisibleText, parseContext, primaryLanguage, runEngine, scoreSelectorQuality, selectorParses, toPageLike, validateAttribute, validateFix, validateRoleValue, validateSelector, validateSelectorForAttribute, validateTextValue };
|