@enricai/barnacle 1.12.82 → 1.13.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.
Files changed (49) hide show
  1. package/dist/lib/ats-field-vocabulary.d.ts.map +1 -1
  2. package/dist/lib/ats-field-vocabulary.js +86 -3
  3. package/dist/lib/ats-field-vocabulary.js.map +1 -1
  4. package/dist/lib/llm/judges/verify-step-advanced.d.ts +1 -1
  5. package/dist/lib/llm/judges/verify-step-advanced.d.ts.map +1 -1
  6. package/dist/lib/llm/judges/verify-step-advanced.js +3 -2
  7. package/dist/lib/llm/judges/verify-step-advanced.js.map +1 -1
  8. package/dist/lib/llm/judges/verify-submit.d.ts +2 -2
  9. package/dist/lib/llm/judges/verify-submit.d.ts.map +1 -1
  10. package/dist/lib/llm/judges/verify-submit.js +17 -5
  11. package/dist/lib/llm/judges/verify-submit.js.map +1 -1
  12. package/dist/lib/random.d.ts +7 -3
  13. package/dist/lib/random.d.ts.map +1 -1
  14. package/dist/lib/random.js +27 -4
  15. package/dist/lib/random.js.map +1 -1
  16. package/dist/scraper/click-settle.d.ts +16 -7
  17. package/dist/scraper/click-settle.d.ts.map +1 -1
  18. package/dist/scraper/click-settle.js +31 -24
  19. package/dist/scraper/click-settle.js.map +1 -1
  20. package/dist/scraper/deep-locator-actuate.d.ts.map +1 -1
  21. package/dist/scraper/deep-locator-actuate.js +17 -1
  22. package/dist/scraper/deep-locator-actuate.js.map +1 -1
  23. package/dist/scraper/deep-locator-fake.js +1 -1
  24. package/dist/scraper/deep-locator-fake.js.map +1 -1
  25. package/dist/scraper/flow-runner.d.ts +139 -8
  26. package/dist/scraper/flow-runner.d.ts.map +1 -1
  27. package/dist/scraper/flow-runner.js +710 -316
  28. package/dist/scraper/flow-runner.js.map +1 -1
  29. package/dist/scraper/phantom-click.d.ts +45 -1
  30. package/dist/scraper/phantom-click.d.ts.map +1 -1
  31. package/dist/scraper/phantom-click.js +114 -10
  32. package/dist/scraper/phantom-click.js.map +1 -1
  33. package/dist/scraper/runtime-capture-store.d.ts +38 -0
  34. package/dist/scraper/runtime-capture-store.d.ts.map +1 -0
  35. package/dist/scraper/runtime-capture-store.js +103 -0
  36. package/dist/scraper/runtime-capture-store.js.map +1 -0
  37. package/dist/scraper/segmented-date-spinbutton.d.ts +13 -0
  38. package/dist/scraper/segmented-date-spinbutton.d.ts.map +1 -0
  39. package/dist/scraper/segmented-date-spinbutton.js +71 -0
  40. package/dist/scraper/segmented-date-spinbutton.js.map +1 -0
  41. package/dist/scripts/recon-browser.d.ts +0 -8
  42. package/dist/scripts/recon-browser.d.ts.map +1 -1
  43. package/dist/scripts/recon-browser.js +102 -50
  44. package/dist/scripts/recon-browser.js.map +1 -1
  45. package/dist/scripts/recon-generate.d.ts +11 -0
  46. package/dist/scripts/recon-generate.d.ts.map +1 -1
  47. package/dist/scripts/recon-generate.js +180 -53
  48. package/dist/scripts/recon-generate.js.map +1 -1
  49. 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":"AAkCA;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAIjF"}
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: ["mobile phone", "phone number", "phone", "cell phone"],
12
- AddressLine: ["address line 1", "address line", "street address"],
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
- return NORMALIZED_LOOKUP.get(normalized) ?? null;
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,CAAC,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,YAAY,CAAC;IAC9D,WAAW,EAAE,CAAC,gBAAgB,EAAE,cAAc,EAAE,gBAAgB,CAAC;IACjE,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,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC,CACnE,CACF,CAAC;AAEF;;;;GAIG;AACH,SAAS,iBAAiB,CAAC,KAAa;IACtC,OAAO,KAAK;SACT,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC;SACnC,OAAO,CAAC,iBAAiB,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,OAAO,iBAAiB,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC;AACnD,CAAC"}
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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B,EAAE,IAAiB,EAAE,UAAuB;IACnF,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACpC,OAAO,CACL,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAC7F,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAS,iBAAiB,CAAC,KAAa;IACtC,OAAO,KAAK;SACT,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC;SACnC,OAAO,CAAC,iBAAiB,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.\nSet 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, or the DOM invalid-marker count is above zero. Only an explicit error summary or message counts as failure.\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.";
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,83CAQO,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"}
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, or the DOM invalid-marker count is above zero. Only an explicit error summary or message counts as failure.
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;;;;;;;;wCAQI,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;IACz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AChC,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
- /** Defaults to true (strict final-submit judging) when omitted. */
38
- isFinalStep?: boolean;
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,iyDAUqF,CAAC;AAQvH;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,kFAAkF;IAClF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mEAAmE;IACnE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC9D,eAAe,EAAE;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E,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC9D,eAAe,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACnE,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kEAAkE;IAClE,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,iEAAiE;IACjE,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,yEAAyE;IACzE,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,0EAA0E;IAC1E,uBAAuB,EAAE,MAAM,EAAE,CAAC;CACnC;AAgDD;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAAE;IAChD,MAAM,EAAE,SAAS,GAAG,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
- const NON_FINAL_STEP_RULE = `
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
- This is NOT the final step of the flow. For a non-final step a stale document title is not evidence (a single-page app's title often stays the same across steps). Visible text decides; if the visible text shows the page advanced, verified=true even when the title or URL did not change.`;
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":"ver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 +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. The value
28
- * is registered for redaction because flows embed it in step instructions that
29
- * reach logs and telemetry.
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
@@ -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;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAIlD"}
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"}
@@ -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. The value
42
- * is registered for redaction because flows embed it in step instructions that
43
- * reach logs and telemetry.
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 password = (0, node_crypto_1.randomBytes)(24).toString("base64url");
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
  }
@@ -1 +1 @@
1
- {"version":3,"file":"random.js","sourceRoot":"","sources":["../../src/lib/random.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;AAEH,6CAA0C;AAE1C,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;;;;;;;;GAQG;AACH;IACE,MAAM,QAAQ,GAAG,IAAA,yBAAW,EAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IACvD,IAAA,mCAAmB,EAAC,QAAQ,CAAC,CAAC;IAC9B,OAAO,QAAQ,CAAC;AAClB,CAAC"}
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,MAA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AAG,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
- * When `advanced` is given and the text has moved but does not yet satisfy it, the
26
- * page is half-transitioned (a header flipped before the body re-rendered), so the
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>, advanced?: (visibleTextSignature: string) => boolean): Promise<void>;
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;AASD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,aAAa,EACtB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AAoB,EAAE,MAAM,CAAA;CAAE,EAChE,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAW7C"}
@@ -1,14 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QUIESCENCE_PROBE_EXPR = void 0;
3
+ exports.QUIESCENCE_PROBE_EXPR = exports.MAX_MS = exports.QUIESCENT_NO_OP_GIVE_UP_MS = exports.IDLE_GIVE_UP_MS = void 0;
4
+ exports.settleTextKey = settleTextKey;
4
5
  exports.settleAfterClick = settleAfterClick;
5
6
  exports.settleAndSnapshot = settleAndSnapshot;
7
+ /**
8
+ * Folds the whole-page text digest into the signature settle compares, so a
9
+ * re-render that keeps the length and the 200-char head still counts as movement.
10
+ */
11
+ function settleTextKey(visibleTextSignature, visibleTextDigest) {
12
+ return visibleTextDigest ? `${visibleTextSignature}#${visibleTextDigest}` : visibleTextSignature;
13
+ }
6
14
  const POLL_MS = 1000;
7
15
  const QUIET_POLLS = 3;
8
- const IDLE_GIVE_UP_MS = 14000;
16
+ exports.IDLE_GIVE_UP_MS = 14000;
17
+ exports.QUIESCENT_NO_OP_GIVE_UP_MS = 4000;
9
18
  const TEXT_QUIET_POLLS = 9;
10
- const MAX_MS = 60000;
11
- const HALF_TRANSITION_MAX_MS = 20000;
19
+ exports.MAX_MS = 60000;
12
20
  /**
13
21
  * Waits for a click's network activity to settle so the verification snapshot
14
22
  * reflects the post-click page rather than a fixed-delay guess. Elapsed time is
@@ -21,14 +29,17 @@ const HALF_TRANSITION_MAX_MS = 20000;
21
29
  * and DOM mutations are read from the page itself: either one is activity, and
22
30
  * the wait only ends once the page reports idle, so the fixed text quiet window
23
31
  * is no longer a guess about how late a re-render can land.
32
+ * Any click whose text moved, or any submit-shaped click that saw network activity, keeps waiting until the same idle allowance a silent
33
+ * submit-shaped one gets, since a header flip can precede the body re-render by many seconds.
34
+ * A silent submit-shaped click whose armed page probe reports no pending request and no mutation
35
+ * gives up at QUIESCENT_NO_OP_GIVE_UP_MS, since a late re-render would itself register as
36
+ * movement; without a probe the long IDLE_GIVE_UP_MS guess remains.
24
37
  * Only submit-shaped steps keep the long idle wait for a slow round-trip to start;
25
38
  * any other click that shows no activity after one quiet poll gives up.
26
- * When `advanced` is given and the text has moved but does not yet satisfy it, the
27
- * page is half-transitioned (a header flipped before the body re-rendered), so the
28
- * quiet window is not trusted and polling continues for up to HALF_TRANSITION_MAX_MS
29
- * more; a click that moved nothing never pays this extra wait.
39
+ * The probe is read once before the click (see snapshotPage) so early requests and
40
+ * mutations are counted; settle ends on page quiescence, never on a content predicate.
30
41
  */
31
- async function settleAfterClick(page, counter, preCount, submitShaped, readText, preText, readQuiescence, advanced) {
42
+ async function settleAfterClick(page, counter, preCount, submitShaped, readText, preText, readQuiescence) {
32
43
  const read = async () => (readText ? readText() : undefined);
33
44
  const quiescence = async () => readQuiescence ? readQuiescence() : undefined;
34
45
  const startQ = await quiescence();
@@ -36,18 +47,14 @@ async function settleAfterClick(page, counter, preCount, submitShaped, readText,
36
47
  const startText = await read();
37
48
  let lastText = preText ?? startText;
38
49
  let textMoved = preText !== undefined && startText !== undefined && startText !== preText;
39
- let latestText = startText;
40
- let halfTransitionWaited = 0;
41
50
  let seen = counter.n > preCount || textMoved;
42
51
  let last = counter.n;
43
52
  let quiet = 0;
44
53
  let elapsed = 0;
45
- while (elapsed < MAX_MS) {
54
+ while (elapsed < exports.MAX_MS) {
46
55
  await page.waitForTimeout(POLL_MS);
47
56
  elapsed += POLL_MS;
48
57
  const text = await read();
49
- if (text !== undefined)
50
- latestText = text;
51
58
  if (text !== undefined && lastText !== undefined && text !== lastText) {
52
59
  lastText = text;
53
60
  textMoved = true;
@@ -73,19 +80,19 @@ async function settleAfterClick(page, counter, preCount, submitShaped, readText,
73
80
  }
74
81
  if (seen) {
75
82
  quiet += 1;
76
- if (quiet >= (textMoved ? TEXT_QUIET_POLLS : QUIET_POLLS)) {
77
- const halfTransitioned = advanced !== undefined &&
78
- textMoved &&
79
- latestText !== undefined &&
80
- !advanced(latestText) &&
81
- halfTransitionWaited < HALF_TRANSITION_MAX_MS;
82
- if (!halfTransitioned)
83
+ if (!textMoved && !submitShaped) {
84
+ if (quiet >= QUIET_POLLS)
83
85
  return;
84
- halfTransitionWaited += POLL_MS;
86
+ continue;
85
87
  }
88
+ if (quiet >= TEXT_QUIET_POLLS && elapsed >= exports.IDLE_GIVE_UP_MS)
89
+ return;
86
90
  continue;
87
91
  }
88
- if (!submitShaped || elapsed >= IDLE_GIVE_UP_MS)
92
+ if (!submitShaped)
93
+ return;
94
+ const giveUpMs = readQuiescence ? exports.QUIESCENT_NO_OP_GIVE_UP_MS : exports.IDLE_GIVE_UP_MS;
95
+ if (elapsed >= giveUpMs)
89
96
  return;
90
97
  }
91
98
  }
@@ -128,7 +135,7 @@ exports.QUIESCENCE_PROBE_EXPR = `(() => {
128
135
  * snapshot instead of each call site hand-building its own reader.
129
136
  */
130
137
  async function settleAndSnapshot(target) {
131
- await settleAfterClick(target.page, target.counter, target.pre.networkCount, target.submitShaped, async () => (await target.snapshot(false)).visibleTextSignature, target.pre.visibleTextSignature, target.readQuiescence, target.advanced);
138
+ await settleAfterClick(target.page, target.counter, target.pre.networkCount, target.submitShaped, async () => (await target.snapshot(false)).visibleTextSignature, target.pre.visibleTextSignature, target.readQuiescence);
132
139
  return target.snapshot(true);
133
140
  }
134
141
  //# sourceMappingURL=click-settle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"click-settle.js","sourceRoot":"","sources":["../../src/scraper/click-settle.ts"],"names":[],"mappings":";;;;;AAaA,MAAM,OAAO,GAAG,IAAI,CAAC;AACrB,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,eAAe,GAAG,KAAK,CAAC;AAC9B,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,MAAM,GAAG,KAAK,CAAC;AACrB,MAAM,sBAAsB,GAAG,KAAK,CAAC;AAErC;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M,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,oBAAoB,EAC/D,MAAM,CAAC,GAAG,CAAC,oBAAoB,EAC/B,MAAM,CAAC,cAAc,CACtB,CAAC;IACF,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"deep-locator-actuate.d.ts","sourceRoot":"","sources":["../../src/scraper/deep-locator-actuate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAYrD,OAAO,EAEL,KAAK,WAAW,EAEjB,MAAM,wBAAwB,CAAC;AAehC,qJAAqJ;AACrJ,MAAM,WAAW,gCAAgC;IAC/C,wIAAwI;IACxI,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;;;;;;;;;;;;OAiBG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AA8ID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACxC,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,cAAc,GAAE,gCAAqC,GACpD,OAAO,CAAC,OAAO,CAAC,CA4ClB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,gCAAgC,CACpD,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACxC,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,cAAc,GAAE,gCAAqC,GACpD,OAAO,CAAC,OAAO,CAAC,CA2ClB"}
1
+ {"version":3,"file":"deep-locator-actuate.d.ts","sourceRoot":"","sources":["../../src/scraper/deep-locator-actuate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAYrD,OAAO,EAEL,KAAK,WAAW,EAEjB,MAAM,wBAAwB,CAAC;AAgBhC,qJAAqJ;AACrJ,MAAM,WAAW,gCAAgC;IAC/C,wIAAwI;IACxI,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;;;;;;;;;;;;OAiBG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAkKD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACxC,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,cAAc,GAAE,gCAAqC,GACpD,OAAO,CAAC,OAAO,CAAC,CAgDlB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,gCAAgC,CACpD,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACxC,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,cAAc,GAAE,gCAAqC,GACpD,OAAO,CAAC,OAAO,CAAC,CA2ClB"}
@@ -28,6 +28,7 @@ const errors_1 = require("../lib/errors");
28
28
  const logging_1 = require("../lib/logging");
29
29
  const deep_locator_scan_1 = require("./deep-locator-scan");
30
30
  const frame_target_1 = require("./frame-target");
31
+ const segmented_date_spinbutton_1 = require("./segmented-date-spinbutton");
31
32
  const watchdog_1 = require("./watchdog");
32
33
  const logger = (0, logging_1.getLogger)({ name: "scraper/deep-locator-actuate" });
33
34
  /**
@@ -108,6 +109,21 @@ function isFrameCandidateWriteResult(entry) {
108
109
  return typeof result.readBack === "string";
109
110
  return result.reason === "out-of-range" || result.reason === "not-actionable";
110
111
  }
112
+ /**
113
+ * Wraps a write expression so the shared detector runs in the SAME evaluate,
114
+ * before any write: a date segment reports `not-actionable`, which makes the
115
+ * caller return `false` without the legacy `Locator.fill` fallback.
116
+ */
117
+ function guardAgainstDateSegmentWrite(innerSelector, index, writeExpr) {
118
+ return `(() => {
119
+ const target = Array.from(document.querySelectorAll(${JSON.stringify(innerSelector)}))[${JSON.stringify(index)}];
120
+ if (target) {
121
+ ${segmented_date_spinbutton_1.SEGMENT_OWNER_JS}
122
+ if (isDateSegment(target)) return { written: false, reason: "not-actionable" };
123
+ }
124
+ return ${writeExpr};
125
+ })()`;
126
+ }
111
127
  /**
112
128
  * Re-reads the candidate's CURRENT value through a second batched
113
129
  * `frameTarget.evaluate(buildReadBackFrameCandidateExpr(...))` round-trip,
@@ -203,7 +219,7 @@ async function fillDeepLocatorCandidate(page, frameSelector, innerSelector, inde
203
219
  const hopSelector = (0, frame_target_1.buildHopSelector)(frameSelector, innerSelector);
204
220
  const frameTarget = await resolveActuateFrameTarget(page, frameSelector, timeoutOptions);
205
221
  const batchedResult = frameTarget
206
- ? await actuateCandidateBatched(page, frameSelector, hopSelector, index, { ...timeoutOptions, frameTarget }, (0, deep_locator_scan_1.buildFillFrameCandidateExpr)(innerSelector, index, value), "fill")
222
+ ? await actuateCandidateBatched(page, frameSelector, hopSelector, index, { ...timeoutOptions, frameTarget }, guardAgainstDateSegmentWrite(innerSelector, index, (0, deep_locator_scan_1.buildFillFrameCandidateExpr)(innerSelector, index, value)), "fill")
207
223
  : null;
208
224
  if (frameTarget &&
209
225
  batchedResult?.written &&
@@ -1 +1 @@
1
- {"version":3,"file":"deep-locator-actuate.js","sourceRoot":"","sources":["../../src/scraper/deep-locator-actuate.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;AAIH,yCAA8C;AAC9C,2CAA0C;AAC1C,mEAOqC;AACrC,yDAIgC;AAChC,iDAAwE;AAExE,M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tB,CAAC,MAAM,wBAAwB,CAC7B,WAAW,EACX,IAAA,mDAA+B,EAAC,aAAa,EAAE,KAAK,CAAC,EACrD,aAAa,CAAC,QAAQ,IAAI,EAAE,CAC7B,CAAC,EACF,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,aAAa,EAAE,MAAM,KAAK,gBAAgB;QAAE,OAAO,KAAK,CAAC;IAE7D,MAAM,mBAAmB,GAAG,aAAa,GAAG,KAAK,GAAG,0DAAsC,CAAC;IAC3F,OAAO,cAAc,CACnB,GAAG,EAAE,CACH,IAAA,uBAAY,EAAC,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE;QAC/E,SAAS,EAAE,mBAAmB;QAC9B,KAAK,EAAE,kCAAkC,WAAW,QAAQ,KAAK,EAAE;KACpE,CAAC,EACJ,GAAG,EAAE,CACH,IAAA,uBAAY,EAAC,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,UAAU,EAAE,EAAE;QACxE,SAAS,EAAE,mBAAmB;QAC9B,KAAK,EAAE,gCAAgC,WAAW,QAAQ,KAAK,EAAE;KAClE,CAAC,EACJ,KAAK,CACN,CAAC;AACJ,CAAC"}
@@ -609,7 +609,7 @@ function makeFakeFrameResolutionPage(options) {
609
609
  }
610
610
  // The resolver's non-empty tiebreak probe; a genuine attached frame has
611
611
  // content.
612
- if (/document\.body/.test(String(expression))) {
612
+ if (String(expression).startsWith("!!(document.body")) {
613
613
  return resolveAfterProbeDelay(true, probeDelayMs);
614
614
  }
615
615
  return (await options.onFrameEvaluate?.(expression)) ?? null;