@koda-sl/baker-cli 0.292.0-dev.1d5970764 → 0.294.0-dev.97421c92b
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 +48 -3
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -29824,7 +29824,7 @@ var VIDEO_ROUTING = "In video, a photoreal presenter renders on `google/veo-3.1`
|
|
|
29824
29824
|
function castingHints(avatar) {
|
|
29825
29825
|
if (avatar.status === "generating") {
|
|
29826
29826
|
return [
|
|
29827
|
-
`Still building
|
|
29827
|
+
`Still building \u2014 a ~30s render that settles on its own, and this avatar is castable only once it reads \`ready\`. If the next thing you do needs it (a clip, a still, anything with --avatar), block on it: \`baker avatars get ${avatar.handle} --wait\` returns the moment it is ready. Otherwise do other work first and read it back with \`baker avatars get ${avatar.handle}\`. Never write your own sleep or poll loop, and never end the turn waiting \u2014 the user would have to come back and tell you it is ready.`
|
|
29828
29828
|
];
|
|
29829
29829
|
}
|
|
29830
29830
|
if (avatar.status === "error") {
|
|
@@ -30282,6 +30282,28 @@ var deleteCommand = defineCommand97({
|
|
|
30282
30282
|
|
|
30283
30283
|
// src/commands/avatars/get.ts
|
|
30284
30284
|
import { defineCommand as defineCommand98 } from "citty";
|
|
30285
|
+
|
|
30286
|
+
// src/commands/avatars/wait.ts
|
|
30287
|
+
var WAIT_TIMEOUT_MS = 9e4;
|
|
30288
|
+
var WAIT_INTERVAL_MS = 3e3;
|
|
30289
|
+
function shouldKeepWaiting(status, elapsedMs) {
|
|
30290
|
+
if (status === "ready") return { done: true, reason: "ready" };
|
|
30291
|
+
if (status === "error" || status === "archived") return { done: true, reason: "settled" };
|
|
30292
|
+
if (elapsedMs >= WAIT_TIMEOUT_MS) return { done: false, reason: "expired" };
|
|
30293
|
+
return { done: false, reason: "building" };
|
|
30294
|
+
}
|
|
30295
|
+
async function waitForSheet(first, read, sleep4 = (ms) => new Promise((resolve5) => setTimeout(resolve5, ms))) {
|
|
30296
|
+
const startedAt = Date.now();
|
|
30297
|
+
let latest = first;
|
|
30298
|
+
while (!shouldKeepWaiting(latest.status, Date.now() - startedAt).done) {
|
|
30299
|
+
if (shouldKeepWaiting(latest.status, Date.now() - startedAt).reason === "expired") return latest;
|
|
30300
|
+
await sleep4(WAIT_INTERVAL_MS);
|
|
30301
|
+
latest = await read();
|
|
30302
|
+
}
|
|
30303
|
+
return latest;
|
|
30304
|
+
}
|
|
30305
|
+
|
|
30306
|
+
// src/commands/avatars/get.ts
|
|
30285
30307
|
registerSchema({
|
|
30286
30308
|
command: "avatars.get",
|
|
30287
30309
|
description: "Read one avatar by handle \u2014 the command you run before casting it. Returns its status (only `ready` can be cast), the identity sheet URL every render must be grounded on via --reference, and the subject description that goes into the prompt VERBATIM. Add --full for the whole written profile (persona, speech, motion, wardrobe, setting, guardrails, voice, source photos).",
|
|
@@ -30305,7 +30327,13 @@ var getCommand2 = defineCommand98({
|
|
|
30305
30327
|
"avatar-handle": { type: "string", description: "Avatar handle (alternative to positional)", required: false },
|
|
30306
30328
|
full: { type: "boolean", description: "Include the whole written profile", required: false, default: false },
|
|
30307
30329
|
output: { type: "string", description: "Output format: json|files|md", required: false, default: "json" },
|
|
30308
|
-
fields: { type: "string", description: "Comma-separated field names to include", required: false }
|
|
30330
|
+
fields: { type: "string", description: "Comma-separated field names to include", required: false },
|
|
30331
|
+
wait: {
|
|
30332
|
+
type: "boolean",
|
|
30333
|
+
description: "Block until the identity sheet has settled (up to 90s), instead of returning while it is still building. Use it when the NEXT thing you do needs this avatar \u2014 a clip, a still, anything with --avatar. Without it you get the current status and have to come back; with it the command returns the moment it is ready. Never write your own sleep/poll loop around this.",
|
|
30334
|
+
required: false,
|
|
30335
|
+
default: false
|
|
30336
|
+
}
|
|
30309
30337
|
},
|
|
30310
30338
|
run: async ({ args }) => {
|
|
30311
30339
|
const handle = (args.handle || args["avatar-handle"])?.trim();
|
|
@@ -30315,7 +30343,13 @@ var getCommand2 = defineCommand98({
|
|
|
30315
30343
|
try {
|
|
30316
30344
|
const params = { handle };
|
|
30317
30345
|
if (args.full) params.full = "1";
|
|
30318
|
-
|
|
30346
|
+
let avatar = await readAvatars("/api/avatars/get", params);
|
|
30347
|
+
if (args.wait) {
|
|
30348
|
+
avatar = await waitForSheet(
|
|
30349
|
+
avatar,
|
|
30350
|
+
() => readAvatars("/api/avatars/get", params)
|
|
30351
|
+
);
|
|
30352
|
+
}
|
|
30319
30353
|
const hints2 = castingHints(avatar);
|
|
30320
30354
|
const format = args.output || "json";
|
|
30321
30355
|
if (format === "json") {
|
|
@@ -57345,6 +57379,15 @@ import { defineCommand as defineCommand208 } from "citty";
|
|
|
57345
57379
|
// src/commands/studio/animate.ts
|
|
57346
57380
|
import { defineCommand as defineCommand200 } from "citty";
|
|
57347
57381
|
|
|
57382
|
+
// src/commands/studio/avatarModel.ts
|
|
57383
|
+
function pinnedModelHint(input) {
|
|
57384
|
+
if (!input.avatar || !input.model) return null;
|
|
57385
|
+
if (input.model === DEFAULT_VIDEO_GENERATE_MODEL) return null;
|
|
57386
|
+
const speaks = input.generateAudio ?? true;
|
|
57387
|
+
if (!speaks) return null;
|
|
57388
|
+
return `You pinned --model ${input.model} on a speaking avatar. Without it this clip routes to ${DEFAULT_VIDEO_GENERATE_MODEL}, which was chosen for exactly this case: the better picture, both orientations, and audio always on. Drop --model unless the user asked for a specific one \u2014 and note ${input.model} may not take the length or the reference you are counting on.`;
|
|
57389
|
+
}
|
|
57390
|
+
|
|
57348
57391
|
// src/commands/studio/batch.ts
|
|
57349
57392
|
function projectBatch(generation, full) {
|
|
57350
57393
|
const compact3 = {
|
|
@@ -57787,6 +57830,8 @@ function costHintsFor(body) {
|
|
|
57787
57830
|
const hints2 = [
|
|
57788
57831
|
count === 1 ? `This clip costs about ${total} credits \u2014 roughly 45x an image.` : `${count} takes at about ${perTake} credits each \u2014 about ${total} credits.`
|
|
57789
57832
|
];
|
|
57833
|
+
const pinned = pinnedModelHint({ avatar: body.avatar, model: body.model, generateAudio: body.generateAudio });
|
|
57834
|
+
if (pinned) hints2.push(pinned);
|
|
57790
57835
|
if (count > 1) {
|
|
57791
57836
|
hints2.push(
|
|
57792
57837
|
"Ask for more than one take only when the MOTION is the risk \u2014 for a look you are unsure about, iterate on the still first."
|