@hydranium/protocol 1.0.0-next.38 → 1.0.0-next.381

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 (298) hide show
  1. package/README.md +44 -83
  2. package/lib/abstract-logger.d.ts +11 -0
  3. package/lib/abstract-logger.d.ts.map +1 -1
  4. package/lib/abstract-logger.js +16 -0
  5. package/lib/abstract-logger.js.map +1 -1
  6. package/lib/client/data-connection.d.ts +303 -0
  7. package/lib/client/data-connection.d.ts.map +1 -0
  8. package/lib/client/data-connection.js +534 -0
  9. package/lib/client/data-connection.js.map +1 -0
  10. package/lib/client/data-events.d.ts +18 -1
  11. package/lib/client/data-events.d.ts.map +1 -1
  12. package/lib/client/data-events.js +26 -0
  13. package/lib/client/data-events.js.map +1 -1
  14. package/lib/client/data-port.d.ts +34 -24
  15. package/lib/client/data-port.d.ts.map +1 -1
  16. package/lib/client/data-session.d.ts +694 -89
  17. package/lib/client/data-session.d.ts.map +1 -1
  18. package/lib/client/data-session.js +1158 -115
  19. package/lib/client/data-session.js.map +1 -1
  20. package/lib/client/index.d.ts +15 -9
  21. package/lib/client/index.d.ts.map +1 -1
  22. package/lib/client/index.js +15 -9
  23. package/lib/client/index.js.map +1 -1
  24. package/lib/client/message-relay.d.ts +6 -4
  25. package/lib/client/message-relay.d.ts.map +1 -1
  26. package/lib/client/message-relay.js +4 -4
  27. package/lib/client/message-relay.js.map +1 -1
  28. package/lib/client/post-message-transport.d.ts +69 -3
  29. package/lib/client/post-message-transport.d.ts.map +1 -1
  30. package/lib/client/post-message-transport.js +175 -1
  31. package/lib/client/post-message-transport.js.map +1 -1
  32. package/lib/client/rpc-connection.d.ts +173 -0
  33. package/lib/client/rpc-connection.d.ts.map +1 -0
  34. package/lib/client/rpc-connection.js +225 -0
  35. package/lib/client/rpc-connection.js.map +1 -0
  36. package/lib/client/worker-handshake.d.ts +94 -0
  37. package/lib/client/worker-handshake.d.ts.map +1 -0
  38. package/lib/client/worker-handshake.js +51 -0
  39. package/lib/client/worker-handshake.js.map +1 -0
  40. package/lib/client-ids.d.ts +45 -0
  41. package/lib/client-ids.d.ts.map +1 -0
  42. package/lib/client-ids.js +48 -0
  43. package/lib/client-ids.js.map +1 -0
  44. package/lib/clock.d.ts +50 -10
  45. package/lib/clock.d.ts.map +1 -1
  46. package/lib/clock.js +36 -1
  47. package/lib/clock.js.map +1 -1
  48. package/lib/console-logger.d.ts +23 -0
  49. package/lib/console-logger.d.ts.map +1 -0
  50. package/lib/console-logger.js +39 -0
  51. package/lib/console-logger.js.map +1 -0
  52. package/lib/data/data-protocol-methods.d.ts +4 -4
  53. package/lib/data/data-protocol-methods.d.ts.map +1 -1
  54. package/lib/data/data-protocol-methods.js +13 -1
  55. package/lib/data/data-protocol-methods.js.map +1 -1
  56. package/lib/data/data-server-protocol.d.ts +176 -49
  57. package/lib/data/data-server-protocol.d.ts.map +1 -1
  58. package/lib/data/events.d.ts +144 -33
  59. package/lib/data/events.d.ts.map +1 -1
  60. package/lib/data/requests.d.ts +84 -11
  61. package/lib/data/requests.d.ts.map +1 -1
  62. package/lib/debouncer.d.ts +7 -4
  63. package/lib/debouncer.d.ts.map +1 -1
  64. package/lib/debouncer.js +10 -10
  65. package/lib/debouncer.js.map +1 -1
  66. package/lib/errors.d.ts +243 -41
  67. package/lib/errors.d.ts.map +1 -1
  68. package/lib/errors.js +400 -55
  69. package/lib/errors.js.map +1 -1
  70. package/lib/format-log-arg.d.ts +33 -0
  71. package/lib/format-log-arg.d.ts.map +1 -0
  72. package/lib/format-log-arg.js +158 -0
  73. package/lib/format-log-arg.js.map +1 -0
  74. package/lib/glsp-edits-settled-actions.d.ts +54 -0
  75. package/lib/glsp-edits-settled-actions.d.ts.map +1 -0
  76. package/lib/glsp-edits-settled-actions.js +28 -0
  77. package/lib/glsp-edits-settled-actions.js.map +1 -0
  78. package/lib/glsp-request-model-args.d.ts +16 -0
  79. package/lib/glsp-request-model-args.d.ts.map +1 -0
  80. package/lib/glsp-request-model-args.js +19 -0
  81. package/lib/glsp-request-model-args.js.map +1 -0
  82. package/lib/glsp-save-model-actions.d.ts +55 -0
  83. package/lib/glsp-save-model-actions.d.ts.map +1 -0
  84. package/lib/glsp-save-model-actions.js +28 -0
  85. package/lib/glsp-save-model-actions.js.map +1 -0
  86. package/lib/index.d.ts +11 -0
  87. package/lib/index.d.ts.map +1 -1
  88. package/lib/index.js +11 -0
  89. package/lib/index.js.map +1 -1
  90. package/lib/latency-collector.d.ts +10 -4
  91. package/lib/latency-collector.d.ts.map +1 -1
  92. package/lib/latency-collector.js +2 -0
  93. package/lib/latency-collector.js.map +1 -1
  94. package/lib/logger.d.ts +38 -7
  95. package/lib/logger.d.ts.map +1 -1
  96. package/lib/logger.js +42 -4
  97. package/lib/logger.js.map +1 -1
  98. package/lib/messages/index.d.ts +4 -2
  99. package/lib/messages/index.d.ts.map +1 -1
  100. package/lib/messages/index.js +17 -4
  101. package/lib/messages/index.js.map +1 -1
  102. package/lib/messages/primitives.d.ts +59 -4
  103. package/lib/messages/primitives.d.ts.map +1 -1
  104. package/lib/messages/primitives.js +97 -4
  105. package/lib/messages/primitives.js.map +1 -1
  106. package/lib/model-server.d.ts +60 -13
  107. package/lib/model-server.d.ts.map +1 -1
  108. package/lib/model-server.js +4 -2
  109. package/lib/model-server.js.map +1 -1
  110. package/lib/model-service/base-version.d.ts +67 -0
  111. package/lib/model-service/base-version.d.ts.map +1 -0
  112. package/lib/model-service/base-version.js +44 -0
  113. package/lib/model-service/base-version.js.map +1 -0
  114. package/lib/model-service/index.d.ts +1 -1
  115. package/lib/model-service/index.d.ts.map +1 -1
  116. package/lib/model-service/index.js +4 -5
  117. package/lib/model-service/index.js.map +1 -1
  118. package/lib/model-service/reference-candidate.d.ts +5 -3
  119. package/lib/model-service/reference-candidate.d.ts.map +1 -1
  120. package/lib/node/index.d.ts +10 -0
  121. package/lib/node/index.d.ts.map +1 -0
  122. package/lib/node/index.js +29 -0
  123. package/lib/node/index.js.map +1 -0
  124. package/lib/node/process-memory.d.ts +66 -0
  125. package/lib/node/process-memory.d.ts.map +1 -0
  126. package/lib/node/process-memory.js +291 -0
  127. package/lib/node/process-memory.js.map +1 -0
  128. package/lib/noop-logger.d.ts.map +1 -1
  129. package/lib/noop-logger.js.map +1 -1
  130. package/lib/observable-value.js.map +1 -1
  131. package/lib/patch-merge.d.ts +63 -35
  132. package/lib/patch-merge.d.ts.map +1 -1
  133. package/lib/patch-merge.js +171 -25
  134. package/lib/patch-merge.js.map +1 -1
  135. package/lib/pending-work-tracker.d.ts +30 -0
  136. package/lib/pending-work-tracker.d.ts.map +1 -0
  137. package/lib/pending-work-tracker.js +47 -0
  138. package/lib/pending-work-tracker.js.map +1 -0
  139. package/lib/profile-session.d.ts +24 -8
  140. package/lib/profile-session.d.ts.map +1 -1
  141. package/lib/profile-session.js +13 -4
  142. package/lib/profile-session.js.map +1 -1
  143. package/lib/profiling.d.ts +15 -2
  144. package/lib/profiling.d.ts.map +1 -1
  145. package/lib/profiling.js.map +1 -1
  146. package/lib/project.d.ts +6 -2
  147. package/lib/project.d.ts.map +1 -1
  148. package/lib/project.js.map +1 -1
  149. package/lib/random-uuid.d.ts +14 -0
  150. package/lib/random-uuid.d.ts.map +1 -0
  151. package/lib/random-uuid.js +24 -0
  152. package/lib/random-uuid.js.map +1 -0
  153. package/lib/reconcile-write.d.ts +70 -0
  154. package/lib/reconcile-write.d.ts.map +1 -0
  155. package/lib/reconcile-write.js +69 -0
  156. package/lib/reconcile-write.js.map +1 -0
  157. package/lib/rpc/bind-rpc-methods.d.ts +6 -2
  158. package/lib/rpc/bind-rpc-methods.d.ts.map +1 -1
  159. package/lib/rpc/bind-rpc-methods.js +17 -7
  160. package/lib/rpc/bind-rpc-methods.js.map +1 -1
  161. package/lib/rpc/create-rpc-proxy.d.ts +3 -0
  162. package/lib/rpc/create-rpc-proxy.d.ts.map +1 -1
  163. package/lib/rpc/create-rpc-proxy.js +6 -1
  164. package/lib/rpc/create-rpc-proxy.js.map +1 -1
  165. package/lib/rpc/index.d.ts +1 -0
  166. package/lib/rpc/index.d.ts.map +1 -1
  167. package/lib/rpc/index.js +1 -0
  168. package/lib/rpc/index.js.map +1 -1
  169. package/lib/rpc/send-by-method-name.d.ts +76 -0
  170. package/lib/rpc/send-by-method-name.d.ts.map +1 -0
  171. package/lib/rpc/send-by-method-name.js +120 -0
  172. package/lib/rpc/send-by-method-name.js.map +1 -0
  173. package/lib/rpc/wire-prefix.js.map +1 -1
  174. package/lib/save-text-document.d.ts +40 -0
  175. package/lib/save-text-document.d.ts.map +1 -0
  176. package/lib/save-text-document.js +34 -0
  177. package/lib/save-text-document.js.map +1 -0
  178. package/lib/testing/catalogue-audit.js.map +1 -1
  179. package/lib/testing/data-doubles.d.ts +41 -12
  180. package/lib/testing/data-doubles.d.ts.map +1 -1
  181. package/lib/testing/data-doubles.js +56 -8
  182. package/lib/testing/data-doubles.js.map +1 -1
  183. package/lib/testing/fake-clock.d.ts +17 -2
  184. package/lib/testing/fake-clock.d.ts.map +1 -1
  185. package/lib/testing/fake-clock.js +61 -46
  186. package/lib/testing/fake-clock.js.map +1 -1
  187. package/lib/testing/index.d.ts +1 -0
  188. package/lib/testing/index.d.ts.map +1 -1
  189. package/lib/testing/index.js +4 -3
  190. package/lib/testing/index.js.map +1 -1
  191. package/lib/testing/node/duplex-connection.d.ts.map +1 -1
  192. package/lib/testing/node/duplex-connection.js +3 -2
  193. package/lib/testing/node/duplex-connection.js.map +1 -1
  194. package/lib/testing/node/duplex-stream.js.map +1 -1
  195. package/lib/testing/node/index.d.ts +1 -0
  196. package/lib/testing/node/index.d.ts.map +1 -1
  197. package/lib/testing/node/index.js +2 -2
  198. package/lib/testing/node/index.js.map +1 -1
  199. package/lib/testing/node/message-port-pair.d.ts +25 -0
  200. package/lib/testing/node/message-port-pair.d.ts.map +1 -0
  201. package/lib/testing/node/message-port-pair.js +26 -0
  202. package/lib/testing/node/message-port-pair.js.map +1 -0
  203. package/lib/testing/transfer-node-builder.d.ts +81 -0
  204. package/lib/testing/transfer-node-builder.d.ts.map +1 -0
  205. package/lib/testing/transfer-node-builder.js +47 -0
  206. package/lib/testing/transfer-node-builder.js.map +1 -0
  207. package/lib/testing/wait-for.d.ts +9 -3
  208. package/lib/testing/wait-for.d.ts.map +1 -1
  209. package/lib/testing/wait-for.js +57 -11
  210. package/lib/testing/wait-for.js.map +1 -1
  211. package/lib/tracer.d.ts.map +1 -1
  212. package/lib/tracer.js +5 -9
  213. package/lib/tracer.js.map +1 -1
  214. package/lib/transfer-diagnostic.d.ts +11 -0
  215. package/lib/transfer-diagnostic.d.ts.map +1 -1
  216. package/lib/transfer-diagnostic.js +17 -0
  217. package/lib/transfer-diagnostic.js.map +1 -1
  218. package/lib/transfer-document.d.ts +96 -32
  219. package/lib/transfer-document.d.ts.map +1 -1
  220. package/lib/transfer-document.js +17 -9
  221. package/lib/transfer-document.js.map +1 -1
  222. package/lib/transfer-element.d.ts +4 -4
  223. package/lib/types.d.ts +32 -0
  224. package/lib/types.d.ts.map +1 -0
  225. package/lib/{model-service/args.js → types.js} +2 -2
  226. package/lib/types.js.map +1 -0
  227. package/lib/uri.d.ts.map +1 -1
  228. package/lib/uri.js.map +1 -1
  229. package/lib/util.d.ts +8 -2
  230. package/lib/util.d.ts.map +1 -1
  231. package/lib/util.js +32 -4
  232. package/lib/util.js.map +1 -1
  233. package/package.json +24 -40
  234. package/src/abstract-logger.ts +18 -0
  235. package/src/client/data-connection.ts +654 -0
  236. package/src/client/data-events.ts +38 -1
  237. package/src/client/data-port.ts +36 -25
  238. package/src/client/data-session.ts +1479 -137
  239. package/src/client/index.ts +15 -9
  240. package/src/client/message-relay.ts +6 -4
  241. package/src/client/post-message-transport.ts +224 -4
  242. package/src/client/rpc-connection.ts +302 -0
  243. package/src/client/worker-handshake.ts +121 -0
  244. package/src/client-ids.ts +49 -0
  245. package/src/clock.ts +68 -10
  246. package/src/console-logger.ts +39 -0
  247. package/src/data/data-protocol-methods.ts +14 -4
  248. package/src/data/data-server-protocol.ts +203 -49
  249. package/src/data/events.ts +150 -33
  250. package/src/data/requests.ts +90 -11
  251. package/src/debouncer.ts +11 -11
  252. package/src/errors.ts +500 -65
  253. package/src/format-log-arg.ts +176 -0
  254. package/src/glsp-edits-settled-actions.ts +62 -0
  255. package/src/glsp-request-model-args.ts +16 -0
  256. package/src/glsp-save-model-actions.ts +64 -0
  257. package/src/index.ts +11 -0
  258. package/src/latency-collector.ts +10 -3
  259. package/src/logger.ts +44 -8
  260. package/src/messages/index.ts +12 -2
  261. package/src/messages/primitives.ts +129 -5
  262. package/src/model-server.ts +64 -19
  263. package/src/model-service/base-version.ts +75 -0
  264. package/src/model-service/index.ts +4 -5
  265. package/src/model-service/reference-candidate.ts +5 -3
  266. package/src/node/index.ts +14 -0
  267. package/src/node/process-memory.ts +299 -0
  268. package/src/patch-merge.ts +230 -45
  269. package/src/pending-work-tracker.ts +47 -0
  270. package/src/profile-session.ts +31 -11
  271. package/src/profiling.ts +15 -2
  272. package/src/project.ts +6 -2
  273. package/src/random-uuid.ts +21 -0
  274. package/src/reconcile-write.ts +131 -0
  275. package/src/rpc/README.md +6 -6
  276. package/src/rpc/bind-rpc-methods.ts +18 -8
  277. package/src/rpc/create-rpc-proxy.ts +6 -1
  278. package/src/rpc/index.ts +1 -0
  279. package/src/rpc/send-by-method-name.ts +140 -0
  280. package/src/save-text-document.ts +39 -0
  281. package/src/testing/data-doubles.ts +141 -19
  282. package/src/testing/fake-clock.ts +76 -48
  283. package/src/testing/index.ts +4 -3
  284. package/src/testing/node/duplex-connection.ts +3 -2
  285. package/src/testing/node/index.ts +2 -2
  286. package/src/testing/node/message-port-pair.ts +40 -0
  287. package/src/testing/transfer-node-builder.ts +107 -0
  288. package/src/testing/wait-for.ts +61 -13
  289. package/src/tracer.ts +5 -9
  290. package/src/transfer-diagnostic.ts +17 -0
  291. package/src/transfer-document.ts +116 -34
  292. package/src/transfer-element.ts +4 -4
  293. package/src/types.ts +30 -0
  294. package/src/util.ts +33 -6
  295. package/lib/model-service/args.d.ts +0 -64
  296. package/lib/model-service/args.d.ts.map +0 -1
  297. package/lib/model-service/args.js.map +0 -1
  298. package/src/model-service/args.ts +0 -67
@@ -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,27 +37,100 @@ 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
+ * Set by a session's restore after a reconnect, which sends its last write
64
+ * again. A model the server took was written over text that parsed, so it
65
+ * is written even over text that does not, as it was before the
66
+ * reconnect. Any other model write over such text is refused with
67
+ * `DocumentSyntaxError`, a save's even when it sets this.
68
+ */
69
+ restore?: boolean;
70
+ }
71
+ /** Update a document the session `clientId` has open, then persist it to disk. */
72
+ export interface TransferSaveDocumentArgs<TTransfer> extends Omit<TransferUpdateDocumentArgs<TTransfer>, 'restore'> {
73
+ }
74
+ /** Persist the text the server holds for a document the session `clientId` has open, without writing a model. */
75
+ export type TransferPersistDocumentArgs = Omit<TransferUpdateDocumentArgs<never>, 'model' | 'restore'>;
76
+ /** Delete a document the session `clientId` has open: its file, then the document. */
77
+ export type TransferDeleteDocumentArgs = Omit<TransferUpdateDocumentArgs<never>, 'model' | 'restore'>;
78
+ /** Register a client session on the connection. */
79
+ export interface CreateSessionArgs {
80
+ /** The session's id, minted by the client; unique in the server process while the session is live. */
81
+ clientId: string;
82
+ /** What the participant is; kept as the server session's `label`. */
83
+ label?: string;
84
+ /**
85
+ * A token the client keeps for the session's lifetime. It is no secret: the
86
+ * wire carries no authentication. A later `createSession` for the same id
87
+ * carrying the same token, from any connection, ends the session it names
88
+ * and registers the id afresh, so a client whose connection dropped before
89
+ * the server noticed can register again. Without it the id stays refused
90
+ * until the server notices.
91
+ */
92
+ resumeToken?: string;
93
+ }
94
+ /** End a client session registered on the connection. */
95
+ export interface CloseSessionArgs {
96
+ clientId: string;
97
+ }
98
+ /** Create a document that exists nowhere yet, open for the session creating it. */
99
+ export interface CreateModelDocumentArgs {
100
+ uri: string;
101
+ /** The id of a live session registered on this connection. */
102
+ clientId: string;
103
+ /** The document's initial content; it reaches disk with the first save. */
104
+ text: string;
105
+ }
106
+ /**
107
+ * Write several documents a session has open, all or none. `clientId` is on
108
+ * the set rather than on each update: an id per update would allow a set
109
+ * mixing clients, which the server would have to refuse.
110
+ */
111
+ export interface TransferUpdateDocumentsArgs<TTransfer> {
112
+ /** The id of a live session registered on this connection. */
113
+ clientId: string;
114
+ /**
115
+ * One entry per document: a set naming one twice, by any spellings that
116
+ * share its canonical URI, is refused.
117
+ */
118
+ updates: Omit<TransferUpdateDocumentArgs<TTransfer>, 'clientId'>[];
119
+ }
48
120
  /**
49
121
  * Identifies a per-document watch on the data server. Shared by both
50
122
  * `watchModelDocument` and `unwatchModelDocument` — the `(uri, clientId)`
51
123
  * pair is the watch key, so unwatching names the same watch that was
52
124
  * 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
125
+ * on the document writes (`TransferUpdateDocumentArgs.clientId`,
126
+ * `TransferSaveDocumentArgs.clientId`): it keys the per-`(uri, clientId)`
127
+ * watch bucket so multiple watchers on the same wire stay distinct, AND it lets
56
128
  * each watcher recognise its own echo on inbound `onDocumentUpdated` events
57
129
  * (the wire shape's `sourceClientId` carries the originating mutation's
58
130
  * `clientId`).
59
131
  */
60
132
  export interface WatchModelDocumentArgs {
133
+ /** Any spelling that the document URI policy maps to the document. */
61
134
  uri: string;
62
135
  /** Stable identifier for the watching client. */
63
136
  clientId: string;
@@ -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,0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AC,CAAC;AAEvG,sFAAsF;AACtF,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAAC,0BAA0B,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC,CAAC;AAEtG,mDAAmD;AACnD,MAAM,WAAW,iBAAiB;IAC/B,sGAAsG;IACtG,QAAQ,EAAE,MAAM,CAAC;IACjB,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,yDAAyD;AACzD,MAAM,WAAW,gBAAgB;IAC9B,QAAQ,EAAE,MAAM,CAAC;CACnB;AAED,mFAAmF;AACnF,MAAM,WAAW,uBAAuB;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,MAAM,WAAW,2BAA2B,CAAC,SAAS;IACnD,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,OAAO,EAAE,IAAI,CAAC,0BAA0B,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,EAAE,CAAC;CACrE;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,sBAAsB;IACpC,sEAAsE;IACtE,GAAG,EAAE,MAAM,CAAC;IACZ,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;CACnB"}
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
- import { type Clock } from './clock';
9
+ import { type Clock, type Stopwatch } from './clock';
10
10
  import { ObservableValue, type MaybeObservableValue } from './observable-value';
11
11
  import { type Disposable } from './util';
12
12
  /** Construction options for {@link Debouncer}. */
@@ -49,11 +49,13 @@ export interface DebouncerOptions {
49
49
  export declare class Debouncer implements Disposable {
50
50
  protected readonly clock: Clock;
51
51
  protected readonly fn: () => void;
52
+ /** {@link DebouncerOptions.delayMs}, read at each {@link schedule}. An armed timer keeps the delay it was armed with. */
52
53
  protected readonly delay: ObservableValue<number>;
54
+ /** {@link DebouncerOptions.maxWaitMs}, fixed at construction unlike {@link delay}. */
53
55
  protected readonly maxWaitMs?: number;
54
56
  protected timer?: Disposable;
55
- /** Virtual time of the first {@link schedule} of the current pending window; drives {@link DebouncerOptions.maxWaitMs}. */
56
- protected firstScheduledAt?: number;
57
+ /** Running since the first {@link schedule} of the current pending window; drives {@link DebouncerOptions.maxWaitMs}. */
58
+ protected sinceFirstSchedule?: Stopwatch;
57
59
  constructor(clock: Clock, fn: () => void, options: DebouncerOptions);
58
60
  /** True while a fire is armed (scheduled, not yet fired or cancelled). */
59
61
  get pending(): boolean;
@@ -64,12 +66,13 @@ export declare class Debouncer implements Disposable {
64
66
  * elapses since the first pending call.
65
67
  */
66
68
  schedule(): void;
67
- /** If a fire is pending, run {@link fn} now and clear the window; otherwise a no-op. */
69
+ /** Run {@link fn} now if a fire is pending, clearing the window first, and do nothing otherwise. */
68
70
  flush(): void;
69
71
  /** Drop a pending fire without running {@link fn}. */
70
72
  cancel(): void;
71
73
  /** Cancel any pending fire and release. */
72
74
  dispose(): void;
75
+ /** Clears the window before it runs {@link fn}, so a {@link schedule} from inside `fn` opens a new one. */
73
76
  protected fire(): void;
74
77
  }
75
78
  //# sourceMappingURL=debouncer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"debouncer.d.ts","sourceRoot":"","sources":["../src/debouncer.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEzC,kDAAkD;AAClD,MAAM,WAAW,gBAAgB;IAC9B;;;;;;OAMG;IAC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;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAC/C;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,SAAU,YAAW,UAAU;IAUtC,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK;IAC/B,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,IAAI;IAVpC,yHAAyH;IACzH,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAClD,sFAAsF;IACtF,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IACtC,SAAS,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAC7B,yHAAyH;IACzH,SAAS,CAAC,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAEzC,YACsB,KAAK,EAAE,KAAK,EACZ,EAAE,EAAE,MAAM,IAAI,EACjC,OAAO,EAAE,gBAAgB,EAI3B;IAED,0EAA0E;IAC1E,IAAI,OAAO,IAAI,OAAO,CAErB;IAED;;;;;OAKG;IACH,QAAQ,IAAI,IAAI,CASf;IAED,oGAAoG;IACpG,KAAK,IAAI,IAAI,CAIZ;IAED,sDAAsD;IACtD,MAAM,IAAI,IAAI,CAIb;IAED,2CAA2C;IAC3C,OAAO,IAAI,IAAI,CAEd;IAED,2GAA2G;IAC3G,SAAS,CAAC,IAAI,IAAI,IAAI,CAKrB;CACH"}
package/lib/debouncer.js CHANGED
@@ -30,11 +30,13 @@ const observable_value_1 = require("./observable-value");
30
30
  class Debouncer {
31
31
  clock;
32
32
  fn;
33
+ /** {@link DebouncerOptions.delayMs}, read at each {@link schedule}. An armed timer keeps the delay it was armed with. */
33
34
  delay;
35
+ /** {@link DebouncerOptions.maxWaitMs}, fixed at construction unlike {@link delay}. */
34
36
  maxWaitMs;
35
37
  timer;
36
- /** Virtual time of the first {@link schedule} of the current pending window; drives {@link DebouncerOptions.maxWaitMs}. */
37
- firstScheduledAt;
38
+ /** Running since the first {@link schedule} of the current pending window; drives {@link DebouncerOptions.maxWaitMs}. */
39
+ sinceFirstSchedule;
38
40
  constructor(clock, fn, options) {
39
41
  this.clock = clock;
40
42
  this.fn = fn;
@@ -52,19 +54,16 @@ class Debouncer {
52
54
  * elapses since the first pending call.
53
55
  */
54
56
  schedule() {
55
- const now = this.clock.now();
56
- if (this.firstScheduledAt === undefined) {
57
- this.firstScheduledAt = now;
58
- }
57
+ this.sinceFirstSchedule ??= this.clock.stopwatch();
59
58
  let wait = Math.max(0, this.delay.value);
60
59
  if (this.maxWaitMs !== undefined) {
61
- const untilCeiling = this.firstScheduledAt + this.maxWaitMs - now;
60
+ const untilCeiling = this.maxWaitMs - this.sinceFirstSchedule.elapsedMs;
62
61
  wait = Math.min(wait, Math.max(0, untilCeiling));
63
62
  }
64
63
  this.timer?.dispose();
65
64
  this.timer = this.clock.setTimer(() => this.fire(), wait);
66
65
  }
67
- /** If a fire is pending, run {@link fn} now and clear the window; otherwise a no-op. */
66
+ /** Run {@link fn} now if a fire is pending, clearing the window first, and do nothing otherwise. */
68
67
  flush() {
69
68
  if (this.timer !== undefined) {
70
69
  this.fire();
@@ -74,16 +73,17 @@ class Debouncer {
74
73
  cancel() {
75
74
  this.timer?.dispose();
76
75
  this.timer = undefined;
77
- this.firstScheduledAt = undefined;
76
+ this.sinceFirstSchedule = undefined;
78
77
  }
79
78
  /** Cancel any pending fire and release. */
80
79
  dispose() {
81
80
  this.cancel();
82
81
  }
82
+ /** Clears the window before it runs {@link fn}, so a {@link schedule} from inside `fn` opens a new one. */
83
83
  fire() {
84
84
  this.timer?.dispose();
85
85
  this.timer = undefined;
86
- this.firstScheduledAt = undefined;
86
+ this.sinceFirstSchedule = undefined;
87
87
  this.fn();
88
88
  }
89
89
  }
@@ -1 +1 @@
1
- {"version":3,"file":"debouncer.js","sour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,KAAK,GAAG,SAAS,CAAC;QACvB,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;QACpC,IAAI,CAAC,EAAE,EAAE,CAAC;IACb,CAAC;CACH"}
package/lib/errors.d.ts CHANGED
@@ -8,55 +8,80 @@
8
8
  ********************************************************************************/
9
9
  import { ResponseError } from 'vscode-jsonrpc';
10
10
  import { type HydraniumMessageData } from './messages/primitives';
11
+ import { type ModelVersion, type TextVersion } from './model-service/base-version';
11
12
  /**
12
- * The catalogue declaration behind {@link ConflictError}'s sentence.
13
+ * The catalogue declaration behind {@link ConflictError}'s sentence. It words
14
+ * the version mismatch rather than stating it: the two numbers mean nothing to
15
+ * an end user, and they stay in {@link ConflictErrorData}.
16
+ */
17
+ export declare const STALE_BASE_VERSION_UPDATE: import("./messages/primitives").MessageDefinition<"The edit to {uri} was not applied: it was made to an older version of the document.">;
18
+ /**
19
+ * {@link STALE_BASE_VERSION_UPDATE}'s counterpart for an editor's save the
20
+ * server refused, since the editor's buffer is not the text it holds.
21
+ */
22
+ export declare const STALE_BASE_VERSION_SAVE: import("./messages/primitives").MessageDefinition<"The save of {uri} was not applied: it was made to an older version of the document.">;
23
+ /**
24
+ * Every JSON-RPC error code the framework raises, from any package, keyed by
25
+ * the error it identifies.
13
26
  *
14
- * Its English must keep containing {@link CONFLICT_ERROR_MESSAGE_MARKER}: the
15
- * marker is tier 3 of {@link isConflictError}'s ladder, and it matches on text.
16
- * That tier only ever works untranslated, which is why it is the last resort
17
- * behind the numeric code rather than the primary check.
27
+ * The framework reserves the block 42000 to 42999 for these, and an adopter's
28
+ * own codes stay outside it: after an RPC the proxy revives an error by its
29
+ * code, so an adopter's error carrying one of these can read as the
30
+ * framework's. A new code takes the next unused number in the block, whichever
31
+ * package raises it, and is declared here, where tests hold every code distinct
32
+ * and inside the block.
33
+ * The block sits clear of the range JSON-RPC 2.0 reserves for itself, -32768
34
+ * to -32000.
18
35
  */
19
- export declare const STALE_BASED_UPDATE: import("./messages/primitives").MessageDefinition<"Stale-based update for {uri}: expected v{expected}, server is at v{actual}">;
36
+ export declare const HYDRANIUM_ERROR_CODES: {
37
+ readonly conflict: 42001;
38
+ readonly noActiveProfile: 42002;
39
+ readonly referenceSettleTimeout: 42003;
40
+ readonly sessionClosed: 42004;
41
+ readonly documentNotOpen: 42005;
42
+ readonly duplicateClientId: 42006;
43
+ readonly reservedClientId: 42007;
44
+ readonly saveFailed: 42008;
45
+ readonly documentSyntaxError: 42009;
46
+ };
20
47
  /**
21
- * Application-specific JSON-RPC error code for {@link ConflictError}.
22
- * Outside the reserved range (-32768 .. -32000) per JSON-RPC 2.0.
48
+ * JSON-RPC error code for {@link ConflictError}.
23
49
  *
24
50
  * The code is the load-bearing identifier across realm boundaries —
25
51
  * `code` is a first-class field on the JSON-RPC error envelope and
26
52
  * survives wire reconstruction; the custom `Error` subclass name does
27
53
  * not.
28
54
  */
29
- export declare const CONFLICT_ERROR_CODE = 1001;
30
- /**
31
- * Structured payload carried in {@link ConflictError.data}, and the only place
32
- * a post-RPC caller can read the version mismatch from.
33
- */
55
+ export declare const CONFLICT_ERROR_CODE: 42001;
56
+ /** Structured payload carried in {@link ConflictError.data}. */
34
57
  export interface ConflictErrorData extends HydraniumMessageData {
58
+ /**
59
+ * The document whose version moved. A write of several documents names
60
+ * the first stale one in request order, and others may be stale too.
61
+ */
35
62
  readonly uri: string;
36
- /** The based-on version the caller authored against. */
37
- readonly expected: number;
63
+ /** The base version the caller authored against. */
64
+ readonly baseVersion: ModelVersion;
38
65
  /** The server's current text-document version at the time of the throw. */
39
- readonly actual: number;
66
+ readonly actualVersion: TextVersion;
40
67
  }
41
68
  /**
42
- * Thrown by `ModelService.update` / `ModelService.save` when the caller-
43
- * supplied based-on version no longer matches the server's current text-
69
+ * Thrown by a client session's `update` / `save` when the caller-
70
+ * supplied base version no longer matches the server's current text-
44
71
  * document version for the same URI — i.e. the snapshot the caller
45
72
  * authored against has been superseded by an intervening edit.
46
73
  *
47
74
  * Extends vscode-jsonrpc's {@link ResponseError} so the typed
48
75
  * {@link ConflictErrorData} payload rides on the standard JSON-RPC
49
76
  * error envelope (`code`, `message`, `data`) — all three fields are
50
- * preserved by RPC reconstruction. Adopters that catch the error on
51
- * the receiving side of an RPC call read the version mismatch from
52
- * `err.data` (the instance is reconstructed as a generic
53
- * `ResponseError`, so subclass getters / fields do not survive).
77
+ * preserved by RPC reconstruction. `createRpcProxy` revives it into
78
+ * this class on the receiving side; a path that does not leaves a
79
+ * plain `ResponseError`, readable through `err.data` only and refused
80
+ * by {@link isConflictError}.
54
81
  *
55
- * Detection is opt-in via the optional `baseVersion` field on
56
- * `TransferUpdateArgs` / `TransferSaveArgs`; callers that omit the field get
57
- * no gating. This mirrors LSP's `OptionalVersionedTextDocumentIdentifier`
58
- * posture, so headless / CLI / batch tooling with no meaningful based-on
59
- * version can opt out explicitly.
82
+ * Detection is driven by the required `baseVersion` field of every write
83
+ * request; a caller with no meaningful base version passes
84
+ * `'any'` and gets no gating.
60
85
  *
61
86
  * Three reasonable adopter recovery strategies:
62
87
  *
@@ -70,25 +95,202 @@ export interface ConflictErrorData extends HydraniumMessageData {
70
95
  * No auto-retry or auto-merge ships by default.
71
96
  */
72
97
  export declare class ConflictError extends ResponseError<ConflictErrorData> {
73
- constructor(uri: string, expected: number, actual: number);
98
+ /** `message` words what was refused: an edit, or with {@link STALE_BASE_VERSION_SAVE} a save. */
99
+ constructor(uri: string, baseVersion: ModelVersion, actualVersion: TextVersion, message?: typeof STALE_BASE_VERSION_UPDATE | typeof STALE_BASE_VERSION_SAVE);
100
+ /** The document whose version moved, see {@link ConflictErrorData.uri}. */
101
+ get uri(): string;
102
+ /**
103
+ * The base version the caller authored against. Not `expected`, and its
104
+ * sibling not `actual`: a test reporter reads that pair as an assertion
105
+ * failure and reports nothing of the real one.
106
+ */
107
+ get baseVersion(): ModelVersion;
108
+ /** The server's version at the time of the throw. Not `actual`, see {@link baseVersion}. */
109
+ get actualVersion(): TextVersion;
110
+ }
111
+ /**
112
+ * JSON-RPC code for {@link SessionClosedError}, beside {@link CONFLICT_ERROR_CODE}
113
+ * and for the same reason: the code survives reconstruction, the class does not.
114
+ */
115
+ export declare const SESSION_CLOSED_ERROR_CODE: 42004;
116
+ /** JSON-RPC code for {@link DocumentNotOpenError}. */
117
+ export declare const DOCUMENT_NOT_OPEN_ERROR_CODE: 42005;
118
+ /** JSON-RPC code for {@link DuplicateClientIdError}. */
119
+ export declare const DUPLICATE_CLIENT_ID_ERROR_CODE: 42006;
120
+ /** JSON-RPC code for {@link ReservedClientIdError}. */
121
+ export declare const RESERVED_CLIENT_ID_ERROR_CODE: 42007;
122
+ /** JSON-RPC code for {@link SaveFailedError}. */
123
+ export declare const SAVE_FAILED_ERROR_CODE: 42008;
124
+ /** JSON-RPC code for {@link DocumentSyntaxError}. */
125
+ export declare const DOCUMENT_SYNTAX_ERROR_CODE: 42009;
126
+ /**
127
+ * The catalogue declaration behind {@link SessionClosedError}'s default
128
+ * sentence. It names no client id: the sentence can reach an end user, and the
129
+ * id stays in {@link SessionClosedErrorData.clientId} for whoever needs it.
130
+ */
131
+ export declare const SESSION_CLOSED: import("./messages/primitives").MessageDefinition<"The editing session has ended.">;
132
+ /** Structured payload carried in {@link SessionClosedError.data}. */
133
+ export interface SessionClosedErrorData extends HydraniumMessageData {
134
+ readonly clientId: string;
135
+ }
136
+ /**
137
+ * Thrown by every call on a client session after it ended, and by an open that
138
+ * was still in flight when its session ended: by the server for its sessions,
139
+ * and by a client-side `DataSession` once disposed, so a caller handles both
140
+ * the same way. A caller recognises it with {@link isSessionClosedError}, never
141
+ * by its sentence.
142
+ */
143
+ export declare class SessionClosedError extends ResponseError<SessionClosedErrorData> {
144
+ /**
145
+ * `message` replaces the default English, for a caller that knows more than
146
+ * that the session is gone. The identity stays {@link SESSION_CLOSED}'s, so a
147
+ * translating renderer renders the catalogue sentence in its place.
148
+ */
149
+ constructor(clientId: string, message?: string);
150
+ get clientId(): string;
151
+ }
152
+ /**
153
+ * The catalogue declaration behind {@link DocumentNotOpenError}'s sentence. The
154
+ * client id stays in {@link DocumentNotOpenErrorData.clientId}.
155
+ */
156
+ export declare const DOCUMENT_NOT_OPEN: import("./messages/primitives").MessageDefinition<"The document {uri} is not open in this editing session.">;
157
+ /** Structured payload carried in {@link DocumentNotOpenError.data}. */
158
+ export interface DocumentNotOpenErrorData extends HydraniumMessageData {
159
+ readonly uri: string;
160
+ readonly clientId: string;
161
+ }
162
+ /**
163
+ * Thrown when a client session writes a document it does not have open.
164
+ *
165
+ * A session writes only what it has open, so this is the answer both to a write
166
+ * that never opened and to one whose open was closed underneath it — by the
167
+ * session itself, or by the document being deleted.
168
+ */
169
+ export declare class DocumentNotOpenError extends ResponseError<DocumentNotOpenErrorData> {
170
+ constructor(uri: string, clientId: string);
74
171
  get uri(): string;
75
- get expected(): number;
76
- get actual(): number;
172
+ get clientId(): string;
173
+ }
174
+ /**
175
+ * The catalogue declaration behind {@link DuplicateClientIdError}'s sentence.
176
+ * The client id stays in {@link DuplicateClientIdErrorData.clientId}.
177
+ */
178
+ export declare const DUPLICATE_CLIENT_ID: import("./messages/primitives").MessageDefinition<"Could not start an editing session: its identifier is still in use by another editor.">;
179
+ /** Structured payload carried in {@link DuplicateClientIdError.data}. */
180
+ export interface DuplicateClientIdErrorData extends HydraniumMessageData {
181
+ readonly clientId: string;
77
182
  }
78
183
  /**
79
- * Type guard for {@link ConflictError}. Detection ladder:
184
+ * Thrown when a client session is started under an id that is already live in
185
+ * the process. The id frees up once its holder ends or closes its last
186
+ * document, so a caller may retry.
80
187
  *
81
- * 1. `error.name === 'ConflictError'` — direct in-process throw, no
82
- * RPC round-trip.
83
- * 2. `(error as ResponseError).code === CONFLICT_ERROR_CODE` — the
84
- * canonical wire-side check; the JSON-RPC `code` field is preserved
85
- * across reconstruction, so any adopter catching after an RPC call
86
- * hits this branch.
87
- * 3. `error.message.includes('Stale-based update for ')` — fallback
88
- * for transports that re-wrap the message and drop the code (rare).
188
+ * Ids are unique process-wide because the id is also the author label on every
189
+ * version and the key a client recognises its own echoes by; two participants
190
+ * sharing one would each take the other's writes for their own.
191
+ */
192
+ export declare class DuplicateClientIdError extends ResponseError<DuplicateClientIdErrorData> {
193
+ constructor(clientId: string);
194
+ get clientId(): string;
195
+ }
196
+ /**
197
+ * Thrown when a client session is started under an id the framework reserves
198
+ * for one of its own participants. A reserved id never frees up, so a caller
199
+ * that retries on {@link DuplicateClientIdError} stops on this one.
89
200
  *
90
- * `instanceof ConflictError` alone would silently return `false` on the
91
- * reconstructed shape, so callers do not use it.
201
+ * It carries no message identity: a host that picks a reserved id has a bug,
202
+ * and no sentence addressed to an end user is true for it.
203
+ */
204
+ export declare class ReservedClientIdError extends ResponseError<{
205
+ readonly clientId: string;
206
+ }> {
207
+ constructor(clientId: string);
208
+ get clientId(): string;
209
+ }
210
+ /**
211
+ * The catalogue declaration behind {@link SaveFailedError}'s message. Its
212
+ * `failures` names each document with the writer's own reason, which stays as
213
+ * written.
214
+ */
215
+ export declare const SAVE_FAILED: import("./messages/primitives").MessageDefinition<"Could not save {failures}.">;
216
+ /** One document a save could not write, and why. */
217
+ export interface SaveFailure {
218
+ readonly uri: string;
219
+ readonly reason: string;
220
+ }
221
+ /** Structured payload carried in {@link SaveFailedError.data}. */
222
+ export interface SaveFailedErrorData extends HydraniumMessageData {
223
+ readonly failures: readonly SaveFailure[];
224
+ }
225
+ /**
226
+ * Thrown by a save that could not write one or more of its documents. A save
227
+ * of several documents writes the others, so the files on disk can be a mix
228
+ * until a later save succeeds.
229
+ */
230
+ export declare class SaveFailedError extends ResponseError<SaveFailedErrorData> {
231
+ constructor(failures: readonly SaveFailure[]);
232
+ get failures(): readonly SaveFailure[];
233
+ }
234
+ /** The catalogue declaration behind {@link DocumentSyntaxError}'s sentence. */
235
+ export declare const DOCUMENT_SYNTAX_ERROR: import("./messages/primitives").MessageDefinition<"The edit to {uri} was not applied: the document has a syntax error. Fix it in the text first.">;
236
+ /** Structured payload carried in {@link DocumentSyntaxError.data}. */
237
+ export interface DocumentSyntaxErrorData extends HydraniumMessageData {
238
+ readonly uri: string;
239
+ }
240
+ /**
241
+ * Thrown when a write would serialize a model over text that does not parse.
242
+ * A model read from a build with lexer or parser errors lacks what the parser
243
+ * skipped, so writing it would delete that text. A client session refuses a
244
+ * model write while the document's last build has such errors and its text
245
+ * is not blank, unless the write is a `restore`. A diagram refuses an edit,
246
+ * undo or redo that would write such a document, or whose merge or collision
247
+ * reads one. A client's write of text is not refused, since that is how the
248
+ * text is repaired.
249
+ */
250
+ export declare class DocumentSyntaxError extends ResponseError<DocumentSyntaxErrorData> {
251
+ constructor(uri: string);
252
+ get uri(): string;
253
+ }
254
+ /**
255
+ * Whether `error` is a `ResponseError` from any copy of `vscode-jsonrpc`. An
256
+ * install holds several copies, and `instanceof` recognises only its own. An
257
+ * error that merely carries an integer `code` has no `toJson`, and is not one.
258
+ */
259
+ export declare function isResponseError(error: unknown): error is ResponseError<unknown>;
260
+ /**
261
+ * `error` as an instance of the typed error class its code names, with its
262
+ * message, data and stack kept, or `error` itself when its code names none or
263
+ * its data lacks the fields that class reads.
264
+ * An RPC reconstructs every rejection as a plain `ResponseError`, which has
265
+ * none of the class getters.
266
+ */
267
+ export declare function reviveProtocolError(error: unknown): unknown;
268
+ /**
269
+ * The error the JSON text `json` describes, as `JSON.stringify(error.toJson())`
270
+ * writes it, revived to its typed class as {@link reviveProtocolError} does, or
271
+ * `undefined` when `json` is not a JSON-RPC error envelope. For a transport
272
+ * that carries the error as text, such as a GLSP `RejectAction`'s `detail`.
273
+ */
274
+ export declare function reviveProtocolErrorJson(json: string): ResponseError<unknown> | undefined;
275
+ /**
276
+ * Whether `error` is a {@link SessionClosedError} whose getters read valid
277
+ * fields: one thrown, or one {@link reviveProtocolError revived}, from any
278
+ * copy of this package, or a subclass. A bare `ResponseError` is not one,
279
+ * whatever its name and fields, since it lacks the class's brand.
280
+ * `createRpcProxy` revives every rejection, so only a caller on a connection
281
+ * of its own needs to revive first. Each guard below works the same way.
92
282
  */
283
+ export declare function isSessionClosedError(error: unknown): error is SessionClosedError;
284
+ /** Whether `error` is a {@link DocumentNotOpenError}. See {@link isSessionClosedError}. */
285
+ export declare function isDocumentNotOpenError(error: unknown): error is DocumentNotOpenError;
286
+ /** Whether `error` is a {@link DuplicateClientIdError}. See {@link isSessionClosedError}. */
287
+ export declare function isDuplicateClientIdError(error: unknown): error is DuplicateClientIdError;
288
+ /** Whether `error` is a {@link ReservedClientIdError}. See {@link isSessionClosedError}. */
289
+ export declare function isReservedClientIdError(error: unknown): error is ReservedClientIdError;
290
+ /** Whether `error` is a {@link SaveFailedError}. See {@link isSessionClosedError}. */
291
+ export declare function isSaveFailedError(error: unknown): error is SaveFailedError;
292
+ /** Whether `error` is a {@link DocumentSyntaxError}. See {@link isSessionClosedError}. */
293
+ export declare function isDocumentSyntaxError(error: unknown): error is DocumentSyntaxError;
294
+ /** Whether `error` is a {@link ConflictError}. See {@link isSessionClosedError}. */
93
295
  export declare function isConflictError(error: unknown): error is ConflictError;
94
296
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAiB,KAAK,oBAAoB,EAAe,MAAM,uBAAuB,CAAC;AAE9F;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,iIAG9B,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,OAAO,CAAC;AAExC;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,oBAAoB;IAC5D,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,2EAA2E;IAC3E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;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