@enricai/barnacle 1.12.13 → 1.12.15
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 +1 -1
- package/dist/recon/capture-filters.d.ts +9 -0
- package/dist/recon/capture-filters.d.ts.map +1 -1
- package/dist/recon/capture-filters.js +16 -0
- package/dist/recon/capture-filters.js.map +1 -1
- package/dist/scripts/recon-generate.d.ts +25 -0
- package/dist/scripts/recon-generate.d.ts.map +1 -1
- package/dist/scripts/recon-generate.js +271 -26
- package/dist/scripts/recon-generate.js.map +1 -1
- package/dist/scripts/recon-http.d.ts +7 -0
- package/dist/scripts/recon-http.d.ts.map +1 -1
- package/dist/scripts/recon-http.js +7 -5
- package/dist/scripts/recon-http.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -343,7 +343,7 @@ import type { SitePlugin, SitePluginContext, SitePluginResult } from "@/site-plu
|
|
|
343
343
|
import { runMySiteBrowserFlow } from "@/sites/my-site/flows/browser-flow";
|
|
344
344
|
|
|
345
345
|
// Generated: Zod schemas inferred from captured JSON — tighten z.unknown() fields as needed.
|
|
346
|
-
const MySiteResponseSchema = z.object({ data: z.object({ items: z.array(z.object({ id: z.string() })) }) });
|
|
346
|
+
export const MySiteResponseSchema = z.object({ data: z.object({ items: z.array(z.object({ id: z.string() })) }) });
|
|
347
347
|
const MySitePayloadSchema = z.object({ query: z.string().min(1) });
|
|
348
348
|
|
|
349
349
|
type MySitePayload = z.infer<typeof MySitePayloadSchema>;
|
|
@@ -47,4 +47,13 @@ export declare function isNoiseUrl(url: string): boolean;
|
|
|
47
47
|
* public suffixes (e.g. `co.uk`), which this codebase does not target.
|
|
48
48
|
*/
|
|
49
49
|
export declare function registrableDomain(hostname: string): string;
|
|
50
|
+
/**
|
|
51
|
+
* True when `hostname` is allowed as a fixture host: an exact match against
|
|
52
|
+
* `ownBackendHostnames` when the flow declares any, otherwise a
|
|
53
|
+
* same-registrable-domain match against `fallbackDomain`. Shared by
|
|
54
|
+
* `recon-http.ts`'s write-time filter and `recon-generate.ts`'s copy-time
|
|
55
|
+
* filter so which hosts count as "the site's own backend" cannot drift
|
|
56
|
+
* between capture and emission.
|
|
57
|
+
*/
|
|
58
|
+
export declare function isAllowedFixtureHost(hostname: string, ownBackendHostnames: string[], fallbackDomain: string | null): boolean;
|
|
50
59
|
//# sourceMappingURL=capture-filters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture-filters.d.ts","sourceRoot":"","sources":["../../src/recon/capture-filters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAW/C;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,QAAyB,CAAC;AAmC9D;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAc/C;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAM1D"}
|
|
1
|
+
{"version":3,"file":"capture-filters.d.ts","sourceRoot":"","sources":["../../src/recon/capture-filters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAW/C;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,QAAyB,CAAC;AAmC9D;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAc/C;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAM1D;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,mBAAmB,EAAE,MAAM,EAAE,EAC7B,cAAc,EAAE,MAAM,GAAG,IAAI,GAC5B,OAAO,CAKT"}
|
|
@@ -15,6 +15,7 @@ exports.ERROR_SINK_PATH_SEGMENT = void 0;
|
|
|
15
15
|
exports.telemetryUrlPatterns = telemetryUrlPatterns;
|
|
16
16
|
exports.isNoiseUrl = isNoiseUrl;
|
|
17
17
|
exports.registrableDomain = registrableDomain;
|
|
18
|
+
exports.isAllowedFixtureHost = isAllowedFixtureHost;
|
|
18
19
|
/**
|
|
19
20
|
* Path/URL substrings we always treat as analytics or logging noise. Site-specific
|
|
20
21
|
* trackers belong in the `RECON_TELEMETRY_URL_PATTERNS` env var (comma-separated),
|
|
@@ -120,4 +121,19 @@ function registrableDomain(hostname) {
|
|
|
120
121
|
.filter((label) => label.length > 0);
|
|
121
122
|
return labels.length <= 2 ? labels.join(".") : labels.slice(-2).join(".");
|
|
122
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* True when `hostname` is allowed as a fixture host: an exact match against
|
|
126
|
+
* `ownBackendHostnames` when the flow declares any, otherwise a
|
|
127
|
+
* same-registrable-domain match against `fallbackDomain`. Shared by
|
|
128
|
+
* `recon-http.ts`'s write-time filter and `recon-generate.ts`'s copy-time
|
|
129
|
+
* filter so which hosts count as "the site's own backend" cannot drift
|
|
130
|
+
* between capture and emission.
|
|
131
|
+
*/
|
|
132
|
+
function isAllowedFixtureHost(hostname, ownBackendHostnames, fallbackDomain) {
|
|
133
|
+
const host = hostname.toLowerCase();
|
|
134
|
+
const allowedHostnames = new Set(ownBackendHostnames.map((h) => h.toLowerCase()));
|
|
135
|
+
if (allowedHostnames.size > 0)
|
|
136
|
+
return allowedHostnames.has(host);
|
|
137
|
+
return fallbackDomain !== null && registrableDomain(host) === fallbackDomain;
|
|
138
|
+
}
|
|
123
139
|
//# sourceMappingURL=capture-filters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture-filters.js","sourceRoot":"","sources":["../../src/recon/capture-filters.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG
|
|
1
|
+
{"version":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iB,CAAC,IAAI,CAAC,KAAK,cAAc,CAAC;AAC/E,CAAC"}
|
|
@@ -132,7 +132,32 @@ export declare function resolveCompositePersonaFields(instruction: string, known
|
|
|
132
132
|
interface InferOpts {
|
|
133
133
|
multipartCoerce?: boolean;
|
|
134
134
|
maxDepth?: number;
|
|
135
|
+
/** Field names carrying an `@include`/`@skip` directive anywhere in the
|
|
136
|
+
* GraphQL query this inference is drawn from, as collected by
|
|
137
|
+
* {@link collectConditionalGraphQLFieldNames}. The server may legally omit
|
|
138
|
+
* these regardless of what a single capture happened to show, so they're
|
|
139
|
+
* OR'd into the same presence-driven `.optional()` decision rather than
|
|
140
|
+
* appending a second independent `.optional()`. */
|
|
141
|
+
conditionalFieldNames?: ReadonlySet<string>;
|
|
135
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* Walks a GraphQL query's selection set and collects the names of fields
|
|
145
|
+
* carrying `@include(if: ...)` or `@skip(if: ...)`. The server omits such a
|
|
146
|
+
* field entirely when its condition doesn't hold, so a single capture where
|
|
147
|
+
* the field happens to be present proves nothing about whether it's always
|
|
148
|
+
* present — schema inference needs this signal to avoid typing a legally
|
|
149
|
+
* omittable field as required.
|
|
150
|
+
*
|
|
151
|
+
* Deliberately a scoped regex over the query text rather than a full GraphQL
|
|
152
|
+
* AST parser — the "battle-tested libraries only" rule covers the
|
|
153
|
+
* fastify/zod/stagehand stack, not query-text scanning, and this is
|
|
154
|
+
* proportionate to the existing hand-rolled string processing in this file
|
|
155
|
+
* (e.g. {@link spliceFacetsIntoStringVariable}). Matches by field name only
|
|
156
|
+
* (not by path), since a directive-bearing field name recurs unchanged across
|
|
157
|
+
* every nesting depth and sibling object shape it appears in within the same
|
|
158
|
+
* query.
|
|
159
|
+
*/
|
|
160
|
+
export declare function collectConditionalGraphQLFieldNames(query: string): ReadonlySet<string>;
|
|
136
161
|
/**
|
|
137
162
|
* Infers a Zod schema expression string from every observed sample of a value,
|
|
138
163
|
* not just the first.
|
|
@@ -1 +1 @@
|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Field = deriveFillLabelField;
|
|
28
28
|
exports.harvestPersonaBindings = harvestPersonaBindings;
|
|
29
29
|
exports.resolveCompositePersonaFields = resolveCompositePersonaFields;
|
|
30
|
+
exports.collectConditionalGraphQLFieldNames = collectConditionalGraphQLFieldNames;
|
|
30
31
|
exports.inferZodSchemaFromSamples = inferZodSchemaFromSamples;
|
|
31
32
|
exports.selectPayloadAction = selectPayloadAction;
|
|
32
33
|
exports.selectReturnAction = selectReturnAction;
|
|
@@ -467,6 +468,33 @@ function assertNoLeakedPersonaConstant(code, knownFieldValues) {
|
|
|
467
468
|
* while still bounding output for pathological payloads.
|
|
468
469
|
*/
|
|
469
470
|
const DEFAULT_MAX_INFER_DEPTH = 12;
|
|
471
|
+
/**
|
|
472
|
+
* Walks a GraphQL query's selection set and collects the names of fields
|
|
473
|
+
* carrying `@include(if: ...)` or `@skip(if: ...)`. The server omits such a
|
|
474
|
+
* field entirely when its condition doesn't hold, so a single capture where
|
|
475
|
+
* the field happens to be present proves nothing about whether it's always
|
|
476
|
+
* present — schema inference needs this signal to avoid typing a legally
|
|
477
|
+
* omittable field as required.
|
|
478
|
+
*
|
|
479
|
+
* Deliberately a scoped regex over the query text rather than a full GraphQL
|
|
480
|
+
* AST parser — the "battle-tested libraries only" rule covers the
|
|
481
|
+
* fastify/zod/stagehand stack, not query-text scanning, and this is
|
|
482
|
+
* proportionate to the existing hand-rolled string processing in this file
|
|
483
|
+
* (e.g. {@link spliceFacetsIntoStringVariable}). Matches by field name only
|
|
484
|
+
* (not by path), since a directive-bearing field name recurs unchanged across
|
|
485
|
+
* every nesting depth and sibling object shape it appears in within the same
|
|
486
|
+
* query.
|
|
487
|
+
*/
|
|
488
|
+
function collectConditionalGraphQLFieldNames(query) {
|
|
489
|
+
const names = new Set();
|
|
490
|
+
const pattern = /([A-Za-z_][A-Za-z0-9_]*)\s*(?:\([^()]*\))?\s*@(?:include|skip)\s*\(/g;
|
|
491
|
+
for (const match of query.matchAll(pattern)) {
|
|
492
|
+
const fieldName = match[1];
|
|
493
|
+
if (fieldName)
|
|
494
|
+
names.add(fieldName);
|
|
495
|
+
}
|
|
496
|
+
return names;
|
|
497
|
+
}
|
|
470
498
|
/**
|
|
471
499
|
* Infers a Zod schema expression string from every observed sample of a value,
|
|
472
500
|
* not just the first.
|
|
@@ -532,9 +560,12 @@ function inferZodSchemaFromSamples(samples, depth = 0, indent = "", opts = {}) {
|
|
|
532
560
|
.map((k) => {
|
|
533
561
|
const valuesForKey = objects.filter((o) => k in o).map((o) => o[k]);
|
|
534
562
|
const expr = inferZodSchemaFromSamples(valuesForKey, depth + 1, inner, opts);
|
|
535
|
-
// Seen on some samples but not others
|
|
536
|
-
//
|
|
537
|
-
|
|
563
|
+
// Seen on some samples but not others (the endpoint omits it sometimes)
|
|
564
|
+
// OR the query marks it @include/@skip-conditional (the server can
|
|
565
|
+
// legally omit it regardless of what this sample happened to show):
|
|
566
|
+
// either signal alone is enough to require callers to guard the field.
|
|
567
|
+
const isOptional = valuesForKey.length < objects.length || (opts.conditionalFieldNames?.has(k) ?? false);
|
|
568
|
+
const optional = isOptional ? `${expr}.optional()` : expr;
|
|
538
569
|
return `${inner}${isValidJsIdentifier(k) ? k : JSON.stringify(k)}: ${optional}`;
|
|
539
570
|
})
|
|
540
571
|
.join(",\n");
|
|
@@ -3582,6 +3613,174 @@ function renderGqlVariablesExpr(variables, payloadFieldNames) {
|
|
|
3582
3613
|
});
|
|
3583
3614
|
return entries.length > 0 ? `{ ${entries.join(", ")} }` : "{}";
|
|
3584
3615
|
}
|
|
3616
|
+
/** A count-style page-size key (e.g. `count`, `limit`, `first`) paired with a
|
|
3617
|
+
* skip-style offset key (e.g. `skip`, `offset`) in the same object is the
|
|
3618
|
+
* shape a paginated listings query's variables take. */
|
|
3619
|
+
const PAGE_SIZE_KEY_PATTERN = /^(count|limit|pageSize|first|take)$/i;
|
|
3620
|
+
const SKIP_KEY_PATTERN = /^(skip|offset)$/i;
|
|
3621
|
+
/** A numeric field named for "the total size of a larger set the current
|
|
3622
|
+
* page is a slice of" — as opposed to the page-size variable, which lives in
|
|
3623
|
+
* the request variables, not the response body. */
|
|
3624
|
+
const TOTAL_FIELD_PATTERN = /total/i;
|
|
3625
|
+
function findPaginationContainer(variables, path = []) {
|
|
3626
|
+
if (variables === null || typeof variables !== "object" || Array.isArray(variables))
|
|
3627
|
+
return null;
|
|
3628
|
+
const entries = Object.entries(variables);
|
|
3629
|
+
const countEntry = entries.find(([k, v]) => PAGE_SIZE_KEY_PATTERN.test(k) && typeof v === "number" && v > 0);
|
|
3630
|
+
const skipEntry = entries.find(([k, v]) => SKIP_KEY_PATTERN.test(k) && typeof v === "number");
|
|
3631
|
+
if (countEntry && skipEntry) {
|
|
3632
|
+
return {
|
|
3633
|
+
path,
|
|
3634
|
+
countKey: countEntry[0],
|
|
3635
|
+
skipKey: skipEntry[0],
|
|
3636
|
+
pageSize: countEntry[1],
|
|
3637
|
+
};
|
|
3638
|
+
}
|
|
3639
|
+
for (const [key, value] of entries) {
|
|
3640
|
+
const found = findPaginationContainer(value, [...path, key]);
|
|
3641
|
+
if (found)
|
|
3642
|
+
return found;
|
|
3643
|
+
}
|
|
3644
|
+
return null;
|
|
3645
|
+
}
|
|
3646
|
+
/** Depth-first search for the first numeric leaf whose key matches `pattern`. */
|
|
3647
|
+
function findNumericFieldByName(value, pattern, path = []) {
|
|
3648
|
+
if (value === null || typeof value !== "object")
|
|
3649
|
+
return null;
|
|
3650
|
+
if (Array.isArray(value)) {
|
|
3651
|
+
for (const item of value) {
|
|
3652
|
+
const found = findNumericFieldByName(item, pattern, path);
|
|
3653
|
+
if (found)
|
|
3654
|
+
return found;
|
|
3655
|
+
}
|
|
3656
|
+
return null;
|
|
3657
|
+
}
|
|
3658
|
+
const entries = Object.entries(value);
|
|
3659
|
+
const direct = entries.find(([k, v]) => typeof v === "number" && pattern.test(k));
|
|
3660
|
+
if (direct)
|
|
3661
|
+
return [...path, direct[0]];
|
|
3662
|
+
for (const [key, v] of entries) {
|
|
3663
|
+
const found = findNumericFieldByName(v, pattern, [...path, key]);
|
|
3664
|
+
if (found)
|
|
3665
|
+
return found;
|
|
3666
|
+
}
|
|
3667
|
+
return null;
|
|
3668
|
+
}
|
|
3669
|
+
/** Depth-first search for the first array whose elements are (non-array)
|
|
3670
|
+
* objects — the same "per-item response array" shape schema inference
|
|
3671
|
+
* already resolves to when it emits `z.array(z.object({...}))`. */
|
|
3672
|
+
function findObjectArrayField(value, path = []) {
|
|
3673
|
+
if (value === null || typeof value !== "object")
|
|
3674
|
+
return null;
|
|
3675
|
+
if (Array.isArray(value)) {
|
|
3676
|
+
const objectItems = value.filter((v) => v !== null && typeof v === "object" && !Array.isArray(v));
|
|
3677
|
+
return objectItems.length > 0 ? { path, items: objectItems } : null;
|
|
3678
|
+
}
|
|
3679
|
+
for (const [key, v] of Object.entries(value)) {
|
|
3680
|
+
const found = findObjectArrayField(v, [...path, key]);
|
|
3681
|
+
if (found)
|
|
3682
|
+
return found;
|
|
3683
|
+
}
|
|
3684
|
+
return null;
|
|
3685
|
+
}
|
|
3686
|
+
/**
|
|
3687
|
+
* Detects whether a read-only GraphQL primary operation exposes a bounded
|
|
3688
|
+
* paging signal: a total/count field in the captured response alongside a
|
|
3689
|
+
* skip+count (or offset+limit) shaped pagination variable whose declared
|
|
3690
|
+
* page size evenly divides the captured page's item count. When present,
|
|
3691
|
+
* {@link emitContractTs} emits a paging loop instead of a single fixed page.
|
|
3692
|
+
*/
|
|
3693
|
+
function detectPaginationSignal(responseBody, gqlVariables) {
|
|
3694
|
+
const container = findPaginationContainer(gqlVariables);
|
|
3695
|
+
if (!container)
|
|
3696
|
+
return null;
|
|
3697
|
+
const totalPath = findNumericFieldByName(responseBody, TOTAL_FIELD_PATTERN);
|
|
3698
|
+
if (!totalPath)
|
|
3699
|
+
return null;
|
|
3700
|
+
const arrayField = findObjectArrayField(responseBody);
|
|
3701
|
+
if (!arrayField || arrayField.items.length === 0)
|
|
3702
|
+
return null;
|
|
3703
|
+
// A real page-size variable evenly explains the captured page's length —
|
|
3704
|
+
// an unrelated numeric "count" that happens to sit near a "skip" would not.
|
|
3705
|
+
if (arrayField.items.length % container.pageSize !== 0)
|
|
3706
|
+
return null;
|
|
3707
|
+
const firstItem = arrayField.items[0];
|
|
3708
|
+
if (!firstItem)
|
|
3709
|
+
return null;
|
|
3710
|
+
const firstItemKeys = Object.keys(firstItem);
|
|
3711
|
+
const identityField = firstItemKeys.find((k) => k.toLowerCase() === "id") ??
|
|
3712
|
+
firstItemKeys.find((k) => /Id$/.test(k)) ??
|
|
3713
|
+
firstItemKeys[0];
|
|
3714
|
+
if (!identityField)
|
|
3715
|
+
return null;
|
|
3716
|
+
return {
|
|
3717
|
+
totalPath,
|
|
3718
|
+
arrayPath: arrayField.path,
|
|
3719
|
+
containerPath: container.path,
|
|
3720
|
+
countKey: container.countKey,
|
|
3721
|
+
skipKey: container.skipKey,
|
|
3722
|
+
pageSize: container.pageSize,
|
|
3723
|
+
identityField,
|
|
3724
|
+
};
|
|
3725
|
+
}
|
|
3726
|
+
/** Renders `base.a.b` / `base["a-b"].c`, using bracket access for any path
|
|
3727
|
+
* segment that isn't a valid JS identifier. */
|
|
3728
|
+
function pathAccessExpr(base, path) {
|
|
3729
|
+
return path.reduce((acc, key) => acc + (isValidJsIdentifier(key) ? `.${key}` : `[${JSON.stringify(key)}]`), base);
|
|
3730
|
+
}
|
|
3731
|
+
/** Rebuilds `base` with `leafExpr` spliced in at `path`, spreading every
|
|
3732
|
+
* ancestor level so sibling fields survive unchanged. `path: []` returns
|
|
3733
|
+
* `leafExpr` itself (the override IS the whole value). */
|
|
3734
|
+
function buildNestedSpreadOverride(base, path, leafExpr) {
|
|
3735
|
+
if (path.length === 0)
|
|
3736
|
+
return leafExpr;
|
|
3737
|
+
const [key, ...rest] = path;
|
|
3738
|
+
const keyExpr = isValidJsIdentifier(key) ? key : JSON.stringify(key);
|
|
3739
|
+
const nested = rest.length === 0 ? leafExpr : buildNestedSpreadOverride(`${base}.${key}`, rest, leafExpr);
|
|
3740
|
+
return `{ ...${base}, ${keyExpr}: ${nested} }`;
|
|
3741
|
+
}
|
|
3742
|
+
/**
|
|
3743
|
+
* Emits a bounded paging loop for a read-only GraphQL primary operation
|
|
3744
|
+
* exposing {@link PaginationSignal}: advances the skip/offset variable by
|
|
3745
|
+
* the observed page size on each call, stops once the response's own
|
|
3746
|
+
* reported total is reached or `MAX_PAGES` caps it, and merges pages by the
|
|
3747
|
+
* detected identity field rather than concatenating blindly.
|
|
3748
|
+
*/
|
|
3749
|
+
function buildPaginatedGqlExecuteHttpBody(opts) {
|
|
3750
|
+
const { pascal, gqlOperationNameExpr, queryConstName, gqlVariablesExpr, signal } = opts;
|
|
3751
|
+
const { totalPath, arrayPath, containerPath, countKey, skipKey, pageSize, identityField } = signal;
|
|
3752
|
+
const countKeyExpr = isValidJsIdentifier(countKey) ? countKey : JSON.stringify(countKey);
|
|
3753
|
+
const skipKeyExpr = isValidJsIdentifier(skipKey) ? skipKey : JSON.stringify(skipKey);
|
|
3754
|
+
const paginationBase = pathAccessExpr("baseVariables", containerPath);
|
|
3755
|
+
const paginationOverrideLeaf = `{ ...${paginationBase}, ${countKeyExpr}: PAGE_SIZE, ${skipKeyExpr}: skip }`;
|
|
3756
|
+
const variablesForCall = buildNestedSpreadOverride("baseVariables", containerPath, paginationOverrideLeaf);
|
|
3757
|
+
const totalAccessExpr = pathAccessExpr("page", totalPath);
|
|
3758
|
+
const arrayAccessExpr = pathAccessExpr("page", arrayPath);
|
|
3759
|
+
const identityAccessExpr = pathAccessExpr("item", [identityField]);
|
|
3760
|
+
// Non-null: the loop body runs at least once (MAX_PAGES is a positive
|
|
3761
|
+
// constant and the initial `total` is Infinity), so `lastPage` is always
|
|
3762
|
+
// assigned before this line executes.
|
|
3763
|
+
const dataOverrideExpr = buildNestedSpreadOverride("lastPage!", arrayPath, "[...itemsById.values()]");
|
|
3764
|
+
return ` const baseVariables = ${gqlVariablesExpr};
|
|
3765
|
+
const PAGE_SIZE = ${pageSize};
|
|
3766
|
+
// Bounded so a paging bug (a total that never converges) can't loop forever.
|
|
3767
|
+
const MAX_PAGES = 50;
|
|
3768
|
+
const itemsById = new Map<string, unknown>();
|
|
3769
|
+
let skip = 0;
|
|
3770
|
+
let total = Number.POSITIVE_INFINITY;
|
|
3771
|
+
let lastPage: ${pascal}Response | null = null;
|
|
3772
|
+
for (let pageIndex = 0; pageIndex < MAX_PAGES && itemsById.size < total; pageIndex++) {
|
|
3773
|
+
const page = await getGql(context.baseUrl)(${gqlOperationNameExpr}, ${queryConstName}, ${variablesForCall});
|
|
3774
|
+
lastPage = page;
|
|
3775
|
+
total = ${totalAccessExpr};
|
|
3776
|
+
for (const item of ${arrayAccessExpr}) {
|
|
3777
|
+
itemsById.set(String(${identityAccessExpr}), item);
|
|
3778
|
+
}
|
|
3779
|
+
skip += PAGE_SIZE;
|
|
3780
|
+
}
|
|
3781
|
+
const data = ${dataOverrideExpr} as ${pascal}Response;
|
|
3782
|
+
return { data };`;
|
|
3783
|
+
}
|
|
3585
3784
|
/**
|
|
3586
3785
|
* Same review-checklist items the pre-move contract.ts header used to embed,
|
|
3587
3786
|
* now surfaced on recon-generate's own stdout instead of the shipped file —
|
|
@@ -3645,11 +3844,12 @@ function emitContractTs(opts) {
|
|
|
3645
3844
|
// verification already throws StepVerificationError on failure, so a
|
|
3646
3845
|
// successful return IS a real signal — z.unknown() would be dishonest
|
|
3647
3846
|
// in the other direction, hiding a field the flow can actually promise.
|
|
3847
|
+
const conditionalFieldNames = gql && gqlQuery ? collectConditionalGraphQLFieldNames(gqlQuery) : undefined;
|
|
3648
3848
|
const responseSchemaExpr = omitExecuteHttp && isSubmissionFlow
|
|
3649
3849
|
? `z.object({ verified: z.boolean() })`
|
|
3650
3850
|
: omitExecuteHttp
|
|
3651
3851
|
? `z.unknown()`
|
|
3652
|
-
: inferZodSchema(responseBody);
|
|
3852
|
+
: inferZodSchema(responseBody, 0, "", { conditionalFieldNames });
|
|
3653
3853
|
// Multi-step flows that include a multipart upload need the binary asset
|
|
3654
3854
|
// on the payload. ApplicantContactSchema (via ApplicantResumeSchema) already
|
|
3655
3855
|
// declares Resume/ResumeContentType/ResumeFilename, so submission flows
|
|
@@ -3924,12 +4124,26 @@ const httpClient = createHttpClient({ schema: ${pascal}ResponseSchema, bottlenec
|
|
|
3924
4124
|
const gqlVariablesExpr = gqlOperationName
|
|
3925
4125
|
? renderGqlVariablesExpr(gqlVariables, payloadFieldNames)
|
|
3926
4126
|
: "{ q: payload.query }";
|
|
4127
|
+
// Only the single-endpoint GraphQL read path (a real primary operation, no
|
|
4128
|
+
// multi-step flow) is a candidate for a paging signal — multiStepBody
|
|
4129
|
+
// already owns its own per-call semantics.
|
|
4130
|
+
const paginationSignal = !multiStepBody && gql && gqlOperationName
|
|
4131
|
+
? detectPaginationSignal(responseBody, gqlVariables)
|
|
4132
|
+
: null;
|
|
3927
4133
|
const executeHttpBody = multiStepBody
|
|
3928
4134
|
? multiStepBody
|
|
3929
|
-
:
|
|
3930
|
-
?
|
|
4135
|
+
: paginationSignal
|
|
4136
|
+
? buildPaginatedGqlExecuteHttpBody({
|
|
4137
|
+
pascal,
|
|
4138
|
+
gqlOperationNameExpr,
|
|
4139
|
+
queryConstName: `${pascal.toUpperCase()}_QUERY`,
|
|
4140
|
+
gqlVariablesExpr,
|
|
4141
|
+
signal: paginationSignal,
|
|
4142
|
+
})
|
|
4143
|
+
: gql
|
|
4144
|
+
? ` const data = await getGql(context.baseUrl)(${gqlOperationNameExpr}, ${pascal.toUpperCase()}_QUERY, ${gqlVariablesExpr});
|
|
3931
4145
|
return { data };`
|
|
3932
|
-
|
|
4146
|
+
: ` const data = await httpClient(\`\${context.baseUrl}${endpointPath}\`, {
|
|
3933
4147
|
method: "POST",
|
|
3934
4148
|
body: JSON.stringify({ query: payload.query }),
|
|
3935
4149
|
});
|
|
@@ -4014,7 +4228,7 @@ import type { BrowserSession } from "${ENGINE_PKG}/scraper/session";
|
|
|
4014
4228
|
import type { SitePlugin, SitePluginContext, SitePluginResult } from "${ENGINE_PKG}/site-plugin";
|
|
4015
4229
|
import { run${pascal}BrowserFlow } from "@/sites/${siteId}/flows/browser-flow";
|
|
4016
4230
|
${baseHeadersBlock}${limiterBlock}
|
|
4017
|
-
const ${pascal}ResponseSchema = ${responseSchemaExpr};
|
|
4231
|
+
export const ${pascal}ResponseSchema = ${responseSchemaExpr};
|
|
4018
4232
|
|
|
4019
4233
|
export type ${pascal}Response = z.infer<typeof ${pascal}ResponseSchema>;
|
|
4020
4234
|
|
|
@@ -4373,26 +4587,26 @@ function emitBrowserFlowTs(opts) {
|
|
|
4373
4587
|
* minus its disk-dump/replan layer.
|
|
4374
4588
|
*/
|
|
4375
4589
|
|
|
4376
|
-
import type { Stagehand } from "@browserbasehq/stagehand"
|
|
4377
|
-
import { z } from "zod/v4";
|
|
4590
|
+
import type { Stagehand } from "@browserbasehq/stagehand";${isSubmissionFlow ? `\nimport { z } from "zod/v4";` : ""}
|
|
4378
4591
|
|
|
4379
4592
|
import { buildAnthropicClient, buildRephraseModel } from "${ENGINE_PKG}/lib/llm/anthropic-client";
|
|
4380
4593
|
import { getLogger } from "${ENGINE_PKG}/lib/logging";${usesThrowawayPassword ? `\nimport { generateThrowawayPassword } from "${ENGINE_PKG}/lib/random";` : ""}
|
|
4381
4594
|
import { type HealingFlowStep, runHealingFlow, waitForSpaReady } from "${ENGINE_PKG}/scraper/flow-runner";
|
|
4382
4595
|
import { guardedExtract } from "${ENGINE_PKG}/scraper/stagehand-guard";
|
|
4383
|
-
import
|
|
4596
|
+
import ${isSubmissionFlow
|
|
4597
|
+
? `type { ${pascal}Payload, ${pascal}Response }`
|
|
4598
|
+
: `{ type ${pascal}Payload, type ${pascal}Response, ${pascal}ResponseSchema }`} from "@/sites/${siteId}/contract";
|
|
4384
4599
|
|
|
4385
4600
|
const logger = getLogger({ name: "${siteId}-browser-flow" });
|
|
4386
|
-
|
|
4387
|
-
const ${pascal}BrowserSchema = z.object({${isSubmissionFlow
|
|
4601
|
+
${isSubmissionFlow
|
|
4388
4602
|
? `
|
|
4603
|
+
const ${pascal}BrowserSchema = z.object({
|
|
4389
4604
|
// runHealingFlow throws StepVerificationError on a failed submitStep, so
|
|
4390
4605
|
// reaching this point already proves the submission verified.
|
|
4391
|
-
verified: z.boolean()
|
|
4392
|
-
: `
|
|
4393
|
-
extraction: z.string(),`}
|
|
4606
|
+
verified: z.boolean(),
|
|
4394
4607
|
});
|
|
4395
|
-
|
|
4608
|
+
`
|
|
4609
|
+
: ""}
|
|
4396
4610
|
/**
|
|
4397
4611
|
* Drives ${siteId} through the recon flow and extracts structured data. This is
|
|
4398
4612
|
* the browser path; if contract.ts also defines executeHttp, that hot path runs
|
|
@@ -4431,8 +4645,7 @@ ${flowStepsBlock}
|
|
|
4431
4645
|
// Schema-enforced extract via guardedExtract: Stagehand 3.4.0 accepts
|
|
4432
4646
|
// both Zod v3 and v4 schemas natively (StagehandZodSchema union since
|
|
4433
4647
|
// 2.4.3 / PR #944), and the caller-side safeParse defends against SDK
|
|
4434
|
-
// contract drift
|
|
4435
|
-
// fields the recon flow actually surfaces.${isSubmissionFlow
|
|
4648
|
+
// contract drift.${isSubmissionFlow
|
|
4436
4649
|
? `
|
|
4437
4650
|
// runHealingFlow above already verified the submit (submitStep:true), so the
|
|
4438
4651
|
// application is already committed at the ATS. A schema-validation or
|
|
@@ -4456,10 +4669,10 @@ ${flowStepsBlock}
|
|
|
4456
4669
|
const result = await guardedExtract(
|
|
4457
4670
|
stagehand,
|
|
4458
4671
|
\`extract results matching query: \${payload.query}\`,
|
|
4459
|
-
${pascal}
|
|
4672
|
+
${pascal}ResponseSchema
|
|
4460
4673
|
);
|
|
4461
4674
|
|
|
4462
|
-
return result
|
|
4675
|
+
return result;
|
|
4463
4676
|
}
|
|
4464
4677
|
`}`;
|
|
4465
4678
|
assertNoLeakedPersonaConstant(code, knownFieldValues);
|
|
@@ -4589,18 +4802,16 @@ async function main() {
|
|
|
4589
4802
|
return [];
|
|
4590
4803
|
}
|
|
4591
4804
|
})();
|
|
4592
|
-
const
|
|
4805
|
+
const flowFile = `src/sites/${siteId}/recon-flow.json`;
|
|
4806
|
+
const auxManifest = (() => {
|
|
4593
4807
|
try {
|
|
4594
|
-
return (0, node_fs_1.
|
|
4595
|
-
.filter((f) => f.endsWith(".json"))
|
|
4596
|
-
.sort();
|
|
4808
|
+
return JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(auxDir, "aux-manifest.json"), "utf8"));
|
|
4597
4809
|
}
|
|
4598
4810
|
catch {
|
|
4599
4811
|
return [];
|
|
4600
4812
|
}
|
|
4601
4813
|
})();
|
|
4602
4814
|
const { flowSteps, frameSelector, submitEndpointPattern, submitBodyPattern } = (() => {
|
|
4603
|
-
const flowFile = `src/sites/${siteId}/recon-flow.json`;
|
|
4604
4815
|
try {
|
|
4605
4816
|
const raw = JSON.parse((0, node_fs_1.readFileSync)(flowFile, "utf8"));
|
|
4606
4817
|
if (Array.isArray(raw))
|
|
@@ -4654,6 +4865,40 @@ async function main() {
|
|
|
4654
4865
|
const formSchema = await resolveFormSchema(formSchemaSpecifier);
|
|
4655
4866
|
const pascal = toPascalCase(siteId);
|
|
4656
4867
|
const baseUrl = deriveBaseUrl(captures);
|
|
4868
|
+
// Gate on the flow's declared own-backend hosts (or the registrable-domain
|
|
4869
|
+
// fallback of baseUrl) via the same predicate recon-http.ts applies at
|
|
4870
|
+
// write time, so a stale aux/ directory from before that filter existed
|
|
4871
|
+
// — or one written by a filter someone bypassed — can never smuggle a
|
|
4872
|
+
// third party's JSON into a generated plugin's fixtures/. A file with no
|
|
4873
|
+
// manifest entry is unverifiable provenance, not proven safe, so it is
|
|
4874
|
+
// excluded rather than assumed to have passed the write-time filter.
|
|
4875
|
+
const ownBackendHostnames = (0, recon_shared_1.readOwnBackendHostnames)(flowFile);
|
|
4876
|
+
const fallbackDomain = baseUrl.length > 0 ? (0, capture_filters_1.registrableDomain)(new URL(baseUrl).hostname) : null;
|
|
4877
|
+
const auxFiles = auxManifest
|
|
4878
|
+
.filter((entry) => {
|
|
4879
|
+
const allowed = (0, capture_filters_1.isAllowedFixtureHost)(entry.hostname, ownBackendHostnames, fallbackDomain);
|
|
4880
|
+
if (!allowed) {
|
|
4881
|
+
logger.warn(`excluding aux fixture '${entry.filename}' — host '${entry.hostname}' is not an own-backend host`);
|
|
4882
|
+
}
|
|
4883
|
+
return allowed;
|
|
4884
|
+
})
|
|
4885
|
+
.map((entry) => entry.filename)
|
|
4886
|
+
.sort();
|
|
4887
|
+
// A file on disk with no manifest entry predates the write-time provenance
|
|
4888
|
+
// record (bugfix-002) or otherwise landed outside probeAuxiliaryEndpoints —
|
|
4889
|
+
// its source host is unverifiable, so it is excluded, not assumed safe.
|
|
4890
|
+
const manifestedFilenames = new Set(auxManifest.map((entry) => entry.filename));
|
|
4891
|
+
const unmanifestedFiles = (() => {
|
|
4892
|
+
try {
|
|
4893
|
+
return (0, node_fs_1.readdirSync)(auxDir).filter((f) => f.endsWith(".json") && f !== "aux-manifest.json" && !manifestedFilenames.has(f));
|
|
4894
|
+
}
|
|
4895
|
+
catch {
|
|
4896
|
+
return [];
|
|
4897
|
+
}
|
|
4898
|
+
})();
|
|
4899
|
+
for (const f of unmanifestedFiles) {
|
|
4900
|
+
logger.warn(`excluding aux fixture '${f}' — no aux-manifest.json entry, provenance unverifiable`);
|
|
4901
|
+
}
|
|
4657
4902
|
const baseHeaders = deriveRequestHeaders(captures, replays, baseUrl, submitPatterns);
|
|
4658
4903
|
const minTime = deriveMinTime(rateLimits);
|
|
4659
4904
|
const hasRateLimitProbeData = rateLimits.some((f) => f.safeRps !== null);
|