editorbrain 0.45.0 → 0.45.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 +2 -2
- package/bin/editorbrain.mjs +109 -24
- package/package.json +1 -1
- package/skill/editorbrain/SKILL.md +3 -0
- package/skill/editorbrain/references/cli-mcp.md +17 -0
- package/skill/editorbrain/references/starting-an-edit.md +3 -0
- package/skill/editorbrain/references/workspace-files.md +20 -7
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.
|
|
8
|
+
npx editorbrain@0.45.1 help
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
For a persistent installation:
|
|
12
12
|
|
|
13
13
|
```sh
|
|
14
|
-
npm install -g editorbrain@0.45.
|
|
14
|
+
npm install -g editorbrain@0.45.1
|
|
15
15
|
editorbrain login --url https://api.editorbrain.com
|
|
16
16
|
editorbrain status --url https://api.editorbrain.com
|
|
17
17
|
editorbrain projects list
|
package/bin/editorbrain.mjs
CHANGED
|
@@ -202828,6 +202828,32 @@ var ApiError = class extends CliError {
|
|
|
202828
202828
|
status;
|
|
202829
202829
|
body;
|
|
202830
202830
|
};
|
|
202831
|
+
function documentDiagnostic(body, endpoint2, status) {
|
|
202832
|
+
const error62 = body?.error;
|
|
202833
|
+
if (!error62 || typeof error62.code !== "string") return void 0;
|
|
202834
|
+
if ([400, 422].includes(status) && ["document_type_unsupported", "document_schema_unsupported"].includes(error62.code)) return { error: { code: error62.code } };
|
|
202835
|
+
if (!(status === 400 && error62.code === "invalid_path" || status === 422 && error62.code === "invalid_document")) return void 0;
|
|
202836
|
+
let legacyCheckpoint = false;
|
|
202837
|
+
if (status === 422 && typeof error62.message === "string" && error62.message.length <= 8192) {
|
|
202838
|
+
try {
|
|
202839
|
+
const path = endpoint2.slice("/v1/documents/".length).split("/").map(decodeURIComponent).join("/");
|
|
202840
|
+
const issues = JSON.parse(error62.message);
|
|
202841
|
+
legacyCheckpoint = /^videos\/[a-z0-9][a-z0-9_-]{0,79}\/checkpoint\.json$/.test(path) && Array.isArray(issues) && issues.length >= 1 && issues.length <= 2 && issues.every((issue3) => issue3 && issue3.path === path && ["schemaVersion must be 1", "Checkpoint has missing or unsupported fields."].includes(issue3.message)) && issues.some((issue3) => issue3.message === "schemaVersion must be 1");
|
|
202842
|
+
} catch {
|
|
202843
|
+
}
|
|
202844
|
+
}
|
|
202845
|
+
return { error: { code: error62.code, ...legacyCheckpoint ? { legacyCheckpoint: true } : {} } };
|
|
202846
|
+
}
|
|
202847
|
+
var UnsupportedDocumentError = class extends ApiError {
|
|
202848
|
+
constructor(status, path) {
|
|
202849
|
+
super(status, void 0);
|
|
202850
|
+
const checkpoint = /^videos\/[^/]+\/checkpoint\.json$/.test(path);
|
|
202851
|
+
this.code = checkpoint ? "CHECKPOINT_UNSUPPORTED" : "DOCUMENT_UNSUPPORTED";
|
|
202852
|
+
this.message = checkpoint ? "El servidor no soporta esta versi\xF3n de checkpoints todav\xEDa." : "El servidor no soporta este tipo o versi\xF3n de documento todav\xEDa.";
|
|
202853
|
+
this.hint = "Actualiza la API de EditorBrain y vuelve a ejecutar push. Conserva el documento local; no elimines campos ni reduzcas su versi\xF3n para forzar la sincronizaci\xF3n.";
|
|
202854
|
+
this.details = { status, documentPath: path };
|
|
202855
|
+
}
|
|
202856
|
+
};
|
|
202831
202857
|
function retryDelay(value, now) {
|
|
202832
202858
|
if (!value) return void 0;
|
|
202833
202859
|
const parsed = /^\d+$/.test(value) ? Number(value) * 1e3 : Date.parse(value) - now;
|
|
@@ -202983,12 +203009,12 @@ var Client = class {
|
|
|
202983
203009
|
const retryAfterMs = retryDelay(response.headers.get("Retry-After"), this.runtime.now());
|
|
202984
203010
|
if (!response.ok) {
|
|
202985
203011
|
let errorBody;
|
|
202986
|
-
if ((/^\/v1\/(?:authored-motion|style-sources|sfx|team|studio|batches|render-cloud|resources)(?:\/|\?|$)/.test(path) || path === "/v1/search/brief" || path === "/v1/projects" || /^\/v1\/projects\/[^/]+\/(?:progress|intake|resolve|export)$/.test(path)
|
|
203012
|
+
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)) {
|
|
202987
203013
|
try {
|
|
202988
203014
|
const parsed = await boundedJson(response, 16 * 1024);
|
|
202989
|
-
const diagnostic = searchDiagnostic(response.status, parsed);
|
|
203015
|
+
const diagnostic = path.startsWith("/v1/documents/") && !/^\/v1\/documents\/videos\/[^/]+\/project\.json$/.test(path) ? void 0 : searchDiagnostic(response.status, parsed);
|
|
202990
203016
|
const voiceRevisionConflict = /^\/v1\/studio\/voice-selection(?:\?|$)/.test(path) && response.status === 409 && parsed?.error?.code === "revision_conflict";
|
|
202991
|
-
errorBody = diagnostic ? { error: { code: diagnostic.serviceCode, ...safeDiagnosticDetails(parsed) } } : voiceRevisionConflict ? { error: { code: "revision_conflict" } } : void 0;
|
|
203017
|
+
errorBody = diagnostic ? { error: { code: diagnostic.serviceCode, ...safeDiagnosticDetails(parsed) } } : voiceRevisionConflict ? { error: { code: "revision_conflict" } } : path.startsWith("/v1/documents/") ? documentDiagnostic(parsed, path, response.status) : void 0;
|
|
202992
203018
|
} catch {
|
|
202993
203019
|
}
|
|
202994
203020
|
} else await response.body?.cancel();
|
|
@@ -203018,7 +203044,21 @@ var Client = class {
|
|
|
203018
203044
|
return this.request(`/v1/documents/${safeDocumentPath(path).split("/").map(encodeURIComponent).join("/")}`);
|
|
203019
203045
|
}
|
|
203020
203046
|
async put(path, content, expectedRevision) {
|
|
203021
|
-
|
|
203047
|
+
const endpoint2 = `/v1/documents/${safeDocumentPath(path).split("/").map(encodeURIComponent).join("/")}`;
|
|
203048
|
+
try {
|
|
203049
|
+
return await this.request(endpoint2, { method: "PUT", body: { content, expectedRevision } });
|
|
203050
|
+
} catch (error62) {
|
|
203051
|
+
if (error62 instanceof ApiError && [400, 422].includes(error62.status)) {
|
|
203052
|
+
const diagnostic = error62.body?.error;
|
|
203053
|
+
const valid = validateDocument(path, content).valid;
|
|
203054
|
+
const legacy = valid && diagnostic?.legacyCheckpoint === true && JSON.parse(content).schemaVersion === 2;
|
|
203055
|
+
if (valid && (legacy || ["document_type_unsupported", "document_schema_unsupported"].includes(diagnostic?.code ?? ""))) throw new UnsupportedDocumentError(error62.status, path);
|
|
203056
|
+
error62.details = { ...error62.details, documentPath: path };
|
|
203057
|
+
error62.message = `El servidor rechaz\xF3 el documento ${path} (HTTP ${error62.status}).`;
|
|
203058
|
+
error62.hint = "Ejecuta editorbrain validate --dir WORKSPACE y revisa este documento y la versi\xF3n de la API. El rechazo no confirma falta de compatibilidad; conserva los campos y no fuerces la sincronizaci\xF3n.";
|
|
203059
|
+
}
|
|
203060
|
+
throw error62;
|
|
203061
|
+
}
|
|
203022
203062
|
}
|
|
203023
203063
|
async uploadPreview(path, content, mimeType) {
|
|
203024
203064
|
const hash11 = path.match(/^\/v1\/assets\/([a-f0-9]{64})(?:\?|$)/)?.[1];
|
|
@@ -203143,8 +203183,19 @@ async function pushWorkspace(client, root, files, options = {}) {
|
|
|
203143
203183
|
if (conflicts.length) throw new CliError("SYNC_CONFLICT", `Remote documents changed. Pull into a separate folder or reconcile changes before pushing:
|
|
203144
203184
|
${conflicts.join("\n")}`, "Run push --dry-run and reconcile the reported paths.", false, { conflicts });
|
|
203145
203185
|
const uploaded = [];
|
|
203186
|
+
const skipped = [];
|
|
203146
203187
|
for (const item of pending) {
|
|
203147
|
-
|
|
203188
|
+
let result2;
|
|
203189
|
+
try {
|
|
203190
|
+
result2 = await client.put(item.path, item.content, item.expectedRevision);
|
|
203191
|
+
} catch (error62) {
|
|
203192
|
+
if (!(error62 instanceof UnsupportedDocumentError)) {
|
|
203193
|
+
if (error62 instanceof CliError) error62.details = { ...error62.details, sync: { uploaded: [...uploaded], skipped: [...skipped], failedPath: item.path } };
|
|
203194
|
+
throw error62;
|
|
203195
|
+
}
|
|
203196
|
+
skipped.push({ path: item.path, code: error62.code, status: error62.status, hint: error62.hint });
|
|
203197
|
+
continue;
|
|
203198
|
+
}
|
|
203148
203199
|
checkRemote(result2);
|
|
203149
203200
|
const digest5 = await sha256(item.content);
|
|
203150
203201
|
if (result2.path !== item.path || result2.sha256 !== digest5) throw new Error("Server returned inconsistent write metadata");
|
|
@@ -203153,7 +203204,13 @@ ${conflicts.join("\n")}`, "Run push --dry-run and reconcile the reported paths."
|
|
|
203153
203204
|
await saveSyncState(root, state);
|
|
203154
203205
|
}
|
|
203155
203206
|
await saveSyncState(root, state);
|
|
203156
|
-
return { uploaded, unchanged: unchanged2
|
|
203207
|
+
return { uploaded, unchanged: unchanged2, ...skipped.length ? {
|
|
203208
|
+
status: "partial",
|
|
203209
|
+
synced: false,
|
|
203210
|
+
skipped,
|
|
203211
|
+
warnings: skipped.map((item) => `${item.path}: el servidor no soporta este documento; sigue pendiente y conservado localmente.`),
|
|
203212
|
+
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
|
+
} : {} };
|
|
203157
203214
|
}
|
|
203158
203215
|
async function pullWorkspace(client, root, local, options = {}) {
|
|
203159
203216
|
const me = await client.me();
|
|
@@ -203438,10 +203495,13 @@ async function listRegisteredProjects(options = {}) {
|
|
|
203438
203495
|
if (options.brandId !== void 0) assertIdentifier(options.brandId);
|
|
203439
203496
|
if (options.binding !== void 0) parseBinding(options.binding);
|
|
203440
203497
|
if (options.query !== void 0 && (typeof options.query !== "string" || options.query.length > 500)) throw new CliError("INVALID_ARGUMENT", "Local project query must be at most 500 characters.", "Use a project ID or a few words from its topic.");
|
|
203441
|
-
const
|
|
203498
|
+
const root = options.directory === void 0 ? void 0 : await ensureRoot(options.directory);
|
|
203499
|
+
const registry2 = await readRegistry(await registryDirectory(false, root ? [root] : []));
|
|
203500
|
+
if (root !== void 0 && !registry2.projects.some((entry) => entry.root === root)) throw new CliError("PROJECT_LOCATION_NOT_FOUND", "No projects are registered in the selected workspace directory.", "Use projects link --project ID --path DIR --dir WORKSPACE, or omit --dir to search all registered projects.");
|
|
203442
203501
|
const projects = [];
|
|
203443
203502
|
const issues = [];
|
|
203444
203503
|
for (const entry of registry2.projects) {
|
|
203504
|
+
if (root !== void 0 && entry.root !== root) continue;
|
|
203445
203505
|
if (options.binding !== void 0 && !sameBinding(options.binding, entry.binding) || options.brandId !== void 0 && options.brandId !== entry.brandId) continue;
|
|
203446
203506
|
try {
|
|
203447
203507
|
const current2 = await location2(entry.root, entry.projectId, "registry", entry);
|
|
@@ -204646,10 +204706,11 @@ async function cleanProject(directory, project, options = {}) {
|
|
|
204646
204706
|
|
|
204647
204707
|
// packages/cli/src/command-help.ts
|
|
204648
204708
|
var introductions = {
|
|
204709
|
+
push: "Sincroniza documentos con control de revisi\xF3n. Una incompatibilidad confirmada conserva el documento local y permite guardar los dem\xE1s: status:partial, synced:false, skipped y salida 2. Actualiza la API y repite push; no bajes el esquema ni borres campos. Conflictos, permisos, datos inv\xE1lidos y fallos de red detienen la operaci\xF3n. --dry-run no comprueba compatibilidad de escritura del servidor.",
|
|
204649
204710
|
where: "Ubica archivos de un proyecto usando el registro privado de esta computadora. No usa red ni sincroniza rutas absolutas. Ante IDs ambiguos selecciona --dir.",
|
|
204650
204711
|
resume: "Usa projects find para resolver nombre/tema/fecha antes de elegir el ID. --rehash fuerza SHA-256 nuevo; checkpointHash protege el siguiente hito con --expected-checkpoint. Descarga contexto y checkpoint, conserva cambios locales y verifica archivos por SHA-256. Solo lectura remota: no renderiza, sube medios, abre aplicaciones ni gasta.",
|
|
204651
|
-
checkpoint: "Usa --expected-checkpoint SHA256|none del \xFAltimo resume para detectar trabajo concurrente. --current-version, --primary-artifact, --dependency y --render-command conservan contexto t\xE9cnico portable; nunca ejecutan. Guarda el hito declarado y hashes en videos/ID/checkpoint.json. Las rutas son relativas a la carpeta registrada por rol o al workspace. Repite --done/--pending/--decision
|
|
204652
|
-
projects: "find/list buscan por nombre/tema, --brand, --since y --before (UTC ISO), con paginaci\xF3n y actividad real; find --local consulta el registro privado. link/unlink administran carpetas privadas locales; where ID las consulta y resume ID recupera el hito. create crea un proyecto remoto con tu marca existente; intake devuelve su material y enlace privado de subida. Conserva el mismo ID para retomarlo. No inicia edici\xF3n, render ni gasto; un enlace de subida requiere iniciar sesi\xF3n.",
|
|
204712
|
+
checkpoint: "Usa --expected-checkpoint SHA256|none del \xFAltimo resume para detectar trabajo concurrente. --current-version, --primary-artifact, --dependency y --render-command conservan contexto t\xE9cnico portable; nunca ejecutan. Guarda el hito declarado y hashes en videos/ID/checkpoint.json. Las rutas son relativas a la carpeta registrada por rol o al workspace. Repite --done/--pending/--decision; sus listas reemplazan las anteriores. --primary-artifact y --dependency registran y verifican sus archivos sin repetir --artifact. --artifact reemplaza la lista base y a\xF1ade esas referencias expl\xEDcitas; omitirlo conserva los artefactos previos. Usa push expl\xEDcitamente para sincronizar el texto.",
|
|
204713
|
+
projects: "find/list buscan por nombre/tema, --brand, --since y --before (UTC ISO), con paginaci\xF3n y actividad real; find --local consulta el registro privado; --dir lo limita a un workspace registrado, sin red ni escaneo. link/unlink administran carpetas privadas locales; where ID las consulta y resume ID recupera el hito. create crea un proyecto remoto con tu marca existente; intake devuelve su material y enlace privado de subida. Conserva el mismo ID para retomarlo. No inicia edici\xF3n, render ni gasto; un enlace de subida requiere iniciar sesi\xF3n.",
|
|
204653
204714
|
styles: "Estilos de edici\xF3n completos. list = biblioteca publicada; mine = estilos locales de este workspace. media styles son recetas visuales para generar im\xE1genes, no ediciones completas.",
|
|
204654
204715
|
production: "Revisi\xF3n local del resultado. Un chequeo t\xE9cnico no aprueba la calidad creativa. verify mide el archivo final; los chequeos de cortes/caras requieren evidencia alineada al mismo render.",
|
|
204655
204716
|
studio: "Herramientas de generaci\xF3n: catalog \u2192 quote \u2192 run \u2192 get. Una cotizaci\xF3n no gasta; run requiere presupuesto autorizado. Las capacidades dependen del proveedor y del plan.",
|
|
@@ -205449,8 +205510,8 @@ async function pushStyle(client, directory, id4, options = {}) {
|
|
|
205449
205510
|
}
|
|
205450
205511
|
for (const [path, content] of Object.entries(initial)) if (await readText(root, path) !== content) throw new Error("Style changed locally during upload; reconcile before pushing documents. Uploaded assets remain available.");
|
|
205451
205512
|
const result2 = await pushWorkspace(client, root, files);
|
|
205452
|
-
if (options.withResources && files[resourcePath] !== initial[resourcePath]) await atomicWrite(root, resourcePath, files[resourcePath]);
|
|
205453
|
-
return { ...result2, verifiedResources: verified, mediaUploaded: uploads.length > 0, skippedResources, warnings: [...styleResourceWarnings(files), ...skippedResources.length ? [`Skipped unsupported resources (still local): ${skippedResources.map((r) => r.path).join(", ")}. Convert them to style documents or explicit local requirements.`] : []], atomic: false };
|
|
205513
|
+
if (options.withResources && files[resourcePath] !== initial[resourcePath] && !result2.skipped?.some((item) => item.path === resourcePath)) await atomicWrite(root, resourcePath, files[resourcePath]);
|
|
205514
|
+
return { ...result2, verifiedResources: verified, mediaUploaded: uploads.length > 0, skippedResources, warnings: [...result2.warnings ?? [], ...styleResourceWarnings(files), ...skippedResources.length ? [`Skipped unsupported resources (still local): ${skippedResources.map((r) => r.path).join(", ")}. Convert them to style documents or explicit local requirements.`] : []], atomic: false };
|
|
205454
205515
|
}, { migrateLegacy: false });
|
|
205455
205516
|
}
|
|
205456
205517
|
async function pullStyle(client, directory, id4, options = {}) {
|
|
@@ -207268,6 +207329,16 @@ import { fileURLToPath } from "node:url";
|
|
|
207268
207329
|
|
|
207269
207330
|
// packages/cli/src/agent-guidance-history.ts
|
|
207270
207331
|
var VERIFIED_GUIDANCE_RELEASES = [
|
|
207332
|
+
{
|
|
207333
|
+
"version": "0.45.0",
|
|
207334
|
+
"archiveSha256": "3b1db0fe7840e6e2760b794212e4f1629005547fe33e3f6189b43548b5e602ea",
|
|
207335
|
+
"files": {
|
|
207336
|
+
"editorbrain/SKILL.md": "42a47f0660002152fc6cc82e9459730361d14a396ad8b551cc4e95f8a7eff711",
|
|
207337
|
+
"editorbrain/references/cli-mcp.md": "8c800570e14fcc926f03e609076e9a7ea2d72a59365d4f5ded6b8750870a0e55",
|
|
207338
|
+
"editorbrain/references/starting-an-edit.md": "d2933b8a53ef81f0c6a29549882d5c6a28cb6799141503a1b0304aa11bb2555f",
|
|
207339
|
+
"editorbrain/references/workspace-files.md": "1a22a183e083ffbd0a5944e6eaecc83186bf1674126ce60fd8b2bc086d56d6d4"
|
|
207340
|
+
}
|
|
207341
|
+
},
|
|
207271
207342
|
{
|
|
207272
207343
|
"version": "0.44.2",
|
|
207273
207344
|
"archiveSha256": "ce8d57d580cb8ef296dab84d0dfcb3b18192d6c9a0a6e55f2d524d18fc7b5333",
|
|
@@ -209437,10 +209508,14 @@ function artifactInput(input2) {
|
|
|
209437
209508
|
const separator = input2.indexOf("=");
|
|
209438
209509
|
const role2 = input2.slice(0, separator);
|
|
209439
209510
|
if (separator < 1 || !checkpointRoles.includes(role2)) {
|
|
209440
|
-
throw new CliError("CHECKPOINT_ARTIFACT_INVALID", "
|
|
209511
|
+
throw new CliError("CHECKPOINT_ARTIFACT_INVALID", "Artifact references require work=relative/file, renders=relative/file or sources=relative/file.", "Use a concrete file for --artifact, --primary-artifact or --dependency. Paths are relative to that role\u2019s linked directory, or --dir if not linked.");
|
|
209441
209512
|
}
|
|
209442
209513
|
return { role: role2, path: assertCheckpointArtifactPath(input2.slice(separator + 1)) };
|
|
209443
209514
|
}
|
|
209515
|
+
var artifactKey = (item) => `${item.role}:${item.path}`;
|
|
209516
|
+
function uniqueArtifacts(items) {
|
|
209517
|
+
return [...new Map(items.map((item) => [artifactKey(item), item])).values()];
|
|
209518
|
+
}
|
|
209444
209519
|
async function writeProjectCheckpoint(options) {
|
|
209445
209520
|
assertIdentifier(options.projectId);
|
|
209446
209521
|
const location3 = await locateProject(options.projectId, options.directory);
|
|
@@ -209461,15 +209536,23 @@ async function writeProjectCheckpoint(options) {
|
|
|
209461
209536
|
if (options.expectedCheckpoint !== void 0 && !/^(?:none|[a-f0-9]{64})$/.test(options.expectedCheckpoint)) throw new CliError("INVALID_ARGUMENT", "Expected checkpoint must be none or a lowercase SHA-256.", "Use the checkpointHash returned by resume or checkpoint.");
|
|
209462
209537
|
if (options.expectedCheckpoint !== void 0 && options.expectedCheckpoint !== originalSha256) throw new CliError("CHECKPOINT_CONFLICT", "Another agent changed this milestone since you read it.", "Resume again, reconcile both agents\u2019 work, then checkpoint with the new expected hash. Nothing was overwritten.", false, { projectId: options.projectId, expected: options.expectedCheckpoint, actual: originalSha256 });
|
|
209463
209538
|
const contextHashes = Object.fromEntries(await Promise.all(Object.entries(files).map(async ([path2, content2]) => [path2, await sha256(content2)])));
|
|
209464
|
-
const
|
|
209539
|
+
const primaryArtifact = options.primaryArtifact === void 0 ? previous?.continuity?.primaryArtifact ?? null : options.primaryArtifact ? artifactInput(options.primaryArtifact) : null;
|
|
209540
|
+
const dependencies = options.dependencies === void 0 ? previous?.continuity?.dependencies ?? [] : uniqueArtifacts(options.dependencies.map(artifactInput));
|
|
209541
|
+
const declared = uniqueArtifacts([
|
|
209542
|
+
...options.artifacts?.map(artifactInput) ?? [],
|
|
209543
|
+
...options.primaryArtifact && primaryArtifact ? [primaryArtifact] : [],
|
|
209544
|
+
...options.dependencies === void 0 ? [] : dependencies
|
|
209545
|
+
]);
|
|
209546
|
+
const artifacts = new Map((options.artifacts === void 0 ? previous?.artifacts ?? [] : []).map((item) => [artifactKey(item), item]));
|
|
209547
|
+
for (const item of declared) artifacts.set(artifactKey(item), { ...item, sha256: "0".repeat(64), bytes: 0 });
|
|
209465
209548
|
const draft = validateProjectCheckpoint({
|
|
209466
209549
|
schemaVersion: 2,
|
|
209467
209550
|
projectId: options.projectId,
|
|
209468
209551
|
status: options.status,
|
|
209469
209552
|
continuity: {
|
|
209470
209553
|
currentVersion: options.currentVersion === void 0 ? previous?.continuity?.currentVersion ?? null : options.currentVersion || null,
|
|
209471
|
-
primaryArtifact
|
|
209472
|
-
dependencies
|
|
209554
|
+
primaryArtifact,
|
|
209555
|
+
dependencies,
|
|
209473
209556
|
renderCommand: options.renderCommand === void 0 ? previous?.continuity?.renderCommand ?? null : options.renderCommand || null,
|
|
209474
209557
|
contextHashes
|
|
209475
209558
|
},
|
|
@@ -209478,20 +209561,20 @@ async function writeProjectCheckpoint(options) {
|
|
|
209478
209561
|
pending: options.pending ?? previous?.pending ?? [],
|
|
209479
209562
|
decisions: options.decisions ?? previous?.decisions ?? [],
|
|
209480
209563
|
next: options.next === void 0 ? previous?.next ?? null : options.next || null,
|
|
209481
|
-
artifacts:
|
|
209564
|
+
artifacts: [...artifacts.values()]
|
|
209482
209565
|
}, options.projectId);
|
|
209483
|
-
if (declared) {
|
|
209484
|
-
draft.artifacts = [];
|
|
209566
|
+
if (declared.length) {
|
|
209485
209567
|
for (const artifact of declared) {
|
|
209486
209568
|
const base = links2?.folders[artifact.role] ?? root;
|
|
209487
209569
|
if (resolve10(base, artifact.path) === resolve10(root, checkpointFile)) throw new CliError("CHECKPOINT_SELF_REFERENCE", "A checkpoint cannot hash itself as an artifact.", "Register the scene, original or render instead.");
|
|
209488
209570
|
try {
|
|
209489
|
-
|
|
209571
|
+
artifacts.set(artifactKey(artifact), { ...artifact, ...await checkpointFileHash(base, artifact.path) });
|
|
209490
209572
|
} catch (error62) {
|
|
209491
209573
|
if (missing(error62)) throw new CliError("CHECKPOINT_ARTIFACT_MISSING", `Artifact ${artifact.role}=${artifact.path} is unavailable.`, recovery);
|
|
209492
209574
|
throw error62;
|
|
209493
209575
|
}
|
|
209494
209576
|
}
|
|
209577
|
+
draft.artifacts = [...artifacts.values()];
|
|
209495
209578
|
}
|
|
209496
209579
|
const checkpoint = validateProjectCheckpoint(draft, options.projectId);
|
|
209497
209580
|
const path = checkpointFile;
|
|
@@ -211286,7 +211369,7 @@ async function syncOnboarding(client, options) {
|
|
|
211286
211369
|
if (!validation.valid) throw new ValidationError(validation.issues);
|
|
211287
211370
|
const accountActions = onboardingAccountActions(receipt.accountSetup);
|
|
211288
211371
|
const result2 = await syncOnboardingDocuments(client, root, files, { snapshots: session.snapshots, scaffold: scaffold(session.brandId, session.projectId), dryRun: options.dryRun });
|
|
211289
|
-
return { ...result2, accountActions, brandId: session.brandId, projectId: session.projectId, aiAnalyzed: false, next: "Documents are synced only after success. Complete requested accountActions against the intended account and verify them before claiming connected setup is ready. Brain analysis is optional: only if requested, read design.md revision and use brain prepare; review before accepting." };
|
|
211372
|
+
return { ...result2, accountActions, brandId: session.brandId, projectId: session.projectId, aiAnalyzed: false, next: result2.next ?? "Documents are synced only after success. Complete requested accountActions against the intended account and verify them before claiming connected setup is ready. Brain analysis is optional: only if requested, read design.md revision and use brain prepare; review before accepting." };
|
|
211290
211373
|
}, { migrateLegacy: !options.dryRun });
|
|
211291
211374
|
}
|
|
211292
211375
|
async function serveOnboarding(options) {
|
|
@@ -215657,7 +215740,7 @@ editorbrain batches retry|detach BATCH_ID --project ID --expected-revision N
|
|
|
215657
215740
|
editorbrain batches claim|renew|release|attention BATCH_ID --project ID --lease-token UUID
|
|
215658
215741
|
editorbrain brands list [--limit 20] [--after CURSOR]
|
|
215659
215742
|
editorbrain projects list [--brand ID] [--query TEXT] [--since ISO] [--before ISO] [--sort recent|id] [--limit 20] [--after CURSOR]
|
|
215660
|
-
editorbrain projects find "NAME OR TOPIC" [--brand ID] [--since ISO] [--before ISO] [--local]
|
|
215743
|
+
editorbrain projects find "NAME OR TOPIC" [--brand ID] [--since ISO] [--before ISO] [--local] [--dir workspace]
|
|
215661
215744
|
editorbrain projects create ID --brand ID --style ID --output-profile ID [--name TEXT] [--topic TEXT] [--goal TEXT] [--dir folder]
|
|
215662
215745
|
editorbrain projects intake --project ID [--dir folder]
|
|
215663
215746
|
editorbrain projects link --project ID --path folder [--role work|renders|sources] [--dir workspace]
|
|
@@ -215870,6 +215953,7 @@ function str(args, name) {
|
|
|
215870
215953
|
}
|
|
215871
215954
|
function output2(value) {
|
|
215872
215955
|
process.stdout.write(stableJson(value));
|
|
215956
|
+
if (value && typeof value === "object" && "status" in value && value.status === "partial" && "synced" in value && value.synced === false) process.exitCode = 2;
|
|
215873
215957
|
}
|
|
215874
215958
|
async function configRoot(create = false) {
|
|
215875
215959
|
let path = process.env.EDITORBRAIN_CONFIG_DIR ?? process.env.EDITORHARNESS_CONFIG_DIR ?? join19(homedir4(), ".config", "editorbrain");
|
|
@@ -216667,8 +216751,8 @@ async function main() {
|
|
|
216667
216751
|
if (argument && args.flags.query) throw new Error("Use the search phrase or --query, not both.");
|
|
216668
216752
|
const query = argument ?? str(args, "query");
|
|
216669
216753
|
if (args.flags.local) {
|
|
216670
|
-
if (["url", "limit", "after", "since", "before", "sort"
|
|
216671
|
-
output2({ source: "local_registry", ...await listRegisteredProjects({ query, brandId: str(args, "brand") }) });
|
|
216754
|
+
if (["url", "limit", "after", "since", "before", "sort"].some((key) => args.flags[key] !== void 0)) throw new Error("Local find supports only --brand, --dir and a query. It inspects this device registry without network access.");
|
|
216755
|
+
output2({ source: "local_registry", ...await listRegisteredProjects({ query, brandId: str(args, "brand"), directory: str(args, "dir") }) });
|
|
216672
216756
|
return;
|
|
216673
216757
|
}
|
|
216674
216758
|
const params = new URLSearchParams();
|
|
@@ -216995,7 +217079,8 @@ async function main() {
|
|
|
216995
217079
|
return;
|
|
216996
217080
|
}
|
|
216997
217081
|
if (command === "push") {
|
|
216998
|
-
|
|
217082
|
+
const result2 = await pushWorkspace(new Client(await config2(args)), root, files, { dryRun: !!args.flags["dry-run"] });
|
|
217083
|
+
output2({ ...result2, warnings: [...result2.warnings ?? [], ...styleResourceWarnings(files)] });
|
|
216999
217084
|
return;
|
|
217000
217085
|
}
|
|
217001
217086
|
const project = subcommand ?? str(args, "project");
|
package/package.json
CHANGED
|
@@ -43,6 +43,9 @@ first; remote metadata does not imply this host can open files on another Mac. S
|
|
|
43
43
|
`checkpoint` at meaningful milestones; synchronize it only through an explicit,
|
|
44
44
|
authorized `push`. See [workspace files](references/workspace-files.md#project-checkpoints-and-local-links)
|
|
45
45
|
for local links, relative artifact paths and the portable record.
|
|
46
|
+
Read a push result before claiming synchronization: `status: "partial"` with
|
|
47
|
+
exit 2 leaves skipped documents local and unsynchronized. Follow its upgrade
|
|
48
|
+
hint and retry without downgrading checkpoint v2; see [sync recovery](references/cli-mcp.md#recovery-and-diagnostics-cli-07).
|
|
46
49
|
|
|
47
50
|
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.
|
|
48
51
|
|
|
@@ -213,6 +213,23 @@ Use `editorbrain version` to discover the installed release. Run `editorbrain do
|
|
|
213
213
|
|
|
214
214
|
Before reconciling sync problems, use `push --dry-run` or `pull --dry-run`. Read `conflicts` and the planned paths. A preview neither writes nor reserves revisions. Never use a separate workspace to evade a binding mismatch.
|
|
215
215
|
|
|
216
|
+
CLI 0.45.1 adds partial push recovery for older APIs.
|
|
217
|
+
`push` continues only past confirmed unsupported document types or
|
|
218
|
+
schemas. Inspect `status: "partial"`, `synced: false`, `uploaded`, `skipped`
|
|
219
|
+
(path, code, hint, HTTP status), `warnings` and `next`. Exit **2** means action
|
|
220
|
+
remains; skipped documents stay local and unsynchronized. Follow the API upgrade
|
|
221
|
+
hint and retry. Successful revisions are recorded and are not uploaded again.
|
|
222
|
+
`push --dry-run` checks local validity and revision conflicts only; it does not
|
|
223
|
+
probe server document/schema support or predict these skips.
|
|
224
|
+
|
|
225
|
+
`CHECKPOINT_UNSUPPORTED` includes an older API rejecting checkpoint v2 because
|
|
226
|
+
`schemaVersion` must be 1. Update the API without stripping v2 continuity fields
|
|
227
|
+
or downgrading the document. Only recognized unsupported document/schema errors
|
|
228
|
+
qualify: generic HTTP 400/422 remain validation/request failures. Authentication,
|
|
229
|
+
conflicts, unsafe paths, invalid documents, server and network failures still
|
|
230
|
+
stop push, preserving any successfully uploaded prefix. Never report a partial
|
|
231
|
+
push as fully synchronized or clear local pending work to hide a skip.
|
|
232
|
+
|
|
216
233
|
Errors include `code`, `hint`, `retryable` and the legacy text `error`. `AUTH_REQUIRED` needs user authorization, `ACCESS_DENIED` needs the right permission, `SYNC_CONFLICT` needs reconciliation, and `WORKSPACE_MISMATCH` requires the correct separate folder. `WORKSPACE_BUSY` means another CLI operation owns `.editorbrain-operation.lock`; do not auto-delete it. After a crash, verify no process is using the folder before removing a leftover lock.
|
|
217
234
|
|
|
218
235
|
GET requests use bounded retries and respect Retry-After. Writes are not retried automatically: after a network error, inspect remote state before repeating them. Do not treat `retryable` as permission for an unbounded loop. HTTP error bodies are not printed. The MCP now provides matching structuredContent and text; consume either without counting them as separate results. Writing a document is declared mutating and may update existing content even though revision history is preserved.
|
|
@@ -59,6 +59,9 @@ server document/progress activity, not an agent-supplied date. Follow its opaque
|
|
|
59
59
|
cursor unchanged with the same filters; results are a live list. Offline,
|
|
60
60
|
`projects find "name" --local` searches registered folders only and reports
|
|
61
61
|
missing disks or stale identities; it is not a complete account inventory.
|
|
62
|
+
CLI 0.45.1 adds `--local --dir <workspace>` to validate the directory
|
|
63
|
+
and limit results to its canonical registered root, without network, folder scans
|
|
64
|
+
or registration. Check the installed version before using this option.
|
|
62
65
|
|
|
63
66
|
Use `resume ID --dir <workspace>` when the workspace is known; without `--dir`,
|
|
64
67
|
the CLI uses the current project or a unique private registry entry. If several
|
|
@@ -105,6 +105,8 @@ tool preferences. Keep local artifacts under separate project directories.
|
|
|
105
105
|
Use CLI 0.45.0 or later for this workflow; remote discovery and continuity require
|
|
106
106
|
API/MCP 0.45.0 or later. Check the installed CLI's help and the connection's actual
|
|
107
107
|
tools before using them. Verify the intended workspace before selecting an ID.
|
|
108
|
+
CLI 0.45.1 adds scoped local discovery and automatic registration of explicit
|
|
109
|
+
continuity references below; use 0.45.1 or later for those fixes.
|
|
108
110
|
Use `projects find "name or topic" --brand ID` for discovery and `projects list
|
|
109
111
|
--brand ID --sort recent` for server-recorded activity. Convert relative dates in
|
|
110
112
|
the user's timezone to UTC `--since`/`--before` boundaries. Preserve filters with
|
|
@@ -113,7 +115,9 @@ new query. Resolve ambiguous matches rather than choosing the first project.
|
|
|
113
115
|
|
|
114
116
|
`projects find "name or topic" --local` searches only this device's private registry,
|
|
115
117
|
without network access. It accepts a brand filter, not dates or remote pagination;
|
|
116
|
-
it does not scan the whole disk.
|
|
118
|
+
it does not scan the whole disk. With `--dir <workspace>`, CLI 0.45.1 validates
|
|
119
|
+
the directory and filters by its canonical registered workspace root; it does
|
|
120
|
+
not scan the folder or register projects. Old projects and completed milestones remain
|
|
117
121
|
discoverable while their documents and permissions exist. Archiving a chat does
|
|
118
122
|
not remove saved project documents, and this release adds no project archive or
|
|
119
123
|
unarchive command. Unsaved conversation-only decisions cannot be recovered from a
|
|
@@ -130,14 +134,14 @@ workspace binding requires registering the folders again.
|
|
|
130
134
|
At meaningful milestones—direction ready, sample produced/reviewed, a resolved
|
|
131
135
|
correction or a delivery—save actual progress, decisions, remaining work and
|
|
132
136
|
concrete artifacts with `checkpoint`. This records work already done; it does
|
|
133
|
-
not create another review gate or certify quality.
|
|
134
|
-
work folder containing `scene.html`:
|
|
137
|
+
not create another review gate or certify quality. Example for CLI 0.45.1+, with an
|
|
138
|
+
existing work folder containing `scene.html`:
|
|
135
139
|
|
|
136
140
|
```sh
|
|
137
141
|
editorbrain checkpoint --project ID --status in_progress --dir <workspace> \
|
|
138
142
|
--done "Representative scene implemented" --pending "Review motion and audio" \
|
|
139
143
|
--decision "Keep the approved direction" --next "Inspect the sample" \
|
|
140
|
-
--
|
|
144
|
+
--expected-checkpoint HASH_FROM_RESUME \
|
|
141
145
|
--current-version cut-v3 --primary-artifact work=scene.html
|
|
142
146
|
```
|
|
143
147
|
|
|
@@ -151,8 +155,11 @@ temporary links out of all portable fields, including free text.
|
|
|
151
155
|
`in_review`, `blocked`, `completed`), `done`, `pending`, `decisions`, `next` and
|
|
152
156
|
artifact references. Repeated `--done`, `--pending`, `--decision` and `--artifact`
|
|
153
157
|
flags supply lists. Omitted fields remain unchanged; a supplied list replaces
|
|
154
|
-
that list.
|
|
155
|
-
|
|
158
|
+
that list. For artifacts, explicit `--primary-artifact` and `--dependency`
|
|
159
|
+
references are then added to that base and hashed. Without `--artifact`, the base
|
|
160
|
+
retains previous artifacts. Previous omitted artifacts keep their old hashes;
|
|
161
|
+
they are not recertified. Existing continuity references omitted from the command
|
|
162
|
+
do not trigger another file read. To clear a list, set it to `[]` in the checkpoint JSON and validate
|
|
156
163
|
the workspace before synchronizing; use `null` to clear `next`, or pass
|
|
157
164
|
`--next ""` to the checkpoint command.
|
|
158
165
|
|
|
@@ -160,7 +167,9 @@ New checkpoints use schema v2; v1 remains readable. `continuity` records
|
|
|
160
167
|
`currentVersion` (agent label, not approval), `primaryArtifact`, `dependencies`,
|
|
161
168
|
`renderCommand` (inert text) and `contextHashes` captured from current editorial
|
|
162
169
|
documents. `--primary-artifact role=path` and repeated `--dependency role=path`
|
|
163
|
-
|
|
170
|
+
automatically register/hash explicitly supplied files in `artifacts` from CLI
|
|
171
|
+
0.45.1; no duplicate `--artifact` is needed. On 0.45.0, also declare
|
|
172
|
+
those files with `--artifact`. Record
|
|
164
173
|
reasons in `--decision`. `--render-command` must use portable relative paths and
|
|
165
174
|
never contains secrets; resume never executes it. Empty strings clear version,
|
|
166
175
|
primary artifact or render command. Removed artifacts require removing/updating
|
|
@@ -185,6 +194,10 @@ media or automatically pushes. Checkpoints are operational documents excluded
|
|
|
185
194
|
from editorial resolution hashes, so recording progress does not invalidate a
|
|
186
195
|
render. They supplement `direction.md`, versioned reviews and the progress board;
|
|
187
196
|
their statuses do not change those records or grant approvals.
|
|
197
|
+
If push returns `status: "partial"` and exit 2, skipped documents remain local
|
|
198
|
+
and unsynchronized. Follow [sync recovery](cli-mcp.md#recovery-and-diagnostics-cli-07),
|
|
199
|
+
upgrade the API as directed, and retry without discarding v2 fields. Dry-run does
|
|
200
|
+
not test whether the server supports their document/schema versions.
|
|
188
201
|
|
|
189
202
|
On resume, follow [adaptive entry](starting-an-edit.md#resume-an-existing-project).
|
|
190
203
|
The CLI verifies each artifact and searches for moved bytes only within bounded
|