@enricai/barnacle 1.6.0 → 1.6.2
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/README.md +66 -7
- package/dist/scraper/cookie-jar.d.ts +19 -0
- package/dist/scraper/cookie-jar.d.ts.map +1 -0
- package/dist/scraper/cookie-jar.js +43 -0
- package/dist/scraper/cookie-jar.js.map +1 -0
- package/dist/scraper/deep-query.d.ts +36 -0
- package/dist/scraper/deep-query.d.ts.map +1 -0
- package/dist/scraper/deep-query.js +87 -0
- package/dist/scraper/deep-query.js.map +1 -0
- package/dist/scraper/errors.d.ts +11 -2
- package/dist/scraper/errors.d.ts.map +1 -1
- package/dist/scraper/errors.js +10 -1
- package/dist/scraper/errors.js.map +1 -1
- package/dist/scraper/flow-runner.d.ts +55 -4
- package/dist/scraper/flow-runner.d.ts.map +1 -1
- package/dist/scraper/flow-runner.js +259 -50
- package/dist/scraper/flow-runner.js.map +1 -1
- package/dist/scraper/phantom-click.d.ts +45 -0
- package/dist/scraper/phantom-click.d.ts.map +1 -0
- package/dist/scraper/phantom-click.js +37 -0
- package/dist/scraper/phantom-click.js.map +1 -0
- package/dist/scraper/session-browserbase.d.ts +48 -0
- package/dist/scraper/session-browserbase.d.ts.map +1 -1
- package/dist/scraper/session-browserbase.js +10 -5
- package/dist/scraper/session-browserbase.js.map +1 -1
- package/dist/scraper/session-shared.d.ts +6 -0
- package/dist/scraper/session-shared.d.ts.map +1 -1
- package/dist/scraper/session-shared.js.map +1 -1
- package/dist/scraper/submit-control.d.ts +51 -0
- package/dist/scraper/submit-control.d.ts.map +1 -0
- package/dist/scraper/submit-control.js +142 -0
- package/dist/scraper/submit-control.js.map +1 -0
- package/dist/scripts/recon-browser.d.ts +34 -12
- package/dist/scripts/recon-browser.d.ts.map +1 -1
- package/dist/scripts/recon-browser.js +78 -33
- package/dist/scripts/recon-browser.js.map +1 -1
- package/dist/scripts/recon-generate.d.ts +28 -7
- package/dist/scripts/recon-generate.d.ts.map +1 -1
- package/dist/scripts/recon-generate.js +50 -24
- package/dist/scripts/recon-generate.js.map +1 -1
- package/dist/scripts/recon-http.d.ts +36 -5
- package/dist/scripts/recon-http.d.ts.map +1 -1
- package/dist/scripts/recon-http.js +77 -47
- package/dist/scripts/recon-http.js.map +1 -1
- package/dist/scripts/recon-replay-jobs.d.ts +25 -1
- package/dist/scripts/recon-replay-jobs.d.ts.map +1 -1
- package/dist/scripts/recon-replay-jobs.js +33 -23
- package/dist/scripts/recon-replay-jobs.js.map +1 -1
- package/dist/scripts/recon-shared.d.ts +68 -0
- package/dist/scripts/recon-shared.d.ts.map +1 -1
- package/dist/scripts/recon-shared.js +94 -1
- package/dist/scripts/recon-shared.js.map +1 -1
- package/dist/scripts/recon-summarize.d.ts +5 -1
- package/dist/scripts/recon-summarize.d.ts.map +1 -1
- package/dist/scripts/recon-summarize.js +19 -7
- package/dist/scripts/recon-summarize.js.map +1 -1
- package/package.json +9 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recon-generate.d.ts","sourceRoot":"","sources":["../../src/scripts/recon-generate.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"recon-generate.d.ts","sourceRoot":"","sources":["../../src/scripts/recon-generate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAiBH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAG3D,OAAO,EAAoB,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EACL,KAAK,OAAO,EAKb,MAAM,wBAAwB,CAAC;AA2EhC;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,MAAM,EACnB,QAAQ,CAAC,EAAE,MAAM,EACjB,SAAS,CAAC,EAAE,OAAO,EACnB,UAAU,GAAE,eAAmD,GAC9D,MAAM,GAAG,IAAI,CAoBf;AAUD,UAAU,SAAS;IACjB,e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coding is required between running recon and registering the plugin.
|
|
6
6
|
*
|
|
7
7
|
* Usage:
|
|
8
|
-
* pnpm run recon:generate -- --site-id my-site [--force]
|
|
8
|
+
* pnpm run recon:generate -- --site-id my-site [--run-dir <path>] [--force]
|
|
9
9
|
*
|
|
10
10
|
* --force overwrites an existing src/sites/<siteId>/ directory.
|
|
11
|
+
* --run-dir selects which run root to read; defaults to the most recently
|
|
12
|
+
* modified run root under the recon output base dir (see
|
|
13
|
+
* {@link resolveLatestReconRunRoot}), so the existing two-command
|
|
14
|
+
* "recon, then generate" workflow keeps working unchanged.
|
|
11
15
|
*
|
|
12
|
-
* Reads from:
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
16
|
+
* Reads from (under the resolved run root):
|
|
17
|
+
* graphql/*.json — Capture[] from recon-browser.ts
|
|
18
|
+
* replays/*.json — ReplayResult[] from recon-http.ts
|
|
19
|
+
* replays/rate-limit.json
|
|
20
|
+
* aux/*.json — static fixture files
|
|
17
21
|
* src/sites/<siteId>/recon-flow.json — plain-English flow steps
|
|
18
22
|
*/
|
|
19
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -22,6 +26,7 @@ exports.inferZodSchemaFromSamples = inferZodSchemaFromSamples;
|
|
|
22
26
|
exports.selectPayloadAction = selectPayloadAction;
|
|
23
27
|
exports.extractActionSequence = extractActionSequence;
|
|
24
28
|
exports.detectFormSchemaFieldNames = detectFormSchemaFieldNames;
|
|
29
|
+
exports.walkSetCookiePairs = walkSetCookiePairs;
|
|
25
30
|
exports.indexStateValues = indexStateValues;
|
|
26
31
|
exports.compileActionSteps = compileActionSteps;
|
|
27
32
|
exports.loadQuestionPromptKeywords = loadQuestionPromptKeywords;
|
|
@@ -1070,6 +1075,12 @@ function applyRawOptionIdPayloadSubstitutions(rawBody, fieldNameMap, fieldOption
|
|
|
1070
1075
|
/** Maximum length to guard against indexing massive blobs (HTML fragments,
|
|
1071
1076
|
* embedded base64 images, etc.) that aren't candidates for state threading. */
|
|
1072
1077
|
const MAX_STATE_VALUE_LENGTH = 256;
|
|
1078
|
+
/** Maximum length for `Set-Cookie`-origin values, distinct from
|
|
1079
|
+
* `MAX_STATE_VALUE_LENGTH`. Auth tokens (JWTs) legitimately exceed the
|
|
1080
|
+
* body-blob cap — a 272-char session cookie is normal, not a massive blob —
|
|
1081
|
+
* so cookie origins get their own, more permissive ceiling. Still bounded so
|
|
1082
|
+
* a pathological cookie can't blow up the index. */
|
|
1083
|
+
const MAX_COOKIE_STATE_VALUE_LENGTH = 4096;
|
|
1073
1084
|
/** Canonical "uninitialized" sentinel values that some REST APIs return as
|
|
1074
1085
|
* placeholders before a downstream call populates the real identifier. An ATS
|
|
1075
1086
|
* whose `/user/create` returns these for CandidateId/ApplicationId/
|
|
@@ -1084,19 +1095,24 @@ const PLACEHOLDER_STATE_VALUES = new Set(["00000000-0000-0000-0000-000000000000"
|
|
|
1084
1095
|
* Splits a raw `Set-Cookie` response-header string into `name`/`value` pairs.
|
|
1085
1096
|
* Captures store `responseHeaders` as a flat `Record<string, string>`
|
|
1086
1097
|
* (see recon-shared.ts's `Capture`), so multiple `Set-Cookie` headers from the
|
|
1087
|
-
* same response
|
|
1088
|
-
*
|
|
1089
|
-
*
|
|
1098
|
+
* same response are folded by the recon browser's CDP session into one
|
|
1099
|
+
* newline-delimited string — each line is one cookie's `name=value; attrs...`.
|
|
1100
|
+
* This walks every newline-delimited line and recovers the name/value pair
|
|
1101
|
+
* from before that line's first `;`, skipping any line with no `=`.
|
|
1090
1102
|
*/
|
|
1103
|
+
/** Exported for unit testing — lets tests exercise the newline-fold parsing
|
|
1104
|
+
* directly against synthetic multi-cookie strings. */
|
|
1091
1105
|
function* walkSetCookiePairs(rawSetCookie) {
|
|
1092
|
-
const
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1106
|
+
for (const line of rawSetCookie.split("\n")) {
|
|
1107
|
+
const pair = line.split(";", 1)[0] ?? "";
|
|
1108
|
+
const eq = pair.indexOf("=");
|
|
1109
|
+
if (eq === -1)
|
|
1110
|
+
continue;
|
|
1111
|
+
const name = pair.slice(0, eq).trim();
|
|
1112
|
+
const value = pair.slice(eq + 1).trim();
|
|
1113
|
+
if (name && value)
|
|
1114
|
+
yield { name, value };
|
|
1115
|
+
}
|
|
1100
1116
|
}
|
|
1101
1117
|
/**
|
|
1102
1118
|
* Walks every capture's response (including GETs — formHistoryId-style values
|
|
@@ -1107,7 +1123,9 @@ function* walkSetCookiePairs(rawSetCookie) {
|
|
|
1107
1123
|
* Also indexes response-header/cookie-origin values (e.g. a `Set-Cookie`
|
|
1108
1124
|
* auth token) the same way, tagged with `headerOrigin` instead of a body
|
|
1109
1125
|
* `path` — this is what lets a stateful API's token-mint response feed a
|
|
1110
|
-
* later call's `Cookie` header via `compileActionSteps`.
|
|
1126
|
+
* later call's `Cookie` header via `compileActionSteps`. Cookie-origin values
|
|
1127
|
+
* are capped by `MAX_COOKIE_STATE_VALUE_LENGTH`, not `MAX_STATE_VALUE_LENGTH`
|
|
1128
|
+
* — session JWTs routinely exceed the body-blob cap.
|
|
1111
1129
|
*
|
|
1112
1130
|
* The index is intentionally permissive — it doesn't try to shape-match
|
|
1113
1131
|
* "what looks like a token" because token shapes are an open set across the
|
|
@@ -1143,7 +1161,7 @@ function indexStateValues(captures, shieldedUuids = new Set(), actionCaptureIndi
|
|
|
1143
1161
|
for (const { name, value } of walkSetCookiePairs(rawSetCookie)) {
|
|
1144
1162
|
if (value.length < MIN_STATE_VALUE_LENGTH)
|
|
1145
1163
|
continue;
|
|
1146
|
-
if (value.length >
|
|
1164
|
+
if (value.length > MAX_COOKIE_STATE_VALUE_LENGTH)
|
|
1147
1165
|
continue;
|
|
1148
1166
|
if (PLACEHOLDER_STATE_VALUES.has(value))
|
|
1149
1167
|
continue;
|
|
@@ -2655,6 +2673,7 @@ async function main() {
|
|
|
2655
2673
|
let emit = "ts";
|
|
2656
2674
|
let vocabularySpecifier = "";
|
|
2657
2675
|
let formSchemaSpecifier = "";
|
|
2676
|
+
let runDir;
|
|
2658
2677
|
for (let i = 0; i < args.length; i++) {
|
|
2659
2678
|
if (args[i] === "--site-id" && args[i + 1])
|
|
2660
2679
|
siteId = args[++i];
|
|
@@ -2662,6 +2681,8 @@ async function main() {
|
|
|
2662
2681
|
vocabularySpecifier = args[++i];
|
|
2663
2682
|
else if (args[i] === "--form-schema" && args[i + 1])
|
|
2664
2683
|
formSchemaSpecifier = args[++i];
|
|
2684
|
+
else if (args[i] === "--run-dir" && args[i + 1])
|
|
2685
|
+
runDir = args[++i];
|
|
2665
2686
|
else if (args[i] === "--force")
|
|
2666
2687
|
force = true;
|
|
2667
2688
|
else if (args[i] === "--emit" && args[i + 1]) {
|
|
@@ -2687,14 +2708,19 @@ async function main() {
|
|
|
2687
2708
|
logger.error(`${manifestPath} already exists — pass --force to overwrite`);
|
|
2688
2709
|
process.exit(1);
|
|
2689
2710
|
}
|
|
2690
|
-
const
|
|
2691
|
-
|
|
2711
|
+
const runRoot = (0, recon_shared_1.resolveLatestReconRunRoot)(runDir);
|
|
2712
|
+
logger.info(`reading recon artifacts from ${runRoot}`);
|
|
2713
|
+
const capturesDir = (0, node_path_1.join)(runRoot, "graphql");
|
|
2714
|
+
const replaysDir = (0, node_path_1.join)(runRoot, "replays");
|
|
2715
|
+
const auxDir = (0, node_path_1.join)(runRoot, "aux");
|
|
2716
|
+
const captures = (0, recon_shared_1.readJsonDir)(capturesDir);
|
|
2717
|
+
const replays = (0, recon_shared_1.readJsonDir)(replaysDir, [
|
|
2692
2718
|
"rate-limit.json",
|
|
2693
2719
|
"introspection-schema.json",
|
|
2694
2720
|
]);
|
|
2695
2721
|
const rateLimits = (() => {
|
|
2696
2722
|
try {
|
|
2697
|
-
return JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(
|
|
2723
|
+
return JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(replaysDir, "rate-limit.json"), "utf8"));
|
|
2698
2724
|
}
|
|
2699
2725
|
catch {
|
|
2700
2726
|
return [];
|
|
@@ -2702,7 +2728,7 @@ async function main() {
|
|
|
2702
2728
|
})();
|
|
2703
2729
|
const auxFiles = (() => {
|
|
2704
2730
|
try {
|
|
2705
|
-
return (0, node_fs_1.readdirSync)(
|
|
2731
|
+
return (0, node_fs_1.readdirSync)(auxDir)
|
|
2706
2732
|
.filter((f) => f.endsWith(".json"))
|
|
2707
2733
|
.sort();
|
|
2708
2734
|
}
|
|
@@ -3017,7 +3043,7 @@ async function main() {
|
|
|
3017
3043
|
if (auxFiles.length > 0) {
|
|
3018
3044
|
(0, node_fs_1.mkdirSync)(`${outDir}/fixtures`, { recursive: true });
|
|
3019
3045
|
for (const f of auxFiles) {
|
|
3020
|
-
(0, node_fs_1.copyFileSync)((0, node_path_1.join)(
|
|
3046
|
+
(0, node_fs_1.copyFileSync)((0, node_path_1.join)(auxDir, f), `${outDir}/fixtures/${f}`);
|
|
3021
3047
|
}
|
|
3022
3048
|
logger.info(`copied ${auxFiles.length} fixture(s) to ${outDir}/fixtures/`);
|
|
3023
3049
|
}
|