@koda-sl/baker-cli 0.434.0-dev.b788a58e0 → 0.434.0-dev.e6bd6f23c

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/cli.js CHANGED
@@ -75621,8 +75621,7 @@ async function recordRendered(canvasRoot, slug, sourceSha, runId, drawn = {}) {
75621
75621
  rendered: { sourceSha, runId, at: Date.now() },
75622
75622
  ...drawn.prompt !== void 0 ? { prompt: drawn.prompt } : {},
75623
75623
  lastFix: drawn.lastFix,
75624
- picture: drawn.picture,
75625
- ...drawn.seriesLeadRun ? { seriesLeadRun: drawn.seriesLeadRun } : {}
75624
+ picture: drawn.picture
75626
75625
  });
75627
75626
  }
75628
75627
  async function recordReviewOutcome(canvasRoot, slug, outcome2) {
@@ -77202,8 +77201,7 @@ async function writeSeriesMemberCanvas(root, slug, opts = {}) {
77202
77201
  const before = await readFile20(file, "utf8").catch(() => null);
77203
77202
  const leadDesign = seriesDesignOf(version.spec);
77204
77203
  const ownDesign = seriesDesignOf(memberSpec);
77205
- const previous = before ? JSON.parse(before).metadata?.series : void 0;
77206
- const synced = previous?.design;
77204
+ const synced = before ? JSON.parse(before).metadata?.series?.design : void 0;
77207
77205
  let designFromLead = false;
77208
77206
  if (leadDesign !== null && ownDesign !== null && ownDesign !== leadDesign) {
77209
77207
  if (!opts.takeLeadDesign && ownDesign !== synced) {
@@ -77225,9 +77223,7 @@ async function writeSeriesMemberCanvas(root, slug, opts = {}) {
77225
77223
  const text4 = `${JSON.stringify(canvas, null, 2)}
77226
77224
  `;
77227
77225
  if (before !== text4) await writeFile11(file, text4, "utf8");
77228
- const madeFrom = (await readRenderState(path26.join(root, "canvas"), slug)).seriesLeadRun;
77229
- const newLeadVersion = madeFrom !== void 0 && madeFrom !== version.lead.runId;
77230
- return { lead, leadRunId: version.lead.runId, canvasPath: file, written: before !== text4, designFromLead, newLeadVersion };
77226
+ return { lead, leadRunId: version.lead.runId, canvasPath: file, written: before !== text4, designFromLead };
77231
77227
  }
77232
77228
  function seriesRunHints(slug, series) {
77233
77229
  if (series.lead) {
@@ -79233,22 +79229,21 @@ async function executeSeriesRun(lead) {
79233
79229
  }
79234
79230
  async function refreshSeriesAd(opts) {
79235
79231
  const slug = opts.slug ?? (opts.file ? creativeSlugFromCanvasPath(path32.resolve(opts.file)) : null);
79236
- if (!slug) return false;
79232
+ if (!slug) return;
79237
79233
  const root = findWorkspaceRoot(opts.file ? path32.dirname(path32.resolve(opts.file)) : process.cwd());
79238
- if (!root) return false;
79234
+ if (!root) return;
79239
79235
  const made = await writeSeriesMemberCanvas(root, slug);
79240
- if (made === null) return false;
79236
+ if (made === null) return;
79241
79237
  if ("refused" in made) failPreflight3(made.refused.code, made.refused.message, made.refused.fix);
79242
79238
  process.stdout.write(
79243
79239
  `[series] ${slug} is the lead ${made.lead}'s version ${made.leadRunId} with this ad's words${made.written ? " (canvas written)" : ""}
79244
79240
  `
79245
79241
  );
79246
- return made.newLeadVersion;
79247
79242
  }
79248
79243
  var canvasHeld = false;
79249
79244
  async function executeCanvasRun(opts) {
79250
79245
  const startedAt = opts.autoFixStartedAt ?? Date.now();
79251
- const newAsk = (opts.autoFixRound ?? 0) === 0 ? await refreshSeriesAd(opts) : false;
79246
+ if ((opts.autoFixRound ?? 0) === 0) await refreshSeriesAd(opts);
79252
79247
  const { canvasPath: filePath, adoptRunId } = await canvasFileFor(opts);
79253
79248
  const canvasRoot = canvasOutputsRoot(filePath);
79254
79249
  const creativeSlug = creativeSlugFromCanvasPath(filePath) ?? void 0;
@@ -79602,8 +79597,7 @@ ${describeRewrites(prepared.rewrites)}
79602
79597
  // taken after the preflight wrote the projected graph, so the two are comparable.
79603
79598
  sourceSha,
79604
79599
  chatId: optionalChatId(),
79605
- canvasSnapshotUrl: snapshot?.url,
79606
- ...newAsk ? { newAsk: true } : {}
79600
+ canvasSnapshotUrl: snapshot?.url
79607
79601
  };
79608
79602
  if (client) {
79609
79603
  const registered = await postInitialRunRecord(client, buildInitialRunRecord(runId, recordMeta));
@@ -79660,7 +79654,6 @@ ${describeRewrites(prepared.rewrites)}
79660
79654
  if (creativeSlug) {
79661
79655
  await recordRendered(canvasRoot, creativeSlug, sourceSha, result.run_id, {
79662
79656
  ...promptNow ? { prompt: promptNow } : {},
79663
- ...seriesOf(parsed)?.run_id ? { seriesLeadRun: seriesOf(parsed)?.run_id } : {},
79664
79657
  picture: pictureRecord(result.run_id, {
79665
79658
  chose: opts.useVariant !== void 0,
79666
79659
  of: shown.picture,