editorbrain 0.39.1 → 0.40.1

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.39.1 help
8
+ npx editorbrain@0.40.1 help
9
9
  ```
10
10
 
11
11
  For a persistent installation:
12
12
 
13
13
  ```sh
14
- npm install -g editorbrain@0.39.1
14
+ npm install -g editorbrain@0.40.1
15
15
  editorbrain login --url https://api.editorbrain.com
16
16
  editorbrain status --url https://api.editorbrain.com
17
17
  editorbrain projects list
@@ -246,6 +246,7 @@ var billing = { label: "Ver plan y cr\xE9ditos", url: "https://editorbrain.com/a
246
246
  var integrations = { label: "Ver mis integraciones", url: "https://editorbrain.com/app/integrations" };
247
247
  var support = { label: "Contactar soporte", url: "mailto:soporte@editorbrain.com" };
248
248
  var guidance = {
249
+ resource_plan_required: { status: 403, help: { message: "Este recurso requiere Creator o Studio.", nextStep: "Puedes ver su preview o proponer un recurso con access.canUse=true que encaje con la escena. Una recarga de cr\xE9ditos no desbloquea recursos premium. No sustituyas la elecci\xF3n expl\xEDcita del usuario ni cambies de plan autom\xE1ticamente.", actions: [billing, { label: "Explorar animaciones", url: "https://editorbrain.com/app/animations" }] } },
249
250
  studio_insufficient_credits: { status: 402, help: {
250
251
  message: "No alcanzan tus cr\xE9ditos creativos de EditorBrain para este encargo.",
251
252
  nextStep: "Consulta Plan y cr\xE9ditos para ver tu saldo y las opciones de recarga disponibles. Tambi\xE9n puedes elegir una integraci\xF3n propia compatible o aportar un recurso ya creado. Comprueba el acceso y presupuesto de esa alternativa antes de usarla; no recargues ni cambies de proveedor autom\xE1ticamente.",
@@ -321,21 +322,6 @@ function validateToolPreferences(input) {
321
322
  return structuredClone(value);
322
323
  }
323
324
 
324
- // packages/core/src/creator-context.ts
325
- var creatorContextOptions = {
326
- teamSize: [["solo", "Solo yo"], ["small", "2 a 5 personas"], ["mid", "6 a 20 personas"], ["large", "M\xE1s de 20 personas"]],
327
- approver: [["me", "Yo decido"], ["lead", "Mi l\xEDder o responsable"], ["brand", "Marca o legal"]],
328
- brandManual: [["yes", "Tenemos manual de marca"], ["no", "Todav\xEDa no tenemos manual"]],
329
- clientCount: [["few", "1 a 3 clientes"], ["some", "4 a 10 clientes"], ["many", "M\xE1s de 10 clientes"]],
330
- clientReview: [["direct", "El cliente revisa"], ["us", "Revisamos nosotros"], ["mixed", "Depende del cliente"]],
331
- settingUp: [["client", "Una marca de cliente"], ["agency", "Mi agencia"]]
332
- };
333
- function creatorContextIssues(value) {
334
- if (value === void 0) return [];
335
- if (!value || typeof value !== "object" || Array.isArray(value)) return ["creatorContext debe ser un objeto."];
336
- return Object.entries(value).flatMap(([key, choice]) => Object.hasOwn(creatorContextOptions, key) && creatorContextOptions[key].some((o) => o[0] === choice) ? [] : [`Contexto de trabajo inv\xE1lido: ${key}.`]);
337
- }
338
-
339
325
  // packages/core/src/question-policy.ts
340
326
  var questionModeOptions = [
341
327
  { id: "essential", title: "Solo lo esencial", description: "Pregunta solo si falta algo que cambia el resultado. Los detalles los decide tu agente." },
@@ -375,6 +361,143 @@ function planEditQuestions(policy, value) {
375
361
  return { mode: policy.mode, assessment: "host-declared-not-media-verified", decisions, questions: decisions.filter((d) => d.action === "ask"), blocked: decisions.filter((d) => d.action === "blocked"), notice: "Resolved means already answered, never proof of approval. This plan does not authorize execution or change saved preferences. Reassess after answers; do not automatically ask every deferred question." };
376
362
  }
377
363
 
364
+ // packages/core/src/integrations.ts
365
+ var integrationCatalog = [
366
+ { id: "higgsfield", name: "Higgsfield", description: "Im\xE1genes y clips generados para apoyar tu edici\xF3n.", capabilities: ["image", "video"], accessMethods: ["agent", "api", "browser", "files"], docsUrl: "https://open.higgsfield.ai/quick-start" },
367
+ { id: "kie-ai", name: "Kie AI", description: "Im\xE1genes, video, voz y m\xFAsica con tu propia cuenta de Kie AI.", capabilities: ["image", "video", "voiceover", "music"], accessMethods: ["api", "agent", "files"], docsUrl: "https://docs.kie.ai/" },
368
+ { id: "elevenlabs", name: "ElevenLabs", description: "Voces, efectos de sonido y m\xFAsica generada.", capabilities: ["voiceover", "sfx", "music"], accessMethods: ["agent", "api", "browser", "files"], docsUrl: "https://elevenlabs.io/docs/overview" },
369
+ { id: "suno", name: "Suno", description: "M\xFAsica generada con Suno; el acceso API depende de tu cuenta.", capabilities: ["music"], accessMethods: ["browser", "api", "files"], docsUrl: "https://platform.suno.com/" },
370
+ { id: "openai-images", name: "OpenAI Images", description: "Creaci\xF3n y edici\xF3n de im\xE1genes para tu contenido.", capabilities: ["image"], accessMethods: ["agent", "api", "browser", "files"], docsUrl: "https://platform.openai.com/docs/guides/image-generation" },
371
+ { id: "pexels", name: "Pexels", description: "Fotos y videos de stock; revisa la licencia y el contexto de uso.", capabilities: ["stock-image", "stock-video"], accessMethods: ["agent", "api", "browser", "files"], docsUrl: "https://www.pexels.com/api/documentation/" },
372
+ { id: "assemblyai", name: "AssemblyAI", description: "Transcripci\xF3n con marcas de tiempo para planificar cortes y subt\xEDtulos.", capabilities: ["transcription"], accessMethods: ["agent", "api", "files"], docsUrl: "https://www.assemblyai.com/docs" }
373
+ ];
374
+ function object2(value) {
375
+ return value !== null && typeof value === "object" && !Array.isArray(value);
376
+ }
377
+ function knownFields(value, allowed) {
378
+ if (Object.keys(value).some((key) => !allowed.includes(key))) throw new Error("Unknown integration field. Credentials and user/workspace IDs are not accepted.");
379
+ }
380
+ function containsCredential(value) {
381
+ return /-----BEGIN [A-Z ]*PRIVATE KEY-----|\bBearer\s+\S{12,}|\b(?:sk-(?:proj-)?|AIza|cfat_|apikey_|tlk_)[A-Za-z0-9_-]{15,}|\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+|(?:api[_ -]?key|access[_ -]?token|secret|password)\s*[:=]\s*["']?\S{8,}/i.test(value);
382
+ }
383
+ function validateIntegrationUpdate(providerId, input) {
384
+ const provider = integrationCatalog.find((entry) => entry.id === providerId);
385
+ if (!provider) throw new Error("Unknown integration provider.");
386
+ if (!object2(input)) throw new Error("Integration settings must be an object.");
387
+ knownFields(input, ["enabled", "accessMethod", "preferences", "expectedRevision"]);
388
+ if (typeof input.enabled !== "boolean") throw new Error("enabled must be a boolean.");
389
+ if (!provider.accessMethods.includes(input.accessMethod)) throw new Error("Unsupported access method for this provider.");
390
+ if (!Number.isSafeInteger(input.expectedRevision) || input.expectedRevision < 0) throw new Error("The current expectedRevision is required.");
391
+ if (!object2(input.preferences)) throw new Error("preferences must be an object.");
392
+ knownFields(input.preferences, ["instructions", "model", "voiceId", "language", "musicMode", "spending"]);
393
+ const preferences = {};
394
+ for (const [field, max] of [["instructions", 1e3], ["model", 120], ["voiceId", 120], ["language", 60]]) {
395
+ const value = input.preferences[field];
396
+ if (value === void 0) continue;
397
+ if (typeof value !== "string" || value.length > max || /[\u0000-\u0008\u000b\u000c\u000e-\u001f]/.test(value)) throw new Error(`${field} must be text of at most ${max} characters.`);
398
+ if (containsCredential(value)) throw new Error("Credentials must stay in your provider connection, never in integration preferences.");
399
+ if (value.trim()) preferences[field] = value.trim();
400
+ }
401
+ const musicMode = input.preferences.musicMode, spending = input.preferences.spending;
402
+ if (musicMode !== void 0) {
403
+ if (!provider.capabilities.includes("music") || !["instrumental", "vocals", "either"].includes(musicMode)) throw new Error("musicMode is only available for music integrations.");
404
+ preferences.musicMode = musicMode;
405
+ }
406
+ if (preferences.voiceId && !provider.capabilities.includes("voiceover")) throw new Error("voiceId is only available for voice integrations.");
407
+ if (spending !== void 0 && !["ask", "use-approved-budget"].includes(spending)) throw new Error("Invalid spending preference.");
408
+ preferences.spending = spending ?? "ask";
409
+ return { enabled: input.enabled, accessMethod: input.accessMethod, preferences, expectedRevision: input.expectedRevision };
410
+ }
411
+ var integrationExecutionPolicy = {
412
+ version: 1,
413
+ selection: "explicit-task-choice-then-compatible-saved-access-then-propose",
414
+ externalCredits: "host-or-provider-account; never require EditorBrain creative credits",
415
+ builtInCredits: "EditorBrain Studio catalog and quote; personal provider access does not unlock Studio",
416
+ verification: "current-session-tool, authentication, supported-model, cost-and-existing-task-budget",
417
+ fallback: "no automatic paid provider or access-method switch",
418
+ uncertainSubmission: "recover existing provider job before resubmitting or switching",
419
+ unknownBalance: "unknown is not zero; do not claim insufficient credits without evidence"
420
+ };
421
+ function integrationRoutes(entries, catalog = integrationCatalog) {
422
+ return entries.filter((entry) => entry.enabled).map((entry) => {
423
+ const provider = catalog.find((item) => item.id === entry.providerId);
424
+ return {
425
+ routeId: `integration:${entry.providerId}:${entry.accessMethod}`,
426
+ providerId: entry.providerId,
427
+ accessMethod: entry.accessMethod,
428
+ capabilities: provider?.capabilities ?? [],
429
+ execution: entry.accessMethod === "files" ? "existing-files" : "verify-in-current-session",
430
+ billingScope: entry.accessMethod === "files" ? "no-generation" : "host-or-provider",
431
+ requiresEditorBrainCreativeCredits: false
432
+ };
433
+ });
434
+ }
435
+
436
+ // packages/core/src/onboarding-account.ts
437
+ var onboardingReviewOptions = [
438
+ { id: "directions", title: "Primero, propuestas", description: "Tu agente te muestra distintas direcciones y ejemplos. T\xFA eliges antes de editar." },
439
+ { id: "sample", title: "Primero, una muestra", description: "Revisas un frame con tu material o un fragmento corto antes del video completo." },
440
+ { id: "direct", title: "Editar directamente", description: "Tu agente usa tu marca y tus preferencias para editar y revisar el video completo." }
441
+ ];
442
+ function validateOnboardingAccount(value) {
443
+ if (!value || typeof value !== "object" || Array.isArray(value) || Object.keys(value).some((k) => !["reviewMode", "integrations"].includes(k))) throw new Error("accountSetup contiene campos desconocidos. No admite credenciales.");
444
+ const input = value;
445
+ if (input.reviewMode !== void 0 && !onboardingReviewOptions.some((v) => v.id === input.reviewMode)) throw new Error("Modo de revisi\xF3n inv\xE1lido.");
446
+ if (input.integrations !== void 0) {
447
+ if (!Array.isArray(input.integrations) || input.integrations.length > 20 || new Set(input.integrations.map((v) => v?.providerId)).size !== input.integrations.length) throw new Error("Integraciones inv\xE1lidas o duplicadas.");
448
+ for (const entry of input.integrations) {
449
+ if (!entry || typeof entry !== "object" || Array.isArray(entry) || Object.keys(entry).some((k) => !["providerId", "enabled", "accessMethod", "preferences"].includes(k))) throw new Error("Integraci\xF3n inv\xE1lida.");
450
+ const { providerId, ...settings } = entry;
451
+ validateIntegrationUpdate(providerId, { ...settings, expectedRevision: 0 });
452
+ }
453
+ }
454
+ return JSON.parse(JSON.stringify(input));
455
+ }
456
+ function onboardingAccountActions(value) {
457
+ const input = value === void 0 ? {} : validateOnboardingAccount(value);
458
+ return {
459
+ status: input.reviewMode !== void 0 || input.integrations?.length ? "pending" : "not-requested",
460
+ requested: input,
461
+ scope: { reviewMode: "workspace", integrations: "authenticated-member-or-connection" },
462
+ instructions: "These are requested account changes, not saved preferences. Authenticate the intended workspace/member. Read workflow get/get_workflow_preferences and integrations list/get_integrations. Compare current values with these choices. Apply only requested differences using workflow set/set_workflow_preferences or integrations set/set_integration with the current expectedRevision; preserve unmentioned providers and merge unmentioned preference fields from the current entry. Stop on a conflict or uncertain write, reread before resuming. Verify persisted values with fresh reads and check_workflow. Never claim account setup complete after document sync alone. Enabling an integration declares access; verify the actual host tool before use and never infer spending authorization.",
463
+ links: { review: "https://editorbrain.com/app/preferences", integrations: "https://editorbrain.com/app/integrations" }
464
+ };
465
+ }
466
+
467
+ // packages/core/src/editing-interaction.ts
468
+ function editingInteraction(questionMode, reviewMode) {
469
+ if (questionMode !== void 0 && !questionModeOptions.some((option) => option.id === questionMode)) throw new Error("Invalid question mode.");
470
+ if (reviewMode !== void 0 && !onboardingReviewOptions.some((option) => option.id === reviewMode)) throw new Error("Invalid review mode.");
471
+ const resolved = questionMode !== void 0 && reviewMode !== void 0;
472
+ return {
473
+ status: resolved ? "resolved" : "needs-project-context",
474
+ questionMode: questionMode ?? null,
475
+ reviewMode: reviewMode ?? null,
476
+ questions: !resolved ? "resolve-context-first" : questionMode === "autonomous" ? "none" : questionMode === "essential" ? "consequential-gaps-only" : "short-recommended-choices",
477
+ firstVisual: !resolved ? null : reviewMode === "direct" ? "review" : reviewMode,
478
+ visualScope: "Only when this decision is still open; reuse valid scoped choices and approvals instead of repeating them.",
479
+ reviewNotice: resolved && questionMode === "autonomous" && reviewMode !== "direct" ? "Sin preguntas no elimina la revisi\xF3n que elegiste. Preparar\xE9 tus propuestas o muestra y dejar\xE9 la aprobaci\xF3n pendiente. Para futuras ediciones sin pausas creativas puedes elegir Editar directamente; no cambiar\xE9 ese ajuste por mi cuenta." : null,
480
+ routing: "Use the current request and inspected material to enter at the next unresolved decision. Chat, footage, an idea and a copied web selection converge on the same project context. Reuse answered questions, pinned selections and valid scoped approvals. An animation selection is not a complete editorial direction or approval of a sample.",
481
+ presentation: "Briefly state the next useful action, not the internal checklist. Show visual directions only while direction is open and review mode calls for them; skip redundant choices. Direct mode delivers a review artifact without a new mid-edit gate. A scoped revision preserves unaffected work. Local HTML actions prepare copy-to-chat feedback; never claim they sent work automatically.",
482
+ authority: "routing-not-approval"
483
+ };
484
+ }
485
+
486
+ // packages/core/src/creator-context.ts
487
+ var creatorContextOptions = {
488
+ teamSize: [["solo", "Solo yo"], ["small", "2 a 5 personas"], ["mid", "6 a 20 personas"], ["large", "M\xE1s de 20 personas"]],
489
+ approver: [["me", "Yo decido"], ["lead", "Mi l\xEDder o responsable"], ["brand", "Marca o legal"]],
490
+ brandManual: [["yes", "Tenemos manual de marca"], ["no", "Todav\xEDa no tenemos manual"]],
491
+ clientCount: [["few", "1 a 3 clientes"], ["some", "4 a 10 clientes"], ["many", "M\xE1s de 10 clientes"]],
492
+ clientReview: [["direct", "El cliente revisa"], ["us", "Revisamos nosotros"], ["mixed", "Depende del cliente"]],
493
+ settingUp: [["client", "Una marca de cliente"], ["agency", "Mi agencia"]]
494
+ };
495
+ function creatorContextIssues(value) {
496
+ if (value === void 0) return [];
497
+ if (!value || typeof value !== "object" || Array.isArray(value)) return ["creatorContext debe ser un objeto."];
498
+ return Object.entries(value).flatMap(([key, choice]) => Object.hasOwn(creatorContextOptions, key) && creatorContextOptions[key].some((o) => o[0] === choice) ? [] : [`Contexto de trabajo inv\xE1lido: ${key}.`]);
499
+ }
500
+
378
501
  // packages/core/src/creative-direction.ts
379
502
  var creativePreferenceSections = [
380
503
  { id: "brand", title: "Marca y tipograf\xEDa", question: "\xBFConservamos tus colores, fuentes e idioma, o quieres ajustarlos?" },
@@ -1241,109 +1364,6 @@ function validateOnboardingTastePatch(value) {
1241
1364
  return JSON.parse(JSON.stringify(value));
1242
1365
  }
1243
1366
 
1244
- // packages/core/src/integrations.ts
1245
- var integrationCatalog = [
1246
- { id: "higgsfield", name: "Higgsfield", description: "Im\xE1genes y clips generados para apoyar tu edici\xF3n.", capabilities: ["image", "video"], accessMethods: ["agent", "api", "browser", "files"], docsUrl: "https://open.higgsfield.ai/quick-start" },
1247
- { id: "kie-ai", name: "Kie AI", description: "Im\xE1genes, video, voz y m\xFAsica con tu propia cuenta de Kie AI.", capabilities: ["image", "video", "voiceover", "music"], accessMethods: ["api", "agent", "files"], docsUrl: "https://docs.kie.ai/" },
1248
- { id: "elevenlabs", name: "ElevenLabs", description: "Voces, efectos de sonido y m\xFAsica generada.", capabilities: ["voiceover", "sfx", "music"], accessMethods: ["agent", "api", "browser", "files"], docsUrl: "https://elevenlabs.io/docs/overview" },
1249
- { id: "suno", name: "Suno", description: "M\xFAsica generada con Suno; el acceso API depende de tu cuenta.", capabilities: ["music"], accessMethods: ["browser", "api", "files"], docsUrl: "https://platform.suno.com/" },
1250
- { id: "openai-images", name: "OpenAI Images", description: "Creaci\xF3n y edici\xF3n de im\xE1genes para tu contenido.", capabilities: ["image"], accessMethods: ["agent", "api", "browser", "files"], docsUrl: "https://platform.openai.com/docs/guides/image-generation" },
1251
- { id: "pexels", name: "Pexels", description: "Fotos y videos de stock; revisa la licencia y el contexto de uso.", capabilities: ["stock-image", "stock-video"], accessMethods: ["agent", "api", "browser", "files"], docsUrl: "https://www.pexels.com/api/documentation/" },
1252
- { id: "assemblyai", name: "AssemblyAI", description: "Transcripci\xF3n con marcas de tiempo para planificar cortes y subt\xEDtulos.", capabilities: ["transcription"], accessMethods: ["agent", "api", "files"], docsUrl: "https://www.assemblyai.com/docs" }
1253
- ];
1254
- function object2(value) {
1255
- return value !== null && typeof value === "object" && !Array.isArray(value);
1256
- }
1257
- function knownFields(value, allowed) {
1258
- if (Object.keys(value).some((key) => !allowed.includes(key))) throw new Error("Unknown integration field. Credentials and user/workspace IDs are not accepted.");
1259
- }
1260
- function containsCredential(value) {
1261
- return /-----BEGIN [A-Z ]*PRIVATE KEY-----|\bBearer\s+\S{12,}|\b(?:sk-(?:proj-)?|AIza|cfat_|apikey_|tlk_)[A-Za-z0-9_-]{15,}|\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+|(?:api[_ -]?key|access[_ -]?token|secret|password)\s*[:=]\s*["']?\S{8,}/i.test(value);
1262
- }
1263
- function validateIntegrationUpdate(providerId, input) {
1264
- const provider = integrationCatalog.find((entry) => entry.id === providerId);
1265
- if (!provider) throw new Error("Unknown integration provider.");
1266
- if (!object2(input)) throw new Error("Integration settings must be an object.");
1267
- knownFields(input, ["enabled", "accessMethod", "preferences", "expectedRevision"]);
1268
- if (typeof input.enabled !== "boolean") throw new Error("enabled must be a boolean.");
1269
- if (!provider.accessMethods.includes(input.accessMethod)) throw new Error("Unsupported access method for this provider.");
1270
- if (!Number.isSafeInteger(input.expectedRevision) || input.expectedRevision < 0) throw new Error("The current expectedRevision is required.");
1271
- if (!object2(input.preferences)) throw new Error("preferences must be an object.");
1272
- knownFields(input.preferences, ["instructions", "model", "voiceId", "language", "musicMode", "spending"]);
1273
- const preferences = {};
1274
- for (const [field, max] of [["instructions", 1e3], ["model", 120], ["voiceId", 120], ["language", 60]]) {
1275
- const value = input.preferences[field];
1276
- if (value === void 0) continue;
1277
- if (typeof value !== "string" || value.length > max || /[\u0000-\u0008\u000b\u000c\u000e-\u001f]/.test(value)) throw new Error(`${field} must be text of at most ${max} characters.`);
1278
- if (containsCredential(value)) throw new Error("Credentials must stay in your provider connection, never in integration preferences.");
1279
- if (value.trim()) preferences[field] = value.trim();
1280
- }
1281
- const musicMode = input.preferences.musicMode, spending = input.preferences.spending;
1282
- if (musicMode !== void 0) {
1283
- if (!provider.capabilities.includes("music") || !["instrumental", "vocals", "either"].includes(musicMode)) throw new Error("musicMode is only available for music integrations.");
1284
- preferences.musicMode = musicMode;
1285
- }
1286
- if (preferences.voiceId && !provider.capabilities.includes("voiceover")) throw new Error("voiceId is only available for voice integrations.");
1287
- if (spending !== void 0 && !["ask", "use-approved-budget"].includes(spending)) throw new Error("Invalid spending preference.");
1288
- preferences.spending = spending ?? "ask";
1289
- return { enabled: input.enabled, accessMethod: input.accessMethod, preferences, expectedRevision: input.expectedRevision };
1290
- }
1291
- var integrationExecutionPolicy = {
1292
- version: 1,
1293
- selection: "explicit-task-choice-then-compatible-saved-access-then-propose",
1294
- externalCredits: "host-or-provider-account; never require EditorBrain creative credits",
1295
- builtInCredits: "EditorBrain Studio catalog and quote; personal provider access does not unlock Studio",
1296
- verification: "current-session-tool, authentication, supported-model, cost-and-existing-task-budget",
1297
- fallback: "no automatic paid provider or access-method switch",
1298
- uncertainSubmission: "recover existing provider job before resubmitting or switching",
1299
- unknownBalance: "unknown is not zero; do not claim insufficient credits without evidence"
1300
- };
1301
- function integrationRoutes(entries, catalog = integrationCatalog) {
1302
- return entries.filter((entry) => entry.enabled).map((entry) => {
1303
- const provider = catalog.find((item) => item.id === entry.providerId);
1304
- return {
1305
- routeId: `integration:${entry.providerId}:${entry.accessMethod}`,
1306
- providerId: entry.providerId,
1307
- accessMethod: entry.accessMethod,
1308
- capabilities: provider?.capabilities ?? [],
1309
- execution: entry.accessMethod === "files" ? "existing-files" : "verify-in-current-session",
1310
- billingScope: entry.accessMethod === "files" ? "no-generation" : "host-or-provider",
1311
- requiresEditorBrainCreativeCredits: false
1312
- };
1313
- });
1314
- }
1315
-
1316
- // packages/core/src/onboarding-account.ts
1317
- var onboardingReviewOptions = [
1318
- { id: "directions", title: "Primero, propuestas", description: "Tu agente te muestra distintas direcciones y ejemplos. T\xFA eliges antes de editar." },
1319
- { id: "sample", title: "Primero, una muestra", description: "Revisas un frame con tu material o un fragmento corto antes del video completo." },
1320
- { id: "direct", title: "Editar directamente", description: "Tu agente usa tu marca y tus preferencias para editar y revisar el video completo." }
1321
- ];
1322
- function validateOnboardingAccount(value) {
1323
- if (!value || typeof value !== "object" || Array.isArray(value) || Object.keys(value).some((k) => !["reviewMode", "integrations"].includes(k))) throw new Error("accountSetup contiene campos desconocidos. No admite credenciales.");
1324
- const input = value;
1325
- if (input.reviewMode !== void 0 && !onboardingReviewOptions.some((v) => v.id === input.reviewMode)) throw new Error("Modo de revisi\xF3n inv\xE1lido.");
1326
- if (input.integrations !== void 0) {
1327
- if (!Array.isArray(input.integrations) || input.integrations.length > 20 || new Set(input.integrations.map((v) => v?.providerId)).size !== input.integrations.length) throw new Error("Integraciones inv\xE1lidas o duplicadas.");
1328
- for (const entry of input.integrations) {
1329
- if (!entry || typeof entry !== "object" || Array.isArray(entry) || Object.keys(entry).some((k) => !["providerId", "enabled", "accessMethod", "preferences"].includes(k))) throw new Error("Integraci\xF3n inv\xE1lida.");
1330
- const { providerId, ...settings } = entry;
1331
- validateIntegrationUpdate(providerId, { ...settings, expectedRevision: 0 });
1332
- }
1333
- }
1334
- return JSON.parse(JSON.stringify(input));
1335
- }
1336
- function onboardingAccountActions(value) {
1337
- const input = value === void 0 ? {} : validateOnboardingAccount(value);
1338
- return {
1339
- status: input.reviewMode !== void 0 || input.integrations?.length ? "pending" : "not-requested",
1340
- requested: input,
1341
- scope: { reviewMode: "workspace", integrations: "authenticated-member-or-connection" },
1342
- instructions: "These are requested account changes, not saved preferences. Authenticate the intended workspace/member. Read workflow get/get_workflow_preferences and integrations list/get_integrations. Compare current values with these choices. Apply only requested differences using workflow set/set_workflow_preferences or integrations set/set_integration with the current expectedRevision; preserve unmentioned providers and merge unmentioned preference fields from the current entry. Stop on a conflict or uncertain write, reread before resuming. Verify persisted values with fresh reads and check_workflow. Never claim account setup complete after document sync alone. Enabling an integration declares access; verify the actual host tool before use and never infer spending authorization.",
1343
- links: { review: "https://editorbrain.com/app/preferences", integrations: "https://editorbrain.com/app/integrations" }
1344
- };
1345
- }
1346
-
1347
1367
  // packages/core/src/audio-production.ts
1348
1368
  var audioProductionOptions = {
1349
1369
  musicIntensity: ["none", "subtle", "present"],
@@ -1516,6 +1536,7 @@ function getOnboardingGuide(intake) {
1516
1536
  visualCatalog: "Use list_media_styles/get_media_style for the same image and animation choices as web. Product demos orient taste; inspect the edited-video library before editing.",
1517
1537
  advanced: "Existing references, pronunciation/glossary, assets and detailed audio/tool settings are preserved. They are not required onboarding questions. Configure with their dedicated editors/tools when requested."
1518
1538
  },
1539
+ interactionPreview: { ...editingInteraction(intake?.profile?.questionMode ?? void 0, intake?.accountSetup?.reviewMode), basis: "draft-not-saved" },
1519
1540
  consultation: { options: questionModeOptions, field: "profile.questionMode", ...resolveQuestionPolicy(intake?.profile?.questionMode ?? void 0) },
1520
1541
  ...intake ? { current: intake, configuration: creativeConfiguration(intake.profile?.creativeDirection ?? void 0, intake.profile?.creativePreferencesReviewed ?? void 0) } : {},
1521
1542
  creativePreferences: { modes: creativeDirectionOptions, sections: creativePreferenceSections, confirmationField: "profile.creativePreferencesReviewed", rule: "Marca una categor\xEDa solo despu\xE9s de que el usuario confirme sus elecciones o decida delegarlas. Los campos precargados y saltar pasos no son confirmaci\xF3n. Al cambiar a guided, completa las categor\xEDas pendientes antes de editar salvo questionMode=autonomous: delega los detalles abiertos por proyecto sin marcar categor\xEDas revisadas; conserva las ya revisadas y todos los valores previos." },
@@ -181449,13 +181470,6 @@ function getAuthoredMotionCard(id2, version) {
181449
181470
  return structuredClone(result2);
181450
181471
  }
181451
181472
 
181452
- // packages/core/src/commercial.ts
181453
- var TOP_UPS = [
181454
- { id: "credits_500", cents: 1e3, credits: 500 },
181455
- { id: "credits_1000", cents: 2e3, credits: 1e3 }
181456
- ];
181457
- var TOP_UP = TOP_UPS[1];
181458
-
181459
181473
  // packages/core/src/production-visual.ts
181460
181474
  var SOCIAL_SAFE_PROFILES = {
181461
181475
  tiktok: { bottom: 0.25, right: 0.15, top: 0.08, left: 0.05 },
@@ -183121,6 +183135,50 @@ var VERIFIED_GUIDANCE_RELEASES = [
183121
183135
  "editorbrain/references/style-creator.md": "1b1bc289a5bc308cbbf7f4d699de2933b8934733a2b69b3e98fb1b7420d986f2",
183122
183136
  "editorbrain/references/workspace-files.md": "29bbddc894ed000bddd065bcb660629e64b29a5cf54dd6850e810b25c990558d"
183123
183137
  }
183138
+ },
183139
+ {
183140
+ "version": "0.39.1",
183141
+ "archiveSha256": "d53f7a9d09b265d0157476840896586b4814dbfdfc460e00c7498e4354cffb28",
183142
+ "files": {
183143
+ "editorbrain-formats/SKILL.md": "65ea59aae091ca9618b5e479befe0c76edf174df7091ed74d4307485a2252fcd",
183144
+ "editorbrain-formats/references/aspirational-list-demo.md": "e884ce44d15f4496812ed18120f7d4c49c4261e148fcefe05c77c110b589771c",
183145
+ "editorbrain-formats/references/cumulative-tier-list.md": "7b7e8208687c6b925443e55d640ced6c1d09824377884244a09d7f3089d60aa5",
183146
+ "editorbrain-formats/references/numbered-tutorial.md": "95754ae7dbfaa678e11ddf1a2b84710dba83a16e2fa4055051bd4f5f4f868a5f",
183147
+ "editorbrain-motion/SKILL.md": "7c27051ae2b7597e45cfafaecb37be79a7cd9bd9788ae515723dbc20c2f34a37",
183148
+ "editorbrain-motion/references/authored-scenes.md": "1056007808a76e2eb02df9ed11cdd1f464e26e2981111e87ce965efb7937fed0",
183149
+ "editorbrain-motion/references/code-motion.md": "50382a797adc1e1596086e2408e81ee75ceb6730ca409be9c884646db643a7cd",
183150
+ "editorbrain-motion/references/component-library.md": "e88ed19d2ab9dca8d2ea02abe6c476021c03b9679bce99292cf7da52d65d2236",
183151
+ "editorbrain-motion/references/generated-motion.md": "a8d214b53c15f742658abd84f03b768fa2821f8cde94f50aab82a3759a30b36b",
183152
+ "editorbrain-motion/references/motion-craft.md": "dae520b0e641fc9c3bf937241936588a855bf3453358e239ccc3cc3a2bcf0825",
183153
+ "editorbrain/AGENTS.md": "b240449d452c824415062a2b422bf55a5ae2d868a81083989d10ffaeb5c33a3f",
183154
+ "editorbrain/SKILL.md": "9236cc479e4b90b1a8a6c1ead279db7293a95fa8f1cc1fbffcffe6957f1d50d0",
183155
+ "editorbrain/references/audio-production.md": "9800505dcb320b58f35aeaed77303039d8fffb2c29b46c43cedeeba8637d2482",
183156
+ "editorbrain/references/cli-mcp.md": "3e2b27e45050410da9d0e425fd90ef816579d3c39331e7cb83b81c5862d8e7de",
183157
+ "editorbrain/references/editorial-evidence.md": "16ce55316b330e5fec85654012ccbdd78ec1175bfd092762638c93c57d845a72",
183158
+ "editorbrain/references/editorial-families.md": "b802ec6f02fd079e99df84d69a3c515d63ad058960b568c0c7b7dec1912495dd",
183159
+ "editorbrain/references/family-animated.md": "54a140d0a64b01147c52ea8cbaab4e4599bfe1af330f5a3ad6ef2a30351ab47d",
183160
+ "editorbrain/references/family-demonstration.md": "737334a8d9230682cde3a6ed11bfc02c4f9795c8f25a3b668be9d7393ec3e53d",
183161
+ "editorbrain/references/family-essay.md": "003f2cd450f33ba6641a9b1114cbc578c04cbb658b992c89c765d43198d1b4c2",
183162
+ "editorbrain/references/family-personal.md": "e93c304d7bc7d3eb31a3c9cb3be83f4f48d41319c2ac2e1e6f53f38576f5e644",
183163
+ "editorbrain/references/family-presenter.md": "76b8140b924930b306ce97772d6a7b683870bd14f19772b5339a490752b7de24",
183164
+ "editorbrain/references/first-edit.md": "c8986ec896941c70b0267da672691170de3e34253ead838b4dc28758e661c9ea",
183165
+ "editorbrain/references/integrations.md": "b5e7ba099acd79053cdd09822092eb121add6de39eada2d6911ad5a4f452ce2a",
183166
+ "editorbrain/references/local-production.md": "268a05706a3c1cae4f61248437c00be3e9ee18b2a0f747c8cd054d88f0a33661",
183167
+ "editorbrain/references/media-preferences.md": "87e508a75cdb6f4644db767273bfb230fb79f182ed05ee0f6257c6c05ea4dc7a",
183168
+ "editorbrain/references/memory-and-review.md": "406589a18e9e86ad8ce7d71e0f5bf00f67dab42c05af7721482fdca1c25c7c1b",
183169
+ "editorbrain/references/motion-review.md": "0fb09a2d61ecd13114ced5cca5daa4580a922cf7d7b3f8698077ceb0e96da6f0",
183170
+ "editorbrain/references/onboarding.md": "2cb212c60f26c6877a865170cf5a52091243ca374f0f8e93dad9ebfbf0427ed1",
183171
+ "editorbrain/references/personal-resources.md": "92ce6f32191929bd946c97305452521f6048d6bb8ea371e9083536eff5ce9512",
183172
+ "editorbrain/references/production-and-review.md": "28a64ee6407a1de7dc204776c158408c11b3987020ad1bdd1b79fd19745fbffa",
183173
+ "editorbrain/references/production-continuity.md": "b73a851bff421fa24e364d8848e312e54de1d3d971099a567295c80a5e18d8c6",
183174
+ "editorbrain/references/real-media.md": "cfad1aa15198dfe5ecc1f1b67c96d43a7d2084e7f5119de93d1b360203694938",
183175
+ "editorbrain/references/search-brief.md": "ea2a9c2d5a5cf685c1e5918366901ef2589c4d79aaa78a0dd31e97d6fed42b7b",
183176
+ "editorbrain/references/sfx-library.md": "d7ee0d2916559ce11a7fd244ccbcb98172413653c3fdbe0545e57b3eda543b16",
183177
+ "editorbrain/references/storage-and-previews.md": "9d06a6bb49f13e23f0af7d5ef35444dd553d1ce8af28662a9aba054b4d0081a5",
183178
+ "editorbrain/references/studio.md": "dfea5aa070e5e600f27a2983530c816d9f77b15f7bcec02c02301d6969b11fe8",
183179
+ "editorbrain/references/style-creator.md": "1b1bc289a5bc308cbbf7f4d699de2933b8934733a2b69b3e98fb1b7420d986f2",
183180
+ "editorbrain/references/workspace-files.md": "29bbddc894ed000bddd065bcb660629e64b29a5cf54dd6850e810b25c990558d"
183181
+ }
183124
183182
  }
183125
183183
  ];
183126
183184
  function isVerifiedHistoricalGuidance(skillName, relativePath, sha2562) {
@@ -183363,6 +183421,8 @@ import { resolve as resolve4 } from "node:path";
183363
183421
  // packages/cli/src/client.ts
183364
183422
  import { setTimeout as delay } from "node:timers/promises";
183365
183423
  var searchErrors = {
183424
+ resource_policy_unavailable: { status: 503, code: "RESOURCE_POLICY_UNAVAILABLE", hint: "La pol\xEDtica de recursos no est\xE1 disponible. Contin\xFAa el trabajo independiente y consulta el estado del servicio; recargar cr\xE9ditos no lo resuelve." },
183425
+ resource_plan_required: { status: 403, code: "RESOURCE_PLAN_REQUIRED", hint: "Consulta https://editorbrain.com/app/billing o elige un recurso Gratis. Recargar cr\xE9ditos no desbloquea este recurso." },
183366
183426
  sfx_disabled: { status: 409, code: "SFX_DISABLED", hint: "Current project preferences disable added effects here. Continue without SFX, including motion-component defaults. Do not change preferences or suggest buying credits; honor only an explicit project exception." },
183367
183427
  sfx_bank_conflict: { status: 409, code: "SFX_BANK_CONFLICT", hint: "Read workflow and use the configured sound bank. A different bank needs an explicit project exception; do not silently substitute or generate effects." },
183368
183428
  sfx_context_changed: { status: 409, code: "SFX_CONTEXT_CHANGED", hint: "Refresh workflow and SFX search/get/check. Revise the cue plan against current preferences, then check again with its new SFX contextHash." },
@@ -183497,7 +183557,7 @@ var Client = class {
183497
183557
  const retryAfterMs = retryDelay(response.headers.get("Retry-After"), this.runtime.now());
183498
183558
  if (!response.ok) {
183499
183559
  let errorBody;
183500
- if (/^\/v1\/sfx\//.test(path) || /^\/v1\/team(?:\/|$)/.test(path) || path.startsWith("/v1/studio/") || path.startsWith("/v1/batches") && response.status === 409 || path === "/v1/search/brief" && [400, 422, 503].includes(response.status) || /^\/v1\/projects\/[^/]+\/progress$/.test(path) && response.status === 409) {
183560
+ if (/^\/v1\/authored-motion(?:\/|\?|$)/.test(path) || /^\/v1\/sfx\//.test(path) || /^\/v1\/team(?:\/|$)/.test(path) || path.startsWith("/v1/studio/") || path.startsWith("/v1/batches") && response.status === 409 || path === "/v1/search/brief" && [400, 422, 503].includes(response.status) || /^\/v1\/projects\/[^/]+\/progress$/.test(path) && response.status === 409) {
183501
183561
  try {
183502
183562
  const diagnostic = searchDiagnostic(response.status, await boundedJson(response, 16 * 1024));
183503
183563
  errorBody = diagnostic ? { error: { code: diagnostic.serviceCode } } : void 0;
@@ -189436,6 +189496,10 @@ async function downloadAuthoredSource(client, pin, root, out, fetcher = fetch) {
189436
189496
  const trustedOrigin = url2.origin === origin || origin === "https://editorharness-api.innovandohorizontes.workers.dev" && url2.origin === "https://api.editorbrain.com";
189437
189497
  if (metadata.sha256 !== pin.sha256 || metadata.bytes !== pin.bytes || !trustedOrigin || url2.pathname !== expectedPath || url2.username || url2.password || url2.hash) throw new CliError("INVALID_RESPONSE", "Scene bundle metadata differs from the selected version.", "Do not use this source. Retrieve the pinned catalog entry again.");
189438
189498
  const response = await fetcher(url2, { redirect: "error", signal: AbortSignal.timeout(18e4) });
189499
+ if (response.status === 403) {
189500
+ await response.body?.cancel();
189501
+ throw new CliError("RESOURCE_ACCESS_CHANGED", "Source access was denied at download time.", "Check current workspace permissions and membership at https://editorbrain.com/app/billing. Do not retry old versions or buy credits to unlock premium resources; existing archives were preserved.");
189502
+ }
189439
189503
  if (!response.ok) throw new CliError("DOWNLOAD_FAILED", `Scene download failed (HTTP ${response.status}).`, "Request a new source link; existing archives were preserved.");
189440
189504
  const reader = response.body?.getReader();
189441
189505
  if (!reader) throw new CliError("INVALID_RESPONSE", "Scene download body is missing.", "Retry the pinned source.");
@@ -190661,13 +190725,13 @@ Waiting for authorization. Press Ctrl+C to cancel.
190661
190725
  async function main() {
190662
190726
  const args = parseArgs(process.argv.slice(2));
190663
190727
  const [command, subcommand, argument] = args.positional;
190664
- if (args.flags.all && command !== "pull") throw new Error("--all is supported only by pull.");
190728
+ if (args.flags.all && !["pull", "update"].includes(command)) throw new Error("--all is supported only by pull and update.");
190665
190729
  if (args.flags.all && str(args, "project")) throw new Error("Choose --project or --all, not both.");
190666
190730
  if (command === "version" || args.flags.version) {
190667
190731
  output({ name: "EditorBrain", version: await cliVersion() });
190668
190732
  return;
190669
190733
  }
190670
- if (args.flags["dry-run"] && !["push", "pull"].includes(command) && !(command === "onboarding" && ["apply", "sync"].includes(subcommand))) throw new CliError("INVALID_ARGUMENT", "--dry-run is supported by push, pull and onboarding apply/sync.", "Read editorbrain help.");
190734
+ if (args.flags["dry-run"] && !["push", "pull", "update"].includes(command) && !(command === "onboarding" && ["apply", "sync"].includes(subcommand))) throw new CliError("INVALID_ARGUMENT", "--dry-run is supported by push, pull, update and onboarding apply/sync.", "Read editorbrain help.");
190671
190735
  if (args.flags.offline && command !== "doctor" && !(command === "production" && ["verify", "mix-events"].includes(subcommand))) throw new CliError("INVALID_ARGUMENT", "--offline is supported by doctor, production verify and project-scoped mix-events.", "Read editorbrain help.");
190672
190736
  if (!command || command === "help" || args.flags.help) {
190673
190737
  process.stdout.write(HELP);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "editorbrain",
3
- "version": "0.39.1",
3
+ "version": "0.40.1",
4
4
  "description": "EditorBrain editorial knowledge, portable workspaces and skills for AI video agents",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -17,11 +17,16 @@ When the user asks to save an edit as a style, create a new style or improve an
17
17
 
18
18
  ## Start here, including a first installation
19
19
 
20
+ For a new request, use [adaptive entry](references/starting-an-edit.md) to choose
21
+ the next unresolved action from chat, supplied footage, an idea or a copied web
22
+ selection. Reuse it within the session. This is not a fixed wizard: skip answered
23
+ questions and approved choices, and preserve scope on corrections.
24
+
20
25
  Before composing an edit with visual support, use the [media acquisition guide](references/real-media.md), including for fully animated videos. Cover the relevant beats with acquired and inspected user/web/generated resources as appropriate. Resolved/workflow `mediaAcquisition`, when available, turns the effective choices into planning guidance; it is not proof of searches or tool access. Searching EditorBrain for editing techniques is a separate job.
21
26
 
22
27
  1. Read the bundled [AGENTS.md](AGENTS.md) once for the editorial contract. Do not assume the host loads this nested file automatically.
23
28
  2. If no workspace is ready, use [first edit](references/first-edit.md). For visual onboarding inside this agent, load [onboarding](references/onboarding.md) only then; discover command availability before use. Verify connection, discover or create the active project, and prepare its context without overwriting existing files. Read [CLI and MCP](references/cli-mcp.md) only for the commands needed now. If connected access is team-restricted, follow its team section before retrieving context or sharing media; permissions do not override the selected project’s preferences.
24
- 3. Match any requested brand name to its saved ID before selecting or creating a project; use compact brand/project discovery when available, and never guess between duplicates. Read the selected project's `project.json`, brief, direction and the brand/style files it names. Resolve effective tokens and inspect available editing tools. Use `check_workflow` (CLI `editorbrain workflow check`) for creative direction, review preference, scoped memory and personal integrations. If creative configuration is pending, complete only those categories through [onboarding](references/onboarding.md) before editing. Choose the resource route before checking funds: personal integrations/native host tools do not require EditorBrain creative credits; built-in tools do. Never switch paid routes silently. On a blocker, explain the next step with a verified link and one compatible alternative; use returned recovery guidance. Declared access is not a working connection; check the needed provider in this session and read [integrations](references/integrations.md) only when using or configuring one. If `audioProduction` is present, honor its voice/SFX/loudness choices; read [audio production](references/audio-production.md) when needed. Use `context.mediaPreferences` for saved image/motion choices; fetch only needed recipes with `get_media_style` / `media style <id> --style-version <version>` (see [media preferences](references/media-preferences.md) when adapting them). Compare workflow version and `contextVersion` at later checkpoints; fetch changed context before acting. Do not load every project or library document.
29
+ 3. Match any requested brand name to its saved ID before selecting or creating a project; use compact brand/project discovery when available, and never guess between duplicates. Read the selected project's `project.json`, brief, direction and the brand/style files it names. Resolve effective tokens and inspect available editing tools. Use `check_workflow` (CLI `editorbrain workflow check`) for creative direction, review preference, scoped memory and personal integrations. If creative configuration is pending, complete only those categories through [onboarding](references/onboarding.md), respecting questionPolicy: autonomous delegates reversible aesthetics per project without marking them confirmed or blocking on optional choices. Choose the resource route before checking funds: personal integrations/native host tools do not require EditorBrain creative credits; built-in tools do. Never switch paid routes silently. On a blocker, explain the next step with a verified link and one compatible alternative; use returned recovery guidance. Declared access is not a working connection; check the needed provider in this session and read [integrations](references/integrations.md) only when using or configuring one. If `audioProduction` is present, honor its voice/SFX/loudness choices; read [audio production](references/audio-production.md) when needed. Use `context.mediaPreferences` for saved image/motion choices; fetch only needed recipes with `get_media_style` / `media style <id> --style-version <version>` (see [media preferences](references/media-preferences.md) when adapting them). Compare workflow version and `contextVersion` at later checkpoints; fetch changed context before acting. Do not load every project or library document.
25
30
  4. Inspect the actual script/video yourself. Understand its argument, goal, audience, tone, rhythm, usable resources and brand restrictions. For unfamiliar multi-clip material or technical render checks, use [local production](references/local-production.md) as needed. Read compact results and fetch details only to answer a specific question. Declare what you could inspect: script, frames, motion, audio and coverage. If you cannot access a modality, keep the limitation explicit; never invent it from a filename.
26
31
  5. Ground each new edit or materially changed direction in the **edited-video reference library**, including when a favorite style is selected. Search with `search_from_brief` (CLI `editorbrain search brief --file <brief.json>`) and the project ID after inspecting the material. Read [search brief](references/search-brief.md) for the schema and [editorial evidence](references/editorial-evidence.md) for selection/adaptation. Search communicative needs, not a guessed template. A scoped revision may reuse still-valid inspected evidence and approval. The optional `search_for_edit` server-analysis path is never an automatic fallback.
27
32
  6. For a new or materially changed direction, use [editorial families](references/editorial-families.md) to load only the relevant method; a fitting saved method or small correction can reuse its decisions. Survey candidates across the video's needs, then inspect selected documents and actual frames/intervals, plus audio when sound matters. Build a coherent scene-level palette of techniques: opening, imagery, type, explanation and transitions can come from different references. A shortlist is not a single template for the whole video. Use preferences to retain, adapt or reject mechanisms; save evidence, limitations and beat-level adaptations in `direction.md`. A motion-catalog lookup does not complete this step. If evidence is inaccessible or unsuitable, disclose the gap. For factual beats, compare allowed user footage and authentic web media with authored explanation. The engine does not dictate the imagery or entire layout.
@@ -1,6 +1,8 @@
1
1
  # First edit: from an empty folder to reviewed output
2
2
 
3
- Use this only when the user's environment or project is not ready. Do not re-onboard an existing project.
3
+ Use this only when the user's environment or project is not ready. Do not re-onboard an existing project. Use [adaptive entry](starting-an-edit.md)
4
+ to reuse supplied material, selections and answers; setup is only for a missing
5
+ dependency, not a required introduction on every video.
4
6
 
5
7
  ## Establish a working workspace
6
8
 
@@ -177,7 +177,10 @@ read the current request first. If the user already said no questions, honor it
177
177
  this task without asking them to confirm that preference again. A saved brand choice
178
178
  requires an explicit request; project.json.questionMode is a scoped override.
179
179
  Use get_onboarding_guide.consultation for shared labels and guidance. Frequency is
180
- separate from aesthetics and reviewMode. For unattended edits, explain once that
180
+ separate from aesthetics and reviewMode. Use [adaptive entry](starting-an-edit.md)
181
+ for the user-facing handoff. `get_onboarding_guide.interactionPreview`, when
182
+ present, previews draft choices only; `check_workflow.interaction` reflects
183
+ resolved project settings. Never call draft account choices saved. For unattended edits, explain once that
181
184
  direct review avoids creative approval pauses, but never silently change reviewMode.
182
185
 
183
186
  Before asking, inspect material/transcript, current request and saved context. Only
@@ -0,0 +1,114 @@
1
+ # Adaptive start: one project, several entry points
2
+
3
+ This is a routing guide, not a wizard or a mandatory questionnaire. The current
4
+ request, effective preferences and scoped approvals govern. Enter at the next
5
+ unresolved decision; skip what is already known. The shared AGENTS contract owns
6
+ editorial quality, permissions and context precedence.
7
+
8
+ ## Orient, then act
9
+
10
+ Give a short, specific next action once the request is understood. For example:
11
+ “I'll use your saved brand and review this recording before proposing an edit.”
12
+ Do not recite internal tools, every production stage or an onboarding questionnaire.
13
+ Use the user's language; these examples are not required scripts.
14
+
15
+ - **Only “I want a video with EditorBrain”:** retrieve ready context first. If the
16
+ request gives neither accessible footage nor an idea, ask one compact question
17
+ under questionPolicy: “Do you have a recording to edit, or an idea to create?”
18
+ Offer these as choices where the host supports them; plain chat works too.
19
+ If a necessary input is missing in autonomous mode, state what is pending
20
+ without a question, and continue only useful independent preparation. Do not
21
+ invent the user's footage or topic just to produce an artifact.
22
+ - **Footage attached:** inspect it and its usable speech/content. Infer reversible
23
+ details from the actual material and saved preferences. Do not ask “what topic?”
24
+ or “which format?” when already clear. Ask only consequential unresolved needs.
25
+ - **A topic or script without footage:** develop the requested video from that
26
+ brief, using allowed personal/web/generated resources and available tools.
27
+ Do not force the user to record themselves or complete optional setup fields.
28
+ A request for ideas or a script alone does not authorize producing a full video.
29
+ - **A style/reference selected:** preserve its requested method and scope. Show
30
+ how it fits this material instead of asking the user to select it again. If the
31
+ direction is already chosen, do not present competing styles merely to fill
32
+ an artifact. Check actual evidence; a selected style is not a reviewed sample.
33
+ - **One or several animation prompts copied from the web:** retrieve the exact
34
+ IDs/versions, ratios, presets and requested changes. A direct selection is a
35
+ request, not just a like. Inspect fit, explain genuine incompatibilities and
36
+ preserve the rest. These mechanisms do not determine the whole video's style;
37
+ establish only the missing direction and scene uses. A source-only request
38
+ stops at source inspection. Do not concatenate catalog demos into a video.
39
+ - **A correction or resumed project:** open the existing version and pending
40
+ feedback. Reuse valid context, evidence and scoped approvals. Do not restart
41
+ onboarding, regenerate all assets or reoffer styles for a localized change.
42
+
43
+ If connection/project setup is missing, follow [first edit](first-edit.md) for
44
+ only that gap. A new video for an existing brand needs a new project, not new
45
+ brand preferences. Disambiguate identity according to questionPolicy; never
46
+ borrow a different brand or account to keep moving. Resolve the same project
47
+ for CLI and MCP. Use the tool route before checking the applicable credit pool.
48
+
49
+ ## One next action, chosen from the context
50
+
51
+ Read check_workflow/`editorbrain workflow check` before dependent production.
52
+ When available, `interaction` describes saved consultation/review settings.
53
+ `needs-project-context` is unknown, not permission to use another brand's
54
+ settings. Older clients can use questionPolicy and review mode directly.
55
+
56
+ Consultation, creative delegation and review are separate. Do not silently
57
+ rewrite brand/account preferences to reconcile them. Current task instructions
58
+ can supply scoped direction; persist only explicitly requested changes.
59
+
60
+ - **Essential:** ask only unresolved information that materially changes the
61
+ result. Reuse answers and inspect before asking. Use questionPlan for real gaps.
62
+ - **Collaborative:** give a recommendation and a small set of consequential
63
+ choices, at most three questions per round. Do not quiz about every shot.
64
+ - **Autonomous:** make reversible creative decisions from evidence, with no
65
+ questions. Missing source/permission or a required review pauses only affected
66
+ work. State the specific dependency and a recovery action; silence is not consent.
67
+
68
+ For review, apply the preference to the work actually remaining:
69
+ - **Directions:** when direction is open, show 1–3 useful visual directions with
70
+ inspected, labelled examples. Recommend one. If the user already selected the
71
+ direction, record that scoped choice and proceed; don't ask them to choose again.
72
+ - **Sample:** make a representative frame/short clip with the customer's actual
73
+ material before full production. Reuse an already-approved, still-valid sample.
74
+ Picking a style or liking a mechanism does not approve that sample.
75
+ - **Direct:** implement and review without inserting a creative approval pause.
76
+ Still deliver the visual review artifact and permit corrections afterward.
77
+
78
+ If autonomous and directions/sample are both saved, explain the review pause
79
+ once in a short notice (workflow may supply `interaction.reviewNotice`). Prepare
80
+ what can be reviewed and leave the required decision pending without prompting.
81
+ Do not claim unattended completion or switch to direct yourself. If the current
82
+ request already approves a particular direction/sample, reuse only that scope.
83
+ For future unattended work, describe “Editar sin preguntas” + “Editar directamente”
84
+ as an option, not a mandatory settings change. Spending and publication remain
85
+ separately authorized even with that combination.
86
+
87
+ ## Visual continuity, not a page of explanations
88
+
89
+ Use [the review artifact](production-continuity.md#visual-artifact-in-the-users-chat)
90
+ for directions, actual preview and delivery as appropriate. Carry the same
91
+ project/version across them. Do not make an empty welcome artifact or create all
92
+ three stages for every edit. A simple correction can go straight to a new preview.
93
+ Use real inspected reference previews, or label an illustrative proposal honestly.
94
+ The tool and its UI support this interaction; do not invent preview media.
95
+
96
+ Keep one obvious next action: choose the proposed direction, request a localized
97
+ change, or review the delivery. With local HTML, selection/comments prepare a
98
+ message: copy it and paste it in the same Claude/Codex chat to continue. Make this
99
+ step visible beside the action and explain it briefly on the first handoff; don't
100
+ say “sent”, “editing” or “done” just because a button was clicked. Where a host
101
+ supports structured questions, use them for short choices rather than requiring
102
+ an HTML artifact for everything.
103
+
104
+ Check that the actual host can display/play the artifact. If it cannot, attach
105
+ it to open in a browser. Local computer review is the default. Phone/web review
106
+ uses an authorized lightweight private copy and verified project link; do not
107
+ upload originals or send a localhost URL as a phone-accessible preview. Direct
108
+ mode still gets a final artifact, not an additional mandatory approval before
109
+ producing it.
110
+
111
+ End the handoff with what is ready and the next action or specific blocker.
112
+ Keep the full execution/evidence record in project files, not in a wall of chat
113
+ text. This guide does not certify render quality: inspect the actual result and
114
+ preserve the main editorial evidence, media, sound and review contracts.
@@ -91,6 +91,14 @@ Download the asset through existing authenticated asset tools. Never persist exp
91
91
 
92
92
  ## Plan, credits and premium images
93
93
 
94
+ Read `billing status` / `billing_status` for this workspace's current `plans`,
95
+ `planPerks`, `includedAiTools`, actual balance, and availability. Do not copy numeric
96
+ plan terms into prompts or infer tool access from plan names. All four tools accept
97
+ Free credits when enabled; eligibility is distinct from provider availability.
98
+ Free monthly credits refresh on balance reads; do not promise historical rollover
99
+ or another welcome grant after switching brands/workspaces. Recargas and upgrades
100
+ are optional recovery paths, never automatic purchases.
101
+
94
102
  Use `editorbrain billing status` / MCP `billing_status` for this workspace's actual
95
103
  balance, expiry, search allowance and `topUps` offers. Read each offer's `available`
96
104
  flag and the overall billing availability before suggesting a purchase; use the
@@ -10,6 +10,23 @@ Use when a scene needs a visual mechanism (an object transforms, a structure fal
10
10
  4. **Validate the motion.** Watch the selected base video's preview (`kind: "video"`, the default). Compare its transformation and timing with the intended beat before committing to its code. Keyframes and the base preview do not certify the preset or a customer-brand render.
11
11
  5. **Source and adaptation.** Request `get_authored_scene_source` with the exact ID, version and bundle SHA-256, or `editorbrain motion source <id> --scene-version <version> --out .editorbrain-local/new-scene.tar.gz`. Downloads require login, verify size/hash, preserve existing files and never extract or execute automatically. Start from the closest `adapt/<name>.json` overrides when present; replace demo values and bind the current project below. Edit code where the card says parameters cannot express the needed change; author a new scene when none fits.
12
12
 
13
+ ### Resource access and membership
14
+
15
+ Remote results can include `access.tier`, `access.canUse`, `requiredPlan` and
16
+ `policyRevision`. Check these before choosing a source. Premium previews remain
17
+ viewable; source downloads require the authenticated workspace's Creator or
18
+ Studio membership. The CLI's bundled local catalog and cards are discovery data,
19
+ not proof of current account access. The server checks access when issuing and
20
+ redeeming a source link, including older pinned catalog versions.
21
+
22
+ On `resource_plan_required` / `RESOURCE_PLAN_REQUIRED`, explain that the user can
23
+ view the preview, review their membership at https://editorbrain.com/app/billing,
24
+ or choose an eligible Free resource if it fits the scene. Buying credits does
25
+ not unlock premium resources. Never switch accounts, try older versions, alter
26
+ preferences, purchase a plan or replace an explicit selection automatically.
27
+ Previously downloaded files stay local; do not delete them. Classification is
28
+ independent of style fit: eligible does not mean editorially appropriate.
29
+
13
30
  ### Filter by the material and purpose
14
31
 
15
32
  Use the curated facets returned by the catalog; never reclassify a scene from its