@officexapp/vidfarm-devcli 0.21.35 → 0.21.36

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.
@@ -22,7 +22,8 @@
22
22
  // Both builders return plain text meant to be shown verbatim to the user, plus a
23
23
  // structured form for `--json` so an agent can render it its own way. No network,
24
24
  // no backend imports — this module is pure string assembly.
25
- import { pickPlateColor, keySafeArtInstruction } from "./sticker-pack.js";
25
+ import { pickPlateColor, connectivitySafeArtInstruction } from "./sticker-pack.js";
26
+ import { planZonedSheet, zonedSheetInstruction } from "./plate-key.js";
26
27
  const DEFAULT_STYLE = "simple flat vector illustration, minimal detail, 2-3 flat colors, no shadows, no text";
27
28
  /** Pick a sensible grid for N items (roughly square, wider than tall). */
28
29
  function gridFor(count) {
@@ -56,46 +57,66 @@ export function buildImageHandoff(input) {
56
57
  const pack = input.pack ?? items.length > 1;
57
58
  const outDir = input.outDir ?? "./stickers";
58
59
  const grid = input.grid ?? gridFor(items.length || 6);
59
- const prompt = pack
60
+ // ZONED sheet: hand the user a color-block grid instead of one plate. Worth it
61
+ // when the pack's own colors fight a single plate (a green frog next to a pink
62
+ // flower), because each panel's color is picked against its own item.
63
+ const zonePlan = pack && input.zoned ? planZonedSheet(items, items.length || 6, pickPlateColor, { theme: input.theme }) : null;
64
+ const prompt = zonePlan
60
65
  ? [
61
- `A sticker sheet of ${items.length || "several"} separate objects — ${style} — on a solid pure ${keyColor} background`,
62
- `(flat, evenly lit, no gradient, no shadow, no text, no labels, no frames or dividing lines).`,
63
- `Theme: ${input.theme}.`,
64
- items.length
65
- ? `Arranged in a ${grid} grid with generous even spacing: ${items.map((it, i) => `(${i + 1}) ${it}`).join(", ")}.`
66
- : `Arranged in a ${grid} grid with generous even spacing.`,
67
- `CRITICAL: every object must be fully separated from the others by a clear margin of plain ${keyColor} background —`,
68
- `nothing touching, overlapping or connected, and nothing touching the image edge.`,
69
- `One consistent art style, line weight and palette across all objects. Front-facing, centered in its own cell.`,
70
- // Load-bearing: the user is about to spend their own time on this sheet,
71
- // and hollow/outline-only art comes back as rims around holes.
72
- keySafeArtInstruction(keyColor),
66
+ `${input.theme} — ${style}.`,
67
+ zonedSheetInstruction(zonePlan, { theme: input.theme }),
73
68
  `Square image, high resolution.`
74
69
  ].join(" ")
75
- : [
76
- `${input.theme} — ${style} — isolated on a solid pure ${keyColor} background`,
77
- `(flat, evenly lit, no gradient, no shadow cast on the background, no text).`,
78
- `Center the subject with generous empty margin on all sides, crisp clean edges, single subject.`,
79
- keySafeArtInstruction(keyColor),
80
- `Square image, high resolution.`
81
- ].join(" ");
82
- const steps = pack
70
+ : pack
71
+ ? [
72
+ `A sticker sheet of ${items.length || "several"} separate objects — ${style} — on a solid pure ${keyColor} background`,
73
+ `(flat, evenly lit, no gradient, no shadow, no text, no labels, no frames or dividing lines).`,
74
+ `Theme: ${input.theme}.`,
75
+ items.length
76
+ ? `Arranged in a ${grid} grid with generous even spacing: ${items.map((it, i) => `(${i + 1}) ${it}`).join(", ")}.`
77
+ : `Arranged in a ${grid} grid with generous even spacing.`,
78
+ `CRITICAL: every object must be fully separated from the others by a clear margin of plain ${keyColor} background —`,
79
+ `nothing touching, overlapping or connected, and nothing touching the image edge.`,
80
+ `One consistent art style, line weight and palette across all objects. Front-facing, centered in its own cell.`,
81
+ // The local cut uses the smart (connectivity) keyer, so hollow shapes and
82
+ // plate-colored detail sealed inside an object are fine — only the
83
+ // silhouette has to stay distinguishable from the plate.
84
+ connectivitySafeArtInstruction(keyColor),
85
+ `Square image, high resolution.`
86
+ ].join(" ")
87
+ : [
88
+ `${input.theme} — ${style} — isolated on a solid pure ${keyColor} background`,
89
+ `(flat, evenly lit, no gradient, no shadow cast on the background, no text).`,
90
+ `Center the subject with generous empty margin on all sides, crisp clean edges, single subject.`,
91
+ connectivitySafeArtInstruction(keyColor),
92
+ `Square image, high resolution.`
93
+ ].join(" ");
94
+ const steps = zonePlan
83
95
  ? [
84
96
  "Open a FREE image generator you're already signed into (list below).",
85
- "Paste the prompt below and generate. Two checks before you send it back: (a) if any two objects are touching, re-generate asking for wider spacing touching objects get cut out as ONE sticker; (b) if any object is a hollow outline with the background showing through its middle, re-generate asking for solid fills that interior gets deleted with the background and the sticker ends up as a rim around a hole.",
97
+ "Paste the prompt below and generate. One check before you send it back: the image should be a grid of solid COLOR PANELS, one object per panel, no object crossing a panel edge and none touching its panel's edge. If the tool ignored the panels and drew one background instead, send it anyway I'll cut it the simple way.",
86
98
  "Download the image (PNG preferred) and tell me the file path — or drop it in this project folder.",
87
- `I'll split it into individual transparent stickers locally for $0: \`vidfarm sticker-pack <sheet> --out-dir ${outDir}\`.`
99
+ `I'll cut each panel with its own background color locally for $0: \`vidfarm sticker-pack <sheet> --zones ${zonePlan.rows}x${zonePlan.cols} --out-dir ${outDir}\`.`
88
100
  ]
89
- : [
90
- "Open a FREE image generator you're already signed into (list below).",
91
- "Paste the prompt below and generate.",
92
- "Download the image (PNG preferred) and tell me the file path.",
93
- "I'll key the background out and trim it to a snug transparent sticker locally for $0: `vidfarm cutout <file>`."
94
- ];
101
+ : pack
102
+ ? [
103
+ "Open a FREE image generator you're already signed into (list below).",
104
+ "Paste the prompt below and generate. Two checks before you send it back: (a) if any two objects are touching, re-generate asking for wider spacing — touching objects get cut out as ONE sticker; (b) make sure no object's outer edge blurs, glows or fades into the background — a crisp edge is what the cut needs.",
105
+ "Download the image (PNG preferred) and tell me the file path or drop it in this project folder.",
106
+ `I'll split it into individual transparent stickers locally for $0: \`vidfarm sticker-pack <sheet> --out-dir ${outDir}\`.`
107
+ ]
108
+ : [
109
+ "Open a FREE image generator you're already signed into (list below).",
110
+ "Paste the prompt below and generate.",
111
+ "Download the image (PNG preferred) and tell me the file path.",
112
+ "I'll key the background out and trim it to a snug transparent sticker locally for $0: `vidfarm cutout <file>`."
113
+ ];
95
114
  const keyFlag = keyColor === "#00FF00" ? "" : ` --key-color "${keyColor}"`;
96
- const followUp = pack
97
- ? `vidfarm sticker-pack <downloaded-sheet.png>${items.length ? ` --items "${items.join(",")}"` : ""}${keyFlag} --out-dir ${outDir}`
98
- : `vidfarm cutout <downloaded.png>${keyFlag}`;
115
+ const followUp = zonePlan
116
+ ? `vidfarm sticker-pack <downloaded-sheet.png>${items.length ? ` --items "${items.join(",")}"` : ""} --zones ${zonePlan.rows}x${zonePlan.cols} --out-dir ${outDir}`
117
+ : pack
118
+ ? `vidfarm sticker-pack <downloaded-sheet.png>${items.length ? ` --items "${items.join(",")}"` : ""}${keyFlag} --out-dir ${outDir}`
119
+ : `vidfarm cutout <downloaded.png>${keyFlag}`;
99
120
  return {
100
121
  prompt,
101
122
  steps,