@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
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2026 CrossBreeze, EclipseSource and others.
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the MIT License which is available in the project root.
7
+ *
8
+ * SPDX-License-Identifier: MIT
9
+ ********************************************************************************/
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.FRAMEWORK_CLIENT_IDS = exports.DOCUMENT_RELEASE_CLIENT_ID = exports.UNKNOWN_CLIENT_ID = exports.LANGUAGE_CLIENT_ID = void 0;
12
+ /**
13
+ * Well-known values of the wire's `clientId` / `sourceClientId` field.
14
+ *
15
+ * The framework tracks each document as belonging to one or more "clients" —
16
+ * typically an LSP-text client (Monaco, VS Code, …), a GLSP diagram client,
17
+ * and/or a structured-form client — and keys its holds and watches per
18
+ * `(uri, clientId)`. These three values are not real participants, so a client
19
+ * minting its own id must avoid them.
20
+ *
21
+ * **Here rather than in the server package, because the side that has to
22
+ * RECOGNISE them is the client.** An inbound `onDocumentUpdated` carries
23
+ * `sourceClientId`, and a consumer deciding what to do with it is asking which
24
+ * of these it is — so a frontend would otherwise have to depend on the server
25
+ * tier to name three strings, and in practice retypes the literal instead.
26
+ */
27
+ /** Identifier for an LSP-text client (Monaco, VS Code, …). */
28
+ exports.LANGUAGE_CLIENT_ID = 'language-client';
29
+ /**
30
+ * The id an event names when no single client is behind it: the source of a
31
+ * `'rebuilt'` event, a document no client authored, or a build with more than
32
+ * one cause.
33
+ */
34
+ exports.UNKNOWN_CLIENT_ID = 'unknown';
35
+ /**
36
+ * Synthetic author id on the `onDocumentUpdated` broadcast a data-server
37
+ * emits for the build that follows a document's release, once no client holds
38
+ * it; by default that build reverts the document to its disk content,
39
+ * discarding unsaved edits. Not a real client: it lets consumers tell the
40
+ * release broadcast from client-authored updates.
41
+ */
42
+ exports.DOCUMENT_RELEASE_CLIENT_ID = 'document-release';
43
+ /**
44
+ * Every id the framework reserves, for a client checking that the identity it
45
+ * is about to mint collides with none of them.
46
+ */
47
+ exports.FRAMEWORK_CLIENT_IDS = [exports.LANGUAGE_CLIENT_ID, exports.UNKNOWN_CLIENT_ID, exports.DOCUMENT_RELEASE_CLIENT_ID];
48
+ //# sourceMappingURL=client-ids.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-ids.js","sourceRoot":"","sources":["../src/client-ids.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAElF;;;;;;;;;;;;;;GAcG;AAEH,8DAA8D;AACjD,QAAA,kBAAkB,GAAG,iBAAiB,CAAC;AAEpD;;;;GAIG;AACU,QAAA,iBAAiB,GAAG,SAAS,CAAC;AAE3C;;;;;;GAMG;AACU,QAAA,0BAA0B,GAAG,kBAAkB,CAAC;AAE7D;;;GAGG;AACU,QAAA,oBAAoB,GAAsB,CAAC,QAAA,kBAAkB,EAAE,QAAA,iBAAiB,EAAE,QAAA,0BAA0B,CAAC,CAAC"}
package/lib/clock.d.ts CHANGED
@@ -12,9 +12,11 @@ import { Disposable } from './util';
12
12
  * there is no `start` — you create it at the moment timing begins.
13
13
  *
14
14
  * Backed by a monotonic source (`performance.now`), so it is sub-millisecond
15
- * precise and immune to wall-clock jumps (NTP/DST adjustments can make a
16
- * `Date.now` delta go backwards; a stopwatch cannot). Use this for durations
17
- * and {@link Clock.now} for "what time is it" (timestamps, TTLs).
15
+ * precise and immune to wall-clock steps (a time sync or a manual change can
16
+ * make a `Date.now` delta go backwards; a stopwatch cannot). In Node on Linux
17
+ * it also leaves out time the system spends suspended, so a duration spanning
18
+ * a suspend reads as the awake time only. Use this for every duration, a TTL
19
+ * included, and {@link Clock.now} for "what time is it".
18
20
  *
19
21
  * It holds no scheduled resource and is therefore NOT a {@link Disposable} —
20
22
  * the disposable thing is a {@link Clock.setTimer}. Reads are lazy, so a fake
@@ -42,16 +44,16 @@ export interface Stopwatch {
42
44
  * testable instead of waiting on real wall-clock. The {@link SystemClock}
43
45
  * default delegates to the platform; tests bind `makeFakeClock`.
44
46
  *
45
- * Two distinct readings on purpose: {@link now} is wall-clock (for timestamps
46
- * and TTLs that compare against a file's mtime), while {@link stopwatch}
47
- * measures durations off a monotonic source. They are different clocks; do not
48
- * subtract two {@link now} readings to measure a duration.
47
+ * Two distinct readings on purpose: {@link now} is wall-clock, for a
48
+ * timestamp, while {@link stopwatch} measures durations off a monotonic
49
+ * source. They are different clocks; do not subtract two {@link now} readings
50
+ * to measure a duration. Framework code reads time only through a `Clock`, so
51
+ * a platform workaround lives in one place.
49
52
  *
50
53
  * A cross-head contract, so it carries no platform or DI-framework coupling.
51
54
  *
52
- * Note: the runtime health monitors (event-loop, memory) intentionally keep
53
- * the real wall-clock rather than taking a `Clock` — faking the time they
54
- * measure would invert their meaning.
55
+ * Note: code that measures real CPU, heap or event-loop time never takes the
56
+ * bound `Clock`: faking the time it measures would invert its meaning.
55
57
  */
56
58
  export interface Clock {
57
59
  /** Current wall-clock time in milliseconds (the `Date.now` reading). */
@@ -73,7 +75,28 @@ export interface Clock {
73
75
  */
74
76
  measure<T>(callback: () => Promise<T>): Promise<Timed<T>>;
75
77
  measure<T>(callback: () => T): Timed<T>;
78
+ /**
79
+ * Settle with `promise`, or with {@link TIMED_OUT} once `ms` have elapsed
80
+ * first. A promise that rejects first rejects this one; one that rejects
81
+ * after the timer is ignored. The timer is disposed the moment `promise`
82
+ * settles, so a won race leaves nothing scheduled, but `promise` itself
83
+ * runs on: nothing here can cancel it.
84
+ *
85
+ * Unlike VS Code's `raceTimeout`, this settles with a sentinel rather than
86
+ * `undefined`, so a promise resolving to `undefined` is not taken for a
87
+ * timeout; the caller branches on the result instead of passing an
88
+ * `onTimeout`.
89
+ *
90
+ * A custom implementation extends {@link SystemClock}, whose race runs over
91
+ * the subclass's {@link setTimer}.
92
+ */
93
+ raceTimer<T>(promise: Promise<T>, ms: number): Promise<T | typeof TIMED_OUT>;
76
94
  }
95
+ /**
96
+ * What {@link Clock.raceTimer} settles with when its timer fires first.
97
+ * Registered under a global key, so two copies of this package agree on it.
98
+ */
99
+ export declare const TIMED_OUT: unique symbol;
77
100
  /**
78
101
  * The result of {@link Clock.measure}: a callback's return value paired with
79
102
  * its elapsed wall-time in milliseconds. A plain value object — no methods, no
@@ -100,6 +123,10 @@ export interface Timed<T> {
100
123
  * Default {@link Clock}: delegates to the platform's `Date.now`,
101
124
  * `performance.now`, and `setTimeout`/`clearTimeout`. Bound everywhere in
102
125
  * production; swapped for `makeFakeClock` in tests.
126
+ *
127
+ * {@link measure} and {@link raceTimer} run over {@link stopwatch} and
128
+ * {@link setTimer}, so a clock that extends this one and replaces those
129
+ * measures and races on its own time, as the test clock does.
103
130
  */
104
131
  export declare class SystemClock implements Clock {
105
132
  now(): number;
@@ -107,5 +134,18 @@ export declare class SystemClock implements Clock {
107
134
  stopwatch(): Stopwatch;
108
135
  measure<T>(callback: () => Promise<T>): Promise<Timed<T>>;
109
136
  measure<T>(callback: () => T): Timed<T>;
137
+ /**
138
+ * The timer settles the race one microtask after it fires. A real timer
139
+ * runs only once pending resolutions are delivered, while a fake one fires
140
+ * inside its `advance`, so settling at once would let a promise already
141
+ * resolved when `advance` runs lose to a timer it beats in production. The
142
+ * deferral covers only that promise: one that settles through further
143
+ * chained reactions, such as a `.then` chain, an async function or
144
+ * `Promise.allSettled`, can still lose to an `advance` in the same turn,
145
+ * while it wins on the platform's timer. The handlers go on `promise`
146
+ * before {@link setTimer} runs, so a `setTimer` that throws still leaves
147
+ * `promise` observed.
148
+ */
149
+ raceTimer<T>(promise: Promise<T>, ms: number): Promise<T | typeof TIMED_OUT>;
110
150
  }
111
151
  //# sourceMappingURL=clock.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"clock.d.ts","sourceRoot":"","sources":["../src/clock.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOk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,CAAC;CACpB;AAyCD;;;;;;;;GAQG;AACH,qBAAa,WAAY,YAAW,KAAK;IACtC,GAAG,IAAI,MAAM,CAEZ;IAED,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,EAAE,EAAE,MAAM,GAAG,UAAU,CAIrD;IAED,SAAS,IAAI,SAAS,CAErB;IAED,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1D,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAUxC;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,OAAO,SAAS,CAAC,CAgB3E;CACH"}
package/lib/clock.js CHANGED
@@ -8,8 +8,13 @@
8
8
  * SPDX-License-Identifier: MIT
9
9
  ********************************************************************************/
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.SystemClock = void 0;
11
+ exports.SystemClock = exports.TIMED_OUT = void 0;
12
12
  const util_1 = require("./util");
13
+ /**
14
+ * What {@link Clock.raceTimer} settles with when its timer fires first.
15
+ * Registered under a global key, so two copies of this package agree on it.
16
+ */
17
+ exports.TIMED_OUT = Symbol.for('hydranium/protocol/timed-out');
13
18
  class SystemStopwatch {
14
19
  start = performance.now();
15
20
  lastLap = this.start;
@@ -48,6 +53,10 @@ function unrefTimer(handle) {
48
53
  * Default {@link Clock}: delegates to the platform's `Date.now`,
49
54
  * `performance.now`, and `setTimeout`/`clearTimeout`. Bound everywhere in
50
55
  * production; swapped for `makeFakeClock` in tests.
56
+ *
57
+ * {@link measure} and {@link raceTimer} run over {@link stopwatch} and
58
+ * {@link setTimer}, so a clock that extends this one and replaces those
59
+ * measures and races on its own time, as the test clock does.
51
60
  */
52
61
  class SystemClock {
53
62
  now() {
@@ -69,6 +78,32 @@ class SystemClock {
69
78
  }
70
79
  return { result: result, elapsedMs: stopwatch.elapsedMs };
71
80
  }
81
+ /**
82
+ * The timer settles the race one microtask after it fires. A real timer
83
+ * runs only once pending resolutions are delivered, while a fake one fires
84
+ * inside its `advance`, so settling at once would let a promise already
85
+ * resolved when `advance` runs lose to a timer it beats in production. The
86
+ * deferral covers only that promise: one that settles through further
87
+ * chained reactions, such as a `.then` chain, an async function or
88
+ * `Promise.allSettled`, can still lose to an `advance` in the same turn,
89
+ * while it wins on the platform's timer. The handlers go on `promise`
90
+ * before {@link setTimer} runs, so a `setTimer` that throws still leaves
91
+ * `promise` observed.
92
+ */
93
+ raceTimer(promise, ms) {
94
+ return new Promise((resolve, reject) => {
95
+ // eslint-disable-next-line prefer-const -- with a `const`, a `setTimer` that throws leaves it uninitialised, and the handlers' later read of it is an unhandled ReferenceError
96
+ let timer;
97
+ promise.then(value => {
98
+ timer?.dispose();
99
+ resolve(value);
100
+ }, (err) => {
101
+ timer?.dispose();
102
+ reject(err);
103
+ });
104
+ timer = this.setTimer(() => void Promise.resolve().then(() => resolve(exports.TIMED_OUT)), ms);
105
+ });
106
+ }
72
107
  }
73
108
  exports.SystemClock = SystemClock;
74
109
  //# sourceMappingURL=clock.js.map
package/lib/clock.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"clock.js","sourceRoot":"","sources":["../src/clock.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAElF,iCAAoC;AA8FpC,MAAM,eAAe;IACC,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IACnC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC;IACrB,OAAO,CAAqB;IAEtC,IAAI,SAAS;QACV,OAAO,CAAC,IAAI,CAAC,OAAO,IAAI,WAAW,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC;IAC3D,C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KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,QAAA,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC1F,CAAC,CAAC,CAAC;IACN,CAAC;CACH"}
@@ -0,0 +1,23 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the MIT License which is available in the project root.
6
+ *
7
+ * SPDX-License-Identifier: MIT
8
+ ********************************************************************************/
9
+ import { AbstractLogger } from './abstract-logger';
10
+ import { type LogLevel, type Logger } from './logger';
11
+ /**
12
+ * {@link Logger} that writes each line to `console`, at the method matching its
13
+ * level: the framework's `[Label - time] [component]` prefix and the message,
14
+ * then any trailing arguments as they are, so a browser console can expand
15
+ * them. For a browser page, webview or extension host, which has no other sink
16
+ * to hand. On Node, `info` and `debug` reach stdout, so a process whose stdout
17
+ * carries a protocol stream must not use it.
18
+ */
19
+ export declare class ConsoleLogger extends AbstractLogger implements Logger {
20
+ protected emit(level: LogLevel, label: string, message: string, args: readonly unknown[]): void;
21
+ protected derive(component: string): this;
22
+ }
23
+ //# sourceMappingURL=console-logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"console-logger.d.ts","sourceRoot":"","sources":["../src/console-logger.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AAWtD;;;;;;;GAOG;AACH,qBAAa,aAAc,SAAQ,cAAe,YAAW,MAAM;IAChE,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,OAAO,EAAE,GAAG,IAAI,CAE9F;IAED,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAGxC;CACH"}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2026 EclipseSource and others.
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the MIT License which is available in the project root.
7
+ *
8
+ * SPDX-License-Identifier: MIT
9
+ ********************************************************************************/
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.ConsoleLogger = void 0;
12
+ const abstract_logger_1 = require("./abstract-logger");
13
+ /** `console.trace` prints a stack with every line, so `trace` goes out at `debug`. */
14
+ const CONSOLE_METHODS = {
15
+ error: 'error',
16
+ warn: 'warn',
17
+ info: 'info',
18
+ debug: 'debug',
19
+ trace: 'debug'
20
+ };
21
+ /**
22
+ * {@link Logger} that writes each line to `console`, at the method matching its
23
+ * level: the framework's `[Label - time] [component]` prefix and the message,
24
+ * then any trailing arguments as they are, so a browser console can expand
25
+ * them. For a browser page, webview or extension host, which has no other sink
26
+ * to hand. On Node, `info` and `debug` reach stdout, so a process whose stdout
27
+ * carries a protocol stream must not use it.
28
+ */
29
+ class ConsoleLogger extends abstract_logger_1.AbstractLogger {
30
+ emit(level, label, message, args) {
31
+ console[CONSOLE_METHODS[level]](`${this.formatLinePrefix(label)} ${message}`, ...args);
32
+ }
33
+ derive(component) {
34
+ const Subclass = this.constructor;
35
+ return new Subclass(component);
36
+ }
37
+ }
38
+ exports.ConsoleLogger = ConsoleLogger;
39
+ //# sourceMappingURL=console-logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"console-logger.js","sourceRoot":"","sources":["../src/console-logger.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAElF,uDAAmD;AAGnD,sFAAsF;AACtF,MAAM,eAAe,GAA0D;IAC5E,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;CAChB,CAAC;AAEF;;;;;;;GAOG;AACH,mBAA2B,SAAQ,gCAAc;IACpC,IAAI,CAAC,KAAe,EAAE,KAAa,EAAE,OAAe,EAAE,IAAwB;QACrF,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,IAAI,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;IAC1F,CAAC;IAES,MAAM,CAAC,SAAiB;QAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,WAA+C,CAAC;QACtE,OAAO,IAAI,QAAQ,CAAC,SAAS,CAAC,CAAC;IAClC,CAAC;CACH"}
@@ -7,7 +7,7 @@
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
9
  /** Request-method names on {@link DocumentServerProtocol}. */
10
- export declare const DOCUMENT_SERVER_PROTOCOL_METHODS: readonly ["openModelDocument", "closeModelDocument", "getModelDocument", "updateModelDocument", "saveModelDocument", "watchModelDocument", "unwatchModelDocument", "waitForReady"];
10
+ export declare const DOCUMENT_SERVER_PROTOCOL_METHODS: readonly ["createSession", "closeSession", "createModelDocument", "updateModelDocuments", "openModelDocument", "closeModelDocument", "getModelDocument", "updateModelDocument", "saveModelDocument", "persistModelDocument", "deleteModelDocument", "watchModelDocument", "unwatchModelDocument", "waitForReady"];
11
11
  /** Request-method names on {@link ProjectServerProtocol}. */
12
12
  export declare const PROJECT_SERVER_PROTOCOL_METHODS: readonly ["getProjects", "getProjectForUri"];
13
13
  /**
@@ -16,7 +16,7 @@ export declare const PROJECT_SERVER_PROTOCOL_METHODS: readonly ["getProjects", "
16
16
  * constraint makes the array typed against the interface — stale names (typos,
17
17
  * renamed methods) fail to typecheck.
18
18
  */
19
- export declare const DATA_SERVER_PROTOCOL_METHODS: readonly ["openModelDocument", "closeModelDocument", "getModelDocument", "updateModelDocument", "saveModelDocument", "watchModelDocument", "unwatchModelDocument", "waitForReady", "getProjects", "getProjectForUri"];
19
+ export declare const DATA_SERVER_PROTOCOL_METHODS: readonly ["createSession", "closeSession", "createModelDocument", "updateModelDocuments", "openModelDocument", "closeModelDocument", "getModelDocument", "updateModelDocument", "saveModelDocument", "persistModelDocument", "deleteModelDocument", "watchModelDocument", "unwatchModelDocument", "waitForReady", "getProjects", "getProjectForUri"];
20
20
  /**
21
21
  * Request-method names on {@link ReferenceServerProtocol}. NOT part of
22
22
  * {@link DATA_SERVER_PROTOCOL_METHODS} — adopters that compose the reference
@@ -25,7 +25,7 @@ export declare const DATA_SERVER_PROTOCOL_METHODS: readonly ["openModelDocument"
25
25
  */
26
26
  export declare const REFERENCE_SERVER_PROTOCOL_METHODS: readonly ["findReferenceCandidates", "resolveReference", "findNextName"];
27
27
  /** Notification-method names on {@link DocumentClientProtocol}. */
28
- export declare const DOCUMENT_CLIENT_PROTOCOL_METHODS: readonly ["onDocumentUpdated", "onDocumentSaved"];
28
+ export declare const DOCUMENT_CLIENT_PROTOCOL_METHODS: readonly ["onDocumentUpdated", "onDocumentSaved", "onDocumentDirtyChanged", "onDocumentDeleted", "onDocumentsBuilt"];
29
29
  /** Notification-method names on {@link ProjectClientProtocol}. */
30
30
  export declare const PROJECT_CLIENT_PROTOCOL_METHODS: readonly ["onProjectsChanged"];
31
31
  /**
@@ -35,5 +35,5 @@ export declare const PROJECT_CLIENT_PROTOCOL_METHODS: readonly ["onProjectsChang
35
35
  * data head's connection routes `<methodNamespace>onDocumentUpdated` etc. to
36
36
  * the bound client target.
37
37
  */
38
- export declare const DATA_CLIENT_PROTOCOL_METHODS: readonly ["onDocumentUpdated", "onDocumentSaved", "onProjectsChanged"];
38
+ export declare const DATA_CLIENT_PROTOCOL_METHODS: readonly ["onDocumentUpdated", "onDocumentSaved", "onDocumentDirtyChanged", "onDocumentDeleted", "onDocumentsBuilt", "onProjectsChanged"];
39
39
  //# sourceMappingURL=data-protocol-methods.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"data-protocol-methods.d.ts","sourceRoot":"","sources":["../../src/data/data-protocol-methods.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAalF,8DAA8D;AAC9D,eAAO,MAAM,gCAAgC,oLAS6C,CAAC;AAE3F,6DAA6D;AAC7D,eAAO,MAAM,+BAA+B,8CAE3C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,uNAG6C,CAAC;AAEvF;;;;;GAKG;AACH,eAAO,MAAM,iCAAiC,0EAI6C,CAAC;AAE5F,mEAAmE;AACnE,eAAO,MAAM,gCAAgC,mDAE5C,CAAC;AAEF,kEAAkE;AAClE,eAAO,MAAM,+BAA+B,gCAA+F,CAAC;AAE5I;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,wEAG6C,CAAC"}
1
+ {"version":3,"file":"data-protocol-methods.d.ts","sourceRoot":"","sources":["../../src/data/data-protocol-methods.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAalF,8DAA8D;AAC9D,eAAO,MAAM,gCAAgC,mTAe6C,CAAC;AAE3F,6DAA6D;AAC7D,eAAO,MAAM,+BAA+B,8CAE3C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,sVAG6C,CAAC;AAEvF;;;;;GAKG;AACH,eAAO,MAAM,iCAAiC,0EAI4B,CAAC;AAE3E,mEAAmE;AACnE,eAAO,MAAM,gCAAgC,sHAM6C,CAAC;AAE3F,kEAAkE;AAClE,eAAO,MAAM,+BAA+B,gCAA+F,CAAC;AAE5I;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,2IAG6C,CAAC"}
@@ -11,11 +11,17 @@ 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',
17
21
  'updateModelDocument',
18
22
  'saveModelDocument',
23
+ 'persistModelDocument',
24
+ 'deleteModelDocument',
19
25
  'watchModelDocument',
20
26
  'unwatchModelDocument',
21
27
  'waitForReady'
@@ -44,7 +50,13 @@ exports.REFERENCE_SERVER_PROTOCOL_METHODS = [
44
50
  'findNextName'
45
51
  ];
46
52
  /** Notification-method names on {@link DocumentClientProtocol}. */
47
- exports.DOCUMENT_CLIENT_PROTOCOL_METHODS = ['onDocumentUpdated', 'onDocumentSaved'];
53
+ exports.DOCUMENT_CLIENT_PROTOCOL_METHODS = [
54
+ 'onDocumentUpdated',
55
+ 'onDocumentSaved',
56
+ 'onDocumentDirtyChanged',
57
+ 'onDocumentDeleted',
58
+ 'onDocumentsBuilt'
59
+ ];
48
60
  /** Notification-method names on {@link ProjectClientProtocol}. */
49
61
  exports.PROJECT_CLIENT_PROTOCOL_METHODS = ['onProjectsChanged'];
50
62
  /**
@@ -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,sBAAsB;IACtB,qBAAqB;IACrB,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"}