@koda-sl/baker-cli 0.184.0-dev.0155730c3 → 0.185.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/cli.js CHANGED
@@ -46,7 +46,7 @@ import {
46
46
  toModelSafeImage,
47
47
  ulid,
48
48
  validateCanvasDeep
49
- } from "./chunk-PJ5KH27L.js";
49
+ } from "./chunk-3TXZKSAR.js";
50
50
  import {
51
51
  csvOrJson,
52
52
  daysAgoIso,
@@ -34671,6 +34671,12 @@ function projectBatch(generation, full) {
34671
34671
  createdAt: generation.createdAt
34672
34672
  };
34673
34673
  }
34674
+ function slotArg(candidates) {
34675
+ return candidates.length === 1 ? `--slot ${candidates[0]?.slot}` : "--slot <n>";
34676
+ }
34677
+ function chooseFirst(candidates) {
34678
+ return candidates.length === 1 ? "" : " Look at the takes and pick one \u2014 do not default to the first.";
34679
+ }
34674
34680
  function batchHints(generation) {
34675
34681
  const id = generation.generationId;
34676
34682
  if (generation.status === "running") {
@@ -34686,13 +34692,13 @@ function batchHints(generation) {
34686
34692
  'Every rendered image is already in the media library and searchable \u2014 `baker images library "<what it shows>"` finds it, and you can use its image id straight away.'
34687
34693
  );
34688
34694
  hints.push(
34689
- `Mark the take you are using: \`baker studio keep ${id} --slot ${ready[0]?.slot ?? 0}\` stars it so the client reviews the right one.`
34695
+ `Mark the take you are using: \`baker studio keep ${id} ${slotArg(ready)}\` stars it so the client reviews the right one.${chooseFirst(ready)}`
34690
34696
  );
34691
34697
  }
34692
34698
  const unkeptClips = ready.filter((variant) => !variant.inLibrary);
34693
34699
  if (generation.kind === "video" && unkeptClips.length > 0) {
34694
34700
  hints.push(
34695
- `A clip is not usable anywhere \u2014 canvas, landing, ad \u2014 until you keep it. \`baker studio keep ${id} --slot ${unkeptClips[0]?.slot ?? 0}\` puts it in the video library; takes nobody keeps are never ingested.`
34701
+ `A clip is not usable anywhere \u2014 canvas, landing, ad \u2014 until you keep it. \`baker studio keep ${id} ${slotArg(unkeptClips)}\` puts it in the video library; takes nobody keeps are never ingested.${chooseFirst(unkeptClips)}`
34696
34702
  );
34697
34703
  }
34698
34704
  if (generation.status === "partial" && failed.length > 0) {
@@ -35229,6 +35235,15 @@ function referenceLimitFor(model) {
35229
35235
  refuse: (count) => max === 1 ? `${label} takes exactly one reference image \u2014 you passed ${count}. Pick the one that matters, or switch to a model that reads several.` : `${label} takes up to ${max} reference images \u2014 you passed ${count}. Drop the weakest ones.`
35230
35236
  };
35231
35237
  }
35238
+ async function effectiveModel(pinned, skillId, fetchSkills = () => apiGet("/api/studio/skills")) {
35239
+ if (pinned || !skillId) return pinned;
35240
+ try {
35241
+ const { skills } = await fetchSkills();
35242
+ return skills.find((skill) => skill.id === skillId)?.defaults.model;
35243
+ } catch {
35244
+ return void 0;
35245
+ }
35246
+ }
35232
35247
  function buildGenerateBody(args, prompt) {
35233
35248
  const body = { prompt };
35234
35249
  if (args.model) body.model = args.model;
@@ -35293,7 +35308,8 @@ var generateCommand = defineCommand164({
35293
35308
  }
35294
35309
  const body = buildGenerateBody(args, prompt);
35295
35310
  if (args.reference) {
35296
- const { imageIds } = await resolveLibraryImageIds(args.reference, referenceLimitFor(body.model));
35311
+ const model = await effectiveModel(body.model, body.skillId);
35312
+ const { imageIds } = await resolveLibraryImageIds(args.reference, referenceLimitFor(model));
35297
35313
  if (imageIds.length > 0) body.referenceImageIds = imageIds;
35298
35314
  }
35299
35315
  const start = await apiPost("/api/studio/generate", body);