@enricai/barnacle 1.6.11 → 1.6.12
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.
|
@@ -17,6 +17,13 @@
|
|
|
17
17
|
* `kind` defaults to `"submit"` because `.barnacle/submissions.ndjson`
|
|
18
18
|
* already holds historical unkinded lines that `s3-sink.ts` has shipped to
|
|
19
19
|
* S3 — a required `kind` would make every one of those lines unparseable.
|
|
20
|
+
*
|
|
21
|
+
* `reconciliationRecordSchema`'s preprocess step also folds a legacy
|
|
22
|
+
* top-level `vivclid`/`jobReference` shape into `joinKeys`: before the
|
|
23
|
+
* opaque `joinKeys` bag existed, those two fields were persisted as named
|
|
24
|
+
* top-level keys, and a plain `z.object()` silently drops unrecognized
|
|
25
|
+
* keys — reading an old line through the new schema would otherwise lose
|
|
26
|
+
* its join keys rather than surface them.
|
|
20
27
|
*/
|
|
21
28
|
import { z } from "zod/v4";
|
|
22
29
|
/**
|
|
@@ -71,7 +78,8 @@ export type BeaconEvent = z.infer<typeof beaconEventSchema>;
|
|
|
71
78
|
* `kind`. Injects `kind: "submit"` ahead of the discriminated union when the
|
|
72
79
|
* field is absent, because `z.discriminatedUnion` reads the raw input's
|
|
73
80
|
* discriminant directly and won't fall back to a member schema's default —
|
|
74
|
-
* confirmed against zod/v4 3.25.76.
|
|
81
|
+
* confirmed against zod/v4 3.25.76. Also folds a legacy vivclid/jobReference
|
|
82
|
+
* shape into `joinKeys` (see `withLegacyJoinKeys`) before the union runs.
|
|
75
83
|
*/
|
|
76
84
|
export declare const reconciliationRecordSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
77
85
|
kind: z.ZodDefault<z.ZodLiteral<"submit">>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reconciliation-record.d.ts","sourceRoot":"","sources":["../../../src/lib/telemetry/reconciliation-record.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"reconciliation-record.d.ts","sourceRoot":"","sources":["../../../src/lib/telemetry/reconciliation-record.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;iBAW7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;iBAS5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAsB5D;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAOtC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
|
|
@@ -18,6 +18,13 @@
|
|
|
18
18
|
* `kind` defaults to `"submit"` because `.barnacle/submissions.ndjson`
|
|
19
19
|
* already holds historical unkinded lines that `s3-sink.ts` has shipped to
|
|
20
20
|
* S3 — a required `kind` would make every one of those lines unparseable.
|
|
21
|
+
*
|
|
22
|
+
* `reconciliationRecordSchema`'s preprocess step also folds a legacy
|
|
23
|
+
* top-level `vivclid`/`jobReference` shape into `joinKeys`: before the
|
|
24
|
+
* opaque `joinKeys` bag existed, those two fields were persisted as named
|
|
25
|
+
* top-level keys, and a plain `z.object()` silently drops unrecognized
|
|
26
|
+
* keys — reading an old line through the new schema would otherwise lose
|
|
27
|
+
* its join keys rather than surface them.
|
|
21
28
|
*/
|
|
22
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
30
|
exports.reconciliationRecordSchema = exports.beaconEventSchema = exports.submitRecordSchema = void 0;
|
|
@@ -60,17 +67,36 @@ exports.beaconEventSchema = v4_1.z.object({
|
|
|
60
67
|
durationMs: v4_1.z.number(),
|
|
61
68
|
ts: v4_1.z.string(),
|
|
62
69
|
});
|
|
70
|
+
/**
|
|
71
|
+
* Folds a legacy top-level `vivclid`/`jobReference` shape into `joinKeys`
|
|
72
|
+
* for a line that doesn't already carry `joinKeys`, so historical lines
|
|
73
|
+
* from before the opaque `joinKeys` bag existed still surface their join
|
|
74
|
+
* keys instead of silently losing them to `z.object()`'s unrecognized-key
|
|
75
|
+
* drop. Only synthesizes a non-null bag when a legacy field was actually
|
|
76
|
+
* present, so lines with neither (e.g. sites that never had these fields)
|
|
77
|
+
* still fall through to `joinKeys`'s own `.default(null)`.
|
|
78
|
+
*/
|
|
79
|
+
function withLegacyJoinKeys(value) {
|
|
80
|
+
if ("joinKeys" in value)
|
|
81
|
+
return value;
|
|
82
|
+
const { vivclid, jobReference, ...rest } = value;
|
|
83
|
+
const legacyJoinKeys = vivclid || jobReference
|
|
84
|
+
? { vivclid: vivclid ?? null, jobReference: jobReference ?? null }
|
|
85
|
+
: null;
|
|
86
|
+
return { ...rest, joinKeys: legacyJoinKeys };
|
|
87
|
+
}
|
|
63
88
|
/**
|
|
64
89
|
* Routes an NDJSON line to `submitRecordSchema` or `beaconEventSchema` by
|
|
65
90
|
* `kind`. Injects `kind: "submit"` ahead of the discriminated union when the
|
|
66
91
|
* field is absent, because `z.discriminatedUnion` reads the raw input's
|
|
67
92
|
* discriminant directly and won't fall back to a member schema's default —
|
|
68
|
-
* confirmed against zod/v4 3.25.76.
|
|
93
|
+
* confirmed against zod/v4 3.25.76. Also folds a legacy vivclid/jobReference
|
|
94
|
+
* shape into `joinKeys` (see `withLegacyJoinKeys`) before the union runs.
|
|
69
95
|
*/
|
|
70
96
|
exports.reconciliationRecordSchema = v4_1.z.preprocess((value) => {
|
|
71
|
-
if (typeof value
|
|
72
|
-
return
|
|
73
|
-
}
|
|
74
|
-
return
|
|
97
|
+
if (typeof value !== "object" || value === null)
|
|
98
|
+
return value;
|
|
99
|
+
const withKind = "kind" in value ? value : { ...value, kind: "submit" };
|
|
100
|
+
return withLegacyJoinKeys(withKind);
|
|
75
101
|
}, v4_1.z.discriminatedUnion("kind", [exports.submitRecordSchema, exports.beaconEventSchema]));
|
|
76
102
|
//# sourceMappingURL=reconciliation-record.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reconciliation-record.js","sourceRoot":"","sources":["../../../src/lib/telemetry/reconciliation-record.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"reconciliation-record.js","sourceRoot":"","sources":["../../../src/lib/telemetry/reconciliation-record.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;AAEH,+BAA2B;AAE3B;;;;GAIG;AACU,QAAA,kBAAkB,GAAG,MAAC,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,MAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IAC3C,MAAM,EAAE,MAAC,CAAC,MAAM,EAAE;IAClB,SAAS,EAAE,MAAC,CAAC,MAAM,EAAE;IACrB,QAAQ,EAAE,MAAC,CAAC,MAAM,CAAC,MAAC,CAAC,MAAM,EAAE,EAAE,MAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACpE,cAAc,EAAE,MAAC,CAAC,OAAO,EAAE;IAC3B,MAAM,EAAE,MAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACtC,YAAY,EAAE,MAAC,CAAC,OAAO,EAAE;IACzB,YAAY,EAAE,MAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,UAAU,EAAE,MAAC,CAAC,MAAM,EAAE;IACtB,EAAE,EAAE,MAAC,CAAC,MAAM,EAAE;CACf,CAAC,CAAC;AAIH;;;;;;;;;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,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IACxE,OAAO,kBAAkB,CAAC,QAAmC,CAAC,CAAC;AACjE,CAAC,EACD,MAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC,QAAA,kBAAkB,EAAE,QAAA,iBAAiB,CAAC,CAAC,CACtE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enricai/barnacle",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.12",
|
|
4
4
|
"description": "Site-agnostic browser automation engine. POST a structured payload to a typed endpoint; Barnacle drives a Steel + Stagehand session through the target site and returns a structured result.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Enricai",
|