@enricai/barnacle 1.12.82 → 1.14.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/lib/ats-field-vocabulary.d.ts.map +1 -1
- package/dist/lib/ats-field-vocabulary.js +86 -3
- package/dist/lib/ats-field-vocabulary.js.map +1 -1
- package/dist/lib/llm/judges/verify-step-advanced.d.ts +1 -1
- package/dist/lib/llm/judges/verify-step-advanced.d.ts.map +1 -1
- package/dist/lib/llm/judges/verify-step-advanced.js +3 -2
- package/dist/lib/llm/judges/verify-step-advanced.js.map +1 -1
- package/dist/lib/llm/judges/verify-submit.d.ts +2 -2
- package/dist/lib/llm/judges/verify-submit.d.ts.map +1 -1
- package/dist/lib/llm/judges/verify-submit.js +17 -5
- package/dist/lib/llm/judges/verify-submit.js.map +1 -1
- package/dist/lib/logging.d.ts +14 -4
- package/dist/lib/logging.d.ts.map +1 -1
- package/dist/lib/logging.js +34 -25
- package/dist/lib/logging.js.map +1 -1
- package/dist/lib/random.d.ts +7 -3
- package/dist/lib/random.d.ts.map +1 -1
- package/dist/lib/random.js +27 -4
- package/dist/lib/random.js.map +1 -1
- package/dist/scraper/click-settle.d.ts +16 -7
- package/dist/scraper/click-settle.d.ts.map +1 -1
- package/dist/scraper/click-settle.js +31 -24
- package/dist/scraper/click-settle.js.map +1 -1
- package/dist/scraper/deep-locator-actuate.d.ts.map +1 -1
- package/dist/scraper/deep-locator-actuate.js +17 -1
- package/dist/scraper/deep-locator-actuate.js.map +1 -1
- package/dist/scraper/deep-locator-fake.js +1 -1
- package/dist/scraper/deep-locator-fake.js.map +1 -1
- package/dist/scraper/flow-runner.d.ts +139 -8
- package/dist/scraper/flow-runner.d.ts.map +1 -1
- package/dist/scraper/flow-runner.js +710 -316
- package/dist/scraper/flow-runner.js.map +1 -1
- package/dist/scraper/phantom-click.d.ts +45 -1
- package/dist/scraper/phantom-click.d.ts.map +1 -1
- package/dist/scraper/phantom-click.js +114 -10
- package/dist/scraper/phantom-click.js.map +1 -1
- package/dist/scraper/runtime-capture-store.d.ts +38 -0
- package/dist/scraper/runtime-capture-store.d.ts.map +1 -0
- package/dist/scraper/runtime-capture-store.js +103 -0
- package/dist/scraper/runtime-capture-store.js.map +1 -0
- package/dist/scraper/segmented-date-spinbutton.d.ts +13 -0
- package/dist/scraper/segmented-date-spinbutton.d.ts.map +1 -0
- package/dist/scraper/segmented-date-spinbutton.js +71 -0
- package/dist/scraper/segmented-date-spinbutton.js.map +1 -0
- package/dist/scripts/recon-browser.d.ts +0 -8
- package/dist/scripts/recon-browser.d.ts.map +1 -1
- package/dist/scripts/recon-browser.js +102 -50
- package/dist/scripts/recon-browser.js.map +1 -1
- package/dist/scripts/recon-generate.d.ts +11 -0
- package/dist/scripts/recon-generate.d.ts.map +1 -1
- package/dist/scripts/recon-generate.js +180 -53
- package/dist/scripts/recon-generate.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ats-field-vocabulary.d.ts","sourceRoot":"","sources":["../../src/lib/ats-field-vocabulary.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ats-field-vocabulary.d.ts","sourceRoot":"","sources":["../../src/lib/ats-field-vocabulary.ts"],"names":[],"mappings":"AAkHA;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQjF"}
|
|
@@ -8,13 +8,89 @@ exports.resolveCanonicalAtsFieldName = resolveCanonicalAtsFieldName;
|
|
|
8
8
|
* the same lookup key, so a single table covers both vocabularies.
|
|
9
9
|
*/
|
|
10
10
|
const ATS_FIELD_VOCABULARY = {
|
|
11
|
-
Phone: [
|
|
12
|
-
|
|
11
|
+
Phone: [
|
|
12
|
+
"mobile phone",
|
|
13
|
+
"mobile phone number",
|
|
14
|
+
"mobile number",
|
|
15
|
+
"mobile",
|
|
16
|
+
"phone number",
|
|
17
|
+
"phone no",
|
|
18
|
+
"phone",
|
|
19
|
+
"cell phone",
|
|
20
|
+
"cell phone number",
|
|
21
|
+
"cell number",
|
|
22
|
+
"cell",
|
|
23
|
+
"telephone",
|
|
24
|
+
"telephone number",
|
|
25
|
+
"primary phone",
|
|
26
|
+
"primary phone number",
|
|
27
|
+
"contact phone",
|
|
28
|
+
"contact phone number",
|
|
29
|
+
"contact number",
|
|
30
|
+
"home phone",
|
|
31
|
+
],
|
|
32
|
+
AddressLine: [
|
|
33
|
+
"address line 1",
|
|
34
|
+
"address line one",
|
|
35
|
+
"address line",
|
|
36
|
+
"address 1",
|
|
37
|
+
"address",
|
|
38
|
+
"street address",
|
|
39
|
+
"street address 1",
|
|
40
|
+
"street address line 1",
|
|
41
|
+
"street address line",
|
|
42
|
+
"street",
|
|
43
|
+
"street 1",
|
|
44
|
+
"home address",
|
|
45
|
+
"mailing address",
|
|
46
|
+
"residential address",
|
|
47
|
+
"current address",
|
|
48
|
+
"primary address",
|
|
49
|
+
],
|
|
13
50
|
PostalCode: ["zip", "zip code", "postal code"],
|
|
14
51
|
FirstName: ["legal first name", "first name", "given name"],
|
|
15
52
|
LastName: ["legal last name", "last name", "surname", "family name"],
|
|
16
53
|
};
|
|
17
54
|
const NORMALIZED_LOOKUP = new Map(Object.entries(ATS_FIELD_VOCABULARY).flatMap(([canonical, synonyms]) => synonyms.map((synonym) => [normalizeAtsLabel(synonym), canonical])));
|
|
55
|
+
const PHONE_KEY_WORDS = new Set(["phone", "mobile", "cell", "cellphone", "telephone", "tel"]);
|
|
56
|
+
const PHONE_QUALIFIER_WORDS = new Set([
|
|
57
|
+
"number",
|
|
58
|
+
"no",
|
|
59
|
+
"num",
|
|
60
|
+
"primary",
|
|
61
|
+
"home",
|
|
62
|
+
"contact",
|
|
63
|
+
"personal",
|
|
64
|
+
"main",
|
|
65
|
+
"preferred",
|
|
66
|
+
"daytime",
|
|
67
|
+
"1",
|
|
68
|
+
"one",
|
|
69
|
+
]);
|
|
70
|
+
const ADDRESS_KEY_WORDS = new Set(["address", "addr", "street"]);
|
|
71
|
+
const ADDRESS_QUALIFIER_WORDS = new Set([
|
|
72
|
+
"line",
|
|
73
|
+
"1",
|
|
74
|
+
"one",
|
|
75
|
+
"primary",
|
|
76
|
+
"home",
|
|
77
|
+
"mailing",
|
|
78
|
+
"residential",
|
|
79
|
+
"current",
|
|
80
|
+
"personal",
|
|
81
|
+
"permanent",
|
|
82
|
+
"physical",
|
|
83
|
+
"present",
|
|
84
|
+
]);
|
|
85
|
+
/**
|
|
86
|
+
* Whether every word of a label is the key word or a neutral qualifier, so
|
|
87
|
+
* "Cell Number" names the applicant's phone while "Phone Type" or
|
|
88
|
+
* "Employer Address" (a word outside the set) does not.
|
|
89
|
+
*/
|
|
90
|
+
function isOnlyWordsOf(normalized, keys, qualifiers) {
|
|
91
|
+
const words = normalized.split(" ");
|
|
92
|
+
return (words.some((word) => keys.has(word)) && words.every((w) => keys.has(w) || qualifiers.has(w)));
|
|
93
|
+
}
|
|
18
94
|
/**
|
|
19
95
|
* Splits camelCase and letter-digit boundaries and collapses punctuation so
|
|
20
96
|
* that human labels ("Mobile Phone") and automation ids ("phoneNumber")
|
|
@@ -37,6 +113,13 @@ function resolveCanonicalAtsFieldName(observedLabel) {
|
|
|
37
113
|
const normalized = normalizeAtsLabel(observedLabel);
|
|
38
114
|
if (normalized === "")
|
|
39
115
|
return null;
|
|
40
|
-
|
|
116
|
+
const listed = NORMALIZED_LOOKUP.get(normalized);
|
|
117
|
+
if (listed !== undefined)
|
|
118
|
+
return listed;
|
|
119
|
+
if (isOnlyWordsOf(normalized, PHONE_KEY_WORDS, PHONE_QUALIFIER_WORDS))
|
|
120
|
+
return "Phone";
|
|
121
|
+
if (isOnlyWordsOf(normalized, ADDRESS_KEY_WORDS, ADDRESS_QUALIFIER_WORDS))
|
|
122
|
+
return "AddressLine";
|
|
123
|
+
return null;
|
|
41
124
|
}
|
|
42
125
|
//# sourceMappingURL=ats-field-vocabulary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ats-field-vocabulary.js","sourceRoot":"","sources":["../../src/lib/ats-field-vocabulary.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,MAAM,oBAAoB,GAA6B;IACrD,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ats-field-vocabulary.js","sourceRoot":"","sources":["../../src/lib/ats-field-vocabulary.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,MAAM,oBAAoB,GAA6B;IACrD,KAAK,EAAE;QACL,cAAc;QACd,qBAAqB;QACrB,eAAe;QACf,QAAQ;QACR,cAAc;QACd,UAAU;QACV,OAAO;QACP,YAAY;QACZ,mBAAmB;QACnB,aAAa;QACb,MAAM;QACN,WAAW;QACX,kBAAkB;QAClB,eAAe;QACf,sBAAsB;QACtB,eAAe;QACf,sBAAsB;QACtB,gBAAgB;QAChB,YAAY;KACb;IACD,WAAW,EAAE;QACX,gBAAgB;QAChB,kBAAkB;QAClB,cAAc;QACd,WAAW;QACX,SAAS;QACT,gBAAgB;QAChB,kBAAkB;QAClB,uBAAuB;QACvB,qBAAqB;QACrB,QAAQ;QACR,UAAU;QACV,cAAc;QACd,iBAAiB;QACjB,qBAAqB;QACrB,iBAAiB;QACjB,iBAAiB;KAClB;IACD,UAAU,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,aAAa,CAAC;IAC9C,SAAS,EAAE,CAAC,kBAAkB,EAAE,YAAY,EAAE,YAAY,CAAC;IAC3D,QAAQ,EAAE,CAAC,iBAAiB,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,CAAC;CACrE,CAAC;AAEF,MAAM,iBAAiB,GAAwB,IAAI,GAAG,CACpD,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE,EAAE,CACrE,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,iBAAiB,C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,EAAE,OAAO,CAAC;SACnC,WAAW,EAAE;SACb,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,IAAI,EAAE,CAAC;AACZ,CAAC;AAED;;;;GAIG;AACH,sCAA6C,aAAqB;IAChE,MAAM,UAAU,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAC;IACpD,IAAI,UAAU,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IACnC,MAAM,MAAM,GAAG,iBAAiB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACjD,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IACxC,IAAI,aAAa,CAAC,UAAU,EAAE,eAAe,EAAE,qBAAqB,CAAC;QAAE,OAAO,OAAO,CAAC;IACtF,IAAI,aAAa,CAAC,UAAU,EAAE,iBAAiB,EAAE,uBAAuB,CAAC;QAAE,OAAO,aAAa,CAAC;IAChG,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -9,7 +9,7 @@ import type Anthropic from "@anthropic-ai/sdk";
|
|
|
9
9
|
import type { z } from "zod/v4";
|
|
10
10
|
import { type JudgeCaptureFn } from "../judge";
|
|
11
11
|
import { STEP_ADVANCED_SCHEMA } from "../schemas";
|
|
12
|
-
declare const STEP_ADVANCED_SYSTEM_PROMPT = "You decide whether a browser-automated flow moved past a mid-flow step after a click. You are given the step instruction, the visible page text BEFORE the click, and the visible page text AFTER it.\n\nCompare which step is marked current (for example \"current step 2 of 7\") in the BEFORE text and in the AFTER text. Ignore step-list or progress-bar names that appear in both texts; they list steps and do not show where the flow is.\
|
|
12
|
+
declare const STEP_ADVANCED_SYSTEM_PROMPT = "You decide whether a browser-automated flow moved past a mid-flow step after a click. You are given the step instruction, the visible page text BEFORE the click, and the visible page text AFTER it.\n\nCompare which step is marked current (for example \"current step 2 of 7\") in the BEFORE text and in the AFTER text. Ignore step-list or progress-bar names that appear in both texts; they list steps and do not show where the flow is.\nBase the decision only on the visible page text, never on a document title. Set advanced=true when the AFTER text marks a different step as current, or shows a different heading with the fields the step asked to fill (present in the BEFORE text) gone.\nRequired-field markers (such as an asterisk) on a newly loaded step are not errors; they are the next step's normal empty form.\nSet advanced=false when the same step is still marked current, or when the AFTER text shows an explicit error summary or error message. Only an explicit error summary or message counts as failure.\nThe DOM invalid-marker count is not evidence in either direction: a newly loaded step's empty required fields are counted too, so never set advanced=false from the count alone.\nShared page chrome (header, cart badge, document title, step list) is not evidence in either direction. If the AFTER text shows content for a later view (for example a shopping-site cart page or the next form) and the asked-for fields are gone, set advanced=true even though the chrome looks the same as BEFORE.\nWhen ambiguous after applying that rule, set advanced=false.\nWrite one short sentence as the reason.";
|
|
13
13
|
/** Inputs for the step-advanced judge. */
|
|
14
14
|
export interface VerifyStepAdvancedInput {
|
|
15
15
|
stepInstruction: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-step-advanced.d.ts","sourceRoot":"","sources":["../../../../src/lib/llm/judges/verify-step-advanced.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAMzD,QAAA,MAAM,2BAA2B,
|
|
1
|
+
{"version":3,"file":"verify-step-advanced.d.ts","sourceRoot":"","sources":["../../../../src/lib/llm/judges/verify-step-advanced.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAMzD,QAAA,MAAM,2BAA2B,6kDASO,CAAC;AAEzC,0CAA0C;AAC1C,MAAM,WAAW,uBAAuB;IACtC,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAgBD;;;GAGG;AACH,wBAAsB,yBAAyB,CAAC,MAAM,EAAE;IACtD,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,KAAK,EAAE,uBAAuB,CAAC;IAC/B,SAAS,CAAC,EAAE,cAAc,CAAC;CAC5B,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,GAAG,IAAI,CAAC,CAgBvD;AAED,OAAO,EAAE,2BAA2B,EAAE,CAAC"}
|
|
@@ -17,9 +17,10 @@ const MAX_REASON_CHARS = 400;
|
|
|
17
17
|
const STEP_ADVANCED_SYSTEM_PROMPT = `You decide whether a browser-automated flow moved past a mid-flow step after a click. You are given the step instruction, the visible page text BEFORE the click, and the visible page text AFTER it.
|
|
18
18
|
|
|
19
19
|
Compare which step is marked current (for example "current step 2 of 7") in the BEFORE text and in the AFTER text. Ignore step-list or progress-bar names that appear in both texts; they list steps and do not show where the flow is.
|
|
20
|
-
Set advanced=true when the AFTER text marks a different step as current, or shows a different heading with the fields the step asked to fill (present in the BEFORE text) gone.
|
|
20
|
+
Base the decision only on the visible page text, never on a document title. Set advanced=true when the AFTER text marks a different step as current, or shows a different heading with the fields the step asked to fill (present in the BEFORE text) gone.
|
|
21
21
|
Required-field markers (such as an asterisk) on a newly loaded step are not errors; they are the next step's normal empty form.
|
|
22
|
-
Set advanced=false when the same step is still marked current, or when the AFTER text shows an explicit error summary or error message
|
|
22
|
+
Set advanced=false when the same step is still marked current, or when the AFTER text shows an explicit error summary or error message. Only an explicit error summary or message counts as failure.
|
|
23
|
+
The DOM invalid-marker count is not evidence in either direction: a newly loaded step's empty required fields are counted too, so never set advanced=false from the count alone.
|
|
23
24
|
Shared page chrome (header, cart badge, document title, step list) is not evidence in either direction. If the AFTER text shows content for a later view (for example a shopping-site cart page or the next form) and the asked-for fields are gone, set advanced=true even though the chrome looks the same as BEFORE.
|
|
24
25
|
When ambiguous after applying that rule, set advanced=false.
|
|
25
26
|
Write one short sentence as the reason.`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-step-advanced.js","sourceRoot":"","sources":["../../../../src/lib/llm/judges/verify-step-advanced.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAKH,2CAAsE;AACtE,+CAAyD;AACzD,2DAA2E;AAE3E,MAAM,cAAc,GAAG,IAAI,CAAC;AAC5B,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B,MAAM,2BAA2B,GAAG
|
|
1
|
+
{"version":3,"file":"verify-step-advanced.js","sourceRoot":"","sources":["../../../../src/lib/llm/judges/verify-step-advanced.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAKH,2CAAsE;AACtE,+CAAyD;AACzD,2DAA2E;AAE3E,MAAM,cAAc,GAAG,IAAI,CAAC;AAC5B,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B,MAAM,2BAA2B,GAAG;;;;;;;;;wCASI,CAAC;QAkDhC,2BAA2B;AAxCpC,SAAS,WAAW,CAAC,KAA8B;IACjD,OAAO;;oBAEW,KAAK,CAAC,eAAe;;;EAGvC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC;;;EAGzC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC;;4BAEd,KAAK,CAAC,kBAAkB,EAAE,CAAC;AACvD,CAAC;AAED;;;GAGG;AACI,KAAK,oCAAoC,MAI/C;IACC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAC5C,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACjC,MAAM,MAAM,GAAG,MAAM,IAAA,sBAAc,EAAC;QAClC,MAAM;QACN,YAAY,EAAE,2BAA2B;QACzC,UAAU,EAAE,WAAW,CAAC,KAAK,CAAC;QAC9B,MAAM,EAAE,8BAAoB;QAC5B,QAAQ,EAAE,0CAA6B;QACvC,SAAS;KACV,CAAC,CAAC;IACH,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,OAAO;QACL,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ;QAChC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,gBAAgB,CAAC;KACxD,CAAC;AACJ,CAAC"}
|
|
@@ -34,8 +34,8 @@ declare const SUBMIT_VERIFY_SYSTEM_PROMPT = "You are a strict submit-verifier fo
|
|
|
34
34
|
export interface VerifySubmitInput {
|
|
35
35
|
/** The step's instruction, so the judge knows what this click was meant to do. */
|
|
36
36
|
stepInstruction?: string;
|
|
37
|
-
/**
|
|
38
|
-
isFinalStep
|
|
37
|
+
/** Required so a non-final step can never fall into strict final-submit judging by omission. */
|
|
38
|
+
isFinalStep: boolean;
|
|
39
39
|
/** Bounded slice of live visible page text; fresher evidence than the title. */
|
|
40
40
|
visibleText?: string;
|
|
41
41
|
pageUrl: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-submit.d.ts","sourceRoot":"","sources":["../../../../src/lib/llm/judges/verify-submit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAG1D;;;;GAIG;AACH,QAAA,MAAM,2BAA2B,i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G,IAAI,CAAC;IACzB,KAAK,EAAE,iBAAiB,CAAC;IACzB,SAAS,CAAC,EAAE,cAAc,CAAC;CAC5B,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,GAAG,IAAI,CAAC,CAaxD;AAED,OAAO,EAAE,2BAA2B,EAAE,CAAC"}
|
|
@@ -40,9 +40,23 @@ Strictness rule for verified=true:
|
|
|
40
40
|
When verified=true, populate the three signal fields with what you found (any can be null if absent), and write a one-sentence rationale citing the strongest signal.
|
|
41
41
|
When verified=false, write a one short sentence reason (keep it brief) citing what you'd need to see to be convinced.`;
|
|
42
42
|
exports.SUBMIT_VERIFY_SYSTEM_PROMPT = SUBMIT_VERIFY_SYSTEM_PROMPT;
|
|
43
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Non-final steps are judged on whether the page advanced, not on a
|
|
45
|
+
* final-submit confirmation, so this prompt is standalone rather than the
|
|
46
|
+
* strict prompt plus an override that would contradict it.
|
|
47
|
+
*/
|
|
48
|
+
const NON_FINAL_SYSTEM_PROMPT = `You are a step-verifier for browser-automated job applications. Given evidence about what happened after a click, decide whether this step succeeded and the page advanced. This is NOT the final step of the flow, so no confirmation page is expected.
|
|
49
|
+
|
|
50
|
+
Rules for verified=true:
|
|
51
|
+
- Visible text decides. If the visible text shows the page advanced to a new stage (relative to the step instruction), set verified=true even when the URL did not change.
|
|
52
|
+
- A stale document title is not evidence: a single-page app's title often stays the same across steps. Neither count it for nor against the step.
|
|
53
|
+
- A new DOM component or URL transition matching the supplied criteria also supports verified=true.
|
|
54
|
+
- A 2xx POST/PUT/DELETE to the site's own backend (matching one of the supplied ownBackendHostnames) strengthens the case but is not required on its own.
|
|
55
|
+
- If only error indicators are present (4xx, 5xx, error containers, the form is still visible with invalid markers), set verified=false with a reason.
|
|
56
|
+
- When ambiguous, set verified=false with a reason.
|
|
44
57
|
|
|
45
|
-
|
|
58
|
+
When verified=true, populate the three signal fields with what you found (any can be null if absent), and write a one-sentence rationale citing the strongest signal.
|
|
59
|
+
When verified=false, write a one short sentence reason (keep it brief) citing what you'd need to see to be convinced.`;
|
|
46
60
|
const MAX_VISIBLE_TEXT_CHARS = 3000;
|
|
47
61
|
/**
|
|
48
62
|
* Render the evidence into a user prompt for Haiku. The structure parallels
|
|
@@ -97,9 +111,7 @@ async function verifySubmitWithLLM(params) {
|
|
|
97
111
|
return null;
|
|
98
112
|
const result = await (0, judge_1.callHaikuJudge)({
|
|
99
113
|
client,
|
|
100
|
-
systemPrompt: input.isFinalStep === false
|
|
101
|
-
? `${SUBMIT_VERIFY_SYSTEM_PROMPT}${NON_FINAL_STEP_RULE}`
|
|
102
|
-
: SUBMIT_VERIFY_SYSTEM_PROMPT,
|
|
114
|
+
systemPrompt: input.isFinalStep === false ? NON_FINAL_SYSTEM_PROMPT : SUBMIT_VERIFY_SYSTEM_PROMPT,
|
|
103
115
|
userPrompt: buildVerifySubmitPrompt(input),
|
|
104
116
|
schema: schemas_1.SUBMIT_VERDICT_SCHEMA,
|
|
105
117
|
callType: call_types_1.CALL_TYPE_JUDGE_SUBMIT_VERIFY,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-submit.js","sourceRoot":"","sources":["../../../../src/lib/llm/judges/verify-submit.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;AAKH,2CAAsE;AACtE,+CAA0D;AAC1D,2DAA2E;AAE3E;;;;GAIG;AACH,MAAM,2BAA2B,GAAG;;;;;;;;;;sHAUkF,CAAC;
|
|
1
|
+
{"version":3,"file":"verify-submit.js","sourceRoot":"","sources":["../../../../src/lib/llm/judges/verify-submit.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;AAKH,2CAAsE;AACtE,+CAA0D;AAC1D,2DAA2E;AAE3E;;;;GAIG;AACH,MAAM,2BAA2B,GAAG;;;;;;;;;;sHAUkF,CAAC;QAwH9G,2BAA2B;AAtHpC;;;;GAIG;AAC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AEX,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,WAAW,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;4BAErE,KAAK,CAAC,kBAAkB;;;2BAGzB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,mBAAmB,CAAC;2BACzC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,mBAAmB,CAAC;EAClE,cAAc,iFAAiF,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,uBAAuB,CAAC,EAAE,CAAC;AACjJ,CAAC;AAED;;;;;GAKG;AACI,KAAK,8BAA8B,MAIzC;IACC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAC5C,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACjC,MAAM,MAAM,GAAG,MAAM,IAAA,sBAAc,EAAC;QAClC,MAAM;QACN,YAAY,EACV,KAAK,CAAC,WAAW,KAAK,KAAK,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,2BAA2B;QACrF,UAAU,EAAE,uBAAuB,CAAC,KAAK,CAAC;QAC1C,MAAM,EAAE,+BAAqB;QAC7B,QAAQ,EAAE,0CAA6B;QACvC,SAAS;KACV,CAAC,CAAC;IACH,OAAO,MAAM,EAAE,MAAM,IAAI,IAAI,CAAC;AAChC,CAAC"}
|
package/dist/lib/logging.d.ts
CHANGED
|
@@ -34,10 +34,20 @@ export declare function extendLogger(logger: pino.Logger): Logger;
|
|
|
34
34
|
*/
|
|
35
35
|
export declare function getScriptLogger(name: string): Logger;
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
37
|
+
* Pino options for the project's standard logger: pino-pretty transport in
|
|
38
|
+
* dev, JSON in prod, silent in test, secrets redacted, request values scrubbed
|
|
39
|
+
* by hook. Split from `getLogger` so tests can build a non-silent logger with
|
|
40
|
+
* the real redaction wiring.
|
|
41
|
+
*/
|
|
42
|
+
export declare function buildLoggerOptions({ name, level, }: {
|
|
43
|
+
name: string;
|
|
44
|
+
level?: string;
|
|
45
|
+
}): pino.LoggerOptions;
|
|
46
|
+
/**
|
|
47
|
+
* Creates a named pino logger with the project's standard wiring (see
|
|
48
|
+
* {@link buildLoggerOptions}), with every string message auto-chunked under
|
|
49
|
+
* CloudWatch's 256KB event cap. `name` appears as `{appName}://{name}` on every
|
|
50
|
+
* line.
|
|
41
51
|
*/
|
|
42
52
|
export declare function getLogger({ name, level }: {
|
|
43
53
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../src/lib/logging.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AAKxB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AA4D9C;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO,CAI/D,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,MAAyB,GAAG,MAAM,EAAE,CAY/F;
|
|
1
|
+
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../src/lib/logging.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AAKxB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AA4D9C;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO,CAI/D,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,MAAyB,GAAG,MAAM,EAAE,CAY/F;AA4ED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,GAAG,MAAM,CAqBxD;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CASpD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,KAAK,GACN,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,IAAI,CAAC,aAAa,CAyBrB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAEnF"}
|
package/dist/lib/logging.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.PII_REDACTING_LOG_HOOKS = void 0;
|
|
|
7
7
|
exports.splitLargeMessage = splitLargeMessage;
|
|
8
8
|
exports.extendLogger = extendLogger;
|
|
9
9
|
exports.getScriptLogger = getScriptLogger;
|
|
10
|
+
exports.buildLoggerOptions = buildLoggerOptions;
|
|
10
11
|
exports.getLogger = getLogger;
|
|
11
12
|
const date_fns_1 = require("date-fns");
|
|
12
13
|
const pino_1 = __importDefault(require("pino"));
|
|
@@ -146,6 +147,18 @@ function logWithSplitting(originalLogFn, obj, ...args) {
|
|
|
146
147
|
function getLogName(name, appName) {
|
|
147
148
|
return `${appName}://${name}`;
|
|
148
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* Wraps a level method so it splits oversized messages, running against the
|
|
152
|
+
* logger it is called on. Child loggers inherit these wrappers, so binding to
|
|
153
|
+
* the logger they were created for would route every child's output through
|
|
154
|
+
* its parent, dropping the child's bindings and serializers (Fastify's
|
|
155
|
+
* `request.log` then dumps the raw request, `rawHeaders` included).
|
|
156
|
+
*/
|
|
157
|
+
function withSplitting(logger, original) {
|
|
158
|
+
return function (obj, ...args) {
|
|
159
|
+
logWithSplitting(original.bind(this ?? logger), obj, ...args);
|
|
160
|
+
};
|
|
161
|
+
}
|
|
149
162
|
/**
|
|
150
163
|
* Wraps a pino logger with the project's extended Logger interface: CloudWatch
|
|
151
164
|
* message splitting on every level method, and `errorWithStack` for one-line
|
|
@@ -155,27 +168,15 @@ function getLogName(name, appName) {
|
|
|
155
168
|
*/
|
|
156
169
|
function extendLogger(logger) {
|
|
157
170
|
const extendedLogger = logger;
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
extendedLogger.
|
|
163
|
-
logWithSplitting(originalInfo, obj, ...args);
|
|
164
|
-
};
|
|
165
|
-
extendedLogger.error = (obj, ...args) => {
|
|
166
|
-
logWithSplitting(originalError, obj, ...args);
|
|
167
|
-
};
|
|
168
|
-
extendedLogger.warn = (obj, ...args) => {
|
|
169
|
-
logWithSplitting(originalWarn, obj, ...args);
|
|
170
|
-
};
|
|
171
|
-
extendedLogger.debug = (obj, ...args) => {
|
|
172
|
-
logWithSplitting(originalDebug, obj, ...args);
|
|
173
|
-
};
|
|
174
|
-
extendedLogger.errorWithStack = (error, msg) => {
|
|
171
|
+
extendedLogger.info = withSplitting(logger, extendedLogger.info);
|
|
172
|
+
extendedLogger.error = withSplitting(logger, extendedLogger.error);
|
|
173
|
+
extendedLogger.warn = withSplitting(logger, extendedLogger.warn);
|
|
174
|
+
extendedLogger.debug = withSplitting(logger, extendedLogger.debug);
|
|
175
|
+
extendedLogger.errorWithStack = function (error, msg) {
|
|
175
176
|
const message = error instanceof Error
|
|
176
177
|
? `${msg || error.message}: ${error.stack}`
|
|
177
178
|
: `${msg || JSON.stringify(error)}`;
|
|
178
|
-
|
|
179
|
+
(this ?? extendedLogger).error(message);
|
|
179
180
|
};
|
|
180
181
|
return extendedLogger;
|
|
181
182
|
}
|
|
@@ -195,13 +196,13 @@ function getScriptLogger(name) {
|
|
|
195
196
|
}));
|
|
196
197
|
}
|
|
197
198
|
/**
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
199
|
+
* Pino options for the project's standard logger: pino-pretty transport in
|
|
200
|
+
* dev, JSON in prod, silent in test, secrets redacted, request values scrubbed
|
|
201
|
+
* by hook. Split from `getLogger` so tests can build a non-silent logger with
|
|
202
|
+
* the real redaction wiring.
|
|
202
203
|
*/
|
|
203
|
-
function
|
|
204
|
-
|
|
204
|
+
function buildLoggerOptions({ name, level, }) {
|
|
205
|
+
return {
|
|
205
206
|
name: getLogName(name, defaultAppName),
|
|
206
207
|
level: isTest ? "silent" : level || defaultLoggingLevel,
|
|
207
208
|
base: {
|
|
@@ -225,7 +226,15 @@ function getLogger({ name, level }) {
|
|
|
225
226
|
},
|
|
226
227
|
transport,
|
|
227
228
|
};
|
|
228
|
-
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Creates a named pino logger with the project's standard wiring (see
|
|
232
|
+
* {@link buildLoggerOptions}), with every string message auto-chunked under
|
|
233
|
+
* CloudWatch's 256KB event cap. `name` appears as `{appName}://{name}` on every
|
|
234
|
+
* line.
|
|
235
|
+
*/
|
|
236
|
+
function getLogger({ name, level }) {
|
|
237
|
+
return extendLogger((0, pino_1.default)(buildLoggerOptions({ name, level })));
|
|
229
238
|
}
|
|
230
239
|
function ddMixin() {
|
|
231
240
|
const span = (0, datadog_1.getTracer)()?.scope().active();
|
package/dist/lib/logging.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.js","sourceRoot":"","sources":["../../src/lib/logging.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logging.js","sourceRoot":"","sources":["../../src/lib/logging.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,uCAAqC;AACrC,gDAAwB;AAExB,2CAA0C;AAC1C,mCAA2D;AAC3D,uDAA+D;AAG/D,MAAM,OAAO,GAAG,IAAA,gB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E,OAAO,CAAC;iBAC/B;aACF,CAAC;SACH;QACD,SAAS,EAAE,YAAY;QACvB,UAAU;QACV,KAAK,EAAE,QAAA,uBAAuB;QAC9B,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;QACtC,MAAM,EAAE;YACN,KAAK,EAAE,WAAW;YAClB,MAAM,EAAE,YAAY;SACrB;QACD,SAAS;KACV,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,mBAA0B,EAAE,IAAI,EAAE,KAAK,EAAoC;IACzE,OAAO,YAAY,CAAC,IAAA,cAAI,EAAC,kBAAkB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;AACjE,CAAC;AAED,SAAS,OAAO;IACd,MAAM,IAAI,GAAG,IAAA,mBAAS,GAAE,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,CAAC;IAC3C,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IACrB,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;IAC3B,OAAO,EAAE,aAAa,EAAE,GAAG,CAAC,SAAS,EAAE,EAAE,YAAY,EAAE,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC;AAC1E,CAAC"}
|
package/dist/lib/random.d.ts
CHANGED
|
@@ -24,9 +24,13 @@ export declare function pickRandom<T>(arr: readonly T[]): T;
|
|
|
24
24
|
* password field but has no caller-supplied secret to splice — recon-captured
|
|
25
25
|
* credentials must never leak into a generated flow, and a fixed literal would
|
|
26
26
|
* be a shared secret across every run. `node:crypto`'s CSPRNG (not `Math.random`,
|
|
27
|
-
* which backs the jitter helpers above) keeps the value unguessable.
|
|
28
|
-
*
|
|
29
|
-
*
|
|
27
|
+
* which backs the jitter helpers above) keeps the value unguessable. Sites
|
|
28
|
+
* commonly enforce upper/lower/digit/special policies, so one character of each
|
|
29
|
+
* class is guaranteed and the result is Fisher-Yates shuffled with `randomInt`
|
|
30
|
+
* (unbiased) so the guaranteed characters sit at unpredictable positions. The
|
|
31
|
+
* alphabet excludes quotes, backticks, backslashes and `$` because flows splice
|
|
32
|
+
* the value into template literals. The value is registered for redaction
|
|
33
|
+
* because flows embed it in step instructions that reach logs and telemetry.
|
|
30
34
|
*/
|
|
31
35
|
export declare function generateThrowawayPassword(): string;
|
|
32
36
|
//# sourceMappingURL=random.d.ts.map
|
package/dist/lib/random.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src/lib/random.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAGnE;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,CAGlD;
|
|
1
|
+
{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src/lib/random.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAGnE;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,CAGlD;AAaD;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAalD"}
|
package/dist/lib/random.js
CHANGED
|
@@ -33,17 +33,40 @@ function pickRandom(arr) {
|
|
|
33
33
|
const index = randomIntInclusive(0, arr.length - 1);
|
|
34
34
|
return arr[index] ?? arr[0];
|
|
35
35
|
}
|
|
36
|
+
const UPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
37
|
+
const LOWERCASE = "abcdefghijklmnopqrstuvwxyz";
|
|
38
|
+
const DIGITS = "0123456789";
|
|
39
|
+
// No `-`/`_`: some policies do not count them as special characters.
|
|
40
|
+
const SPECIALS = "!@#%^*()+=?.";
|
|
41
|
+
const PASSWORD_LENGTH = 24;
|
|
42
|
+
function pickChar(charset) {
|
|
43
|
+
return charset.charAt((0, node_crypto_1.randomInt)(charset.length));
|
|
44
|
+
}
|
|
36
45
|
/**
|
|
37
46
|
* Mints a fresh, single-use credential value for a flow step that must fill a
|
|
38
47
|
* password field but has no caller-supplied secret to splice — recon-captured
|
|
39
48
|
* credentials must never leak into a generated flow, and a fixed literal would
|
|
40
49
|
* be a shared secret across every run. `node:crypto`'s CSPRNG (not `Math.random`,
|
|
41
|
-
* which backs the jitter helpers above) keeps the value unguessable.
|
|
42
|
-
*
|
|
43
|
-
*
|
|
50
|
+
* which backs the jitter helpers above) keeps the value unguessable. Sites
|
|
51
|
+
* commonly enforce upper/lower/digit/special policies, so one character of each
|
|
52
|
+
* class is guaranteed and the result is Fisher-Yates shuffled with `randomInt`
|
|
53
|
+
* (unbiased) so the guaranteed characters sit at unpredictable positions. The
|
|
54
|
+
* alphabet excludes quotes, backticks, backslashes and `$` because flows splice
|
|
55
|
+
* the value into template literals. The value is registered for redaction
|
|
56
|
+
* because flows embed it in step instructions that reach logs and telemetry.
|
|
44
57
|
*/
|
|
45
58
|
function generateThrowawayPassword() {
|
|
46
|
-
const
|
|
59
|
+
const all = UPPERCASE + LOWERCASE + DIGITS + SPECIALS;
|
|
60
|
+
const chars = [pickChar(UPPERCASE), pickChar(LOWERCASE), pickChar(DIGITS), pickChar(SPECIALS)];
|
|
61
|
+
while (chars.length < PASSWORD_LENGTH)
|
|
62
|
+
chars.push(pickChar(all));
|
|
63
|
+
for (let i = chars.length - 1; i > 0; i--) {
|
|
64
|
+
const j = (0, node_crypto_1.randomInt)(i + 1);
|
|
65
|
+
const tmp = chars[i];
|
|
66
|
+
chars[i] = chars[j];
|
|
67
|
+
chars[j] = tmp;
|
|
68
|
+
}
|
|
69
|
+
const password = chars.join("");
|
|
47
70
|
(0, pii_redaction_1.registerSecretValue)(password);
|
|
48
71
|
return password;
|
|
49
72
|
}
|
package/dist/lib/random.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"random.js","sourceRoot":"","sources":["../../src/lib/random.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"random.js","sourceRoot":"","sources":["../../src/lib/random.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;AAEH,6CAAwC;AAExC,uDAA0D;AAE1D;;;;GAIG;AACH,4BAAmC,GAAW,EAAE,GAAW;IACzD,IAAI,GAAG,IAAI,GAAG;QAAE,OAAO,GAAG,CAAC;IAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;AAC3D,CAAC;AAED;;;;;GAKG;AACH,oBAA8B,GAAiB;IAC7C,MAAM,KAAK,GAAG,kBAAkB,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACpD,OAAO,GAAG,CAAC,KAAK,CAAC,IAAK,GAAG,CAAC,CAAC,CAAO,CAAC;AACrC,CAAC;AAED,MAAM,SAAS,GAAG,4BAA4B,CAAC;AAC/C,MAAM,SAAS,GAAG,4BAA4B,CAAC;AAC/C,MAAM,MAAM,GAAG,YAAY,CAAC;AAC5B,qEAAqE;AACrE,MAAM,QAAQ,GAAG,cAAc,CAAC;AAChC,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B,SAAS,QAAQ,CAAC,OAAe;IAC/B,OAAO,OAAO,CAAC,MAAM,CAAC,IAAA,uBAAS,EAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;AACnD,CAAC;AAED;;;;;;;;;;;;GAYG;AACH;IACE,MAAM,GAAG,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;IACtD,MAAM,KAAK,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC/F,OAAO,KAAK,CAAC,MAAM,GAAG,eAAe;QAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IACjE,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1C,MAAM,CAAC,GAAG,IAAA,uBAAS,EAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAC3B,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAW,CAAC;QAC/B,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAW,CAAC;QAC9B,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IACjB,CAAC;IACD,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChC,IAAA,mCAAmB,EAAC,QAAQ,CAAC,CAAC;IAC9B,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -8,6 +8,14 @@ export interface PageQuiescence {
|
|
|
8
8
|
pending: number;
|
|
9
9
|
mutations: number;
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Folds the whole-page text digest into the signature settle compares, so a
|
|
13
|
+
* re-render that keeps the length and the 200-char head still counts as movement.
|
|
14
|
+
*/
|
|
15
|
+
export declare function settleTextKey(visibleTextSignature: string, visibleTextDigest?: string): string;
|
|
16
|
+
export declare const IDLE_GIVE_UP_MS = 14000;
|
|
17
|
+
export declare const QUIESCENT_NO_OP_GIVE_UP_MS = 4000;
|
|
18
|
+
export declare const MAX_MS = 60000;
|
|
11
19
|
/**
|
|
12
20
|
* Waits for a click's network activity to settle so the verification snapshot
|
|
13
21
|
* reflects the post-click page rather than a fixed-delay guess. Elapsed time is
|
|
@@ -20,14 +28,17 @@ export interface PageQuiescence {
|
|
|
20
28
|
* and DOM mutations are read from the page itself: either one is activity, and
|
|
21
29
|
* the wait only ends once the page reports idle, so the fixed text quiet window
|
|
22
30
|
* is no longer a guess about how late a re-render can land.
|
|
31
|
+
* Any click whose text moved, or any submit-shaped click that saw network activity, keeps waiting until the same idle allowance a silent
|
|
32
|
+
* submit-shaped one gets, since a header flip can precede the body re-render by many seconds.
|
|
33
|
+
* A silent submit-shaped click whose armed page probe reports no pending request and no mutation
|
|
34
|
+
* gives up at QUIESCENT_NO_OP_GIVE_UP_MS, since a late re-render would itself register as
|
|
35
|
+
* movement; without a probe the long IDLE_GIVE_UP_MS guess remains.
|
|
23
36
|
* Only submit-shaped steps keep the long idle wait for a slow round-trip to start;
|
|
24
37
|
* any other click that shows no activity after one quiet poll gives up.
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* quiet window is not trusted and polling continues for up to HALF_TRANSITION_MAX_MS
|
|
28
|
-
* more; a click that moved nothing never pays this extra wait.
|
|
38
|
+
* The probe is read once before the click (see snapshotPage) so early requests and
|
|
39
|
+
* mutations are counted; settle ends on page quiescence, never on a content predicate.
|
|
29
40
|
*/
|
|
30
|
-
export declare function settleAfterClick(page: SettlePage, counter: SettleCounter, preCount: number, submitShaped: boolean, readText?: () => Promise<string>, preText?: string, readQuiescence?: () => Promise<PageQuiescence
|
|
41
|
+
export declare function settleAfterClick(page: SettlePage, counter: SettleCounter, preCount: number, submitShaped: boolean, readText?: () => Promise<string>, preText?: string, readQuiescence?: () => Promise<PageQuiescence>): Promise<void>;
|
|
31
42
|
/**
|
|
32
43
|
* Page-side probe that counts requests the network capture never sees and DOM
|
|
33
44
|
* mutations, so settle can tell a finished re-render from a pending one.
|
|
@@ -44,8 +55,6 @@ export interface SettleSnapshotTarget<S extends {
|
|
|
44
55
|
/** Takes a snapshot; `withPage` marks the final post-settle read. */
|
|
45
56
|
snapshot: (withPage: boolean) => Promise<S>;
|
|
46
57
|
readQuiescence?: () => Promise<PageQuiescence>;
|
|
47
|
-
/** Whether a text signature shows the page finished advancing; see settleAfterClick. */
|
|
48
|
-
advanced?: (visibleTextSignature: string) => boolean;
|
|
49
58
|
}
|
|
50
59
|
/**
|
|
51
60
|
* Settles after a click and returns the post snapshot, so the settle wait, the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"click-settle.d.ts","sourceRoot":"","sources":["../../src/scraper/click-settle.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,aAAa;IAC5B,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;
|
|
1
|
+
{"version":3,"file":"click-settle.d.ts","sourceRoot":"","sources":["../../src/scraper/click-settle.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,aAAa;IAC5B,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,oBAAoB,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,MAAM,GAAG,MAAM,CAE9F;AAID,eAAO,MAAM,eAAe,QAAQ,CAAC;AACrC,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,eAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B;;;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