@hydranium/data-server 1.0.0-next.13 → 1.0.0-next.132

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.
package/README.md CHANGED
@@ -19,10 +19,21 @@ Installed by the server process that already composes
19
19
  `getModelDocument`, `updateModelDocument`, `saveModelDocument`,
20
20
  `closeModelDocument`, `watchModelDocument` / `unwatchModelDocument`, and
21
21
  `waitForReady` for clients that must not race workspace initialisation.
22
+ - **Client sessions per connection:** `createSession` registers a participant,
23
+ whose requests then write only what it has open; `createModelDocument` and
24
+ the all-or-none `updateModelDocuments` serve sessions only; `closeSession`, or
25
+ the connection closing, ends a session and closes everything it has open. See
26
+ [Client sessions](../../docs/concepts/client-sessions.md).
22
27
  - **Push notifications instead of polling:** `onDocumentUpdated` when a
23
28
  subscribed document reaches the configured build phase
24
29
  (`DataServerOptions.subscriptionPhase`, `DocumentState.Validated` by default),
25
- `onDocumentSaved` on a separate channel, and `onProjectsChanged` from the
30
+ `onDocumentSaved` on a separate channel, `onDocumentDirtyChanged` when a
31
+ subscribed document starts or stops differing from its file (every document
32
+ the head sends also carries its current `dirty`), `onDocumentDeleted` (a
33
+ deleted document has no built state to carry, and the build-phase path never
34
+ runs for one), `onDocumentsBuilt` once per build for the documents nobody
35
+ watches — chiefly those rebuilt as a cascade, which no filesystem watcher can
36
+ see because their own files did not change — and `onProjectsChanged` from the
26
37
  project registry.
27
38
  - **Projects as first-class:** `getProjects` and `getProjectForUri`, answered from
28
39
  the framework's `ProjectManager`.
@@ -38,6 +49,8 @@ The projection itself is not this package's: it delegates to `TransferEncoder`
38
49
  and `ModelService` from `@hydranium/core`, so there is no second in-memory model
39
50
  to keep in sync.
40
51
 
52
+ For the adopter extension path, see [Add a data-server method](../../docs/guides/data-server-method.md). It covers the typed subclass, `additionalMethods`, shared namespace, and client proxy as one wire contract.
53
+
41
54
  ## Install
42
55
 
43
56
  ```bash
@@ -6,13 +6,49 @@
6
6
  *
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
- import { DisposableCollection, ReferenceSource, type CloseModelArgs, type Disposable, type ElementSource, type FindNextNameArgs, type LatencyCollector, type LatencyReport, type OpenModelArgs, type Project, type ReferenceCandidate, type ReferenceContext, type ReferenceRequest, type ReferenceTarget, type Tracer, type TransferDiagnostic, type TransferDocument, type TransferElement } from '@hydranium/protocol';
10
- import { type DataClientProtocol, type DataServerDiagnosticsProtocol, type DataServerProtocol, type DumpServerStateArgs, type StartProfilingArgs, type StopProfilingArgs, type WriteServerHeapSnapshotArgs, type GetModelDocumentArgs, type GetProjectForUriArgs, type TransferSaveDocumentArgs, type WatchModelDocumentArgs, type TransferDocumentUpdatedEvent, type TransferUpdateDocumentArgs } from '@hydranium/protocol/data';
9
+ import { DisposableCollection, ReferenceSource, type CloseModelArgs, type HydraniumResponseError, type Disposable, type ElementSource, type FindNextNameArgs, type LatencyCollector, type LatencyReport, type OpenModelArgs, type Project, type ReferenceCandidate, type ReferenceContext, type ReferenceRequest, type ReferenceTarget, type Tracer, type TransferDiagnostic, TransferDocument, type TransferElement } from '@hydranium/protocol';
10
+ import { type DataClientProtocol, type DataServerDiagnosticsProtocol, type DataServerProtocol, type DumpServerStateArgs, type StartProfilingArgs, type StopProfilingArgs, type WriteServerHeapSnapshotArgs, type CloseSessionArgs, type CreateModelDocumentArgs, type CreateSessionArgs, type GetModelDocumentArgs, type GetProjectForUriArgs, type TransferSaveDocumentArgs, type WatchModelDocumentArgs, type TransferDocumentUpdatedEvent, type TransferUpdateDocumentArgs, type TransferUpdateDocumentsArgs } from '@hydranium/protocol/data';
11
+ /**
12
+ * Raised when a profiling command arrives with no capture running.
13
+ *
14
+ * A `ResponseError` rather than a plain `Error` so the identity survives to the
15
+ * response boundary, which is where the message is rendered. An unwrapped throw
16
+ * reaches the client as a generic internal error instead: no code for a caller
17
+ * to switch on, and nothing for the boundary to render from.
18
+ */
19
+ export declare const NO_ACTIVE_PROFILE: import("@hydranium/protocol").MessageDefinition<"No profiling capture is active; call startProfiling first.">;
20
+ /**
21
+ * The JSON-RPC code, unrelated to the catalogue code above: this one is numeric,
22
+ * survives reconstruction and is what a caller switches on.
23
+ */
24
+ export declare const NO_ACTIVE_PROFILE_CODE = 1002;
25
+ export declare const noActiveProfileError: () => HydraniumResponseError;
26
+ /**
27
+ * Raised when a reference question's wait for the build exceeds
28
+ * {@link DataServerOptions.referenceSettleTimeoutMs}.
29
+ *
30
+ * A `ResponseError` because a class name does not cross RPC: without the code a
31
+ * wire client cannot tell a wedged build from a reference that resolves to
32
+ * nothing, which is the distinction the wait exists to keep.
33
+ */
34
+ export declare const REFERENCE_SETTLE_TIMEOUT: import("@hydranium/protocol").MessageDefinition<"Timed out after {elapsedMs}ms waiting for the build to settle before answering a reference query.">;
35
+ /** See {@link NO_ACTIVE_PROFILE_CODE} for why this is separate from the catalogue code. */
36
+ export declare const REFERENCE_SETTLE_TIMEOUT_CODE = 1003;
37
+ export declare const referenceSettleTimeoutError: (elapsedMs: number) => HydraniumResponseError;
11
38
  import type { DataServerDiagnosticsProvider, DataServerProfileCapture } from './diagnostics-provider.js';
12
- import type { ClientTextDocumentChangeEvent, HydraniumLanguageServices, LogNameOptions, ModelService, ProjectChangeEvent, ServerSharedServices, TransferEncoder } from '@hydranium/core';
39
+ import type { ClientSession, ClientSessionWriteArgs, ClientTextDocumentChangeEvent, DocumentDirtyChangedEvent, HydraniumLanguageServices, LogNameOptions, AstDiagnostic, AstDocument, ModelService, ProjectChangeEvent, ServerSharedServices, SessionEndCause, TransferEncoder } from '@hydranium/core';
13
40
  import type { TextDocument } from 'vscode-languageserver-textdocument';
14
41
  import { type AstNode, DocumentState, type LangiumDocument, type URI } from '@hydranium/langium';
15
42
  import type { CancellationToken, MessageConnection } from 'vscode-jsonrpc';
43
+ /**
44
+ * A session a data connection registered with a resume token, and how to end
45
+ * it from another connection. See {@link DataServer.resumableSessions}.
46
+ */
47
+ export interface ResumableSession {
48
+ readonly token: string;
49
+ /** End the session as its connection closing would. */
50
+ readonly end: () => void;
51
+ }
16
52
  /**
17
53
  * Which observable state {@link DataServer.computeDocumentFingerprint} hashes to
18
54
  * de-dup `onDocumentUpdated` emissions.
@@ -82,6 +118,21 @@ export interface DataServerOptions extends LogNameOptions {
82
118
  * state included). See {@link FingerprintStrategy}.
83
119
  */
84
120
  readonly fingerprintStrategy?: FingerprintStrategy;
121
+ /**
122
+ * How long a reference question waits for the build to reach `Linked` before
123
+ * failing with {@link REFERENCE_SETTLE_TIMEOUT_CODE}. Bounded because the
124
+ * wait resolves off a build-phase notification, so a build cancelled below
125
+ * `Linked` with nothing after it leaves the request unanswered for the life
126
+ * of the server.
127
+ *
128
+ * Expiry rejects rather than reading the index anyway: the unsettled index
129
+ * is what the wait keeps the caller away from, so falling through to it on a
130
+ * slow build reinstates the fault — and on a name proposal persists it.
131
+ *
132
+ * Default {@link DataServer.DEFAULT_OPTIONS}, sized for a cold workspace
133
+ * still reaching `Linked` for the first time.
134
+ */
135
+ readonly referenceSettleTimeoutMs?: number;
85
136
  /**
86
137
  * Wire-method namespace for both inbound request handlers and the
87
138
  * outbound notification client proxy. Defaults to
@@ -136,14 +187,19 @@ export interface DataServerOptions extends LogNameOptions {
136
187
  * When supplied, every inbound data-server RPC is timed into this collector
137
188
  * (via the `createRpcProxy` binding) and exposed through
138
189
  * {@link DataServerDiagnosticsProtocol.getLatency}. A head that also runs an
139
- * LSP connection can pass the SAME collector to
140
- * `instrumentLspConnection(connection, latency)` so one report covers both
141
- * heads. Absent by default (no timing overhead).
190
+ * LSP connection can pass the SAME collector through `lspLatencyOptions` to
191
+ * that connection, so one report covers both heads. Absent by default (no
192
+ * timing overhead).
142
193
  */
143
194
  readonly latency?: LatencyCollector;
144
195
  }
145
- /** Fully-resolved variant — every field set, used internally after merging defaults. */
146
- interface ResolvedDataServerOptions {
196
+ /**
197
+ * Fully-resolved variant of {@link DataServerOptions} — every field set, after
198
+ * merging defaults. Returned by the `protected`
199
+ * {@link DataServer.resolveOptions} and held on {@link DataServer.options}, so
200
+ * an adopter changing how defaults resolve has to name it.
201
+ */
202
+ export interface ResolvedDataServerOptions {
147
203
  readonly subscriptionPhase: DocumentState;
148
204
  readonly fingerprintStrategy: FingerprintStrategy;
149
205
  readonly methodNamespace: string;
@@ -151,6 +207,7 @@ interface ResolvedDataServerOptions {
151
207
  readonly excludedMethods: readonly string[];
152
208
  /** Always resolved — to the caller's, or to the platform default. */
153
209
  readonly diagnostics: DataServerDiagnosticsProvider;
210
+ readonly referenceSettleTimeoutMs: number;
154
211
  }
155
212
  /**
156
213
  * Typed-RPC protocol head for the hydranium framework. The data-server
@@ -177,9 +234,11 @@ interface ResolvedDataServerOptions {
177
234
  * any names supplied via {@link DataServerOptions.additionalMethods}) and
178
235
  * builds the {@link DataClientProtocol} notification proxy on the same
179
236
  * connection in one {@link createRpcProxy} call (binding `this` as its
180
- * `localTarget`) under the configured namespace, and subscribes one
181
- * `DocumentBuilder.onDocumentPhase` listener per configured phase that
182
- * dispatches subscription events via `clientProxy.onDocumentUpdated`.
237
+ * `localTarget`) under the configured namespace, and subscribes two listeners
238
+ * at the configured phase: a `DocumentBuilder.onDocumentPhase` one dispatching
239
+ * per-document `clientProxy.onDocumentUpdated` for watched URIs, and a
240
+ * `DocumentBuilder.onBuildPhase` one dispatching a single
241
+ * `clientProxy.onDocumentsBuilt` naming the batch's unwatched documents.
183
242
  *
184
243
  * The data-server requires the full {@link ServerSharedServices}
185
244
  * shape — `HydraniumTextDocuments` for client-attributed updates,
@@ -198,37 +257,37 @@ interface ResolvedDataServerOptions {
198
257
  */
199
258
  export declare class DataServer<TTransfer extends TransferElement, TDiagnostic extends TransferDiagnostic = TransferDiagnostic, TProject extends Project = Project> implements DataServerProtocol<TTransfer, TDiagnostic, TProject>, DataServerDiagnosticsProtocol, Disposable {
200
259
  protected readonly connection: MessageConnection;
201
- protected readonly services: ServerSharedServices<TProject>;
260
+ protected readonly services: ServerSharedServices<TProject, TDiagnostic>;
202
261
  /**
203
262
  * Framework defaults, exposed so an adopter can spread them when
204
263
  * extending rather than restate a value the framework may change.
205
264
  */
206
- static readonly DEFAULT_OPTIONS: Required<Pick<DataServerOptions, 'subscriptionPhase'>>;
265
+ static readonly DEFAULT_OPTIONS: Required<Pick<DataServerOptions, 'subscriptionPhase' | 'referenceSettleTimeoutMs'>>;
207
266
  protected readonly options: ResolvedDataServerOptions;
208
267
  /** Subscription bookkeeping: URI → set of clientIds that subscribed for that URI. */
209
268
  protected readonly subscriptions: Map<string, Set<string>>;
210
269
  /**
211
- * Open-document bookkeeping: URI → set of clientIds that opened it over THIS
212
- * connection.
270
+ * The client sessions this connection registered, by client id. A document
271
+ * request carrying one of these ids acts as that session; one carrying any
272
+ * other id fails.
213
273
  *
214
- * Kept because the document store releases a client's hold only from an
215
- * explicit close, and a client that dies without closing would otherwise keep
216
- * the document open forever — resident, and with its last-close revert
217
- * suppressed. The store has no notion of which connection a clientId reached
218
- * it over, so the connection-scoped set has to live here; teaching it a client
219
- * identity is the more robust and much larger alternative.
274
+ * Entries stay after {@link dispose} has ended their sessions, so a request
275
+ * still running from before the connection closed reaches the ended handle
276
+ * and fails with the session's own error.
220
277
  */
221
- protected readonly openedDocuments: Map<string, Set<string>>;
278
+ protected readonly clientSessions: Map<string, ClientSession<AstNode, AstDiagnostic, TTransfer, object>>;
222
279
  /** Typed client proxy — sends `data-server/on*` notifications back over the same wire. */
223
280
  protected readonly clientProxy: DataClientProtocol<TTransfer, TDiagnostic, TProject>;
224
281
  protected readonly disposables: DisposableCollection;
225
282
  /**
226
283
  * Snapshot of the most recent `DocumentBuilder.onUpdate` event. Drives
227
284
  * `reason` discrimination on outbound `onDocumentUpdated` notifications:
228
- * a URI in the `changed` list emits `'changed'`, in `deleted` emits
229
- * `'deleted'`, otherwise `'rebuilt'` (cascade rebuild from a dependent
230
- * URI's change). The same mechanism `AstDocumentManager.onUpdate` uses on
231
- * the LSP side, so reason fidelity stays consistent between heads.
285
+ * a URI in the `changed` list emits `'changed'`, otherwise `'rebuilt'`
286
+ * (cascade rebuild from a dependent URI's change). The same mechanism
287
+ * `AstDocumentManager.onUpdate` uses on the LSP side, so reason fidelity
288
+ * stays consistent between heads. The `deleted` half is read by
289
+ * {@link dispatchDeleteEvents} rather than by the reason discrimination,
290
+ * a deletion travelling on its own channel.
232
291
  */
233
292
  protected lastBuildUpdate?: {
234
293
  changed: readonly URI[];
@@ -271,12 +330,12 @@ export declare class DataServer<TTransfer extends TransferElement, TDiagnostic e
271
330
  */
272
331
  protected readonly lastEmittedFingerprint: Map<string, string>;
273
332
  /**
274
- * URIs whose LAST client just closed. The update handler rebuilds such a
275
- * document from its disk content (discarding unsaved in-session edits),
276
- * but {@link dispatchPhaseEvent} gates on the subscription map — and the
277
- * last close typically also removed the last watcher, so consumers that
278
- * only ever fetch via `getModelDocument` would keep showing the
279
- * discarded state forever. Marked on the last-close transition (see
333
+ * URIs the text store just released after their last close. The store
334
+ * rebuilds such a document from its disk content (discarding unsaved
335
+ * in-session edits), but {@link dispatchPhaseEvent} gates on the
336
+ * subscription map — and the last close typically also removed the last
337
+ * watcher, so consumers that only ever fetch via `getModelDocument` would
338
+ * keep showing the discarded state forever. Marked on the release (see
280
339
  * {@link subscribeToTextDocumentCloses}) and consumed by
281
340
  * {@link dispatchPhaseEvent}, which broadcasts the following rebuild's
282
341
  * phase event even without a subscription — de-duplicated against
@@ -292,55 +351,84 @@ export declare class DataServer<TTransfer extends TransferElement, TDiagnostic e
292
351
  /** Per-method RPC latency collector, when the head opted in via {@link DataServerOptions.latency}. */
293
352
  protected readonly latency?: LatencyCollector;
294
353
  /** Encoder pulled from DI. Adopters rebind `services.model.TransferEncoder` to a typed-overlay subclass. */
295
- protected readonly encoder: TransferEncoder<unknown, TDiagnostic>;
354
+ protected readonly encoder: TransferEncoder<TDiagnostic>;
296
355
  /**
297
356
  * In-process workspace facade — the lifecycle delegate `get` / `update` / `save` go through.
298
- * The facade's AstDocument diagnostic shape is intentionally typed `unknown` here: adopters
299
- * carry LSP-shape diagnostics in their AstDocument (e.g. an adopter's LSP-shape diagnostic type)
300
- * while the wire shape stays `TDiagnostic extends TransferDiagnostic`. The encoder's
301
- * `astDocumentToTransferDocument` accepts both shapes (wire-shape or LSP-shape) and projects
302
- * to wire shape on the return — see `TransferEncoder.astDocumentToTransferDocument`.
357
+ * Its documents carry the AST-layer {@link AstDiagnostic}, never the wire `TDiagnostic`:
358
+ * {@link encoder} converts one into the other on the way out.
303
359
  */
304
- protected readonly modelService: ModelService<AstNode, unknown, TTransfer>;
305
- constructor(connection: MessageConnection, services: ServerSharedServices<TProject>, options?: DataServerOptions);
360
+ protected readonly modelService: ModelService<AstNode, AstDiagnostic, TTransfer>;
361
+ constructor(connection: MessageConnection, services: ServerSharedServices<TProject, TDiagnostic>, options?: DataServerOptions);
306
362
  /**
307
363
  * Release everything the constructor wired up — the bound protocol
308
364
  * handlers and every listener — and clear the subscription map and the
309
365
  * per-URI emission-fingerprint cache, so a long-lived shared services
310
366
  * bundle does not retain per-connection memory after the connection
311
- * closes. Also closes every document still open over this connection (see
312
- * {@link closeOpenDocuments}), which is the SHARED store's state rather than
313
- * this server's and so outlives the connection unless released here.
314
- *
315
- * Idempotent: subsequent calls are no-ops. Self-fires on
316
- * `connection.onClose` so adopters who don't hold a reference still
317
- * get per-connection cleanup; adopters that DO hold a reference may
318
- * call `dispose()` directly for early teardown.
319
- */
320
- dispose(): void;
321
- openModelDocument(args: OpenModelArgs): Promise<TransferDocument<TTransfer, TDiagnostic>>;
367
+ * closes. Also ends every session this connection registered, which closes
368
+ * every document it has open: the SHARED store's state rather than this
369
+ * server's, which outlives the connection unless released here.
370
+ *
371
+ * Idempotent: subsequent calls are no-ops. Runs by itself when the
372
+ * connection closes, so adopters who don't hold a reference still get
373
+ * per-connection cleanup; adopters that DO hold a reference may call
374
+ * `dispose()` directly for early teardown. The sessions end with `cause`:
375
+ * `'closed'` reverts every document whose last open they close at once,
376
+ * and `'lost'`, the connection's own close, lets each wait out the revert
377
+ * grace.
378
+ */
379
+ dispose(cause?: SessionEndCause): void;
380
+ createSession(args: CreateSessionArgs): Promise<void>;
381
+ /**
382
+ * End a session this connection registered. The ended handle stays in
383
+ * {@link clientSessions}, as it does after {@link dispose}, so a request for
384
+ * the id still arriving fails with the ended session's own error.
385
+ */
386
+ closeSession(args: CloseSessionArgs): Promise<void>;
387
+ /** End `session`, registered here under `clientId`, with `cause`, and drop its watches on this connection. */
388
+ protected endSession(clientId: string, session: ClientSession<AstNode, AstDiagnostic, TTransfer>, cause?: SessionEndCause): void;
389
+ /**
390
+ * The resumable sessions of this services tree, by client id, across all of
391
+ * its data connections: a client resumes on another connection than the one
392
+ * that registered it. An entry leaves when its session ends, by any path, so
393
+ * it keeps no ended connection alive.
394
+ *
395
+ * A takeover by resume token ends the old session even when its connection
396
+ * is still alive, so two clients that shared an id and its token would end
397
+ * each other's sessions. And the token is a guard against colliding with a
398
+ * session the server has not yet seen end, not a secret: the wire carries no
399
+ * authentication, and a peer that learns the token can end the session.
400
+ */
401
+ protected resumableSessions(): Map<string, ResumableSession>;
402
+ createModelDocument(args: CreateModelDocumentArgs): Promise<TransferDocument<TTransfer, TDiagnostic>>;
403
+ updateModelDocuments(args: TransferUpdateDocumentsArgs<TTransfer>): Promise<TransferDocument<TTransfer, TDiagnostic>[]>;
404
+ /**
405
+ * The session write a wire write request carries. Only the fields a session
406
+ * takes: a field an adopter adds to a request reaches the session only
407
+ * through an override of this.
408
+ */
409
+ protected toSessionWrite(request: Omit<TransferUpdateDocumentArgs<TTransfer>, 'clientId'>): ClientSessionWriteArgs<TTransfer>;
410
+ /**
411
+ * The session this connection registered under `clientId`, which every
412
+ * document request acts as. An id that is not one fails with the
413
+ * closed-session code: opening or writing under it would leave an open that
414
+ * no session end ever closes.
415
+ */
416
+ protected requireSession(clientId: string): ClientSession<AstNode, AstDiagnostic, TTransfer>;
417
+ openModelDocument(args: Pick<OpenModelArgs, 'uri' | 'clientId' | 'options'>): Promise<TransferDocument<TTransfer, TDiagnostic>>;
418
+ /**
419
+ * The snapshot a session's open or create answers with. When the read
420
+ * fails, `rollback` undoes the open this call made before the failure is
421
+ * rethrown: the caller sees no open, so nothing on its side would ever close
422
+ * it.
423
+ *
424
+ * Versioned with the store's shared version rather than the snapshot's own:
425
+ * the built document's `textDocument.version` lags the store's whenever the
426
+ * store assigned the version, and the store's is what a write's `basedOn` is
427
+ * compared against, so reporting the snapshot's would make the caller's
428
+ * first based-on write conflict with itself.
429
+ */
430
+ protected openedSnapshot(uri: string, rollback?: () => Promise<void>): Promise<TransferDocument<TTransfer, TDiagnostic>>;
322
431
  closeModelDocument(args: CloseModelArgs): Promise<void>;
323
- /**
324
- * Drop the recorded hold for `(uri, clientId)` so {@link dispose} does not
325
- * close it a second time. Idempotent.
326
- */
327
- protected forgetOpenDocument(uri: string, clientId: string): void;
328
- /**
329
- * Close every document still open over this connection, for the clients that
330
- * opened it here.
331
- *
332
- * The document store releases a per-URI hold only from an explicit close, so
333
- * without this a client that dies mid-session keeps its documents open for the
334
- * lifetime of the process: `isOpenInAnyClient` stays true, the document stays
335
- * resident, and the last-close revert never runs. A long-lived multi-client
336
- * head is the configuration where a dead client is normal rather than
337
- * exceptional, so the leak accumulates there.
338
- *
339
- * Runs from {@link dispose}, which is synchronous, so each close is fired and
340
- * its failure swallowed — a teardown must not reject, and a URI whose close
341
- * fails is no worse off than it was before this drain existed.
342
- */
343
- protected closeOpenDocuments(): void;
344
432
  getModelDocument(args: GetModelDocumentArgs): Promise<TransferDocument<TTransfer, TDiagnostic>>;
345
433
  updateModelDocument(args: TransferUpdateDocumentArgs<TTransfer>): Promise<TransferDocument<TTransfer, TDiagnostic>>;
346
434
  saveModelDocument(args: TransferSaveDocumentArgs<TTransfer>): Promise<TransferDocument<TTransfer, TDiagnostic>>;
@@ -395,6 +483,23 @@ export declare class DataServer<TTransfer extends TransferElement, TDiagnostic e
395
483
  * subclass.
396
484
  */
397
485
  waitForReady(): Promise<void>;
486
+ /**
487
+ * Settle the build before a reference question is answered from the index.
488
+ *
489
+ * A query issued right after a model update otherwise races the rebuild and
490
+ * reads an index missing the symbols it asks about. The cost is not confined
491
+ * to this call: a scope built inside that window is cached, and the build's
492
+ * remaining documents link against it.
493
+ *
494
+ * Waits the source document specifically, but ONLY when one is loaded at
495
+ * that URI: a synthetic source can address a URI with no document (a
496
+ * directory URI, typically), where a per-URI `waitUntil` throws "No document
497
+ * found". Falls back to a global settle, matching the id-based
498
+ * `ElementSource` path.
499
+ *
500
+ * Bounded by {@link DataServerOptions.referenceSettleTimeoutMs}.
501
+ */
502
+ protected awaitReferencesLinked(source: ReferenceSource): Promise<void>;
398
503
  findReferenceCandidates(ctx: ReferenceContext): Promise<ReferenceCandidate[]>;
399
504
  resolveReference(ref: ReferenceRequest): Promise<ReferenceTarget<TTransfer> | undefined>;
400
505
  findNextName(args: FindNextNameArgs): Promise<string>;
@@ -409,6 +514,9 @@ export declare class DataServer<TTransfer extends TransferElement, TDiagnostic e
409
514
  /**
410
515
  * Pick the language that owns a reference source, in order:
411
516
  *
517
+ * 0. A {@link isSyntheticSource} naming its own `language` routes there.
518
+ * First because every step below infers, and an inference must not
519
+ * override a caller that has said which grammar it means.
412
520
  * 1. A URI-bearing source ({@link isDocumentSource}/{@link isSyntheticSource})
413
521
  * whose URI resolves to a registered language routes by URI.
414
522
  * 2. A single-language workspace always routes to that one language — so
@@ -482,6 +590,19 @@ export declare class DataServer<TTransfer extends TransferElement, TDiagnostic e
482
590
  * single boundary point rather than spread across the callers.
483
591
  */
484
592
  protected envelope(uri: URI): TransferDocument<TTransfer, TDiagnostic>;
593
+ /**
594
+ * The transfer document a request answers with for `astDocument`, the
595
+ * store's current `dirty` stamped on it by {@link withDirtyState}. Every
596
+ * document a request answers with goes through here, so none goes out
597
+ * without the stamp.
598
+ */
599
+ protected encodeDocument(astDocument: AstDocument<AstNode, AstDiagnostic>): TransferDocument<TTransfer, TDiagnostic>;
600
+ /**
601
+ * `document` with the store's current {@link TransferDocument.dirty}. Read
602
+ * when the document is sent rather than kept with the build: a save changes
603
+ * the answer without a rebuild.
604
+ */
605
+ protected withDirtyState(document: TransferDocument<TTransfer, TDiagnostic>): TransferDocument<TTransfer, TDiagnostic>;
485
606
  /**
486
607
  * Subscribe one listener at the configured {@link DataServerOptions.subscriptionPhase}.
487
608
  * The listener dispatches subscription events for every matching URI. A
@@ -489,6 +610,42 @@ export declare class DataServer<TTransfer extends TransferElement, TDiagnostic e
489
610
  * regardless of subscriber count.
490
611
  */
491
612
  protected subscribeToDocumentBuilder(): void;
613
+ /**
614
+ * Report the documents that reached {@link DataServerOptions.subscriptionPhase}
615
+ * and that NOBODY on this
616
+ * connection is watching — the ones a client was not told about through
617
+ * {@link dispatchPhaseEvent}, which is gated per URI.
618
+ *
619
+ * **The gap this closes is the one no other source can observe.** A document
620
+ * the client watches, it hears about already. A file changed on disk, the
621
+ * host's own filesystem watcher reports — and on a browser host, where the
622
+ * workspace lives behind this head, an external change cannot happen at all.
623
+ * What is left, and what nothing outside the server can see, is a document
624
+ * rebuilt because something it DEPENDS ON changed: its file never changed, so
625
+ * a filesystem watcher is silent by construction, and it has no subscriber, so
626
+ * the update channel is silent by design. A consumer displaying data derived
627
+ * from that document — a tree label, a decorator — otherwise goes stale with
628
+ * no signal from any source, and repairs itself the moment someone opens the
629
+ * file to investigate, which is what makes it expensive to diagnose later.
630
+ *
631
+ * Payload-free on purpose: URIs only, so a client re-reads what it displays
632
+ * rather than being handed transfer documents it did not ask for. That is the
633
+ * property the subscription map protects, and it is preserved here by
634
+ * carrying no document rather than by gating the message.
635
+ *
636
+ * Quiet in the common case. Editing a document that an editor has open leaves
637
+ * that URI watched and therefore out of this set, so a build with no
638
+ * dependents produces nothing at all, and workspace initialisation produces
639
+ * nothing because it does not build to this phase. The ceiling is a
640
+ * whole-workspace rebuild at the subscription phase: one message, URIs only.
641
+ *
642
+ * The URI is canonicalised for the same reason the subscription map is keyed
643
+ * that way, and is untested for the same reason as its twin in
644
+ * {@link dispatchDeleteEvents}: the builder reports URIs out of its own
645
+ * store, so a non-canonical one cannot be produced without a fixture
646
+ * asserting a shape the real system never emits.
647
+ */
648
+ protected dispatchBuiltEvent(built: readonly LangiumDocument[]): void;
492
649
  /**
493
650
  * Subscribe to the universal save event on `HydraniumTextDocuments` so a
494
651
  * single `onDocumentSaved` wire notification fires for ANY save of a
@@ -504,13 +661,65 @@ export declare class DataServer<TTransfer extends TransferElement, TDiagnostic e
504
661
  * clients, which never clear their dirty state.
505
662
  */
506
663
  protected subscribeToTextDocumentSaves(): void;
664
+ /** Relay each change of a document's dirty state; see {@link dispatchDirtyEvent}. */
665
+ protected subscribeToDirtyChanges(): void;
666
+ /**
667
+ * Send a dirty flip to the connection, gated by the subscription map as
668
+ * {@link dispatchSaveEvent} is: the answer at any one moment travels on
669
+ * every document sent, so a client that watches nothing reads it there.
670
+ */
671
+ protected dispatchDirtyEvent(event: DocumentDirtyChangedEvent): void;
507
672
  /**
508
- * Mark the last-close transition per URI (see
509
- * {@link pendingRevertBroadcasts}). The listener consults
510
- * `isOpenInAnyClient` AFTER the store decremented the closing client's
511
- * hold, so a `false` answer means this close was the last one.
673
+ * Mark each document the store releases after its last close (see
674
+ * {@link pendingRevertBroadcasts}). A release, not the close itself: a
675
+ * document whose last client lost its connection is released only once
676
+ * the revert grace runs out, or when another client opens it meanwhile, and
677
+ * not at all when a client lost from it opens it again within its own
678
+ * grace.
512
679
  */
513
680
  protected subscribeToTextDocumentCloses(): void;
681
+ /**
682
+ * Fan out a deletion for each removed URI, to EVERY client on the connection
683
+ * rather than only to the ones watching that URI.
684
+ *
685
+ * **Deliberately ungated, where {@link dispatchPhaseEvent} and
686
+ * {@link dispatchSaveEvent} are gated.** Those two carry a built document and
687
+ * fire on every build, so the subscription map is what keeps bandwidth
688
+ * proportional to what a client asked for. A deletion is neither: it is one
689
+ * URI, it is rare, and it reports the workspace's STRUCTURE rather than a
690
+ * document's content. Gating it forces any consumer that displays the
691
+ * workspace — a model tree, a file decorator — to learn about disappearances
692
+ * from a filesystem watcher instead, which a client hosted in a browser has
693
+ * no way to run: its workspace lives behind the head. A client that does not
694
+ * care filters on the URI, which costs it a comparison.
695
+ *
696
+ * The precedent is the last-close revert broadcast (see
697
+ * {@link pendingRevertBroadcasts}), where the same judgement was already made
698
+ * in the other direction: a transition that matters enough is delivered
699
+ * without a subscription.
700
+ *
701
+ * Runs from the `DocumentBuilder.onUpdate` listener rather than from a phase
702
+ * listener, which is the only place a deletion is observable: `update`
703
+ * removes the document before deriving the rebuild set, so it is never built.
704
+ * That ordering also puts this notification ahead of the `'rebuilt'` events
705
+ * for the dependents whose references the deletion just broke.
706
+ *
707
+ * The `deleted` list arrives already expanded to concrete document URIs —
708
+ * `deleteDocuments` resolves a directory URI to the documents beneath it — so
709
+ * no caller has to handle a directory here.
710
+ *
711
+ * Per-URI derived state is dropped for the same reason it is dropped
712
+ * anywhere: it describes a document that no longer exists.
713
+ * {@link lastEmittedFingerprint} in particular can outlive its subscriptions
714
+ * through the last-close revert path — left behind, it is adopted as the
715
+ * baseline by the next {@link watchModelDocument} and suppresses the first
716
+ * emit after the file returns with its previous content.
717
+ *
718
+ * The subscription itself SURVIVES: a recreated file resumes delivering to
719
+ * the same watchers with no re-subscription, and a client that answers the
720
+ * deletion by closing releases the watch through `closeModelDocument` anyway.
721
+ */
722
+ protected dispatchDeleteEvents(deleted: readonly URI[]): void;
514
723
  /** Fan out a save event for the document's URI, gated by the subscription map. */
515
724
  protected dispatchSaveEvent(event: ClientTextDocumentChangeEvent<TextDocument>): void;
516
725
  /**
@@ -556,16 +765,16 @@ export declare class DataServer<TTransfer extends TransferElement, TDiagnostic e
556
765
  /**
557
766
  * Discriminate the reason for a phase-event-driven update notification.
558
767
  * Uses the most recent `DocumentBuilder.onUpdate` snapshot:
559
- * - URI in the `deleted` list → `'deleted'`
560
768
  * - URI in the `changed` list → `'changed'` (the URI was passed to
561
769
  * `documentBuilder.update(changed, deleted)`, which spans `didChange`
562
770
  * text-document events and programmatic `update([uri], [])` calls).
563
771
  * - Otherwise → `'rebuilt'` (cascade re-derivation: this URI was rebuilt
564
772
  * because something it depends on changed; its own text wasn't flagged).
565
773
  *
566
- * `'saved'` is NOT emitted from this code path — saves take the dedicated
567
- * `DataClientProtocol.onDocumentSaved` channel; adopters that want a
568
- * unified update stream synthesise `'saved'` in their bridge layer.
774
+ * `'saved'` is NOT emitted here — saves take the dedicated
775
+ * `DataClientProtocol.onDocumentSaved` channel, and adopters wanting a
776
+ * unified stream synthesise it in their bridge layer. A deletion is not a
777
+ * reason at all; see {@link dispatchDeleteEvents}.
569
778
  */
570
779
  protected resolveUpdateReason(uri: URI): TransferDocumentUpdatedEvent<TTransfer, TDiagnostic>['reason'];
571
780
  /**
@@ -610,5 +819,4 @@ export declare class DataServer<TTransfer extends TransferElement, TDiagnostic e
610
819
  /** Resolve a partial options object into a fully-defaulted form. */
611
820
  protected resolveOptions(partial: DataServerOptions): ResolvedDataServerOptions;
612
821
  }
613
- export {};
614
822
  //# sourceMappingURL=data-server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"data-server.d.ts","sourceRoot":"","sources":["../src/data-server.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAEJ,oBAAoB,EAIpB,eAAe,EACf,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,OAAO,EACZ,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,MAAM,EACX,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAIJ,KAAK,kBAAkB,EACvB,KAAK,6BAA6B,EAClC,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACv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