@claudian-collab/protocol 4.1.4 → 4.2.0

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
@@ -20,7 +20,7 @@ or compatibility rules.
20
20
  - Shared limits that client and server must agree on (`COLLAB_LIMITS`)
21
21
  - Protocol-version negotiation (`COLLAB_PROTOCOL_VERSION`, envelope decoding)
22
22
  - Canonical Project checkpoint profiles, logical records, authority-generation transfer, exact membership claims, target-signed redemption receipts, offline backup operational continuity, and Project retirement contracts
23
- - Cloud binding v4 route construction/matching, bounded checkpoint streams, capability negotiation, strict success/error envelopes, private-development bootstrap, Project snapshot, and redacted event contracts
23
+ - Cloud binding v5 route construction/matching, bounded checkpoint streams, capability negotiation, strict success/error envelopes, private-development bootstrap, Project snapshot, and redacted event contracts
24
24
  - Markdown-derived Ticket-reference and Member-mention semantics shared by
25
25
  client rendering and authority derivation
26
26
 
@@ -37,7 +37,7 @@ fixed part of the detail so the whole detail stays within
37
37
  has one compatible final-serialization limit. Request comments and Ticket
38
38
  accepted relations also have shared authority-enforced total limits; summary
39
39
  counts let complete consumers reject partial or cross-snapshot assembly.
40
- Cloud binding v4 retains the authority-neutral Project snapshot, nine redacted durable event kinds plus `snapshot.required`, eighteen capability tokens, the exact ordinary Project/Git route catalog, bounded authority-transfer artifact routes, and six private-development bootstrap bindings. Wire v8 adds target-confirmed Cloud-to-LAN invalidation and cleanup to the existing authority-transfer contract. Its domain-separated Ed25519 proof binds the exact target Member, source and target generations, checkpoint, stage, current claim batch when present, and cleanup digest; Manager cancellation, timeout, disconnect, or target absence does not prove cleanup. The shared checkpoint container is exactly `checkpoint.json`, `coordination.ndjson`, and `repository.bundle`; authority-transfer and export use wire-visible coordination format v1, and offline backup uses format v3. Portable profiles exclude engine storage, paths, credentials, tokens, private keys, and operational refs, and backups exclude plaintext invitation secrets, raw claims, and private keys. Existing LAN Join, invitation, endpoint, membership lifecycle, Host-transfer, snapshot, event, and HTTP bindings remain independently application-owned; the dedicated LAN authority-transfer transport binds shared payloads without creating another shared operation registry.
40
+ Cloud binding v5 retains the authority-neutral Project snapshot, nine redacted durable event kinds plus `snapshot.required`, eighteen capability tokens, the exact ordinary Project/Git route catalog, bounded authority-transfer artifact routes, and six private-development bootstrap bindings. Wire v9 retains target-confirmed Cloud-to-LAN invalidation and cleanup to the existing authority-transfer contract. Its domain-separated Ed25519 proof binds the exact target Member, source and target generations, checkpoint, stage, current claim batch when present, and cleanup digest; Manager cancellation, timeout, disconnect, or target absence does not prove cleanup. The shared checkpoint container is exactly `checkpoint.json`, `coordination.ndjson`, and `repository.bundle`; authority-transfer and export use wire-visible coordination format v1, and offline backup uses format v3. Portable profiles exclude engine storage, paths, credentials, tokens, private keys, and operational refs, and backups exclude plaintext invitation secrets, raw claims, and private keys. Existing LAN Join, invitation, endpoint, membership lifecycle, Host-transfer, snapshot, event, and HTTP bindings remain independently application-owned; the dedicated LAN authority-transfer transport binds shared payloads without creating another shared operation registry.
41
41
 
42
42
  Backup coordination artifacts are limited to 256 MiB of actual UTF-8 bytes, including the final newline. The decoder, encoder, and consistency checker apply this same inclusive limit without rewriting principals into an intermediate format. Valid current-format artifacts at the limit are accepted; an additional byte is rejected.
43
43
 
@@ -64,12 +64,13 @@ part of the public surface.
64
64
 
65
65
  Package SemVer, canonical wire version, and Cloud binding version are independent concepts.
66
66
 
67
- - **Package version** (this `package.json`): `4.1.4`. Behavior-preserving implementation refactors and reviewed compatible defect corrections may use a patch release when public declarations, runtime exports, and accepted wire/binding semantics remain unchanged. Minor releases may add backward-compatible API. Removing or incompatibly changing an existing declaration, export, runtime behavior, codec, error, limit, ref rule, operation, or compatibility rule requires a major release. Package API SemVer is classified independently from the wire and Cloud binding contracts, but a compatible package addition cannot exempt a changed wire contract from a wire-version increase or a changed Cloud binding contract from a binding-version increase. The package version never signals wire compatibility by itself.
68
- - **Wire version** (`COLLAB_PROTOCOL_VERSION`): currently `8`. The supported range is exactly `[8, 8]`. This is independent from Cloud binding version `4` and the application-owned LAN bindings. Any change to an existing envelope, DTO, operation payload shape, or operation definition requires a new wire-protocol version. This includes additive operations: every wire-contract change increases the canonical wire version.
69
- - **Cloud binding version** (`COLLAB_CLOUD_BINDING_VERSION`): currently `4`. It versions Cloud routes, bounded transfer streams, and capabilities independently from package and wire versions. Every Cloud binding-contract change increases this version. Bindings before v4 and wire versions before v8 are unsupported rather than translated or dual-interpreted.
67
+ - **Package version** (this `package.json`): `4.2.0`. Behavior-preserving implementation refactors and reviewed compatible defect corrections may use a patch release when public declarations, runtime exports, and accepted wire/binding semantics remain unchanged. Minor releases may add backward-compatible API. Removing or incompatibly changing an existing declaration, export, runtime behavior, codec, error, limit, ref rule, operation, or compatibility rule requires a major release. Package API SemVer is classified independently from the wire and Cloud binding contracts, but a compatible package addition cannot exempt a changed wire contract from a wire-version increase or a changed Cloud binding contract from a binding-version increase. The package version never signals wire compatibility by itself.
68
+ - **Wire version** (`COLLAB_PROTOCOL_VERSION`): currently `9`. The supported range is exactly `[9, 9]`. This is independent from Cloud binding version `5` and the application-owned LAN bindings. Any change to an existing envelope, DTO, operation payload shape, or operation definition requires a new wire-protocol version. This includes additive operations: every wire-contract change increases the canonical wire version.
69
+ - **Cloud binding version** (`COLLAB_CLOUD_BINDING_VERSION`): currently `5`. It versions Cloud routes, bounded transfer streams, and capabilities independently from package and wire versions. Every Cloud binding-contract change increases this version. Bindings before v5 and wire versions before v9 are unsupported rather than translated or dual-interpreted.
70
70
 
71
71
  ### Compatibility behavior
72
72
 
73
+ - A Cloud error envelope may carry `mutationOutcome: 'rejected'` only when the authority has checked the exact request's retained result and nonterminal journal under its Project write lane and durable state prevents that request from ever applying. A persisted rejection fence or a strictly advanced monotone expected-state value can establish that guarantee; a later snapshot, missing row, ordinary rejection code, timeout, or diagnostic reason cannot. The envelope's request ID binds the proof to the submitted operation and request. Without this property, clients must preserve ambiguous mutation recovery. The authority must preserve the facts establishing this guarantee in backup/restore and delayed-duplicate handling.
73
74
  - Envelope decoders reject unknown fields (`protocol-payload-invalid`).
74
75
  Operation request and response compatibility is
75
76
  decoder-defined and pinned by package fixtures; decoded DTOs are reconstructed
@@ -2,7 +2,7 @@ import { COLLAB_PROTOCOL_VERSION } from './CollabConstants';
2
2
  import { CollabError, type CollabDiagnosticContext, type CollabErrorCode, type CollabRecoveryAction } from './CollabError';
3
3
  import { COLLAB_PROJECT_CHECKPOINT_ARTIFACTS } from './CollabProjectCheckpoint';
4
4
  import type { CollabIsoTimestamp, CollabProjectId } from './types';
5
- export declare const COLLAB_CLOUD_BINDING_VERSION: 4;
5
+ export declare const COLLAB_CLOUD_BINDING_VERSION: 5;
6
6
  export declare const COLLAB_CLOUD_CAPABILITY_DOCUMENT_SCHEMA_VERSION: 2;
7
7
  export declare const COLLAB_CLOUD_CAPABILITIES: readonly ["accept", "authority-transfer", "cloud-imported-membership-claims", "cloud-project-create", "cloud-project-invitations", "cloud-project-join", "cloud-project-leave", "cloud-project-manager-responsibility", "cloud-project-membership", "development-bootstrap", "git-receive-pack-personal-ref", "git-upload-pack", "project-checkpoint-export", "project-events", "project-retirement", "project-snapshot", "requests", "tickets"];
8
8
  export type CollabCloudCapability = typeof COLLAB_CLOUD_CAPABILITIES[number];
@@ -122,6 +122,12 @@ export interface CollabCloudWireError {
122
122
  }
123
123
  export interface CollabCloudErrorEnvelope {
124
124
  readonly error: CollabCloudWireError;
125
+ /**
126
+ * Exact request-correlated proof of no retained success or nonterminal journal,
127
+ * and durable authority state preventing this request from applying later.
128
+ * Omission leaves the mutation outcome unknown, regardless of the error code.
129
+ */
130
+ readonly mutationOutcome?: 'rejected';
125
131
  readonly protocolVersion: typeof COLLAB_PROTOCOL_VERSION;
126
132
  readonly requestId: string;
127
133
  }
@@ -142,5 +148,5 @@ export declare function collabCloudCapabilityDocument(capabilities: readonly Col
142
148
  export declare function collabCloudCapabilitySupported(document: CollabCloudCapabilityDocument, capability: CollabCloudCapability): boolean;
143
149
  export declare function collabCloudSuccessEnvelope<T>(requestId: string, data: T): CollabCloudSuccessEnvelope<T>;
144
150
  export declare function decodeCollabCloudSuccessEnvelope<T = unknown>(value: unknown): CollabCloudSuccessEnvelope<T>;
145
- export declare function collabCloudErrorEnvelope(requestId: string, error: CollabError): CollabCloudErrorEnvelope;
151
+ export declare function collabCloudErrorEnvelope(requestId: string, error: CollabError, mutationOutcome?: CollabCloudErrorEnvelope['mutationOutcome']): CollabCloudErrorEnvelope;
146
152
  export declare function decodeCollabCloudErrorEnvelope(value: unknown): CollabCloudErrorEnvelope;
@@ -23,7 +23,7 @@ const CollabControlOperationCodecs_1 = require("./CollabControlOperationCodecs")
23
23
  const CollabError_1 = require("./CollabError");
24
24
  const CollabValidation_1 = require("./CollabValidation");
25
25
  const CollabProjectCheckpoint_1 = require("./CollabProjectCheckpoint");
26
- exports.COLLAB_CLOUD_BINDING_VERSION = 4;
26
+ exports.COLLAB_CLOUD_BINDING_VERSION = 5;
27
27
  exports.COLLAB_CLOUD_CAPABILITY_DOCUMENT_SCHEMA_VERSION = 2;
28
28
  exports.COLLAB_CLOUD_CAPABILITIES = Object.freeze([
29
29
  'accept',
@@ -188,7 +188,7 @@ function collabCloudProjectOperationRoute(projectId, operation) {
188
188
  assertProjectId(projectId);
189
189
  if (!isCloudJsonOperation(operation))
190
190
  invalidRoute();
191
- return route('POST', `/v4/projects/${projectId}/operations/${operation}`, {
191
+ return route('POST', `/v5/projects/${projectId}/operations/${operation}`, {
192
192
  kind: 'project-operation',
193
193
  operation,
194
194
  projectId,
@@ -198,7 +198,7 @@ function collabCloudProjectEventsRoute(projectId, afterSequence) {
198
198
  assertProjectId(projectId);
199
199
  if (!Number.isSafeInteger(afterSequence) || afterSequence < 0)
200
200
  invalidRoute();
201
- return route('GET', `/v4/projects/${projectId}/events?afterSequence=${afterSequence}`, {
201
+ return route('GET', `/v5/projects/${projectId}/events?afterSequence=${afterSequence}`, {
202
202
  afterSequence,
203
203
  kind: 'project-events',
204
204
  projectId,
@@ -209,11 +209,11 @@ function collabCloudGitRoute(projectId, routeKind, service) {
209
209
  if (routeKind === 'info-refs') {
210
210
  if (service !== 'git-upload-pack' && service !== 'git-receive-pack')
211
211
  invalidRoute();
212
- return route('GET', `/v4/projects/${projectId}/repository.git/info/refs?service=${service}`, { kind: 'git-info-refs', projectId, service });
212
+ return route('GET', `/v5/projects/${projectId}/repository.git/info/refs?service=${service}`, { kind: 'git-info-refs', projectId, service });
213
213
  }
214
214
  if (service !== undefined)
215
215
  invalidRoute();
216
- return route('POST', `/v4/projects/${projectId}/repository.git/${routeKind}`, {
216
+ return route('POST', `/v5/projects/${projectId}/repository.git/${routeKind}`, {
217
217
  kind: routeKind,
218
218
  projectId,
219
219
  });
@@ -224,7 +224,7 @@ function collabCloudAuthorityTransferArtifactRoute(projectId, transferId, direct
224
224
  if (direction !== 'download' && direction !== 'upload'
225
225
  || !COLLAB_PROJECT_CHECKPOINT_ARTIFACTS_SET.has(artifact))
226
226
  invalidRoute();
227
- return route(direction === 'upload' ? 'PUT' : 'GET', `/v4/projects/${projectId}/authority-transfers/${transferId}/checkpoint/${artifact}`, {
227
+ return route(direction === 'upload' ? 'PUT' : 'GET', `/v5/projects/${projectId}/authority-transfers/${transferId}/checkpoint/${artifact}`, {
228
228
  artifact,
229
229
  direction,
230
230
  kind: 'authority-transfer-artifact',
@@ -237,7 +237,7 @@ function collabCloudProjectCheckpointExportArtifactRoute(projectId, exportId, ar
237
237
  assertAttemptId(exportId);
238
238
  if (!COLLAB_PROJECT_CHECKPOINT_ARTIFACTS_SET.has(artifact))
239
239
  invalidRoute();
240
- return route('GET', `/v4/projects/${projectId}/checkpoint-exports/${exportId}/checkpoint/${artifact}`, {
240
+ return route('GET', `/v5/projects/${projectId}/checkpoint-exports/${exportId}/checkpoint/${artifact}`, {
241
241
  artifact,
242
242
  exportId,
243
243
  kind: 'project-checkpoint-export-artifact',
@@ -249,7 +249,7 @@ function collabCloudProjectCheckpointExportRoute(projectId, exportId, operation)
249
249
  assertAttemptId(exportId);
250
250
  if (operation !== 'begin' && operation !== 'status')
251
251
  invalidRoute();
252
- return route(operation === 'begin' ? 'POST' : 'GET', `/v4/projects/${projectId}/checkpoint-exports/${exportId}`, { exportId, kind: 'project-checkpoint-export', operation, projectId });
252
+ return route(operation === 'begin' ? 'POST' : 'GET', `/v5/projects/${projectId}/checkpoint-exports/${exportId}`, { exportId, kind: 'project-checkpoint-export', operation, projectId });
253
253
  }
254
254
  function decodeCollabCloudProjectCheckpointExportStatus(value) {
255
255
  const source = exactRecord(value, 'checkpointExport', [
@@ -287,7 +287,7 @@ function decodeCollabCloudProjectCheckpointExportStatus(value) {
287
287
  });
288
288
  }
289
289
  function collabDevelopmentBootstrapRoute(operation, attemptId) {
290
- const base = '/v4/development/bootstrap/attempts';
290
+ const base = '/v5/development/bootstrap/attempts';
291
291
  if (operation === 'beginDevelopmentBootstrap') {
292
292
  if (attemptId !== undefined)
293
293
  invalidRoute();
@@ -346,7 +346,7 @@ function matchCollabCloudRoute(method, target) {
346
346
  && url.pathname === '/collab/capabilities'
347
347
  && exactQuery(url, []))
348
348
  return { kind: 'capabilities' };
349
- if (segments[0] === 'v4'
349
+ if (segments[0] === 'v5'
350
350
  && segments[1] === 'projects'
351
351
  && (0, CollabValidation_1.isCollabProjectId)(segments[2])) {
352
352
  const projectId = segments[2];
@@ -425,7 +425,7 @@ function matchCollabCloudRoute(method, target) {
425
425
  && exactQuery(url, []))
426
426
  return { kind: segments[4], projectId };
427
427
  }
428
- if (segments[0] !== 'v4'
428
+ if (segments[0] !== 'v5'
429
429
  || segments[1] !== 'development'
430
430
  || segments[2] !== 'bootstrap'
431
431
  || segments[3] !== 'attempts'
@@ -533,21 +533,32 @@ function decodeCollabCloudSuccessEnvelope(value) {
533
533
  requestId: source.requestId,
534
534
  });
535
535
  }
536
- function collabCloudErrorEnvelope(requestId, error) {
536
+ function collabCloudErrorEnvelope(requestId, error, mutationOutcome) {
537
537
  if (!(0, CollabValidation_1.isCollabOpaqueId)(requestId))
538
538
  throw invalidPayload('requestId');
539
+ if (mutationOutcome !== undefined && mutationOutcome !== 'rejected') {
540
+ throw invalidPayload('mutationOutcome');
541
+ }
539
542
  return Object.freeze({
540
543
  error: Object.freeze({
541
544
  code: error.code,
542
545
  recoveryActions: Object.freeze([...error.recoveryActions]),
543
546
  safeContext: error.safeContext,
544
547
  }),
548
+ ...(mutationOutcome === undefined ? {} : { mutationOutcome }),
545
549
  protocolVersion: CollabConstants_1.COLLAB_PROTOCOL_VERSION,
546
550
  requestId,
547
551
  });
548
552
  }
549
553
  function decodeCollabCloudErrorEnvelope(value) {
550
- const source = exactRecord(value, 'envelope', ['error', 'protocolVersion', 'requestId']);
554
+ const source = record(value, 'envelope');
555
+ const hasOutcome = Object.hasOwn(source, 'mutationOutcome');
556
+ if (!hasExactKeys(source, hasOutcome
557
+ ? ['error', 'mutationOutcome', 'protocolVersion', 'requestId']
558
+ : ['error', 'protocolVersion', 'requestId']))
559
+ throw invalidPayload('envelope');
560
+ if (hasOutcome && source.mutationOutcome !== 'rejected')
561
+ throw invalidPayload('mutationOutcome');
551
562
  const wireError = exactRecord(source.error, 'error', [
552
563
  'code',
553
564
  'recoveryActions',
@@ -573,6 +584,7 @@ function decodeCollabCloudErrorEnvelope(value) {
573
584
  ]),
574
585
  safeContext,
575
586
  }),
587
+ ...(hasOutcome ? { mutationOutcome: 'rejected' } : {}),
576
588
  protocolVersion: CollabConstants_1.COLLAB_PROTOCOL_VERSION,
577
589
  requestId: source.requestId,
578
590
  });
@@ -1,4 +1,4 @@
1
- export declare const COLLAB_PROTOCOL_VERSION: 8;
1
+ export declare const COLLAB_PROTOCOL_VERSION: 9;
2
2
  export declare const COLLAB_MAIN_REF: "refs/heads/main";
3
3
  export declare const COLLAB_MEMBER_REF_PREFIX: "refs/heads/members/";
4
4
  export declare const COLLAB_LIMITS: Readonly<{
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.COLLAB_LIMITS = exports.COLLAB_MEMBER_REF_PREFIX = exports.COLLAB_MAIN_REF = exports.COLLAB_PROTOCOL_VERSION = void 0;
4
- exports.COLLAB_PROTOCOL_VERSION = 8;
4
+ exports.COLLAB_PROTOCOL_VERSION = 9;
5
5
  exports.COLLAB_MAIN_REF = 'refs/heads/main';
6
6
  exports.COLLAB_MEMBER_REF_PREFIX = 'refs/heads/members/';
7
7
  exports.COLLAB_LIMITS = Object.freeze({
@@ -3,7 +3,7 @@ import { COLLAB_CONTROL_OPERATION_CODECS, } from './CollabControlOperationCodecs
3
3
  import { COLLAB_ERROR_CODES, CollabError, sanitizeCollabDiagnosticContext, } from './CollabError.mjs';
4
4
  import { isCollabOpaqueId, isCollabProjectId, } from './CollabValidation.mjs';
5
5
  import { COLLAB_CHECKPOINT_ARTIFACT_LIMITS, COLLAB_PROJECT_CHECKPOINT_ARTIFACTS, } from './CollabProjectCheckpoint.mjs';
6
- export const COLLAB_CLOUD_BINDING_VERSION = 4;
6
+ export const COLLAB_CLOUD_BINDING_VERSION = 5;
7
7
  export const COLLAB_CLOUD_CAPABILITY_DOCUMENT_SCHEMA_VERSION = 2;
8
8
  export const COLLAB_CLOUD_CAPABILITIES = Object.freeze([
9
9
  'accept',
@@ -168,7 +168,7 @@ export function collabCloudProjectOperationRoute(projectId, operation) {
168
168
  assertProjectId(projectId);
169
169
  if (!isCloudJsonOperation(operation))
170
170
  invalidRoute();
171
- return route('POST', `/v4/projects/${projectId}/operations/${operation}`, {
171
+ return route('POST', `/v5/projects/${projectId}/operations/${operation}`, {
172
172
  kind: 'project-operation',
173
173
  operation,
174
174
  projectId,
@@ -178,7 +178,7 @@ export function collabCloudProjectEventsRoute(projectId, afterSequence) {
178
178
  assertProjectId(projectId);
179
179
  if (!Number.isSafeInteger(afterSequence) || afterSequence < 0)
180
180
  invalidRoute();
181
- return route('GET', `/v4/projects/${projectId}/events?afterSequence=${afterSequence}`, {
181
+ return route('GET', `/v5/projects/${projectId}/events?afterSequence=${afterSequence}`, {
182
182
  afterSequence,
183
183
  kind: 'project-events',
184
184
  projectId,
@@ -189,11 +189,11 @@ export function collabCloudGitRoute(projectId, routeKind, service) {
189
189
  if (routeKind === 'info-refs') {
190
190
  if (service !== 'git-upload-pack' && service !== 'git-receive-pack')
191
191
  invalidRoute();
192
- return route('GET', `/v4/projects/${projectId}/repository.git/info/refs?service=${service}`, { kind: 'git-info-refs', projectId, service });
192
+ return route('GET', `/v5/projects/${projectId}/repository.git/info/refs?service=${service}`, { kind: 'git-info-refs', projectId, service });
193
193
  }
194
194
  if (service !== undefined)
195
195
  invalidRoute();
196
- return route('POST', `/v4/projects/${projectId}/repository.git/${routeKind}`, {
196
+ return route('POST', `/v5/projects/${projectId}/repository.git/${routeKind}`, {
197
197
  kind: routeKind,
198
198
  projectId,
199
199
  });
@@ -204,7 +204,7 @@ export function collabCloudAuthorityTransferArtifactRoute(projectId, transferId,
204
204
  if (direction !== 'download' && direction !== 'upload'
205
205
  || !COLLAB_PROJECT_CHECKPOINT_ARTIFACTS_SET.has(artifact))
206
206
  invalidRoute();
207
- return route(direction === 'upload' ? 'PUT' : 'GET', `/v4/projects/${projectId}/authority-transfers/${transferId}/checkpoint/${artifact}`, {
207
+ return route(direction === 'upload' ? 'PUT' : 'GET', `/v5/projects/${projectId}/authority-transfers/${transferId}/checkpoint/${artifact}`, {
208
208
  artifact,
209
209
  direction,
210
210
  kind: 'authority-transfer-artifact',
@@ -217,7 +217,7 @@ export function collabCloudProjectCheckpointExportArtifactRoute(projectId, expor
217
217
  assertAttemptId(exportId);
218
218
  if (!COLLAB_PROJECT_CHECKPOINT_ARTIFACTS_SET.has(artifact))
219
219
  invalidRoute();
220
- return route('GET', `/v4/projects/${projectId}/checkpoint-exports/${exportId}/checkpoint/${artifact}`, {
220
+ return route('GET', `/v5/projects/${projectId}/checkpoint-exports/${exportId}/checkpoint/${artifact}`, {
221
221
  artifact,
222
222
  exportId,
223
223
  kind: 'project-checkpoint-export-artifact',
@@ -229,7 +229,7 @@ export function collabCloudProjectCheckpointExportRoute(projectId, exportId, ope
229
229
  assertAttemptId(exportId);
230
230
  if (operation !== 'begin' && operation !== 'status')
231
231
  invalidRoute();
232
- return route(operation === 'begin' ? 'POST' : 'GET', `/v4/projects/${projectId}/checkpoint-exports/${exportId}`, { exportId, kind: 'project-checkpoint-export', operation, projectId });
232
+ return route(operation === 'begin' ? 'POST' : 'GET', `/v5/projects/${projectId}/checkpoint-exports/${exportId}`, { exportId, kind: 'project-checkpoint-export', operation, projectId });
233
233
  }
234
234
  export function decodeCollabCloudProjectCheckpointExportStatus(value) {
235
235
  const source = exactRecord(value, 'checkpointExport', [
@@ -267,7 +267,7 @@ export function decodeCollabCloudProjectCheckpointExportStatus(value) {
267
267
  });
268
268
  }
269
269
  export function collabDevelopmentBootstrapRoute(operation, attemptId) {
270
- const base = '/v4/development/bootstrap/attempts';
270
+ const base = '/v5/development/bootstrap/attempts';
271
271
  if (operation === 'beginDevelopmentBootstrap') {
272
272
  if (attemptId !== undefined)
273
273
  invalidRoute();
@@ -326,7 +326,7 @@ export function matchCollabCloudRoute(method, target) {
326
326
  && url.pathname === '/collab/capabilities'
327
327
  && exactQuery(url, []))
328
328
  return { kind: 'capabilities' };
329
- if (segments[0] === 'v4'
329
+ if (segments[0] === 'v5'
330
330
  && segments[1] === 'projects'
331
331
  && isCollabProjectId(segments[2])) {
332
332
  const projectId = segments[2];
@@ -405,7 +405,7 @@ export function matchCollabCloudRoute(method, target) {
405
405
  && exactQuery(url, []))
406
406
  return { kind: segments[4], projectId };
407
407
  }
408
- if (segments[0] !== 'v4'
408
+ if (segments[0] !== 'v5'
409
409
  || segments[1] !== 'development'
410
410
  || segments[2] !== 'bootstrap'
411
411
  || segments[3] !== 'attempts'
@@ -513,21 +513,32 @@ export function decodeCollabCloudSuccessEnvelope(value) {
513
513
  requestId: source.requestId,
514
514
  });
515
515
  }
516
- export function collabCloudErrorEnvelope(requestId, error) {
516
+ export function collabCloudErrorEnvelope(requestId, error, mutationOutcome) {
517
517
  if (!isCollabOpaqueId(requestId))
518
518
  throw invalidPayload('requestId');
519
+ if (mutationOutcome !== undefined && mutationOutcome !== 'rejected') {
520
+ throw invalidPayload('mutationOutcome');
521
+ }
519
522
  return Object.freeze({
520
523
  error: Object.freeze({
521
524
  code: error.code,
522
525
  recoveryActions: Object.freeze([...error.recoveryActions]),
523
526
  safeContext: error.safeContext,
524
527
  }),
528
+ ...(mutationOutcome === undefined ? {} : { mutationOutcome }),
525
529
  protocolVersion: COLLAB_PROTOCOL_VERSION,
526
530
  requestId,
527
531
  });
528
532
  }
529
533
  export function decodeCollabCloudErrorEnvelope(value) {
530
- const source = exactRecord(value, 'envelope', ['error', 'protocolVersion', 'requestId']);
534
+ const source = record(value, 'envelope');
535
+ const hasOutcome = Object.hasOwn(source, 'mutationOutcome');
536
+ if (!hasExactKeys(source, hasOutcome
537
+ ? ['error', 'mutationOutcome', 'protocolVersion', 'requestId']
538
+ : ['error', 'protocolVersion', 'requestId']))
539
+ throw invalidPayload('envelope');
540
+ if (hasOutcome && source.mutationOutcome !== 'rejected')
541
+ throw invalidPayload('mutationOutcome');
531
542
  const wireError = exactRecord(source.error, 'error', [
532
543
  'code',
533
544
  'recoveryActions',
@@ -553,6 +564,7 @@ export function decodeCollabCloudErrorEnvelope(value) {
553
564
  ]),
554
565
  safeContext,
555
566
  }),
567
+ ...(hasOutcome ? { mutationOutcome: 'rejected' } : {}),
556
568
  protocolVersion: COLLAB_PROTOCOL_VERSION,
557
569
  requestId: source.requestId,
558
570
  });
@@ -1,4 +1,4 @@
1
- export const COLLAB_PROTOCOL_VERSION = 8;
1
+ export const COLLAB_PROTOCOL_VERSION = 9;
2
2
  export const COLLAB_MAIN_REF = 'refs/heads/main';
3
3
  export const COLLAB_MEMBER_REF_PREFIX = 'refs/heads/members/';
4
4
  export const COLLAB_LIMITS = Object.freeze({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claudian-collab/protocol",
3
- "version": "4.1.4",
3
+ "version": "4.2.0",
4
4
  "description": "Canonical Collab wire and Cloud binding contract for Claudian clients and servers.",
5
5
  "license": "MIT",
6
6
  "repository": {