pixelkiln 0.121.0 → 0.121.1

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.cjs CHANGED
@@ -758,7 +758,11 @@ var CharacterPortraitSchema = import_zod.z.object({
758
758
  /** The base or state to portray, in the same style. */
759
759
  of: import_zod.z.string().min(1),
760
760
  size: CharacterPortraitSizeSchema.default(64),
761
- /** PixelLab's seed for this portrait, in place of the style's `seed`. Part of its identity. */
761
+ /**
762
+ * Refused when set. Given a seed, PixelLab ignores the character image and
763
+ * draws a generic face, so a portrait is never sent one; the key stays so
764
+ * the refusal can say why instead of "unrecognized key".
765
+ */
762
766
  seed: import_zod.z.number().int().min(0).optional(),
763
767
  /**
764
768
  * Attach the drawn portrait to the parent's PixelLab character record, as
@@ -9338,7 +9342,8 @@ var PixelLabProvider = class _PixelLabProvider {
9338
9342
  image: { base64: bytes.toString("base64"), format: "png" },
9339
9343
  view: spec.view,
9340
9344
  resultSize: character.portrait.size,
9341
- seed: spec.seed,
9345
+ // No seed, ever, not even the style's: given one, PixelLab draws a generic face
9346
+ // and ignores the character image (measured, docs/ENDPOINTS.md, "Portrait seeds").
9342
9347
  targetPalette: targetPaletteFor(spec)
9343
9348
  });
9344
9349
  return {
@@ -9348,9 +9353,6 @@ var PixelLabProvider = class _PixelLabProvider {
9348
9353
  kind: "portrait",
9349
9354
  parentCharacterId: parentId,
9350
9355
  backgroundJobId: res2.background_job_id,
9351
- // PixelLab expires finished jobs within about a day, so the seed sent is kept here;
9352
- // poll replaces it with the one the job reports using.
9353
- ...spec.seed != null ? { seed: spec.seed } : {},
9354
9356
  ...character.portrait.attach ? {} : { attach: false }
9355
9357
  }
9356
9358
  }
@@ -9533,7 +9535,7 @@ var PixelLabProvider = class _PixelLabProvider {
9533
9535
  await this.client.setCharacterPortrait(attach, { base64: bytes.toString("base64"), format: "png" });
9534
9536
  }
9535
9537
  const { billed, lastResponse } = await this.readFinishedJob(meta?.backgroundJobId);
9536
- const seed = typeof lastResponse?.seed === "number" ? lastResponse.seed : meta?.seed;
9538
+ const seed = typeof lastResponse?.seed === "number" ? lastResponse.seed : void 0;
9537
9539
  return {
9538
9540
  status: "ready",
9539
9541
  objectId: jobId,
@@ -14272,6 +14274,11 @@ async function resolveSpecs(loaded, filter) {
14272
14274
  `assets.${assetId}: ${asset.portrait ? "portrait" : "outfit"} needs a character style; "${styleId}" generates ${generator}`
14273
14275
  );
14274
14276
  }
14277
+ if (asset.portrait?.seed !== void 0) {
14278
+ throw new Error(
14279
+ `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`
14280
+ );
14281
+ }
14275
14282
  if (asset.layer && generator !== "character") {
14276
14283
  throw new Error(`assets.${assetId}: layer needs a character style; "${styleId}" generates ${generator}`);
14277
14284
  }
@@ -14343,8 +14350,7 @@ async function resolveSpecs(loaded, filter) {
14343
14350
  outline: style.outline,
14344
14351
  shading: style.shading,
14345
14352
  detail: style.detail,
14346
- // A portrait may pin its own; it reaches the wire and the identity like the style's.
14347
- seed: asset.portrait?.seed ?? style.seed,
14353
+ seed: style.seed,
14348
14354
  uiPieces: generator === "uiAsset" ? asset.pieces : void 0,
14349
14355
  uiElements: generator === "uiAsset" ? asset.elements : void 0,
14350
14356
  uiColorPalette: generator === "uiAsset" || generator === "uiElement" ? style.uiColorPalette : void 0,
@@ -16390,12 +16396,18 @@ async function qualitySource(spec, lock) {
16390
16396
  return (0, import_node_fs14.existsSync)(source) ? { items: [{ role: "source", path: source }] } : { items: null, reason: `declared source is missing: ${spec.source}` };
16391
16397
  }
16392
16398
  const entry = lock.entries[lockKey(spec.styleId, spec.assetId)];
16393
- if (!entry) return { items: null, reason: "raw provider output is not in the lockfile" };
16399
+ const what = spec.derive ? "derived output" : "raw provider output";
16400
+ if (!entry) {
16401
+ return {
16402
+ items: null,
16403
+ reason: spec.derive ? "derived output is not made yet; `pixelkiln gen` derives it once its source is ready" : `${what} is not in the lockfile`
16404
+ };
16405
+ }
16394
16406
  if (entry.specHash !== spec.specHash) {
16395
- return { items: null, reason: "raw provider output does not match the current generation spec" };
16407
+ return { items: null, reason: `${what} does not match the current generation spec` };
16396
16408
  }
16397
16409
  if (entry.status !== "downloaded") {
16398
- return { items: null, reason: `raw provider output is ${entry.status}, not downloaded` };
16410
+ return { items: null, reason: `${what} is ${entry.status}, not downloaded` };
16399
16411
  }
16400
16412
  const frameSet = spec.generator === "frames";
16401
16413
  if (!frameSet && entry.outputs.length !== 1 || frameSet && entry.outputs.length < 2) {
@@ -16518,7 +16530,7 @@ async function refineQualityProfiles(specs, lock, options = {}) {
16518
16530
  if (!configured.length) {
16519
16531
  throw new Error("No selected style has a quality profile.");
16520
16532
  }
16521
- const result = { processed: 0, skipped: 0, failed: 0, items: [] };
16533
+ const result = { processed: 0, skipped: 0, blocked: 0, failed: 0, items: [] };
16522
16534
  for (const spec of configured) {
16523
16535
  const inspection = await inspectQualityProfile(spec, lock);
16524
16536
  if (!options.force && (inspection.state === "approved" || inspection.state === "needs-approval")) {
@@ -16527,7 +16539,7 @@ async function refineQualityProfiles(specs, lock, options = {}) {
16527
16539
  continue;
16528
16540
  }
16529
16541
  if (inspection.state === "blocked") {
16530
- result.failed++;
16542
+ result.blocked++;
16531
16543
  result.items.push(inspection);
16532
16544
  continue;
16533
16545
  }
@@ -21755,7 +21767,8 @@ function renderSheetDocument(format, atlas, opts) {
21755
21767
  var IN_FLIGHT_POLL_MS = 5e3;
21756
21768
  var sleep = (ms) => new Promise((r) => setTimeout(r, ms));
21757
21769
  async function submit(provider, loaded, items, lock, lockPath, opts = {}) {
21758
- const limits = provider.rateLimit?.() ?? DEFAULT_RATE_LIMIT;
21770
+ const local = (spec) => Boolean(spec.mirror || spec.derive || isHeldItem(spec));
21771
+ const limits = items.every((item) => local(item.spec)) ? DEFAULT_RATE_LIMIT : provider.rateLimit?.() ?? DEFAULT_RATE_LIMIT;
21759
21772
  const maxInFlight = opts.maxInFlight ?? limits.maxInFlight;
21760
21773
  const spacing = opts.spacingMs ?? limits.spacingMs;
21761
21774
  const slotPollMs = opts.slotPollMs ?? IN_FLIGHT_POLL_MS;
@@ -21764,7 +21777,7 @@ async function submit(provider, loaded, items, lock, lockPath, opts = {}) {
21764
21777
  });
21765
21778
  const estimates = new Map(items.map((item) => [
21766
21779
  item.key,
21767
- item.spec.mirror || item.spec.derive || isHeldItem(item.spec) ? { amount: 0, unit: item.spec.costUnit, candidates: 1 } : validateCostEstimate(provider.id, provider.estimate(item.spec))
21780
+ local(item.spec) ? { amount: 0, unit: item.spec.costUnit, candidates: 1 } : validateCostEstimate(provider.id, provider.estimate(item.spec))
21768
21781
  ]));
21769
21782
  const units = new Set(items.filter((item) => !item.spec.derive).map((item) => estimates.get(item.key).unit));
21770
21783
  if (units.size > 1) {