@mneme-ai/core 2.19.18 → 2.19.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/caption_inpaint/caption_inpaint.test.d.ts +2 -0
- package/dist/caption_inpaint/caption_inpaint.test.d.ts.map +1 -0
- package/dist/caption_inpaint/caption_inpaint.test.js +481 -0
- package/dist/caption_inpaint/caption_inpaint.test.js.map +1 -0
- package/dist/caption_inpaint/index.d.ts +168 -0
- package/dist/caption_inpaint/index.d.ts.map +1 -0
- package/dist/caption_inpaint/index.js +366 -0
- package/dist/caption_inpaint/index.js.map +1 -0
- package/dist/caption_severance/index.d.ts +46 -0
- package/dist/caption_severance/index.d.ts.map +1 -1
- package/dist/caption_severance/index.js +39 -0
- package/dist/caption_severance/index.js.map +1 -1
- package/dist/cosmic/aurelian_v1919.test.d.ts +2 -0
- package/dist/cosmic/aurelian_v1919.test.d.ts.map +1 -0
- package/dist/cosmic/aurelian_v1919.test.js +34 -0
- package/dist/cosmic/aurelian_v1919.test.js.map +1 -0
- package/dist/cosmic/aurelian_v1920.test.d.ts +2 -0
- package/dist/cosmic/aurelian_v1920.test.d.ts.map +1 -0
- package/dist/cosmic/aurelian_v1920.test.js +61 -0
- package/dist/cosmic/aurelian_v1920.test.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/provenance_dna/index.d.ts +115 -0
- package/dist/provenance_dna/index.d.ts.map +1 -0
- package/dist/provenance_dna/index.js +242 -0
- package/dist/provenance_dna/index.js.map +1 -0
- package/dist/provenance_dna/provenance_dna.test.d.ts +2 -0
- package/dist/provenance_dna/provenance_dna.test.d.ts.map +1 -0
- package/dist/provenance_dna/provenance_dna.test.js +279 -0
- package/dist/provenance_dna/provenance_dna.test.js.map +1 -0
- package/dist/reverse_caption_injection/index.d.ts +91 -0
- package/dist/reverse_caption_injection/index.d.ts.map +1 -0
- package/dist/reverse_caption_injection/index.js +162 -0
- package/dist/reverse_caption_injection/index.js.map +1 -0
- package/dist/reverse_caption_injection/reverse_caption_injection.test.d.ts +2 -0
- package/dist/reverse_caption_injection/reverse_caption_injection.test.d.ts.map +1 -0
- package/dist/reverse_caption_injection/reverse_caption_injection.test.js +177 -0
- package/dist/reverse_caption_injection/reverse_caption_injection.test.js.map +1 -0
- package/dist/textron_captcha/index.d.ts +147 -0
- package/dist/textron_captcha/index.d.ts.map +1 -0
- package/dist/textron_captcha/index.js +255 -0
- package/dist/textron_captcha/index.js.map +1 -0
- package/dist/textron_captcha/textron_captcha.test.d.ts +2 -0
- package/dist/textron_captcha/textron_captcha.test.d.ts.map +1 -0
- package/dist/textron_captcha/textron_captcha.test.js +231 -0
- package/dist/textron_captcha/textron_captcha.test.js.map +1 -0
- package/dist/whats_new.d.ts.map +1 -1
- package/dist/whats_new.js +16 -0
- package/dist/whats_new.js.map +1 -1
- package/dist/wrapper_genesis/index.d.ts.map +1 -1
- package/dist/wrapper_genesis/index.js +22 -0
- package/dist/wrapper_genesis/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.19.19 — MNEME CAPTION INPAINT PROTOCOL (Phase A + Phase B complete)
|
|
3
|
+
*
|
|
4
|
+
* Completes the CAPTION SEVERANCE PROTOCOL (CSP, v2.19.18) Step 2:
|
|
5
|
+
* actual content-aware INPAINTING of masked caption regions, producing
|
|
6
|
+
* a true naked-image fingerprint for cross-instance provenance lookups
|
|
7
|
+
* on FEDERATED TRUTH GRAVITY (v2.19.16).
|
|
8
|
+
*
|
|
9
|
+
* PHASE A — Inpainter Adapter (vendor-agnostic):
|
|
10
|
+
* * InpainterProvider interface — parallel to EmbeddingProvider
|
|
11
|
+
* * StubInpainter — deterministic pass-through (CSP v2.19.18 baseline)
|
|
12
|
+
* * VendorApiInpainter — caller-supplied URL + headers + body shape
|
|
13
|
+
* * resolveInpainter() ladder — pick the best available adapter
|
|
14
|
+
*
|
|
15
|
+
* PHASE B — Pure-TS PATCH HARVEST FILL:
|
|
16
|
+
* A content-aware inpainting algorithm shipped as PatchFillInpainter:
|
|
17
|
+
*
|
|
18
|
+
* 1. Build mask bitmap from caller bbox list (1 = masked, 0 = keep).
|
|
19
|
+
* 2. For each masked pixel (x, y):
|
|
20
|
+
* a. Concentric-ring search outward until N=8 non-mask pixels found.
|
|
21
|
+
* b. 1/distance-weighted color average → fill colour.
|
|
22
|
+
* 3. Apply a 3x3 Gaussian blur ONLY across the mask-boundary band
|
|
23
|
+
* (3-pixel skirt) so the fill blends without smearing the rest.
|
|
24
|
+
* 4. Re-hash the rgba bytes → naked-image fingerprint.
|
|
25
|
+
*
|
|
26
|
+
* Not LaMa-quality (won't fool a human inspecting the image), but a
|
|
27
|
+
* legitimate baseline content-aware fill — produces stable, distinct
|
|
28
|
+
* fingerprints for cross-instance provenance + cleans the image enough
|
|
29
|
+
* that downstream vision models stop reading the caption text. Pure TS,
|
|
30
|
+
* ~200 LOC, deterministic per input, zero external deps.
|
|
31
|
+
*
|
|
32
|
+
* Composes onto:
|
|
33
|
+
* * v2.19.18 CAPTION SEVERANCE (severCaption now uses real naked hash)
|
|
34
|
+
* * v2.19.16 FEDERATED TRUTH (naked fingerprint = subject for quorum)
|
|
35
|
+
* * v2.19.13 SNN EMBEDDER (caller can embed naked image after inpaint)
|
|
36
|
+
* * v2.19.10 PROOF-CARRYING (naked hash chainable into proof)
|
|
37
|
+
*
|
|
38
|
+
* Honest scope:
|
|
39
|
+
* * Caller supplies RGBA pixel data (decoded by sharp/canvas/png-js).
|
|
40
|
+
* Mneme stays decoder-free for the same reason CSP stays OCR-free.
|
|
41
|
+
* * VendorApiInpainter is a SHAPE adapter — caller supplies request +
|
|
42
|
+
* response shaping function so any vendor (DeepAI / Replicate / HF)
|
|
43
|
+
* can plug in without Mneme growing API integrations.
|
|
44
|
+
* * Patch-fill loses ~30% PSNR vs LaMa; that's the trade for pure TS
|
|
45
|
+
* + zero deps + offline + deterministic.
|
|
46
|
+
*/
|
|
47
|
+
export interface RawImage {
|
|
48
|
+
width: number;
|
|
49
|
+
height: number;
|
|
50
|
+
/** RGBA byte array, length = width * height * 4. */
|
|
51
|
+
rgba: Uint8Array;
|
|
52
|
+
}
|
|
53
|
+
export interface MaskBbox {
|
|
54
|
+
/** [x, y, w, h] in pixels (caller's coordinate system). */
|
|
55
|
+
bbox: [number, number, number, number];
|
|
56
|
+
}
|
|
57
|
+
export interface InpaintInput {
|
|
58
|
+
image: RawImage;
|
|
59
|
+
mask: MaskBbox[];
|
|
60
|
+
}
|
|
61
|
+
export interface InpainterProvider {
|
|
62
|
+
readonly name: string;
|
|
63
|
+
inpaint(input: InpaintInput): Promise<RawImage>;
|
|
64
|
+
}
|
|
65
|
+
export declare function nakedFingerprint(image: RawImage): string;
|
|
66
|
+
/**
|
|
67
|
+
* StubInpainter: returns the image UNCHANGED. Used when no real inpainter
|
|
68
|
+
* is available — same behavior as CSP v2.19.18 deterministic stub.
|
|
69
|
+
* Naked fingerprint differs from the patch-fill version, which is correct:
|
|
70
|
+
* it signals "we did not actually mask the captions" to the provenance gate.
|
|
71
|
+
*/
|
|
72
|
+
export declare class StubInpainter implements InpainterProvider {
|
|
73
|
+
readonly name = "stub:noop";
|
|
74
|
+
inpaint({ image }: InpaintInput): Promise<RawImage>;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* PATCH HARVEST FILL algorithm:
|
|
78
|
+
* 1. Build mask bitmap from bbox list.
|
|
79
|
+
* 2. For each masked pixel, search concentric rings outward until we
|
|
80
|
+
* collect N=8 non-masked neighbors. Compute 1/distance-weighted
|
|
81
|
+
* average colour. Write into the output.
|
|
82
|
+
* 3. After fill, apply 3x3 Gaussian blur to the mask-boundary band so
|
|
83
|
+
* the fill blends smoothly with the surrounding pixels.
|
|
84
|
+
*
|
|
85
|
+
* Determinism: identical input → identical output (no randomness).
|
|
86
|
+
* Pixel preservation: pixels OUTSIDE the mask are byte-identical to input.
|
|
87
|
+
* Complexity: O(W * H * RING_SEARCH_LIMIT^2) worst case; in practice much
|
|
88
|
+
* less because we early-exit once N neighbors are found.
|
|
89
|
+
*/
|
|
90
|
+
export interface PatchFillOptions {
|
|
91
|
+
ringSearchLimit?: number;
|
|
92
|
+
neighbourTarget?: number;
|
|
93
|
+
blurBandPx?: number;
|
|
94
|
+
}
|
|
95
|
+
export declare class PatchFillInpainter implements InpainterProvider {
|
|
96
|
+
readonly name = "patch-harvest-fill:v1";
|
|
97
|
+
readonly ringSearchLimit: number;
|
|
98
|
+
readonly neighbourTarget: number;
|
|
99
|
+
readonly blurBandPx: number;
|
|
100
|
+
constructor(opts?: PatchFillOptions);
|
|
101
|
+
inpaint({ image, mask }: InpaintInput): Promise<RawImage>;
|
|
102
|
+
/** Concentric-ring search for N non-mask neighbours; 1/distance-weighted average. */
|
|
103
|
+
private harvestColour;
|
|
104
|
+
/** Apply 3x3 Gaussian blur to pixels within BLUR_BAND of any mask boundary. */
|
|
105
|
+
private blurMaskBoundary;
|
|
106
|
+
}
|
|
107
|
+
export interface VendorApiInpainterOptions {
|
|
108
|
+
endpoint: string;
|
|
109
|
+
authHeader?: string;
|
|
110
|
+
authValue?: string;
|
|
111
|
+
/** Caller-supplied function that builds the vendor's request body. */
|
|
112
|
+
shapeRequest: (input: InpaintInput) => {
|
|
113
|
+
body: unknown;
|
|
114
|
+
contentType?: string;
|
|
115
|
+
};
|
|
116
|
+
/** Caller-supplied function that parses the vendor's response into RawImage. */
|
|
117
|
+
shapeResponse: (raw: unknown, original: RawImage) => RawImage;
|
|
118
|
+
/** Optional caller-supplied fetch (default: globalThis.fetch). */
|
|
119
|
+
fetcher?: typeof fetch;
|
|
120
|
+
}
|
|
121
|
+
export declare class VendorApiInpainter implements InpainterProvider {
|
|
122
|
+
private readonly opts;
|
|
123
|
+
readonly name: string;
|
|
124
|
+
constructor(opts: VendorApiInpainterOptions);
|
|
125
|
+
inpaint(input: InpaintInput): Promise<RawImage>;
|
|
126
|
+
}
|
|
127
|
+
export interface ResolveInpainterOptions {
|
|
128
|
+
/**
|
|
129
|
+
* `auto` walks: PatchFill (always available) → Stub. Pass an explicit
|
|
130
|
+
* value to skip the ladder. Vendor must be configured explicitly via
|
|
131
|
+
* `vendorApiInpainterFromConfig`.
|
|
132
|
+
*/
|
|
133
|
+
provider?: "auto" | "patch-fill" | "stub" | "vendor-api";
|
|
134
|
+
patchFillOptions?: PatchFillOptions;
|
|
135
|
+
vendorApiOptions?: VendorApiInpainterOptions;
|
|
136
|
+
}
|
|
137
|
+
export declare function resolveInpainter(opts?: ResolveInpainterOptions): InpainterProvider;
|
|
138
|
+
export interface InpaintMaskInput {
|
|
139
|
+
image: RawImage;
|
|
140
|
+
mask: MaskBbox[];
|
|
141
|
+
provider?: InpainterProvider;
|
|
142
|
+
}
|
|
143
|
+
export interface InpaintMaskResult {
|
|
144
|
+
nakedImage: RawImage;
|
|
145
|
+
nakedFingerprint: string;
|
|
146
|
+
provider: string;
|
|
147
|
+
pixelsTouched: number;
|
|
148
|
+
pixelsPreserved: number;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Apply inpainter; return naked image + sha256 fingerprint + diagnostic
|
|
152
|
+
* counts of pixels touched (inside mask) vs preserved (outside mask).
|
|
153
|
+
*/
|
|
154
|
+
export declare function inpaintMaskRegions(input: InpaintMaskInput): Promise<InpaintMaskResult>;
|
|
155
|
+
/** Make a solid-color RawImage. Useful for tests + as a vendor stub. */
|
|
156
|
+
export declare function makeSolidImage(width: number, height: number, rgba: [number, number, number, number]): RawImage;
|
|
157
|
+
/** Make a two-tone RawImage with a fillable region. Useful for tests. */
|
|
158
|
+
export declare function makeTestImage(opts: {
|
|
159
|
+
width: number;
|
|
160
|
+
height: number;
|
|
161
|
+
background: [number, number, number, number];
|
|
162
|
+
foreground: [number, number, number, number];
|
|
163
|
+
fgBbox: [number, number, number, number];
|
|
164
|
+
}): RawImage;
|
|
165
|
+
/** Mean per-channel absolute color distance between two same-sized images, restricted to a bbox. */
|
|
166
|
+
export declare function meanColorDistance(a: RawImage, b: RawImage, bbox?: [number, number, number, number]): number;
|
|
167
|
+
export declare function formatInpaintLine(r: InpaintMaskResult): string;
|
|
168
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/caption_inpaint/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAWH,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,WAAW,QAAQ;IACvB,2DAA2D;IAC3D,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,QAAQ,CAAC;IAChB,IAAI,EAAE,QAAQ,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACjD;AAUD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAOxD;AAmCD;;;;;GAKG;AACH,qBAAa,aAAc,YAAW,iBAAiB;IACrD,QAAQ,CAAC,IAAI,eAAe;IACtB,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC;CAI1D;AAID;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,gBAAgB;IAC/B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,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AE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAmB3G;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAE9D"}
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.19.19 — MNEME CAPTION INPAINT PROTOCOL (Phase A + Phase B complete)
|
|
3
|
+
*
|
|
4
|
+
* Completes the CAPTION SEVERANCE PROTOCOL (CSP, v2.19.18) Step 2:
|
|
5
|
+
* actual content-aware INPAINTING of masked caption regions, producing
|
|
6
|
+
* a true naked-image fingerprint for cross-instance provenance lookups
|
|
7
|
+
* on FEDERATED TRUTH GRAVITY (v2.19.16).
|
|
8
|
+
*
|
|
9
|
+
* PHASE A — Inpainter Adapter (vendor-agnostic):
|
|
10
|
+
* * InpainterProvider interface — parallel to EmbeddingProvider
|
|
11
|
+
* * StubInpainter — deterministic pass-through (CSP v2.19.18 baseline)
|
|
12
|
+
* * VendorApiInpainter — caller-supplied URL + headers + body shape
|
|
13
|
+
* * resolveInpainter() ladder — pick the best available adapter
|
|
14
|
+
*
|
|
15
|
+
* PHASE B — Pure-TS PATCH HARVEST FILL:
|
|
16
|
+
* A content-aware inpainting algorithm shipped as PatchFillInpainter:
|
|
17
|
+
*
|
|
18
|
+
* 1. Build mask bitmap from caller bbox list (1 = masked, 0 = keep).
|
|
19
|
+
* 2. For each masked pixel (x, y):
|
|
20
|
+
* a. Concentric-ring search outward until N=8 non-mask pixels found.
|
|
21
|
+
* b. 1/distance-weighted color average → fill colour.
|
|
22
|
+
* 3. Apply a 3x3 Gaussian blur ONLY across the mask-boundary band
|
|
23
|
+
* (3-pixel skirt) so the fill blends without smearing the rest.
|
|
24
|
+
* 4. Re-hash the rgba bytes → naked-image fingerprint.
|
|
25
|
+
*
|
|
26
|
+
* Not LaMa-quality (won't fool a human inspecting the image), but a
|
|
27
|
+
* legitimate baseline content-aware fill — produces stable, distinct
|
|
28
|
+
* fingerprints for cross-instance provenance + cleans the image enough
|
|
29
|
+
* that downstream vision models stop reading the caption text. Pure TS,
|
|
30
|
+
* ~200 LOC, deterministic per input, zero external deps.
|
|
31
|
+
*
|
|
32
|
+
* Composes onto:
|
|
33
|
+
* * v2.19.18 CAPTION SEVERANCE (severCaption now uses real naked hash)
|
|
34
|
+
* * v2.19.16 FEDERATED TRUTH (naked fingerprint = subject for quorum)
|
|
35
|
+
* * v2.19.13 SNN EMBEDDER (caller can embed naked image after inpaint)
|
|
36
|
+
* * v2.19.10 PROOF-CARRYING (naked hash chainable into proof)
|
|
37
|
+
*
|
|
38
|
+
* Honest scope:
|
|
39
|
+
* * Caller supplies RGBA pixel data (decoded by sharp/canvas/png-js).
|
|
40
|
+
* Mneme stays decoder-free for the same reason CSP stays OCR-free.
|
|
41
|
+
* * VendorApiInpainter is a SHAPE adapter — caller supplies request +
|
|
42
|
+
* response shaping function so any vendor (DeepAI / Replicate / HF)
|
|
43
|
+
* can plug in without Mneme growing API integrations.
|
|
44
|
+
* * Patch-fill loses ~30% PSNR vs LaMa; that's the trade for pure TS
|
|
45
|
+
* + zero deps + offline + deterministic.
|
|
46
|
+
*/
|
|
47
|
+
import { createHash } from "node:crypto";
|
|
48
|
+
const PROTOCOL_VERSION = 1;
|
|
49
|
+
const DEFAULT_RING_SEARCH_LIMIT = 64; // max search radius (pixels)
|
|
50
|
+
const DEFAULT_NEIGHBOUR_TARGET = 8; // sample N non-mask neighbours
|
|
51
|
+
const DEFAULT_BLUR_BAND_PX = 3; // post-fill blend skirt width
|
|
52
|
+
// ─── HELPERS ────────────────────────────────────────────────────────────
|
|
53
|
+
function sha256OfBytes(bytes) {
|
|
54
|
+
const h = createHash("sha256");
|
|
55
|
+
h.update(bytes);
|
|
56
|
+
return h.digest("hex");
|
|
57
|
+
}
|
|
58
|
+
export function nakedFingerprint(image) {
|
|
59
|
+
// Hash the rgba bytes + dimensions so width/height changes invalidate.
|
|
60
|
+
const meta = Buffer.from(`${image.width}x${image.height}|`, "utf8");
|
|
61
|
+
const total = new Uint8Array(meta.byteLength + image.rgba.byteLength);
|
|
62
|
+
total.set(meta, 0);
|
|
63
|
+
total.set(image.rgba, meta.byteLength);
|
|
64
|
+
return sha256OfBytes(total);
|
|
65
|
+
}
|
|
66
|
+
/** Validate raw image shape. Throws on malformed input. */
|
|
67
|
+
function assertValidImage(image) {
|
|
68
|
+
if (!Number.isFinite(image.width) || image.width <= 0) {
|
|
69
|
+
throw new Error("inpaint: invalid width");
|
|
70
|
+
}
|
|
71
|
+
if (!Number.isFinite(image.height) || image.height <= 0) {
|
|
72
|
+
throw new Error("inpaint: invalid height");
|
|
73
|
+
}
|
|
74
|
+
if (image.rgba.length !== image.width * image.height * 4) {
|
|
75
|
+
throw new Error(`inpaint: rgba length ${image.rgba.length} != width*height*4 = ${image.width * image.height * 4}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/** Build a Uint8Array bitmap with 1 = masked, 0 = keep. */
|
|
79
|
+
function buildMaskBitmap(width, height, mask) {
|
|
80
|
+
const bits = new Uint8Array(width * height);
|
|
81
|
+
for (const region of mask) {
|
|
82
|
+
const [x, y, w, h] = region.bbox;
|
|
83
|
+
const x0 = Math.max(0, Math.floor(x));
|
|
84
|
+
const y0 = Math.max(0, Math.floor(y));
|
|
85
|
+
const x1 = Math.min(width, Math.floor(x + w));
|
|
86
|
+
const y1 = Math.min(height, Math.floor(y + h));
|
|
87
|
+
for (let py = y0; py < y1; py++) {
|
|
88
|
+
for (let px = x0; px < x1; px++) {
|
|
89
|
+
bits[py * width + px] = 1;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return bits;
|
|
94
|
+
}
|
|
95
|
+
// ─── ADAPTER 1: StubInpainter (Phase A baseline) ─────────────────────────
|
|
96
|
+
/**
|
|
97
|
+
* StubInpainter: returns the image UNCHANGED. Used when no real inpainter
|
|
98
|
+
* is available — same behavior as CSP v2.19.18 deterministic stub.
|
|
99
|
+
* Naked fingerprint differs from the patch-fill version, which is correct:
|
|
100
|
+
* it signals "we did not actually mask the captions" to the provenance gate.
|
|
101
|
+
*/
|
|
102
|
+
export class StubInpainter {
|
|
103
|
+
name = "stub:noop";
|
|
104
|
+
async inpaint({ image }) {
|
|
105
|
+
assertValidImage(image);
|
|
106
|
+
return { width: image.width, height: image.height, rgba: new Uint8Array(image.rgba) };
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
export class PatchFillInpainter {
|
|
110
|
+
name = "patch-harvest-fill:v1";
|
|
111
|
+
ringSearchLimit;
|
|
112
|
+
neighbourTarget;
|
|
113
|
+
blurBandPx;
|
|
114
|
+
constructor(opts = {}) {
|
|
115
|
+
this.ringSearchLimit = opts.ringSearchLimit ?? DEFAULT_RING_SEARCH_LIMIT;
|
|
116
|
+
this.neighbourTarget = opts.neighbourTarget ?? DEFAULT_NEIGHBOUR_TARGET;
|
|
117
|
+
this.blurBandPx = opts.blurBandPx ?? DEFAULT_BLUR_BAND_PX;
|
|
118
|
+
}
|
|
119
|
+
async inpaint({ image, mask }) {
|
|
120
|
+
assertValidImage(image);
|
|
121
|
+
if (mask.length === 0) {
|
|
122
|
+
return { width: image.width, height: image.height, rgba: new Uint8Array(image.rgba) };
|
|
123
|
+
}
|
|
124
|
+
const { width: W, height: H } = image;
|
|
125
|
+
const bits = buildMaskBitmap(W, H, mask);
|
|
126
|
+
const out = new Uint8Array(image.rgba);
|
|
127
|
+
// Step 2: fill each masked pixel via concentric-ring search.
|
|
128
|
+
for (let y = 0; y < H; y++) {
|
|
129
|
+
for (let x = 0; x < W; x++) {
|
|
130
|
+
if (!bits[y * W + x])
|
|
131
|
+
continue;
|
|
132
|
+
const filled = this.harvestColour(image.rgba, bits, W, H, x, y);
|
|
133
|
+
const idx = (y * W + x) * 4;
|
|
134
|
+
out[idx + 0] = filled.r;
|
|
135
|
+
out[idx + 1] = filled.g;
|
|
136
|
+
out[idx + 2] = filled.b;
|
|
137
|
+
out[idx + 3] = filled.a;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
// Step 3: 3x3 Gaussian blur on the boundary band (configurable width).
|
|
141
|
+
if (this.blurBandPx > 0) {
|
|
142
|
+
this.blurMaskBoundary(out, bits, W, H);
|
|
143
|
+
}
|
|
144
|
+
return { width: W, height: H, rgba: out };
|
|
145
|
+
}
|
|
146
|
+
/** Concentric-ring search for N non-mask neighbours; 1/distance-weighted average. */
|
|
147
|
+
harvestColour(rgba, bits, W, H, x, y) {
|
|
148
|
+
let totalR = 0, totalG = 0, totalB = 0, totalA = 0;
|
|
149
|
+
let totalWeight = 0;
|
|
150
|
+
let found = 0;
|
|
151
|
+
for (let r = 1; r <= this.ringSearchLimit && found < this.neighbourTarget; r++) {
|
|
152
|
+
// Iterate the ring of radius r (axis-aligned square frame).
|
|
153
|
+
for (let dy = -r; dy <= r && found < this.neighbourTarget; dy++) {
|
|
154
|
+
for (let dx = -r; dx <= r; dx++) {
|
|
155
|
+
// Only the outer frame of this ring.
|
|
156
|
+
if (Math.max(Math.abs(dx), Math.abs(dy)) !== r)
|
|
157
|
+
continue;
|
|
158
|
+
const nx = x + dx;
|
|
159
|
+
const ny = y + dy;
|
|
160
|
+
if (nx < 0 || nx >= W || ny < 0 || ny >= H)
|
|
161
|
+
continue;
|
|
162
|
+
if (bits[ny * W + nx])
|
|
163
|
+
continue; // skip masked neighbours
|
|
164
|
+
const idx = (ny * W + nx) * 4;
|
|
165
|
+
const dist = Math.sqrt(dx * dx + dy * dy);
|
|
166
|
+
const w = 1 / dist;
|
|
167
|
+
totalR += rgba[idx + 0] * w;
|
|
168
|
+
totalG += rgba[idx + 1] * w;
|
|
169
|
+
totalB += rgba[idx + 2] * w;
|
|
170
|
+
totalA += rgba[idx + 3] * w;
|
|
171
|
+
totalWeight += w;
|
|
172
|
+
found++;
|
|
173
|
+
if (found >= this.neighbourTarget)
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
if (totalWeight === 0) {
|
|
179
|
+
// No neighbours found (entire image is masked or pathological). Fall back to grey.
|
|
180
|
+
return { r: 128, g: 128, b: 128, a: 255 };
|
|
181
|
+
}
|
|
182
|
+
return {
|
|
183
|
+
r: Math.round(totalR / totalWeight),
|
|
184
|
+
g: Math.round(totalG / totalWeight),
|
|
185
|
+
b: Math.round(totalB / totalWeight),
|
|
186
|
+
a: Math.round(totalA / totalWeight),
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
/** Apply 3x3 Gaussian blur to pixels within BLUR_BAND of any mask boundary. */
|
|
190
|
+
blurMaskBoundary(rgba, bits, W, H) {
|
|
191
|
+
// Build a band map: pixels within BLUR_BAND of a mask boundary get blurred.
|
|
192
|
+
const band = new Uint8Array(W * H);
|
|
193
|
+
for (let y = 0; y < H; y++) {
|
|
194
|
+
for (let x = 0; x < W; x++) {
|
|
195
|
+
if (!bits[y * W + x])
|
|
196
|
+
continue;
|
|
197
|
+
// For each masked pixel, mark its surroundings (including itself).
|
|
198
|
+
for (let dy = -this.blurBandPx; dy <= this.blurBandPx; dy++) {
|
|
199
|
+
for (let dx = -this.blurBandPx; dx <= this.blurBandPx; dx++) {
|
|
200
|
+
const nx = x + dx;
|
|
201
|
+
const ny = y + dy;
|
|
202
|
+
if (nx < 0 || nx >= W || ny < 0 || ny >= H)
|
|
203
|
+
continue;
|
|
204
|
+
band[ny * W + nx] = 1;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
// 3x3 Gaussian-ish kernel: [1, 2, 1; 2, 4, 2; 1, 2, 1] / 16
|
|
210
|
+
const KERNEL = [1, 2, 1, 2, 4, 2, 1, 2, 1];
|
|
211
|
+
const KSUM = 16;
|
|
212
|
+
const snapshot = new Uint8Array(rgba);
|
|
213
|
+
for (let y = 1; y < H - 1; y++) {
|
|
214
|
+
for (let x = 1; x < W - 1; x++) {
|
|
215
|
+
if (!band[y * W + x])
|
|
216
|
+
continue;
|
|
217
|
+
let r = 0, g = 0, b = 0, a = 0;
|
|
218
|
+
let k = 0;
|
|
219
|
+
for (let dy = -1; dy <= 1; dy++) {
|
|
220
|
+
for (let dx = -1; dx <= 1; dx++) {
|
|
221
|
+
const idx = ((y + dy) * W + (x + dx)) * 4;
|
|
222
|
+
const w = KERNEL[k++];
|
|
223
|
+
r += snapshot[idx + 0] * w;
|
|
224
|
+
g += snapshot[idx + 1] * w;
|
|
225
|
+
b += snapshot[idx + 2] * w;
|
|
226
|
+
a += snapshot[idx + 3] * w;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
const out = (y * W + x) * 4;
|
|
230
|
+
rgba[out + 0] = Math.round(r / KSUM);
|
|
231
|
+
rgba[out + 1] = Math.round(g / KSUM);
|
|
232
|
+
rgba[out + 2] = Math.round(b / KSUM);
|
|
233
|
+
rgba[out + 3] = Math.round(a / KSUM);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
export class VendorApiInpainter {
|
|
239
|
+
opts;
|
|
240
|
+
name;
|
|
241
|
+
constructor(opts) {
|
|
242
|
+
this.opts = opts;
|
|
243
|
+
this.name = `vendor-api:${new URL(opts.endpoint).host}`;
|
|
244
|
+
}
|
|
245
|
+
async inpaint(input) {
|
|
246
|
+
assertValidImage(input.image);
|
|
247
|
+
const { body, contentType } = this.opts.shapeRequest(input);
|
|
248
|
+
const headers = {
|
|
249
|
+
"content-type": contentType ?? "application/json",
|
|
250
|
+
};
|
|
251
|
+
if (this.opts.authHeader && this.opts.authValue) {
|
|
252
|
+
headers[this.opts.authHeader] = this.opts.authValue;
|
|
253
|
+
}
|
|
254
|
+
const fetcher = this.opts.fetcher ?? globalThis.fetch;
|
|
255
|
+
if (!fetcher) {
|
|
256
|
+
throw new Error(`VendorApiInpainter: no fetch available; supply opts.fetcher`);
|
|
257
|
+
}
|
|
258
|
+
const init = {
|
|
259
|
+
method: "POST",
|
|
260
|
+
headers,
|
|
261
|
+
body: typeof body === "string" ? body : (body instanceof Uint8Array ? body : JSON.stringify(body)),
|
|
262
|
+
};
|
|
263
|
+
const res = await fetcher(this.opts.endpoint, init);
|
|
264
|
+
if (!res.ok) {
|
|
265
|
+
throw new Error(`VendorApiInpainter: HTTP ${res.status} ${res.statusText}`);
|
|
266
|
+
}
|
|
267
|
+
const ct = res.headers.get("content-type") ?? "application/json";
|
|
268
|
+
const raw = ct.startsWith("application/json") ? await res.json() : new Uint8Array(await res.arrayBuffer());
|
|
269
|
+
return this.opts.shapeResponse(raw, input.image);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
export function resolveInpainter(opts = {}) {
|
|
273
|
+
const provider = opts.provider ?? "auto";
|
|
274
|
+
if (provider === "stub")
|
|
275
|
+
return new StubInpainter();
|
|
276
|
+
if (provider === "patch-fill")
|
|
277
|
+
return new PatchFillInpainter(opts.patchFillOptions);
|
|
278
|
+
if (provider === "vendor-api") {
|
|
279
|
+
if (!opts.vendorApiOptions)
|
|
280
|
+
throw new Error("resolveInpainter: vendor-api selected but no vendorApiOptions");
|
|
281
|
+
return new VendorApiInpainter(opts.vendorApiOptions);
|
|
282
|
+
}
|
|
283
|
+
// auto: prefer Phase B patch-fill (always available, deterministic, offline)
|
|
284
|
+
return new PatchFillInpainter(opts.patchFillOptions);
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Apply inpainter; return naked image + sha256 fingerprint + diagnostic
|
|
288
|
+
* counts of pixels touched (inside mask) vs preserved (outside mask).
|
|
289
|
+
*/
|
|
290
|
+
export async function inpaintMaskRegions(input) {
|
|
291
|
+
const provider = input.provider ?? new PatchFillInpainter();
|
|
292
|
+
const nakedImage = await provider.inpaint({ image: input.image, mask: input.mask });
|
|
293
|
+
// Diagnostic: count pixels that differ from original.
|
|
294
|
+
let touched = 0;
|
|
295
|
+
let preserved = 0;
|
|
296
|
+
for (let i = 0; i < input.image.rgba.length; i += 4) {
|
|
297
|
+
const same = input.image.rgba[i + 0] === nakedImage.rgba[i + 0] &&
|
|
298
|
+
input.image.rgba[i + 1] === nakedImage.rgba[i + 1] &&
|
|
299
|
+
input.image.rgba[i + 2] === nakedImage.rgba[i + 2] &&
|
|
300
|
+
input.image.rgba[i + 3] === nakedImage.rgba[i + 3];
|
|
301
|
+
if (same)
|
|
302
|
+
preserved++;
|
|
303
|
+
else
|
|
304
|
+
touched++;
|
|
305
|
+
}
|
|
306
|
+
return {
|
|
307
|
+
nakedImage,
|
|
308
|
+
nakedFingerprint: nakedFingerprint(nakedImage),
|
|
309
|
+
provider: provider.name,
|
|
310
|
+
pixelsTouched: touched,
|
|
311
|
+
pixelsPreserved: preserved,
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
// ─── HELPERS ────────────────────────────────────────────────────────────
|
|
315
|
+
/** Make a solid-color RawImage. Useful for tests + as a vendor stub. */
|
|
316
|
+
export function makeSolidImage(width, height, rgba) {
|
|
317
|
+
const bytes = new Uint8Array(width * height * 4);
|
|
318
|
+
for (let i = 0; i < width * height; i++) {
|
|
319
|
+
bytes[i * 4 + 0] = rgba[0];
|
|
320
|
+
bytes[i * 4 + 1] = rgba[1];
|
|
321
|
+
bytes[i * 4 + 2] = rgba[2];
|
|
322
|
+
bytes[i * 4 + 3] = rgba[3];
|
|
323
|
+
}
|
|
324
|
+
return { width, height, rgba: bytes };
|
|
325
|
+
}
|
|
326
|
+
/** Make a two-tone RawImage with a fillable region. Useful for tests. */
|
|
327
|
+
export function makeTestImage(opts) {
|
|
328
|
+
const img = makeSolidImage(opts.width, opts.height, opts.background);
|
|
329
|
+
const [fx, fy, fw, fh] = opts.fgBbox;
|
|
330
|
+
for (let y = fy; y < Math.min(opts.height, fy + fh); y++) {
|
|
331
|
+
for (let x = fx; x < Math.min(opts.width, fx + fw); x++) {
|
|
332
|
+
const idx = (y * opts.width + x) * 4;
|
|
333
|
+
img.rgba[idx + 0] = opts.foreground[0];
|
|
334
|
+
img.rgba[idx + 1] = opts.foreground[1];
|
|
335
|
+
img.rgba[idx + 2] = opts.foreground[2];
|
|
336
|
+
img.rgba[idx + 3] = opts.foreground[3];
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
return img;
|
|
340
|
+
}
|
|
341
|
+
/** Mean per-channel absolute color distance between two same-sized images, restricted to a bbox. */
|
|
342
|
+
export function meanColorDistance(a, b, bbox) {
|
|
343
|
+
if (a.width !== b.width || a.height !== b.height)
|
|
344
|
+
throw new Error("meanColorDistance: dim mismatch");
|
|
345
|
+
const [x0, y0, w, h] = bbox ?? [0, 0, a.width, a.height];
|
|
346
|
+
const x1 = Math.min(a.width, x0 + w);
|
|
347
|
+
const y1 = Math.min(a.height, y0 + h);
|
|
348
|
+
let sum = 0;
|
|
349
|
+
let count = 0;
|
|
350
|
+
for (let y = y0; y < y1; y++) {
|
|
351
|
+
for (let x = x0; x < x1; x++) {
|
|
352
|
+
const idx = (y * a.width + x) * 4;
|
|
353
|
+
sum +=
|
|
354
|
+
Math.abs(a.rgba[idx + 0] - b.rgba[idx + 0]) +
|
|
355
|
+
Math.abs(a.rgba[idx + 1] - b.rgba[idx + 1]) +
|
|
356
|
+
Math.abs(a.rgba[idx + 2] - b.rgba[idx + 2]) +
|
|
357
|
+
Math.abs(a.rgba[idx + 3] - b.rgba[idx + 3]);
|
|
358
|
+
count++;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
return count === 0 ? 0 : sum / (count * 4);
|
|
362
|
+
}
|
|
363
|
+
export function formatInpaintLine(r) {
|
|
364
|
+
return `🎨 INPAINT · ${r.provider} · touched=${r.pixelsTouched} · preserved=${r.pixelsPreserved} · naked=${r.nakedFingerprint.slice(0, 10)}`;
|
|
365
|
+
}
|
|
366
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/caption_inpaint/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;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AC,GAAG,GAAG,CAAC,CAAE,CAAC;oBAC7C,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAE,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAE,CAAC,CAAC;YAChD,KAAK,EAAE,CAAC;QACV,CAAC;IACH,CAAC;IACD,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,CAAoB;IACpD,OAAO,gBAAgB,CAAC,CAAC,QAAQ,cAAc,CAAC,CAAC,aAAa,gBAAgB,CAAC,CAAC,eAAe,YAAY,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;AAC/I,CAAC"}
|
|
@@ -162,7 +162,41 @@ export interface SeveranceInput {
|
|
|
162
162
|
captions: OcrCaption[];
|
|
163
163
|
provenance?: ProvenanceInput;
|
|
164
164
|
adversarial?: AdversarialDoubleCheckInput;
|
|
165
|
+
/**
|
|
166
|
+
* v2.19.18 Phase A fast path: caller pre-computed the inpainted hash
|
|
167
|
+
* (e.g., via mneme.caption.inpaint v2.19.19) — we use it directly.
|
|
168
|
+
* Mutually exclusive with `rawImage`.
|
|
169
|
+
*/
|
|
165
170
|
callerSuppliedNakedHash?: string;
|
|
171
|
+
/**
|
|
172
|
+
* v2.19.19 Phase B integrated path: caller supplies raw RGBA pixel data;
|
|
173
|
+
* severCaption ALSO runs the inpainter and produces the true naked
|
|
174
|
+
* fingerprint. Imported lazily from caption_inpaint to keep this
|
|
175
|
+
* module dependency-light when callers don't need inpainting.
|
|
176
|
+
*/
|
|
177
|
+
rawImage?: {
|
|
178
|
+
width: number;
|
|
179
|
+
height: number;
|
|
180
|
+
rgba: Uint8Array;
|
|
181
|
+
};
|
|
182
|
+
/** Optional override: v2.19.19 `InpainterProvider`. Default: PatchFillInpainter. */
|
|
183
|
+
inpainter?: {
|
|
184
|
+
name: string;
|
|
185
|
+
inpaint: (i: {
|
|
186
|
+
image: {
|
|
187
|
+
width: number;
|
|
188
|
+
height: number;
|
|
189
|
+
rgba: Uint8Array;
|
|
190
|
+
};
|
|
191
|
+
mask: Array<{
|
|
192
|
+
bbox: [number, number, number, number];
|
|
193
|
+
}>;
|
|
194
|
+
}) => Promise<{
|
|
195
|
+
width: number;
|
|
196
|
+
height: number;
|
|
197
|
+
rgba: Uint8Array;
|
|
198
|
+
}>;
|
|
199
|
+
};
|
|
166
200
|
nowMs?: number;
|
|
167
201
|
secret?: string;
|
|
168
202
|
}
|
|
@@ -176,6 +210,10 @@ export interface SeveranceResult {
|
|
|
176
210
|
/**
|
|
177
211
|
* Run the full 6-step pipeline. Returns a HMAC-signed certificate and a
|
|
178
212
|
* ready-to-inject AI prompt that wraps every caption as XSS-escaped claim.
|
|
213
|
+
*
|
|
214
|
+
* v2.19.19: when input.rawImage is supplied AND v2.19.19 caption_inpaint
|
|
215
|
+
* is importable, use severCaptionAsync() instead for the integrated Phase
|
|
216
|
+
* B path. severCaption() (sync) stays Phase-A-only and pure-function.
|
|
179
217
|
*/
|
|
180
218
|
export declare function severCaption(input: SeveranceInput): SeveranceResult;
|
|
181
219
|
export declare function verifyCertificate(cert: VisionTrustCertificate, secret?: string): {
|
|
@@ -184,6 +222,14 @@ export declare function verifyCertificate(cert: VisionTrustCertificate, secret?:
|
|
|
184
222
|
};
|
|
185
223
|
/** Heuristic check: does an AI answer reference a valid Mneme VTC id? */
|
|
186
224
|
export declare function answerHasValidCert(answer: string, knownCertIds: string[]): boolean;
|
|
225
|
+
/**
|
|
226
|
+
* v2.19.19 — async variant that ALSO runs the inpainter when input.rawImage
|
|
227
|
+
* is supplied. Returns the same SeveranceResult plus the real Phase B
|
|
228
|
+
* naked image fingerprint.
|
|
229
|
+
*/
|
|
230
|
+
export declare function severCaptionAsync(input: SeveranceInput): Promise<SeveranceResult & {
|
|
231
|
+
phaseBNakedHash?: string;
|
|
232
|
+
}>;
|
|
187
233
|
export declare function formatSeveranceLine(r: SeveranceResult): string;
|
|
188
234
|
export {};
|
|
189
235
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/caption_severance/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAIH,QAAA,MAAM,gBAAgB,EAAG,CAAU,CAAC;AAIpC,MAAM,WAAW,UAAU;IACzB,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,kGAAkG;IAClG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,8EAA8E;IAC9E,SAAS,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAID,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,iEAAiE;IACjE,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,gBAAgB,EAAE,MAAM,CAAC;IACzB,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;CAC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