@hydranium/protocol 1.0.0-next.14 → 1.0.0-next.140

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 (172) hide show
  1. package/README.md +35 -1
  2. package/lib/client/data-connection.d.ts +150 -0
  3. package/lib/client/data-connection.d.ts.map +1 -0
  4. package/lib/client/data-connection.js +211 -0
  5. package/lib/client/data-connection.js.map +1 -0
  6. package/lib/client/data-events.d.ts +13 -1
  7. package/lib/client/data-events.d.ts.map +1 -1
  8. package/lib/client/data-events.js +21 -0
  9. package/lib/client/data-events.js.map +1 -1
  10. package/lib/client/data-port.d.ts +17 -22
  11. package/lib/client/data-port.d.ts.map +1 -1
  12. package/lib/client/data-session.d.ts +301 -80
  13. package/lib/client/data-session.d.ts.map +1 -1
  14. package/lib/client/data-session.js +425 -107
  15. package/lib/client/data-session.js.map +1 -1
  16. package/lib/client/index.d.ts +13 -8
  17. package/lib/client/index.d.ts.map +1 -1
  18. package/lib/client/index.js +13 -8
  19. package/lib/client/index.js.map +1 -1
  20. package/lib/client/message-relay.d.ts +9 -3
  21. package/lib/client/message-relay.d.ts.map +1 -1
  22. package/lib/client/message-relay.js +11 -5
  23. package/lib/client/message-relay.js.map +1 -1
  24. package/lib/client/post-message-transport.d.ts +64 -3
  25. package/lib/client/post-message-transport.d.ts.map +1 -1
  26. package/lib/client/post-message-transport.js +175 -1
  27. package/lib/client/post-message-transport.js.map +1 -1
  28. package/lib/client/rpc-connection.d.ts +149 -0
  29. package/lib/client/rpc-connection.d.ts.map +1 -0
  30. package/lib/client/rpc-connection.js +179 -0
  31. package/lib/client/rpc-connection.js.map +1 -0
  32. package/lib/client-ids.d.ts +45 -0
  33. package/lib/client-ids.d.ts.map +1 -0
  34. package/lib/client-ids.js +48 -0
  35. package/lib/client-ids.js.map +1 -0
  36. package/lib/clock.d.ts +38 -0
  37. package/lib/clock.d.ts.map +1 -1
  38. package/lib/clock.js +36 -1
  39. package/lib/clock.js.map +1 -1
  40. package/lib/data/data-protocol-methods.d.ts +4 -4
  41. package/lib/data/data-protocol-methods.d.ts.map +1 -1
  42. package/lib/data/data-protocol-methods.js +11 -1
  43. package/lib/data/data-protocol-methods.js.map +1 -1
  44. package/lib/data/data-server-protocol.d.ts +111 -31
  45. package/lib/data/data-server-protocol.d.ts.map +1 -1
  46. package/lib/data/events.d.ts +103 -14
  47. package/lib/data/events.d.ts.map +1 -1
  48. package/lib/data/requests.d.ts +67 -11
  49. package/lib/data/requests.d.ts.map +1 -1
  50. package/lib/errors.d.ts +163 -17
  51. package/lib/errors.d.ts.map +1 -1
  52. package/lib/errors.js +219 -22
  53. package/lib/errors.js.map +1 -1
  54. package/lib/glsp-save-model-actions.d.ts +50 -0
  55. package/lib/glsp-save-model-actions.d.ts.map +1 -0
  56. package/lib/glsp-save-model-actions.js +28 -0
  57. package/lib/glsp-save-model-actions.js.map +1 -0
  58. package/lib/index.d.ts +3 -0
  59. package/lib/index.d.ts.map +1 -1
  60. package/lib/index.js +6 -0
  61. package/lib/index.js.map +1 -1
  62. package/lib/latency-collector.d.ts +8 -4
  63. package/lib/latency-collector.d.ts.map +1 -1
  64. package/lib/latency-collector.js.map +1 -1
  65. package/lib/messages/index.d.ts +29 -0
  66. package/lib/messages/index.d.ts.map +1 -0
  67. package/lib/messages/index.js +58 -0
  68. package/lib/messages/index.js.map +1 -0
  69. package/lib/messages/primitives.d.ts +188 -0
  70. package/lib/messages/primitives.d.ts.map +1 -0
  71. package/lib/messages/primitives.js +161 -0
  72. package/lib/messages/primitives.js.map +1 -0
  73. package/lib/model-server.d.ts +60 -13
  74. package/lib/model-server.d.ts.map +1 -1
  75. package/lib/model-server.js +4 -2
  76. package/lib/model-server.js.map +1 -1
  77. package/lib/model-service/based-on.d.ts +57 -0
  78. package/lib/model-service/based-on.d.ts.map +1 -0
  79. package/lib/model-service/based-on.js +37 -0
  80. package/lib/model-service/based-on.js.map +1 -0
  81. package/lib/model-service/index.d.ts +1 -1
  82. package/lib/model-service/index.d.ts.map +1 -1
  83. package/lib/model-service/index.js +4 -5
  84. package/lib/model-service/index.js.map +1 -1
  85. package/lib/patch-merge.d.ts +28 -27
  86. package/lib/patch-merge.d.ts.map +1 -1
  87. package/lib/patch-merge.js +66 -22
  88. package/lib/patch-merge.js.map +1 -1
  89. package/lib/profile-session.d.ts +8 -4
  90. package/lib/profile-session.d.ts.map +1 -1
  91. package/lib/profile-session.js.map +1 -1
  92. package/lib/rpc/bind-rpc-methods.d.ts +29 -3
  93. package/lib/rpc/bind-rpc-methods.d.ts.map +1 -1
  94. package/lib/rpc/bind-rpc-methods.js +22 -3
  95. package/lib/rpc/bind-rpc-methods.js.map +1 -1
  96. package/lib/rpc/create-rpc-proxy.d.ts +7 -0
  97. package/lib/rpc/create-rpc-proxy.d.ts.map +1 -1
  98. package/lib/rpc/create-rpc-proxy.js +6 -1
  99. package/lib/rpc/create-rpc-proxy.js.map +1 -1
  100. package/lib/testing/catalogue-audit.d.ts +80 -0
  101. package/lib/testing/catalogue-audit.d.ts.map +1 -0
  102. package/lib/testing/catalogue-audit.js +94 -0
  103. package/lib/testing/catalogue-audit.js.map +1 -0
  104. package/lib/testing/data-doubles.d.ts +13 -12
  105. package/lib/testing/data-doubles.d.ts.map +1 -1
  106. package/lib/testing/data-doubles.js +19 -5
  107. package/lib/testing/data-doubles.js.map +1 -1
  108. package/lib/testing/fake-clock.d.ts +9 -1
  109. package/lib/testing/fake-clock.d.ts.map +1 -1
  110. package/lib/testing/fake-clock.js +54 -45
  111. package/lib/testing/fake-clock.js.map +1 -1
  112. package/lib/testing/index.d.ts +1 -0
  113. package/lib/testing/index.d.ts.map +1 -1
  114. package/lib/testing/index.js +4 -1
  115. package/lib/testing/index.js.map +1 -1
  116. package/lib/testing/node/index.d.ts +1 -0
  117. package/lib/testing/node/index.d.ts.map +1 -1
  118. package/lib/testing/node/index.js +2 -2
  119. package/lib/testing/node/index.js.map +1 -1
  120. package/lib/testing/node/message-port-pair.d.ts +25 -0
  121. package/lib/testing/node/message-port-pair.d.ts.map +1 -0
  122. package/lib/testing/node/message-port-pair.js +26 -0
  123. package/lib/testing/node/message-port-pair.js.map +1 -0
  124. package/lib/transfer-diagnostic.d.ts +33 -0
  125. package/lib/transfer-diagnostic.d.ts.map +1 -1
  126. package/lib/transfer-diagnostic.js +23 -0
  127. package/lib/transfer-diagnostic.js.map +1 -1
  128. package/lib/transfer-document.d.ts +22 -5
  129. package/lib/transfer-document.d.ts.map +1 -1
  130. package/lib/transfer-document.js +14 -1
  131. package/lib/transfer-document.js.map +1 -1
  132. package/package.json +11 -2
  133. package/src/client/data-connection.ts +288 -0
  134. package/src/client/data-events.ts +33 -1
  135. package/src/client/data-port.ts +17 -23
  136. package/src/client/data-session.ts +549 -126
  137. package/src/client/index.ts +13 -8
  138. package/src/client/message-relay.ts +29 -7
  139. package/src/client/post-message-transport.ts +219 -4
  140. package/src/client/rpc-connection.ts +244 -0
  141. package/src/client-ids.ts +49 -0
  142. package/src/clock.ts +56 -0
  143. package/src/data/data-protocol-methods.ts +11 -3
  144. package/src/data/data-server-protocol.ts +132 -31
  145. package/src/data/events.ts +109 -14
  146. package/src/data/requests.ts +71 -11
  147. package/src/errors.ts +259 -24
  148. package/src/glsp-save-model-actions.ts +59 -0
  149. package/src/index.ts +6 -0
  150. package/src/latency-collector.ts +8 -3
  151. package/src/messages/index.ts +36 -0
  152. package/src/messages/primitives.ts +271 -0
  153. package/src/model-server.ts +63 -18
  154. package/src/model-service/based-on.ts +63 -0
  155. package/src/model-service/index.ts +4 -5
  156. package/src/patch-merge.ts +90 -37
  157. package/src/profile-session.ts +9 -4
  158. package/src/rpc/bind-rpc-methods.ts +49 -4
  159. package/src/rpc/create-rpc-proxy.ts +14 -1
  160. package/src/testing/catalogue-audit.ts +111 -0
  161. package/src/testing/data-doubles.ts +42 -17
  162. package/src/testing/fake-clock.ts +62 -47
  163. package/src/testing/index.ts +4 -1
  164. package/src/testing/node/index.ts +2 -2
  165. package/src/testing/node/message-port-pair.ts +40 -0
  166. package/src/transfer-diagnostic.ts +40 -0
  167. package/src/transfer-document.ts +29 -6
  168. package/lib/model-service/args.d.ts +0 -64
  169. package/lib/model-service/args.d.ts.map +0 -1
  170. package/lib/model-service/args.js +0 -11
  171. package/lib/model-service/args.js.map +0 -1
  172. package/src/model-service/args.ts +0 -67
package/README.md CHANGED
@@ -60,7 +60,7 @@ names, a worked example — is in
60
60
  @hydranium/protocol # transfer documents, references, RPC machinery
61
61
  @hydranium/protocol/data # DataServerProtocol / DataClientProtocol
62
62
  @hydranium/protocol/client # the host-neutral client tier
63
- @hydranium/protocol/testing # test doubles and waiters
63
+ @hydranium/protocol/testing # test doubles, waiters, catalogue audit
64
64
  @hydranium/protocol/testing/node # the Node-only doubles
65
65
  ```
66
66
 
@@ -69,6 +69,40 @@ narrower surface rather than reach; `testing` is only reachable by its own
69
69
  specifier, which is what keeps the doubles out of a production bundle. The RPC
70
70
  machinery documents itself in [`src/rpc/README.md`](./src/rpc/README.md).
71
71
 
72
+ ### Auditing a translation catalogue
73
+
74
+ An adopter with i18n has one failure mode nothing else catches: a catalogue key
75
+ naming no declared code falls back to the English, which is byte-identical to
76
+ the deliberately-partial behaviour every adopter relies on. So a typo is
77
+ invisible at runtime, and `theia nls-extract` reports what the source declares
78
+ rather than whether a catalogue matches it.
79
+
80
+ `@hydranium/protocol/testing` ships the audit for it — call it from your own
81
+ test, over your own barrels:
82
+
83
+ <!-- snippet-preamble
84
+ import { flattenCatalogue, findUndeclaredCodes, findSharedCodes } from '@hydranium/protocol/testing';
85
+ import * as protocolMessages from '@hydranium/protocol';
86
+ declare const readFileSync: (path: string, encoding: string) => string;
87
+ declare const expect: (actual: unknown) => { toEqual(expected: unknown): void };
88
+ -->
89
+
90
+ ```ts
91
+ const keys = Object.keys(flattenCatalogue(JSON.parse(readFileSync('nls/de.json', 'utf-8'))));
92
+
93
+ // Every key names a code some barrel declares. `exemptPrefixes` is for keys no
94
+ // barrel CAN declare — a host mechanism taking its key as an inline literal.
95
+ expect(findUndeclaredCodes(keys, [protocolMessages])).toEqual([]);
96
+ ```
97
+
98
+ `flattenCatalogue` joins nested keys with `/` (the separator a code already
99
+ uses, and what Theia does to a nested catalogue) and drops `_`-prefixed note
100
+ keys, so a flat server-side catalogue and a nested host-side one both go through
101
+ it. `findSharedCodes` covers the other half: exactly one side renders a given
102
+ message, so two catalogues holding one code are two authorities over one
103
+ sentence — assert both key sets non-empty first, since an empty one satisfies
104
+ disjointness while proving nothing.
105
+
72
106
  ## Status
73
107
 
74
108
  Alpha — pre-v0. The package is being populated incrementally, and its API is
@@ -0,0 +1,150 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 CrossBreeze, 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 { Emitter, type Event } from 'vscode-jsonrpc';
10
+ import { type DataClientProtocol, type DataServerProtocol, type DiagnosticOf, type ProjectOf, type TransferDocumentDirtyChangedEvent } from '../data';
11
+ import type { TransferElement } from '../transfer-element';
12
+ import { DataEvents } from './data-events';
13
+ import type { DataPort } from './data-port';
14
+ import { DataSession, type DataSessionFactory } from './data-session';
15
+ import { RpcConnection, type RpcConnectionLifecycle } from './rpc-connection';
16
+ /** Options for {@link DataConnection}. */
17
+ export interface DataConnectionOptions<TTransfer extends TransferElement = TransferElement, TServer extends DataServerProtocol<TTransfer, DiagnosticOf<TServer>> = DataServerProtocol<TTransfer>> extends RpcConnectionLifecycle {
18
+ /**
19
+ * Wire namespace the server is addressed under. Defaults to the
20
+ * framework's {@link DATA_SERVER_WIRE_PREFIX}, which is what an unmodified
21
+ * `DataServer` binds. Override only alongside the server's own
22
+ * `methodNamespace` option — a mismatch turns every request into
23
+ * "Unhandled method" rather than failing at wire-up.
24
+ */
25
+ readonly methodNamespace?: string;
26
+ /** Builds the sessions `createSession` hands out. Defaults to a plain {@link DataSession}. */
27
+ readonly sessionFactory?: DataSessionFactory<TTransfer, TServer>;
28
+ }
29
+ /** {@link DataConnectionOptions} for a client that does not speak {@link DataClientProtocol}. */
30
+ export interface DataConnectionOptionsWithMethods<TClient extends object, TTransfer extends TransferElement = TransferElement, TServer extends DataServerProtocol<TTransfer, DiagnosticOf<TServer>> = DataServerProtocol<TTransfer>> extends DataConnectionOptions<TTransfer, TServer> {
31
+ /**
32
+ * Method names of the client to bind as inbound handlers. Declare it
33
+ * `as const satisfies ReadonlyArray<keyof YourClient & string>` so the list
34
+ * cannot drift from the interface.
35
+ */
36
+ readonly clientMethods: readonly (keyof TClient & string)[];
37
+ }
38
+ /**
39
+ * Trailing constructor arguments, required only when the client cannot take
40
+ * the framework's default method list.
41
+ *
42
+ * `bindRpcMethods` throws for a name the target does not implement, so a
43
+ * request/response-only client binding the default list fails at wire-up. The
44
+ * conditional turns that into a compile error.
45
+ */
46
+ export type DataConnectionArgs<TTransfer extends TransferElement, TClient extends object, TServer extends DataServerProtocol<TTransfer, DiagnosticOf<TServer>> = DataServerProtocol<TTransfer>> = TClient extends DataClientProtocol<TTransfer> ? [options?: DataConnectionOptions<TTransfer, TServer> & Partial<DataConnectionOptionsWithMethods<TClient, TTransfer, TServer>>] : [options: DataConnectionOptionsWithMethods<TClient, TTransfer, TServer>];
47
+ /**
48
+ * A {@link RpcConnection} to the data head, carrying as many participants as
49
+ * the host has interested parties.
50
+ *
51
+ * Document operations live on the participants rather than here: they carry a
52
+ * `clientId`, which identifies a participant rather than a wire, and the server
53
+ * keys its opens and watches per `(uri, clientId)`. Two parties sharing one
54
+ * identity cannot tell each other's writes from their own echoes.
55
+ *
56
+ * Generic over the transfer root so this file names no grammar. An adopter
57
+ * binds the concrete root (or the union of them, for a multi-grammar head) at
58
+ * its own edge.
59
+ */
60
+ export declare class DataConnection<TTransfer extends TransferElement, TServer extends DataServerProtocol<TTransfer, DiagnosticOf<TServer>> = DataServerProtocol<TTransfer>, TClient extends object = DataClientProtocol<TTransfer>> extends RpcConnection<TServer, TClient> {
61
+ protected readonly sessions: Set<DataSession<TTransfer, TServer>>;
62
+ protected readonly sessionFactory: DataSessionFactory<TTransfer, TServer>;
63
+ protected readonly createSessionEmitter: Emitter<DataSession<TTransfer, TServer>>;
64
+ /**
65
+ * Fires with each session {@link createSession} starts, before it returns,
66
+ * so a listener sees every session a caller can. A session started before
67
+ * the listener subscribed is in {@link liveSessions}.
68
+ */
69
+ readonly onDidCreateSession: Event<DataSession<TTransfer, TServer>>;
70
+ /**
71
+ * Per URI, the `dirty` the client was last told since a session of this
72
+ * connection last opened the URI. A restore tells the client its answer
73
+ * only where it differs, so the client hears changes and nothing else; see
74
+ * {@link DataSessionHost.restoreDirty}.
75
+ */
76
+ protected readonly dirtyStates: Map<string, boolean>;
77
+ constructor(port: DataPort, client: TClient, ...rest: DataConnectionArgs<TTransfer, TClient, TServer>);
78
+ /**
79
+ * The sessions of this connection that have not ended, in the order they
80
+ * started. A session is listed until its `onDidDispose` fires, or until
81
+ * {@link dispose} clears the list.
82
+ */
83
+ get liveSessions(): readonly DataSession<TTransfer, TServer>[];
84
+ /**
85
+ * Start a participant on this connection, registered with the server under a
86
+ * fresh id, `label` plus `#` plus a random UUID, or under `clientId` when
87
+ * given. Pass a `label` naming the participant; without one it is
88
+ * `session`. Synchronous: the registration is sent at once, and the
89
+ * session's calls wait for it. The server refuses an id live anywhere in
90
+ * its process, and every call of that session then rejects with an error
91
+ * `isDuplicateClientIdError` recognises; an id the server reserves beyond
92
+ * {@link FRAMEWORK_CLIENT_IDS}, such as the integrity author, with one
93
+ * `isReservedClientIdError` recognises. Only the code crosses the wire, so
94
+ * test with those guards rather than `instanceof`.
95
+ *
96
+ * Throws a {@link ReservedClientIdError} for an id in
97
+ * {@link FRAMEWORK_CLIENT_IDS} — those are authors the SERVER emits rather
98
+ * than participants, so a session holding one would read the framework's
99
+ * own broadcasts as its own echoes and drop them — and a
100
+ * {@link DuplicateClientIdError} for an id a live session on this
101
+ * connection already holds.
102
+ */
103
+ createSession(label?: string, clientId?: string): DataSession<TTransfer, TServer>;
104
+ /**
105
+ * The client, with its `onDocumentDirtyChanged` passing through
106
+ * {@link deliverDirty} first, so {@link dirtyStates} holds what the server
107
+ * told it. Every other bound method forwards to the client unchanged, and
108
+ * one the client lacks stays absent, so the binding still refuses it.
109
+ */
110
+ protected localTarget(): TClient;
111
+ /** Record `event` in {@link dirtyStates} and hand it to the client. */
112
+ protected deliverDirty(event: TransferDocumentDirtyChangedEvent): void;
113
+ /**
114
+ * After the transport dropped, reconnect on the next macrotask for the
115
+ * sessions with documents open, so they re-watch and follow their documents
116
+ * again without waiting for a call of their own; a session with nothing
117
+ * open restores on its next call. Nothing is scheduled once this connection
118
+ * is disposed, which drops its generation too.
119
+ */
120
+ protected dropGeneration(): void;
121
+ /**
122
+ * Sessions are detached rather than disposed: the server ends every session
123
+ * on a connection it sees close, so ending each one first sends requests
124
+ * over a connection this call is about to dispose.
125
+ */
126
+ dispose(): void;
127
+ }
128
+ /**
129
+ * A {@link DataConnection} that brings its own {@link DataEvents}, so a host
130
+ * with several interested parties does not have to supply one.
131
+ *
132
+ * **The client slot holds exactly one object, and that is why this exists.**
133
+ * `createRpcProxy` binds a single `localTarget`, and underneath a method name
134
+ * maps to one handler — a second registration replaces the first silently. So a
135
+ * properties panel and a tree cannot both be the client; one fan-out sits in the
136
+ * slot and both subscribe to it.
137
+ *
138
+ * Use {@link DataConnection} directly instead when the client is yours: an
139
+ * adopter service that implements the protocol plus its own methods, a single
140
+ * consumer that IS the client, or a request/response-only client that binds
141
+ * nothing.
142
+ */
143
+ export declare class DataConnectionWithEvents<TTransfer extends TransferElement, TServer extends DataServerProtocol<TTransfer, DiagnosticOf<TServer>> = DataServerProtocol<TTransfer>> extends DataConnection<TTransfer, TServer, DataEvents<TTransfer, DiagnosticOf<TServer>, ProjectOf<TServer>>> {
144
+ /** Server pushes, fanned out to as many local listeners as the host has. */
145
+ readonly events: DataEvents<TTransfer, DiagnosticOf<TServer>, ProjectOf<TServer>>;
146
+ constructor(port: DataPort, options?: DataConnectionOptions<TTransfer, TServer>);
147
+ /** Disposes the fan-out it created, which no caller else holds. */
148
+ dispose(): void;
149
+ }
150
+ //# sourceMappingURL=data-connection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-connection.d.ts","sourceRoot":"","sources":["../../src/client/data-connection.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAGJ,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,iCAAiC,EACxC,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,KAAK,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE9E,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB,CACnC,SAAS,SAAS,eAAe,GAAG,eAAe,EACnD,OAAO,SAAS,kBAAkB,CAAC,SAAS,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,GAAG,kBAAkB,CAAC,SAAS,CAAC,CACrG,SAAQ,sBAAsB;IAC7B;;;;;;OAMG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,8FAA8F;IAC9F,QAAQ,CAAC,cAAc,CAAC,EAAE,kBAAkB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;CACnE;AAED,iGAAiG;AACjG,MAAM,WAAW,gCAAgC,CAC9C,OAAO,SAAS,MAAM,EACtB,SAA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,EAAE,OAAO,CAAC,EAAE,qBAAqB,CAAC,SAAS,EAAE,OAAO,CAAC;IAQ/E,mEAAmE;IAC1D,OAAO,IAAI,IAAI;CAI1B"}
@@ -0,0 +1,211 @@
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.DataConnectionWithEvents = exports.DataConnection = void 0;
12
+ const vscode_jsonrpc_1 = require("vscode-jsonrpc");
13
+ const client_ids_1 = require("../client-ids");
14
+ const data_1 = require("../data");
15
+ const errors_1 = require("../errors");
16
+ const data_events_1 = require("./data-events");
17
+ const data_session_1 = require("./data-session");
18
+ const rpc_connection_1 = require("./rpc-connection");
19
+ /**
20
+ * A {@link RpcConnection} to the data head, carrying as many participants as
21
+ * the host has interested parties.
22
+ *
23
+ * Document operations live on the participants rather than here: they carry a
24
+ * `clientId`, which identifies a participant rather than a wire, and the server
25
+ * keys its opens and watches per `(uri, clientId)`. Two parties sharing one
26
+ * identity cannot tell each other's writes from their own echoes.
27
+ *
28
+ * Generic over the transfer root so this file names no grammar. An adopter
29
+ * binds the concrete root (or the union of them, for a multi-grammar head) at
30
+ * its own edge.
31
+ */
32
+ class DataConnection extends rpc_connection_1.RpcConnection {
33
+ sessions = new Set();
34
+ sessionFactory;
35
+ createSessionEmitter = new vscode_jsonrpc_1.Emitter();
36
+ /**
37
+ * Fires with each session {@link createSession} starts, before it returns,
38
+ * so a listener sees every session a caller can. A session started before
39
+ * the listener subscribed is in {@link liveSessions}.
40
+ */
41
+ onDidCreateSession = this.createSessionEmitter.event;
42
+ /**
43
+ * Per URI, the `dirty` the client was last told since a session of this
44
+ * connection last opened the URI. A restore tells the client its answer
45
+ * only where it differs, so the client hears changes and nothing else; see
46
+ * {@link DataSessionHost.restoreDirty}.
47
+ */
48
+ dirtyStates = new Map();
49
+ constructor(port, client, ...rest) {
50
+ const [options = {}] = rest;
51
+ super(port, client, {
52
+ methodNamespace: options.methodNamespace ?? data_1.DATA_SERVER_WIRE_PREFIX,
53
+ // The default is reachable only where `TClient` satisfies
54
+ // `DataClientProtocol`, which the constructor's conditional enforces;
55
+ // the compiler cannot carry that through to the generic parameter.
56
+ clientMethods: options.clientMethods ?? data_1.DATA_CLIENT_PROTOCOL_METHODS,
57
+ lifecycle: options
58
+ });
59
+ this.sessionFactory =
60
+ options.sessionFactory ?? ((clientId, host, label) => new data_session_1.DataSession(clientId, host, label));
61
+ }
62
+ /**
63
+ * The sessions of this connection that have not ended, in the order they
64
+ * started. A session is listed until its `onDidDispose` fires, or until
65
+ * {@link dispose} clears the list.
66
+ */
67
+ get liveSessions() {
68
+ return [...this.sessions];
69
+ }
70
+ /**
71
+ * Start a participant on this connection, registered with the server under a
72
+ * fresh id, `label` plus `#` plus a random UUID, or under `clientId` when
73
+ * given. Pass a `label` naming the participant; without one it is
74
+ * `session`. Synchronous: the registration is sent at once, and the
75
+ * session's calls wait for it. The server refuses an id live anywhere in
76
+ * its process, and every call of that session then rejects with an error
77
+ * `isDuplicateClientIdError` recognises; an id the server reserves beyond
78
+ * {@link FRAMEWORK_CLIENT_IDS}, such as the integrity author, with one
79
+ * `isReservedClientIdError` recognises. Only the code crosses the wire, so
80
+ * test with those guards rather than `instanceof`.
81
+ *
82
+ * Throws a {@link ReservedClientIdError} for an id in
83
+ * {@link FRAMEWORK_CLIENT_IDS} — those are authors the SERVER emits rather
84
+ * than participants, so a session holding one would read the framework's
85
+ * own broadcasts as its own echoes and drop them — and a
86
+ * {@link DuplicateClientIdError} for an id a live session on this
87
+ * connection already holds.
88
+ */
89
+ createSession(label = 'session', clientId) {
90
+ this.assertLive();
91
+ const id = clientId ?? `${label}#${globalThis.crypto.randomUUID()}`;
92
+ if (client_ids_1.FRAMEWORK_CLIENT_IDS.includes(id)) {
93
+ throw new errors_1.ReservedClientIdError(id);
94
+ }
95
+ if ([...this.sessions].some(session => session.clientId === id)) {
96
+ throw new errors_1.DuplicateClientIdError(id);
97
+ }
98
+ const session = this.sessionFactory(id, {
99
+ connected: () => this.connected(),
100
+ reportError: (error, reported) => this.reportError(error, reported),
101
+ restoreDirty: event => {
102
+ if (this.dirtyStates.get(event.uri) !== event.dirty) {
103
+ this.deliverDirty(event);
104
+ }
105
+ },
106
+ forgetDirty: uri => this.dirtyStates.delete(uri)
107
+ }, label);
108
+ this.sessions.add(session);
109
+ // Subscribed before the session is handed out, so the id is free again
110
+ // on this connection by the time any caller's listener runs.
111
+ session.onDidDispose(() => this.sessions.delete(session));
112
+ // A failure reaches the session's own calls, which wait for the same
113
+ // registration; caught here only so it is not also reported unhandled.
114
+ session.connected().catch(() => undefined);
115
+ this.createSessionEmitter.fire(session);
116
+ return session;
117
+ }
118
+ /**
119
+ * The client, with its `onDocumentDirtyChanged` passing through
120
+ * {@link deliverDirty} first, so {@link dirtyStates} holds what the server
121
+ * told it. Every other bound method forwards to the client unchanged, and
122
+ * one the client lacks stays absent, so the binding still refuses it.
123
+ */
124
+ localTarget() {
125
+ const client = this.client;
126
+ if (typeof client.onDocumentDirtyChanged !== 'function') {
127
+ return this.client;
128
+ }
129
+ const target = {};
130
+ for (const name of this.clientMethods) {
131
+ const method = client[name];
132
+ if (typeof method === 'function') {
133
+ target[name] = (params) => method.call(client, params);
134
+ }
135
+ }
136
+ target.onDocumentDirtyChanged = (event) => this.deliverDirty(event);
137
+ return target;
138
+ }
139
+ /** Record `event` in {@link dirtyStates} and hand it to the client. */
140
+ deliverDirty(event) {
141
+ this.dirtyStates.set(event.uri, event.dirty);
142
+ const client = this.client;
143
+ client.onDocumentDirtyChanged?.(event);
144
+ }
145
+ /**
146
+ * After the transport dropped, reconnect on the next macrotask for the
147
+ * sessions with documents open, so they re-watch and follow their documents
148
+ * again without waiting for a call of their own; a session with nothing
149
+ * open restores on its next call. Nothing is scheduled once this connection
150
+ * is disposed, which drops its generation too.
151
+ */
152
+ dropGeneration() {
153
+ const dropped = this.generation !== undefined;
154
+ super.dropGeneration();
155
+ if (dropped && !this.disposed) {
156
+ setTimeout(() => {
157
+ if (!this.disposed) {
158
+ this.sessions.forEach(session => session.reconnect());
159
+ }
160
+ }, 0);
161
+ }
162
+ }
163
+ /**
164
+ * Sessions are detached rather than disposed: the server ends every session
165
+ * on a connection it sees close, so ending each one first sends requests
166
+ * over a connection this call is about to dispose.
167
+ */
168
+ dispose() {
169
+ for (const session of [...this.sessions]) {
170
+ session.detach();
171
+ }
172
+ // For a factory's session whose `detach` does not fire.
173
+ this.sessions.clear();
174
+ this.createSessionEmitter.dispose();
175
+ super.dispose();
176
+ }
177
+ }
178
+ exports.DataConnection = DataConnection;
179
+ /**
180
+ * A {@link DataConnection} that brings its own {@link DataEvents}, so a host
181
+ * with several interested parties does not have to supply one.
182
+ *
183
+ * **The client slot holds exactly one object, and that is why this exists.**
184
+ * `createRpcProxy` binds a single `localTarget`, and underneath a method name
185
+ * maps to one handler — a second registration replaces the first silently. So a
186
+ * properties panel and a tree cannot both be the client; one fan-out sits in the
187
+ * slot and both subscribe to it.
188
+ *
189
+ * Use {@link DataConnection} directly instead when the client is yours: an
190
+ * adopter service that implements the protocol plus its own methods, a single
191
+ * consumer that IS the client, or a request/response-only client that binds
192
+ * nothing.
193
+ */
194
+ class DataConnectionWithEvents extends DataConnection {
195
+ /** Server pushes, fanned out to as many local listeners as the host has. */
196
+ events;
197
+ constructor(port, options) {
198
+ // Built as a local because `this` is unavailable before `super`, then
199
+ // read back onto the field.
200
+ const events = new data_events_1.DataEvents();
201
+ super(port, events, options);
202
+ this.events = events;
203
+ }
204
+ /** Disposes the fan-out it created, which no caller else holds. */
205
+ dispose() {
206
+ super.dispose();
207
+ this.events.dispose();
208
+ }
209
+ }
210
+ exports.DataConnectionWithEvents = DataConnectionWithEvents;
211
+ //# sourceMappingURL=data-connection.js.map
@@ -0,0 +1 @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,CAAC;QAC9C,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,IAAI,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC7B,UAAU,CAAC,GAAG,EAAE;gBACb,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;oBAClB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;gBACzD,CAAC;YACJ,CAAC,EAAE,CAAC,CAAC,CAAC;QACT,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACM,OAAO;QACb,KAAK,MAAM,OAAO,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YACxC,OAAO,CAAC,MAAM,EAAE,CAAC;QACpB,CAAC;QACD,wDAAwD;QACxD,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QACtB,IAAI,CAAC,oBAAoB,CAAC,OAAO,EAAE,CAAC;QACpC,KAAK,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;CACH;AAlKD,wCAkKC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAa,wBAGX,SAAQ,cAAoG;IAC3G,4EAA4E;IACnE,MAAM,CAAmE;IAElF,YAAY,IAAc,EAAE,OAAmD;QAC5E,sEAAsE;QACtE,4BAA4B;QAC5B,MAAM,MAAM,GAAG,IAAI,wBAAU,EAAwD,CAAC;QACtF,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,mEAAmE;IAC1D,OAAO;QACb,KAAK,CAAC,OAAO,EAAE,CAAC;QAChB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;IACzB,CAAC;CACH;AApBD,4DAoBC"}
@@ -7,7 +7,7 @@
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
9
  import { Emitter, type Event } from 'vscode-jsonrpc';
10
- import type { DataClientProtocol, ProjectsChangedEvent, TransferDocumentSavedEvent, TransferDocumentUpdatedEvent } from '../data';
10
+ import type { DataClientProtocol, ProjectsChangedEvent, TransferDocumentDeletedEvent, TransferDocumentDirtyChangedEvent, TransferDocumentSavedEvent, TransferDocumentsBuiltEvent, TransferDocumentUpdatedEvent } from '../data';
11
11
  import type { Project } from '../project';
12
12
  import type { TransferDiagnostic } from '../transfer-diagnostic';
13
13
  import type { TransferElement } from '../transfer-element';
@@ -34,15 +34,27 @@ import type { TransferElement } from '../transfer-element';
34
34
  export declare class DataEvents<TTransfer extends TransferElement, TDiagnostic extends TransferDiagnostic = TransferDiagnostic, TProject extends Project = Project> implements DataClientProtocol<TTransfer, TDiagnostic, TProject> {
35
35
  protected readonly documentUpdatedEmitter: Emitter<TransferDocumentUpdatedEvent<TTransfer, TDiagnostic>>;
36
36
  protected readonly documentSavedEmitter: Emitter<TransferDocumentSavedEvent<TTransfer, TDiagnostic>>;
37
+ protected readonly documentDirtyChangedEmitter: Emitter<TransferDocumentDirtyChangedEvent>;
38
+ protected readonly documentDeletedEmitter: Emitter<TransferDocumentDeletedEvent>;
39
+ protected readonly documentsBuiltEmitter: Emitter<TransferDocumentsBuiltEvent>;
37
40
  protected readonly projectsChangedEmitter: Emitter<ProjectsChangedEvent<TProject>>;
38
41
  /** A build-phase event for a watched document. Carries the originating `sourceClientId`. */
39
42
  readonly onDidUpdateDocument: Event<TransferDocumentUpdatedEvent<TTransfer, TDiagnostic>>;
40
43
  /** A watched document was persisted to disk. */
41
44
  readonly onDidSaveDocument: Event<TransferDocumentSavedEvent<TTransfer, TDiagnostic>>;
45
+ /** A watched document's text started or stopped differing from its file. */
46
+ readonly onDidChangeDocumentDirty: Event<TransferDocumentDirtyChangedEvent>;
47
+ /** A document's backing file was removed, watched or not. Any watch survives. */
48
+ readonly onDidDeleteDocument: Event<TransferDocumentDeletedEvent>;
49
+ /** Documents built that nobody watches — re-read anything derived from them. */
50
+ readonly onDidBuildDocuments: Event<TransferDocumentsBuiltEvent>;
42
51
  /** The project set changed. */
43
52
  readonly onDidChangeProjects: Event<ProjectsChangedEvent<TProject>>;
44
53
  onDocumentUpdated(event: TransferDocumentUpdatedEvent<TTransfer, TDiagnostic>): void;
45
54
  onDocumentSaved(event: TransferDocumentSavedEvent<TTransfer, TDiagnostic>): void;
55
+ onDocumentDirtyChanged(event: TransferDocumentDirtyChangedEvent): void;
56
+ onDocumentDeleted(event: TransferDocumentDeletedEvent): void;
57
+ onDocumentsBuilt(event: TransferDocumentsBuiltEvent): void;
46
58
  onProjectsChanged(event: ProjectsChangedEvent<TProject>): void;
47
59
  dispose(): void;
48
60
  }
@@ -1 +1 @@
1
- {"version":3,"file":"data-events.d.ts","sourceRoot":"","sources":["../../src/client/data-events.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAClI,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,UAAU,CACpB,SAAS,SAAS,eAAe,EACjC,WAAW,SAAS,kBAAkB,GAAG,kBAAkB,EAC3D,QAAQ,SAAS,OAAO,GAAG,OAAO,CACnC,YAAW,kBAAkB,CAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,CAAC;IAC9D,SAAS,CAAC,QAAQ,CAAC,sBAAsB,gEAAuE;IAChH,SAAS,CAAC,QAAQ,CAAC,oBAAoB,8DAAqE;IAC5G,SAAS,CAAC,QA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AAG,IAAI;IAI5D,gBAAgB,CAAC,KAAK,EAAE,2BAA2B,GAAG,IAAI;IAI1D,iBAAiB,CAAC,KAAK,EAAE,oBAAoB,CAAC,QAAQ,CAAC,GAAG,IAAI;IAI9D,OAAO,IAAI,IAAI;CAQjB"}
@@ -33,11 +33,20 @@ const vscode_jsonrpc_1 = require("vscode-jsonrpc");
33
33
  class DataEvents {
34
34
  documentUpdatedEmitter = new vscode_jsonrpc_1.Emitter();
35
35
  documentSavedEmitter = new vscode_jsonrpc_1.Emitter();
36
+ documentDirtyChangedEmitter = new vscode_jsonrpc_1.Emitter();
37
+ documentDeletedEmitter = new vscode_jsonrpc_1.Emitter();
38
+ documentsBuiltEmitter = new vscode_jsonrpc_1.Emitter();
36
39
  projectsChangedEmitter = new vscode_jsonrpc_1.Emitter();
37
40
  /** A build-phase event for a watched document. Carries the originating `sourceClientId`. */
38
41
  onDidUpdateDocument = this.documentUpdatedEmitter.event;
39
42
  /** A watched document was persisted to disk. */
40
43
  onDidSaveDocument = this.documentSavedEmitter.event;
44
+ /** A watched document's text started or stopped differing from its file. */
45
+ onDidChangeDocumentDirty = this.documentDirtyChangedEmitter.event;
46
+ /** A document's backing file was removed, watched or not. Any watch survives. */
47
+ onDidDeleteDocument = this.documentDeletedEmitter.event;
48
+ /** Documents built that nobody watches — re-read anything derived from them. */
49
+ onDidBuildDocuments = this.documentsBuiltEmitter.event;
41
50
  /** The project set changed. */
42
51
  onDidChangeProjects = this.projectsChangedEmitter.event;
43
52
  // --- DataClientProtocol (wire names) ---
@@ -47,12 +56,24 @@ class DataEvents {
47
56
  onDocumentSaved(event) {
48
57
  this.documentSavedEmitter.fire(event);
49
58
  }
59
+ onDocumentDirtyChanged(event) {
60
+ this.documentDirtyChangedEmitter.fire(event);
61
+ }
62
+ onDocumentDeleted(event) {
63
+ this.documentDeletedEmitter.fire(event);
64
+ }
65
+ onDocumentsBuilt(event) {
66
+ this.documentsBuiltEmitter.fire(event);
67
+ }
50
68
  onProjectsChanged(event) {
51
69
  this.projectsChangedEmitter.fire(event);
52
70
  }
53
71
  dispose() {
54
72
  this.documentUpdatedEmitter.dispose();
55
73
  this.documentSavedEmitter.dispose();
74
+ this.documentDirtyChangedEmitter.dispose();
75
+ this.documentDeletedEmitter.dispose();
76
+ this.documentsBuiltEmitter.dispose();
56
77
  this.projectsChangedEmitter.dispose();
57
78
  }
58
79
  }
@@ -1 +1 @@
1
- {"version":3,"file":"data-events.js","sourceRoot":"","sources":["../../src/client/data-events.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAElF,mDAAqD;AAMrD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,UAAU;IAKD,sBAAsB,GAAG,IAAI,wBAAO,EAAwD,CAAC;IAC7F,oBAAoB,GAAG,IAAI,wBAAO,EAAsD,CAAC;IACzF,sBAAsB,GAAG,IAAI,wBAAO,EAAkC,CAAC;IAE1F,4FAA4F;IACnF,mBAAmB,GAAgE,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC;IAC9H,gDAAgD;IACvC,iBAAiB,GAA8D,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC;IACxH,+BAA+B;IACtB,mBAAmB,GAA0C,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC;IAExG,0CAA0C;IAE1C,iBAAiB,CAAC,KAA2D;QAC1E,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED,eAAe,CAAC,KAAyD;QACtE,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;IAED,iBAAiB,CAAC,KAAqC;QACpD,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO;QACJ,IAAI,CAAC,sBAAsB,CAAC,OAAO,EAAE,CAAC;QACtC,IAAI,CAAC,oBAAoB,CAAC,OAAO,EAAE,CAAC;QACpC,IAAI,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,2BAA2B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;IAED,iBAAiB,CAAC,KAAmC;QAClD,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED,gBAAgB,CAAC,KAAkC;QAChD,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;IAED,iBAAiB,CAAC,KAAqC;QACpD,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO;QACJ,IAAI,CAAC,sBAAsB,CAAC,OAAO,EAAE,CAAC;QACtC,IAAI,CAAC,oBAAoB,CAAC,OAAO,EAAE,CAAC;QACpC,IAAI,CAAC,2BAA2B,CAAC,OAAO,EAAE,CAAC;QAC3C,IAAI,CAAC,sBAAsB,CAAC,OAAO,EAAE,CAAC;QACtC,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,CAAC;QACrC,IAAI,CAAC,sBAAsB,CAAC,OAAO,EAAE,CAAC;IACzC,CAAC;CACH;AA3DD,gCA2DC"}
@@ -7,20 +7,24 @@
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
9
  import type { Event, MessageConnection } from 'vscode-jsonrpc';
10
+ import type { ResolvedMessage } from '../messages/primitives';
10
11
  /**
11
12
  * The one thing a host has to supply for the data head: a live JSON-RPC
12
- * connection to the data server, plus the identity and failure sink that go
13
- * with it.
13
+ * connection to the data server, plus the failure sink that goes with it.
14
14
  *
15
- * "Port" in the hexagonal sense — the host implements it, `DataSession`
15
+ * "Port" in the hexagonal sense — the host implements it, `DataConnection`
16
16
  * consumes it, and nothing on either side of the boundary imports the other.
17
17
  *
18
+ * Carries no identity. A `clientId` names a participant, and one transport
19
+ * serves as many as the host has; binding an identity here is what makes two
20
+ * of them share one, so it lives on `DataSession` instead.
21
+ *
18
22
  * **This deliberately does NOT wrap the protocol methods.** `createRpcProxy`
19
23
  * already takes a promise of a connection and produces the whole typed
20
24
  * `DataServerProtocol` surface, so wrapping it would re-derive the framework's
21
25
  * pass-throughs in a second place and lose the `as const satisfies keyof`
22
26
  * method allowlists, which cannot drift. Everything a form or a tree actually
23
- * does — the wire contract, the open/watch/update/close sequence, `baseVersion`
27
+ * does — the wire contract, the open/watch/update/close sequence, `basedOn`
24
28
  * conflict handling, echo filtering by `sourceClientId` — is host-invariant and
25
29
  * lives above this interface. What varies between hosts is exactly the four
26
30
  * members below.
@@ -43,21 +47,6 @@ import type { Event, MessageConnection } from 'vscode-jsonrpc';
43
47
  * calls on the promise but never calls `listen` itself.
44
48
  */
45
49
  export interface DataPort {
46
- /**
47
- * Stable identity of this client on the data server, passed as `clientId`
48
- * on every document request.
49
- *
50
- * It has to be stable for the session because it is the echo key: an
51
- * inbound `onDocumentUpdated` carries the originating mutation's
52
- * `clientId` as `sourceClientId`, and a client that cannot recognise its
53
- * own echo treats its own write as a concurrent third-party one. It also
54
- * has to be distinct per client, since it keys the server's per-
55
- * `(uri, clientId)` watch bucket.
56
- *
57
- * Avoid the three values the framework itself uses as sentinels —
58
- * `'language-client'`, `'unknown'` and `'revert-on-close'`.
59
- */
60
- readonly clientId: string;
61
50
  /**
62
51
  * Open the transport and hand back a listening `MessageConnection`.
63
52
  *
@@ -73,10 +62,16 @@ export interface DataPort {
73
62
  *
74
63
  * It exists because the alternative is worse in both directions: this tier
75
64
  * cannot import a host's UI, and swallowing the error makes a dead
76
- * connection look like an empty model. `context` names what was being
77
- * attempted, not where in the code it happened.
65
+ * connection look like an empty model.
66
+ *
67
+ * `reported` is a complete sentence plus the identity needed to render it in
68
+ * another language. It carries a value rather than using a protocol field
69
+ * because this tier does not know whether a process hop intervenes — in a
70
+ * webview host the render happens across one — and a `ResolvedMessage` is
71
+ * structured-clone safe either way. Render it with `renderFrameworkMessage`;
72
+ * passing no translation map yields the English.
78
73
  */
79
- reportError(error: unknown, context: string): void;
74
+ reportError(error: unknown, reported: ResolvedMessage): void;
80
75
  /**
81
76
  * Fires when the host tears the transport down and the current connection
82
77
  * is no longer usable — a language-server restart being the case that
@@ -1 +1 @@
1
- {"version":3,"file":"data-port.d.ts","sourceRoot":"","sources":["../../src/client/data-port.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,WAAW,QAAQ;IACtB;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B;;;;;;;OAOG;IACH,OAAO,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEtC;;;;;;;;OAQG;IACH,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnD;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;CAClC"}
1
+ {"version":3,"file":"data-port.d.ts","sourceRoot":"","sources":["../../src/client/data-port.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,WAAW,QAAQ;IACtB;;;;;;;OAOG;IACH,OAAO,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEtC;;;;;;;;;;;;;;OAcG;IACH,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,GAAG,IAAI,CAAC;IAE7D;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;CAClC"}