@vcp-dev/site-edit-engine 0.10.69 → 0.11.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.
@@ -1,769 +0,0 @@
1
- import type { SiteEditCommandSuccess, SiteEditCompositionContext, SiteEditCompositionSelector, SiteEditMutationContext, SiteEditOperationSelectionRef, SiteEditResolveSourceLocationInput } from "@vcp-dev/contracts";
2
- import type { SiteEditEngineHistoryStatus, PreviewSiteEditEngineRuntime, PreviewSiteEditEngineRuntimeOptions } from "./types.js";
3
- export declare class PreviewFileSystemSiteEditEngineRuntime implements PreviewSiteEditEngineRuntime {
4
- private readonly options;
5
- private readonly engine;
6
- private readonly listeners;
7
- constructor(options: PreviewSiteEditEngineRuntimeOptions);
8
- get status(): PreviewSiteEditEngineRuntime["status"];
9
- initializeComposition(composition: SiteEditCompositionSelector): Promise<void>;
10
- registerComposition(composition: SiteEditCompositionContext, entryFile: string): void;
11
- unregisterComposition(composition: SiteEditCompositionSelector): void;
12
- getDocument(composition: SiteEditCompositionSelector): {
13
- ok: true;
14
- composition: {
15
- routeId: string;
16
- effectiveTemplateId?: string | undefined;
17
- };
18
- data: {
19
- siteId: string;
20
- snapshotId: string;
21
- composition: {
22
- routeId: string;
23
- effectiveTemplateId?: string | undefined;
24
- };
25
- version: number;
26
- entries: {
27
- key: string;
28
- operationSummary: {
29
- canUpdateText: boolean;
30
- canInsertChild: boolean;
31
- canMove: boolean;
32
- canRemove: boolean;
33
- };
34
- parentKey?: string | null | undefined;
35
- pageCompositionUnitKey?: string | undefined;
36
- pageCompositionActionScope?: {
37
- kind: "route-unit";
38
- } | {
39
- kind: "source-siblings";
40
- siblingKeys: string[];
41
- } | {
42
- kind: "unavailable";
43
- } | undefined;
44
- dynamicDataSummary?: {
45
- hasDynamicData: boolean;
46
- sourceKinds: ("vcp-cms-collection" | "vcp-cms-form" | "vcp-cms-settings" | "vcp-cms-navigation" | "site-api-route" | "external-api" | "unknown-api")[];
47
- collections?: string[] | undefined;
48
- primaryEndpoint?: string | undefined;
49
- primaryCollection?: string | undefined;
50
- primaryFieldPath?: string | undefined;
51
- } | undefined;
52
- }[];
53
- pageComposition: {
54
- status: "supported";
55
- containerKey: string;
56
- hasBusinessMembers: boolean;
57
- placementUnitKeys: string[];
58
- placements: {
59
- placementKey: string;
60
- placementUnitKey: string;
61
- relation: "before" | "after" | "prepend" | "append";
62
- }[];
63
- } | {
64
- status: "unsupported";
65
- reason: "VERSION_STALE" | "RECOVERY_REQUIRED" | "MULTIPLE_PAGE_RETURNS" | "INDIRECT_RETURN_ONLY" | "PAGE_CONTAINER_AMBIGUOUS" | "NO_SAFE_PAGE_PLACEMENT" | "MEMBER_NOT_INDEPENDENT" | "UNSUPPORTED_ROUTE_STRUCTURE" | "RUNTIME_ANCHOR_UNRESOLVED" | "ROUTE_RETURN_NOT_FOUND";
66
- diagnostics: {
67
- code: string;
68
- message: string;
69
- }[];
70
- };
71
- };
72
- };
73
- getStyleContext(composition: SiteEditCompositionSelector): {
74
- ok: true;
75
- composition: {
76
- routeId: string;
77
- effectiveTemplateId?: string | undefined;
78
- };
79
- data: {
80
- composition: {
81
- routeId: string;
82
- effectiveTemplateId?: string | undefined;
83
- };
84
- revision: string;
85
- entryCss: {
86
- path: string;
87
- content: string;
88
- hash?: string | undefined;
89
- };
90
- stylesheets: {
91
- path: string;
92
- content: string;
93
- hash?: string | undefined;
94
- }[];
95
- } | null;
96
- };
97
- getHistoryStatus(): Promise<SiteEditCommandSuccess<SiteEditEngineHistoryStatus>>;
98
- getObjectEditContext(key: string, composition: SiteEditCompositionSelector, selectionRef?: SiteEditOperationSelectionRef): {
99
- readonly ok: true;
100
- readonly composition: {
101
- routeId: string;
102
- effectiveTemplateId?: string | undefined;
103
- };
104
- readonly data: {
105
- composition: {
106
- routeId: string;
107
- effectiveTemplateId?: string | undefined;
108
- };
109
- key: string;
110
- tag: string;
111
- label: string;
112
- isOpaque: boolean;
113
- ancestors: {
114
- key: string;
115
- label: string;
116
- tag: string;
117
- }[];
118
- componentName: string;
119
- sourceFile: string;
120
- capabilities: {
121
- composition: {
122
- routeId: string;
123
- effectiveTemplateId?: string | undefined;
124
- };
125
- key: string;
126
- canUpdateText: boolean;
127
- canInsertChild: boolean;
128
- canMove: boolean;
129
- canRemove: boolean;
130
- constraints: {
131
- kind: "component-boundary" | "repeat-region" | "conditional-region" | "opaque-region" | "void-element" | "read-only" | "cross-file-required" | "import-required";
132
- message: string;
133
- }[];
134
- editModes?: {
135
- updateText?: {
136
- mode: "direct" | "proxy" | "upstream" | "readonly" | "unsupported";
137
- reasonCode?: string | undefined;
138
- } | undefined;
139
- insertChild?: {
140
- mode: "direct" | "proxy" | "upstream" | "readonly" | "unsupported";
141
- reasonCode?: string | undefined;
142
- } | undefined;
143
- move?: {
144
- mode: "direct" | "proxy" | "upstream" | "readonly" | "unsupported";
145
- reasonCode?: string | undefined;
146
- } | undefined;
147
- remove?: {
148
- mode: "direct" | "proxy" | "upstream" | "readonly" | "unsupported";
149
- reasonCode?: string | undefined;
150
- } | undefined;
151
- } | undefined;
152
- };
153
- textSegments: {
154
- index: number;
155
- editable: boolean;
156
- sourceKind: "literal" | "binding" | "imported-binding" | "repeat-template" | null;
157
- }[];
158
- boundaryKind: "component-boundary" | "repeat-region" | "conditional-region" | "fragment-region" | "opaque-region" | null;
159
- linkSourceKind?: "unsupported" | "native-anchor" | "next-link" | undefined;
160
- sourceLocator?: {
161
- sourceFile: string;
162
- componentName: string;
163
- openingElementRange: {
164
- startLine: number;
165
- startColumn: number;
166
- endLine: number;
167
- endColumn: number;
168
- };
169
- structuralPath: string;
170
- textPreview?: string | undefined;
171
- } | undefined;
172
- provenanceChain?: {
173
- editMode: "direct" | "proxy" | "upstream" | "readonly" | "unsupported";
174
- diagnostics: {
175
- code: string;
176
- message: string;
177
- }[];
178
- } | undefined;
179
- dynamicData?: {
180
- hasDynamicData: boolean;
181
- bindings: {
182
- sourceKind: "vcp-cms-collection" | "vcp-cms-form" | "vcp-cms-settings" | "vcp-cms-navigation" | "site-api-route" | "external-api" | "unknown-api";
183
- sourceType: "api-field" | "cms-field";
184
- targetKind: "repeat-region" | "conditional-region" | "text" | "attribute" | "richtext" | "component-prop";
185
- targetName: string;
186
- confidence: "exact" | "safe-derived" | "partial" | "unknown";
187
- readonly: true;
188
- evidence: {
189
- file: string;
190
- reason: string;
191
- symbol?: string | undefined;
192
- }[];
193
- endpointPattern?: string | undefined;
194
- operation?: string | undefined;
195
- collection?: string | undefined;
196
- fieldPath?: string | undefined;
197
- valuePath?: string | undefined;
198
- }[];
199
- } | undefined;
200
- properties?: {
201
- documentVersion: number;
202
- items: {
203
- name: string;
204
- source: {
205
- kind: "expression" | "literal" | "binding" | "repeat-template" | "boolean-shorthand";
206
- raw?: string | undefined;
207
- };
208
- resolution: {
209
- status: "resolved";
210
- value: import("@vcp-dev/contracts").SiteEditOperationValue;
211
- } | {
212
- status: "undefined";
213
- } | {
214
- status: "unresolved";
215
- };
216
- editMode: "direct" | "proxy" | "upstream" | "readonly" | "unsupported";
217
- sourceScope: "node" | "repeat-template" | "repeat-item";
218
- allowedWriteScopes: ("template" | "selection")[];
219
- diagnostics: {
220
- code: string;
221
- message: string;
222
- }[];
223
- effectiveWriteTarget?: {
224
- kind: "jsx-node" | "route-export" | "value-path" | "external-entry";
225
- isProxy: boolean;
226
- file?: string | undefined;
227
- displayPath?: string | undefined;
228
- sourceType?: "api-field" | "cms-field" | "i18n-message" | "config-entry" | undefined;
229
- sourceId?: string | undefined;
230
- } | undefined;
231
- }[];
232
- spreads: {
233
- raw: string;
234
- sourceRange: {
235
- start: number;
236
- end: number;
237
- };
238
- order: number;
239
- diagnostics: {
240
- code: string;
241
- message: string;
242
- }[];
243
- }[];
244
- creation: {
245
- selection: "direct" | "unsupported" | "materialize";
246
- template: "direct" | "unsupported";
247
- };
248
- selectionRef?: {
249
- key: string;
250
- instanceIndex?: number | undefined;
251
- instanceCount?: number | undefined;
252
- } | undefined;
253
- } | undefined;
254
- };
255
- };
256
- getClassNameSource(key: string, composition: SiteEditCompositionSelector): {
257
- readonly ok: true;
258
- readonly composition: {
259
- routeId: string;
260
- effectiveTemplateId?: string | undefined;
261
- };
262
- readonly data: {
263
- key: string;
264
- composition: {
265
- routeId: string;
266
- effectiveTemplateId?: string | undefined;
267
- };
268
- filePath: string;
269
- componentName: string;
270
- sourceKind: "expression" | "missing" | "stringLiteral";
271
- attrRaw: string | null;
272
- valueRaw: string | null;
273
- attrRange: {
274
- start: number;
275
- end: number;
276
- } | null;
277
- openingElementRange: {
278
- start: number;
279
- end: number;
280
- };
281
- version: {
282
- documentVersion: number;
283
- contentHash: string;
284
- };
285
- diagnostics: {
286
- code: "missing-class-name" | "unsupported-attribute-name" | "source-locator-warning" | "invalid-new-attr" | "version-conflict" | "write-failed";
287
- message: string;
288
- }[];
289
- computedStyle?: Record<string, string> | undefined;
290
- };
291
- };
292
- getSourceTree(composition: SiteEditCompositionSelector): Promise<{
293
- ok: true;
294
- composition: {
295
- routeId: string;
296
- effectiveTemplateId?: string | undefined;
297
- };
298
- data: {
299
- composition: {
300
- routeId: string;
301
- effectiveTemplateId?: string | undefined;
302
- };
303
- nodes: import("@vcp-dev/contracts").SiteEditSourceTreeNode[];
304
- totalFiles: number;
305
- defaultPath?: string | undefined;
306
- truncated?: {
307
- reasons: ("max-files" | "max-depth" | "max-total-bytes")[];
308
- maxFiles: number;
309
- maxDepth: number;
310
- maxTotalBytes: number;
311
- } | undefined;
312
- };
313
- }>;
314
- getSourceFile(input: {
315
- path: string;
316
- composition: SiteEditCompositionSelector;
317
- }): Promise<{
318
- ok: true;
319
- composition: {
320
- routeId: string;
321
- effectiveTemplateId?: string | undefined;
322
- };
323
- data: {
324
- composition: {
325
- routeId: string;
326
- effectiveTemplateId?: string | undefined;
327
- };
328
- path: string;
329
- sizeBytes: number;
330
- kind: "text";
331
- language: string;
332
- readonly: boolean;
333
- content: string;
334
- contentHash?: string | undefined;
335
- } | {
336
- composition: {
337
- routeId: string;
338
- effectiveTemplateId?: string | undefined;
339
- };
340
- path: string;
341
- sizeBytes: number;
342
- kind: "binary";
343
- language: null;
344
- readonly: true;
345
- mimeType: string;
346
- contentHash?: string | undefined;
347
- contentBase64?: string | undefined;
348
- previewUnavailableReason?: "too-large" | "unsupported-mime" | "bytes-unavailable" | undefined;
349
- };
350
- }>;
351
- resolveSourceLocation(input: SiteEditResolveSourceLocationInput): {
352
- ok: true;
353
- composition: {
354
- routeId: string;
355
- effectiveTemplateId?: string | undefined;
356
- };
357
- data: {
358
- key: string;
359
- composition: {
360
- routeId: string;
361
- effectiveTemplateId?: string | undefined;
362
- };
363
- sourceFile: string;
364
- componentName: string;
365
- openingElementRange: {
366
- startLine: number;
367
- startColumn: number;
368
- endLine: number;
369
- endColumn: number;
370
- };
371
- structuralPath: string;
372
- textPreview?: string | undefined;
373
- };
374
- };
375
- refreshSourceForKey(key: string, composition: SiteEditCompositionSelector): Promise<void>;
376
- executeOperation(request: Parameters<PreviewSiteEditEngineRuntime["executeOperation"]>[0], mutationContext?: SiteEditMutationContext): Promise<SiteEditCommandSuccess<{
377
- requestId: string;
378
- kind: "set-props" | "insert-child" | "update-text" | "update-array-item" | "remove-node" | "replace-node" | "move-node" | "set-class-name-source" | "set-link-target" | "apply-style-draft" | "source-edit" | "insert-page-resource" | "delete-page-source";
379
- composition: {
380
- routeId: string;
381
- effectiveTemplateId?: string | undefined;
382
- };
383
- target: {
384
- kind: "node";
385
- key: string;
386
- } | {
387
- kind: "page-unit";
388
- composition: {
389
- routeId: string;
390
- effectiveTemplateId?: string | undefined;
391
- };
392
- placementUnitKey: string;
393
- } | {
394
- kind: "route";
395
- composition: {
396
- routeId: string;
397
- effectiveTemplateId?: string | undefined;
398
- };
399
- } | {
400
- kind: "source-file";
401
- path: string;
402
- } | {
403
- kind: "source-batch";
404
- paths: string[];
405
- } | {
406
- kind: "project";
407
- };
408
- resultVersion: number;
409
- affectedFiles?: string[] | undefined;
410
- fileChanges?: {
411
- path: string;
412
- operation: "delete" | "upsert";
413
- }[] | undefined;
414
- selectionRef?: {
415
- key: string;
416
- instanceIndex?: number | undefined;
417
- instanceCount?: number | undefined;
418
- } | undefined;
419
- output?: {
420
- kind: "insert-page-resource";
421
- package_instance_id: string;
422
- pages: {
423
- template_page_id: string;
424
- title: string;
425
- final_route: string;
426
- route_file_path: string;
427
- }[];
428
- } | {
429
- kind: "delete-page-source";
430
- deleted_files: string[];
431
- updated_files: string[];
432
- preserved_shared_files: string[];
433
- warnings: string[];
434
- } | undefined;
435
- }> | import("@vcp-dev/contracts").SiteEditCommandFailure<"VERSION_STALE" | "RECOVERY_REQUIRED" | "NODE_NOT_FOUND" | "HOME_PAGE_LOCKED" | "ROUTE_NOT_FOUND" | "CAPABILITY_REJECTED" | "CONSTRAINT_VIOLATED" | "INVALID_PARAMS" | "PLAN_FAILED" | "TRANSACTION_PREFLIGHT_FAILED" | "ROUTE_REBUILD_FAILED" | "HISTORY_COMMIT_FAILED" | "MATERIALIZATION_CONFLICT" | "MATERIALIZATION_REJECTED" | "MUTATION_ASSERTION_REQUIRED" | "MUTATION_ASSERTION_INVALID" | "AST_PARSE_ERROR" | "UNSUPPORTED_OPERATION" | "LOCATOR_FAILED" | "INVALID_TARGET" | "WRITE_IO_ERROR" | "CONCURRENT_MODIFIED" | "ROLLBACK_FAILED" | "RECOVERY_PERSIST_FAILED" | "MUTATION_SESSION_REQUIRED" | "LEASE_ASSERTION_INVALID" | "LEASE_ASSERTION_EXPIRED" | "LEASE_ASSERTION_SCOPE_MISMATCH" | "CROSS_PAGE_MOVE_UNSUPPORTED" | "INTERNAL_ERROR", unknown, never, Partial<{
436
- requestId: string;
437
- kind: "set-props" | "insert-child" | "update-text" | "update-array-item" | "remove-node" | "replace-node" | "move-node" | "set-class-name-source" | "set-link-target" | "apply-style-draft" | "source-edit" | "insert-page-resource" | "delete-page-source";
438
- composition: {
439
- routeId: string;
440
- effectiveTemplateId?: string | undefined;
441
- };
442
- target: {
443
- kind: "node";
444
- key: string;
445
- } | {
446
- kind: "page-unit";
447
- composition: {
448
- routeId: string;
449
- effectiveTemplateId?: string | undefined;
450
- };
451
- placementUnitKey: string;
452
- } | {
453
- kind: "route";
454
- composition: {
455
- routeId: string;
456
- effectiveTemplateId?: string | undefined;
457
- };
458
- } | {
459
- kind: "source-file";
460
- path: string;
461
- } | {
462
- kind: "source-batch";
463
- paths: string[];
464
- } | {
465
- kind: "project";
466
- };
467
- resultVersion: number;
468
- affectedFiles?: string[] | undefined;
469
- fileChanges?: {
470
- path: string;
471
- operation: "delete" | "upsert";
472
- }[] | undefined;
473
- selectionRef?: {
474
- key: string;
475
- instanceIndex?: number | undefined;
476
- instanceCount?: number | undefined;
477
- } | undefined;
478
- output?: {
479
- kind: "insert-page-resource";
480
- package_instance_id: string;
481
- pages: {
482
- template_page_id: string;
483
- title: string;
484
- final_route: string;
485
- route_file_path: string;
486
- }[];
487
- } | {
488
- kind: "delete-page-source";
489
- deleted_files: string[];
490
- updated_files: string[];
491
- preserved_shared_files: string[];
492
- warnings: string[];
493
- } | undefined;
494
- }>> | {
495
- ok: false;
496
- composition: {
497
- routeId: string;
498
- effectiveTemplateId?: string | undefined;
499
- };
500
- error: {
501
- details?: Record<string, unknown> | undefined;
502
- code: "VERSION_STALE" | "RECOVERY_REQUIRED" | "NODE_NOT_FOUND" | "HOME_PAGE_LOCKED" | "ROUTE_NOT_FOUND" | "CAPABILITY_REJECTED" | "CONSTRAINT_VIOLATED" | "INVALID_PARAMS" | "PLAN_FAILED" | "TRANSACTION_PREFLIGHT_FAILED" | "ROUTE_REBUILD_FAILED" | "HISTORY_COMMIT_FAILED" | "MATERIALIZATION_CONFLICT" | "MATERIALIZATION_REJECTED" | "MUTATION_ASSERTION_REQUIRED" | "MUTATION_ASSERTION_INVALID" | "AST_PARSE_ERROR" | "UNSUPPORTED_OPERATION" | "LOCATOR_FAILED" | "INVALID_TARGET" | "WRITE_IO_ERROR" | "CONCURRENT_MODIFIED" | "ROLLBACK_FAILED" | "RECOVERY_PERSIST_FAILED" | "MUTATION_SESSION_REQUIRED" | "LEASE_ASSERTION_INVALID" | "LEASE_ASSERTION_EXPIRED" | "LEASE_ASSERTION_SCOPE_MISMATCH" | "CROSS_PAGE_MOVE_UNSUPPORTED" | "INTERNAL_ERROR";
503
- message: string;
504
- };
505
- data: {
506
- affectedFiles?: string[] | undefined;
507
- requestId: string;
508
- kind: "set-props" | "insert-child" | "update-text" | "update-array-item" | "remove-node" | "replace-node" | "move-node" | "set-class-name-source" | "set-link-target" | "apply-style-draft" | "source-edit" | "insert-page-resource" | "delete-page-source";
509
- composition: {
510
- routeId: string;
511
- effectiveTemplateId?: string | undefined;
512
- };
513
- target: {
514
- kind: "node";
515
- key: string;
516
- } | {
517
- kind: "page-unit";
518
- composition: {
519
- routeId: string;
520
- templateId?: string | undefined;
521
- };
522
- placementUnitKey: string;
523
- } | {
524
- kind: "route";
525
- composition: {
526
- routeId: string;
527
- templateId?: string | undefined;
528
- };
529
- } | {
530
- kind: "source-file";
531
- path: string;
532
- } | {
533
- kind: "source-batch";
534
- paths: string[];
535
- } | {
536
- kind: "project";
537
- };
538
- resultVersion: number;
539
- };
540
- }>;
541
- undo(_mutationContext?: SiteEditMutationContext): Promise<{
542
- ok: false;
543
- composition: {
544
- routeId: string;
545
- effectiveTemplateId?: string | undefined;
546
- };
547
- error: {
548
- code: "VERSION_STALE" | "RECOVERY_REQUIRED" | "NODE_NOT_FOUND" | "HOME_PAGE_LOCKED" | "ROUTE_NOT_FOUND" | "CAPABILITY_REJECTED" | "CONSTRAINT_VIOLATED" | "INVALID_PARAMS" | "PLAN_FAILED" | "TRANSACTION_PREFLIGHT_FAILED" | "ROUTE_REBUILD_FAILED" | "HISTORY_COMMIT_FAILED" | "MATERIALIZATION_CONFLICT" | "MATERIALIZATION_REJECTED" | "MUTATION_ASSERTION_REQUIRED" | "MUTATION_ASSERTION_INVALID" | "AST_PARSE_ERROR" | "UNSUPPORTED_OPERATION" | "LOCATOR_FAILED" | "INVALID_TARGET" | "WRITE_IO_ERROR" | "CONCURRENT_MODIFIED" | "ROLLBACK_FAILED" | "RECOVERY_PERSIST_FAILED" | "MUTATION_SESSION_REQUIRED" | "LEASE_ASSERTION_INVALID" | "LEASE_ASSERTION_EXPIRED" | "LEASE_ASSERTION_SCOPE_MISMATCH" | "CROSS_PAGE_MOVE_UNSUPPORTED" | "INTERNAL_ERROR";
549
- message: string;
550
- };
551
- data: {
552
- requestId: string;
553
- kind: "set-props" | "insert-child" | "update-text" | "update-array-item" | "remove-node" | "replace-node" | "move-node" | "set-class-name-source" | "set-link-target" | "apply-style-draft" | "source-edit" | "insert-page-resource" | "delete-page-source";
554
- composition: {
555
- routeId: string;
556
- effectiveTemplateId?: string | undefined;
557
- };
558
- target: {
559
- kind: "node";
560
- key: string;
561
- } | {
562
- kind: "page-unit";
563
- composition: {
564
- routeId: string;
565
- templateId?: string | undefined;
566
- };
567
- placementUnitKey: string;
568
- } | {
569
- kind: "route";
570
- composition: {
571
- routeId: string;
572
- templateId?: string | undefined;
573
- };
574
- } | {
575
- kind: "source-file";
576
- path: string;
577
- } | {
578
- kind: "source-batch";
579
- paths: string[];
580
- } | {
581
- kind: "project";
582
- };
583
- resultVersion: number;
584
- };
585
- } | {
586
- ok: true;
587
- composition: {
588
- routeId: string;
589
- effectiveTemplateId?: string | undefined;
590
- };
591
- data: {
592
- requestId: string;
593
- kind: "set-props" | "insert-child" | "update-text" | "update-array-item" | "remove-node" | "replace-node" | "move-node" | "set-class-name-source" | "set-link-target" | "apply-style-draft" | "source-edit" | "insert-page-resource" | "delete-page-source";
594
- composition: {
595
- routeId: string;
596
- effectiveTemplateId?: string | undefined;
597
- };
598
- target: {
599
- kind: "node";
600
- key: string;
601
- } | {
602
- kind: "page-unit";
603
- composition: {
604
- routeId: string;
605
- effectiveTemplateId?: string | undefined;
606
- };
607
- placementUnitKey: string;
608
- } | {
609
- kind: "route";
610
- composition: {
611
- routeId: string;
612
- effectiveTemplateId?: string | undefined;
613
- };
614
- } | {
615
- kind: "source-file";
616
- path: string;
617
- } | {
618
- kind: "source-batch";
619
- paths: string[];
620
- } | {
621
- kind: "project";
622
- };
623
- resultVersion: number;
624
- affectedFiles?: string[] | undefined;
625
- fileChanges?: {
626
- path: string;
627
- operation: "delete" | "upsert";
628
- }[] | undefined;
629
- selectionRef?: {
630
- key: string;
631
- instanceIndex?: number | undefined;
632
- instanceCount?: number | undefined;
633
- } | undefined;
634
- output?: {
635
- kind: "insert-page-resource";
636
- package_instance_id: string;
637
- pages: {
638
- template_page_id: string;
639
- title: string;
640
- final_route: string;
641
- route_file_path: string;
642
- }[];
643
- } | {
644
- kind: "delete-page-source";
645
- deleted_files: string[];
646
- updated_files: string[];
647
- preserved_shared_files: string[];
648
- warnings: string[];
649
- } | undefined;
650
- };
651
- error?: undefined;
652
- }>;
653
- redo(_mutationContext?: SiteEditMutationContext): Promise<{
654
- ok: false;
655
- composition: {
656
- routeId: string;
657
- effectiveTemplateId?: string | undefined;
658
- };
659
- error: {
660
- code: "VERSION_STALE" | "RECOVERY_REQUIRED" | "NODE_NOT_FOUND" | "HOME_PAGE_LOCKED" | "ROUTE_NOT_FOUND" | "CAPABILITY_REJECTED" | "CONSTRAINT_VIOLATED" | "INVALID_PARAMS" | "PLAN_FAILED" | "TRANSACTION_PREFLIGHT_FAILED" | "ROUTE_REBUILD_FAILED" | "HISTORY_COMMIT_FAILED" | "MATERIALIZATION_CONFLICT" | "MATERIALIZATION_REJECTED" | "MUTATION_ASSERTION_REQUIRED" | "MUTATION_ASSERTION_INVALID" | "AST_PARSE_ERROR" | "UNSUPPORTED_OPERATION" | "LOCATOR_FAILED" | "INVALID_TARGET" | "WRITE_IO_ERROR" | "CONCURRENT_MODIFIED" | "ROLLBACK_FAILED" | "RECOVERY_PERSIST_FAILED" | "MUTATION_SESSION_REQUIRED" | "LEASE_ASSERTION_INVALID" | "LEASE_ASSERTION_EXPIRED" | "LEASE_ASSERTION_SCOPE_MISMATCH" | "CROSS_PAGE_MOVE_UNSUPPORTED" | "INTERNAL_ERROR";
661
- message: string;
662
- };
663
- data: {
664
- requestId: string;
665
- kind: "set-props" | "insert-child" | "update-text" | "update-array-item" | "remove-node" | "replace-node" | "move-node" | "set-class-name-source" | "set-link-target" | "apply-style-draft" | "source-edit" | "insert-page-resource" | "delete-page-source";
666
- composition: {
667
- routeId: string;
668
- effectiveTemplateId?: string | undefined;
669
- };
670
- target: {
671
- kind: "node";
672
- key: string;
673
- } | {
674
- kind: "page-unit";
675
- composition: {
676
- routeId: string;
677
- templateId?: string | undefined;
678
- };
679
- placementUnitKey: string;
680
- } | {
681
- kind: "route";
682
- composition: {
683
- routeId: string;
684
- templateId?: string | undefined;
685
- };
686
- } | {
687
- kind: "source-file";
688
- path: string;
689
- } | {
690
- kind: "source-batch";
691
- paths: string[];
692
- } | {
693
- kind: "project";
694
- };
695
- resultVersion: number;
696
- };
697
- } | {
698
- ok: true;
699
- composition: {
700
- routeId: string;
701
- effectiveTemplateId?: string | undefined;
702
- };
703
- data: {
704
- requestId: string;
705
- kind: "set-props" | "insert-child" | "update-text" | "update-array-item" | "remove-node" | "replace-node" | "move-node" | "set-class-name-source" | "set-link-target" | "apply-style-draft" | "source-edit" | "insert-page-resource" | "delete-page-source";
706
- composition: {
707
- routeId: string;
708
- effectiveTemplateId?: string | undefined;
709
- };
710
- target: {
711
- kind: "node";
712
- key: string;
713
- } | {
714
- kind: "page-unit";
715
- composition: {
716
- routeId: string;
717
- effectiveTemplateId?: string | undefined;
718
- };
719
- placementUnitKey: string;
720
- } | {
721
- kind: "route";
722
- composition: {
723
- routeId: string;
724
- effectiveTemplateId?: string | undefined;
725
- };
726
- } | {
727
- kind: "source-file";
728
- path: string;
729
- } | {
730
- kind: "source-batch";
731
- paths: string[];
732
- } | {
733
- kind: "project";
734
- };
735
- resultVersion: number;
736
- affectedFiles?: string[] | undefined;
737
- fileChanges?: {
738
- path: string;
739
- operation: "delete" | "upsert";
740
- }[] | undefined;
741
- selectionRef?: {
742
- key: string;
743
- instanceIndex?: number | undefined;
744
- instanceCount?: number | undefined;
745
- } | undefined;
746
- output?: {
747
- kind: "insert-page-resource";
748
- package_instance_id: string;
749
- pages: {
750
- template_page_id: string;
751
- title: string;
752
- final_route: string;
753
- route_file_path: string;
754
- }[];
755
- } | {
756
- kind: "delete-page-source";
757
- deleted_files: string[];
758
- updated_files: string[];
759
- preserved_shared_files: string[];
760
- warnings: string[];
761
- } | undefined;
762
- };
763
- error?: undefined;
764
- }>;
765
- notifyFileChanged(file: string): void;
766
- subscribe(listener: Parameters<PreviewSiteEditEngineRuntime["subscribe"]>[0]): () => void;
767
- dispose(): void;
768
- }
769
- export declare function createPreviewSiteEditEngineRuntime(options: PreviewSiteEditEngineRuntimeOptions): PreviewSiteEditEngineRuntime;