@koda-sl/baker-cli 0.184.0-dev.0155730c3 → 0.185.2

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,
@@ -3760,7 +3760,9 @@ var tagInputResultSchema = z13.discriminatedUnion("status", [
3760
3760
  }),
3761
3761
  z13.object({
3762
3762
  status: z13.literal("declined"),
3763
- reason: z13.string().optional()
3763
+ reason: z13.string().optional(),
3764
+ /** Set when the platform could not apply an approved change, rather than the user skipping it. */
3765
+ failed: z13.boolean().optional()
3764
3766
  })
3765
3767
  ]);
3766
3768
  var tagChangeToolResultSchema = z13.object({
@@ -34671,6 +34673,12 @@ function projectBatch(generation, full) {
34671
34673
  createdAt: generation.createdAt
34672
34674
  };
34673
34675
  }
34676
+ function slotArg(candidates) {
34677
+ return candidates.length === 1 ? `--slot ${candidates[0]?.slot}` : "--slot <n>";
34678
+ }
34679
+ function chooseFirst(candidates) {
34680
+ return candidates.length === 1 ? "" : " Look at the takes and pick one \u2014 do not default to the first.";
34681
+ }
34674
34682
  function batchHints(generation) {
34675
34683
  const id = generation.generationId;
34676
34684
  if (generation.status === "running") {
@@ -34686,13 +34694,13 @@ function batchHints(generation) {
34686
34694
  '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
34695
  );
34688
34696
  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.`
34697
+ `Mark the take you are using: \`baker studio keep ${id} ${slotArg(ready)}\` stars it so the client reviews the right one.${chooseFirst(ready)}`
34690
34698
  );
34691
34699
  }
34692
34700
  const unkeptClips = ready.filter((variant) => !variant.inLibrary);
34693
34701
  if (generation.kind === "video" && unkeptClips.length > 0) {
34694
34702
  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.`
34703
+ `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
34704
  );
34697
34705
  }
34698
34706
  if (generation.status === "partial" && failed.length > 0) {
@@ -35229,6 +35237,15 @@ function referenceLimitFor(model) {
35229
35237
  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
35238
  };
35231
35239
  }
35240
+ async function effectiveModel(pinned, skillId, fetchSkills = () => apiGet("/api/studio/skills")) {
35241
+ if (pinned || !skillId) return pinned;
35242
+ try {
35243
+ const { skills } = await fetchSkills();
35244
+ return skills.find((skill) => skill.id === skillId)?.defaults.model;
35245
+ } catch {
35246
+ return void 0;
35247
+ }
35248
+ }
35232
35249
  function buildGenerateBody(args, prompt) {
35233
35250
  const body = { prompt };
35234
35251
  if (args.model) body.model = args.model;
@@ -35293,7 +35310,8 @@ var generateCommand = defineCommand164({
35293
35310
  }
35294
35311
  const body = buildGenerateBody(args, prompt);
35295
35312
  if (args.reference) {
35296
- const { imageIds } = await resolveLibraryImageIds(args.reference, referenceLimitFor(body.model));
35313
+ const model = await effectiveModel(body.model, body.skillId);
35314
+ const { imageIds } = await resolveLibraryImageIds(args.reference, referenceLimitFor(model));
35297
35315
  if (imageIds.length > 0) body.referenceImageIds = imageIds;
35298
35316
  }
35299
35317
  const start = await apiPost("/api/studio/generate", body);