pixelkiln 0.121.0 → 0.122.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
@@ -1213,7 +1213,11 @@ declare const CharacterPortraitSchema: z.ZodObject<{
1213
1213
  /** The base or state to portray, in the same style. */
1214
1214
  of: z.ZodString;
1215
1215
  size: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<16>, z.ZodLiteral<32>, z.ZodLiteral<48>, z.ZodLiteral<64>, z.ZodLiteral<128>, z.ZodLiteral<160>]>>;
1216
- /** PixelLab's seed for this portrait, in place of the style's `seed`. Part of its identity. */
1216
+ /**
1217
+ * Refused when set. Given a seed, PixelLab ignores the character image and
1218
+ * draws a generic face, so a portrait is never sent one; the key stays so
1219
+ * the refusal can say why instead of "unrecognized key".
1220
+ */
1217
1221
  seed: z.ZodOptional<z.ZodNumber>;
1218
1222
  /**
1219
1223
  * Attach the drawn portrait to the parent's PixelLab character record, as
@@ -6159,7 +6163,11 @@ declare const AssetSchema: z.ZodEffects<z.ZodObject<{
6159
6163
  /** The base or state to portray, in the same style. */
6160
6164
  of: z.ZodString;
6161
6165
  size: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<16>, z.ZodLiteral<32>, z.ZodLiteral<48>, z.ZodLiteral<64>, z.ZodLiteral<128>, z.ZodLiteral<160>]>>;
6162
- /** PixelLab's seed for this portrait, in place of the style's `seed`. Part of its identity. */
6166
+ /**
6167
+ * Refused when set. Given a seed, PixelLab ignores the character image and
6168
+ * draws a generic face, so a portrait is never sent one; the key stays so
6169
+ * the refusal can say why instead of "unrecognized key".
6170
+ */
6163
6171
  seed: z.ZodOptional<z.ZodNumber>;
6164
6172
  /**
6165
6173
  * Attach the drawn portrait to the parent's PixelLab character record, as
@@ -9439,7 +9447,11 @@ declare const ManifestSchema: z.ZodObject<{
9439
9447
  /** The base or state to portray, in the same style. */
9440
9448
  of: z.ZodString;
9441
9449
  size: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<16>, z.ZodLiteral<32>, z.ZodLiteral<48>, z.ZodLiteral<64>, z.ZodLiteral<128>, z.ZodLiteral<160>]>>;
9442
- /** PixelLab's seed for this portrait, in place of the style's `seed`. Part of its identity. */
9450
+ /**
9451
+ * Refused when set. Given a seed, PixelLab ignores the character image and
9452
+ * draws a generic face, so a portrait is never sent one; the key stays so
9453
+ * the refusal can say why instead of "unrecognized key".
9454
+ */
9443
9455
  seed: z.ZodOptional<z.ZodNumber>;
9444
9456
  /**
9445
9457
  * Attach the drawn portrait to the parent's PixelLab character record, as
@@ -13749,7 +13761,11 @@ declare const ManifestInputSchema: z.ZodObject<{
13749
13761
  /** The base or state to portray, in the same style. */
13750
13762
  of: z.ZodString;
13751
13763
  size: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<16>, z.ZodLiteral<32>, z.ZodLiteral<48>, z.ZodLiteral<64>, z.ZodLiteral<128>, z.ZodLiteral<160>]>>;
13752
- /** PixelLab's seed for this portrait, in place of the style's `seed`. Part of its identity. */
13764
+ /**
13765
+ * Refused when set. Given a seed, PixelLab ignores the character image and
13766
+ * draws a generic face, so a portrait is never sent one; the key stays so
13767
+ * the refusal can say why instead of "unrecognized key".
13768
+ */
13753
13769
  seed: z.ZodOptional<z.ZodNumber>;
13754
13770
  /**
13755
13771
  * Attach the drawn portrait to the parent's PixelLab character record, as
@@ -26221,6 +26237,8 @@ interface RefineQualityProfilesOptions {
26221
26237
  interface RefineQualityProfilesResult {
26222
26238
  processed: number;
26223
26239
  skipped: number;
26240
+ /** Waiting on something else (output not made yet, a source not approved); not refined, not a failure. */
26241
+ blocked: number;
26224
26242
  failed: number;
26225
26243
  items: QualityProfileInspection[];
26226
26244
  }
package/dist/index.d.ts CHANGED
@@ -1213,7 +1213,11 @@ declare const CharacterPortraitSchema: z.ZodObject<{
1213
1213
  /** The base or state to portray, in the same style. */
1214
1214
  of: z.ZodString;
1215
1215
  size: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<16>, z.ZodLiteral<32>, z.ZodLiteral<48>, z.ZodLiteral<64>, z.ZodLiteral<128>, z.ZodLiteral<160>]>>;
1216
- /** PixelLab's seed for this portrait, in place of the style's `seed`. Part of its identity. */
1216
+ /**
1217
+ * Refused when set. Given a seed, PixelLab ignores the character image and
1218
+ * draws a generic face, so a portrait is never sent one; the key stays so
1219
+ * the refusal can say why instead of "unrecognized key".
1220
+ */
1217
1221
  seed: z.ZodOptional<z.ZodNumber>;
1218
1222
  /**
1219
1223
  * Attach the drawn portrait to the parent's PixelLab character record, as
@@ -6159,7 +6163,11 @@ declare const AssetSchema: z.ZodEffects<z.ZodObject<{
6159
6163
  /** The base or state to portray, in the same style. */
6160
6164
  of: z.ZodString;
6161
6165
  size: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<16>, z.ZodLiteral<32>, z.ZodLiteral<48>, z.ZodLiteral<64>, z.ZodLiteral<128>, z.ZodLiteral<160>]>>;
6162
- /** PixelLab's seed for this portrait, in place of the style's `seed`. Part of its identity. */
6166
+ /**
6167
+ * Refused when set. Given a seed, PixelLab ignores the character image and
6168
+ * draws a generic face, so a portrait is never sent one; the key stays so
6169
+ * the refusal can say why instead of "unrecognized key".
6170
+ */
6163
6171
  seed: z.ZodOptional<z.ZodNumber>;
6164
6172
  /**
6165
6173
  * Attach the drawn portrait to the parent's PixelLab character record, as
@@ -9439,7 +9447,11 @@ declare const ManifestSchema: z.ZodObject<{
9439
9447
  /** The base or state to portray, in the same style. */
9440
9448
  of: z.ZodString;
9441
9449
  size: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<16>, z.ZodLiteral<32>, z.ZodLiteral<48>, z.ZodLiteral<64>, z.ZodLiteral<128>, z.ZodLiteral<160>]>>;
9442
- /** PixelLab's seed for this portrait, in place of the style's `seed`. Part of its identity. */
9450
+ /**
9451
+ * Refused when set. Given a seed, PixelLab ignores the character image and
9452
+ * draws a generic face, so a portrait is never sent one; the key stays so
9453
+ * the refusal can say why instead of "unrecognized key".
9454
+ */
9443
9455
  seed: z.ZodOptional<z.ZodNumber>;
9444
9456
  /**
9445
9457
  * Attach the drawn portrait to the parent's PixelLab character record, as
@@ -13749,7 +13761,11 @@ declare const ManifestInputSchema: z.ZodObject<{
13749
13761
  /** The base or state to portray, in the same style. */
13750
13762
  of: z.ZodString;
13751
13763
  size: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<16>, z.ZodLiteral<32>, z.ZodLiteral<48>, z.ZodLiteral<64>, z.ZodLiteral<128>, z.ZodLiteral<160>]>>;
13752
- /** PixelLab's seed for this portrait, in place of the style's `seed`. Part of its identity. */
13764
+ /**
13765
+ * Refused when set. Given a seed, PixelLab ignores the character image and
13766
+ * draws a generic face, so a portrait is never sent one; the key stays so
13767
+ * the refusal can say why instead of "unrecognized key".
13768
+ */
13753
13769
  seed: z.ZodOptional<z.ZodNumber>;
13754
13770
  /**
13755
13771
  * Attach the drawn portrait to the parent's PixelLab character record, as
@@ -26221,6 +26237,8 @@ interface RefineQualityProfilesOptions {
26221
26237
  interface RefineQualityProfilesResult {
26222
26238
  processed: number;
26223
26239
  skipped: number;
26240
+ /** Waiting on something else (output not made yet, a source not approved); not refined, not a failure. */
26241
+ blocked: number;
26224
26242
  failed: number;
26225
26243
  items: QualityProfileInspection[];
26226
26244
  }
package/dist/index.js CHANGED
@@ -260,7 +260,11 @@ var CharacterPortraitSchema = z.object({
260
260
  /** The base or state to portray, in the same style. */
261
261
  of: z.string().min(1),
262
262
  size: CharacterPortraitSizeSchema.default(64),
263
- /** PixelLab's seed for this portrait, in place of the style's `seed`. Part of its identity. */
263
+ /**
264
+ * Refused when set. Given a seed, PixelLab ignores the character image and
265
+ * draws a generic face, so a portrait is never sent one; the key stays so
266
+ * the refusal can say why instead of "unrecognized key".
267
+ */
264
268
  seed: z.number().int().min(0).optional(),
265
269
  /**
266
270
  * Attach the drawn portrait to the parent's PixelLab character record, as
@@ -8840,7 +8844,8 @@ var PixelLabProvider = class _PixelLabProvider {
8840
8844
  image: { base64: bytes.toString("base64"), format: "png" },
8841
8845
  view: spec.view,
8842
8846
  resultSize: character.portrait.size,
8843
- seed: spec.seed,
8847
+ // No seed, ever, not even the style's: given one, PixelLab draws a generic face
8848
+ // and ignores the character image (measured, docs/ENDPOINTS.md, "Portrait seeds").
8844
8849
  targetPalette: targetPaletteFor(spec)
8845
8850
  });
8846
8851
  return {
@@ -8850,9 +8855,6 @@ var PixelLabProvider = class _PixelLabProvider {
8850
8855
  kind: "portrait",
8851
8856
  parentCharacterId: parentId,
8852
8857
  backgroundJobId: res2.background_job_id,
8853
- // PixelLab expires finished jobs within about a day, so the seed sent is kept here;
8854
- // poll replaces it with the one the job reports using.
8855
- ...spec.seed != null ? { seed: spec.seed } : {},
8856
8858
  ...character.portrait.attach ? {} : { attach: false }
8857
8859
  }
8858
8860
  }
@@ -9035,7 +9037,7 @@ var PixelLabProvider = class _PixelLabProvider {
9035
9037
  await this.client.setCharacterPortrait(attach, { base64: bytes.toString("base64"), format: "png" });
9036
9038
  }
9037
9039
  const { billed, lastResponse } = await this.readFinishedJob(meta?.backgroundJobId);
9038
- const seed = typeof lastResponse?.seed === "number" ? lastResponse.seed : meta?.seed;
9040
+ const seed = typeof lastResponse?.seed === "number" ? lastResponse.seed : void 0;
9039
9041
  return {
9040
9042
  status: "ready",
9041
9043
  objectId: jobId,
@@ -13774,6 +13776,11 @@ async function resolveSpecs(loaded, filter) {
13774
13776
  `assets.${assetId}: ${asset.portrait ? "portrait" : "outfit"} needs a character style; "${styleId}" generates ${generator}`
13775
13777
  );
13776
13778
  }
13779
+ if (asset.portrait?.seed !== void 0) {
13780
+ throw new Error(
13781
+ `assets.${assetId}.portrait.seed: PixelLab ignores the character and draws a generic face when a portrait is sent a seed (measured November 2026), so pixelkiln never sends one; remove it`
13782
+ );
13783
+ }
13777
13784
  if (asset.layer && generator !== "character") {
13778
13785
  throw new Error(`assets.${assetId}: layer needs a character style; "${styleId}" generates ${generator}`);
13779
13786
  }
@@ -13845,8 +13852,7 @@ async function resolveSpecs(loaded, filter) {
13845
13852
  outline: style.outline,
13846
13853
  shading: style.shading,
13847
13854
  detail: style.detail,
13848
- // A portrait may pin its own; it reaches the wire and the identity like the style's.
13849
- seed: asset.portrait?.seed ?? style.seed,
13855
+ seed: style.seed,
13850
13856
  uiPieces: generator === "uiAsset" ? asset.pieces : void 0,
13851
13857
  uiElements: generator === "uiAsset" ? asset.elements : void 0,
13852
13858
  uiColorPalette: generator === "uiAsset" || generator === "uiElement" ? style.uiColorPalette : void 0,
@@ -15892,12 +15898,18 @@ async function qualitySource(spec, lock) {
15892
15898
  return existsSync12(source) ? { items: [{ role: "source", path: source }] } : { items: null, reason: `declared source is missing: ${spec.source}` };
15893
15899
  }
15894
15900
  const entry = lock.entries[lockKey(spec.styleId, spec.assetId)];
15895
- if (!entry) return { items: null, reason: "raw provider output is not in the lockfile" };
15901
+ const what = spec.derive ? "derived output" : "raw provider output";
15902
+ if (!entry) {
15903
+ return {
15904
+ items: null,
15905
+ reason: spec.derive ? "derived output is not made yet; `pixelkiln gen` derives it once its source is ready" : `${what} is not in the lockfile`
15906
+ };
15907
+ }
15896
15908
  if (entry.specHash !== spec.specHash) {
15897
- return { items: null, reason: "raw provider output does not match the current generation spec" };
15909
+ return { items: null, reason: `${what} does not match the current generation spec` };
15898
15910
  }
15899
15911
  if (entry.status !== "downloaded") {
15900
- return { items: null, reason: `raw provider output is ${entry.status}, not downloaded` };
15912
+ return { items: null, reason: `${what} is ${entry.status}, not downloaded` };
15901
15913
  }
15902
15914
  const frameSet = spec.generator === "frames";
15903
15915
  if (!frameSet && entry.outputs.length !== 1 || frameSet && entry.outputs.length < 2) {
@@ -16020,7 +16032,7 @@ async function refineQualityProfiles(specs, lock, options = {}) {
16020
16032
  if (!configured.length) {
16021
16033
  throw new Error("No selected style has a quality profile.");
16022
16034
  }
16023
- const result = { processed: 0, skipped: 0, failed: 0, items: [] };
16035
+ const result = { processed: 0, skipped: 0, blocked: 0, failed: 0, items: [] };
16024
16036
  for (const spec of configured) {
16025
16037
  const inspection = await inspectQualityProfile(spec, lock);
16026
16038
  if (!options.force && (inspection.state === "approved" || inspection.state === "needs-approval")) {
@@ -16029,7 +16041,7 @@ async function refineQualityProfiles(specs, lock, options = {}) {
16029
16041
  continue;
16030
16042
  }
16031
16043
  if (inspection.state === "blocked") {
16032
- result.failed++;
16044
+ result.blocked++;
16033
16045
  result.items.push(inspection);
16034
16046
  continue;
16035
16047
  }
@@ -21257,7 +21269,8 @@ function renderSheetDocument(format, atlas, opts) {
21257
21269
  var IN_FLIGHT_POLL_MS = 5e3;
21258
21270
  var sleep = (ms) => new Promise((r) => setTimeout(r, ms));
21259
21271
  async function submit(provider, loaded, items, lock, lockPath, opts = {}) {
21260
- const limits = provider.rateLimit?.() ?? DEFAULT_RATE_LIMIT;
21272
+ const local = (spec) => Boolean(spec.mirror || spec.derive || isHeldItem(spec));
21273
+ const limits = items.every((item) => local(item.spec)) ? DEFAULT_RATE_LIMIT : provider.rateLimit?.() ?? DEFAULT_RATE_LIMIT;
21261
21274
  const maxInFlight = opts.maxInFlight ?? limits.maxInFlight;
21262
21275
  const spacing = opts.spacingMs ?? limits.spacingMs;
21263
21276
  const slotPollMs = opts.slotPollMs ?? IN_FLIGHT_POLL_MS;
@@ -21266,7 +21279,7 @@ async function submit(provider, loaded, items, lock, lockPath, opts = {}) {
21266
21279
  });
21267
21280
  const estimates = new Map(items.map((item) => [
21268
21281
  item.key,
21269
- item.spec.mirror || item.spec.derive || isHeldItem(item.spec) ? { amount: 0, unit: item.spec.costUnit, candidates: 1 } : validateCostEstimate(provider.id, provider.estimate(item.spec))
21282
+ local(item.spec) ? { amount: 0, unit: item.spec.costUnit, candidates: 1 } : validateCostEstimate(provider.id, provider.estimate(item.spec))
21270
21283
  ]));
21271
21284
  const units = new Set(items.filter((item) => !item.spec.derive).map((item) => estimates.get(item.key).unit));
21272
21285
  if (units.size > 1) {