@pantheon-systems/css-client 0.4.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.
Files changed (89) hide show
  1. package/dist/auth.d.ts +54 -0
  2. package/dist/auth.d.ts.map +1 -0
  3. package/dist/auth.js +72 -0
  4. package/dist/auth.js.map +1 -0
  5. package/dist/broker.d.ts +41 -0
  6. package/dist/broker.d.ts.map +1 -0
  7. package/dist/broker.js +187 -0
  8. package/dist/broker.js.map +1 -0
  9. package/dist/client.d.ts +138 -0
  10. package/dist/client.d.ts.map +1 -0
  11. package/dist/client.js +130 -0
  12. package/dist/client.js.map +1 -0
  13. package/dist/content.d.ts +45 -0
  14. package/dist/content.d.ts.map +1 -0
  15. package/dist/content.js +65 -0
  16. package/dist/content.js.map +1 -0
  17. package/dist/endpoints/agent-edit.d.ts +79 -0
  18. package/dist/endpoints/agent-edit.d.ts.map +1 -0
  19. package/dist/endpoints/agent-edit.js +125 -0
  20. package/dist/endpoints/agent-edit.js.map +1 -0
  21. package/dist/endpoints/agent-registry.d.ts +59 -0
  22. package/dist/endpoints/agent-registry.d.ts.map +1 -0
  23. package/dist/endpoints/agent-registry.js +96 -0
  24. package/dist/endpoints/agent-registry.js.map +1 -0
  25. package/dist/endpoints/base.d.ts +49 -0
  26. package/dist/endpoints/base.d.ts.map +1 -0
  27. package/dist/endpoints/base.js +150 -0
  28. package/dist/endpoints/base.js.map +1 -0
  29. package/dist/endpoints/branches.d.ts +32 -0
  30. package/dist/endpoints/branches.d.ts.map +1 -0
  31. package/dist/endpoints/branches.js +69 -0
  32. package/dist/endpoints/branches.js.map +1 -0
  33. package/dist/endpoints/checkpoints.d.ts +36 -0
  34. package/dist/endpoints/checkpoints.d.ts.map +1 -0
  35. package/dist/endpoints/checkpoints.js +76 -0
  36. package/dist/endpoints/checkpoints.js.map +1 -0
  37. package/dist/endpoints/documents.d.ts +46 -0
  38. package/dist/endpoints/documents.d.ts.map +1 -0
  39. package/dist/endpoints/documents.js +101 -0
  40. package/dist/endpoints/documents.js.map +1 -0
  41. package/dist/endpoints/index.d.ts +15 -0
  42. package/dist/endpoints/index.d.ts.map +1 -0
  43. package/dist/endpoints/index.js +16 -0
  44. package/dist/endpoints/index.js.map +1 -0
  45. package/dist/endpoints/merge.d.ts +51 -0
  46. package/dist/endpoints/merge.d.ts.map +1 -0
  47. package/dist/endpoints/merge.js +104 -0
  48. package/dist/endpoints/merge.js.map +1 -0
  49. package/dist/endpoints/presence.d.ts +55 -0
  50. package/dist/endpoints/presence.d.ts.map +1 -0
  51. package/dist/endpoints/presence.js +72 -0
  52. package/dist/endpoints/presence.js.map +1 -0
  53. package/dist/endpoints/sites.d.ts +20 -0
  54. package/dist/endpoints/sites.d.ts.map +1 -0
  55. package/dist/endpoints/sites.js +38 -0
  56. package/dist/endpoints/sites.js.map +1 -0
  57. package/dist/endpoints/versions.d.ts +37 -0
  58. package/dist/endpoints/versions.d.ts.map +1 -0
  59. package/dist/endpoints/versions.js +64 -0
  60. package/dist/endpoints/versions.js.map +1 -0
  61. package/dist/errors.d.ts +61 -0
  62. package/dist/errors.d.ts.map +1 -0
  63. package/dist/errors.js +87 -0
  64. package/dist/errors.js.map +1 -0
  65. package/dist/index.d.ts +20 -0
  66. package/dist/index.d.ts.map +1 -0
  67. package/dist/index.js +20 -0
  68. package/dist/index.js.map +1 -0
  69. package/dist/jwt-utils.d.ts +13 -0
  70. package/dist/jwt-utils.d.ts.map +1 -0
  71. package/dist/jwt-utils.js +45 -0
  72. package/dist/jwt-utils.js.map +1 -0
  73. package/dist/oauth.d.ts +64 -0
  74. package/dist/oauth.d.ts.map +1 -0
  75. package/dist/oauth.js +62 -0
  76. package/dist/oauth.js.map +1 -0
  77. package/dist/realtime.d.ts +314 -0
  78. package/dist/realtime.d.ts.map +1 -0
  79. package/dist/realtime.js +615 -0
  80. package/dist/realtime.js.map +1 -0
  81. package/dist/types.d.ts +703 -0
  82. package/dist/types.d.ts.map +1 -0
  83. package/dist/types.js +7 -0
  84. package/dist/types.js.map +1 -0
  85. package/dist/utils.d.ts +3 -0
  86. package/dist/utils.d.ts.map +1 -0
  87. package/dist/utils.js +17 -0
  88. package/dist/utils.js.map +1 -0
  89. package/package.json +56 -0
@@ -0,0 +1,703 @@
1
+ /**
2
+ * P1 Client Types
3
+ *
4
+ * TypeScript types matching the Collaborative State System API.
5
+ */
6
+ /**
7
+ * Workflow settings for a site.
8
+ */
9
+ export interface WorkflowSettings {
10
+ mergeApprovalMode: 'optional' | 'required';
11
+ minApprovers: number;
12
+ allowSelfApproval: boolean;
13
+ approverMode: 'users' | 'agents' | 'both';
14
+ approverMinRole: string;
15
+ }
16
+ /**
17
+ * A site in the Collaborative State System.
18
+ */
19
+ export interface Site {
20
+ id: string;
21
+ pantheonSiteId: string;
22
+ name: string;
23
+ workflowSettings: WorkflowSettings;
24
+ createdAt: string;
25
+ updatedAt: string;
26
+ }
27
+ /**
28
+ * Branch status values.
29
+ */
30
+ export type BranchStatus = 'active' | 'merged' | 'archived';
31
+ /**
32
+ * A branch within a site.
33
+ */
34
+ export interface Branch {
35
+ id: string;
36
+ siteId: string;
37
+ name: string;
38
+ isMain: boolean;
39
+ status: BranchStatus;
40
+ sourceBranchId: string | null;
41
+ sourceCheckpointId: string | null;
42
+ createdById: string;
43
+ createdByType: 'user' | 'agent';
44
+ createdAt: string;
45
+ updatedAt: string;
46
+ }
47
+ /**
48
+ * A document (page) within a site.
49
+ */
50
+ export interface Document {
51
+ id: string;
52
+ siteId: string;
53
+ path: string;
54
+ archived: boolean;
55
+ createdAt: string;
56
+ updatedAt: string;
57
+ /** Whether this document has been published on the current branch */
58
+ isPublished?: boolean;
59
+ /** Version ID from the most recent checkpoint containing this document */
60
+ publishedVersionId?: string | null;
61
+ /** Timestamp of the checkpoint that published this document */
62
+ publishedAt?: string | null;
63
+ /** Whether this document is inherited from the parent branch (COW) vs locally edited */
64
+ inherited?: boolean;
65
+ }
66
+ /**
67
+ * Document version source types.
68
+ */
69
+ export type DocumentVersionSource = 'edit' | 'merge' | 'revert' | 'initial';
70
+ /**
71
+ * A version of a document on a specific branch.
72
+ */
73
+ export interface DocumentVersion {
74
+ id: string;
75
+ documentId: string;
76
+ branchId: string;
77
+ versionNumber: number;
78
+ snapshot: Record<string, unknown>;
79
+ crdtState: string | null;
80
+ source: DocumentVersionSource;
81
+ createdById: string;
82
+ createdByType: 'user' | 'agent';
83
+ createdAt: string;
84
+ /** Whether this version has been published (exists in a checkpoint) */
85
+ isPublished?: boolean;
86
+ }
87
+ /**
88
+ * Checkpoint types.
89
+ */
90
+ export type CheckpointType = 'manual' | 'auto' | 'merge' | 'pre_merge' | 'agent_edit';
91
+ /**
92
+ * Checkpoint status for agent edits.
93
+ */
94
+ export type CheckpointStatus = 'completed' | 'rolled_back';
95
+ /**
96
+ * A checkpoint capturing the state of all documents on a branch.
97
+ */
98
+ export interface Checkpoint {
99
+ id: string;
100
+ branchId: string;
101
+ name: string | null;
102
+ checkpointType: CheckpointType;
103
+ createdById: string;
104
+ createdByType: 'user' | 'agent';
105
+ createdAt: string;
106
+ /** Name of the creator (user or agent) */
107
+ createdByName?: string;
108
+ /** Description of what was done */
109
+ description?: string;
110
+ /** How the action was triggered */
111
+ trigger?: AgentTrigger;
112
+ /** ID of the user who requested the agent action */
113
+ requestedById?: string;
114
+ /** Name of the user who requested the agent action */
115
+ requestedByName?: string;
116
+ /** Type of operation performed */
117
+ operationType?: string;
118
+ /** Regions affected by the operation */
119
+ affectedRegions?: string[];
120
+ /** Status of the checkpoint */
121
+ status?: CheckpointStatus;
122
+ /** ID of user who rolled back (if rolled_back) */
123
+ rolledBackById?: string;
124
+ /** When the checkpoint was rolled back */
125
+ rolledBackAt?: string;
126
+ }
127
+ /**
128
+ * Document with its version snapshot at a checkpoint.
129
+ */
130
+ export interface CheckpointDocument {
131
+ documentId: string;
132
+ documentPath: string;
133
+ versionId: string;
134
+ versionNumber: number;
135
+ snapshot: Record<string, unknown>;
136
+ }
137
+ /**
138
+ * Puck component data.
139
+ */
140
+ export interface PuckComponentData {
141
+ type: string;
142
+ props: Record<string, unknown> & {
143
+ id: string;
144
+ };
145
+ }
146
+ /**
147
+ * Puck root data.
148
+ */
149
+ export interface PuckRootData {
150
+ props?: Record<string, unknown>;
151
+ }
152
+ /**
153
+ * Puck page data structure.
154
+ * This is the format stored in DocumentVersion.snapshot.
155
+ */
156
+ export interface PuckData {
157
+ content: PuckComponentData[];
158
+ root: PuckRootData;
159
+ zones?: Record<string, PuckComponentData[]>;
160
+ }
161
+ /**
162
+ * Principal (user or agent) making API requests.
163
+ */
164
+ export interface Principal {
165
+ id: string;
166
+ type: 'user' | 'agent';
167
+ }
168
+ /**
169
+ * Pagination options for list endpoints.
170
+ */
171
+ export interface PaginationOptions {
172
+ limit?: number;
173
+ offset?: number;
174
+ }
175
+ /**
176
+ * Parameters for creating a branch.
177
+ */
178
+ export interface CreateBranchParams {
179
+ siteId: string;
180
+ name: string;
181
+ sourceBranchId?: string;
182
+ }
183
+ /**
184
+ * Parameters for creating a document.
185
+ */
186
+ export interface CreateDocumentParams {
187
+ siteId: string;
188
+ branchId: string;
189
+ path: string;
190
+ }
191
+ /**
192
+ * Parameters for creating a document version.
193
+ */
194
+ export interface CreateDocumentVersionParams {
195
+ documentId: string;
196
+ branchId: string;
197
+ snapshot: Record<string, unknown>;
198
+ }
199
+ /**
200
+ * Parameters for creating a checkpoint.
201
+ */
202
+ export interface CreateCheckpointParams {
203
+ branchId: string;
204
+ name?: string;
205
+ type?: CheckpointType;
206
+ }
207
+ /**
208
+ * Result of publishing a single document.
209
+ */
210
+ export interface PublishDocumentResult {
211
+ checkpoint: Checkpoint;
212
+ publishedVersionId: string;
213
+ }
214
+ /**
215
+ * List documents options.
216
+ */
217
+ export interface ListDocumentsOptions extends PaginationOptions {
218
+ pathPrefix?: string;
219
+ }
220
+ /**
221
+ * Actor state in a document session.
222
+ */
223
+ export type ActorState = 'active' | 'idle' | 'editing';
224
+ /**
225
+ * Simplified role for presence display.
226
+ */
227
+ export type ActorRole = 'human' | 'agent';
228
+ /**
229
+ * Presence information for an actor in a document.
230
+ */
231
+ export interface ActorPresence {
232
+ id: string;
233
+ actorId: string;
234
+ actorType: 'user' | 'agent';
235
+ role: ActorRole;
236
+ name: string;
237
+ avatar?: string;
238
+ state: ActorState;
239
+ intent?: string;
240
+ focusRegions?: string[];
241
+ lastActivityAt: string;
242
+ joinedAt: string;
243
+ }
244
+ /**
245
+ * Summary of presence in a document.
246
+ */
247
+ export interface DocumentPresenceSummary {
248
+ documentId: string;
249
+ documentPath: string;
250
+ actorCount: number;
251
+ hasHumans: boolean;
252
+ hasAgents: boolean;
253
+ }
254
+ /**
255
+ * Summary of presence in a branch.
256
+ */
257
+ export interface BranchPresenceSummary {
258
+ branchId: string;
259
+ branchName: string;
260
+ actorCount: number;
261
+ hasHumans: boolean;
262
+ hasAgents: boolean;
263
+ }
264
+ /**
265
+ * Presence rollup for a branch.
266
+ */
267
+ export interface BranchPresence {
268
+ branchId: string;
269
+ branchName: string;
270
+ siteId: string;
271
+ summary: {
272
+ totalActors: number;
273
+ humanCount: number;
274
+ agentCount: number;
275
+ editingCount: number;
276
+ };
277
+ actors: ActorPresence[];
278
+ documentSummary: DocumentPresenceSummary[];
279
+ }
280
+ /**
281
+ * Presence rollup for a site.
282
+ */
283
+ export interface SitePresence {
284
+ siteId: string;
285
+ siteName: string;
286
+ summary: {
287
+ totalActors: number;
288
+ humanCount: number;
289
+ agentCount: number;
290
+ activeBranches: number;
291
+ };
292
+ branches: BranchPresenceSummary[];
293
+ }
294
+ /**
295
+ * Location where an agent is present.
296
+ */
297
+ export interface AgentPresenceLocation {
298
+ siteId: string;
299
+ siteName: string;
300
+ branchId: string;
301
+ branchName: string;
302
+ documentId: string;
303
+ documentPath: string;
304
+ presence: ActorPresence;
305
+ }
306
+ /**
307
+ * Global presence for an agent across an organization.
308
+ */
309
+ export interface AgentGlobalPresence {
310
+ agentId: string;
311
+ agentName: string;
312
+ organizationId: string;
313
+ locations: AgentPresenceLocation[];
314
+ }
315
+ /**
316
+ * Agent status values.
317
+ */
318
+ export type AgentStatus = 'active' | 'suspended' | 'disabled';
319
+ /**
320
+ * Agent settings.
321
+ */
322
+ export interface AgentSettings {
323
+ priorityTier?: string;
324
+ allowedOperationTypes?: string[];
325
+ maxConcurrentDocuments?: number;
326
+ }
327
+ /**
328
+ * A registered agent in an organization.
329
+ */
330
+ export interface RegisteredAgent {
331
+ id: string;
332
+ organizationId: string;
333
+ name: string;
334
+ description?: string;
335
+ capabilities: string[];
336
+ status: AgentStatus;
337
+ settings: AgentSettings;
338
+ createdAt: string;
339
+ updatedAt: string;
340
+ }
341
+ /**
342
+ * Parameters for creating an agent.
343
+ */
344
+ export interface CreateAgentParams {
345
+ name: string;
346
+ description?: string;
347
+ capabilities?: string[];
348
+ settings?: AgentSettings;
349
+ }
350
+ /**
351
+ * Parameters for updating an agent.
352
+ */
353
+ export interface UpdateAgentParams {
354
+ name?: string;
355
+ description?: string;
356
+ capabilities?: string[];
357
+ settings?: AgentSettings;
358
+ }
359
+ /**
360
+ * Options for listing agents.
361
+ */
362
+ export interface ListAgentsOptions {
363
+ status?: AgentStatus;
364
+ }
365
+ /**
366
+ * Trigger type for agent actions.
367
+ */
368
+ export type AgentTrigger = 'human_requested' | 'autonomous';
369
+ /**
370
+ * Reason why agent edit was denied.
371
+ */
372
+ export type AgentEditDenialReason = 'human_active' | 'region_conflict' | 'agent_suspended';
373
+ /**
374
+ * Context for an agent edit operation.
375
+ */
376
+ export interface AgentEditContext {
377
+ agentId: string;
378
+ trigger: AgentTrigger;
379
+ requestedById?: string;
380
+ intent: string;
381
+ targetRegions: string[];
382
+ operationType?: string;
383
+ }
384
+ /**
385
+ * Permission result for agent edit check.
386
+ */
387
+ export interface AgentEditPermission {
388
+ allowed: boolean;
389
+ reason?: AgentEditDenialReason;
390
+ retryAfterMs?: number;
391
+ conflictingRegions?: string[];
392
+ }
393
+ /**
394
+ * Session info returned when starting an agent edit.
395
+ */
396
+ export interface AgentEditSession {
397
+ sessionId: string;
398
+ checkpointId?: string;
399
+ }
400
+ /**
401
+ * Result of completing an agent edit.
402
+ */
403
+ export interface AgentEditCompleteResult {
404
+ success: boolean;
405
+ checkpointId?: string;
406
+ }
407
+ /**
408
+ * Result of aborting an agent edit.
409
+ */
410
+ export interface AgentEditAbortResult {
411
+ success: boolean;
412
+ checkpointId?: string;
413
+ }
414
+ /**
415
+ * Result of stopping an agent (human-initiated).
416
+ * Server looks up the agent's session and performs rollback if needed.
417
+ */
418
+ export interface AgentStopResult {
419
+ success: boolean;
420
+ rolledBack: boolean;
421
+ message?: string;
422
+ }
423
+ /**
424
+ * Response from updating focus regions.
425
+ */
426
+ export interface UpdateFocusRegionsResponse {
427
+ success: boolean;
428
+ focusRegions: string[];
429
+ }
430
+ /**
431
+ * Update focus regions for the current actor.
432
+ * Sent from client to server via WebSocket text frame.
433
+ */
434
+ export interface WsFocusRegionUpdateMessage {
435
+ type: 'focus_region_update';
436
+ /** JSON paths the actor is focused on */
437
+ focusRegions: string[];
438
+ /** Client timestamp for latency measurement */
439
+ timestamp: number;
440
+ }
441
+ /**
442
+ * Heartbeat to keep presence alive and optionally update state.
443
+ * Sent from client to server via WebSocket text frame.
444
+ */
445
+ export interface WsPresenceHeartbeatMessage {
446
+ type: 'presence_heartbeat';
447
+ /** Optional state update */
448
+ state?: ActorState;
449
+ /** Client timestamp for latency measurement */
450
+ timestamp: number;
451
+ }
452
+ /**
453
+ * Union of all client-to-server WebSocket messages.
454
+ */
455
+ export type WsClientMessage = WsFocusRegionUpdateMessage | WsPresenceHeartbeatMessage;
456
+ /**
457
+ * Full presence update for all actors in the document.
458
+ * Sent from server to client on connect and periodically.
459
+ */
460
+ export interface WsPresenceUpdateMessage {
461
+ type: 'presence_update';
462
+ /** All actors currently present in the document */
463
+ actors: ActorPresence[];
464
+ /** Server timestamp */
465
+ timestamp: number;
466
+ }
467
+ /**
468
+ * Incremental broadcast when another actor updates their focus regions.
469
+ * Sent from server to client.
470
+ */
471
+ export interface WsFocusRegionBroadcastMessage {
472
+ type: 'focus_region_broadcast';
473
+ /** Actor whose focus regions changed */
474
+ actorId: string;
475
+ /** New focus regions for this actor */
476
+ focusRegions: string[];
477
+ /** Server timestamp */
478
+ timestamp: number;
479
+ }
480
+ /**
481
+ * Acknowledgment of focus region update from client.
482
+ * Sent from server to client.
483
+ */
484
+ export interface WsFocusRegionAckMessage {
485
+ type: 'focus_region_ack';
486
+ /** Whether the update was accepted */
487
+ success: boolean;
488
+ /** The focus regions that were set */
489
+ focusRegions: string[];
490
+ /** Server timestamp */
491
+ timestamp: number;
492
+ }
493
+ /**
494
+ * Error message for invalid presence operations.
495
+ * Sent from server to client.
496
+ */
497
+ export interface WsPresenceErrorMessage {
498
+ type: 'presence_error';
499
+ /** Error code for programmatic handling */
500
+ code: string;
501
+ /** Human-readable error message */
502
+ message: string;
503
+ /** Server timestamp */
504
+ timestamp: number;
505
+ }
506
+ /**
507
+ * Server acknowledgment that all preceding messages have been processed.
508
+ * Sent in response to a delivery_ack_request from the client.
509
+ */
510
+ export interface WsDeliveryAckMessage {
511
+ type: 'delivery_ack';
512
+ /** Matches the requestId from the request */
513
+ requestId: string;
514
+ /** Server timestamp */
515
+ timestamp: number;
516
+ }
517
+ /**
518
+ * Result of a WebSocket-driven publish request.
519
+ * Sent in response to publish_request after the DO completes flush + publish.
520
+ */
521
+ export interface WsPublishResultMessage {
522
+ type: 'publish_result';
523
+ /** Matches the requestId from the request */
524
+ requestId: string;
525
+ /** Whether the publish succeeded */
526
+ success: boolean;
527
+ /** The published version ID (on success) */
528
+ publishedVersionId?: string;
529
+ /** The checkpoint created by the publish (on success) */
530
+ checkpoint?: Checkpoint;
531
+ /** Error message (on failure) */
532
+ error?: string;
533
+ /** Server timestamp */
534
+ timestamp: number;
535
+ }
536
+ /**
537
+ * Result returned by requestPublish().
538
+ */
539
+ export interface PublishResult {
540
+ success: boolean;
541
+ publishedVersionId?: string;
542
+ checkpoint?: Checkpoint;
543
+ error?: string;
544
+ }
545
+ /**
546
+ * Union of all server-to-client WebSocket messages.
547
+ */
548
+ export type WsServerMessage = WsPresenceUpdateMessage | WsFocusRegionBroadcastMessage | WsFocusRegionAckMessage | WsPresenceErrorMessage | WsDeliveryAckMessage | WsPublishResultMessage;
549
+ /**
550
+ * Merge conflict resolution strategies (matches backend).
551
+ */
552
+ export type ConflictResolutionStrategy = 'take-source' | 'take-target' | 'manual';
553
+ /**
554
+ * Merge request workflow states.
555
+ */
556
+ export type MergeRequestStatus = 'open' | 'approved' | 'merged' | 'closed' | 'conflicted';
557
+ /**
558
+ * Document-level conflict types.
559
+ */
560
+ export type DocumentConflictType = 'both-modified' | 'deleted-in-source' | 'deleted-in-target';
561
+ /**
562
+ * A single document conflict in a merge.
563
+ */
564
+ export interface DocumentConflict {
565
+ documentId: string;
566
+ documentPath: string;
567
+ conflictType: DocumentConflictType;
568
+ sourceVersion?: number;
569
+ targetVersion?: number;
570
+ baseVersion?: number;
571
+ }
572
+ /**
573
+ * Conflict details containing document and structure conflicts.
574
+ */
575
+ export interface ConflictDetails {
576
+ documentConflicts: DocumentConflict[];
577
+ structureConflicts: unknown[];
578
+ }
579
+ /**
580
+ * Result of checking mergeability between two branches.
581
+ */
582
+ export interface MergeabilityResult {
583
+ canMerge: boolean;
584
+ conflicts: DocumentConflict[];
585
+ mergeBase: {
586
+ checkpointId: string;
587
+ branchId: string;
588
+ };
589
+ changes: {
590
+ documentsModifiedInSource: string[];
591
+ documentsModifiedInTarget: string[];
592
+ };
593
+ }
594
+ /**
595
+ * Diff information for a single document in a merge.
596
+ */
597
+ export interface DocumentDiff {
598
+ documentId: string;
599
+ documentPath: string;
600
+ sourceSnapshot: Record<string, unknown> | null;
601
+ targetSnapshot: Record<string, unknown> | null;
602
+ diffOperations: unknown[];
603
+ }
604
+ /**
605
+ * A document that was modified on a branch since the merge base.
606
+ */
607
+ export interface MergeDocumentChange {
608
+ documentId: string;
609
+ documentPath: string;
610
+ latestVersionId?: string | null;
611
+ latestVersionNumber?: number | null;
612
+ baseVersionId?: string | null;
613
+ baseVersionNumber?: number | null;
614
+ isDeleted?: boolean;
615
+ }
616
+ /**
617
+ * Preview of a merge operation between two branches.
618
+ */
619
+ export interface MergePreview {
620
+ canMerge: boolean;
621
+ hasConflicts: boolean;
622
+ conflicts: ConflictDetails;
623
+ sourceChanges: MergeDocumentChange[];
624
+ targetChanges: MergeDocumentChange[];
625
+ mergeBase: {
626
+ checkpointId: string;
627
+ branchId: string;
628
+ } | null;
629
+ documentDiffs?: DocumentDiff[];
630
+ }
631
+ /**
632
+ * Parameters for executing a merge.
633
+ */
634
+ export interface MergeExecuteParams {
635
+ sourceBranchId: string;
636
+ targetBranchId: string;
637
+ message?: string;
638
+ conflictResolutions?: {
639
+ documentId: string;
640
+ strategy: ConflictResolutionStrategy;
641
+ resolvedSnapshot?: Record<string, unknown>;
642
+ }[];
643
+ }
644
+ /**
645
+ * Result of executing a merge.
646
+ */
647
+ export interface MergeExecuteResult {
648
+ success: boolean;
649
+ checkpointId?: string;
650
+ documentsUpdated?: number;
651
+ }
652
+ /**
653
+ * A merge request in the system.
654
+ */
655
+ export interface MergeRequest {
656
+ id: string;
657
+ siteId: string;
658
+ sourceBranchId: string;
659
+ targetBranchId: string;
660
+ title: string;
661
+ description?: string;
662
+ status: MergeRequestStatus;
663
+ hasConflicts: boolean;
664
+ conflictDetails?: ConflictDetails;
665
+ createdById: string;
666
+ createdByType: 'user' | 'agent';
667
+ createdAt: string;
668
+ updatedAt: string;
669
+ }
670
+ /**
671
+ * Parameters for creating a merge request.
672
+ */
673
+ export interface CreateMergeRequestParams {
674
+ sourceBranchId: string;
675
+ targetBranchId: string;
676
+ title: string;
677
+ description?: string;
678
+ }
679
+ /**
680
+ * Parameters for updating a merge request.
681
+ */
682
+ export interface UpdateMergeRequestParams {
683
+ title?: string;
684
+ description?: string;
685
+ status?: MergeRequestStatus;
686
+ }
687
+ /**
688
+ * Options for listing merge requests.
689
+ */
690
+ export interface ListMergeRequestsOptions {
691
+ status?: MergeRequestStatus;
692
+ }
693
+ /**
694
+ * Options for executing a merge request.
695
+ */
696
+ export interface ExecuteMergeRequestOptions {
697
+ resolutions?: {
698
+ documentId: string;
699
+ strategy: ConflictResolutionStrategy;
700
+ resolvedSnapshot?: Record<string, unknown>;
701
+ }[];
702
+ }
703
+ //# sourceMappingURL=types.d.ts.map