The short version
The EditV2Input type in @proof/agent-bridge uses revision and ops as field names, but the server's editV2 handler (agent-edit-v2.ts) expects baseRevision and operations. Calls through client.editV2() silently fail — the server sees undefined for both fields and returns a 400.
What's happening
In packages/agent-bridge/src/types.ts:
export interface EditV2Input {
by: string;
revision: number; // ← server expects `baseRevision`
ops: EditV2BlockOp[]; // ← server expects `operations`
idempotencyKey?: string;
}
The editV2() method in the bridge client (packages/agent-bridge/src/index.ts) sends this payload as-is via JSON.stringify(input). No field remapping happens.
Meanwhile, the server handler in server/agent-edit-v2.ts reads:
const operationsRaw = Array.isArray(payload.operations) ? payload.operations : [];
const baseRevision = typeof payload.baseRevision === 'number' ? payload.baseRevision : null;
So payload.revision and payload.ops are never read — the server gets an empty operations array and a null baseRevision, then returns "baseRevision is required".
Workaround
Build the request body manually with the correct field names and POST directly to /documents/:slug/edit/v2. That's what I ended up doing in proof-sdk-cli after hitting this.
Suggested fix
Rename the fields in EditV2Input to match the server:
export interface EditV2Input {
by: string;
baseRevision: number;
operations: EditV2BlockOp[];
idempotencyKey?: string;
}
This is a breaking change for anyone currently constructing EditV2Input objects, but since the current interface doesn't actually work against the server, the practical impact should be minimal.
The short version
The
EditV2Inputtype in@proof/agent-bridgeusesrevisionandopsas field names, but the server's editV2 handler (agent-edit-v2.ts) expectsbaseRevisionandoperations. Calls throughclient.editV2()silently fail — the server seesundefinedfor both fields and returns a 400.What's happening
In
packages/agent-bridge/src/types.ts:The
editV2()method in the bridge client (packages/agent-bridge/src/index.ts) sends this payload as-is viaJSON.stringify(input). No field remapping happens.Meanwhile, the server handler in
server/agent-edit-v2.tsreads:So
payload.revisionandpayload.opsare never read — the server gets an empty operations array and a null baseRevision, then returns"baseRevision is required".Workaround
Build the request body manually with the correct field names and POST directly to
/documents/:slug/edit/v2. That's what I ended up doing inproof-sdk-cliafter hitting this.Suggested fix
Rename the fields in
EditV2Inputto match the server:This is a breaking change for anyone currently constructing
EditV2Inputobjects, but since the current interface doesn't actually work against the server, the practical impact should be minimal.