@brass-build/client 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/AGENTS.md +72 -63
  2. package/CHANGELOG.md +86 -0
  3. package/README.md +317 -231
  4. package/dist/auth-flow.d.ts +10 -1
  5. package/dist/auth-flow.d.ts.map +1 -1
  6. package/dist/auth-flow.js +64 -20
  7. package/dist/auth-flow.js.map +1 -1
  8. package/dist/client.d.ts +3 -0
  9. package/dist/client.d.ts.map +1 -1
  10. package/dist/client.js +217 -75
  11. package/dist/client.js.map +1 -1
  12. package/dist/document-engine.d.ts +4 -0
  13. package/dist/document-engine.d.ts.map +1 -0
  14. package/dist/document-engine.js +9 -0
  15. package/dist/document-engine.js.map +1 -0
  16. package/dist/document-streams.d.ts +8 -1
  17. package/dist/document-streams.d.ts.map +1 -1
  18. package/dist/document-streams.js +79 -8
  19. package/dist/document-streams.js.map +1 -1
  20. package/dist/documents-namespace.d.ts.map +1 -1
  21. package/dist/documents-namespace.js +19 -3
  22. package/dist/documents-namespace.js.map +1 -1
  23. package/dist/documents.d.ts +43 -14
  24. package/dist/documents.d.ts.map +1 -1
  25. package/dist/documents.js +871 -223
  26. package/dist/documents.js.map +1 -1
  27. package/dist/embed-protocol.d.ts +3 -0
  28. package/dist/embed-protocol.d.ts.map +1 -0
  29. package/dist/embed-protocol.js +26 -0
  30. package/dist/embed-protocol.js.map +1 -0
  31. package/dist/emitter.d.ts.map +1 -1
  32. package/dist/emitter.js +8 -1
  33. package/dist/emitter.js.map +1 -1
  34. package/dist/export-guest.d.ts.map +1 -1
  35. package/dist/export-guest.js +14 -6
  36. package/dist/export-guest.js.map +1 -1
  37. package/dist/fetch-deadline.d.ts +22 -0
  38. package/dist/fetch-deadline.d.ts.map +1 -0
  39. package/dist/fetch-deadline.js +96 -0
  40. package/dist/fetch-deadline.js.map +1 -0
  41. package/dist/fetch-retry.d.ts +1 -0
  42. package/dist/fetch-retry.d.ts.map +1 -1
  43. package/dist/fetch-retry.js +12 -5
  44. package/dist/fetch-retry.js.map +1 -1
  45. package/dist/handle-types.d.ts +150 -0
  46. package/dist/handle-types.d.ts.map +1 -0
  47. package/dist/handle-types.js +8 -0
  48. package/dist/handle-types.js.map +1 -0
  49. package/dist/handles.d.ts +48 -48
  50. package/dist/handles.d.ts.map +1 -1
  51. package/dist/handles.js +3122 -501
  52. package/dist/handles.js.map +1 -1
  53. package/dist/hosted-runtime.d.ts.map +1 -1
  54. package/dist/hosted-runtime.js +8 -12
  55. package/dist/hosted-runtime.js.map +1 -1
  56. package/dist/hosted-ui.d.ts +0 -1
  57. package/dist/hosted-ui.d.ts.map +1 -1
  58. package/dist/hosted-ui.js +29 -24
  59. package/dist/hosted-ui.js.map +1 -1
  60. package/dist/importer.d.ts.map +1 -1
  61. package/dist/importer.js +253 -8
  62. package/dist/importer.js.map +1 -1
  63. package/dist/index.d.ts +10 -10
  64. package/dist/index.d.ts.map +1 -1
  65. package/dist/index.js +11 -2
  66. package/dist/index.js.map +1 -1
  67. package/dist/internal.d.ts +1 -1
  68. package/dist/internal.d.ts.map +1 -1
  69. package/dist/internal.js.map +1 -1
  70. package/dist/join-coverage.d.ts +12 -0
  71. package/dist/join-coverage.d.ts.map +1 -0
  72. package/dist/join-coverage.js +37 -0
  73. package/dist/join-coverage.js.map +1 -0
  74. package/dist/jwt.d.ts.map +1 -1
  75. package/dist/jwt.js +5 -1
  76. package/dist/jwt.js.map +1 -1
  77. package/dist/launch-context.js +2 -2
  78. package/dist/launch-context.js.map +1 -1
  79. package/dist/mutate-batching.d.ts +25 -2
  80. package/dist/mutate-batching.d.ts.map +1 -1
  81. package/dist/mutate-batching.js +57 -10
  82. package/dist/mutate-batching.js.map +1 -1
  83. package/dist/open-document.d.ts +15 -1
  84. package/dist/open-document.d.ts.map +1 -1
  85. package/dist/open-document.js +1851 -321
  86. package/dist/open-document.js.map +1 -1
  87. package/dist/presence.d.ts +28 -0
  88. package/dist/presence.d.ts.map +1 -1
  89. package/dist/presence.js +149 -7
  90. package/dist/presence.js.map +1 -1
  91. package/dist/record-paging.d.ts +336 -71
  92. package/dist/record-paging.d.ts.map +1 -1
  93. package/dist/record-paging.js +591 -127
  94. package/dist/record-paging.js.map +1 -1
  95. package/dist/selection-persistence.d.ts.map +1 -1
  96. package/dist/selection-persistence.js +11 -1
  97. package/dist/selection-persistence.js.map +1 -1
  98. package/dist/serializer.d.ts +30 -1
  99. package/dist/serializer.d.ts.map +1 -1
  100. package/dist/session-persistence.d.ts.map +1 -1
  101. package/dist/session-persistence.js +9 -8
  102. package/dist/session-persistence.js.map +1 -1
  103. package/dist/session-toolbar.d.ts +0 -1
  104. package/dist/session-toolbar.d.ts.map +1 -1
  105. package/dist/session-toolbar.js +226 -75
  106. package/dist/session-toolbar.js.map +1 -1
  107. package/dist/session.d.ts.map +1 -1
  108. package/dist/session.js +87 -18
  109. package/dist/session.js.map +1 -1
  110. package/dist/tail-ops.d.ts +14 -4
  111. package/dist/tail-ops.d.ts.map +1 -1
  112. package/dist/tail-ops.js +75 -15
  113. package/dist/tail-ops.js.map +1 -1
  114. package/dist/topic-lifecycle.d.ts +4 -0
  115. package/dist/topic-lifecycle.d.ts.map +1 -1
  116. package/dist/topic-lifecycle.js +25 -1
  117. package/dist/topic-lifecycle.js.map +1 -1
  118. package/dist/types.d.ts +47 -1
  119. package/dist/types.d.ts.map +1 -1
  120. package/dist/undo.d.ts +2 -3
  121. package/dist/undo.d.ts.map +1 -1
  122. package/dist/undo.js +11 -0
  123. package/dist/undo.js.map +1 -1
  124. package/dist/unload-guard.d.ts +5 -0
  125. package/dist/unload-guard.d.ts.map +1 -0
  126. package/dist/unload-guard.js +88 -0
  127. package/dist/unload-guard.js.map +1 -0
  128. package/dist/version-bar.d.ts +4 -3
  129. package/dist/version-bar.d.ts.map +1 -1
  130. package/dist/version-bar.js +140 -19
  131. package/dist/version-bar.js.map +1 -1
  132. package/dist/version.d.ts +2 -2
  133. package/dist/version.js +1 -1
  134. package/dist/vite.d.ts +18 -2
  135. package/dist/vite.d.ts.map +1 -1
  136. package/dist/vite.js +133 -8
  137. package/dist/vite.js.map +1 -1
  138. package/dist/ws-client.d.ts +23 -3
  139. package/dist/ws-client.d.ts.map +1 -1
  140. package/dist/ws-client.js +339 -89
  141. package/dist/ws-client.js.map +1 -1
  142. package/dist/ws-frame-limit.d.ts.map +1 -1
  143. package/dist/ws-frame-limit.js +19 -12
  144. package/dist/ws-frame-limit.js.map +1 -1
  145. package/docs/app-manifest.md +7 -8
  146. package/docs/custom-chrome.md +17 -20
  147. package/docs/hosted-ui-advanced.md +14 -17
  148. package/docs/imported-documents.md +53 -197
  149. package/docs/presence.md +45 -21
  150. package/docs/schemas.md +12 -17
  151. package/docs/streams.md +55 -57
  152. package/package.json +4 -3
  153. package/src/auth-flow.ts +90 -23
  154. package/src/client.ts +225 -78
  155. package/src/document-engine.ts +15 -0
  156. package/src/document-signals.ts +7 -7
  157. package/src/document-streams.ts +95 -9
  158. package/src/documents-namespace.ts +18 -3
  159. package/src/documents.ts +983 -277
  160. package/src/embed-protocol.ts +25 -0
  161. package/src/emitter.ts +8 -1
  162. package/src/export-guest.ts +15 -9
  163. package/src/fetch-deadline.ts +119 -0
  164. package/src/fetch-retry.ts +14 -5
  165. package/src/handle-types.ts +303 -0
  166. package/src/handles.ts +3406 -683
  167. package/src/hosted-runtime.ts +8 -12
  168. package/src/hosted-ui.ts +28 -32
  169. package/src/importer.ts +261 -8
  170. package/src/index.ts +29 -18
  171. package/src/internal.ts +1 -0
  172. package/src/join-coverage.ts +42 -0
  173. package/src/jwt.ts +8 -1
  174. package/src/launch-context.ts +2 -2
  175. package/src/mutate-batching.ts +60 -11
  176. package/src/open-document.ts +2355 -515
  177. package/src/presence.ts +210 -11
  178. package/src/record-paging.ts +687 -137
  179. package/src/selection-persistence.ts +10 -1
  180. package/src/serializer.ts +33 -1
  181. package/src/session-persistence.ts +9 -8
  182. package/src/session-toolbar.ts +249 -80
  183. package/src/session.ts +91 -17
  184. package/src/tail-ops.ts +76 -10
  185. package/src/topic-lifecycle.ts +31 -1
  186. package/src/types.ts +56 -4
  187. package/src/undo.ts +13 -5
  188. package/src/unload-guard.ts +91 -0
  189. package/src/version-bar.ts +163 -25
  190. package/src/version.ts +1 -1
  191. package/src/vite.ts +175 -10
  192. package/src/ws-client.ts +392 -92
  193. package/src/ws-frame-limit.ts +19 -12
@@ -14,11 +14,13 @@
14
14
  //
15
15
  // - A GET is idempotent, so replaying it is always safe: retry the whole
16
16
  // transient 5xx / 429 set AND a thrown network error (`RETRY_READ`).
17
- // - A write is NOT idempotent, so only a 503 is safe to replay: the API
18
- // gateway returns a 503 BEFORE the request reaches the handler (a transient
19
- // throttle / scale-up / deploy-window blip), so the write never ran and
20
- // a replay cannot double-apply it. A 502 / 504 / 429 or a network throw
21
- // might mean the handler ran, so those stay hard failures (`RETRY_WRITE_503`).
17
+ // - A write is NOT idempotent, so only a 503 is safe to replay, and only on
18
+ // a route where a 503 means the write did not land: the gateway's own 503
19
+ // (a transient throttle / scale-up / deploy-window blip) is returned before
20
+ // the request reaches the handler, and a handler that answers 503 does so
21
+ // for a write it refused rather than applied. A 502 / 504 / 429 or a network
22
+ // throw might mean the handler ran, so those stay hard failures
23
+ // (`RETRY_WRITE_503`).
22
24
  // - A 500 is never retried under either policy: an unhandled server error
23
25
  // is usually deterministic, so a replay just doubles the cost without
24
26
  // changing the outcome.
@@ -54,9 +56,11 @@ const defaultSleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
54
56
  export async function fetchWithRetry(doFetch, options = {}) {
55
57
  const policy = options.policy ?? RETRY_READ;
56
58
  const maxAttempts = options.maxAttempts ?? 3;
59
+ const maxNetworkAttempts = options.maxNetworkAttempts ?? maxAttempts;
57
60
  const baseDelayMs = options.baseDelayMs ?? 300;
58
61
  const sleep = options.sleep ?? defaultSleep;
59
62
  let lastError;
63
+ let networkThrows = 0;
60
64
  for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {
61
65
  let response;
62
66
  try {
@@ -68,6 +72,9 @@ export async function fetchWithRetry(doFetch, options = {}) {
68
72
  if (!policy.replayNetworkErrors)
69
73
  throw err;
70
74
  lastError = err;
75
+ networkThrows += 1;
76
+ if (networkThrows >= maxNetworkAttempts)
77
+ throw err;
71
78
  }
72
79
  if (response && !policy.replayStatuses.has(response.status)) {
73
80
  return response;
@@ -1 +1 @@
1
- {"version":3,"file":"fetch-retry.js","sourceRoot":"","sources":["../src/fetch-retry.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,4EAA4E;AAC5E,wEAAwE;AACxE,EAAE;AACF,wEAAwE;AACxE,yEAAyE;AACzE,uEAAuE;AACvE,wEAAwE;AACxE,uEAAuE;AACvE,uCAAuC;AACvC,EAAE;AACF,uEAAuE;AACvE,iEAAiE;AACjE,EAAE;AACF,yEAAyE;AACzE,uEAAuE;AACvE,wEAAwE;AACxE,8EAA8E;AAC9E,0EAA0E;AAC1E,0EAA0E;AAC1E,iFAAiF;AACjF,0EAA0E;AAC1E,wEAAwE;AACxE,0BAA0B;AAC1B,2EAA2E;AAC3E,yCAAyC;AAWzC,oEAAoE;AACpE,MAAM,CAAC,MAAM,UAAU,GAAgB;IACrC,cAAc,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAC7C,mBAAmB,EAAE,IAAI;CAC1B,CAAC;AAEF,8EAA8E;AAC9E,MAAM,CAAC,MAAM,eAAe,GAAgB;IAC1C,cAAc,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IAC9B,mBAAmB,EAAE,KAAK;CAC3B,CAAC;AAEF,+EAA+E;AAC/E,+EAA+E;AAC/E,yEAAyE;AACzE,+EAA+E;AAC/E,8EAA8E;AAC9E,yEAAyE;AACzE,MAAM,CAAC,MAAM,sBAAsB,GAAgB;IACjD,cAAc,EAAE,IAAI,GAAG,CAAC,CAAC,GA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OAAO,GAAG,EAAE,CAAC;YACb,sEAAsE;YACtE,8DAA8D;YAC9D,IAAI,CAAC,MAAM,CAAC,mBAAmB;gBAAE,MAAM,GAAG,CAAC;YAC3C,SAAS,GAAG,GAAG,CAAC;YAChB,aAAa,IAAI,CAAC,CAAC;YACnB,IAAI,aAAa,IAAI,kBAAkB;gBAAE,MAAM,GAAG,CAAC;QACrD,CAAC;QACD,IAAI,QAAQ,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YAC5D,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,IAAI,OAAO,KAAK,WAAW,EAAE,CAAC;YAC5B,IAAI,QAAQ;gBAAE,OAAO,QAAQ,CAAC;YAC9B,MAAM,SAAS,CAAC;QAClB,CAAC;QACD,OAAO,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACrC,iEAAiE;QACjE,4DAA4D;QAC5D,MAAM,OAAO,GAAG,WAAW,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC;QACjD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,WAAW,CAAC;QAC3C,MAAM,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC;IAChC,CAAC;IACD,gEAAgE;IAChE,MAAM,SAAS,IAAI,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;AACnE,CAAC"}
@@ -0,0 +1,150 @@
1
+ export interface Change<T = unknown> {
2
+ readonly set: ReadonlyMap<string, T>;
3
+ readonly deleted: readonly string[];
4
+ readonly order?: readonly string[];
5
+ }
6
+ export type ChangeSource = 'local' | 'remote' | 'undo' | 'redo';
7
+ export interface ChangeOrigin {
8
+ readonly source: ChangeSource;
9
+ }
10
+ export type MapSubscriber<T = unknown> = (change: Change<T>, origin?: ChangeOrigin) => void;
11
+ export type InternalMapSubscriber<T> = (change: Change<T>, origin: ChangeOrigin | undefined, resync: boolean) => void;
12
+ /**
13
+ * One positional edit, applied in the order the change carries them.
14
+ *
15
+ * `at` indexes the sequence as the preceding splices in the same change left
16
+ * it, so applying them in order to what you already hold leaves you current.
17
+ * That is the whole contract: a subscriber never has to ask what the list
18
+ * holds, because every fire says how to get from its last state to this one.
19
+ */
20
+ export interface Splice<E> {
21
+ readonly at: number;
22
+ readonly removed: number;
23
+ readonly inserted: readonly E[];
24
+ }
25
+ /**
26
+ * What changed in a list. Fires once on registration carrying the whole list
27
+ * as a single splice, then on every change carrying only what moved.
28
+ *
29
+ * A registration fire and a resync are not special cases a subscriber has to
30
+ * recognise: both arrive as splices that replace what it was last told, so
31
+ * one apply loop is the entire subscriber.
32
+ */
33
+ export interface ListChange<T> {
34
+ readonly splices: readonly Splice<T>[];
35
+ }
36
+ export type ListSubscriber<T = unknown> = (change: ListChange<T>) => void;
37
+ export type InternalListSubscriber = (change: ListChange<unknown>, origin?: ChangeOrigin) => void;
38
+ export type HandleUnsubscribe = () => void;
39
+ export interface HandleOwner {
40
+ assertWritable(): void;
41
+ assertReadable(): void;
42
+ ensureLocalUpdatesSubscribed(): void;
43
+ commitMutate(): void;
44
+ originOf(event: unknown): ChangeSource;
45
+ }
46
+ export interface MapHandle<T = unknown> {
47
+ get(entryKey: string): T | undefined;
48
+ keys(): string[];
49
+ has(entryKey: string): boolean;
50
+ mutate(fn: (draft: Record<string, T>) => void): void;
51
+ subscribe(cb: MapSubscriber<T>): HandleUnsubscribe;
52
+ /**
53
+ * Report each time this container has been delivered whole: on
54
+ * registration, and again after a version checkout, a return to head or a
55
+ * hydrate replaces it.
56
+ *
57
+ * This is where the work that follows on the collection belongs rather than
58
+ * on any single change: frame the camera on what arrived, run the first pass
59
+ * over it. It repeats because that work is owed again each time the
60
+ * container is replaced.
61
+ *
62
+ * It reports that this peer holds what it had converged to when the delivery
63
+ * began, which is the only claim available: more always arrives afterwards.
64
+ */
65
+ onSettled(cb: () => void): HandleUnsubscribe;
66
+ map<U>(entryKey: string): MapHandle<U>;
67
+ list<U>(entryKey: string): ListHandle<U>;
68
+ }
69
+ /**
70
+ * The array a list `mutate` hands its callback: an ordinary `T[]` plus
71
+ * `move`.
72
+ *
73
+ * `move` is here because a plain array has no way to say "this entry is now
74
+ * at that position", and the difference matters once two people edit at once.
75
+ * Spelled as a removal and an insertion, a reposition merges with another
76
+ * peer's reposition of the SAME entry by keeping BOTH insertions, so the entry
77
+ * ends up in the list twice and a reader has to guess which position was
78
+ * meant. `move` states the reposition, and the two merge to one entry.
79
+ */
80
+ export interface ListDraft<T> extends Array<T> {
81
+ /** Reposition the entry at `from` so it sits at `to`. Indices are clamped
82
+ * to the list, and a `from` outside it does nothing. */
83
+ move(from: number, to: number): void;
84
+ }
85
+ export interface ListHandle<T = unknown> {
86
+ length(): number;
87
+ mutate(fn: (draft: ListDraft<T>) => void): void;
88
+ subscribe(cb: ListSubscriber<T>): HandleUnsubscribe;
89
+ /**
90
+ * Report each time this container has been delivered whole: on
91
+ * registration, and again after a version checkout, a return to head or a
92
+ * hydrate replaces it.
93
+ *
94
+ * This is where the work that follows on the collection belongs rather than
95
+ * on any single change: frame the camera on what arrived, run the first pass
96
+ * over it. It repeats because that work is owed again each time the
97
+ * container is replaced.
98
+ *
99
+ * It reports that this peer holds what it had converged to when the delivery
100
+ * began, which is the only claim available: more always arrives afterwards.
101
+ */
102
+ onSettled(cb: () => void): HandleUnsubscribe;
103
+ }
104
+ /**
105
+ * Where an ordered map puts a key.
106
+ *
107
+ * The two anchor forms name a neighbouring key, which is what a reader's
108
+ * gesture actually means (insert after the paragraph the caret is in, drop
109
+ * this step on that one) and what survives a peer editing the collection
110
+ * between the render and the write. `index` counts positions in `keys()`, for
111
+ * a surface that works in indices; anything at or past the end appends, and a
112
+ * negative index goes to the front.
113
+ *
114
+ * An anchor key the order list does not name puts the key at the end.
115
+ */
116
+ export type OrderedMapPosition = {
117
+ before: string;
118
+ } | {
119
+ after: string;
120
+ } | {
121
+ index: number;
122
+ };
123
+ export interface OrderedMapHandle<T = unknown> {
124
+ get(entryKey: string): T | undefined;
125
+ has(entryKey: string): boolean;
126
+ keys(): string[];
127
+ ordered(): {
128
+ key: string;
129
+ value: T;
130
+ }[];
131
+ mutate(fn: (draft: Record<string, T>) => void): void;
132
+ insert(entryKey: string, value: T, at: OrderedMapPosition): void;
133
+ move(entryKey: string, to: OrderedMapPosition): void;
134
+ subscribe(cb: MapSubscriber<T>): HandleUnsubscribe;
135
+ /**
136
+ * Report each time this container has been delivered whole: on
137
+ * registration, and again after a version checkout, a return to head or a
138
+ * hydrate replaces it.
139
+ *
140
+ * This is where the work that follows on the collection belongs rather than
141
+ * on any single change: frame the camera on what arrived, run the first pass
142
+ * over it. It repeats because that work is owed again each time the
143
+ * container is replaced.
144
+ *
145
+ * It reports that this peer holds what it had converged to when the delivery
146
+ * began, which is the only claim available: more always arrives afterwards.
147
+ */
148
+ onSettled(cb: () => void): HandleUnsubscribe;
149
+ }
150
+ //# sourceMappingURL=handle-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handle-types.d.ts","sourceRoot":"","sources":["../src/handle-types.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,MAAM,CAAC,CAAC,GAAG,OAAO;IAUjC,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAErC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAKpC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAcD,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAChE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;CAC/B;AAQD,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,OAAO,IAAI,CACvC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EACjB,MAAM,CAA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AC,GAAG,OAAO;IAE3C,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC;IAErC,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAE/B,IAAI,IAAI,MAAM,EAAE,CAAC;IAGjB,OAAO,IAAI;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,CAAC,CAAA;KAAE,EAAE,CAAC;IAKvC,MAAM,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI,CAAC;IAIrD,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAIjE,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,kBAAkB,GAAG,IAAI,CAAC;IASrD,SAAS,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC;IACnD;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,iBAAiB,CAAC;CAC9C"}
@@ -0,0 +1,8 @@
1
+ // The handle surface's public types, kept apart from the `handles.ts` code
2
+ // that implements them against Loro. Every type the package entry re-exports
3
+ // pulls its declaring module into a consumer's typecheck graph, so declaring
4
+ // them here is what makes the public surface engine-neutral all the way down
5
+ // rather than only in the signatures an app calls.
6
+ // `public-types-engine-free.test.ts` holds that line.
7
+ export {};
8
+ //# sourceMappingURL=handle-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handle-types.js","sourceRoot":"","sources":["../src/handle-types.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,6EAA6E;AAC7E,6EAA6E;AAC7E,6EAA6E;AAC7E,mDAAmD;AACnD,sDAAsD"}
package/dist/handles.d.ts CHANGED
@@ -1,56 +1,56 @@
1
- import { LoroList, LoroMap } from 'loro-crdt';
1
+ import { LoroMovableList, LoroMap } from 'loro-crdt';
2
2
  import { MutateBatcher } from './mutate-batching.js';
3
- export interface Change<T = unknown> {
4
- readonly set: ReadonlyMap<string, T>;
5
- readonly deleted: readonly string[];
6
- readonly order?: readonly string[];
7
- }
8
- export type ChangeSource = 'local' | 'remote' | 'undo' | 'redo' | 'checkout';
9
- export interface ChangeOrigin {
10
- readonly source: ChangeSource;
11
- }
12
- export type MapSubscriber<T = unknown> = (change: Change<T>, origin?: ChangeOrigin) => void;
13
- export type ListSubscriber = () => void;
14
- export type HandleUnsubscribe = () => void;
15
- export interface HandleOwner {
16
- assertWritable(): void;
17
- ensureLocalUpdatesSubscribed(): void;
18
- commitMutate(): void;
19
- originOf(event: unknown): ChangeSource;
20
- }
21
- export interface MapHandle<T = unknown> {
22
- read(): Record<string, T>;
23
- get(entryKey: string): T | undefined;
3
+ import type { Change, ChangeOrigin, ChangeSource, HandleOwner, HandleUnsubscribe, ListDraft, ListHandle, ListSubscriber, MapHandle, MapSubscriber, OrderedMapHandle, OrderedMapPosition } from './handle-types.js';
4
+ export type { Change, ChangeOrigin, ChangeSource, HandleOwner, ListDraft, HandleUnsubscribe, ListHandle, ListSubscriber, MapHandle, MapSubscriber, OrderedMapHandle, OrderedMapPosition, };
5
+ /**
6
+ * Where a root map's ADDITIONS go once the map has paged itself part-way
7
+ * through a mutation.
8
+ *
9
+ * A mutation large enough to need paging usually starts against a map that
10
+ * is not yet paged, so the decision cannot be made once at the top. The
11
+ * proxy consults this on every assignment; while it declines, the mutation
12
+ * runs exactly as an unpaged one does.
13
+ */
14
+ interface WriteDivert {
15
+ take(key: string, value: unknown): boolean;
16
+ holds(key: string): boolean;
17
+ peek(key: string): unknown;
18
+ drop(key: string): void;
24
19
  keys(): string[];
25
- has(entryKey: string): boolean;
26
- mutate(fn: (draft: Record<string, T>) => void): void;
27
- subscribe(cb: MapSubscriber<T>): HandleUnsubscribe;
28
- map<U>(entryKey: string): MapHandle<U>;
29
- list<U>(entryKey: string): ListHandle<U>;
30
20
  }
31
- export interface ListHandle<T = unknown> {
32
- read(): T[];
33
- length(): number;
34
- mutate(fn: (draft: T[]) => void): void;
35
- subscribe(cb: ListSubscriber): HandleUnsubscribe;
36
- }
37
- export interface OrderedMapHandle<T = unknown> {
38
- read(): Record<string, T>;
39
- get(entryKey: string): T | undefined;
40
- has(entryKey: string): boolean;
41
- keys(): string[];
42
- ordered(): {
43
- key: string;
44
- value: T;
45
- }[];
46
- mutate(fn: (draft: Record<string, T>) => void): void;
47
- subscribe(cb: MapSubscriber<T>): HandleUnsubscribe;
21
+ export declare function wrapLoroMapProxy(loroMap: LoroMap, batcher?: MutateBatcher, divert?: WriteDivert, guardKeys?: boolean): Record<string, unknown>;
22
+ /**
23
+ * What a ROOT map handle needs from its owning Document to present a paged
24
+ * store. Bundled rather than passed one by one: every member is read off the
25
+ * ACTIVE source's `meta` at call time (a version checkout swaps the source),
26
+ * and a handle that can never be a paged root is given none of them.
27
+ */
28
+ /**
29
+ * The document's version, as the freshness stamp a cached index checks.
30
+ *
31
+ * Loro's frontiers, which advance on every op whatever produced it: a local
32
+ * write, a remote import, an undo, a version checkout. A cached index cannot
33
+ * key on the map's SIZE instead, because a remote change and a local undo can
34
+ * leave the size they found it at while changing which keys are there, and the
35
+ * index then answers from keys the map no longer holds. Reading it costs about
36
+ * 2 us and does not close the open transaction, so a mutation still commits as
37
+ * one change.
38
+ */
39
+ export type StateVersion = readonly {
40
+ peer: string;
41
+ counter: number;
42
+ }[];
43
+ export interface PagedRootHooks {
44
+ isPaged(): boolean;
45
+ page(): void;
46
+ sessionToken(): string;
47
+ stateVersion(): StateVersion;
48
48
  }
49
- export declare function wrapLoroMapProxy(loroMap: LoroMap, batcher?: MutateBatcher): Record<string, unknown>;
50
- export declare function createRootMapHandle<T>(root: LoroMap, owner: HandleOwner, pageCount?: () => number, pagingScheme?: () => number): MapHandle<T>;
51
- export declare function createRootListHandle<T>(root: LoroList, owner: HandleOwner): ListHandle<T>;
49
+ export declare function createRootMapHandle<T>(root: LoroMap, owner: HandleOwner, paging?: PagedRootHooks): MapHandle<T>;
50
+ export declare function createRootListHandle<T>(root: LoroMovableList, owner: HandleOwner): ListHandle<T>;
52
51
  export declare function rebindRootMapAnchor(handle: MapHandle<unknown>, next: LoroMap): void;
53
- export declare function rebindRootListAnchor(handle: ListHandle<unknown>, next: LoroList): void;
52
+ export declare function rebindRootListAnchor(handle: ListHandle<unknown>, next: LoroMovableList): void;
53
+ export declare function snapshotRootMapKeys(handle: MapHandle<unknown>): void;
54
54
  export declare function resyncRootHandle(handle: MapHandle<unknown> | ListHandle<unknown>): void;
55
55
  export declare function teardownRootHandle(handle: MapHandle<unknown> | ListHandle<unknown>): void;
56
56
  export declare function createOrderedMapHandle<T>(map: MapHandle<T>, order: ListHandle<string>, owner: HandleOwner): OrderedMapHandle<T>;
@@ -1 +1 @@
1
- {"version":3,"file":"handles.d.ts","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,QAAQ,EACR,OAAO,EAGR,MAAM,WAAW,CAAC;AAcnB,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAOrD,MAAM,WAAW,MAAM,CAAC,CAAC,GAAG,OAAO;IAKjC,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAErC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAKpC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAOD,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC;AAC7E,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;CAC/B;AAOD,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,OAAO,IAAI,CACvC,MAAM,EAAE,MAAM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