editorbrain 0.45.1 → 0.45.3

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/README.md CHANGED
@@ -5,13 +5,13 @@ Editorial references, brand context and portable video projects for Claude Code
5
5
  Inspect the CLI without configuring your agent:
6
6
 
7
7
  ```sh
8
- npx editorbrain@0.45.1 help
8
+ npx editorbrain@0.45.3 help
9
9
  ```
10
10
 
11
11
  For a persistent installation:
12
12
 
13
13
  ```sh
14
- npm install -g editorbrain@0.45.1
14
+ npm install -g editorbrain@0.45.3
15
15
  editorbrain login --url https://api.editorbrain.com
16
16
  editorbrain status --url https://api.editorbrain.com
17
17
  editorbrain projects list
@@ -2107,6 +2107,9 @@ function mergeProfile(base, patch) {
2107
2107
  const issues = creativePreferencesReviewedIssues(value);
2108
2108
  if (issues.length) throw new Error(issues.join("\n"));
2109
2109
  result2[key] = [.../* @__PURE__ */ new Set([...base.creativePreferencesReviewed ?? [], ...value])];
2110
+ } else if (key === "creatorContext") {
2111
+ const fields2 = record5(value, key, Object.keys(creatorContextOptions));
2112
+ result2[key] = { ...object5(result2[key]) ? result2[key] : {}, ...fields2 };
2110
2113
  } else if (key === "editorialDelivery" || key === "visualTaste") {
2111
2114
  const fields2 = record5(value, key, key === "editorialDelivery" ? Object.keys(editorialDeliveryOptions) : ["density", "energy", "contrast"]);
2112
2115
  const previous = object5(result2[key]) ? result2[key] : {};
@@ -201976,7 +201979,7 @@ var renderManifestSchema = external_exports.object({
201976
201979
  projectId: external_exports.string().regex(/^[a-zA-Z0-9_-]{1,80}$/),
201977
201980
  engine: renderEngineSchema,
201978
201981
  entry: renderPath,
201979
- blender: external_exports.object({ version: external_exports.literal(RENDER_BLENDER_VERSION), frameStart: external_exports.number().int().min(1).max(1e6) }).strict().optional(),
201982
+ blender: external_exports.object({ version: external_exports.literal(RENDER_BLENDER_VERSION), frameStart: external_exports.number().int().min(0).max(1e6) }).strict().optional(),
201980
201983
  width: external_exports.number().int().min(64).max(3840),
201981
201984
  height: external_exports.number().int().min(64).max(3840),
201982
201985
  fps: external_exports.number().int().min(1).max(60),
@@ -201984,12 +201987,14 @@ var renderManifestSchema = external_exports.object({
201984
201987
  audio: renderPath.optional(),
201985
201988
  purpose: external_exports.enum(["preview", "final"]).optional(),
201986
201989
  previewQuality: external_exports.union([external_exports.literal(480), external_exports.literal(720)]).optional(),
201990
+ output: external_exports.object({ encoding: external_exports.literal("master-h264-v1") }).strict().optional(),
201987
201991
  delivery: external_exports.object({ maxOutputBytes: external_exports.number().int().positive().max(RENDER_MAX_OUTPUT_BYTES) }).strict().optional(),
201988
- execution: external_exports.object({ workers: external_exports.number().int().min(2).max(3), deterministicSeek: external_exports.literal(true) }).strict().optional(),
201992
+ execution: external_exports.object({ workers: external_exports.number().int().min(2).max(8), deterministicSeek: external_exports.literal(true), scheduling: external_exports.literal("dynamic-v1").optional() }).strict().optional(),
201989
201993
  files: external_exports.array(external_exports.object({ path: renderPath, bytes: external_exports.number().int().positive().max(RENDER_LONG_MAX_BYTES), sha256: external_exports.string().regex(/^[a-f0-9]{64}$/), sourceAssetId: external_exports.string().regex(/^[a-f0-9]{64}$/).optional() }).strict()).min(1).max(256)
201990
201994
  }).strict().superRefine((m, c) => {
201991
201995
  if (m.width % 2 || m.height % 2) c.addIssue({ code: "custom", message: "H.264 dimensions must be even." });
201992
201996
  if (m.previewQuality !== void 0 && m.purpose !== "preview") c.addIssue({ code: "custom", message: "previewQuality requires purpose preview; a final render uses the original composition dimensions." });
201997
+ if (m.output && (m.version !== 2 || m.engine !== "blender-cycles-v1" || m.purpose === "preview")) c.addIssue({ code: "custom", path: ["output", "encoding"], message: "master-h264-v1 requires a version 2 Blender final render. It is 8-bit H.264 at CRF 16, not lossless." });
201993
201998
  if (m.purpose === "preview" && Math.min(renderOutput(m).width, renderOutput(m).height) < 64) c.addIssue({ code: "custom", message: "Preview output must be at least 64 pixels on each side; use 720p or an appropriate composition." });
201994
201999
  const paths2 = m.files.map((f) => f.path);
201995
202000
  if (new Set(paths2).size !== paths2.length) c.addIssue({ code: "custom", message: "Duplicate file paths." });
@@ -202017,7 +202022,7 @@ function renderSegmentPlan(m) {
202017
202022
  function renderOutput(m) {
202018
202023
  const edge = (m.previewQuality ?? 480) === 480 ? 854 : 1280;
202019
202024
  const scale = m.purpose === "preview" ? Math.min(1, edge / Math.max(m.width, m.height)) : 1;
202020
- return { width: Math.max(2, Math.floor(m.width * scale / 2) * 2), height: Math.max(2, Math.floor(m.height * scale / 2) * 2), scale, purpose: m.purpose ?? "final" };
202025
+ return { width: Math.max(2, Math.floor(m.width * scale / 2) * 2), height: Math.max(2, Math.floor(m.height * scale / 2) * 2), scale, purpose: m.purpose ?? "final", ...m.output ? { encoding: m.output.encoding } : {} };
202021
202026
  }
202022
202027
 
202023
202028
  // packages/core/src/index.ts
@@ -202664,6 +202669,7 @@ import { dirname as dirname2, isAbsolute, join as join2, relative as relative2,
202664
202669
  // packages/cli/src/client.ts
202665
202670
  import { setTimeout as delay } from "node:timers/promises";
202666
202671
  var searchErrors = {
202672
+ brand_limit_reached: { status: 409, code: "BRAND_LIMIT_REACHED", hint: "Consulta el l\xEDmite de marcas de este espacio en https://editorbrain.com/app/billing. Puedes seguir editando las existentes. Comprar cr\xE9ditos no aumenta este l\xEDmite." },
202667
202673
  invalid_project_intake: { status: 400, code: "INVALID_PROJECT_INTAKE", hint: "Use projects create ID --brand ID --style ID --output-profile ID with existing IDs. The workspace comes from your authenticated account; do not send a workspace ID." },
202668
202674
  project_dependency_missing: { status: 404, code: "PROJECT_DEPENDENCY_MISSING", hint: "Read dependencyKind and documentPath. Discover the existing brand with brands list and styles/output profiles with documents list --prefix .editorbrain/styles/ or .editorbrain/output-profiles/. Preserve saved choices; do not invent replacement preferences or select another brand silently." },
202669
202675
  project_exists: { status: 409, code: "PROJECT_EXISTS", hint: "This ID belongs to an existing or edited project. Use projects intake --project ID to resume it, or choose a new ID for a separate edit. Never overwrite or delete the existing project to retry creation." },
@@ -202785,6 +202791,7 @@ function safeDiagnosticDetails(body) {
202785
202791
  if (e.billingUrl === "https://editorbrain.com/app/billing" || e.billingUrl === "https://editorbrain.com/app/billing#credits") details.billingUrl = e.billingUrl;
202786
202792
  if (["render_credit_budget", "render_insufficient_credits"].includes(String(e.code)) && typeof e.requiredCredits === "number" && Number.isFinite(e.requiredCredits) && e.requiredCredits >= 0 && e.requiredCredits <= 1e6) details.requiredCredits = e.requiredCredits;
202787
202793
  for (const key of ["limit", "retryAfter"]) if (Number.isSafeInteger(e[key]) && Number(e[key]) >= 0 && Number(e[key]) <= 86400) details[key] = Number(e[key]);
202794
+ if (e.code === "brand_limit_reached" && Number.isSafeInteger(e.used) && Number(e.used) >= 0 && Number(e.used) <= 2e3) details.used = Number(e.used);
202788
202795
  if (e.code === "render_queue_full") {
202789
202796
  for (const key of ["global", "perUser", "perWorkspace", "pendingGlobal", "pendingPerUser", "pendingPerWorkspace"]) if (Number.isSafeInteger(e[key]) && Number(e[key]) > 0 && Number(e[key]) <= 500) details[key] = Number(e[key]);
202790
202797
  }
@@ -202821,7 +202828,8 @@ var ApiError = class extends CliError {
202821
202828
  const recovery2 = diagnostic ? recoveryGuidance(diagnostic.serviceCode, status) : void 0;
202822
202829
  const details = diagnostic ? safeDiagnosticDetails(body) : {};
202823
202830
  const preferenceHint = diagnostic?.serviceCode === "studio_preference_conflict" && details.conflict === "narration" ? 'Read workflow and the returned projectPath/documentPath. Only after an explicit user request, save narrationOverride={value:"voiceover",reason:"user-requested reason"} in this project.json, then choose an authorized public voice with studio voices and studio voice VOICE_ID --project ID --expected-revision N. Preserve the brand. Quote again; a preference exception never authorizes spending.' : diagnostic?.serviceCode === "studio_preference_conflict" && details.conflict === "voice_selection" ? "Read workflow and studio voice --project ID. Reconcile the requested public alias with the authorized saved voice using studio voices; a deliberate change uses studio voice VOICE_ID --project ID --expected-revision N. Preserve original/no-narration restrictions and the brand. Quote again; a voice selection never authorizes spending." : void 0;
202824
- super(diagnostic?.code ?? code, `API request failed (HTTP ${status}).`, recovery2 ? recoveryHint(recovery2) : preferenceHint ?? diagnostic?.hint ?? hint, !diagnostic && safeToRetry && (status === 429 || status >= 500), { status, ...recovery2 ? { recovery: recovery2 } : {}, ...diagnostic ? { serviceCode: diagnostic.serviceCode, ...details } : {}, ...retryAfterMs === void 0 ? {} : { retryAfterMs } });
202831
+ const message = diagnostic?.serviceCode === "brand_limit_reached" ? `Este espacio alcanz\xF3 su l\xEDmite de marcas${typeof details.used === "number" && typeof details.limit === "number" ? ` (${details.used}/${details.limit})` : ""}.` : `API request failed (HTTP ${status}).`;
202832
+ super(diagnostic?.code ?? code, message, recovery2 ? recoveryHint(recovery2) : preferenceHint ?? diagnostic?.hint ?? hint, !diagnostic && safeToRetry && (status === 429 || status >= 500), { status, ...recovery2 ? { recovery: recovery2 } : {}, ...diagnostic ? { serviceCode: diagnostic.serviceCode, ...details } : {}, ...retryAfterMs === void 0 ? {} : { retryAfterMs } });
202825
202833
  this.status = status;
202826
202834
  this.body = body;
202827
202835
  }
@@ -203012,7 +203020,8 @@ var Client = class {
203012
203020
  if ((/^\/v1\/(?:authored-motion|style-sources|sfx|team|studio|batches|render-cloud|resources)(?:\/|\?|$)/.test(path) || path.startsWith("/v1/documents/") || path === "/v1/search/brief" || path === "/v1/projects" || /^\/v1\/projects\/[^/]+\/(?:progress|intake|resolve|export)$/.test(path)) && [400, 402, 403, 404, 409, 422, 429, 503].includes(response.status)) {
203013
203021
  try {
203014
203022
  const parsed = await boundedJson(response, 16 * 1024);
203015
- const diagnostic = path.startsWith("/v1/documents/") && !/^\/v1\/documents\/videos\/[^/]+\/project\.json$/.test(path) ? void 0 : searchDiagnostic(response.status, parsed);
203023
+ const knownDiagnostic = searchDiagnostic(response.status, parsed);
203024
+ const diagnostic = path.startsWith("/v1/documents/") && !/^\/v1\/documents\/videos\/[^/]+\/project\.json$/.test(path) && knownDiagnostic?.serviceCode !== "brand_limit_reached" ? void 0 : knownDiagnostic;
203016
203025
  const voiceRevisionConflict = /^\/v1\/studio\/voice-selection(?:\?|$)/.test(path) && response.status === 409 && parsed?.error?.code === "revision_conflict";
203017
203026
  errorBody = diagnostic ? { error: { code: diagnostic.serviceCode, ...safeDiagnosticDetails(parsed) } } : voiceRevisionConflict ? { error: { code: "revision_conflict" } } : path.startsWith("/v1/documents/") ? documentDiagnostic(parsed, path, response.status) : void 0;
203018
203027
  } catch {
@@ -203179,14 +203188,36 @@ async function pushWorkspace(client, root, files, options = {}) {
203179
203188
  }
203180
203189
  pending.push({ path, content, expectedRevision: base?.revision ?? 0 });
203181
203190
  }
203191
+ const finalPaths = new Set(options.finalizePaths ?? []);
203192
+ pending.sort((a, b) => Number(finalPaths.has(a.path)) - Number(finalPaths.has(b.path)));
203182
203193
  if (options.dryRun) return { dryRun: true, uploaded: [], unchanged: unchanged2, wouldUpload: pending.map((item) => item.path), conflicts };
203183
203194
  if (conflicts.length) throw new CliError("SYNC_CONFLICT", `Remote documents changed. Pull into a separate folder or reconcile changes before pushing:
203184
203195
  ${conflicts.join("\n")}`, "Run push --dry-run and reconcile the reported paths.", false, { conflicts });
203185
203196
  const uploaded = [];
203186
203197
  const skipped = [];
203198
+ const deferred = [];
203199
+ let finalChecked = false;
203187
203200
  for (const item of pending) {
203188
203201
  let result2;
203189
203202
  try {
203203
+ if (finalPaths.has(item.path)) {
203204
+ if (skipped.length) {
203205
+ deferred.push(item.path);
203206
+ continue;
203207
+ }
203208
+ if (!finalChecked) {
203209
+ if ((await client.me()).workspaceId !== me.workspaceId) throw new CliError("WORKSPACE_MISMATCH", "The connected workspace changed during sync.", "Retry against the intended account.");
203210
+ const latest = new Map((await client.list()).map((summary2) => {
203211
+ checkRemote(summary2);
203212
+ return [summary2.path, summary2];
203213
+ }));
203214
+ const changed2 = Object.keys(files).filter((path) => latest.get(path)?.revision !== remote.get(path)?.revision || latest.get(path)?.sha256 !== remote.get(path)?.sha256);
203215
+ if (changed2.length) throw new CliError("SYNC_CONFLICT", `Remote documents changed before confirmations were saved:
203216
+ ${changed2.join("\n")}`, "Reconcile the changed documents before retrying.", false, { conflicts: changed2 });
203217
+ await options.beforeFinalize?.();
203218
+ finalChecked = true;
203219
+ }
203220
+ }
203190
203221
  result2 = await client.put(item.path, item.content, item.expectedRevision);
203191
203222
  } catch (error62) {
203192
203223
  if (!(error62 instanceof UnsupportedDocumentError)) {
@@ -203200,6 +203231,7 @@ ${conflicts.join("\n")}`, "Run push --dry-run and reconcile the reported paths."
203200
203231
  const digest5 = await sha256(item.content);
203201
203232
  if (result2.path !== item.path || result2.sha256 !== digest5) throw new Error("Server returned inconsistent write metadata");
203202
203233
  state.documents[item.path] = { revision: result2.revision, sha256: result2.sha256 };
203234
+ remote.set(item.path, result2);
203203
203235
  uploaded.push(item.path);
203204
203236
  await saveSyncState(root, state);
203205
203237
  }
@@ -203208,6 +203240,7 @@ ${conflicts.join("\n")}`, "Run push --dry-run and reconcile the reported paths."
203208
203240
  status: "partial",
203209
203241
  synced: false,
203210
203242
  skipped,
203243
+ ...deferred.length ? { deferred } : {},
203211
203244
  warnings: skipped.map((item) => `${item.path}: el servidor no soporta este documento; sigue pendiente y conservado localmente.`),
203212
203245
  next: "Actualiza la API y repite push para sincronizar los documentos pendientes. Los guardados confirmados no se repiten. El proyecto a\xFAn no est\xE1 sincronizado por completo."
203213
203246
  } : {} };
@@ -203751,7 +203784,18 @@ async function cloudRenderCommand(client, root, command, id4, flags) {
203751
203784
  const requireEngine = (engine) => {
203752
203785
  if (!(capability.engines ?? ["html-seek-v1"]).includes(engine)) throw new CliError("RENDER_ENGINE_UNAVAILABLE", `Render engine ${engine} is not available for this account. Native Blender projects require an enabled compatible runtime. No media was read or uploaded.`, "Read editorbrain capabilities; continue rendering locally until the requested engine is available. Do not rename a .blend file to .html.");
203753
203786
  };
203754
- const allowed = /* @__PURE__ */ new Set(["dir", "url", ...command === "prepare" ? ["file", "out", "purpose", "quality"] : command === "quote" ? ["file", "out", "max-cost-usd", "runtime-seconds"] : command === "submit" ? ["file", "quote-file", "max-credits", "max-cost-usd", "runtime-seconds", "user-confirmed", "grant"] : command === "delivery-delete" ? ["sha256", "bytes", "user-confirmed"] : command === "download" ? ["out"] : command === "preferences" ? ["file", "project"] : command === "plan" || command === "acknowledge" ? ["file"] : command === "upload" ? ["file", "project", "mime", "id"] : command === "grants" ? ["file", "id", "user-confirmed"] : []]);
203787
+ const requireFeatures = (manifest2) => {
203788
+ const unavailable = (feature) => {
203789
+ throw new CliError("RENDER_FEATURE_UNAVAILABLE", `${feature} is not advertised by the active render runtime. No media was read or uploaded.`, "Read editorbrain capabilities. Continue locally or prepare a new manifest with explicitly approved supported settings; do not silently change frames, quality or scheduling.");
203790
+ };
203791
+ if (manifest2.blender?.frameStart === 0 && capability.blender?.minFrameStart !== 0) unavailable("Blender frame 0");
203792
+ if (manifest2.output && !capability.blender?.outputEncodings?.includes(manifest2.output.encoding)) unavailable(manifest2.output.encoding);
203793
+ if (manifest2.execution?.scheduling === "dynamic-v1") {
203794
+ const parallel = capability.parallelRender, maxWorkers = parallel?.dynamicMaxWorkers ?? parallel?.maxWorkers;
203795
+ if (!parallel?.scheduling?.includes("dynamic-v1") || !parallel.dynamicEngines?.includes(manifest2.engine) || !Number.isInteger(maxWorkers) || manifest2.execution.workers > maxWorkers) unavailable("Dynamic rendering for this engine with the requested worker count");
203796
+ } else if (manifest2.execution && manifest2.execution.workers > Math.min(3, capability.parallelRender?.staticMaxWorkers ?? 3)) unavailable("Static rendering with the requested worker count");
203797
+ };
203798
+ const allowed = /* @__PURE__ */ new Set(["dir", "url", ...command === "prepare" ? ["file", "out", "purpose", "quality", "encoding", "frame-start"] : command === "quote" ? ["file", "out", "max-cost-usd", "runtime-seconds"] : command === "submit" ? ["file", "quote-file", "max-credits", "max-cost-usd", "runtime-seconds", "user-confirmed", "grant"] : command === "delivery-delete" ? ["sha256", "bytes", "user-confirmed"] : command === "download" ? ["out"] : command === "preferences" ? ["file", "project"] : command === "plan" || command === "acknowledge" ? ["file"] : command === "upload" ? ["file", "project", "mime", "id"] : command === "grants" ? ["file", "id", "user-confirmed"] : []]);
203755
203799
  for (const k of Object.keys(flags)) if (!allowed.has(k)) throw bad(`Unsupported --${k}.`);
203756
203800
  if (["upload", "upload-status", "upload-cancel", "preferences", "packages", "plan", "delivery", "delivery-retry", "delivery-delete", "grants", "acknowledge"].includes(command) && !capability.storage) throw new CliError("NOT_AVAILABLE", "Cloud storage is unavailable for this account.", "Read capabilities and continue with available tools; no media was read or uploaded.");
203757
203801
  if (command === "grants") {
@@ -203894,6 +203938,15 @@ async function cloudRenderCommand(client, root, command, id4, flags) {
203894
203938
  input2.previewQuality = Number(flags.quality);
203895
203939
  }
203896
203940
  if (flags.purpose === "final") delete input2.previewQuality;
203941
+ if (flags.encoding !== void 0) {
203942
+ if (flags.encoding !== "master-h264-v1") throw bad("Use --encoding master-h264-v1 for a version 2 Blender final render. This is 8-bit H.264 at CRF 16, not lossless.");
203943
+ input2.output = { ...input2.output, encoding: flags.encoding };
203944
+ }
203945
+ if (flags["frame-start"] !== void 0) {
203946
+ const value = flags["frame-start"];
203947
+ if (typeof value !== "string" || !/^\d+$/.test(value) || Number(value) > 1e6 || input2.engine !== "blender-cycles-v1" || !input2.blender) throw bad("--frame-start requires a Blender manifest and an integer from 0 to 1000000. The requested range must fit the source scene.");
203948
+ input2.blender = { ...input2.blender, frameStart: Number(value) };
203949
+ }
203897
203950
  if (Array.isArray(input2.files) && input2.files.some((f) => f && typeof f === "object" && Object.hasOwn(f, "sourceAssetId")) && !capability.storage) throw bad("This account does not support cloud asset inputs. Read capabilities; do not download media to bypass the selected cloud-only preference.");
203898
203951
  const engine = renderEngineSchema.safeParse(input2.engine);
203899
203952
  if (!engine.success) throw bad(engine.error.issues[0].message);
@@ -203906,7 +203959,7 @@ async function cloudRenderCommand(client, root, command, id4, flags) {
203906
203959
  else entries.push(typeof f === "object" && f !== null && Object.hasOwn(f, "sourceAssetId") ? { path: result2.data, sourceAssetId: f.sourceAssetId, bytes: f.bytes, sha256: f.sha256 } : { path: result2.data });
203907
203960
  }
203908
203961
  if (issues.length) throw invalidManifest(flags.file, issues);
203909
- parseManifest({ ...input2, files: entries.map((f) => Object.hasOwn(f, "sourceAssetId") ? f : { path: f.path, bytes: 1, sha256: "0".repeat(64) }) }, flags.file);
203962
+ requireFeatures(parseManifest({ ...input2, files: entries.map((f) => Object.hasOwn(f, "sourceAssetId") ? f : { path: f.path, bytes: 1, sha256: "0".repeat(64) }) }, flags.file));
203910
203963
  const activityContext = await captureRemoteProjectActivity(client, root, String(input2.projectId));
203911
203964
  if (capability.storage && input2.purpose === "preview" && input2.previewQuality === void 0) {
203912
203965
  const settings = await client.request("/v1/render-cloud/preferences?" + new URLSearchParams({ projectId: String(input2.projectId) }));
@@ -203926,10 +203979,11 @@ async function cloudRenderCommand(client, root, command, id4, flags) {
203926
203979
  const transfer = caps.capabilities.find((x) => x.id === "private-cloud-render")?.inputTransfer;
203927
203980
  const inputTransport2 = transfer?.transport === "multipart-v1" && transfer.partBytes === 8 * 1024 * 1024 && files.some((f) => !("sourceAssetId" in f) && f.bytes >= transfer.partBytes) ? "multipart-v1" : "chunks-v1";
203928
203981
  await atomicWrite(root, out, JSON.stringify({ id: randomUUID3(), manifest: manifest2, inputTransport: inputTransport2 }, null, 2), { document: false, overwrite: false, mode: 384 });
203929
- return { path: out, files: files.length, localFiles: files.filter((f) => !("sourceAssetId" in f)).length, cloudFiles: files.filter((f) => "sourceAssetId" in f).length, bytes: files.reduce((n, f) => n + f.bytes, 0), uploaded: false, registration: await recordProjectActivity(activityContext, { kind: "render_prepared", files: [out] }), next: capability.storage ? "Run render-cloud plan with this prepared file to check saved storage preferences and cloud input access; then quote. Cloud asset metadata is rechecked by the server without downloading media locally. Review credits and expiry before approved submission." : "Request render-cloud quote with this prepared file; review credits and expiry, then obtain approval before submit." };
203982
+ return { path: out, files: files.length, localFiles: files.filter((f) => !("sourceAssetId" in f)).length, cloudFiles: files.filter((f) => "sourceAssetId" in f).length, bytes: files.reduce((n, f) => n + f.bytes, 0), uploaded: false, ...manifest2.output ? { outputEncoding: { name: manifest2.output.encoding, codec: "H.264", crf: 16, bitDepth: 8, lossless: false, sizeGuidance: "CRF does not guarantee a file size. Limits remain 64 MiB per checkpoint and 2 GiB total, subject to the approved delivery ceiling. Measure a representative sample; do not silently lower quality." } } : {}, registration: await recordProjectActivity(activityContext, { kind: "render_prepared", files: [out] }), next: capability.storage ? "Run render-cloud plan with this prepared file to check saved storage preferences and cloud input access; then quote. Cloud asset metadata is rechecked by the server without downloading media locally. Review credits and expiry before approved submission." : "Request render-cloud quote with this prepared file; review credits and expiry, then obtain approval before submit." };
203930
203983
  }
203931
203984
  const manifest = parseManifest(input2.manifest, flags.file);
203932
203985
  requireEngine(manifest.engine);
203986
+ requireFeatures(manifest);
203933
203987
  if (command === "plan") return client.request("/v1/render-cloud/plan", { method: "POST", body: { manifest } });
203934
203988
  if (manifest.engine === "blender-cycles-v1" && flags["runtime-seconds"] === void 0) throw bad("Native Blender requires an explicit --runtime-seconds based on a representative render at the requested settings. Use the same runtime for quote and submit; animation duration does not estimate Cycles render time.");
203935
203989
  const maxCostUsd = Number(flags["max-cost-usd"] ?? (manifest.version === 2 ? 5 : 0.5)), runtimeSeconds = Number(flags["runtime-seconds"] ?? (manifest.version === 2 ? Math.min(RENDER_MAX_RUNTIME_SECONDS, Math.ceil(manifest.durationSeconds * 2 + 600)) : 600));
@@ -207329,6 +207383,13 @@ import { fileURLToPath } from "node:url";
207329
207383
 
207330
207384
  // packages/cli/src/agent-guidance-history.ts
207331
207385
  var VERIFIED_GUIDANCE_RELEASES = [
207386
+ {
207387
+ "version": "0.45.1",
207388
+ "archiveSha256": "52fee57c90037924969319d5c6e9e576bbbe5166cdaeae4772cfe7be0b20988d",
207389
+ "files": {
207390
+ "editorbrain/references/onboarding.md": "b842dac368455b670543d9a0defdad91708c10788d1474ddfa6b31ca929e930b"
207391
+ }
207392
+ },
207332
207393
  {
207333
207394
  "version": "0.45.0",
207334
207395
  "archiveSha256": "3b1db0fe7840e6e2760b794212e4f1629005547fe33e3f6189b43548b5e602ea",
@@ -211237,7 +211298,8 @@ async function syncOnboardingDocuments(client, root, files, options) {
211237
211298
  }
211238
211299
  const valid = validateWorkspace(prepared);
211239
211300
  if (!valid.valid) throw new ValidationError(valid.issues);
211240
- const preview = await pushWorkspace(client, root, prepared, { dryRun: true });
211301
+ const finalizePaths = Object.keys(prepared).filter((path) => /^\.editorbrain\/brands\/[^/]+\/design\.md$/.test(path));
211302
+ const preview = await pushWorkspace(client, root, prepared, { dryRun: true, finalizePaths });
211241
211303
  if (preview.conflicts?.length) throw conflict(preview.conflicts);
211242
211304
  await unchanged(root, files);
211243
211305
  if (options.dryRun) return { ...preview, adoptedShared: [], wouldAdoptShared: adoptions.map((doc) => doc.path) };
@@ -211249,7 +211311,11 @@ async function syncOnboardingDocuments(client, root, files, options) {
211249
211311
  await atomicWrite(root, doc.path, doc.content);
211250
211312
  }
211251
211313
  await unchanged(root, prepared);
211252
- return { ...await pushWorkspace(client, root, prepared), adoptedShared: adoptions.map((doc) => doc.path) };
211314
+ const result2 = await pushWorkspace(client, root, prepared, { finalizePaths, beforeFinalize: () => unchanged(root, prepared) });
211315
+ return { ...result2, adoptedShared: adoptions.map((doc) => doc.path), ...result2.deferred?.length ? {
211316
+ deferredConfirmations: result2.deferred,
211317
+ next: `${result2.next ?? ""} Las confirmaciones editoriales quedan pendientes hasta guardar los documentos restantes.`.trim()
211318
+ } : {} };
211253
211319
  }
211254
211320
 
211255
211321
  // packages/cli/src/onboarding.ts
@@ -211342,7 +211408,7 @@ async function applyOnboarding(options) {
211342
211408
  if (configuration.status === "pending" && profile.questionMode !== "autonomous") throw failure2("ONBOARDING_PREFERENCES_PENDING", `Confirm the remaining preference categories before applying guided onboarding: ${configuration.pending.join(", ")}`, "Reopen the artifact or ask the user in chat. Keep saved choices; mark categories reviewed only after explicit confirmation or delegation.");
211343
211409
  const validation = validateWorkspace(merged);
211344
211410
  if (!validation.valid) throw new ValidationError(validation.issues);
211345
- const pending = writes.filter((w) => current2[w.path]?.content !== w.content);
211411
+ const pending = writes.filter((w) => current2[w.path]?.content !== w.content).sort((a, b) => Number(a.path === `.editorbrain/brands/${session.brandId}/design.md`) - Number(b.path === `.editorbrain/brands/${session.brandId}/design.md`));
211346
211412
  if (!options.dryRun) {
211347
211413
  for (const item of pending) {
211348
211414
  const now = await localDocument(root, item.path);
@@ -215915,7 +215981,7 @@ function parseArgs(argv) {
215915
215981
  known.add("expected-version");
215916
215982
  known.add("lease-token");
215917
215983
  known.add("batch-lease-token");
215918
- if (argv[0] === "render-cloud") for (const flag2 of ["max-cost-usd", "runtime-seconds", "quote-file", "grant", "bytes"]) known.add(flag2);
215984
+ if (argv[0] === "render-cloud") for (const flag2 of ["max-cost-usd", "runtime-seconds", "quote-file", "grant", "bytes", "encoding", "frame-start"]) known.add(flag2);
215919
215985
  if (argv[0] === "team") for (const flag2 of ["email", "user", "at-ms"]) known.add(flag2);
215920
215986
  for (const flag2 of ["language", "accent", "gender"]) known.add(flag2);
215921
215987
  for (let i = 0; i < argv.length; i++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "editorbrain",
3
- "version": "0.45.1",
3
+ "version": "0.45.3",
4
4
  "description": "EditorBrain editorial knowledge, portable workspaces and skills for AI video agents",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -135,6 +135,16 @@ editorbrain onboarding sync --session <session> --dir ./my-videos
135
135
 
136
136
  After `onboarding apply`, the canonical publishing step is `onboarding sync` (preview, then sync) for the same session. Do not additionally run `push`: it is the general document command and may include unrelated edits.
137
137
 
138
+ CLI 0.45.2 writes the brand's `design.md` with editorial confirmations last,
139
+ after its other local answers, including audio. Sync checks the whole selected
140
+ set before any upload, then rechecks local inputs and remote revisions before
141
+ publishing that final document. A conflict, failed upload or unsupported
142
+ document before that final write leaves the new confirmations unpublished. This is not a multi-file
143
+ transaction: earlier accepted writes remain saved. Inspect `uploaded`, `skipped`
144
+ and the recovery hint before retrying the same session; never mark the intake
145
+ complete from an HTTP success for only one document. If the final receipt is
146
+ missing, inspect the saved remote state before deciding whether it completed.
147
+
138
148
  Inspect planned paths/conflicts. Sync uploads only this brand/starter context.
139
149
  Untouched shared starter guides can adopt the account's existing versions;
140
150
  personalized local documents are never silently replaced. On network failure,