@hydranium/protocol 1.0.0-next.19 → 1.0.0-next.192

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 (205) hide show
  1. package/README.md +35 -1
  2. package/lib/abstract-logger.d.ts.map +1 -1
  3. package/lib/abstract-logger.js.map +1 -1
  4. package/lib/client/data-connection.d.ts +157 -0
  5. package/lib/client/data-connection.d.ts.map +1 -0
  6. package/lib/client/data-connection.js +236 -0
  7. package/lib/client/data-connection.js.map +1 -0
  8. package/lib/client/data-events.d.ts +13 -1
  9. package/lib/client/data-events.d.ts.map +1 -1
  10. package/lib/client/data-events.js +21 -0
  11. package/lib/client/data-events.js.map +1 -1
  12. package/lib/client/data-port.d.ts +24 -22
  13. package/lib/client/data-port.d.ts.map +1 -1
  14. package/lib/client/data-session.d.ts +461 -81
  15. package/lib/client/data-session.d.ts.map +1 -1
  16. package/lib/client/data-session.js +725 -108
  17. package/lib/client/data-session.js.map +1 -1
  18. package/lib/client/index.d.ts +14 -9
  19. package/lib/client/index.d.ts.map +1 -1
  20. package/lib/client/index.js +14 -9
  21. package/lib/client/index.js.map +1 -1
  22. package/lib/client/message-relay.d.ts +9 -3
  23. package/lib/client/message-relay.d.ts.map +1 -1
  24. package/lib/client/message-relay.js +11 -5
  25. package/lib/client/message-relay.js.map +1 -1
  26. package/lib/client/post-message-transport.d.ts +64 -3
  27. package/lib/client/post-message-transport.d.ts.map +1 -1
  28. package/lib/client/post-message-transport.js +175 -1
  29. package/lib/client/post-message-transport.js.map +1 -1
  30. package/lib/client/rpc-connection.d.ts +149 -0
  31. package/lib/client/rpc-connection.d.ts.map +1 -0
  32. package/lib/client/rpc-connection.js +202 -0
  33. package/lib/client/rpc-connection.js.map +1 -0
  34. package/lib/client-ids.d.ts +45 -0
  35. package/lib/client-ids.d.ts.map +1 -0
  36. package/lib/client-ids.js +48 -0
  37. package/lib/client-ids.js.map +1 -0
  38. package/lib/clock.d.ts +38 -0
  39. package/lib/clock.d.ts.map +1 -1
  40. package/lib/clock.js +36 -1
  41. package/lib/clock.js.map +1 -1
  42. package/lib/data/data-protocol-methods.d.ts +4 -4
  43. package/lib/data/data-protocol-methods.d.ts.map +1 -1
  44. package/lib/data/data-protocol-methods.js +11 -1
  45. package/lib/data/data-protocol-methods.js.map +1 -1
  46. package/lib/data/data-server-protocol.d.ts +117 -36
  47. package/lib/data/data-server-protocol.d.ts.map +1 -1
  48. package/lib/data/events.d.ts +110 -15
  49. package/lib/data/events.d.ts.map +1 -1
  50. package/lib/data/requests.d.ts +67 -11
  51. package/lib/data/requests.d.ts.map +1 -1
  52. package/lib/debouncer.d.ts.map +1 -1
  53. package/lib/debouncer.js.map +1 -1
  54. package/lib/errors.d.ts +181 -29
  55. package/lib/errors.d.ts.map +1 -1
  56. package/lib/errors.js +261 -29
  57. package/lib/errors.js.map +1 -1
  58. package/lib/glsp-save-model-actions.d.ts +50 -0
  59. package/lib/glsp-save-model-actions.d.ts.map +1 -0
  60. package/lib/glsp-save-model-actions.js +28 -0
  61. package/lib/glsp-save-model-actions.js.map +1 -0
  62. package/lib/index.d.ts +4 -0
  63. package/lib/index.d.ts.map +1 -1
  64. package/lib/index.js +7 -0
  65. package/lib/index.js.map +1 -1
  66. package/lib/latency-collector.d.ts +8 -4
  67. package/lib/latency-collector.d.ts.map +1 -1
  68. package/lib/latency-collector.js.map +1 -1
  69. package/lib/logger.d.ts +22 -1
  70. package/lib/logger.d.ts.map +1 -1
  71. package/lib/logger.js +31 -3
  72. package/lib/logger.js.map +1 -1
  73. package/lib/messages/index.d.ts +29 -0
  74. package/lib/messages/index.d.ts.map +1 -0
  75. package/lib/messages/index.js +59 -0
  76. package/lib/messages/index.js.map +1 -0
  77. package/lib/messages/primitives.d.ts +188 -0
  78. package/lib/messages/primitives.d.ts.map +1 -0
  79. package/lib/messages/primitives.js +161 -0
  80. package/lib/messages/primitives.js.map +1 -0
  81. package/lib/model-server.d.ts +60 -13
  82. package/lib/model-server.d.ts.map +1 -1
  83. package/lib/model-server.js +4 -2
  84. package/lib/model-server.js.map +1 -1
  85. package/lib/model-service/base-version.d.ts +64 -0
  86. package/lib/model-service/base-version.d.ts.map +1 -0
  87. package/lib/model-service/base-version.js +43 -0
  88. package/lib/model-service/base-version.js.map +1 -0
  89. package/lib/model-service/index.d.ts +1 -1
  90. package/lib/model-service/index.d.ts.map +1 -1
  91. package/lib/model-service/index.js +4 -5
  92. package/lib/model-service/index.js.map +1 -1
  93. package/lib/model-service/reference-candidate.d.ts +5 -3
  94. package/lib/model-service/reference-candidate.d.ts.map +1 -1
  95. package/lib/noop-logger.d.ts.map +1 -1
  96. package/lib/noop-logger.js.map +1 -1
  97. package/lib/observable-value.js.map +1 -1
  98. package/lib/patch-merge.d.ts +35 -32
  99. package/lib/patch-merge.d.ts.map +1 -1
  100. package/lib/patch-merge.js +67 -23
  101. package/lib/patch-merge.js.map +1 -1
  102. package/lib/profile-session.d.ts +8 -4
  103. package/lib/profile-session.d.ts.map +1 -1
  104. package/lib/profile-session.js.map +1 -1
  105. package/lib/reconcile-write.d.ts +65 -0
  106. package/lib/reconcile-write.d.ts.map +1 -0
  107. package/lib/reconcile-write.js +67 -0
  108. package/lib/reconcile-write.js.map +1 -0
  109. package/lib/rpc/bind-rpc-methods.d.ts +29 -3
  110. package/lib/rpc/bind-rpc-methods.d.ts.map +1 -1
  111. package/lib/rpc/bind-rpc-methods.js +22 -3
  112. package/lib/rpc/bind-rpc-methods.js.map +1 -1
  113. package/lib/rpc/create-rpc-proxy.d.ts +10 -0
  114. package/lib/rpc/create-rpc-proxy.d.ts.map +1 -1
  115. package/lib/rpc/create-rpc-proxy.js +12 -2
  116. package/lib/rpc/create-rpc-proxy.js.map +1 -1
  117. package/lib/rpc/wire-prefix.js.map +1 -1
  118. package/lib/testing/catalogue-audit.d.ts +80 -0
  119. package/lib/testing/catalogue-audit.d.ts.map +1 -0
  120. package/lib/testing/catalogue-audit.js +94 -0
  121. package/lib/testing/catalogue-audit.js.map +1 -0
  122. package/lib/testing/data-doubles.d.ts +13 -12
  123. package/lib/testing/data-doubles.d.ts.map +1 -1
  124. package/lib/testing/data-doubles.js +19 -5
  125. package/lib/testing/data-doubles.js.map +1 -1
  126. package/lib/testing/fake-clock.d.ts +9 -1
  127. package/lib/testing/fake-clock.d.ts.map +1 -1
  128. package/lib/testing/fake-clock.js +54 -45
  129. package/lib/testing/fake-clock.js.map +1 -1
  130. package/lib/testing/index.d.ts +1 -0
  131. package/lib/testing/index.d.ts.map +1 -1
  132. package/lib/testing/index.js +5 -2
  133. package/lib/testing/index.js.map +1 -1
  134. package/lib/testing/node/duplex-connection.js.map +1 -1
  135. package/lib/testing/node/duplex-stream.js.map +1 -1
  136. package/lib/testing/node/index.d.ts +1 -0
  137. package/lib/testing/node/index.d.ts.map +1 -1
  138. package/lib/testing/node/index.js +2 -2
  139. package/lib/testing/node/index.js.map +1 -1
  140. package/lib/testing/node/message-port-pair.d.ts +25 -0
  141. package/lib/testing/node/message-port-pair.d.ts.map +1 -0
  142. package/lib/testing/node/message-port-pair.js +26 -0
  143. package/lib/testing/node/message-port-pair.js.map +1 -0
  144. package/lib/testing/wait-for.js.map +1 -1
  145. package/lib/tracer.d.ts.map +1 -1
  146. package/lib/tracer.js.map +1 -1
  147. package/lib/transfer-diagnostic.d.ts +33 -0
  148. package/lib/transfer-diagnostic.d.ts.map +1 -1
  149. package/lib/transfer-diagnostic.js +23 -0
  150. package/lib/transfer-diagnostic.js.map +1 -1
  151. package/lib/transfer-document.d.ts +59 -32
  152. package/lib/transfer-document.d.ts.map +1 -1
  153. package/lib/transfer-document.js +17 -9
  154. package/lib/transfer-document.js.map +1 -1
  155. package/lib/uri.d.ts.map +1 -1
  156. package/lib/uri.js.map +1 -1
  157. package/lib/util.d.ts +8 -0
  158. package/lib/util.d.ts.map +1 -1
  159. package/lib/util.js +32 -0
  160. package/lib/util.js.map +1 -1
  161. package/package.json +27 -18
  162. package/src/client/data-connection.ts +314 -0
  163. package/src/client/data-events.ts +33 -1
  164. package/src/client/data-port.ts +25 -23
  165. package/src/client/data-session.ts +922 -126
  166. package/src/client/index.ts +14 -9
  167. package/src/client/message-relay.ts +29 -7
  168. package/src/client/post-message-transport.ts +219 -4
  169. package/src/client/rpc-connection.ts +268 -0
  170. package/src/client-ids.ts +49 -0
  171. package/src/clock.ts +56 -0
  172. package/src/data/data-protocol-methods.ts +12 -4
  173. package/src/data/data-server-protocol.ts +140 -36
  174. package/src/data/events.ts +116 -15
  175. package/src/data/requests.ts +71 -11
  176. package/src/errors.ts +311 -36
  177. package/src/glsp-save-model-actions.ts +59 -0
  178. package/src/index.ts +7 -0
  179. package/src/latency-collector.ts +8 -3
  180. package/src/logger.ts +28 -2
  181. package/src/messages/index.ts +36 -0
  182. package/src/messages/primitives.ts +271 -0
  183. package/src/model-server.ts +63 -18
  184. package/src/model-service/base-version.ts +72 -0
  185. package/src/model-service/index.ts +4 -5
  186. package/src/model-service/reference-candidate.ts +5 -3
  187. package/src/patch-merge.ts +97 -42
  188. package/src/profile-session.ts +9 -4
  189. package/src/reconcile-write.ts +124 -0
  190. package/src/rpc/bind-rpc-methods.ts +49 -4
  191. package/src/rpc/create-rpc-proxy.ts +20 -2
  192. package/src/testing/catalogue-audit.ts +111 -0
  193. package/src/testing/data-doubles.ts +42 -17
  194. package/src/testing/fake-clock.ts +62 -47
  195. package/src/testing/index.ts +5 -2
  196. package/src/testing/node/index.ts +2 -2
  197. package/src/testing/node/message-port-pair.ts +40 -0
  198. package/src/transfer-diagnostic.ts +40 -0
  199. package/src/transfer-document.ts +74 -34
  200. package/src/util.ts +33 -0
  201. package/lib/model-service/args.d.ts +0 -64
  202. package/lib/model-service/args.d.ts.map +0 -1
  203. package/lib/model-service/args.js +0 -11
  204. package/lib/model-service/args.js.map +0 -1
  205. package/src/model-service/args.ts +0 -67
@@ -11,6 +11,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
11
11
  exports.DATA_CLIENT_PROTOCOL_METHODS = exports.PROJECT_CLIENT_PROTOCOL_METHODS = exports.DOCUMENT_CLIENT_PROTOCOL_METHODS = exports.REFERENCE_SERVER_PROTOCOL_METHODS = exports.DATA_SERVER_PROTOCOL_METHODS = exports.PROJECT_SERVER_PROTOCOL_METHODS = exports.DOCUMENT_SERVER_PROTOCOL_METHODS = void 0;
12
12
  /** Request-method names on {@link DocumentServerProtocol}. */
13
13
  exports.DOCUMENT_SERVER_PROTOCOL_METHODS = [
14
+ 'createSession',
15
+ 'closeSession',
16
+ 'createModelDocument',
17
+ 'updateModelDocuments',
14
18
  'openModelDocument',
15
19
  'closeModelDocument',
16
20
  'getModelDocument',
@@ -44,7 +48,13 @@ exports.REFERENCE_SERVER_PROTOCOL_METHODS = [
44
48
  'findNextName'
45
49
  ];
46
50
  /** Notification-method names on {@link DocumentClientProtocol}. */
47
- exports.DOCUMENT_CLIENT_PROTOCOL_METHODS = ['onDocumentUpdated', 'onDocumentSaved'];
51
+ exports.DOCUMENT_CLIENT_PROTOCOL_METHODS = [
52
+ 'onDocumentUpdated',
53
+ 'onDocumentSaved',
54
+ 'onDocumentDirtyChanged',
55
+ 'onDocumentDeleted',
56
+ 'onDocumentsBuilt'
57
+ ];
48
58
  /** Notification-method names on {@link ProjectClientProtocol}. */
49
59
  exports.PROJECT_CLIENT_PROTOCOL_METHODS = ['onProjectsChanged'];
50
60
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"data-protocol-methods.js","sourceRoot":"","sources":["../../src/data/data-protocol-methods.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAalF,8DAA8D;AACjD,QAAA,gCAAgC,GAAG;IAC7C,mBAAmB;IACnB,oBAAoB;IACpB,kBAAkB;IAClB,qBAAqB;IACrB,mBAAmB;IACnB,oBAAoB;IACpB,sBAAsB;IACtB,cAAc;CACyE,CAAC;AAE3F,6DAA6D;AAChD,QAAA,+BAA+B,GAAG,CAAC,aAAa,EAAE,kBAAkB,CAEhF,CAAC;AAEF;;;;;GAKG;AACU,QAAA,4BAA4B,GAAG;IACzC,GAAG,wCAAgC;IACnC,GAAG,uCAA+B;CACiD,CAAC;AAEvF;;;;;GAKG;AACU,QAAA,iCAAiC,GAAG;IAC9C,yBAAyB;IACzB,kBAAkB;IAClB,cAAc;CAC0E,CAAC;AAE5F,mEAAmE;AACtD,QAAA,gCAAgC,GAAG,CAAC,mBAAmB,EAAE,iBAAiB,CAEtF,CAAC;AAEF,kEAAkE;AACrD,QAAA,+BAA+B,GAAG,CAAC,mBAAmB,CAAwE,CAAC;AAE5I;;;;;;GAMG;AACU,QAAA,4BAA4B,GAAG;IACzC,GAAG,wCAAgC;IACnC,GAAG,uCAA+B;CACiD,CAAC"}
1
+ {"version":3,"file":"data-protocol-methods.js","sourceRoot":"","sources":["../../src/data/data-protocol-methods.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAalF,8DAA8D;AACjD,QAAA,gCAAgC,GAAG;IAC7C,eAAe;IACf,cAAc;IACd,qBAAqB;IACrB,sBAAsB;IACtB,mBAAmB;IACnB,oBAAoB;IACpB,kBAAkB;IAClB,qBAAqB;IACrB,mBAAmB;IACnB,oBAAoB;IACpB,sBAAsB;IACtB,cAAc;CACyE,CAAC;AAE3F,6DAA6D;AAChD,QAAA,+BAA+B,GAAG,CAAC,aAAa,EAAE,kBAAkB,CAEhF,CAAC;AAEF;;;;;GAKG;AACU,QAAA,4BAA4B,GAAG;IACzC,GAAG,QAAA,gCAAgC;IACnC,GAAG,QAAA,+BAA+B;CACiD,CAAC;AAEvF;;;;;GAKG;AACU,QAAA,iCAAiC,GAAG;IAC9C,yBAAyB;IACzB,kBAAkB;IAClB,cAAc;CACyD,CAAC;AAE3E,mEAAmE;AACtD,QAAA,gCAAgC,GAAG;IAC7C,mBAAmB;IACnB,iBAAiB;IACjB,wBAAwB;IACxB,mBAAmB;IACnB,kBAAkB;CACqE,CAAC;AAE3F,kEAAkE;AACrD,QAAA,+BAA+B,GAAG,CAAC,mBAAmB,CAAwE,CAAC;AAE5I;;;;;;GAMG;AACU,QAAA,4BAA4B,GAAG;IACzC,GAAG,QAAA,gCAAgC;IACnC,GAAG,QAAA,+BAA+B;CACiD,CAAC"}
@@ -12,8 +12,8 @@ import type { Project } from '../project';
12
12
  import type { TransferDocument } from '../transfer-document';
13
13
  import type { CloseModelArgs, FindNextNameArgs, OpenModelArgs, ReferenceContext, ReferenceRequest } from '../model-server';
14
14
  import type { ReferenceCandidate, ReferenceTarget } from '../model-service/reference-candidate';
15
- import type { ProjectsChangedEvent, TransferDocumentSavedEvent, TransferDocumentUpdatedEvent } from './events';
16
- import type { GetModelDocumentArgs, GetProjectForUriArgs, TransferSaveDocumentArgs, WatchModelDocumentArgs, TransferUpdateDocumentArgs } from './requests';
15
+ import type { ProjectsChangedEvent, TransferDocumentDeletedEvent, TransferDocumentDirtyChangedEvent, TransferDocumentSavedEvent, TransferDocumentsBuiltEvent, TransferDocumentUpdatedEvent } from './events';
16
+ import type { CloseSessionArgs, CreateModelDocumentArgs, CreateSessionArgs, GetModelDocumentArgs, GetProjectForUriArgs, TransferSaveDocumentArgs, WatchModelDocumentArgs, TransferUpdateDocumentArgs, TransferUpdateDocumentsArgs } from './requests';
17
17
  /**
18
18
  * Document-scoped slice of the data-server wire contract: the per-document
19
19
  * lifecycle (get / update / save), the per-`(uri, clientId)` watch
@@ -32,34 +32,68 @@ import type { GetModelDocumentArgs, GetProjectForUriArgs, TransferSaveDocumentAr
32
32
  */
33
33
  export interface DocumentServerProtocol<TTransfer extends TransferElement, TDiagnostic extends TransferDiagnostic = TransferDiagnostic> {
34
34
  /**
35
- * Open a document for an editor session and return its current state.
36
- * Registers `(uri, clientId)` with the multi-client document manager
37
- * (so concurrent editors share one built document) and returns the
38
- * document at the server's configured target phase — the same shape
39
- * {@link getModelDocument} returns, except that `version` is taken from
40
- * the text-document store so the caller's first `baseVersion` write
41
- * cannot self-conflict. Idempotent in registration terms: opening an
42
- * already-open document refreshes the client registration. Note it does
43
- * NOT avoid a rebuild — a second client attaching triggers
44
- * `refreshContent`, which fires a change event, so mounting a form on a
45
- * document already open in a text editor rebuilds it.
35
+ * Register `args.clientId` as a client session owned by this connection.
36
+ * Rejects with a `DuplicateClientIdError` code when the id is live anywhere
37
+ * in the server process, and with a `ReservedClientIdError` code when the
38
+ * framework reserves it.
46
39
  *
47
- * The default `DataServer` impl delegates to `ModelService.open` then
48
- * reads the built state. Pair with {@link watchModelDocument} to receive
49
- * subsequent build-phase events (open returns a one-shot snapshot;
50
- * later validation diagnostics arrive on the watch channel).
40
+ * A request carrying a registered id acts as that session: it writes only
41
+ * what the session has open, failing with a `DocumentNotOpenError` code
42
+ * otherwise, and opens nothing implicitly; its open reads the file and takes
43
+ * no `languageId`, `version` or `text` seed. The session ends with
44
+ * {@link closeSession} or when the connection closes, and either closes
45
+ * every document it has open.
46
+ *
47
+ * A registration carrying the `resumeToken` an earlier registration of the
48
+ * same id carried ends that session first, from any connection, so a client
49
+ * whose connection dropped can register again before the server notices.
50
+ */
51
+ createSession(args: CreateSessionArgs): Promise<void>;
52
+ /**
53
+ * End a session this connection registered: close every document it has
54
+ * open, drop its watches, and free its id. A no-op for an id this
55
+ * connection did not register.
51
56
  */
52
- openModelDocument(args: OpenModelArgs): Promise<TransferDocument<TTransfer, TDiagnostic>>;
57
+ closeSession(args: CloseSessionArgs): Promise<void>;
53
58
  /**
54
- * Close an editor session for `(uri, clientId)`. Counterpart to
55
- * {@link openModelDocument}; the underlying document stays built until
56
- * every registered client has closed. The default `DataServer` impl
57
- * delegates to `ModelService.close` and ALSO releases any watch for the
58
- * same `(uri, clientId)` (closing a session frees its own watch — a
59
- * forgotten {@link unwatchModelDocument} would otherwise leak dispatch;
60
- * the implicit unwatch is idempotent). `watchModelDocument` is NOT
61
- * coupled the other way: opening does not force a watch, so a snapshot
62
- * reader can open without streaming.
59
+ * Create a document with `args.text`, open for the session, and return it
60
+ * as {@link openModelDocument} does. It reaches disk with the first save.
61
+ * Fails when the file exists or any client has the URI open, and with a
62
+ * `SessionClosedError` code when `args.clientId` is not a session
63
+ * registered on this connection.
64
+ */
65
+ createModelDocument(args: CreateModelDocumentArgs): Promise<TransferDocument<TTransfer, TDiagnostic>>;
66
+ /**
67
+ * Write several documents the session has open, all or none: a conflict or
68
+ * a document not open fails the whole set before any text applies.
69
+ * Resolves to the documents in the order given. Only for a session
70
+ * registered on this connection.
71
+ */
72
+ updateModelDocuments(args: TransferUpdateDocumentsArgs<TTransfer>): Promise<TransferDocument<TTransfer, TDiagnostic>[]>;
73
+ /**
74
+ * Open a document for the client session `clientId` and return its current
75
+ * state. `clientId` must be a session this connection registered with
76
+ * {@link createSession}; any other id fails with the closed-session code,
77
+ * as every document request here does. The document is read from disk
78
+ * unless a client has it open already, so the request carries no
79
+ * `languageId`, `version` or `text` seed. Returns the document at
80
+ * the server's configured target phase, as {@link getModelDocument} does.
81
+ * A repeat open changes nothing.
82
+ *
83
+ * Pair with {@link watchModelDocument} to receive subsequent build-phase
84
+ * events (open returns a one-shot snapshot; later validation diagnostics
85
+ * arrive on the watch channel).
86
+ */
87
+ openModelDocument(args: Pick<OpenModelArgs, 'uri' | 'clientId' | 'options'>): Promise<TransferDocument<TTransfer, TDiagnostic>>;
88
+ /**
89
+ * Close the session's open of `uri`. Counterpart to
90
+ * {@link openModelDocument}; the document stays open until every client
91
+ * has closed it, and the last close reverts it to disk. The default
92
+ * `DataServer` impl ALSO releases any watch for the same
93
+ * `(uri, clientId)` (a forgotten {@link unwatchModelDocument} would
94
+ * otherwise leak dispatch; the implicit unwatch is idempotent).
95
+ * `watchModelDocument` is NOT coupled the other way: opening does not force
96
+ * a watch, so a snapshot reader can open without streaming.
63
97
  */
64
98
  closeModelDocument(args: CloseModelArgs): Promise<void>;
65
99
  /**
@@ -70,13 +104,14 @@ export interface DocumentServerProtocol<TTransfer extends TransferElement, TDiag
70
104
  */
71
105
  getModelDocument(args: GetModelDocumentArgs): Promise<TransferDocument<TTransfer, TDiagnostic>>;
72
106
  /**
73
- * Update a document's content. The response carries the latest built
74
- * state including diagnostics; callers observe convergence via that
75
- * response.
107
+ * Update a document's content as the session `clientId`, which must have
108
+ * it open. The response carries the latest built state including
109
+ * diagnostics; callers observe convergence via that response.
76
110
  */
77
111
  updateModelDocument(args: TransferUpdateDocumentArgs<TTransfer>): Promise<TransferDocument<TTransfer, TDiagnostic>>;
78
112
  /**
79
- * Persist a document to disk. The response is the post-save document
113
+ * Write a document as the session `clientId`, which must have it open, and
114
+ * persist it to disk. The response is the post-save document
80
115
  * state (matches the file on disk). Save semantics depend on the
81
116
  * filesystem-provider wiring; rejection paths surface as awaited
82
117
  * promise rejections.
@@ -171,6 +206,19 @@ export interface ProjectServerProtocol<TProject extends Project = Project> {
171
206
  */
172
207
  export interface DataServerProtocol<TTransfer extends TransferElement, TDiagnostic extends TransferDiagnostic = TransferDiagnostic, TProject extends Project = Project> extends DocumentServerProtocol<TTransfer, TDiagnostic>, ProjectServerProtocol<TProject> {
173
208
  }
209
+ /**
210
+ * The diagnostic shape a server answers with, read back off its own
211
+ * declaration.
212
+ *
213
+ * This is what lets a client tier stay generic over the server alone and still
214
+ * describe what it hands back. Both parameters must be inferred: naming
215
+ * {@link TransferElement} for the transfer instead fails to match while that
216
+ * parameter is still generic, and a default declared against the constraint
217
+ * then stops satisfying it.
218
+ */
219
+ export type DiagnosticOf<TServer> = TServer extends DocumentServerProtocol<infer _TTransfer, infer TDiagnostic> ? TDiagnostic : TransferDiagnostic;
220
+ /** The project shape a server answers with, read back off its own declaration. */
221
+ export type ProjectOf<TServer> = TServer extends ProjectServerProtocol<infer TProject> ? TProject : Project;
174
222
  /**
175
223
  * Cross-reference / naming slice of the server surface — scope-aware
176
224
  * queries that resolve against the language's reference services. NOT part
@@ -181,11 +229,11 @@ export interface DataServerProtocol<TTransfer extends TransferElement, TDiagnost
181
229
  * source/URI (an `ElementSource` with no URI resolves to the sole
182
230
  * registered language; a multi-language workspace overrides).
183
231
  *
184
- * Generic over the transfer root type only — the resolution result
185
- * ({@link ReferenceTarget}) carries the resolved node's encoded subtree;
186
- * candidates and names are diagnostic-free.
232
+ * Not generic over a server's root type: {@link resolveReference} answers with
233
+ * a node a reference names, which is no document root, and candidates and
234
+ * names are diagnostic-free.
187
235
  */
188
- export interface ReferenceServerProtocol<TTransfer extends TransferElement> {
236
+ export interface ReferenceServerProtocol {
189
237
  /**
190
238
  * List the reference candidates reachable for the property named in `ctx`
191
239
  * from its (possibly synthetic) source. Backed by the language's
@@ -197,8 +245,11 @@ export interface ReferenceServerProtocol<TTransfer extends TransferElement> {
197
245
  * target's document URI, display fields, and the resolved node's encoded
198
246
  * transfer subtree. Resolves via the language's reference services;
199
247
  * `undefined` when the reference does not resolve.
248
+ *
249
+ * `TElement` is the caller's claim about the target node's type; nothing
250
+ * checks it, so leave it at the default unless the reference names one type.
200
251
  */
201
- resolveReference(ref: ReferenceRequest): Promise<ReferenceTarget<TTransfer> | undefined>;
252
+ resolveReference<TElement extends TransferElement = TransferElement>(ref: ReferenceRequest): Promise<ReferenceTarget<TElement> | undefined>;
202
253
  /**
203
254
  * Compute the next free name for a new element of `args.type` based on
204
255
  * `args.proposal`, unique within the `args.tier` scope (default
@@ -235,6 +286,36 @@ export interface DocumentClientProtocol<TTransfer extends TransferElement, TDiag
235
286
  * codepath, not a subscription codepath).
236
287
  */
237
288
  onDocumentSaved(event: TransferDocumentSavedEvent<TTransfer, TDiagnostic>): void;
289
+ /**
290
+ * Delivered when a subscribed document's text starts or stops differing
291
+ * from its file, as the server last knew it. Gated like
292
+ * {@link onDocumentSaved}; the answer at any one moment is the `dirty` of
293
+ * the documents the server sends. After a reconnect, a `DataSession`
294
+ * delivers here the answer of each document it restored, when that differs
295
+ * from the last this client was told: the flips while the connection was
296
+ * down reached no one.
297
+ */
298
+ onDocumentDirtyChanged(event: TransferDocumentDirtyChangedEvent): void;
299
+ /**
300
+ * Delivered when a document's backing file was removed. Separate from
301
+ * {@link onDocumentUpdated} for the same reason as {@link onDocumentSaved},
302
+ * and more strongly: there is no built state to deliver, and the build-phase
303
+ * path cannot report a deletion at all.
304
+ *
305
+ * Ungated, because on a browser host — where the workspace lives behind the
306
+ * head — no other source can observe a file disappearing. Recipients that
307
+ * only care about their own documents filter by URI.
308
+ */
309
+ onDocumentDeleted(event: TransferDocumentDeletedEvent): void;
310
+ /**
311
+ * Delivered once per build, naming the documents that reached the
312
+ * subscription phase and that
313
+ * nobody on this connection watches — chiefly the ones rebuilt as a cascade
314
+ * from a dependency's change, which no filesystem watcher can see because
315
+ * their own files did not change. The complement of
316
+ * {@link onDocumentUpdated}; carries URIs and no documents.
317
+ */
318
+ onDocumentsBuilt(event: TransferDocumentsBuiltEvent): void;
238
319
  }
239
320
  /**
240
321
  * Project-scoped slice of the client surface — the project-registry change
@@ -1 +1 @@
1
- {"version":3,"file":"data-server-protocol.d.ts","sourceRoot":"","sources":["../../src/data/data-server-protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC3H,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAChG,OAAO,KAAK,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAC/G,OAAO,KAAK,EACT,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,sBAAsB,EACtB,0BAA0B,EAC5B,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WA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C,eAAe,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC,CAAC;IAElD;;;;OAIG;IACH,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACxD;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,sBAAsB,CAAC,SAAS,SAAS,eAAe,EAAE,WAAW,SAAS,kBAAkB,GAAG,kBAAkB;IACnI;;;;OAIG;IACH,iBAAiB,CAAC,KAAK,EAAE,4BAA4B,CAAC,SAAS,EAAE,WAAW,CAAC,GAAG,IAAI,CAAC;IAErF;;;;;;;;;OASG;IACH,eAAe,CAAC,KAAK,EAAE,0BAA0B,CAAC,SAAS,EAAE,WAAW,CAAC,GAAG,IAAI,CAAC;IAEjF;;;;;;;;OAQG;IACH,sBAAsB,CAAC,KAAK,EAAE,iCAAiC,GAAG,IAAI,CAAC;IAEvE;;;;;;;;;OASG;IACH,iBAAiB,CAAC,KAAK,EAAE,4BAA4B,GAAG,IAAI,CAAC;IAE7D;;;;;;;OAOG;IACH,gBAAgB,CAAC,KAAK,EAAE,2BAA2B,GAAG,IAAI,CAAC;CAC7D;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB,CAAC,QAAQ,SAAS,OAAO,GAAG,OAAO;IACtE;;;;;;;;OAQG;IACH,iBAAiB,CAAC,KAAK,EAAE,oBAAoB,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;CACjE;AAED;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB,CAChC,SAAS,SAAS,eAAe,EACjC,WAAW,SAAS,kBAAkB,GAAG,kBAAkB,EAC3D,QAAQ,SAAS,OAAO,GAAG,OAAO,CAElC,SAAQ,sBAAsB,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE,qBAAqB,CAAC,QAAQ,CAAC;CAAG"}
@@ -9,29 +9,35 @@
9
9
  import type { TransferDiagnostic } from '../transfer-diagnostic';
10
10
  import type { TransferElement } from '../transfer-element';
11
11
  import type { Project } from '../project';
12
- import type { TransferDocument } from '../transfer-document';
12
+ import type { TextState, TransferDocument } from '../transfer-document';
13
13
  /**
14
14
  * Why an update event fired. Subscribers filter on reason for behaviour
15
15
  * decisions (e.g. dirty-flag handling, undo-history grouping, telemetry):
16
16
  *
17
- * - `'changed'` — the URI appeared in `DocumentBuilder.onUpdate`'s
18
- * `changed` list. The framework's underlying primitive is "this URI was
19
- * passed to `documentBuilder.update(changed, deleted)`", which spans
20
- * `didChange` text-document events, `notifyDidChangeTextDocument` calls,
21
- * and any programmatic `documentBuilder.update([uri], [])` invocation.
22
- * The name matches Langium's own `changed` parameter — it's vague-on-
23
- * purpose because the underlying primitive is.
24
- * - `'rebuilt'` — the URI was rebuilt as a cascade from another URI's
25
- * build (dependency graph re-derivation), without itself being passed to
26
- * `documentBuilder.update`. The complement of `'changed'`.
17
+ * - `'changed'` — the server's first update event for the document's current
18
+ * version: its content changed since the last one. A write whose build a
19
+ * later write cancelled is still `'changed'` in the build that takes over.
20
+ * - `'rebuilt'` — a later event for a version the server already delivered,
21
+ * whether or not any client watched it then: something the document depends
22
+ * on changed, or the document was built again with the same content. The
23
+ * complement of `'changed'`.
27
24
  * - `'saved'` — emitted by adopters that synthesise a unified update stream
28
25
  * from both `onDocumentUpdated` and `onDocumentSaved`. The framework's own
29
26
  * `dispatchPhaseEvent` does NOT emit `'saved'` — saves take the dedicated
30
27
  * `DataClientProtocol.onDocumentSaved` channel.
31
- * - `'deleted'` — the URI appeared in `DocumentBuilder.onUpdate`'s
32
- * `deleted` list. The backing file was removed.
28
+ *
29
+ * The version rule needs a version the server keeps and builds that validate.
30
+ * For a document no client has opened, or when rebuilds do not validate,
31
+ * `'changed'` means the URI was passed to `DocumentBuilder.update` for this
32
+ * build. A document that a validating build skips is `'changed'` every time.
33
+ *
34
+ * Deletion is deliberately NOT a member. An update event carries a built
35
+ * document, which a deleted one has none of, and the phase-driven path that
36
+ * produces these events never runs for a deleted URI — the builder drops the
37
+ * document before deriving the rebuild set. It travels as
38
+ * {@link TransferDocumentDeletedEvent} on its own channel instead.
33
39
  */
34
- export type TransferDocumentUpdateReason = 'changed' | 'rebuilt' | 'saved' | 'deleted';
40
+ export type TransferDocumentUpdateReason = 'changed' | 'rebuilt' | 'saved';
35
41
  /**
36
42
  * Delivered on the data-server when a document's content (or existence)
37
43
  * changed. Subscribers receive this via `DocumentServerProtocol.watchModelDocument`.
@@ -41,7 +47,13 @@ export type TransferDocumentUpdateReason = 'changed' | 'rebuilt' | 'saved' | 'de
41
47
  */
42
48
  export interface TransferDocumentUpdatedEvent<TTransfer extends TransferElement, TDiagnostic extends TransferDiagnostic = TransferDiagnostic> {
43
49
  document: TransferDocument<TTransfer, TDiagnostic>;
44
- /** Stable identifier of the client that triggered the update. */
50
+ /**
51
+ * The client whose write this event echoes: the author of the version on a
52
+ * `'changed'`, and the unknown-client id on a `'rebuilt'`, which echoes no
53
+ * write. A recipient compares it against its own id to recognise its echo.
54
+ * The rebuild that reverts a document to disk after its last close names
55
+ * the revert-on-close id instead.
56
+ */
45
57
  sourceClientId: string;
46
58
  reason: TransferDocumentUpdateReason;
47
59
  }
@@ -72,6 +84,89 @@ export interface TransferDocumentSavedEvent<TTransfer extends TransferElement, T
72
84
  }
73
85
  /** Callback shape for `DataClientProtocol.onDocumentSaved`. */
74
86
  export type TransferDocumentSavedListener<TTransfer extends TransferElement, TDiagnostic extends TransferDiagnostic = TransferDiagnostic> = (event: TransferDocumentSavedEvent<TTransfer, TDiagnostic>) => void;
87
+ /**
88
+ * Delivered on the data-server when a watched document's text starts or stops
89
+ * differing from its file, as the server last knew the file. The current
90
+ * answer rides on every transfer document the server sends as `text.dirty`;
91
+ * this carries only its changes, so a client that follows it needs no rebuild
92
+ * to learn of a save.
93
+ */
94
+ export interface TransferDocumentDirtyChangedEvent {
95
+ /** Canonical URI, keyed as the subscription is. */
96
+ readonly uri: string;
97
+ /**
98
+ * The text the answer was decided on. It is sent before that text is
99
+ * built, so a `text.version` ahead of the model a client holds means an
100
+ * update at this version or a later one follows. Absent when the document
101
+ * no longer exists, or when the build that follows its release failed.
102
+ */
103
+ readonly text?: TextState;
104
+ }
105
+ /** Callback shape for `DataClientProtocol.onDocumentDirtyChanged`. */
106
+ export type TransferDocumentDirtyChangedListener = (event: TransferDocumentDirtyChangedEvent) => void;
107
+ /**
108
+ * Delivered on the data-server when a document's backing file was removed.
109
+ * Carries no document, and cannot: the state a
110
+ * {@link TransferDocumentUpdatedEvent} would have to carry no longer exists by
111
+ * the time anyone can be told. That is also why deletion is not a `reason` on
112
+ * the update stream — `DocumentBuilder.update` drops the document before
113
+ * deriving the rebuild set, so the phase-driven path that produces update
114
+ * events never runs for it.
115
+ *
116
+ * **Delivered for EVERY document, not only watched ones**, unlike
117
+ * `onDocumentUpdated` and `onDocumentSaved`. The test that decides which
118
+ * channels are gated is whether any OTHER source can observe the fact on the
119
+ * least capable host: a browser-hosted client's workspace lives behind the
120
+ * head, so nothing there can see a file disappear, and gating the notification
121
+ * would leave it blind. (A Theia frontend's filesystem watcher would cover it,
122
+ * which is why this is a host argument and not a structure-versus-content one.)
123
+ * A watcher is told about its own document's deletion here too, the update
124
+ * channel being silent for deletions by construction. Filter on {@link uri} if
125
+ * the receiver only cares about documents it opened.
126
+ *
127
+ * A watch survives the deletion, so a file that comes back resumes delivering
128
+ * `onDocumentUpdated` to the same subscribers with no re-subscription. A
129
+ * client that responds by closing its editor releases the watch through
130
+ * `closeModelDocument` as usual.
131
+ */
132
+ export interface TransferDocumentDeletedEvent {
133
+ /** Canonical URI of the removed document, keyed as the subscription is. */
134
+ readonly uri: string;
135
+ }
136
+ /** Callback shape for `DataClientProtocol.onDocumentDeleted`. */
137
+ export type TransferDocumentDeletedListener = (event: TransferDocumentDeletedEvent) => void;
138
+ /**
139
+ * Delivered on the data-server once per build, naming the documents that reached
140
+ * the configured subscription phase (`DataServerOptions.subscriptionPhase`,
141
+ * `Validated` by default) and that NO client on the connection is watching. Not
142
+ * the integrity-settled landmark, which is a different point and a different
143
+ * word in this framework.
144
+ *
145
+ * The complement of {@link TransferDocumentUpdatedEvent}, which is gated per
146
+ * URI: together the two cover every document a build touched. This one exists
147
+ * for the case no source outside the server can observe — a document rebuilt
148
+ * because something it DEPENDS ON changed. Its own file never changed, so a
149
+ * filesystem watcher cannot see it, and it has no subscriber, so the update
150
+ * channel does not report it. A consumer showing data derived from such a
151
+ * document (a tree label, a decorator) would otherwise hold a stale value with
152
+ * nothing to invalidate it.
153
+ *
154
+ * Carries URIs and no documents: a recipient re-reads what it displays, through
155
+ * `getModelDocument` or its own request. That keeps the bandwidth property the
156
+ * per-URI subscription exists for, without gating the message.
157
+ *
158
+ * Not sent when the set is empty, which is the normal case while editing — the
159
+ * document being edited is watched by its own editor and therefore excluded.
160
+ * Workspace initialisation sends nothing either: it does not build to the
161
+ * subscription phase. The largest message a workspace can produce is therefore
162
+ * a whole-workspace rebuild at that phase, which is one message of URIs.
163
+ */
164
+ export interface TransferDocumentsBuiltEvent {
165
+ /** Canonical URIs, keyed as subscriptions are. Never empty. */
166
+ readonly uris: readonly string[];
167
+ }
168
+ /** Callback shape for `DataClientProtocol.onDocumentsBuilt`. */
169
+ export type TransferDocumentsBuiltListener = (event: TransferDocumentsBuiltEvent) => void;
75
170
  /**
76
171
  * Why a project-change event fired. `added` — the project was newly
77
172
  * registered (descriptor discovered); `updated` — the project's
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/data/events.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,4BAA4B,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BAAuB,CAAC,QAAQ,SAAS,OAAO,GAAG,OAAO,IAAI,CAAC,KAAK,EAAE,oBAAoB,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC"}
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
- import type { TransferSaveArgs, TransferUpdateArgs } from '../model-service/args';
9
+ import type { BaseVersion } from '../model-service/base-version';
10
10
  /** Get the current state of a single document. The server returns the latest built version. */
11
11
  export interface GetModelDocumentArgs {
12
12
  /** Document URI. */
@@ -37,22 +37,78 @@ export interface GetProjectForUriArgs {
37
37
  uri: string;
38
38
  }
39
39
  /**
40
- * Update a document's content. Wire-side projection of the facade's
41
- * {@link TransferUpdateArgs}; structurally identical so the data-server RPC
42
- * handler can forward straight to the in-process `ModelService.update`
43
- * without an args mapping.
40
+ * Update a document the session `clientId` has open. Generic over `TTransfer`
41
+ * so adopters parameterise the structured shape against their grammar's
42
+ * transfer-model overlay; passing a string is always allowed.
44
43
  */
45
- export type TransferUpdateDocumentArgs<TTransfer> = TransferUpdateArgs<TTransfer>;
46
- /** Persist a document to disk. Wire-side projection of {@link TransferSaveArgs}. */
47
- export type TransferSaveDocumentArgs<TTransfer> = TransferSaveArgs<TTransfer>;
44
+ export interface TransferUpdateDocumentArgs<TTransfer> {
45
+ /** Document URI. */
46
+ uri: string;
47
+ /** The id of a live session registered on this connection. */
48
+ clientId: string;
49
+ /** The whole structured model root, or its serialised textual form. */
50
+ model: TTransfer | string;
51
+ /**
52
+ * What this write was authored against. A `ModelVersion` is compared
53
+ * against the server's current text-document version for `uri` and throws
54
+ * `ConflictError` on mismatch; `'any'` writes unconditionally.
55
+ *
56
+ * **Required so that an ungated write is a decision rather than an
57
+ * omission.** An optional gate is indistinguishable from a forgotten one at
58
+ * the call site, and a file of twenty writes hides the one that lost the
59
+ * field. Nothing else here can see that, since the defect is an absence.
60
+ */
61
+ baseVersion: BaseVersion;
62
+ }
63
+ /** Update a document the session `clientId` has open, then persist it to disk. */
64
+ export interface TransferSaveDocumentArgs<TTransfer> extends TransferUpdateDocumentArgs<TTransfer> {
65
+ }
66
+ /** Register a client session on the connection. */
67
+ export interface CreateSessionArgs {
68
+ /** The session's id, minted by the client; unique in the server process while the session is live. */
69
+ clientId: string;
70
+ /** What the participant is; kept as the server session's `label`. */
71
+ label?: string;
72
+ /**
73
+ * A token the client keeps for the session's lifetime. It is no secret: the
74
+ * wire carries no authentication. A later `createSession` for the same id
75
+ * carrying the same token, from any connection, ends the session it names
76
+ * and registers the id afresh, so a client whose connection dropped before
77
+ * the server noticed can register again. Without it the id stays refused
78
+ * until the server notices.
79
+ */
80
+ resumeToken?: string;
81
+ }
82
+ /** End a client session registered on the connection. */
83
+ export interface CloseSessionArgs {
84
+ clientId: string;
85
+ }
86
+ /** Create a document that exists nowhere yet, open for the session creating it. */
87
+ export interface CreateModelDocumentArgs {
88
+ uri: string;
89
+ /** The id of a live session registered on this connection. */
90
+ clientId: string;
91
+ /** The document's initial content; it reaches disk with the first save. */
92
+ text: string;
93
+ }
94
+ /**
95
+ * Write several documents a session has open, all or none. `clientId` is on
96
+ * the set rather than on each update: an id per update would allow a set
97
+ * mixing clients, which the server would have to refuse.
98
+ */
99
+ export interface TransferUpdateDocumentsArgs<TTransfer> {
100
+ /** The id of a live session registered on this connection. */
101
+ clientId: string;
102
+ updates: Omit<TransferUpdateDocumentArgs<TTransfer>, 'clientId'>[];
103
+ }
48
104
  /**
49
105
  * Identifies a per-document watch on the data server. Shared by both
50
106
  * `watchModelDocument` and `unwatchModelDocument` — the `(uri, clientId)`
51
107
  * pair is the watch key, so unwatching names the same watch that was
52
108
  * started. The `clientId` identifies the originator the same way it does
53
- * on facade-side mutations (`TransferUpdateArgs.clientId`,
54
- * `TransferSaveArgs.clientId`): it keys the per-`(uri, clientId)` watch
55
- * bucket so multiple watchers on the same wire stay distinct, AND it lets
109
+ * on the document writes (`TransferUpdateDocumentArgs.clientId`,
110
+ * `TransferSaveDocumentArgs.clientId`): it keys the per-`(uri, clientId)`
111
+ * watch bucket so multiple watchers on the same wire stay distinct, AND it lets
56
112
  * each watcher recognise its own echo on inbound `onDocumentUpdated` events
57
113
  * (the wire shape's `sourceClientId` carries the originating mutation's
58
114
  * `clientId`).
@@ -1 +1 @@
1
- {"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../src/data/requests.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAElF,+FAA+F;AAC/F,MAAM,WAAW,oBAAoB;IAClC,oBAAoB;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ;;;;;;;;;;;;OAYG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IAClC,+BAA+B;IAC/B,GAAG,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,MAAM,MAAM,0BAA0B,CAAC,SAAS,IAAI,kBAAkB,CAAC,SAAS,CAAC,CAAC;AAElF,oFAAoF;AACpF,MAAM,MAAM,wBAAwB,CAAC,SAAS,IAAI,gBAAgB,CAAC,SAAS,CAAC,CAAC;AAE9E;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,sBAAsB;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;CACnB"}
1
+ {"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../src/data/requests.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEjE,+FAA+F;AAC/F,MAAM,WAAW,oBAAoB;IAClC,oBAAoB;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ;;;;;;;;;;;;OAYG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;GAKG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