pixelkiln 0.35.0 → 0.37.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.
package/dist/index.d.cts CHANGED
@@ -12,6 +12,71 @@ declare function detectMediaType(bytes: Buffer): MediaType | null;
12
12
  declare function validateMedia(bytes: Buffer, expected?: MediaType): MediaType;
13
13
  declare function cacheFileName(hash: string, mediaType?: MediaType): string;
14
14
 
15
+ /**
16
+ * The kinds of failure a caller can act on differently.
17
+ *
18
+ * Most errors in this codebase are plain `Error`s with a good message, and
19
+ * that stays true: the message is for a person. A `code` is for a program.
20
+ * The gallery turns one into an HTTP status, the CLI into an exit code, and
21
+ * an integration decides whether to retry, ask, or stop without matching on
22
+ * message text that may be reworded.
23
+ *
24
+ * The set is deliberately small. A new code earns its place when some caller
25
+ * would branch on it; until then a plain Error is the right type.
26
+ */
27
+ type ErrorCode =
28
+ /** Bad flags or arguments. Nothing was read or written. */
29
+ "usage"
30
+ /** The manifest, lockfile, or workspace catalog is missing or invalid. */
31
+ | "project"
32
+ /** A provider rejected a request or answered with something unusable. */
33
+ | "provider"
34
+ /** A file on disk differs from what the record expects; nothing was overwritten. */
35
+ | "refused-overwrite"
36
+ /** The run would spend past a ceiling, or the balance cannot cover it. */
37
+ | "budget"
38
+ /** The provider recorded for this work does not offer the operation. */
39
+ | "capability";
40
+ /** Exit codes the CLI maps each kind to. 1 stays the code for anything untyped. */
41
+ declare const EXIT_CODES: Record<ErrorCode, number>;
42
+ interface PixelKilnErrorOptions {
43
+ /** One line of what to do next, printed under the message by the CLI. */
44
+ hint?: string;
45
+ cause?: unknown;
46
+ }
47
+ declare class PixelKilnError extends Error {
48
+ readonly code: ErrorCode;
49
+ readonly hint?: string;
50
+ constructor(message: string, code: ErrorCode, opts?: PixelKilnErrorOptions);
51
+ }
52
+ declare class UsageError extends PixelKilnError {
53
+ constructor(message: string, opts?: PixelKilnErrorOptions);
54
+ }
55
+ declare class ProjectError extends PixelKilnError {
56
+ constructor(message: string, opts?: PixelKilnErrorOptions);
57
+ }
58
+ declare class ProviderError extends PixelKilnError {
59
+ /** Registry id of the provider that failed. */
60
+ readonly provider: string;
61
+ /** HTTP status when the failure was a response, otherwise undefined. */
62
+ readonly status?: number;
63
+ constructor(provider: string, message: string, opts?: PixelKilnErrorOptions & {
64
+ status?: number;
65
+ });
66
+ }
67
+ declare class OverwriteRefusedError extends PixelKilnError {
68
+ /** The file(s) left untouched. */
69
+ readonly files: string[];
70
+ constructor(message: string, files: string[], opts?: PixelKilnErrorOptions);
71
+ }
72
+ declare class BudgetError extends PixelKilnError {
73
+ constructor(message: string, opts?: PixelKilnErrorOptions);
74
+ }
75
+ /** The code of any thrown value, or undefined for an untyped error. */
76
+ declare function errorCode(err: unknown): ErrorCode | undefined;
77
+ /** What a process should exit with after failing on `err`. */
78
+ declare function exitCodeFor(err: unknown): number;
79
+
15
80
  /**
16
81
  * Human-readable unit attached to every estimate and recorded charge.
17
82
  * Built-ins use generations, USD, free, and compute units. Adapters may report
@@ -230,7 +295,7 @@ interface Provider {
230
295
  /** Irreversible. Only reached via `purge`, behind explicit confirmation. */
231
296
  delete?(assetId: string): Promise<void>;
232
297
  }
233
- declare class UnsupportedCapabilityError extends Error {
298
+ declare class UnsupportedCapabilityError extends PixelKilnError {
234
299
  constructor(providerId: string, capability: string);
235
300
  }
236
301
  /** Narrowing helpers so call sites fail with a clear message, not `undefined is not a function`. */
@@ -561,6 +626,18 @@ declare const StyleSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
561
626
  * chocolate bar.
562
627
  */
563
628
  palette: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
629
+ /**
630
+ * Snap every visible pixel of the downloaded art to the nearest `palette`
631
+ * colour, without dithering. The palette is sent to providers that take
632
+ * one, and most honour it most of the time; this makes it a guarantee
633
+ * for every generator, including the ones with no palette parameter.
634
+ * Applied by `fetch` as the file is written and recorded on the lock
635
+ * entry, so a restore reproduces the same bytes. Turning it on or off
636
+ * does not change the spec hash: `plan` reports the entry as recoverable
637
+ * and the next `fetch` or `restore` re-applies it from the art already
638
+ * on disk or in the cache, spending nothing.
639
+ */
640
+ enforcePalette: z.ZodDefault<z.ZodBoolean>;
564
641
  /** Fail-closed native-grid, palette, and human-approval policy for derived art. */
565
642
  quality: z.ZodOptional<z.ZodEffects<z.ZodObject<{
566
643
  /** Output root for approved refined art, relative to the manifest. */
@@ -657,6 +734,7 @@ declare const StyleSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
657
734
  path: string;
658
735
  }[];
659
736
  noBackground: boolean;
737
+ enforcePalette: boolean;
660
738
  tags: string[];
661
739
  providerOptions: Record<string, Record<string, unknown>>;
662
740
  provider?: string | undefined;
@@ -688,8 +766,8 @@ declare const StyleSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
688
766
  } | undefined;
689
767
  }, {
690
768
  outDir: string;
691
- palette?: string[] | undefined;
692
769
  provider?: string | undefined;
770
+ palette?: string[] | undefined;
693
771
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
694
772
  size?: number | undefined;
695
773
  view?: string | undefined;
@@ -708,6 +786,7 @@ declare const StyleSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
708
786
  outlineMode?: "outline" | "segmentation" | undefined;
709
787
  noBackground?: boolean | undefined;
710
788
  seed?: number | undefined;
789
+ enforcePalette?: boolean | undefined;
711
790
  quality?: {
712
791
  outDir: string;
713
792
  palette: string[];
@@ -735,6 +814,7 @@ declare const StyleSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
735
814
  path: string;
736
815
  }[];
737
816
  noBackground: boolean;
817
+ enforcePalette: boolean;
738
818
  tags: string[];
739
819
  providerOptions: Record<string, Record<string, unknown>>;
740
820
  provider?: string | undefined;
@@ -766,8 +846,8 @@ declare const StyleSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
766
846
  } | undefined;
767
847
  }, {
768
848
  outDir: string;
769
- palette?: string[] | undefined;
770
849
  provider?: string | undefined;
850
+ palette?: string[] | undefined;
771
851
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
772
852
  size?: number | undefined;
773
853
  view?: string | undefined;
@@ -786,6 +866,7 @@ declare const StyleSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
786
866
  outlineMode?: "outline" | "segmentation" | undefined;
787
867
  noBackground?: boolean | undefined;
788
868
  seed?: number | undefined;
869
+ enforcePalette?: boolean | undefined;
789
870
  quality?: {
790
871
  outDir: string;
791
872
  palette: string[];
@@ -813,6 +894,7 @@ declare const StyleSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
813
894
  path: string;
814
895
  }[];
815
896
  noBackground: boolean;
897
+ enforcePalette: boolean;
816
898
  tags: string[];
817
899
  providerOptions: Record<string, Record<string, unknown>>;
818
900
  provider?: string | undefined;
@@ -844,8 +926,8 @@ declare const StyleSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
844
926
  } | undefined;
845
927
  }, {
846
928
  outDir: string;
847
- palette?: string[] | undefined;
848
929
  provider?: string | undefined;
930
+ palette?: string[] | undefined;
849
931
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
850
932
  size?: number | undefined;
851
933
  view?: string | undefined;
@@ -864,6 +946,7 @@ declare const StyleSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
864
946
  outlineMode?: "outline" | "segmentation" | undefined;
865
947
  noBackground?: boolean | undefined;
866
948
  seed?: number | undefined;
949
+ enforcePalette?: boolean | undefined;
867
950
  quality?: {
868
951
  outDir: string;
869
952
  palette: string[];
@@ -912,6 +995,7 @@ declare const InheritedStyleSchema: z.ZodObject<{
912
995
  noBackground: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
913
996
  seed: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
914
997
  palette: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
998
+ enforcePalette: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
915
999
  mount: z.ZodOptional<z.ZodOptional<z.ZodObject<{
916
1000
  /**
917
1001
  * Existing sheet to composite into, relative to the manifest. Every
@@ -968,8 +1052,8 @@ declare const InheritedStyleSchema: z.ZodObject<{
968
1052
  }, "strict", z.ZodTypeAny, {
969
1053
  outDir: string;
970
1054
  extends: string;
971
- palette?: string[] | undefined;
972
1055
  provider?: string | undefined;
1056
+ palette?: string[] | undefined;
973
1057
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
974
1058
  size?: number | undefined;
975
1059
  view?: string | undefined;
@@ -988,6 +1072,7 @@ declare const InheritedStyleSchema: z.ZodObject<{
988
1072
  outlineMode?: "outline" | "segmentation" | undefined;
989
1073
  noBackground?: boolean | undefined;
990
1074
  seed?: number | undefined;
1075
+ enforcePalette?: boolean | undefined;
991
1076
  quality?: {
992
1077
  outDir?: string | undefined;
993
1078
  palette?: string[] | undefined;
@@ -1008,8 +1093,8 @@ declare const InheritedStyleSchema: z.ZodObject<{
1008
1093
  }, {
1009
1094
  outDir: string;
1010
1095
  extends: string;
1011
- palette?: string[] | undefined;
1012
1096
  provider?: string | undefined;
1097
+ palette?: string[] | undefined;
1013
1098
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
1014
1099
  size?: number | undefined;
1015
1100
  view?: string | undefined;
@@ -1028,6 +1113,7 @@ declare const InheritedStyleSchema: z.ZodObject<{
1028
1113
  outlineMode?: "outline" | "segmentation" | undefined;
1029
1114
  noBackground?: boolean | undefined;
1030
1115
  seed?: number | undefined;
1116
+ enforcePalette?: boolean | undefined;
1031
1117
  quality?: {
1032
1118
  outDir?: string | undefined;
1033
1119
  palette?: string[] | undefined;
@@ -1137,6 +1223,18 @@ declare const StyleInputSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodObjec
1137
1223
  * chocolate bar.
1138
1224
  */
1139
1225
  palette: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1226
+ /**
1227
+ * Snap every visible pixel of the downloaded art to the nearest `palette`
1228
+ * colour, without dithering. The palette is sent to providers that take
1229
+ * one, and most honour it most of the time; this makes it a guarantee
1230
+ * for every generator, including the ones with no palette parameter.
1231
+ * Applied by `fetch` as the file is written and recorded on the lock
1232
+ * entry, so a restore reproduces the same bytes. Turning it on or off
1233
+ * does not change the spec hash: `plan` reports the entry as recoverable
1234
+ * and the next `fetch` or `restore` re-applies it from the art already
1235
+ * on disk or in the cache, spending nothing.
1236
+ */
1237
+ enforcePalette: z.ZodDefault<z.ZodBoolean>;
1140
1238
  /** Fail-closed native-grid, palette, and human-approval policy for derived art. */
1141
1239
  quality: z.ZodOptional<z.ZodEffects<z.ZodObject<{
1142
1240
  /** Output root for approved refined art, relative to the manifest. */
@@ -1233,6 +1331,7 @@ declare const StyleInputSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodObjec
1233
1331
  path: string;
1234
1332
  }[];
1235
1333
  noBackground: boolean;
1334
+ enforcePalette: boolean;
1236
1335
  tags: string[];
1237
1336
  providerOptions: Record<string, Record<string, unknown>>;
1238
1337
  provider?: string | undefined;
@@ -1264,8 +1363,8 @@ declare const StyleInputSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodObjec
1264
1363
  } | undefined;
1265
1364
  }, {
1266
1365
  outDir: string;
1267
- palette?: string[] | undefined;
1268
1366
  provider?: string | undefined;
1367
+ palette?: string[] | undefined;
1269
1368
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
1270
1369
  size?: number | undefined;
1271
1370
  view?: string | undefined;
@@ -1284,6 +1383,7 @@ declare const StyleInputSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodObjec
1284
1383
  outlineMode?: "outline" | "segmentation" | undefined;
1285
1384
  noBackground?: boolean | undefined;
1286
1385
  seed?: number | undefined;
1386
+ enforcePalette?: boolean | undefined;
1287
1387
  quality?: {
1288
1388
  outDir: string;
1289
1389
  palette: string[];
@@ -1311,6 +1411,7 @@ declare const StyleInputSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodObjec
1311
1411
  path: string;
1312
1412
  }[];
1313
1413
  noBackground: boolean;
1414
+ enforcePalette: boolean;
1314
1415
  tags: string[];
1315
1416
  providerOptions: Record<string, Record<string, unknown>>;
1316
1417
  provider?: string | undefined;
@@ -1342,8 +1443,8 @@ declare const StyleInputSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodObjec
1342
1443
  } | undefined;
1343
1444
  }, {
1344
1445
  outDir: string;
1345
- palette?: string[] | undefined;
1346
1446
  provider?: string | undefined;
1447
+ palette?: string[] | undefined;
1347
1448
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
1348
1449
  size?: number | undefined;
1349
1450
  view?: string | undefined;
@@ -1362,6 +1463,7 @@ declare const StyleInputSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodObjec
1362
1463
  outlineMode?: "outline" | "segmentation" | undefined;
1363
1464
  noBackground?: boolean | undefined;
1364
1465
  seed?: number | undefined;
1466
+ enforcePalette?: boolean | undefined;
1365
1467
  quality?: {
1366
1468
  outDir: string;
1367
1469
  palette: string[];
@@ -1389,6 +1491,7 @@ declare const StyleInputSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodObjec
1389
1491
  path: string;
1390
1492
  }[];
1391
1493
  noBackground: boolean;
1494
+ enforcePalette: boolean;
1392
1495
  tags: string[];
1393
1496
  providerOptions: Record<string, Record<string, unknown>>;
1394
1497
  provider?: string | undefined;
@@ -1420,8 +1523,8 @@ declare const StyleInputSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodObjec
1420
1523
  } | undefined;
1421
1524
  }, {
1422
1525
  outDir: string;
1423
- palette?: string[] | undefined;
1424
1526
  provider?: string | undefined;
1527
+ palette?: string[] | undefined;
1425
1528
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
1426
1529
  size?: number | undefined;
1427
1530
  view?: string | undefined;
@@ -1440,6 +1543,7 @@ declare const StyleInputSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodObjec
1440
1543
  outlineMode?: "outline" | "segmentation" | undefined;
1441
1544
  noBackground?: boolean | undefined;
1442
1545
  seed?: number | undefined;
1546
+ enforcePalette?: boolean | undefined;
1443
1547
  quality?: {
1444
1548
  outDir: string;
1445
1549
  palette: string[];
@@ -1483,6 +1587,7 @@ declare const StyleInputSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodObjec
1483
1587
  noBackground: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1484
1588
  seed: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
1485
1589
  palette: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
1590
+ enforcePalette: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1486
1591
  mount: z.ZodOptional<z.ZodOptional<z.ZodObject<{
1487
1592
  /**
1488
1593
  * Existing sheet to composite into, relative to the manifest. Every
@@ -1539,8 +1644,8 @@ declare const StyleInputSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodObjec
1539
1644
  }, "strict", z.ZodTypeAny, {
1540
1645
  outDir: string;
1541
1646
  extends: string;
1542
- palette?: string[] | undefined;
1543
1647
  provider?: string | undefined;
1648
+ palette?: string[] | undefined;
1544
1649
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
1545
1650
  size?: number | undefined;
1546
1651
  view?: string | undefined;
@@ -1559,6 +1664,7 @@ declare const StyleInputSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodObjec
1559
1664
  outlineMode?: "outline" | "segmentation" | undefined;
1560
1665
  noBackground?: boolean | undefined;
1561
1666
  seed?: number | undefined;
1667
+ enforcePalette?: boolean | undefined;
1562
1668
  quality?: {
1563
1669
  outDir?: string | undefined;
1564
1670
  palette?: string[] | undefined;
@@ -1579,8 +1685,8 @@ declare const StyleInputSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodObjec
1579
1685
  }, {
1580
1686
  outDir: string;
1581
1687
  extends: string;
1582
- palette?: string[] | undefined;
1583
1688
  provider?: string | undefined;
1689
+ palette?: string[] | undefined;
1584
1690
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
1585
1691
  size?: number | undefined;
1586
1692
  view?: string | undefined;
@@ -1599,6 +1705,7 @@ declare const StyleInputSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodObjec
1599
1705
  outlineMode?: "outline" | "segmentation" | undefined;
1600
1706
  noBackground?: boolean | undefined;
1601
1707
  seed?: number | undefined;
1708
+ enforcePalette?: boolean | undefined;
1602
1709
  quality?: {
1603
1710
  outDir?: string | undefined;
1604
1711
  palette?: string[] | undefined;
@@ -1907,6 +2014,18 @@ declare const ManifestSchema: z.ZodObject<{
1907
2014
  * chocolate bar.
1908
2015
  */
1909
2016
  palette: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2017
+ /**
2018
+ * Snap every visible pixel of the downloaded art to the nearest `palette`
2019
+ * colour, without dithering. The palette is sent to providers that take
2020
+ * one, and most honour it most of the time; this makes it a guarantee
2021
+ * for every generator, including the ones with no palette parameter.
2022
+ * Applied by `fetch` as the file is written and recorded on the lock
2023
+ * entry, so a restore reproduces the same bytes. Turning it on or off
2024
+ * does not change the spec hash: `plan` reports the entry as recoverable
2025
+ * and the next `fetch` or `restore` re-applies it from the art already
2026
+ * on disk or in the cache, spending nothing.
2027
+ */
2028
+ enforcePalette: z.ZodDefault<z.ZodBoolean>;
1910
2029
  /** Fail-closed native-grid, palette, and human-approval policy for derived art. */
1911
2030
  quality: z.ZodOptional<z.ZodEffects<z.ZodObject<{
1912
2031
  /** Output root for approved refined art, relative to the manifest. */
@@ -2003,6 +2122,7 @@ declare const ManifestSchema: z.ZodObject<{
2003
2122
  path: string;
2004
2123
  }[];
2005
2124
  noBackground: boolean;
2125
+ enforcePalette: boolean;
2006
2126
  tags: string[];
2007
2127
  providerOptions: Record<string, Record<string, unknown>>;
2008
2128
  provider?: string | undefined;
@@ -2034,8 +2154,8 @@ declare const ManifestSchema: z.ZodObject<{
2034
2154
  } | undefined;
2035
2155
  }, {
2036
2156
  outDir: string;
2037
- palette?: string[] | undefined;
2038
2157
  provider?: string | undefined;
2158
+ palette?: string[] | undefined;
2039
2159
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
2040
2160
  size?: number | undefined;
2041
2161
  view?: string | undefined;
@@ -2054,6 +2174,7 @@ declare const ManifestSchema: z.ZodObject<{
2054
2174
  outlineMode?: "outline" | "segmentation" | undefined;
2055
2175
  noBackground?: boolean | undefined;
2056
2176
  seed?: number | undefined;
2177
+ enforcePalette?: boolean | undefined;
2057
2178
  quality?: {
2058
2179
  outDir: string;
2059
2180
  palette: string[];
@@ -2081,6 +2202,7 @@ declare const ManifestSchema: z.ZodObject<{
2081
2202
  path: string;
2082
2203
  }[];
2083
2204
  noBackground: boolean;
2205
+ enforcePalette: boolean;
2084
2206
  tags: string[];
2085
2207
  providerOptions: Record<string, Record<string, unknown>>;
2086
2208
  provider?: string | undefined;
@@ -2112,8 +2234,8 @@ declare const ManifestSchema: z.ZodObject<{
2112
2234
  } | undefined;
2113
2235
  }, {
2114
2236
  outDir: string;
2115
- palette?: string[] | undefined;
2116
2237
  provider?: string | undefined;
2238
+ palette?: string[] | undefined;
2117
2239
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
2118
2240
  size?: number | undefined;
2119
2241
  view?: string | undefined;
@@ -2132,6 +2254,7 @@ declare const ManifestSchema: z.ZodObject<{
2132
2254
  outlineMode?: "outline" | "segmentation" | undefined;
2133
2255
  noBackground?: boolean | undefined;
2134
2256
  seed?: number | undefined;
2257
+ enforcePalette?: boolean | undefined;
2135
2258
  quality?: {
2136
2259
  outDir: string;
2137
2260
  palette: string[];
@@ -2159,6 +2282,7 @@ declare const ManifestSchema: z.ZodObject<{
2159
2282
  path: string;
2160
2283
  }[];
2161
2284
  noBackground: boolean;
2285
+ enforcePalette: boolean;
2162
2286
  tags: string[];
2163
2287
  providerOptions: Record<string, Record<string, unknown>>;
2164
2288
  provider?: string | undefined;
@@ -2190,8 +2314,8 @@ declare const ManifestSchema: z.ZodObject<{
2190
2314
  } | undefined;
2191
2315
  }, {
2192
2316
  outDir: string;
2193
- palette?: string[] | undefined;
2194
2317
  provider?: string | undefined;
2318
+ palette?: string[] | undefined;
2195
2319
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
2196
2320
  size?: number | undefined;
2197
2321
  view?: string | undefined;
@@ -2210,6 +2334,7 @@ declare const ManifestSchema: z.ZodObject<{
2210
2334
  outlineMode?: "outline" | "segmentation" | undefined;
2211
2335
  noBackground?: boolean | undefined;
2212
2336
  seed?: number | undefined;
2337
+ enforcePalette?: boolean | undefined;
2213
2338
  quality?: {
2214
2339
  outDir: string;
2215
2340
  palette: string[];
@@ -2429,6 +2554,7 @@ declare const ManifestSchema: z.ZodObject<{
2429
2554
  path: string;
2430
2555
  }[];
2431
2556
  noBackground: boolean;
2557
+ enforcePalette: boolean;
2432
2558
  tags: string[];
2433
2559
  providerOptions: Record<string, Record<string, unknown>>;
2434
2560
  provider?: string | undefined;
@@ -2487,8 +2613,8 @@ declare const ManifestSchema: z.ZodObject<{
2487
2613
  }, {
2488
2614
  styles: Record<string, {
2489
2615
  outDir: string;
2490
- palette?: string[] | undefined;
2491
2616
  provider?: string | undefined;
2617
+ palette?: string[] | undefined;
2492
2618
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
2493
2619
  size?: number | undefined;
2494
2620
  view?: string | undefined;
@@ -2507,6 +2633,7 @@ declare const ManifestSchema: z.ZodObject<{
2507
2633
  outlineMode?: "outline" | "segmentation" | undefined;
2508
2634
  noBackground?: boolean | undefined;
2509
2635
  seed?: number | undefined;
2636
+ enforcePalette?: boolean | undefined;
2510
2637
  quality?: {
2511
2638
  outDir: string;
2512
2639
  palette: string[];
@@ -2649,6 +2776,18 @@ declare const ManifestInputSchema: z.ZodObject<{
2649
2776
  * chocolate bar.
2650
2777
  */
2651
2778
  palette: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2779
+ /**
2780
+ * Snap every visible pixel of the downloaded art to the nearest `palette`
2781
+ * colour, without dithering. The palette is sent to providers that take
2782
+ * one, and most honour it most of the time; this makes it a guarantee
2783
+ * for every generator, including the ones with no palette parameter.
2784
+ * Applied by `fetch` as the file is written and recorded on the lock
2785
+ * entry, so a restore reproduces the same bytes. Turning it on or off
2786
+ * does not change the spec hash: `plan` reports the entry as recoverable
2787
+ * and the next `fetch` or `restore` re-applies it from the art already
2788
+ * on disk or in the cache, spending nothing.
2789
+ */
2790
+ enforcePalette: z.ZodDefault<z.ZodBoolean>;
2652
2791
  /** Fail-closed native-grid, palette, and human-approval policy for derived art. */
2653
2792
  quality: z.ZodOptional<z.ZodEffects<z.ZodObject<{
2654
2793
  /** Output root for approved refined art, relative to the manifest. */
@@ -2745,6 +2884,7 @@ declare const ManifestInputSchema: z.ZodObject<{
2745
2884
  path: string;
2746
2885
  }[];
2747
2886
  noBackground: boolean;
2887
+ enforcePalette: boolean;
2748
2888
  tags: string[];
2749
2889
  providerOptions: Record<string, Record<string, unknown>>;
2750
2890
  provider?: string | undefined;
@@ -2776,8 +2916,8 @@ declare const ManifestInputSchema: z.ZodObject<{
2776
2916
  } | undefined;
2777
2917
  }, {
2778
2918
  outDir: string;
2779
- palette?: string[] | undefined;
2780
2919
  provider?: string | undefined;
2920
+ palette?: string[] | undefined;
2781
2921
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
2782
2922
  size?: number | undefined;
2783
2923
  view?: string | undefined;
@@ -2796,6 +2936,7 @@ declare const ManifestInputSchema: z.ZodObject<{
2796
2936
  outlineMode?: "outline" | "segmentation" | undefined;
2797
2937
  noBackground?: boolean | undefined;
2798
2938
  seed?: number | undefined;
2939
+ enforcePalette?: boolean | undefined;
2799
2940
  quality?: {
2800
2941
  outDir: string;
2801
2942
  palette: string[];
@@ -2823,6 +2964,7 @@ declare const ManifestInputSchema: z.ZodObject<{
2823
2964
  path: string;
2824
2965
  }[];
2825
2966
  noBackground: boolean;
2967
+ enforcePalette: boolean;
2826
2968
  tags: string[];
2827
2969
  providerOptions: Record<string, Record<string, unknown>>;
2828
2970
  provider?: string | undefined;
@@ -2854,8 +2996,8 @@ declare const ManifestInputSchema: z.ZodObject<{
2854
2996
  } | undefined;
2855
2997
  }, {
2856
2998
  outDir: string;
2857
- palette?: string[] | undefined;
2858
2999
  provider?: string | undefined;
3000
+ palette?: string[] | undefined;
2859
3001
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
2860
3002
  size?: number | undefined;
2861
3003
  view?: string | undefined;
@@ -2874,6 +3016,7 @@ declare const ManifestInputSchema: z.ZodObject<{
2874
3016
  outlineMode?: "outline" | "segmentation" | undefined;
2875
3017
  noBackground?: boolean | undefined;
2876
3018
  seed?: number | undefined;
3019
+ enforcePalette?: boolean | undefined;
2877
3020
  quality?: {
2878
3021
  outDir: string;
2879
3022
  palette: string[];
@@ -2901,6 +3044,7 @@ declare const ManifestInputSchema: z.ZodObject<{
2901
3044
  path: string;
2902
3045
  }[];
2903
3046
  noBackground: boolean;
3047
+ enforcePalette: boolean;
2904
3048
  tags: string[];
2905
3049
  providerOptions: Record<string, Record<string, unknown>>;
2906
3050
  provider?: string | undefined;
@@ -2932,8 +3076,8 @@ declare const ManifestInputSchema: z.ZodObject<{
2932
3076
  } | undefined;
2933
3077
  }, {
2934
3078
  outDir: string;
2935
- palette?: string[] | undefined;
2936
3079
  provider?: string | undefined;
3080
+ palette?: string[] | undefined;
2937
3081
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
2938
3082
  size?: number | undefined;
2939
3083
  view?: string | undefined;
@@ -2952,6 +3096,7 @@ declare const ManifestInputSchema: z.ZodObject<{
2952
3096
  outlineMode?: "outline" | "segmentation" | undefined;
2953
3097
  noBackground?: boolean | undefined;
2954
3098
  seed?: number | undefined;
3099
+ enforcePalette?: boolean | undefined;
2955
3100
  quality?: {
2956
3101
  outDir: string;
2957
3102
  palette: string[];
@@ -2995,6 +3140,7 @@ declare const ManifestInputSchema: z.ZodObject<{
2995
3140
  noBackground: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
2996
3141
  seed: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
2997
3142
  palette: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
3143
+ enforcePalette: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
2998
3144
  mount: z.ZodOptional<z.ZodOptional<z.ZodObject<{
2999
3145
  /**
3000
3146
  * Existing sheet to composite into, relative to the manifest. Every
@@ -3051,8 +3197,8 @@ declare const ManifestInputSchema: z.ZodObject<{
3051
3197
  }, "strict", z.ZodTypeAny, {
3052
3198
  outDir: string;
3053
3199
  extends: string;
3054
- palette?: string[] | undefined;
3055
3200
  provider?: string | undefined;
3201
+ palette?: string[] | undefined;
3056
3202
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
3057
3203
  size?: number | undefined;
3058
3204
  view?: string | undefined;
@@ -3071,6 +3217,7 @@ declare const ManifestInputSchema: z.ZodObject<{
3071
3217
  outlineMode?: "outline" | "segmentation" | undefined;
3072
3218
  noBackground?: boolean | undefined;
3073
3219
  seed?: number | undefined;
3220
+ enforcePalette?: boolean | undefined;
3074
3221
  quality?: {
3075
3222
  outDir?: string | undefined;
3076
3223
  palette?: string[] | undefined;
@@ -3091,8 +3238,8 @@ declare const ManifestInputSchema: z.ZodObject<{
3091
3238
  }, {
3092
3239
  outDir: string;
3093
3240
  extends: string;
3094
- palette?: string[] | undefined;
3095
3241
  provider?: string | undefined;
3242
+ palette?: string[] | undefined;
3096
3243
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
3097
3244
  size?: number | undefined;
3098
3245
  view?: string | undefined;
@@ -3111,6 +3258,7 @@ declare const ManifestInputSchema: z.ZodObject<{
3111
3258
  outlineMode?: "outline" | "segmentation" | undefined;
3112
3259
  noBackground?: boolean | undefined;
3113
3260
  seed?: number | undefined;
3261
+ enforcePalette?: boolean | undefined;
3114
3262
  quality?: {
3115
3263
  outDir?: string | undefined;
3116
3264
  palette?: string[] | undefined;
@@ -3330,6 +3478,7 @@ declare const ManifestInputSchema: z.ZodObject<{
3330
3478
  path: string;
3331
3479
  }[];
3332
3480
  noBackground: boolean;
3481
+ enforcePalette: boolean;
3333
3482
  tags: string[];
3334
3483
  providerOptions: Record<string, Record<string, unknown>>;
3335
3484
  provider?: string | undefined;
@@ -3362,8 +3511,8 @@ declare const ManifestInputSchema: z.ZodObject<{
3362
3511
  } | {
3363
3512
  outDir: string;
3364
3513
  extends: string;
3365
- palette?: string[] | undefined;
3366
3514
  provider?: string | undefined;
3515
+ palette?: string[] | undefined;
3367
3516
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
3368
3517
  size?: number | undefined;
3369
3518
  view?: string | undefined;
@@ -3382,6 +3531,7 @@ declare const ManifestInputSchema: z.ZodObject<{
3382
3531
  outlineMode?: "outline" | "segmentation" | undefined;
3383
3532
  noBackground?: boolean | undefined;
3384
3533
  seed?: number | undefined;
3534
+ enforcePalette?: boolean | undefined;
3385
3535
  quality?: {
3386
3536
  outDir?: string | undefined;
3387
3537
  palette?: string[] | undefined;
@@ -3428,8 +3578,8 @@ declare const ManifestInputSchema: z.ZodObject<{
3428
3578
  }, {
3429
3579
  styles: Record<string, {
3430
3580
  outDir: string;
3431
- palette?: string[] | undefined;
3432
3581
  provider?: string | undefined;
3582
+ palette?: string[] | undefined;
3433
3583
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
3434
3584
  size?: number | undefined;
3435
3585
  view?: string | undefined;
@@ -3448,6 +3598,7 @@ declare const ManifestInputSchema: z.ZodObject<{
3448
3598
  outlineMode?: "outline" | "segmentation" | undefined;
3449
3599
  noBackground?: boolean | undefined;
3450
3600
  seed?: number | undefined;
3601
+ enforcePalette?: boolean | undefined;
3451
3602
  quality?: {
3452
3603
  outDir: string;
3453
3604
  palette: string[];
@@ -3468,8 +3619,8 @@ declare const ManifestInputSchema: z.ZodObject<{
3468
3619
  } | {
3469
3620
  outDir: string;
3470
3621
  extends: string;
3471
- palette?: string[] | undefined;
3472
3622
  provider?: string | undefined;
3623
+ palette?: string[] | undefined;
3473
3624
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
3474
3625
  size?: number | undefined;
3475
3626
  view?: string | undefined;
@@ -3488,6 +3639,7 @@ declare const ManifestInputSchema: z.ZodObject<{
3488
3639
  outlineMode?: "outline" | "segmentation" | undefined;
3489
3640
  noBackground?: boolean | undefined;
3490
3641
  seed?: number | undefined;
3642
+ enforcePalette?: boolean | undefined;
3491
3643
  quality?: {
3492
3644
  outDir?: string | undefined;
3493
3645
  palette?: string[] | undefined;
@@ -3536,6 +3688,40 @@ declare const ManifestInputSchema: z.ZodObject<{
3536
3688
  type Manifest = z.infer<typeof ManifestSchema>;
3537
3689
  type Style = z.infer<typeof StyleSchema>;
3538
3690
  type Asset = z.infer<typeof AssetSchema>;
3691
+ /**
3692
+ * What `fetch` did to the provider's bytes before writing them. Recorded on
3693
+ * the entry so `plan` can tell when the manifest asks for something else
3694
+ * and `restore` can reproduce the recorded hash from the raw bytes.
3695
+ */
3696
+ declare const PostprocessSchema: z.ZodObject<{
3697
+ palette: z.ZodOptional<z.ZodObject<{
3698
+ /** Canonical lowercase `#rrggbb` values, in manifest order. */
3699
+ colors: z.ZodArray<z.ZodString, "many">;
3700
+ dither: z.ZodLiteral<"none">;
3701
+ distance: z.ZodLiteral<"redmean">;
3702
+ }, "strip", z.ZodTypeAny, {
3703
+ colors: string[];
3704
+ dither: "none";
3705
+ distance: "redmean";
3706
+ }, {
3707
+ colors: string[];
3708
+ dither: "none";
3709
+ distance: "redmean";
3710
+ }>>;
3711
+ }, "strip", z.ZodTypeAny, {
3712
+ palette?: {
3713
+ colors: string[];
3714
+ dither: "none";
3715
+ distance: "redmean";
3716
+ } | undefined;
3717
+ }, {
3718
+ palette?: {
3719
+ colors: string[];
3720
+ dither: "none";
3721
+ distance: "redmean";
3722
+ } | undefined;
3723
+ }>;
3724
+ type Postprocess = z.infer<typeof PostprocessSchema>;
3539
3725
  /**
3540
3726
  * A generation this entry replaced, kept so it can be brought back. It is the
3541
3727
  * retired entry's identity — object, sources, output hashes, prompt, cost —
@@ -3572,16 +3758,24 @@ declare const LockHistoryEntrySchema: z.ZodObject<{
3572
3758
  sha256: z.ZodString;
3573
3759
  role: z.ZodOptional<z.ZodString>;
3574
3760
  mediaType: z.ZodOptional<z.ZodEnum<["image/png", "image/gif"]>>;
3761
+ /**
3762
+ * Hash of the provider's bytes before post-processing changed them, when
3763
+ * it did. The content cache keeps both, so the post-processing can be
3764
+ * undone or redone without contacting the provider.
3765
+ */
3766
+ raw: z.ZodOptional<z.ZodString>;
3575
3767
  }, "strip", z.ZodTypeAny, {
3576
3768
  path: string;
3577
3769
  sha256: string;
3578
3770
  role?: string | undefined;
3579
3771
  mediaType?: "image/png" | "image/gif" | undefined;
3772
+ raw?: string | undefined;
3580
3773
  }, {
3581
3774
  path: string;
3582
3775
  sha256: string;
3583
3776
  role?: string | undefined;
3584
3777
  mediaType?: "image/png" | "image/gif" | undefined;
3778
+ raw?: string | undefined;
3585
3779
  }>, "many">>;
3586
3780
  providerMetadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
3587
3781
  submittedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
@@ -3589,6 +3783,34 @@ declare const LockHistoryEntrySchema: z.ZodObject<{
3589
3783
  cost: z.ZodDefault<z.ZodNumber>;
3590
3784
  costUnit: z.ZodDefault<z.ZodString>;
3591
3785
  provider: z.ZodDefault<z.ZodString>;
3786
+ postprocess: z.ZodOptional<z.ZodObject<{
3787
+ palette: z.ZodOptional<z.ZodObject<{
3788
+ /** Canonical lowercase `#rrggbb` values, in manifest order. */
3789
+ colors: z.ZodArray<z.ZodString, "many">;
3790
+ dither: z.ZodLiteral<"none">;
3791
+ distance: z.ZodLiteral<"redmean">;
3792
+ }, "strip", z.ZodTypeAny, {
3793
+ colors: string[];
3794
+ dither: "none";
3795
+ distance: "redmean";
3796
+ }, {
3797
+ colors: string[];
3798
+ dither: "none";
3799
+ distance: "redmean";
3800
+ }>>;
3801
+ }, "strip", z.ZodTypeAny, {
3802
+ palette?: {
3803
+ colors: string[];
3804
+ dither: "none";
3805
+ distance: "redmean";
3806
+ } | undefined;
3807
+ }, {
3808
+ palette?: {
3809
+ colors: string[];
3810
+ dither: "none";
3811
+ distance: "redmean";
3812
+ } | undefined;
3813
+ }>>;
3592
3814
  /** When the replacement was submitted. */
3593
3815
  retiredAt: z.ZodString;
3594
3816
  }, "strip", z.ZodTypeAny, {
@@ -3613,6 +3835,7 @@ declare const LockHistoryEntrySchema: z.ZodObject<{
3613
3835
  sha256: string;
3614
3836
  role?: string | undefined;
3615
3837
  mediaType?: "image/png" | "image/gif" | undefined;
3838
+ raw?: string | undefined;
3616
3839
  }[];
3617
3840
  providerMetadata: Record<string, Record<string, unknown>>;
3618
3841
  submittedAt: string | null;
@@ -3620,6 +3843,13 @@ declare const LockHistoryEntrySchema: z.ZodObject<{
3620
3843
  cost: number;
3621
3844
  costUnit: string;
3622
3845
  retiredAt: string;
3846
+ postprocess?: {
3847
+ palette?: {
3848
+ colors: string[];
3849
+ dither: "none";
3850
+ distance: "redmean";
3851
+ } | undefined;
3852
+ } | undefined;
3623
3853
  }, {
3624
3854
  width: number;
3625
3855
  height: number;
@@ -3643,12 +3873,20 @@ declare const LockHistoryEntrySchema: z.ZodObject<{
3643
3873
  sha256: string;
3644
3874
  role?: string | undefined;
3645
3875
  mediaType?: "image/png" | "image/gif" | undefined;
3876
+ raw?: string | undefined;
3646
3877
  }[] | undefined;
3647
3878
  providerMetadata?: Record<string, Record<string, unknown>> | undefined;
3648
3879
  submittedAt?: string | null | undefined;
3649
3880
  downloadedAt?: string | null | undefined;
3650
3881
  cost?: number | undefined;
3651
3882
  costUnit?: string | undefined;
3883
+ postprocess?: {
3884
+ palette?: {
3885
+ colors: string[];
3886
+ dither: "none";
3887
+ distance: "redmean";
3888
+ } | undefined;
3889
+ } | undefined;
3652
3890
  }>;
3653
3891
  declare const LockEntrySchema: z.ZodObject<{
3654
3892
  styleId: z.ZodString;
@@ -3741,16 +3979,24 @@ declare const LockEntrySchema: z.ZodObject<{
3741
3979
  sha256: z.ZodString;
3742
3980
  role: z.ZodOptional<z.ZodString>;
3743
3981
  mediaType: z.ZodOptional<z.ZodEnum<["image/png", "image/gif"]>>;
3982
+ /**
3983
+ * Hash of the provider's bytes before post-processing changed them, when
3984
+ * it did. The content cache keeps both, so the post-processing can be
3985
+ * undone or redone without contacting the provider.
3986
+ */
3987
+ raw: z.ZodOptional<z.ZodString>;
3744
3988
  }, "strip", z.ZodTypeAny, {
3745
3989
  path: string;
3746
3990
  sha256: string;
3747
3991
  role?: string | undefined;
3748
3992
  mediaType?: "image/png" | "image/gif" | undefined;
3993
+ raw?: string | undefined;
3749
3994
  }, {
3750
3995
  path: string;
3751
3996
  sha256: string;
3752
3997
  role?: string | undefined;
3753
3998
  mediaType?: "image/png" | "image/gif" | undefined;
3999
+ raw?: string | undefined;
3754
4000
  }>, "many">>;
3755
4001
  /**
3756
4002
  * Provider-owned data retained for downstream consumers, namespaced by
@@ -3796,16 +4042,24 @@ declare const LockEntrySchema: z.ZodObject<{
3796
4042
  sha256: z.ZodString;
3797
4043
  role: z.ZodOptional<z.ZodString>;
3798
4044
  mediaType: z.ZodOptional<z.ZodEnum<["image/png", "image/gif"]>>;
4045
+ /**
4046
+ * Hash of the provider's bytes before post-processing changed them, when
4047
+ * it did. The content cache keeps both, so the post-processing can be
4048
+ * undone or redone without contacting the provider.
4049
+ */
4050
+ raw: z.ZodOptional<z.ZodString>;
3799
4051
  }, "strip", z.ZodTypeAny, {
3800
4052
  path: string;
3801
4053
  sha256: string;
3802
4054
  role?: string | undefined;
3803
4055
  mediaType?: "image/png" | "image/gif" | undefined;
4056
+ raw?: string | undefined;
3804
4057
  }, {
3805
4058
  path: string;
3806
4059
  sha256: string;
3807
4060
  role?: string | undefined;
3808
4061
  mediaType?: "image/png" | "image/gif" | undefined;
4062
+ raw?: string | undefined;
3809
4063
  }>, "many">>;
3810
4064
  providerMetadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
3811
4065
  submittedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
@@ -3813,6 +4067,34 @@ declare const LockEntrySchema: z.ZodObject<{
3813
4067
  cost: z.ZodDefault<z.ZodNumber>;
3814
4068
  costUnit: z.ZodDefault<z.ZodString>;
3815
4069
  provider: z.ZodDefault<z.ZodString>;
4070
+ postprocess: z.ZodOptional<z.ZodObject<{
4071
+ palette: z.ZodOptional<z.ZodObject<{
4072
+ /** Canonical lowercase `#rrggbb` values, in manifest order. */
4073
+ colors: z.ZodArray<z.ZodString, "many">;
4074
+ dither: z.ZodLiteral<"none">;
4075
+ distance: z.ZodLiteral<"redmean">;
4076
+ }, "strip", z.ZodTypeAny, {
4077
+ colors: string[];
4078
+ dither: "none";
4079
+ distance: "redmean";
4080
+ }, {
4081
+ colors: string[];
4082
+ dither: "none";
4083
+ distance: "redmean";
4084
+ }>>;
4085
+ }, "strip", z.ZodTypeAny, {
4086
+ palette?: {
4087
+ colors: string[];
4088
+ dither: "none";
4089
+ distance: "redmean";
4090
+ } | undefined;
4091
+ }, {
4092
+ palette?: {
4093
+ colors: string[];
4094
+ dither: "none";
4095
+ distance: "redmean";
4096
+ } | undefined;
4097
+ }>>;
3816
4098
  /** When the replacement was submitted. */
3817
4099
  retiredAt: z.ZodString;
3818
4100
  }, "strip", z.ZodTypeAny, {
@@ -3837,6 +4119,7 @@ declare const LockEntrySchema: z.ZodObject<{
3837
4119
  sha256: string;
3838
4120
  role?: string | undefined;
3839
4121
  mediaType?: "image/png" | "image/gif" | undefined;
4122
+ raw?: string | undefined;
3840
4123
  }[];
3841
4124
  providerMetadata: Record<string, Record<string, unknown>>;
3842
4125
  submittedAt: string | null;
@@ -3844,6 +4127,13 @@ declare const LockEntrySchema: z.ZodObject<{
3844
4127
  cost: number;
3845
4128
  costUnit: string;
3846
4129
  retiredAt: string;
4130
+ postprocess?: {
4131
+ palette?: {
4132
+ colors: string[];
4133
+ dither: "none";
4134
+ distance: "redmean";
4135
+ } | undefined;
4136
+ } | undefined;
3847
4137
  }, {
3848
4138
  width: number;
3849
4139
  height: number;
@@ -3867,18 +4157,55 @@ declare const LockEntrySchema: z.ZodObject<{
3867
4157
  sha256: string;
3868
4158
  role?: string | undefined;
3869
4159
  mediaType?: "image/png" | "image/gif" | undefined;
4160
+ raw?: string | undefined;
3870
4161
  }[] | undefined;
3871
4162
  providerMetadata?: Record<string, Record<string, unknown>> | undefined;
3872
4163
  submittedAt?: string | null | undefined;
3873
4164
  downloadedAt?: string | null | undefined;
3874
4165
  cost?: number | undefined;
3875
4166
  costUnit?: string | undefined;
4167
+ postprocess?: {
4168
+ palette?: {
4169
+ colors: string[];
4170
+ dither: "none";
4171
+ distance: "redmean";
4172
+ } | undefined;
4173
+ } | undefined;
3876
4174
  }>, "many">>;
4175
+ /** Post-processing applied to the recorded outputs; absent when the bytes are the provider's. */
4176
+ postprocess: z.ZodOptional<z.ZodObject<{
4177
+ palette: z.ZodOptional<z.ZodObject<{
4178
+ /** Canonical lowercase `#rrggbb` values, in manifest order. */
4179
+ colors: z.ZodArray<z.ZodString, "many">;
4180
+ dither: z.ZodLiteral<"none">;
4181
+ distance: z.ZodLiteral<"redmean">;
4182
+ }, "strip", z.ZodTypeAny, {
4183
+ colors: string[];
4184
+ dither: "none";
4185
+ distance: "redmean";
4186
+ }, {
4187
+ colors: string[];
4188
+ dither: "none";
4189
+ distance: "redmean";
4190
+ }>>;
4191
+ }, "strip", z.ZodTypeAny, {
4192
+ palette?: {
4193
+ colors: string[];
4194
+ dither: "none";
4195
+ distance: "redmean";
4196
+ } | undefined;
4197
+ }, {
4198
+ palette?: {
4199
+ colors: string[];
4200
+ dither: "none";
4201
+ distance: "redmean";
4202
+ } | undefined;
4203
+ }>>;
3877
4204
  }, "strip", z.ZodTypeAny, {
3878
4205
  width: number;
3879
4206
  height: number;
3880
- status: "processing" | "review" | "failed" | "pending" | "selected" | "downloaded" | "download-failed";
3881
4207
  provider: string;
4208
+ status: "processing" | "review" | "failed" | "pending" | "selected" | "downloaded" | "download-failed";
3882
4209
  generator: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames";
3883
4210
  tileFeature: string | null;
3884
4211
  prompt: string;
@@ -3904,6 +4231,7 @@ declare const LockEntrySchema: z.ZodObject<{
3904
4231
  sha256: string;
3905
4232
  role?: string | undefined;
3906
4233
  mediaType?: "image/png" | "image/gif" | undefined;
4234
+ raw?: string | undefined;
3907
4235
  }[];
3908
4236
  providerMetadata: Record<string, Record<string, unknown>>;
3909
4237
  submittedAt: string | null;
@@ -3936,6 +4264,7 @@ declare const LockEntrySchema: z.ZodObject<{
3936
4264
  sha256: string;
3937
4265
  role?: string | undefined;
3938
4266
  mediaType?: "image/png" | "image/gif" | undefined;
4267
+ raw?: string | undefined;
3939
4268
  }[];
3940
4269
  providerMetadata: Record<string, Record<string, unknown>>;
3941
4270
  submittedAt: string | null;
@@ -3943,7 +4272,21 @@ declare const LockEntrySchema: z.ZodObject<{
3943
4272
  cost: number;
3944
4273
  costUnit: string;
3945
4274
  retiredAt: string;
4275
+ postprocess?: {
4276
+ palette?: {
4277
+ colors: string[];
4278
+ dither: "none";
4279
+ distance: "redmean";
4280
+ } | undefined;
4281
+ } | undefined;
3946
4282
  }[] | undefined;
4283
+ postprocess?: {
4284
+ palette?: {
4285
+ colors: string[];
4286
+ dither: "none";
4287
+ distance: "redmean";
4288
+ } | undefined;
4289
+ } | undefined;
3947
4290
  supersededOutputs?: {
3948
4291
  path: string;
3949
4292
  sha256: string;
@@ -3959,8 +4302,8 @@ declare const LockEntrySchema: z.ZodObject<{
3959
4302
  specHash: string;
3960
4303
  styleId: string;
3961
4304
  assetId: string;
3962
- status?: "processing" | "review" | "failed" | "pending" | "selected" | "downloaded" | "download-failed" | undefined;
3963
4305
  provider?: string | undefined;
4306
+ status?: "processing" | "review" | "failed" | "pending" | "selected" | "downloaded" | "download-failed" | undefined;
3964
4307
  tileFeature?: string | null | undefined;
3965
4308
  revision?: {
3966
4309
  mode: "image-to-image" | "inpaint" | "outpaint";
@@ -3992,12 +4335,20 @@ declare const LockEntrySchema: z.ZodObject<{
3992
4335
  sha256: string;
3993
4336
  role?: string | undefined;
3994
4337
  mediaType?: "image/png" | "image/gif" | undefined;
4338
+ raw?: string | undefined;
3995
4339
  }[] | undefined;
3996
4340
  providerMetadata?: Record<string, Record<string, unknown>> | undefined;
3997
4341
  submittedAt?: string | null | undefined;
3998
4342
  downloadedAt?: string | null | undefined;
3999
4343
  cost?: number | undefined;
4000
4344
  costUnit?: string | undefined;
4345
+ postprocess?: {
4346
+ palette?: {
4347
+ colors: string[];
4348
+ dither: "none";
4349
+ distance: "redmean";
4350
+ } | undefined;
4351
+ } | undefined;
4001
4352
  }[] | undefined;
4002
4353
  jobId?: string | null | undefined;
4003
4354
  objectId?: string | null | undefined;
@@ -4013,12 +4364,20 @@ declare const LockEntrySchema: z.ZodObject<{
4013
4364
  sha256: string;
4014
4365
  role?: string | undefined;
4015
4366
  mediaType?: "image/png" | "image/gif" | undefined;
4367
+ raw?: string | undefined;
4016
4368
  }[] | undefined;
4017
4369
  providerMetadata?: Record<string, Record<string, unknown>> | undefined;
4018
4370
  submittedAt?: string | null | undefined;
4019
4371
  downloadedAt?: string | null | undefined;
4020
4372
  cost?: number | undefined;
4021
4373
  costUnit?: string | undefined;
4374
+ postprocess?: {
4375
+ palette?: {
4376
+ colors: string[];
4377
+ dither: "none";
4378
+ distance: "redmean";
4379
+ } | undefined;
4380
+ } | undefined;
4022
4381
  supersededOutputs?: {
4023
4382
  path: string;
4024
4383
  sha256: string;
@@ -4122,16 +4481,24 @@ declare const LockSchema: z.ZodObject<{
4122
4481
  sha256: z.ZodString;
4123
4482
  role: z.ZodOptional<z.ZodString>;
4124
4483
  mediaType: z.ZodOptional<z.ZodEnum<["image/png", "image/gif"]>>;
4484
+ /**
4485
+ * Hash of the provider's bytes before post-processing changed them, when
4486
+ * it did. The content cache keeps both, so the post-processing can be
4487
+ * undone or redone without contacting the provider.
4488
+ */
4489
+ raw: z.ZodOptional<z.ZodString>;
4125
4490
  }, "strip", z.ZodTypeAny, {
4126
4491
  path: string;
4127
4492
  sha256: string;
4128
4493
  role?: string | undefined;
4129
4494
  mediaType?: "image/png" | "image/gif" | undefined;
4495
+ raw?: string | undefined;
4130
4496
  }, {
4131
4497
  path: string;
4132
4498
  sha256: string;
4133
4499
  role?: string | undefined;
4134
4500
  mediaType?: "image/png" | "image/gif" | undefined;
4501
+ raw?: string | undefined;
4135
4502
  }>, "many">>;
4136
4503
  /**
4137
4504
  * Provider-owned data retained for downstream consumers, namespaced by
@@ -4177,16 +4544,24 @@ declare const LockSchema: z.ZodObject<{
4177
4544
  sha256: z.ZodString;
4178
4545
  role: z.ZodOptional<z.ZodString>;
4179
4546
  mediaType: z.ZodOptional<z.ZodEnum<["image/png", "image/gif"]>>;
4547
+ /**
4548
+ * Hash of the provider's bytes before post-processing changed them, when
4549
+ * it did. The content cache keeps both, so the post-processing can be
4550
+ * undone or redone without contacting the provider.
4551
+ */
4552
+ raw: z.ZodOptional<z.ZodString>;
4180
4553
  }, "strip", z.ZodTypeAny, {
4181
4554
  path: string;
4182
4555
  sha256: string;
4183
4556
  role?: string | undefined;
4184
4557
  mediaType?: "image/png" | "image/gif" | undefined;
4558
+ raw?: string | undefined;
4185
4559
  }, {
4186
4560
  path: string;
4187
4561
  sha256: string;
4188
4562
  role?: string | undefined;
4189
4563
  mediaType?: "image/png" | "image/gif" | undefined;
4564
+ raw?: string | undefined;
4190
4565
  }>, "many">>;
4191
4566
  providerMetadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
4192
4567
  submittedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
@@ -4194,6 +4569,34 @@ declare const LockSchema: z.ZodObject<{
4194
4569
  cost: z.ZodDefault<z.ZodNumber>;
4195
4570
  costUnit: z.ZodDefault<z.ZodString>;
4196
4571
  provider: z.ZodDefault<z.ZodString>;
4572
+ postprocess: z.ZodOptional<z.ZodObject<{
4573
+ palette: z.ZodOptional<z.ZodObject<{
4574
+ /** Canonical lowercase `#rrggbb` values, in manifest order. */
4575
+ colors: z.ZodArray<z.ZodString, "many">;
4576
+ dither: z.ZodLiteral<"none">;
4577
+ distance: z.ZodLiteral<"redmean">;
4578
+ }, "strip", z.ZodTypeAny, {
4579
+ colors: string[];
4580
+ dither: "none";
4581
+ distance: "redmean";
4582
+ }, {
4583
+ colors: string[];
4584
+ dither: "none";
4585
+ distance: "redmean";
4586
+ }>>;
4587
+ }, "strip", z.ZodTypeAny, {
4588
+ palette?: {
4589
+ colors: string[];
4590
+ dither: "none";
4591
+ distance: "redmean";
4592
+ } | undefined;
4593
+ }, {
4594
+ palette?: {
4595
+ colors: string[];
4596
+ dither: "none";
4597
+ distance: "redmean";
4598
+ } | undefined;
4599
+ }>>;
4197
4600
  /** When the replacement was submitted. */
4198
4601
  retiredAt: z.ZodString;
4199
4602
  }, "strip", z.ZodTypeAny, {
@@ -4218,6 +4621,7 @@ declare const LockSchema: z.ZodObject<{
4218
4621
  sha256: string;
4219
4622
  role?: string | undefined;
4220
4623
  mediaType?: "image/png" | "image/gif" | undefined;
4624
+ raw?: string | undefined;
4221
4625
  }[];
4222
4626
  providerMetadata: Record<string, Record<string, unknown>>;
4223
4627
  submittedAt: string | null;
@@ -4225,6 +4629,13 @@ declare const LockSchema: z.ZodObject<{
4225
4629
  cost: number;
4226
4630
  costUnit: string;
4227
4631
  retiredAt: string;
4632
+ postprocess?: {
4633
+ palette?: {
4634
+ colors: string[];
4635
+ dither: "none";
4636
+ distance: "redmean";
4637
+ } | undefined;
4638
+ } | undefined;
4228
4639
  }, {
4229
4640
  width: number;
4230
4641
  height: number;
@@ -4248,18 +4659,55 @@ declare const LockSchema: z.ZodObject<{
4248
4659
  sha256: string;
4249
4660
  role?: string | undefined;
4250
4661
  mediaType?: "image/png" | "image/gif" | undefined;
4662
+ raw?: string | undefined;
4251
4663
  }[] | undefined;
4252
4664
  providerMetadata?: Record<string, Record<string, unknown>> | undefined;
4253
4665
  submittedAt?: string | null | undefined;
4254
4666
  downloadedAt?: string | null | undefined;
4255
4667
  cost?: number | undefined;
4256
4668
  costUnit?: string | undefined;
4669
+ postprocess?: {
4670
+ palette?: {
4671
+ colors: string[];
4672
+ dither: "none";
4673
+ distance: "redmean";
4674
+ } | undefined;
4675
+ } | undefined;
4257
4676
  }>, "many">>;
4677
+ /** Post-processing applied to the recorded outputs; absent when the bytes are the provider's. */
4678
+ postprocess: z.ZodOptional<z.ZodObject<{
4679
+ palette: z.ZodOptional<z.ZodObject<{
4680
+ /** Canonical lowercase `#rrggbb` values, in manifest order. */
4681
+ colors: z.ZodArray<z.ZodString, "many">;
4682
+ dither: z.ZodLiteral<"none">;
4683
+ distance: z.ZodLiteral<"redmean">;
4684
+ }, "strip", z.ZodTypeAny, {
4685
+ colors: string[];
4686
+ dither: "none";
4687
+ distance: "redmean";
4688
+ }, {
4689
+ colors: string[];
4690
+ dither: "none";
4691
+ distance: "redmean";
4692
+ }>>;
4693
+ }, "strip", z.ZodTypeAny, {
4694
+ palette?: {
4695
+ colors: string[];
4696
+ dither: "none";
4697
+ distance: "redmean";
4698
+ } | undefined;
4699
+ }, {
4700
+ palette?: {
4701
+ colors: string[];
4702
+ dither: "none";
4703
+ distance: "redmean";
4704
+ } | undefined;
4705
+ }>>;
4258
4706
  }, "strip", z.ZodTypeAny, {
4259
4707
  width: number;
4260
4708
  height: number;
4261
- status: "processing" | "review" | "failed" | "pending" | "selected" | "downloaded" | "download-failed";
4262
4709
  provider: string;
4710
+ status: "processing" | "review" | "failed" | "pending" | "selected" | "downloaded" | "download-failed";
4263
4711
  generator: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames";
4264
4712
  tileFeature: string | null;
4265
4713
  prompt: string;
@@ -4285,6 +4733,7 @@ declare const LockSchema: z.ZodObject<{
4285
4733
  sha256: string;
4286
4734
  role?: string | undefined;
4287
4735
  mediaType?: "image/png" | "image/gif" | undefined;
4736
+ raw?: string | undefined;
4288
4737
  }[];
4289
4738
  providerMetadata: Record<string, Record<string, unknown>>;
4290
4739
  submittedAt: string | null;
@@ -4317,6 +4766,7 @@ declare const LockSchema: z.ZodObject<{
4317
4766
  sha256: string;
4318
4767
  role?: string | undefined;
4319
4768
  mediaType?: "image/png" | "image/gif" | undefined;
4769
+ raw?: string | undefined;
4320
4770
  }[];
4321
4771
  providerMetadata: Record<string, Record<string, unknown>>;
4322
4772
  submittedAt: string | null;
@@ -4324,7 +4774,21 @@ declare const LockSchema: z.ZodObject<{
4324
4774
  cost: number;
4325
4775
  costUnit: string;
4326
4776
  retiredAt: string;
4777
+ postprocess?: {
4778
+ palette?: {
4779
+ colors: string[];
4780
+ dither: "none";
4781
+ distance: "redmean";
4782
+ } | undefined;
4783
+ } | undefined;
4327
4784
  }[] | undefined;
4785
+ postprocess?: {
4786
+ palette?: {
4787
+ colors: string[];
4788
+ dither: "none";
4789
+ distance: "redmean";
4790
+ } | undefined;
4791
+ } | undefined;
4328
4792
  supersededOutputs?: {
4329
4793
  path: string;
4330
4794
  sha256: string;
@@ -4340,8 +4804,8 @@ declare const LockSchema: z.ZodObject<{
4340
4804
  specHash: string;
4341
4805
  styleId: string;
4342
4806
  assetId: string;
4343
- status?: "processing" | "review" | "failed" | "pending" | "selected" | "downloaded" | "download-failed" | undefined;
4344
4807
  provider?: string | undefined;
4808
+ status?: "processing" | "review" | "failed" | "pending" | "selected" | "downloaded" | "download-failed" | undefined;
4345
4809
  tileFeature?: string | null | undefined;
4346
4810
  revision?: {
4347
4811
  mode: "image-to-image" | "inpaint" | "outpaint";
@@ -4373,12 +4837,20 @@ declare const LockSchema: z.ZodObject<{
4373
4837
  sha256: string;
4374
4838
  role?: string | undefined;
4375
4839
  mediaType?: "image/png" | "image/gif" | undefined;
4840
+ raw?: string | undefined;
4376
4841
  }[] | undefined;
4377
4842
  providerMetadata?: Record<string, Record<string, unknown>> | undefined;
4378
4843
  submittedAt?: string | null | undefined;
4379
4844
  downloadedAt?: string | null | undefined;
4380
4845
  cost?: number | undefined;
4381
4846
  costUnit?: string | undefined;
4847
+ postprocess?: {
4848
+ palette?: {
4849
+ colors: string[];
4850
+ dither: "none";
4851
+ distance: "redmean";
4852
+ } | undefined;
4853
+ } | undefined;
4382
4854
  }[] | undefined;
4383
4855
  jobId?: string | null | undefined;
4384
4856
  objectId?: string | null | undefined;
@@ -4394,12 +4866,20 @@ declare const LockSchema: z.ZodObject<{
4394
4866
  sha256: string;
4395
4867
  role?: string | undefined;
4396
4868
  mediaType?: "image/png" | "image/gif" | undefined;
4869
+ raw?: string | undefined;
4397
4870
  }[] | undefined;
4398
4871
  providerMetadata?: Record<string, Record<string, unknown>> | undefined;
4399
4872
  submittedAt?: string | null | undefined;
4400
4873
  downloadedAt?: string | null | undefined;
4401
4874
  cost?: number | undefined;
4402
4875
  costUnit?: string | undefined;
4876
+ postprocess?: {
4877
+ palette?: {
4878
+ colors: string[];
4879
+ dither: "none";
4880
+ distance: "redmean";
4881
+ } | undefined;
4882
+ } | undefined;
4403
4883
  supersededOutputs?: {
4404
4884
  path: string;
4405
4885
  sha256: string;
@@ -4414,8 +4894,8 @@ declare const LockSchema: z.ZodObject<{
4414
4894
  entries: Record<string, {
4415
4895
  width: number;
4416
4896
  height: number;
4417
- status: "processing" | "review" | "failed" | "pending" | "selected" | "downloaded" | "download-failed";
4418
4897
  provider: string;
4898
+ status: "processing" | "review" | "failed" | "pending" | "selected" | "downloaded" | "download-failed";
4419
4899
  generator: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames";
4420
4900
  tileFeature: string | null;
4421
4901
  prompt: string;
@@ -4441,6 +4921,7 @@ declare const LockSchema: z.ZodObject<{
4441
4921
  sha256: string;
4442
4922
  role?: string | undefined;
4443
4923
  mediaType?: "image/png" | "image/gif" | undefined;
4924
+ raw?: string | undefined;
4444
4925
  }[];
4445
4926
  providerMetadata: Record<string, Record<string, unknown>>;
4446
4927
  submittedAt: string | null;
@@ -4473,6 +4954,7 @@ declare const LockSchema: z.ZodObject<{
4473
4954
  sha256: string;
4474
4955
  role?: string | undefined;
4475
4956
  mediaType?: "image/png" | "image/gif" | undefined;
4957
+ raw?: string | undefined;
4476
4958
  }[];
4477
4959
  providerMetadata: Record<string, Record<string, unknown>>;
4478
4960
  submittedAt: string | null;
@@ -4480,7 +4962,21 @@ declare const LockSchema: z.ZodObject<{
4480
4962
  cost: number;
4481
4963
  costUnit: string;
4482
4964
  retiredAt: string;
4965
+ postprocess?: {
4966
+ palette?: {
4967
+ colors: string[];
4968
+ dither: "none";
4969
+ distance: "redmean";
4970
+ } | undefined;
4971
+ } | undefined;
4483
4972
  }[] | undefined;
4973
+ postprocess?: {
4974
+ palette?: {
4975
+ colors: string[];
4976
+ dither: "none";
4977
+ distance: "redmean";
4978
+ } | undefined;
4979
+ } | undefined;
4484
4980
  supersededOutputs?: {
4485
4981
  path: string;
4486
4982
  sha256: string;
@@ -4499,8 +4995,8 @@ declare const LockSchema: z.ZodObject<{
4499
4995
  specHash: string;
4500
4996
  styleId: string;
4501
4997
  assetId: string;
4502
- status?: "processing" | "review" | "failed" | "pending" | "selected" | "downloaded" | "download-failed" | undefined;
4503
4998
  provider?: string | undefined;
4999
+ status?: "processing" | "review" | "failed" | "pending" | "selected" | "downloaded" | "download-failed" | undefined;
4504
5000
  tileFeature?: string | null | undefined;
4505
5001
  revision?: {
4506
5002
  mode: "image-to-image" | "inpaint" | "outpaint";
@@ -4532,12 +5028,20 @@ declare const LockSchema: z.ZodObject<{
4532
5028
  sha256: string;
4533
5029
  role?: string | undefined;
4534
5030
  mediaType?: "image/png" | "image/gif" | undefined;
5031
+ raw?: string | undefined;
4535
5032
  }[] | undefined;
4536
5033
  providerMetadata?: Record<string, Record<string, unknown>> | undefined;
4537
5034
  submittedAt?: string | null | undefined;
4538
5035
  downloadedAt?: string | null | undefined;
4539
5036
  cost?: number | undefined;
4540
5037
  costUnit?: string | undefined;
5038
+ postprocess?: {
5039
+ palette?: {
5040
+ colors: string[];
5041
+ dither: "none";
5042
+ distance: "redmean";
5043
+ } | undefined;
5044
+ } | undefined;
4541
5045
  }[] | undefined;
4542
5046
  jobId?: string | null | undefined;
4543
5047
  objectId?: string | null | undefined;
@@ -4553,12 +5057,20 @@ declare const LockSchema: z.ZodObject<{
4553
5057
  sha256: string;
4554
5058
  role?: string | undefined;
4555
5059
  mediaType?: "image/png" | "image/gif" | undefined;
5060
+ raw?: string | undefined;
4556
5061
  }[] | undefined;
4557
5062
  providerMetadata?: Record<string, Record<string, unknown>> | undefined;
4558
5063
  submittedAt?: string | null | undefined;
4559
5064
  downloadedAt?: string | null | undefined;
4560
5065
  cost?: number | undefined;
4561
5066
  costUnit?: string | undefined;
5067
+ postprocess?: {
5068
+ palette?: {
5069
+ colors: string[];
5070
+ dither: "none";
5071
+ distance: "redmean";
5072
+ } | undefined;
5073
+ } | undefined;
4562
5074
  supersededOutputs?: {
4563
5075
  path: string;
4564
5076
  sha256: string;
@@ -4629,6 +5141,8 @@ interface ResolvedSpec {
4629
5141
  seed?: number;
4630
5142
  /** Forced palette hex values; empty unless the style sets one. */
4631
5143
  palette: string[];
5144
+ /** Snap downloaded art to `palette`; excluded from the spec hash. */
5145
+ enforcePalette: boolean;
4632
5146
  /** `pixflux` only — strip the generated background. Defaults to true. */
4633
5147
  noBackground: boolean;
4634
5148
  /** `tiles` generator only — see StyleSchema for what each one means. */
@@ -4740,8 +5254,7 @@ interface MapObject {
4740
5254
  height: number | null;
4741
5255
  download_url: string | null;
4742
5256
  }
4743
- declare class PixelLabError extends Error {
4744
- readonly status: number;
5257
+ declare class PixelLabError extends ProviderError {
4745
5258
  readonly body: string;
4746
5259
  constructor(message: string, status: number, body: string);
4747
5260
  }
@@ -5689,6 +6202,7 @@ declare const RecipeSchema: z.ZodEffects<z.ZodObject<{
5689
6202
  noBackground: z.ZodDefault<z.ZodBoolean>;
5690
6203
  seed: z.ZodOptional<z.ZodNumber>;
5691
6204
  palette: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
6205
+ enforcePalette: z.ZodDefault<z.ZodBoolean>;
5692
6206
  quality: z.ZodOptional<z.ZodEffects<z.ZodObject<{
5693
6207
  outDir: z.ZodString;
5694
6208
  palette: z.ZodArray<z.ZodString, "many">;
@@ -5758,6 +6272,7 @@ declare const RecipeSchema: z.ZodEffects<z.ZodObject<{
5758
6272
  path: string;
5759
6273
  }[];
5760
6274
  noBackground: boolean;
6275
+ enforcePalette: boolean;
5761
6276
  tags: string[];
5762
6277
  providerOptions: Record<string, Record<string, unknown>>;
5763
6278
  provider?: string | undefined;
@@ -5789,8 +6304,8 @@ declare const RecipeSchema: z.ZodEffects<z.ZodObject<{
5789
6304
  } | undefined;
5790
6305
  }, {
5791
6306
  outDir: string;
5792
- palette?: string[] | undefined;
5793
6307
  provider?: string | undefined;
6308
+ palette?: string[] | undefined;
5794
6309
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
5795
6310
  size?: number | undefined;
5796
6311
  view?: string | undefined;
@@ -5809,6 +6324,7 @@ declare const RecipeSchema: z.ZodEffects<z.ZodObject<{
5809
6324
  outlineMode?: "outline" | "segmentation" | undefined;
5810
6325
  noBackground?: boolean | undefined;
5811
6326
  seed?: number | undefined;
6327
+ enforcePalette?: boolean | undefined;
5812
6328
  quality?: {
5813
6329
  outDir: string;
5814
6330
  palette: string[];
@@ -5836,6 +6352,7 @@ declare const RecipeSchema: z.ZodEffects<z.ZodObject<{
5836
6352
  path: string;
5837
6353
  }[];
5838
6354
  noBackground: boolean;
6355
+ enforcePalette: boolean;
5839
6356
  tags: string[];
5840
6357
  providerOptions: Record<string, Record<string, unknown>>;
5841
6358
  provider?: string | undefined;
@@ -5867,8 +6384,8 @@ declare const RecipeSchema: z.ZodEffects<z.ZodObject<{
5867
6384
  } | undefined;
5868
6385
  }, {
5869
6386
  outDir: string;
5870
- palette?: string[] | undefined;
5871
6387
  provider?: string | undefined;
6388
+ palette?: string[] | undefined;
5872
6389
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
5873
6390
  size?: number | undefined;
5874
6391
  view?: string | undefined;
@@ -5887,6 +6404,7 @@ declare const RecipeSchema: z.ZodEffects<z.ZodObject<{
5887
6404
  outlineMode?: "outline" | "segmentation" | undefined;
5888
6405
  noBackground?: boolean | undefined;
5889
6406
  seed?: number | undefined;
6407
+ enforcePalette?: boolean | undefined;
5890
6408
  quality?: {
5891
6409
  outDir: string;
5892
6410
  palette: string[];
@@ -5914,6 +6432,7 @@ declare const RecipeSchema: z.ZodEffects<z.ZodObject<{
5914
6432
  path: string;
5915
6433
  }[];
5916
6434
  noBackground: boolean;
6435
+ enforcePalette: boolean;
5917
6436
  tags: string[];
5918
6437
  providerOptions: Record<string, Record<string, unknown>>;
5919
6438
  provider?: string | undefined;
@@ -5945,8 +6464,8 @@ declare const RecipeSchema: z.ZodEffects<z.ZodObject<{
5945
6464
  } | undefined;
5946
6465
  }, {
5947
6466
  outDir: string;
5948
- palette?: string[] | undefined;
5949
6467
  provider?: string | undefined;
6468
+ palette?: string[] | undefined;
5950
6469
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
5951
6470
  size?: number | undefined;
5952
6471
  view?: string | undefined;
@@ -5965,6 +6484,7 @@ declare const RecipeSchema: z.ZodEffects<z.ZodObject<{
5965
6484
  outlineMode?: "outline" | "segmentation" | undefined;
5966
6485
  noBackground?: boolean | undefined;
5967
6486
  seed?: number | undefined;
6487
+ enforcePalette?: boolean | undefined;
5968
6488
  quality?: {
5969
6489
  outDir: string;
5970
6490
  palette: string[];
@@ -6343,6 +6863,7 @@ declare const RecipeSchema: z.ZodEffects<z.ZodObject<{
6343
6863
  path: string;
6344
6864
  }[];
6345
6865
  noBackground: boolean;
6866
+ enforcePalette: boolean;
6346
6867
  tags: string[];
6347
6868
  providerOptions: Record<string, Record<string, unknown>>;
6348
6869
  provider?: string | undefined;
@@ -6445,8 +6966,8 @@ declare const RecipeSchema: z.ZodEffects<z.ZodObject<{
6445
6966
  summary: string;
6446
6967
  style: {
6447
6968
  outDir: string;
6448
- palette?: string[] | undefined;
6449
6969
  provider?: string | undefined;
6970
+ palette?: string[] | undefined;
6450
6971
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
6451
6972
  size?: number | undefined;
6452
6973
  view?: string | undefined;
@@ -6465,6 +6986,7 @@ declare const RecipeSchema: z.ZodEffects<z.ZodObject<{
6465
6986
  outlineMode?: "outline" | "segmentation" | undefined;
6466
6987
  noBackground?: boolean | undefined;
6467
6988
  seed?: number | undefined;
6989
+ enforcePalette?: boolean | undefined;
6468
6990
  quality?: {
6469
6991
  outDir: string;
6470
6992
  palette: string[];
@@ -6585,6 +7107,7 @@ declare const RecipeSchema: z.ZodEffects<z.ZodObject<{
6585
7107
  path: string;
6586
7108
  }[];
6587
7109
  noBackground: boolean;
7110
+ enforcePalette: boolean;
6588
7111
  tags: string[];
6589
7112
  providerOptions: Record<string, Record<string, unknown>>;
6590
7113
  provider?: string | undefined;
@@ -6687,8 +7210,8 @@ declare const RecipeSchema: z.ZodEffects<z.ZodObject<{
6687
7210
  summary: string;
6688
7211
  style: {
6689
7212
  outDir: string;
6690
- palette?: string[] | undefined;
6691
7213
  provider?: string | undefined;
7214
+ palette?: string[] | undefined;
6692
7215
  generator?: "map" | "1dir" | "pixflux" | "tiles" | "animation" | "frames" | undefined;
6693
7216
  size?: number | undefined;
6694
7217
  view?: string | undefined;
@@ -6707,6 +7230,7 @@ declare const RecipeSchema: z.ZodEffects<z.ZodObject<{
6707
7230
  outlineMode?: "outline" | "segmentation" | undefined;
6708
7231
  noBackground?: boolean | undefined;
6709
7232
  seed?: number | undefined;
7233
+ enforcePalette?: boolean | undefined;
6710
7234
  quality?: {
6711
7235
  outDir: string;
6712
7236
  palette: string[];
@@ -6780,6 +7304,8 @@ declare const RecipeSchema: z.ZodEffects<z.ZodObject<{
6780
7304
  type Recipe = z.infer<typeof RecipeSchema>;
6781
7305
  interface LoadedRecipe {
6782
7306
  recipe: Recipe;
7307
+ /** The file's JSON as written, before schema defaults; what the digest covers. */
7308
+ authored: Record<string, unknown>;
6783
7309
  path: string;
6784
7310
  dir: string;
6785
7311
  bundled: boolean;
@@ -6830,7 +7356,14 @@ interface InstallRecipeResult {
6830
7356
  styleId: string;
6831
7357
  style: Style;
6832
7358
  }
6833
- declare function recipeDigest(recipe: Recipe): string;
7359
+ /**
7360
+ * The digest covers the recipe as its author wrote it, minus `integrity`.
7361
+ * It used to cover the parsed form, which meant every schema default added
7362
+ * to a style changed the digest of every recipe ever published; the
7363
+ * `enforcePalette` default was the first to trip it. What the author
7364
+ * signed is what the file says, so that is what is hashed.
7365
+ */
7366
+ declare function recipeDigest(recipe: Recipe | Record<string, unknown>): string;
6834
7367
  declare function bundledRecipeRoot(): string;
6835
7368
  declare function listBundledRecipes(root?: string): Promise<LoadedRecipe[]>;
6836
7369
  declare function resolveRecipe(target: string, bundledRoot?: string): Promise<LoadedRecipe>;
@@ -6855,11 +7388,9 @@ interface PaletteEntry {
6855
7388
  }
6856
7389
 
6857
7390
  /**
6858
- * Perceptual-ish distance between two colours, 0-255ish.
6859
- *
6860
- * "Redmean" — a cheap weighting that tracks human perception far better than
6861
- * raw RGB euclidean and needs no colour-space conversion or dependency. Good
6862
- * enough to rank outliers, which is all this is for; it is not colourimetry.
7391
+ * Perceptual-ish RGB distance that weights channels by where the colour sits
7392
+ * (Riemersma's redmean). Cheap and good enough to pick a swatch; not a
7393
+ * colour-management tool.
6863
7394
  */
6864
7395
  declare function colorDistance(a: {
6865
7396
  r: number;
@@ -6870,6 +7401,9 @@ declare function colorDistance(a: {
6870
7401
  g: number;
6871
7402
  b: number;
6872
7403
  }): number;
7404
+ /** `quantize` for callers that only want the picture. */
7405
+ declare function quantizeToPalette(png: DecodedPng, palette: string[]): DecodedPng;
7406
+
6873
7407
  /**
6874
7408
  * How far an asset's palette sits from a reference palette.
6875
7409
  *
@@ -7113,8 +7647,7 @@ interface ApproveQualityOptions {
7113
7647
  declare function qualityRecordPath(output: string): string;
7114
7648
  /** Canonical lowercase palette identity shared by manifest quality profiles. */
7115
7649
  declare function normalizeRefinementPalette(values: string[]): string[];
7116
- /** Map every visible pixel to the nearest explicit color, without dithering. */
7117
- declare function quantizeToPalette(png: DecodedPng, palette: string[]): DecodedPng;
7650
+
7118
7651
  /** Derive a stable frame PNG beside a quality profile's virtual output stem. */
7119
7652
  declare function qualityFrameOutputPath(output: string, role: string, index: number): string;
7120
7653
  /** Recover an image's native grid, enforce its final palette, and write an auditable bundle. */
@@ -7194,9 +7727,9 @@ declare const ImageQualityMetricsSchema: z.ZodObject<{
7194
7727
  width: number;
7195
7728
  height: number;
7196
7729
  sha256: string;
7730
+ colors: string[];
7197
7731
  colorCount: number;
7198
7732
  transparency: number;
7199
- colors: string[];
7200
7733
  partialAlpha: number;
7201
7734
  edgeDensity: number;
7202
7735
  meanEdgeContrast: number;
@@ -7205,9 +7738,9 @@ declare const ImageQualityMetricsSchema: z.ZodObject<{
7205
7738
  width: number;
7206
7739
  height: number;
7207
7740
  sha256: string;
7741
+ colors: string[];
7208
7742
  colorCount: number;
7209
7743
  transparency: number;
7210
- colors: string[];
7211
7744
  partialAlpha: number;
7212
7745
  edgeDensity: number;
7213
7746
  meanEdgeContrast: number;
@@ -7246,9 +7779,9 @@ declare const QualityBaselineSchema: z.ZodEffects<z.ZodObject<{
7246
7779
  width: number;
7247
7780
  height: number;
7248
7781
  sha256: string;
7782
+ colors: string[];
7249
7783
  colorCount: number;
7250
7784
  transparency: number;
7251
- colors: string[];
7252
7785
  partialAlpha: number;
7253
7786
  edgeDensity: number;
7254
7787
  meanEdgeContrast: number;
@@ -7257,9 +7790,9 @@ declare const QualityBaselineSchema: z.ZodEffects<z.ZodObject<{
7257
7790
  width: number;
7258
7791
  height: number;
7259
7792
  sha256: string;
7793
+ colors: string[];
7260
7794
  colorCount: number;
7261
7795
  transparency: number;
7262
- colors: string[];
7263
7796
  partialAlpha: number;
7264
7797
  edgeDensity: number;
7265
7798
  meanEdgeContrast: number;
@@ -7298,9 +7831,9 @@ declare const QualityBaselineSchema: z.ZodEffects<z.ZodObject<{
7298
7831
  width: number;
7299
7832
  height: number;
7300
7833
  sha256: string;
7834
+ colors: string[];
7301
7835
  colorCount: number;
7302
7836
  transparency: number;
7303
- colors: string[];
7304
7837
  partialAlpha: number;
7305
7838
  edgeDensity: number;
7306
7839
  meanEdgeContrast: number;
@@ -7327,9 +7860,9 @@ declare const QualityBaselineSchema: z.ZodEffects<z.ZodObject<{
7327
7860
  width: number;
7328
7861
  height: number;
7329
7862
  sha256: string;
7863
+ colors: string[];
7330
7864
  colorCount: number;
7331
7865
  transparency: number;
7332
- colors: string[];
7333
7866
  partialAlpha: number;
7334
7867
  edgeDensity: number;
7335
7868
  meanEdgeContrast: number;
@@ -7360,9 +7893,9 @@ declare const QualityBaselineSchema: z.ZodEffects<z.ZodObject<{
7360
7893
  width: number;
7361
7894
  height: number;
7362
7895
  sha256: string;
7896
+ colors: string[];
7363
7897
  colorCount: number;
7364
7898
  transparency: number;
7365
- colors: string[];
7366
7899
  partialAlpha: number;
7367
7900
  edgeDensity: number;
7368
7901
  meanEdgeContrast: number;
@@ -7394,9 +7927,9 @@ declare const QualityBaselineSchema: z.ZodEffects<z.ZodObject<{
7394
7927
  width: number;
7395
7928
  height: number;
7396
7929
  sha256: string;
7930
+ colors: string[];
7397
7931
  colorCount: number;
7398
7932
  transparency: number;
7399
- colors: string[];
7400
7933
  partialAlpha: number;
7401
7934
  edgeDensity: number;
7402
7935
  meanEdgeContrast: number;
@@ -7428,9 +7961,9 @@ declare const QualityBaselineSchema: z.ZodEffects<z.ZodObject<{
7428
7961
  width: number;
7429
7962
  height: number;
7430
7963
  sha256: string;
7964
+ colors: string[];
7431
7965
  colorCount: number;
7432
7966
  transparency: number;
7433
- colors: string[];
7434
7967
  partialAlpha: number;
7435
7968
  edgeDensity: number;
7436
7969
  meanEdgeContrast: number;
@@ -7462,9 +7995,9 @@ declare const QualityBaselineSchema: z.ZodEffects<z.ZodObject<{
7462
7995
  width: number;
7463
7996
  height: number;
7464
7997
  sha256: string;
7998
+ colors: string[];
7465
7999
  colorCount: number;
7466
8000
  transparency: number;
7467
- colors: string[];
7468
8001
  partialAlpha: number;
7469
8002
  edgeDensity: number;
7470
8003
  meanEdgeContrast: number;
@@ -8312,6 +8845,8 @@ interface GalleryItem {
8312
8845
  outputs: GalleryOutput[];
8313
8846
  quality: GalleryQuality | null;
8314
8847
  providerMetadata: Record<string, unknown>;
8848
+ /** Post-processing recorded on the entry: the palette its files were snapped to, if any. */
8849
+ postprocess: Postprocess | null;
8315
8850
  /** Manifest asset as declared, for the "intent" side of the record. */
8316
8851
  asset: Asset | null;
8317
8852
  /** Manifest-relative committed art placed instead of generated output. */
@@ -8357,6 +8892,8 @@ interface GalleryStyle {
8357
8892
  promptPrefix: string;
8358
8893
  promptSuffix: string;
8359
8894
  palette: string[];
8895
+ /** Downloaded art is snapped to `palette` by fetch. */
8896
+ enforcePalette: boolean;
8360
8897
  /** Provider view name, when the style sets one. */
8361
8898
  view: string | null;
8362
8899
  /** Strip the generated background (sent for pixflux and non-PixelLab providers). */
@@ -8648,6 +9185,7 @@ declare const CompanionV2Schema: z.ZodObject<{
8648
9185
  basedOn: string | null;
8649
9186
  }>, "many">;
8650
9187
  }, "strict", z.ZodTypeAny, {
9188
+ project: string | null;
8651
9189
  outputs: {
8652
9190
  sha256: string;
8653
9191
  role: string | null;
@@ -8655,10 +9193,10 @@ declare const CompanionV2Schema: z.ZodObject<{
8655
9193
  }[];
8656
9194
  version: 2;
8657
9195
  protocol: number;
8658
- project: string | null;
8659
9196
  editor: string;
8660
9197
  savedAt: string;
8661
9198
  }, {
9199
+ project: string | null;
8662
9200
  outputs: {
8663
9201
  sha256: string;
8664
9202
  role: string | null;
@@ -8666,7 +9204,6 @@ declare const CompanionV2Schema: z.ZodObject<{
8666
9204
  }[];
8667
9205
  version: 2;
8668
9206
  protocol: number;
8669
- project: string | null;
8670
9207
  editor: string;
8671
9208
  savedAt: string;
8672
9209
  }>;
@@ -8696,6 +9233,7 @@ declare const HandEditCompanionSchema: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
8696
9233
  basedOn: string | null;
8697
9234
  }>, "many">;
8698
9235
  }, "strict", z.ZodTypeAny, {
9236
+ project: string | null;
8699
9237
  outputs: {
8700
9238
  sha256: string;
8701
9239
  role: string | null;
@@ -8703,10 +9241,10 @@ declare const HandEditCompanionSchema: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
8703
9241
  }[];
8704
9242
  version: 2;
8705
9243
  protocol: number;
8706
- project: string | null;
8707
9244
  editor: string;
8708
9245
  savedAt: string;
8709
9246
  }, {
9247
+ project: string | null;
8710
9248
  outputs: {
8711
9249
  sha256: string;
8712
9250
  role: string | null;
@@ -8714,7 +9252,6 @@ declare const HandEditCompanionSchema: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
8714
9252
  }[];
8715
9253
  version: 2;
8716
9254
  protocol: number;
8717
- project: string | null;
8718
9255
  editor: string;
8719
9256
  savedAt: string;
8720
9257
  }>, z.ZodObject<{
@@ -8726,22 +9263,23 @@ declare const HandEditCompanionSchema: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
8726
9263
  savedAt: z.ZodString;
8727
9264
  project: z.ZodNullable<z.ZodString>;
8728
9265
  }, "strict", z.ZodTypeAny, {
9266
+ project: string | null;
8729
9267
  sha256: string;
8730
9268
  version: 1;
8731
9269
  protocol: number;
8732
- project: string | null;
8733
9270
  basedOn: string | null;
8734
9271
  editor: string;
8735
9272
  savedAt: string;
8736
9273
  }, {
9274
+ project: string | null;
8737
9275
  sha256: string;
8738
9276
  version: 1;
8739
9277
  protocol: number;
8740
- project: string | null;
8741
9278
  basedOn: string | null;
8742
9279
  editor: string;
8743
9280
  savedAt: string;
8744
9281
  }>]>, {
9282
+ project: string | null;
8745
9283
  outputs: {
8746
9284
  sha256: string;
8747
9285
  role: string | null;
@@ -8749,10 +9287,10 @@ declare const HandEditCompanionSchema: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
8749
9287
  }[];
8750
9288
  version: 2;
8751
9289
  protocol: number;
8752
- project: string | null;
8753
9290
  editor: string;
8754
9291
  savedAt: string;
8755
9292
  }, {
9293
+ project: string | null;
8756
9294
  outputs: {
8757
9295
  sha256: string;
8758
9296
  role: string | null;
@@ -8760,14 +9298,13 @@ declare const HandEditCompanionSchema: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
8760
9298
  }[];
8761
9299
  version: 2;
8762
9300
  protocol: number;
8763
- project: string | null;
8764
9301
  editor: string;
8765
9302
  savedAt: string;
8766
9303
  } | {
9304
+ project: string | null;
8767
9305
  sha256: string;
8768
9306
  version: 1;
8769
9307
  protocol: number;
8770
- project: string | null;
8771
9308
  basedOn: string | null;
8772
9309
  editor: string;
8773
9310
  savedAt: string;
@@ -8844,7 +9381,7 @@ declare function retireGeneration(entry: LockEntry, retiredAt: string): LockHist
8844
9381
  * no bytes to come back to.
8845
9382
  */
8846
9383
  declare function historyAfterReplacing(previous: LockEntry | undefined, limit: number, retiredAt: string): LockHistoryEntry[] | undefined;
8847
- /** Output hashes every generation in the lockfile, current or retired, still refers to. */
9384
+ /** Hashes every generation in the lockfile, current or retired, still refers to: outputs and the raw bytes behind them. */
8848
9385
  declare function referencedHashes(lock: Lock): Set<string>;
8849
9386
  interface HistoryPick {
8850
9387
  /** 1 is the most recently replaced generation. */
@@ -9125,49 +9662,49 @@ declare const GenerateRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
9125
9662
  revert: z.ZodOptional<z.ZodString>;
9126
9663
  }, "strict", z.ZodTypeAny, {
9127
9664
  keys: string[];
9665
+ project?: string | undefined;
9128
9666
  resume?: boolean | undefined;
9129
9667
  force?: boolean | undefined;
9130
- project?: string | undefined;
9131
9668
  refresh?: boolean | undefined;
9132
9669
  restore?: boolean | undefined;
9133
9670
  revert?: string | undefined;
9134
9671
  }, {
9135
9672
  keys: string[];
9673
+ project?: string | undefined;
9136
9674
  resume?: boolean | undefined;
9137
9675
  force?: boolean | undefined;
9138
- project?: string | undefined;
9139
9676
  refresh?: boolean | undefined;
9140
9677
  restore?: boolean | undefined;
9141
9678
  revert?: string | undefined;
9142
9679
  }>, {
9143
9680
  keys: string[];
9681
+ project?: string | undefined;
9144
9682
  resume?: boolean | undefined;
9145
9683
  force?: boolean | undefined;
9146
- project?: string | undefined;
9147
9684
  refresh?: boolean | undefined;
9148
9685
  restore?: boolean | undefined;
9149
9686
  revert?: string | undefined;
9150
9687
  }, {
9151
9688
  keys: string[];
9689
+ project?: string | undefined;
9152
9690
  resume?: boolean | undefined;
9153
9691
  force?: boolean | undefined;
9154
- project?: string | undefined;
9155
9692
  refresh?: boolean | undefined;
9156
9693
  restore?: boolean | undefined;
9157
9694
  revert?: string | undefined;
9158
9695
  }>, {
9159
9696
  keys: string[];
9697
+ project?: string | undefined;
9160
9698
  resume?: boolean | undefined;
9161
9699
  force?: boolean | undefined;
9162
- project?: string | undefined;
9163
9700
  refresh?: boolean | undefined;
9164
9701
  restore?: boolean | undefined;
9165
9702
  revert?: string | undefined;
9166
9703
  }, {
9167
9704
  keys: string[];
9705
+ project?: string | undefined;
9168
9706
  resume?: boolean | undefined;
9169
9707
  force?: boolean | undefined;
9170
- project?: string | undefined;
9171
9708
  refresh?: boolean | undefined;
9172
9709
  restore?: boolean | undefined;
9173
9710
  revert?: string | undefined;
@@ -9372,6 +9909,8 @@ declare const ManifestEditSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObject
9372
9909
  promptSuffix: z.ZodOptional<z.ZodString>;
9373
9910
  /** `#rrggbb` values; null or empty clears the style's own palette. */
9374
9911
  palette: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
9912
+ /** Snap downloaded art to the palette; false clears the style's own value. */
9913
+ enforcePalette: z.ZodOptional<z.ZodBoolean>;
9375
9914
  /** Provider view name (PixelLab: low top-down, high top-down, side); empty clears. */
9376
9915
  view: z.ZodOptional<z.ZodNullable<z.ZodString>>;
9377
9916
  /** pixflux only; null clears the style's own value. */
@@ -9383,6 +9922,7 @@ declare const ManifestEditSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObject
9383
9922
  promptSuffix?: string | undefined;
9384
9923
  promptPrefix?: string | undefined;
9385
9924
  noBackground?: boolean | null | undefined;
9925
+ enforcePalette?: boolean | undefined;
9386
9926
  }, {
9387
9927
  candidates?: number | undefined;
9388
9928
  palette?: string[] | null | undefined;
@@ -9390,6 +9930,7 @@ declare const ManifestEditSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObject
9390
9930
  promptSuffix?: string | undefined;
9391
9931
  promptPrefix?: string | undefined;
9392
9932
  noBackground?: boolean | null | undefined;
9933
+ enforcePalette?: boolean | undefined;
9393
9934
  }>, {
9394
9935
  candidates?: number | undefined;
9395
9936
  palette?: string[] | null | undefined;
@@ -9397,6 +9938,7 @@ declare const ManifestEditSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObject
9397
9938
  promptSuffix?: string | undefined;
9398
9939
  promptPrefix?: string | undefined;
9399
9940
  noBackground?: boolean | null | undefined;
9941
+ enforcePalette?: boolean | undefined;
9400
9942
  }, {
9401
9943
  candidates?: number | undefined;
9402
9944
  palette?: string[] | null | undefined;
@@ -9404,6 +9946,7 @@ declare const ManifestEditSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObject
9404
9946
  promptSuffix?: string | undefined;
9405
9947
  promptPrefix?: string | undefined;
9406
9948
  noBackground?: boolean | null | undefined;
9949
+ enforcePalette?: boolean | undefined;
9407
9950
  }>;
9408
9951
  }, "strict", z.ZodTypeAny, {
9409
9952
  styleId: string;
@@ -9414,6 +9957,7 @@ declare const ManifestEditSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObject
9414
9957
  promptSuffix?: string | undefined;
9415
9958
  promptPrefix?: string | undefined;
9416
9959
  noBackground?: boolean | null | undefined;
9960
+ enforcePalette?: boolean | undefined;
9417
9961
  };
9418
9962
  expectedSha256: string;
9419
9963
  action: "patch-style";
@@ -9427,6 +9971,7 @@ declare const ManifestEditSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObject
9427
9971
  promptSuffix?: string | undefined;
9428
9972
  promptPrefix?: string | undefined;
9429
9973
  noBackground?: boolean | null | undefined;
9974
+ enforcePalette?: boolean | undefined;
9430
9975
  };
9431
9976
  expectedSha256: string;
9432
9977
  action: "patch-style";
@@ -9777,4 +10322,4 @@ interface WorkspaceStatusReport {
9777
10322
  */
9778
10323
  declare function workspaceStatus(ws: Workspace, dir: string): Promise<WorkspaceStatusReport>;
9779
10324
 
9780
- export { type AdoptResult, type ApproveQualityOptions, type ApprovedQualityReview, type ArtifactBundleManifest, type ArtifactBundleOptions, type ArtifactBundleResult, type ArtifactFile, type ArtifactProvenance, type ArtifactSource, type ArtifactVerification, type Asset, type AssetAudit, AssetSchema, type AuditEvaluation, type AuditThresholds, type AuditViolation, type Balance, type BalanceChange, type BalanceInfo, type BuildGalleryOptions, type BuildWorkspaceGalleryOptions, type CacheHealthOptions, type CacheHealthReport, type CandidateSelection, type ComfyUIBinding, type ComfyUIBindings, type ComfyUIFramesOptions, type ComfyUIImageInput, type ComfyUIOptions, ComfyUIProvider, type ContentCacheHealth, type ContentCacheIssue, type CostEstimate, type CostUnit, DEFAULT_HISTORY_LIMIT, DEFAULT_QUALITY_TOLERANCES, DEFAULT_RATE_LIMIT, DEFAULT_TIMEOUT_MS, type DoctorCheck, type DoctorLevel, type DoctorOptions, type DoctorReport, EDITOR_PIN, EDITOR_RELEASE_BASE, EditorInstallError, type EditorInstallOptions, type EditorInstallProgress, type EditorInstallResult, type EditorInstallStatus, type EditorPin, FAKE_PNG, type FakeOptions, FakeProvider, type FetchResult, type GalleryBuild, type GalleryEditHandlerOptions, type GalleryEditMeta, type GalleryEditorHandlers, type GalleryEditorOptions, type GalleryEditorStatus, type GalleryGenerateHandlers, type GalleryGeneration, type GalleryItem, type GalleryMedia, type GalleryOutput, type GalleryProject, type GalleryProjectContext, type GalleryQuality, type GalleryServer, type GalleryServerOptions, type GallerySnapshot, type GalleryState, type GalleryStyle, type GenerateHandlerOptions, type GenerateJob, type GeneratePhase, GenerateRequestError, GenerateRequestSchema, type GenerateStatus, type Generator, GeneratorSchema, type GenericTileset, type GridConfidence, GridConfidenceSchema, HAND_EDIT_DIR, HISTORY_ENV, type HandEditCompanion, HandEditCompanionSchema, type HandEditMember, type HandEditSave, type HandEditSaveInput, type HandEditStart, type HandEditStatus, type HistoryPick, type ImageQualityMetrics, ImageQualityMetricsSchema, InheritedStyleSchema, type InstallRecipeOptions, type InstallRecipeResult, type JobState, type LoadedManifest, type LoadedRecipe, type Lock, type LockEntry, LockEntrySchema, type LockHistoryEntry, LockHistoryEntrySchema, type LockOutput, LockSchema, MAX_DOWNLOAD_BYTES, MAX_HAND_EDIT_BYTES, MAX_RETRIES, type ManagedArtifactBundleOptions, type Manifest, ManifestDriftError, type ManifestEdit, ManifestEditError, type ManifestEditResult, ManifestEditSchema, ManifestInputSchema, ManifestSchema, type MapObject, MediaType, type MountPlacement, type MountedSheet, type NormalizedTileRules, type OpenProjectOptions, type Orphan, type OrphanGroups, type OutputSelection, type OutputSource, PIXEL_ART_FIXER_REVISION, PIXEL_ART_FIXER_URL, type PackedFrame, type PackedSheet, type PackedSource, type PendingQualityReview, type PickResult, type PixelArtFixerDetection, PixelLabClient, PixelLabError, type PixelLabObject, PixelLabProvider, type Plan, type PlanItem, type PlanState, type PollContext, type PollOptions, type PollResult, type PrepareReviewOptions, type Project, type Provider, type ProviderFactory, type ProviderInputContext, type ProviderInputScalar, type ProviderInputValue, type ProviderMetadata, type ProviderMode, type ProviderOptionContext, type ProviderSubmission, type QualityBaseline, QualityBaselineSchema, type QualityCheck, type QualityProfile, type QualityProfileInspection, QualityProfileSchema, type QualityProfileState, type QualityRegressionCaseResult, type QualityRegressionReport, type QualitySnapshotResult, QualityToleranceSchema, type QualityTolerances, type RateLimit, type Recipe, type RecipeFileVerification, type RecipeModelVerification, RecipeSchema, type RecipeVerification, type RefineAudit, type RefineFrameSetOptions, type RefineFrameSetResult, type RefineOptions, type RefineQualityProfilesOptions, type RefineQualityProfilesResult, type RefineRecordOptions, type RefineResult, type RemoteAsset, type RemoteHashCacheHealth, type RenderGalleryOptions, type RenderSheetOptions, type ResolvedOutput, type ResolvedProviderInputs, type ResolvedProviderOptions, type ResolvedQualityInput, type ResolvedQualityProfile, type ResolvedRevision, type ResolvedSpec, type ResolvedStyleImage, type ResumeAction, type ResumeCommand, type RetroDiffusionOptions, RetroDiffusionProvider, type RetryInit, type RetryOptions, type RetryingFetch, type RevertOptions, type RevertResult, type ReviewReadyInfo, type ReviewSession, type Revision, type RevisionMode, RevisionModeSchema, type RevisionReadiness, RevisionSchema, type SalvageAction, type SalvageResult, type ScannedAsset, type ScenarioOptions, ScenarioProvider, type SessionBudget, type SheetGroup, type SiblingManifest, type SpriteInput, type Style, type StyleAudit, type StyleInput, StyleInputSchema, StyleSchema, type SubmissionCheckpoint, type SubmitContext, type SubmitOptions, type SubmitResult, type TilesPro, type TilesetExport, type TilesetExportOptions, type TilesetFormat, UnsupportedCapabilityError, type Workspace, type WorkspaceClaims, type WorkspaceDiagnostic, type WorkspaceProject, WorkspaceProjectSchema, type WorkspaceProjectStatus, WorkspaceSchema, type WorkspaceStatusReport, adopt, applyManifestEdit, applyTags, approveQualityRecord, auditStyle, availableProviders, backoffMs, buildGallerySnapshot, buildManifest, buildPlan, buildWorkspaceGallerySnapshot, bundledRecipeRoot, cacheFileName, candidateCount, checkQualityBaseline, checkQualityRecord, clientFromEnv, colorDistance, countNumberedDescriptions, createArtifactBundleManifest, createGalleryEditHandler, createGalleryEditorHandlers, createGenerateHandlers, createProvider, currentEntryOutputPath, currentOutputPath, defaultOpenCommand, detachHandEdit, detectMediaType, doctor, editorBaseUrl, editorDir, editorRoute, editorStatus, editorToolsRoot, evaluateAudit, expectedOutputPath, exportTileset, fallbackOutputRole, fetchAssets, fetchWithRetry, findOrphans, formatCost, galleryMediaId, galleryMediaRoute, generationCost, groupOrphansByStyle, handEditBase, handEditBases, handEditCompanionPath, handEditMembers, handEditPath, handEditProjectPath, hex, historyAfterReplacing, historyLimit, idFromPrompt, imageMetadata, inspectCaches, inspectQualityProfile, inspectRevisionReadiness, installEditor, installRecipe, isFrameSetEntry, isMemberSetEntry, isSensitiveSourceUrl, listBundledRecipes, loadClaims, loadLock, loadManifest, loadSiblingManifests, loadWorkspace, lockKey, matchOrphanStyle, measureBalanceChange, measureDecodedImageQuality, measureImageQuality, mediaExtension, mediaTypeFromExtension, memberPath, mergePalettes, mountSprites, mountStyle, normalizeLockOutputPaths, normalizeRefinementPalette, normalizeTileRules, openExternal, openInEditor, openProject, outliers, outputId, packSprites, packStyle, paletteDistance, parseLock, parseWorkspace, pickHistory, pngSize, poll, portableOutputPath, prepareReview, primaryOutput, providerCredentialEnvs, providerFactory, pushTags, qualityFrameOutputPath, qualityRecordPath, quantizeToPalette, readArtifactBundleManifest, readHandEditCompanion, readQualityBaseline, recipeDigest, referencedHashes, refineAsset, refineFrameSet, refineQualityProfiles, registerProvider, remove, renderGallery, renderSalvageSheet, renderSheet, requireApprovedQualitySources, requireBalance, requireDelete, requireList, requireRevisionReady, requireSelectCandidate, resolveEntryOutputs, resolveOutputPath, resolvePackInputs, resolveProject, resolveQualityInputs, resolveRecipe, resolveSpecEntryOutputs, resolveSpecOutputs, resolveSpecs, resolveStyleImages, resolveStyleOutputs, resumeActions, resumeCommandForStatus, retireGeneration, retryAfterMs, revertGeneration, runPicker, runSalvage, saveHandEdit, saveLock, saveWorkspace, scanAssets, selectEntryOutput, serveGallery, sha256, sha256File, shouldPersistSourceUrl, shouldRetry, slugify, snapshotQualityBaseline, sourceIsStem, sourceOutputPath, specHash, spendByUnit, startHandEdit, styleImagesBase64, submit, summarize, tagAdopted, tileFeatureOutputCount, tileVariationCount, tilesCost, toPortablePath, totalSpend, upsert, validateCostEstimate, validateMedia, validateWorkspace, verifyArtifactBundle, verifyRecipe, withArtifactManifest, workspaceClaims, workspaceStatus, writeArtifactBundle, writeManagedArtifactBundle };
10325
+ export { type AdoptResult, type ApproveQualityOptions, type ApprovedQualityReview, type ArtifactBundleManifest, type ArtifactBundleOptions, type ArtifactBundleResult, type ArtifactFile, type ArtifactProvenance, type ArtifactSource, type ArtifactVerification, type Asset, type AssetAudit, AssetSchema, type AuditEvaluation, type AuditThresholds, type AuditViolation, type Balance, type BalanceChange, type BalanceInfo, BudgetError, type BuildGalleryOptions, type BuildWorkspaceGalleryOptions, type CacheHealthOptions, type CacheHealthReport, type CandidateSelection, type ComfyUIBinding, type ComfyUIBindings, type ComfyUIFramesOptions, type ComfyUIImageInput, type ComfyUIOptions, ComfyUIProvider, type ContentCacheHealth, type ContentCacheIssue, type CostEstimate, type CostUnit, DEFAULT_HISTORY_LIMIT, DEFAULT_QUALITY_TOLERANCES, DEFAULT_RATE_LIMIT, DEFAULT_TIMEOUT_MS, type DoctorCheck, type DoctorLevel, type DoctorOptions, type DoctorReport, EDITOR_PIN, EDITOR_RELEASE_BASE, EXIT_CODES, EditorInstallError, type EditorInstallOptions, type EditorInstallProgress, type EditorInstallResult, type EditorInstallStatus, type EditorPin, type ErrorCode, FAKE_PNG, type FakeOptions, FakeProvider, type FetchResult, type GalleryBuild, type GalleryEditHandlerOptions, type GalleryEditMeta, type GalleryEditorHandlers, type GalleryEditorOptions, type GalleryEditorStatus, type GalleryGenerateHandlers, type GalleryGeneration, type GalleryItem, type GalleryMedia, type GalleryOutput, type GalleryProject, type GalleryProjectContext, type GalleryQuality, type GalleryServer, type GalleryServerOptions, type GallerySnapshot, type GalleryState, type GalleryStyle, type GenerateHandlerOptions, type GenerateJob, type GeneratePhase, GenerateRequestError, GenerateRequestSchema, type GenerateStatus, type Generator, GeneratorSchema, type GenericTileset, type GridConfidence, GridConfidenceSchema, HAND_EDIT_DIR, HISTORY_ENV, type HandEditCompanion, HandEditCompanionSchema, type HandEditMember, type HandEditSave, type HandEditSaveInput, type HandEditStart, type HandEditStatus, type HistoryPick, type ImageQualityMetrics, ImageQualityMetricsSchema, InheritedStyleSchema, type InstallRecipeOptions, type InstallRecipeResult, type JobState, type LoadedManifest, type LoadedRecipe, type Lock, type LockEntry, LockEntrySchema, type LockHistoryEntry, LockHistoryEntrySchema, type LockOutput, LockSchema, MAX_DOWNLOAD_BYTES, MAX_HAND_EDIT_BYTES, MAX_RETRIES, type ManagedArtifactBundleOptions, type Manifest, ManifestDriftError, type ManifestEdit, ManifestEditError, type ManifestEditResult, ManifestEditSchema, ManifestInputSchema, ManifestSchema, type MapObject, MediaType, type MountPlacement, type MountedSheet, type NormalizedTileRules, type OpenProjectOptions, type Orphan, type OrphanGroups, type OutputSelection, type OutputSource, OverwriteRefusedError, PIXEL_ART_FIXER_REVISION, PIXEL_ART_FIXER_URL, type PackedFrame, type PackedSheet, type PackedSource, type PendingQualityReview, type PickResult, type PixelArtFixerDetection, PixelKilnError, type PixelKilnErrorOptions, PixelLabClient, PixelLabError, type PixelLabObject, PixelLabProvider, type Plan, type PlanItem, type PlanState, type PollContext, type PollOptions, type PollResult, type Postprocess, PostprocessSchema, type PrepareReviewOptions, type Project, ProjectError, type Provider, ProviderError, type ProviderFactory, type ProviderInputContext, type ProviderInputScalar, type ProviderInputValue, type ProviderMetadata, type ProviderMode, type ProviderOptionContext, type ProviderSubmission, type QualityBaseline, QualityBaselineSchema, type QualityCheck, type QualityProfile, type QualityProfileInspection, QualityProfileSchema, type QualityProfileState, type QualityRegressionCaseResult, type QualityRegressionReport, type QualitySnapshotResult, QualityToleranceSchema, type QualityTolerances, type RateLimit, type Recipe, type RecipeFileVerification, type RecipeModelVerification, RecipeSchema, type RecipeVerification, type RefineAudit, type RefineFrameSetOptions, type RefineFrameSetResult, type RefineOptions, type RefineQualityProfilesOptions, type RefineQualityProfilesResult, type RefineRecordOptions, type RefineResult, type RemoteAsset, type RemoteHashCacheHealth, type RenderGalleryOptions, type RenderSheetOptions, type ResolvedOutput, type ResolvedProviderInputs, type ResolvedProviderOptions, type ResolvedQualityInput, type ResolvedQualityProfile, type ResolvedRevision, type ResolvedSpec, type ResolvedStyleImage, type ResumeAction, type ResumeCommand, type RetroDiffusionOptions, RetroDiffusionProvider, type RetryInit, type RetryOptions, type RetryingFetch, type RevertOptions, type RevertResult, type ReviewReadyInfo, type ReviewSession, type Revision, type RevisionMode, RevisionModeSchema, type RevisionReadiness, RevisionSchema, type SalvageAction, type SalvageResult, type ScannedAsset, type ScenarioOptions, ScenarioProvider, type SessionBudget, type SheetGroup, type SiblingManifest, type SpriteInput, type Style, type StyleAudit, type StyleInput, StyleInputSchema, StyleSchema, type SubmissionCheckpoint, type SubmitContext, type SubmitOptions, type SubmitResult, type TilesPro, type TilesetExport, type TilesetExportOptions, type TilesetFormat, UnsupportedCapabilityError, UsageError, type Workspace, type WorkspaceClaims, type WorkspaceDiagnostic, type WorkspaceProject, WorkspaceProjectSchema, type WorkspaceProjectStatus, WorkspaceSchema, type WorkspaceStatusReport, adopt, applyManifestEdit, applyTags, approveQualityRecord, auditStyle, availableProviders, backoffMs, buildGallerySnapshot, buildManifest, buildPlan, buildWorkspaceGallerySnapshot, bundledRecipeRoot, cacheFileName, candidateCount, checkQualityBaseline, checkQualityRecord, clientFromEnv, colorDistance, countNumberedDescriptions, createArtifactBundleManifest, createGalleryEditHandler, createGalleryEditorHandlers, createGenerateHandlers, createProvider, currentEntryOutputPath, currentOutputPath, defaultOpenCommand, detachHandEdit, detectMediaType, doctor, editorBaseUrl, editorDir, editorRoute, editorStatus, editorToolsRoot, errorCode, evaluateAudit, exitCodeFor, expectedOutputPath, exportTileset, fallbackOutputRole, fetchAssets, fetchWithRetry, findOrphans, formatCost, galleryMediaId, galleryMediaRoute, generationCost, groupOrphansByStyle, handEditBase, handEditBases, handEditCompanionPath, handEditMembers, handEditPath, handEditProjectPath, hex, historyAfterReplacing, historyLimit, idFromPrompt, imageMetadata, inspectCaches, inspectQualityProfile, inspectRevisionReadiness, installEditor, installRecipe, isFrameSetEntry, isMemberSetEntry, isSensitiveSourceUrl, listBundledRecipes, loadClaims, loadLock, loadManifest, loadSiblingManifests, loadWorkspace, lockKey, matchOrphanStyle, measureBalanceChange, measureDecodedImageQuality, measureImageQuality, mediaExtension, mediaTypeFromExtension, memberPath, mergePalettes, mountSprites, mountStyle, normalizeLockOutputPaths, normalizeRefinementPalette, normalizeTileRules, openExternal, openInEditor, openProject, outliers, outputId, packSprites, packStyle, paletteDistance, parseLock, parseWorkspace, pickHistory, pngSize, poll, portableOutputPath, prepareReview, primaryOutput, providerCredentialEnvs, providerFactory, pushTags, qualityFrameOutputPath, qualityRecordPath, quantizeToPalette, readArtifactBundleManifest, readHandEditCompanion, readQualityBaseline, recipeDigest, referencedHashes, refineAsset, refineFrameSet, refineQualityProfiles, registerProvider, remove, renderGallery, renderSalvageSheet, renderSheet, requireApprovedQualitySources, requireBalance, requireDelete, requireList, requireRevisionReady, requireSelectCandidate, resolveEntryOutputs, resolveOutputPath, resolvePackInputs, resolveProject, resolveQualityInputs, resolveRecipe, resolveSpecEntryOutputs, resolveSpecOutputs, resolveSpecs, resolveStyleImages, resolveStyleOutputs, resumeActions, resumeCommandForStatus, retireGeneration, retryAfterMs, revertGeneration, runPicker, runSalvage, saveHandEdit, saveLock, saveWorkspace, scanAssets, selectEntryOutput, serveGallery, sha256, sha256File, shouldPersistSourceUrl, shouldRetry, slugify, snapshotQualityBaseline, sourceIsStem, sourceOutputPath, specHash, spendByUnit, startHandEdit, styleImagesBase64, submit, summarize, tagAdopted, tileFeatureOutputCount, tileVariationCount, tilesCost, toPortablePath, totalSpend, upsert, validateCostEstimate, validateMedia, validateWorkspace, verifyArtifactBundle, verifyRecipe, withArtifactManifest, workspaceClaims, workspaceStatus, writeArtifactBundle, writeManagedArtifactBundle };