@inflatable-cookie/longhorn 0.1.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 (178) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +38 -0
  3. package/package.json +205 -0
  4. package/src/agent-control/index.ts +20 -0
  5. package/src/agent-control/inject.ts +4 -0
  6. package/src/agent-control/shim.ts +722 -0
  7. package/src/bridge/direct.ts +22 -0
  8. package/src/bridge/generated/fields.ts +32 -0
  9. package/src/bridge/generated/protocol.ts +218 -0
  10. package/src/bridge/generated/variant-fields.ts +10 -0
  11. package/src/bridge/index.ts +15 -0
  12. package/src/bridge/job.ts +51 -0
  13. package/src/bridge/loopback.ts +84 -0
  14. package/src/bridge/operation.ts +166 -0
  15. package/src/bridge/router.ts +71 -0
  16. package/src/bridge/runtime/connection.ts +318 -0
  17. package/src/bridge/runtime/policy.ts +89 -0
  18. package/src/bridge/runtime/retry.ts +60 -0
  19. package/src/bridge/runtime.ts +3 -0
  20. package/src/bridge/session.ts +67 -0
  21. package/src/bridge/stream/connection.ts +146 -0
  22. package/src/bridge/stream/source.ts +61 -0
  23. package/src/bridge/stream/tracker.ts +109 -0
  24. package/src/bridge/stream.ts +6 -0
  25. package/src/bridge/supervision.ts +204 -0
  26. package/src/bridge/validation/base.ts +164 -0
  27. package/src/bridge/validation/jobs.ts +105 -0
  28. package/src/bridge/validation/negotiation.ts +242 -0
  29. package/src/bridge/validation/operations.ts +213 -0
  30. package/src/bridge/validation/streams.ts +47 -0
  31. package/src/bridge/validation.ts +5 -0
  32. package/src/commands/client.ts +124 -0
  33. package/src/commands/controller.ts +411 -0
  34. package/src/commands/generated/fields.ts +43 -0
  35. package/src/commands/generated/protocol.ts +876 -0
  36. package/src/commands/generated/variant-fields.ts +88 -0
  37. package/src/commands/index.ts +13 -0
  38. package/src/commands/keyboard.ts +361 -0
  39. package/src/commands/ports.ts +82 -0
  40. package/src/commands/projectors.ts +306 -0
  41. package/src/commands/validation.ts +444 -0
  42. package/src/config/client.ts +215 -0
  43. package/src/config/generated/base.ts +714 -0
  44. package/src/config/generated/fields.ts +54 -0
  45. package/src/config/generated/label-template.ts +14 -0
  46. package/src/config/generated/labels.ts +30 -0
  47. package/src/config/generated/protocol.ts +3 -0
  48. package/src/config/generated/restore.ts +658 -0
  49. package/src/config/generated/variant-fields.ts +129 -0
  50. package/src/config/index.ts +12 -0
  51. package/src/config/names.ts +19 -0
  52. package/src/config/validation/commands.ts +155 -0
  53. package/src/config/validation/outcomes.ts +243 -0
  54. package/src/config/validation/primitives.ts +174 -0
  55. package/src/config/validation/projection.ts +351 -0
  56. package/src/config/validation.ts +7 -0
  57. package/src/core/connection.ts +252 -0
  58. package/src/core/index.ts +2 -0
  59. package/src/core/transport.ts +24 -0
  60. package/src/history/client.ts +65 -0
  61. package/src/history/controller.ts +385 -0
  62. package/src/history/direct.ts +21 -0
  63. package/src/history/generated/fields.ts +18 -0
  64. package/src/history/generated/protocol.ts +389 -0
  65. package/src/history/generated/variant-fields.ts +27 -0
  66. package/src/history/index.ts +13 -0
  67. package/src/history/ports.ts +31 -0
  68. package/src/history/serialized.ts +38 -0
  69. package/src/history/validation.ts +334 -0
  70. package/src/history-tree/client.ts +16 -0
  71. package/src/history-tree/controller.ts +199 -0
  72. package/src/history-tree/direct.ts +3 -0
  73. package/src/history-tree/generated/fields.ts +26 -0
  74. package/src/history-tree/generated/protocol.ts +711 -0
  75. package/src/history-tree/generated/variant-fields.ts +39 -0
  76. package/src/history-tree/index.ts +13 -0
  77. package/src/history-tree/ports.ts +43 -0
  78. package/src/history-tree/serialized.ts +15 -0
  79. package/src/history-tree/validation.ts +269 -0
  80. package/src/layout/generated/protocol.ts +289 -0
  81. package/src/layout/index.ts +4 -0
  82. package/src/layout/ratio.ts +22 -0
  83. package/src/layout/validation.ts +110 -0
  84. package/src/layout/visibility.ts +30 -0
  85. package/src/licence/client.ts +32 -0
  86. package/src/licence/controller.ts +301 -0
  87. package/src/licence/direct.ts +3 -0
  88. package/src/licence/generated/fields.ts +17 -0
  89. package/src/licence/generated/key-conformance.json +42 -0
  90. package/src/licence/generated/protocol.ts +249 -0
  91. package/src/licence/generated/variant-fields.ts +34 -0
  92. package/src/licence/index.ts +14 -0
  93. package/src/licence/key.ts +125 -0
  94. package/src/licence/ports.ts +39 -0
  95. package/src/licence/serialized.ts +13 -0
  96. package/src/licence/validation.ts +226 -0
  97. package/src/native-content/client.ts +474 -0
  98. package/src/native-content/direct.ts +16 -0
  99. package/src/native-content/generated/fields.ts +32 -0
  100. package/src/native-content/generated/protocol.ts +498 -0
  101. package/src/native-content/generated/variant-fields.ts +77 -0
  102. package/src/native-content/index.ts +12 -0
  103. package/src/native-content/ports.ts +46 -0
  104. package/src/native-content/serialized.ts +50 -0
  105. package/src/native-content/validation/base.ts +194 -0
  106. package/src/native-content/validation/messages.ts +192 -0
  107. package/src/native-content/validation/state.ts +404 -0
  108. package/src/native-content/validation.ts +7 -0
  109. package/src/notifications/client.ts +106 -0
  110. package/src/notifications/controller.ts +240 -0
  111. package/src/notifications/direct.ts +12 -0
  112. package/src/notifications/generated/fields.ts +19 -0
  113. package/src/notifications/generated/labels.ts +20 -0
  114. package/src/notifications/generated/protocol.ts +522 -0
  115. package/src/notifications/generated/variant-fields.ts +37 -0
  116. package/src/notifications/index.ts +16 -0
  117. package/src/notifications/ports.ts +22 -0
  118. package/src/notifications/serialized.ts +27 -0
  119. package/src/notifications/toast.ts +41 -0
  120. package/src/notifications/tone.ts +27 -0
  121. package/src/notifications/validation.ts +246 -0
  122. package/src/operation/bridge.ts +168 -0
  123. package/src/operation/client.ts +167 -0
  124. package/src/operation/controller.ts +321 -0
  125. package/src/operation/direct.ts +15 -0
  126. package/src/operation/generated/fields.ts +20 -0
  127. package/src/operation/generated/labels.ts +15 -0
  128. package/src/operation/generated/protocol.ts +762 -0
  129. package/src/operation/generated/variant-fields.ts +60 -0
  130. package/src/operation/index.ts +14 -0
  131. package/src/operation/ports.ts +29 -0
  132. package/src/operation/serialized.ts +39 -0
  133. package/src/operation/validation.ts +479 -0
  134. package/src/settings/client.ts +142 -0
  135. package/src/settings/connection.ts +246 -0
  136. package/src/settings/generated/fields.ts +34 -0
  137. package/src/settings/generated/protocol.ts +668 -0
  138. package/src/settings/generated/variant-fields.ts +26 -0
  139. package/src/settings/index.ts +12 -0
  140. package/src/settings/names.ts +8 -0
  141. package/src/settings/registry.ts +141 -0
  142. package/src/settings/validation/authority.ts +66 -0
  143. package/src/settings/validation/command.ts +165 -0
  144. package/src/settings/validation/error.ts +33 -0
  145. package/src/settings/validation/primitives.ts +203 -0
  146. package/src/settings/validation/projection.ts +50 -0
  147. package/src/settings/validation/registry.ts +170 -0
  148. package/src/settings/validation.ts +4 -0
  149. package/src/surface-transfer/client.ts +54 -0
  150. package/src/surface-transfer/generated/fields.ts +12 -0
  151. package/src/surface-transfer/generated/protocol.ts +61 -0
  152. package/src/surface-transfer/generated/variant-fields.ts +30 -0
  153. package/src/surface-transfer/index.ts +9 -0
  154. package/src/surface-transfer/validation.ts +209 -0
  155. package/src/surfaces/client.ts +140 -0
  156. package/src/surfaces/generated/fields.ts +19 -0
  157. package/src/surfaces/generated/protocol.ts +217 -0
  158. package/src/surfaces/generated/variant-fields.ts +42 -0
  159. package/src/surfaces/index.ts +9 -0
  160. package/src/surfaces/validation.ts +199 -0
  161. package/src/transfer/client.ts +133 -0
  162. package/src/transfer/connection.ts +87 -0
  163. package/src/transfer/generated/fields.ts +23 -0
  164. package/src/transfer/generated/protocol.ts +171 -0
  165. package/src/transfer/generated/variant-fields.ts +45 -0
  166. package/src/transfer/index.ts +11 -0
  167. package/src/transfer/payload.ts +71 -0
  168. package/src/transfer/validation.ts +282 -0
  169. package/src/update/client.ts +29 -0
  170. package/src/update/controller.ts +255 -0
  171. package/src/update/direct.ts +3 -0
  172. package/src/update/generated/fields.ts +14 -0
  173. package/src/update/generated/protocol.ts +238 -0
  174. package/src/update/generated/variant-fields.ts +44 -0
  175. package/src/update/index.ts +14 -0
  176. package/src/update/ports.ts +36 -0
  177. package/src/update/serialized.ts +12 -0
  178. package/src/update/validation.ts +191 -0
@@ -0,0 +1,39 @@
1
+ // @generated by `effigy generate:history-tree`; do not edit.
2
+ // Allowed field names per tagged-union variant, from the Rust enums.
3
+ // Keyed by type, then by discriminant. The discriminant itself is in
4
+ // each list, because `exact()` compares every key.
5
+
6
+ export const HISTORY_TREE_VARIANT_FIELDS: Record<string, Record<string, readonly string[]>> = {
7
+ "ForkPathFloorProjection": {
8
+ "origin": ["kind"],
9
+ "anchor": ["kind", "entryId"],
10
+ },
11
+ "ForkPathTargetProjection": {
12
+ "default": ["kind"],
13
+ "branch": ["kind", "branchId"],
14
+ "continuation": ["kind", "fromEntryId"],
15
+ },
16
+ "ForkPruneResult": {
17
+ "unchanged": ["status"],
18
+ "pruned": ["status", "receipt"],
19
+ },
20
+ "ForkNavigationTargetProjection": {
21
+ "undo": ["kind"],
22
+ "redo": ["kind"],
23
+ "checkout": ["kind", "branchId", "entryId"],
24
+ "checkoutBranchRoot": ["kind", "branchId"],
25
+ "checkoutContinuation": ["kind", "entryId"],
26
+ },
27
+ "ForkNavigationResult": {
28
+ "committed": ["status", "snapshot", "receipt"],
29
+ "rejected": ["status", "snapshot", "rejection"],
30
+ },
31
+ };
32
+
33
+ export const HISTORY_TREE_VARIANT_FIELDS_DISCRIMINANTS: Record<string, string> = {
34
+ "ForkPathFloorProjection": "kind",
35
+ "ForkPathTargetProjection": "kind",
36
+ "ForkPruneResult": "status",
37
+ "ForkNavigationTargetProjection": "kind",
38
+ "ForkNavigationResult": "status",
39
+ };
@@ -0,0 +1,13 @@
1
+ export * from "./generated/protocol.ts";
2
+ // The generated field map is public API. A consumer that mirrors these
3
+ // types structurally -- Poodle does, because it may not depend on Longhorn --
4
+ // has no compile-time link to them, so a field added here is silent on their
5
+ // side. Whoever sees both can assert their shape against this map and fail
6
+ // when it drifts.
7
+ export * from "./generated/fields.ts";
8
+ export * from "./validation.ts";
9
+ export * from "./ports.ts";
10
+ export * from "./client.ts";
11
+ export * from "./direct.ts";
12
+ export * from "./serialized.ts";
13
+ export * from "./controller.ts";
@@ -0,0 +1,43 @@
1
+ import type {
2
+ ForkBranchPageCommand,
3
+ ForkBranchPageSnapshot,
4
+ ForkChangedEvent,
5
+ ForkContinuationPageCommand,
6
+ ForkContinuationPageSnapshot,
7
+ ForkDeleteContinuationCommand,
8
+ ForkPruneCommand,
9
+ ForkPruneResult,
10
+ ForkNavigationCommand,
11
+ ForkNavigationResult,
12
+ ForkPathPageCommand,
13
+ ForkPathPageSnapshot,
14
+ ForkRemovalReceiptProjection,
15
+ ForkSnapshot,
16
+ HistoryPlanId,
17
+ } from "./generated/protocol.ts";
18
+
19
+ export type ForkHistoryUnlisten = () => void | Promise<void>;
20
+
21
+ export interface ForkHistoryPort {
22
+ snapshot(): Promise<unknown>;
23
+ path(command: ForkPathPageCommand): Promise<unknown>;
24
+ branches(command: ForkBranchPageCommand): Promise<unknown>;
25
+ continuations(command: ForkContinuationPageCommand): Promise<unknown>;
26
+ deleteContinuation(command: ForkDeleteContinuationCommand): Promise<unknown>;
27
+ prune(command: ForkPruneCommand): Promise<unknown>;
28
+ navigate(command: ForkNavigationCommand): Promise<unknown>;
29
+ listen?(listener: (event: unknown) => void): ForkHistoryUnlisten | Promise<ForkHistoryUnlisten>;
30
+ nextPlanId(): HistoryPlanId;
31
+ }
32
+
33
+ export interface CheckedForkHistoryPort {
34
+ snapshot(): Promise<ForkSnapshot>;
35
+ path(command: ForkPathPageCommand): Promise<ForkPathPageSnapshot>;
36
+ branches(command: ForkBranchPageCommand): Promise<ForkBranchPageSnapshot>;
37
+ continuations(command: ForkContinuationPageCommand): Promise<ForkContinuationPageSnapshot>;
38
+ deleteContinuation(command: ForkDeleteContinuationCommand): Promise<ForkRemovalReceiptProjection>;
39
+ prune(command: ForkPruneCommand): Promise<ForkPruneResult>;
40
+ navigate(command: ForkNavigationCommand): Promise<ForkNavigationResult>;
41
+ listen?(listener: (event: ForkChangedEvent) => void): Promise<ForkHistoryUnlisten>;
42
+ nextPlanId(): HistoryPlanId;
43
+ }
@@ -0,0 +1,15 @@
1
+ import type { ForkBranchPageCommand, ForkContinuationPageCommand, ForkDeleteContinuationCommand, ForkNavigationCommand, ForkPathPageCommand, ForkPruneCommand } from "./generated/protocol.ts";
2
+ import type { ForkHistoryPort, ForkHistoryUnlisten } from "./ports.ts";
3
+ export class SerializedForkHistoryPort implements ForkHistoryPort {
4
+ constructor(readonly inner: ForkHistoryPort) {}
5
+ async snapshot(): Promise<unknown> { return clone(await this.inner.snapshot()); }
6
+ async path(command: ForkPathPageCommand): Promise<unknown> { return clone(await this.inner.path(clone(command))); }
7
+ async branches(command: ForkBranchPageCommand): Promise<unknown> { return clone(await this.inner.branches(clone(command))); }
8
+ async continuations(command: ForkContinuationPageCommand): Promise<unknown> { return clone(await this.inner.continuations(clone(command))); }
9
+ async deleteContinuation(command: ForkDeleteContinuationCommand): Promise<unknown> { return clone(await this.inner.deleteContinuation(clone(command))); }
10
+ async prune(command: ForkPruneCommand): Promise<unknown> { return clone(await this.inner.prune(clone(command))); }
11
+ async navigate(command: ForkNavigationCommand): Promise<unknown> { return clone(await this.inner.navigate(clone(command))); }
12
+ async listen(listener: (event: unknown) => void): Promise<ForkHistoryUnlisten> { if (this.inner.listen === undefined) return () => {}; return this.inner.listen((event) => listener(clone(event))); }
13
+ nextPlanId(): string { return this.inner.nextPlanId(); }
14
+ }
15
+ function clone<T>(value: T): T { return JSON.parse(JSON.stringify(value)) as T; }
@@ -0,0 +1,269 @@
1
+ import { HISTORY_TREE_VARIANT_FIELDS, HISTORY_TREE_VARIANT_FIELDS_DISCRIMINANTS } from "./generated/variant-fields.ts";
2
+ import {
3
+ FORK_HISTORY_CHANGED_KINDS,
4
+ FORK_HISTORY_ENTRY_POSITIONS,
5
+ FORK_HISTORY_NAVIGATION_STATUSES,
6
+ FORK_HISTORY_NAVIGATION_TARGETS,
7
+ FORK_HISTORY_NAVIGATION_REJECTION_CODES,
8
+ FORK_HISTORY_PATH_FLOORS,
9
+ FORK_HISTORY_PATH_TARGETS,
10
+ FORK_HISTORY_PRUNE_STATUSES,
11
+ FORK_HISTORY_PROTOCOL_VERSION,
12
+ MAXIMUM_FORK_HISTORY_PAGE_SIZE,
13
+ type ForkBranchPageCommand,
14
+ type ForkBranchPageSnapshot,
15
+ type ForkContinuationPageCommand,
16
+ type ForkContinuationPageSnapshot,
17
+ type ForkDeleteContinuationCommand,
18
+ type ForkPruneCommand,
19
+ type ForkPruneResult,
20
+ type ForkRemovalReceiptProjection,
21
+ type ForkChangedEvent,
22
+ type ForkNavigationCommand,
23
+ type ForkNavigationResult,
24
+ type ForkPathPageCommand,
25
+ type ForkPathPageSnapshot,
26
+ type ForkSnapshot,
27
+ } from "./generated/protocol.ts";
28
+ import { HISTORY_TREE_FIELDS } from "./generated/fields.ts";
29
+
30
+ export class ForkHistoryValidationError extends Error {
31
+ constructor(readonly path: string, message: string) {
32
+ super(`${path}: ${message}`);
33
+ this.name = "ForkHistoryValidationError";
34
+ }
35
+ }
36
+
37
+ export function assertForkSnapshot(value: unknown): asserts value is ForkSnapshot {
38
+ noPayload(value);
39
+ const root = object(value, "$");
40
+ exact(root, "$", HISTORY_TREE_FIELDS.ForkSnapshot);
41
+ protocol(root.protocolVersion, "$.protocolVersion");
42
+ positive(root.authorityEpoch, "$.authorityEpoch");
43
+ const summary = object(root.summary, "$.summary");
44
+ exact(summary, "$.summary", HISTORY_TREE_FIELDS.ForkSummaryProjection);
45
+ id(summary.historyId, "$.summary.historyId");
46
+ integer(summary.revision, "$.summary.revision");
47
+ id(summary.currentBranchId, "$.summary.currentBranchId");
48
+ optionalId(summary.currentEntryId, "$.summary.currentEntryId");
49
+ for (const key of ["undoDepth", "redoDepth", "retainedEntryCount", "retainedEncodedWeight", "branchCount", "alternatePathCount"] as const) integer(summary[key], `$.summary.${key}`);
50
+ optionalString(summary.nextUndoLabel, "$.summary.nextUndoLabel");
51
+ optionalString(summary.nextRedoLabel, "$.summary.nextRedoLabel");
52
+ }
53
+
54
+ export function assertForkPathCommand(value: unknown): asserts value is ForkPathPageCommand {
55
+ commandBase(value, HISTORY_TREE_FIELDS.ForkPathPageCommand);
56
+ const target = object(object(value, "$").target, "$.target");
57
+ oneOf(target.kind, "$.target.kind", FORK_HISTORY_PATH_TARGETS);
58
+ exact(target, "$.target", variantFields("ForkPathTargetProjection", target, "$.target"));
59
+ if (target.kind === "branch") id(target.branchId, "$.target.branchId");
60
+ if (target.kind === "continuation") id(target.fromEntryId, "$.target.fromEntryId");
61
+ }
62
+
63
+ export function assertForkBranchCommand(value: unknown): asserts value is ForkBranchPageCommand {
64
+ commandBase(value, HISTORY_TREE_FIELDS.ForkBranchPageCommand);
65
+ }
66
+
67
+ export function assertForkPathPage(value: unknown): asserts value is ForkPathPageSnapshot {
68
+ noPayload(value);
69
+ const root = object(value, "$");
70
+ exact(root, "$", HISTORY_TREE_FIELDS.ForkPathPageSnapshot);
71
+ snapshotBase(root);
72
+ optionalId(root.branchId, "$.branchId");
73
+ optionalId(root.headEntryId, "$.headEntryId");
74
+ integer(root.precedingContinuationCount, "$.precedingContinuationCount");
75
+ // Card 191. The floor tells a renderer whether to draw an origin row; a
76
+ // nested run says `anchor` and means "draw nothing, it is already above".
77
+ const floor = object(root.floor, "$.floor");
78
+ oneOf(floor.kind, "$.floor.kind", FORK_HISTORY_PATH_FLOORS);
79
+ exact(floor, "$.floor", variantFields("ForkPathFloorProjection", floor, "$.floor"));
80
+ if (floor.kind === "anchor") id(floor.entryId, "$.floor.entryId");
81
+ integer(root.totalEntries, "$.totalEntries");
82
+ array(root.entries, "$.entries").forEach((entry, index) => entryRecord(entry, `$.entries[${index}]`));
83
+ boolean(root.truncatedBefore, "$.truncatedBefore");
84
+ boolean(root.truncatedAfter, "$.truncatedAfter");
85
+ }
86
+
87
+ export function assertForkBranchPage(value: unknown): asserts value is ForkBranchPageSnapshot {
88
+ noPayload(value);
89
+ const root = object(value, "$");
90
+ exact(root, "$", HISTORY_TREE_FIELDS.ForkBranchPageSnapshot);
91
+ snapshotBase(root);
92
+ integer(root.totalBranches, "$.totalBranches");
93
+ array(root.branches, "$.branches").forEach((value, index) => {
94
+ const branch = object(value, `$.branches[${index}]`);
95
+ exact(branch, `$.branches[${index}]`, HISTORY_TREE_FIELDS.ForkBranchRecord);
96
+ id(branch.branchId, `$.branches[${index}].branchId`);
97
+ optionalId(branch.headEntryId, `$.branches[${index}].headEntryId`);
98
+ optionalId(branch.divergenceEntryId, `$.branches[${index}].divergenceEntryId`);
99
+ optionalId(branch.divergenceBranchId, `$.branches[${index}].divergenceBranchId`);
100
+ optionalString(branch.name, `$.branches[${index}].name`);
101
+ optionalString(branch.annotation, `$.branches[${index}].annotation`);
102
+ boolean(branch.pinned, `$.branches[${index}].pinned`);
103
+ boolean(branch.current, `$.branches[${index}].current`);
104
+ });
105
+ boolean(root.truncatedBefore, "$.truncatedBefore");
106
+ boolean(root.truncatedAfter, "$.truncatedAfter");
107
+ }
108
+
109
+ export function assertForkNavigationCommand(value: unknown): asserts value is ForkNavigationCommand {
110
+ noPayload(value);
111
+ const root = object(value, "$");
112
+ exact(root, "$", HISTORY_TREE_FIELDS.ForkNavigationCommand);
113
+ protocol(root.protocolVersion, "$.protocolVersion"); positive(root.authorityEpoch, "$.authorityEpoch"); id(root.historyId, "$.historyId"); id(root.planId, "$.planId"); integer(root.expectedRevision, "$.expectedRevision");
114
+ const target = object(root.target, "$.target"); oneOf(target.kind, "$.target.kind", FORK_HISTORY_NAVIGATION_TARGETS);
115
+ exact(target, "$.target", variantFields("ForkNavigationTargetProjection", target, "$.target"));
116
+ if (target.kind === "checkout") { id(target.branchId, "$.target.branchId"); id(target.entryId, "$.target.entryId"); }
117
+ if (target.kind === "checkoutBranchRoot") id(target.branchId, "$.target.branchId");
118
+ if (target.kind === "checkoutContinuation") id(target.entryId, "$.target.entryId");
119
+ }
120
+
121
+ export function assertForkNavigationResult(value: unknown): asserts value is ForkNavigationResult {
122
+ noPayload(value);
123
+ const root = object(value, "$"); oneOf(root.status, "$.status", FORK_HISTORY_NAVIGATION_STATUSES);
124
+ exact(root, "$", root.status === "committed" ? ["status", "snapshot", "receipt"] : ["status", "snapshot", "rejection"]);
125
+ assertForkSnapshot(root.snapshot);
126
+ if (root.status === "committed") {
127
+ const receipt = object(root.receipt, "$.receipt");
128
+ exact(receipt, "$.receipt", HISTORY_TREE_FIELDS.ForkNavigationReceiptProjection);
129
+ id(receipt.historyId, "$.receipt.historyId"); id(receipt.planId, "$.receipt.planId"); integer(receipt.previousRevision, "$.receipt.previousRevision"); integer(receipt.committedRevision, "$.receipt.committedRevision"); optionalId(receipt.sourceEntryId, "$.receipt.sourceEntryId"); optionalId(receipt.targetEntryId, "$.receipt.targetEntryId"); id(receipt.targetBranchId, "$.receipt.targetBranchId"); array(receipt.movedEntryIds, "$.receipt.movedEntryIds").forEach((entry, index) => id(entry, `$.receipt.movedEntryIds[${index}]`));
130
+ } else {
131
+ const rejection = object(root.rejection, "$.rejection");
132
+ exact(rejection, "$.rejection", HISTORY_TREE_FIELDS.ForkNavigationRejectionProjection); oneOf(rejection.code, "$.rejection.code", FORK_HISTORY_NAVIGATION_REJECTION_CODES); string(rejection.detail, "$.rejection.detail"); boolean(rejection.refreshRequired, "$.rejection.refreshRequired");
133
+ }
134
+ }
135
+
136
+ export function assertForkChangedEvent(value: unknown): asserts value is ForkChangedEvent {
137
+ noPayload(value); const root = object(value, "$");
138
+ exact(root, "$", HISTORY_TREE_FIELDS.ForkChangedEvent);
139
+ protocol(root.protocolVersion, "$.protocolVersion"); positive(root.authorityEpoch, "$.authorityEpoch"); id(root.historyId, "$.historyId");
140
+ if (root.previousRevision !== null) integer(root.previousRevision, "$.previousRevision");
141
+ integer(root.committedRevision, "$.committedRevision"); oneOf(root.kind, "$.kind", FORK_HISTORY_CHANGED_KINDS);
142
+ }
143
+
144
+ function commandBase(value: unknown, allowed: readonly string[]): void { noPayload(value); const root = object(value, "$"); exact(root, "$", allowed); protocol(root.protocolVersion, "$.protocolVersion"); positive(root.authorityEpoch, "$.authorityEpoch"); id(root.historyId, "$.historyId"); integer(root.expectedRevision, "$.expectedRevision"); integer(root.offset, "$.offset"); positive(root.limit, "$.limit"); if ((root.limit as number) > MAXIMUM_FORK_HISTORY_PAGE_SIZE) fail("$.limit", `maximum is ${MAXIMUM_FORK_HISTORY_PAGE_SIZE}`); }
145
+ function snapshotBase(root: Record<string, unknown>): void { protocol(root.protocolVersion, "$.protocolVersion"); positive(root.authorityEpoch, "$.authorityEpoch"); id(root.historyId, "$.historyId"); integer(root.revision, "$.revision"); integer(root.offset, "$.offset"); }
146
+ function entryRecord(value: unknown, path: string): void { const root = object(value, path); exact(root, path, HISTORY_TREE_FIELDS.ForkEntryRecord); id(root.entryId, `${path}.entryId`); string(root.label, `${path}.label`); optionalId(root.kindId, `${path}.kindId`); optionalId(root.groupId, `${path}.groupId`); optionalInteger(root.recordedAt, `${path}.recordedAt`); integer(root.continuationCount, `${path}.continuationCount`); positive(root.sequence, `${path}.sequence`); integer(root.committedRevision, `${path}.committedRevision`); integer(root.encodedWeight, `${path}.encodedWeight`); oneOf(root.position, `${path}.position`, FORK_HISTORY_ENTRY_POSITIONS); }
147
+ function noPayload(value: unknown): void { const visit = (candidate: unknown, path: string): void => { if (Array.isArray(candidate)) return candidate.forEach((item, index) => visit(item, `${path}[${index}]`)); if (candidate !== null && typeof candidate === "object") for (const [key, child] of Object.entries(candidate)) { if (key.toLocaleLowerCase().includes("payload")) fail(`${path}.${key}`, "product payload field is forbidden"); visit(child, `${path}.${key}`); } }; visit(value, "$"); }
148
+ function object(value: unknown, path: string): Record<string, unknown> { if (value === null || typeof value !== "object" || Array.isArray(value)) fail(path, "expected object"); return value as Record<string, unknown>; }
149
+ function array(value: unknown, path: string): unknown[] { if (!Array.isArray(value)) fail(path, "expected array"); return value; }
150
+ function exact(value: Record<string, unknown>, path: string, expected: readonly string[]): void { const actual = Object.keys(value).sort(); const wanted = [...expected].sort(); if (actual.length !== wanted.length || actual.some((key, index) => key !== wanted[index])) fail(path, `unexpected keys: ${actual.join(",")}`); }
151
+ function protocol(value: unknown, path: string): void { if (value !== FORK_HISTORY_PROTOCOL_VERSION) fail(path, `expected exact protocol ${FORK_HISTORY_PROTOCOL_VERSION}`); }
152
+ function integer(value: unknown, path: string): void { if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 0) fail(path, "expected non-negative safe integer"); }
153
+ function positive(value: unknown, path: string): void { integer(value, path); if (value === 0) fail(path, "expected positive integer"); }
154
+ function string(value: unknown, path: string): void { if (typeof value !== "string") fail(path, "expected string"); }
155
+ function id(value: unknown, path: string): void { string(value, path); if ((value as string).length === 0) fail(path, "expected non-empty id"); }
156
+ function optionalId(value: unknown, path: string): void { if (value !== null) id(value, path); }
157
+ function optionalString(value: unknown, path: string): void { if (value !== null) string(value, path); }
158
+ function optionalInteger(value: unknown, path: string): void { if (value !== null) integer(value, path); }
159
+ function boolean(value: unknown, path: string): void { if (typeof value !== "boolean") fail(path, "expected boolean"); }
160
+ function oneOf(value: unknown, path: string, values: readonly string[]): void { if (typeof value !== "string" || !values.includes(value)) fail(path, "unsupported value"); }
161
+ function fail(path: string, message: string): never { throw new ForkHistoryValidationError(path, message); }
162
+
163
+ export function assertForkContinuationCommand(value: unknown): asserts value is ForkContinuationPageCommand {
164
+ commandBase(value, HISTORY_TREE_FIELDS.ForkContinuationPageCommand);
165
+ optionalId(object(value, "$").anchorEntryId, "$.anchorEntryId");
166
+ }
167
+
168
+ export function assertForkContinuationPage(value: unknown): asserts value is ForkContinuationPageSnapshot {
169
+ noPayload(value);
170
+ const root = object(value, "$");
171
+ exact(root, "$", HISTORY_TREE_FIELDS.ForkContinuationPageSnapshot);
172
+ snapshotBase(root);
173
+ optionalId(root.anchorEntryId, "$.anchorEntryId");
174
+ integer(root.totalContinuations, "$.totalContinuations");
175
+ array(root.continuations, "$.continuations").forEach((value, index) => {
176
+ const at = `$.continuations[${index}]`;
177
+ const continuation = object(value, at);
178
+ exact(continuation, at, HISTORY_TREE_FIELDS.ForkContinuationRecord);
179
+ id(continuation.entryId, `${at}.entryId`);
180
+ string(continuation.label, `${at}.label`);
181
+ optionalInteger(continuation.recordedAt, `${at}.recordedAt`);
182
+ boolean(continuation.preferred, `${at}.preferred`);
183
+ integer(continuation.entryCount, `${at}.entryCount`);
184
+ id(continuation.branchId, `${at}.branchId`);
185
+ optionalString(continuation.branchName, `${at}.branchName`);
186
+ });
187
+ boolean(root.truncatedBefore, "$.truncatedBefore");
188
+ boolean(root.truncatedAfter, "$.truncatedAfter");
189
+ }
190
+
191
+ /**
192
+ * Deletion is irreversible, so its command is validated on its own terms
193
+ * rather than through `commandBase`: it carries no page, and a validator that
194
+ * silently tolerated `offset` and `limit` would accept a caller who thought
195
+ * this was a paged read.
196
+ */
197
+ export function assertForkDeleteCommand(value: unknown): asserts value is ForkDeleteContinuationCommand {
198
+ noPayload(value);
199
+ const root = object(value, "$");
200
+ exact(root, "$", HISTORY_TREE_FIELDS.ForkDeleteContinuationCommand);
201
+ protocol(root.protocolVersion, "$.protocolVersion");
202
+ positive(root.authorityEpoch, "$.authorityEpoch");
203
+ id(root.historyId, "$.historyId");
204
+ integer(root.expectedRevision, "$.expectedRevision");
205
+ id(root.entryId, "$.entryId");
206
+ }
207
+
208
+ export function assertForkRemovalReceipt(value: unknown): asserts value is ForkRemovalReceiptProjection {
209
+ noPayload(value);
210
+ const root = object(value, "$");
211
+ exact(root, "$", HISTORY_TREE_FIELDS.ForkRemovalReceiptProjection);
212
+ protocol(root.protocolVersion, "$.protocolVersion");
213
+ positive(root.authorityEpoch, "$.authorityEpoch");
214
+ id(root.historyId, "$.historyId");
215
+ integer(root.previousRevision, "$.previousRevision");
216
+ integer(root.committedRevision, "$.committedRevision");
217
+ array(root.removedEntries, "$.removedEntries").forEach((value, index) => {
218
+ const at = `$.removedEntries[${index}]`;
219
+ const entry = object(value, at);
220
+ exact(entry, at, HISTORY_TREE_FIELDS.ForkRemovedEntryRecord);
221
+ id(entry.entryId, `${at}.entryId`);
222
+ positive(entry.sequence, `${at}.sequence`);
223
+ integer(entry.encodedWeight, `${at}.encodedWeight`);
224
+ });
225
+ array(root.removedBranches, "$.removedBranches").forEach((branch, index) => id(branch, `$.removedBranches[${index}]`));
226
+ array(root.removedCheckpoints, "$.removedCheckpoints").forEach((checkpoint, index) => id(checkpoint, `$.removedCheckpoints[${index}]`));
227
+ integer(root.retainedEntryCount, "$.retainedEntryCount");
228
+ integer(root.retainedEncodedWeight, "$.retainedEncodedWeight");
229
+ integer(root.unprotectedEntryCount, "$.unprotectedEntryCount");
230
+ integer(root.unprotectedEncodedWeight, "$.unprotectedEncodedWeight");
231
+ }
232
+
233
+ export function assertForkPruneCommand(value: unknown): asserts value is ForkPruneCommand {
234
+ noPayload(value);
235
+ const root = object(value, "$");
236
+ exact(root, "$", HISTORY_TREE_FIELDS.ForkPruneCommand);
237
+ protocol(root.protocolVersion, "$.protocolVersion");
238
+ positive(root.authorityEpoch, "$.authorityEpoch");
239
+ id(root.historyId, "$.historyId");
240
+ integer(root.expectedRevision, "$.expectedRevision");
241
+ // The budget bounds the unprotected share, and a zero budget is rejected by
242
+ // the authority rather than treated as "remove everything unprotected".
243
+ positive(root.maximumEntries, "$.maximumEntries");
244
+ positive(root.maximumEncodedWeight, "$.maximumEncodedWeight");
245
+ }
246
+
247
+ export function assertForkPruneResult(value: unknown): asserts value is ForkPruneResult {
248
+ noPayload(value);
249
+ const root = object(value, "$");
250
+ oneOf(root.status, "$.status", FORK_HISTORY_PRUNE_STATUSES);
251
+ exact(root, "$", variantFields("ForkPruneResult", root, "$"));
252
+ if (root.status === "pruned") assertForkRemovalReceipt(root.receipt);
253
+ }
254
+
255
+ /**
256
+ * Allowed keys for one variant, from the generated map.
257
+ *
258
+ * A missing entry means the generator failed to read the union, not that a
259
+ * consumer sent something odd — every caller runs `oneOf` over the
260
+ * discriminant first, so an unknown one is already rejected by then. Failing
261
+ * loudly beats defaulting to a key list, which is how `checkoutBranchRoot`
262
+ * shipped rejecting its own `branchId`.
263
+ */
264
+ function variantFields(type: string, object: Record<string, unknown>, path: string): readonly string[] {
265
+ const discriminant = object[HISTORY_TREE_VARIANT_FIELDS_DISCRIMINANTS[type] ?? "kind"];
266
+ const fields = HISTORY_TREE_VARIANT_FIELDS[type]?.[discriminant as string];
267
+ if (fields === undefined) fail(path, `no generated fields for ${type}.${String(discriminant)}`);
268
+ return fields;
269
+ }
@@ -0,0 +1,289 @@
1
+ // @generated by `effigy generate:layout`; do not edit.
2
+ // Rust serde types are the wire authority.
3
+
4
+ export const LAYOUT_PROTOCOL_VERSION = 1 as const;
5
+ export const LAYOUT_MUTATION_COMMAND_KINDS = ["create_panel","close_panel","activate_panel","reorder_region","move_panel","set_sizing_slot","set_region_collapsed"] as const;
6
+ export const LAYOUT_MUTATION_OUTCOME_KINDS = ["panel_created","panel_closed","panel_activated","region_reordered","panel_moved","sizing_slot_set","region_collapsed_set"] as const;
7
+ export const LAYOUT_MUTATION_REJECTION_CODES = ["invalid_current_document","stale_revision","revision_overflow","unknown_surface","unknown_region","unknown_sizing_slot","unknown_panel_definition","unknown_panel_instance","duplicate_panel_instance","panel_placement_not_allowed","instance_policy_exceeded","panel_not_closeable","panel_not_movable","move_target_unchanged","invalid_insertion_index","incomplete_reorder","duplicate_reorder_member","foreign_reorder_member","invalid_sizing_ratio","unsupported_collapse","invalid_candidate","request_id_conflict"] as const;
8
+
9
+ export type LayoutSchemaId = string;
10
+
11
+ export type SurfaceId = string;
12
+
13
+ export type RegionId = string;
14
+
15
+ export type RegionFamilyId = string;
16
+
17
+ export type SizingSlotId = string;
18
+
19
+ export type PanelDefinitionId = string;
20
+
21
+ export type PanelInstanceId = string;
22
+
23
+ export type LayoutRequestId = string;
24
+
25
+ export type SurfaceRevision = number;
26
+
27
+ export type LayoutRatio = number;
28
+
29
+ export type LayoutLimits = { maximum_schemas: number, maximum_regions_per_schema: number, maximum_sizing_slots_per_schema: number, maximum_panel_definitions: number, maximum_surfaces: number, maximum_panel_instances: number, maximum_panel_instances_per_region: number, };
30
+
31
+ export type EmptyRegionPolicy = "keep_visible" | "hide_when_empty";
32
+
33
+ export type RegionDefinition = { id: RegionId, family_id: RegionFamilyId, order: number, empty_policy: EmptyRegionPolicy, collapsible: boolean, };
34
+
35
+ export type SizingSlotDefinition = { id: SizingSlotId, order: number, minimum: LayoutRatio, default: LayoutRatio, maximum: LayoutRatio, };
36
+
37
+ export type LayoutSchemaDefinition = { id: LayoutSchemaId, regions: Array<RegionDefinition>, sizing_slots: Array<SizingSlotDefinition>, };
38
+
39
+ export type PlacementSelector = { "kind": "region", "id": RegionId } | { "kind": "family", "id": RegionFamilyId };
40
+
41
+ export type PanelInstancePolicy = { "kind": "singleton" } | { "kind": "one_per_container" } | { "kind": "bounded",
42
+ /**
43
+ * Maximum instances in the complete document.
44
+ */
45
+ maximum_per_document: number,
46
+ /**
47
+ * Maximum instances in one surface.
48
+ */
49
+ maximum_per_surface: number, } | { "kind": "multiple" };
50
+
51
+ export type PanelDefinition = { id: PanelDefinitionId, default_placements: Array<PlacementSelector>, allowed_placements: Array<PlacementSelector>, instance_policy: PanelInstancePolicy, movable: boolean, closeable: boolean, };
52
+
53
+ export type PanelInstance = { id: PanelInstanceId, definition_id: PanelDefinitionId, };
54
+
55
+ export type WindowId = string;
56
+
57
+ export type RegionState = { region_id: RegionId, panel_instance_ids: Array<PanelInstanceId>, active_panel_instance_id: PanelInstanceId | null, collapsed: boolean | null, };
58
+
59
+ export type SizingSlotState = { sizing_slot_id: SizingSlotId, ratio: LayoutRatio, };
60
+
61
+ export type SurfaceHostPreference = { window_id: WindowId, order: number, };
62
+
63
+ export type SurfacePresentation = { "kind": "regional" } | { "kind": "focused_panel",
64
+ /**
65
+ * The panel rendered for the whole Surface.
66
+ */
67
+ panel_definition_id: PanelDefinitionId, };
68
+
69
+ export type SurfaceRecord = { id: SurfaceId, schema_id: LayoutSchemaId, label: string | null, presentation: SurfacePresentation, regions: Array<RegionState>, sizing_slots: Array<SizingSlotState>, host_preferences: Array<SurfaceHostPreference>, };
70
+
71
+ export type ParticipatingWindow = { id: WindowId, active_surface_id: SurfaceId | null, };
72
+
73
+ export type SurfaceDocument = { revision: SurfaceRevision, surfaces: Array<SurfaceRecord>, panel_instances: Array<PanelInstance>, windows: Array<ParticipatingWindow>, };
74
+
75
+ export type RegionVisibilityState = "visible" | "hidden" | "transiently_revealed";
76
+
77
+ export type RegionVisibility = { region_id: RegionId, state: RegionVisibilityState, };
78
+
79
+ export type LayoutMutationCommand = { "kind": "create_panel",
80
+ /**
81
+ * New durable panel-instance identity.
82
+ */
83
+ panel_instance_id: PanelInstanceId,
84
+ /**
85
+ * Registered panel-definition identity.
86
+ */
87
+ panel_definition_id: PanelDefinitionId,
88
+ /**
89
+ * Target layout surface.
90
+ */
91
+ surface_id: SurfaceId,
92
+ /**
93
+ * Target semantic region.
94
+ */
95
+ region_id: RegionId,
96
+ /**
97
+ * Zero-based insertion index, including append at current length.
98
+ */
99
+ insertion_index: number, } | { "kind": "close_panel",
100
+ /**
101
+ * Existing durable panel-instance identity.
102
+ */
103
+ panel_instance_id: PanelInstanceId, } | { "kind": "activate_panel",
104
+ /**
105
+ * Existing durable panel-instance identity.
106
+ */
107
+ panel_instance_id: PanelInstanceId, } | { "kind": "reorder_region",
108
+ /**
109
+ * Target layout surface.
110
+ */
111
+ surface_id: SurfaceId,
112
+ /**
113
+ * Target semantic region.
114
+ */
115
+ region_id: RegionId,
116
+ /**
117
+ * Complete ordered permutation of current region members.
118
+ */
119
+ panel_instance_ids: Array<PanelInstanceId>, } | { "kind": "move_panel",
120
+ /**
121
+ * Existing durable panel-instance identity.
122
+ */
123
+ panel_instance_id: PanelInstanceId,
124
+ /**
125
+ * Target layout surface.
126
+ */
127
+ target_surface_id: SurfaceId,
128
+ /**
129
+ * Target semantic region.
130
+ */
131
+ target_region_id: RegionId,
132
+ /**
133
+ * Zero-based insertion index in the target before insertion.
134
+ */
135
+ insertion_index: number, } | { "kind": "set_sizing_slot",
136
+ /**
137
+ * Target layout surface.
138
+ */
139
+ surface_id: SurfaceId,
140
+ /**
141
+ * Target sizing slot.
142
+ */
143
+ sizing_slot_id: SizingSlotId,
144
+ /**
145
+ * New bounded integer-millionth ratio.
146
+ */
147
+ ratio: LayoutRatio, } | { "kind": "set_region_collapsed",
148
+ /**
149
+ * Target layout surface.
150
+ */
151
+ surface_id: SurfaceId,
152
+ /**
153
+ * Target semantic region.
154
+ */
155
+ region_id: RegionId,
156
+ /**
157
+ * New collapse state.
158
+ */
159
+ collapsed: boolean, };
160
+
161
+ export type LayoutMutationRequest = { request_id: LayoutRequestId, expected_revision: SurfaceRevision, command: LayoutMutationCommand, };
162
+
163
+ export type LayoutMutationOutcome = { "kind": "panel_created",
164
+ /**
165
+ * Created panel instance.
166
+ */
167
+ panel_instance_id: PanelInstanceId,
168
+ /**
169
+ * Committed surface.
170
+ */
171
+ surface_id: SurfaceId,
172
+ /**
173
+ * Committed region.
174
+ */
175
+ region_id: RegionId,
176
+ /**
177
+ * Committed insertion index.
178
+ */
179
+ insertion_index: number, } | { "kind": "panel_closed",
180
+ /**
181
+ * Closed panel instance.
182
+ */
183
+ panel_instance_id: PanelInstanceId,
184
+ /**
185
+ * Former surface.
186
+ */
187
+ surface_id: SurfaceId,
188
+ /**
189
+ * Former region.
190
+ */
191
+ region_id: RegionId,
192
+ /**
193
+ * Former zero-based index.
194
+ */
195
+ former_index: number, } | { "kind": "panel_activated",
196
+ /**
197
+ * Activated panel instance.
198
+ */
199
+ panel_instance_id: PanelInstanceId,
200
+ /**
201
+ * Containing layout surface.
202
+ */
203
+ surface_id: SurfaceId,
204
+ /**
205
+ * Containing semantic region.
206
+ */
207
+ region_id: RegionId,
208
+ /**
209
+ * Previous active member, when present.
210
+ */
211
+ previous_active_panel_instance_id: PanelInstanceId | null, } | { "kind": "region_reordered",
212
+ /**
213
+ * Reordered layout surface.
214
+ */
215
+ surface_id: SurfaceId,
216
+ /**
217
+ * Reordered semantic region.
218
+ */
219
+ region_id: RegionId,
220
+ /**
221
+ * Complete committed order.
222
+ */
223
+ panel_instance_ids: Array<PanelInstanceId>, } | { "kind": "panel_moved",
224
+ /**
225
+ * Moved panel instance.
226
+ */
227
+ panel_instance_id: PanelInstanceId,
228
+ /**
229
+ * Former surface.
230
+ */
231
+ source_surface_id: SurfaceId,
232
+ /**
233
+ * Former region.
234
+ */
235
+ source_region_id: RegionId,
236
+ /**
237
+ * Former zero-based index.
238
+ */
239
+ former_index: number,
240
+ /**
241
+ * Committed target surface.
242
+ */
243
+ target_surface_id: SurfaceId,
244
+ /**
245
+ * Committed target region.
246
+ */
247
+ target_region_id: RegionId,
248
+ /**
249
+ * Committed target insertion index.
250
+ */
251
+ insertion_index: number, } | { "kind": "sizing_slot_set",
252
+ /**
253
+ * Mutated layout surface.
254
+ */
255
+ surface_id: SurfaceId,
256
+ /**
257
+ * Mutated sizing slot.
258
+ */
259
+ sizing_slot_id: SizingSlotId,
260
+ /**
261
+ * Previous ratio.
262
+ */
263
+ previous_ratio: LayoutRatio,
264
+ /**
265
+ * Committed ratio.
266
+ */
267
+ committed_ratio: LayoutRatio, } | { "kind": "region_collapsed_set",
268
+ /**
269
+ * Mutated layout surface.
270
+ */
271
+ surface_id: SurfaceId,
272
+ /**
273
+ * Mutated semantic region.
274
+ */
275
+ region_id: RegionId,
276
+ /**
277
+ * Previous supported collapse state.
278
+ */
279
+ previous_collapsed: boolean,
280
+ /**
281
+ * Committed collapse state.
282
+ */
283
+ committed_collapsed: boolean, };
284
+
285
+ export type LayoutMutationReceipt = { request_id: LayoutRequestId, previous_revision: SurfaceRevision, committed_revision: SurfaceRevision, outcome: LayoutMutationOutcome, authoritative_document: SurfaceDocument, };
286
+
287
+ export type LayoutMutationRejectionCode = "invalid_current_document" | "stale_revision" | "revision_overflow" | "unknown_surface" | "unknown_region" | "unknown_sizing_slot" | "unknown_panel_definition" | "unknown_panel_instance" | "duplicate_panel_instance" | "panel_placement_not_allowed" | "instance_policy_exceeded" | "panel_not_closeable" | "panel_not_movable" | "move_target_unchanged" | "invalid_insertion_index" | "incomplete_reorder" | "duplicate_reorder_member" | "foreign_reorder_member" | "invalid_sizing_ratio" | "unsupported_collapse" | "invalid_candidate" | "request_id_conflict";
288
+
289
+ export type LayoutMutationRejection = { request_id: LayoutRequestId, current_revision: SurfaceRevision, code: LayoutMutationRejectionCode, detail: string, authoritative_document: SurfaceDocument, };