@hydranium/glsp-server 1.0.0-next.67 → 1.0.0-next.70

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
@@ -20,8 +20,8 @@ the diagram model is adopter-side, bound per diagram module.
20
20
  over the GModel.
21
21
  - **Load / save against the live AST.** `HydraniumGlspStorage` loads a document
22
22
  on diagram open and writes user operations back through the shared model
23
- coordination layer, with `SaveConflictPolicy` deciding what a concurrent
24
- external write means. `HydraniumGlspRecordingCommand` is the operation-handler
23
+ coordination layer, with `SaveDeliveryPolicy` deciding whether the save action
24
+ awaits the write. `HydraniumGlspRecordingCommand` is the operation-handler
25
25
  seam — the framework provides no base handler class.
26
26
  - **A submission and dispatch lifecycle that waits for the model.**
27
27
  `HydraniumGlspSubmissionHandler` gates submit on the readiness event,
@@ -12,7 +12,7 @@ import { type AstNode } from '@hydranium/langium';
12
12
  import { AstDocument, type AstDocumentSavedEvent, type AstDocumentUpdatedEvent, type ServerSharedServices } from '@hydranium/core';
13
13
  import { type AbstractHydraniumGlspState } from '../state/abstract-hydranium-glsp-state.js';
14
14
  import { type HydraniumGlspSubmissionHandler } from '../submission/hydranium-glsp-submission-handler.js';
15
- import { SaveConflictPolicy } from './save-conflict-policy.js';
15
+ import { SaveDeliveryPolicy } from './save-delivery-policy.js';
16
16
  /**
17
17
  * A save action arrived with nowhere to write to. A save action carries no
18
18
  * request id, so it falls through to the error handler and `message` becomes
@@ -72,17 +72,14 @@ export declare const DIAGRAM_READONLY_PARSE_ERROR: import("@hydranium/protocol")
72
72
  *
73
73
  * Adopters with richer needs override the seams ({@link isStructurallyBroken},
74
74
  * {@link onParseErrorChanged}, {@link onSourceModelSettled}) rather than the
75
- * whole flow, and select a {@link SaveConflictPolicy} via the bound option to
76
- * tune how {@link saveSourceModel} reacts to a concurrent edit.
75
+ * whole flow, and select a {@link SaveDeliveryPolicy} via the bound option to
76
+ * tune how {@link saveSourceModel} delivers its result.
77
77
  *
78
- * **Default `saveSourceModel` flow.** Delegates to `ModelService.save`, which
79
- * serialises through the language-specific `Serializer` bound at
80
- * `services.serializer.Serializer` (resolved per-URI via `ServiceRegistry`),
81
- * updates the multi-client text-document store, drives a rebuild, and writes the
82
- * result via the `WritableFileSystemProvider`. The bound
83
- * {@link SaveConflictPolicy} (default {@link DEFAULT_SAVE_CONFLICT_POLICY},
84
- * `overwrite`) decides the based-on-version guard, await-vs-fire-and-forget, and
85
- * failure handling.
78
+ * **Default `saveSourceModel` flow.** Flushes the stored text of the primary and
79
+ * every tracked secondary via `AstDocumentManager.save`, with no serializer in
80
+ * the path the update path already put the settled text in the store. The
81
+ * bound {@link SaveDeliveryPolicy} (default {@link DEFAULT_SAVE_DELIVERY_POLICY},
82
+ * `await`) decides await-vs-fire-and-forget and failure handling.
86
83
  *
87
84
  * **tempId filter.** GLSP's `DefaultGlobalActionProvider` spins up a
88
85
  * throwaway per-diagram-type container with upstream's {@link TEMPORARY_CLIENT_ID}
@@ -114,14 +111,13 @@ export declare class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel =
114
111
  */
115
112
  protected readonly modelValidator?: ModelValidator;
116
113
  /**
117
- * Selected {@link SaveConflictPolicy} for {@link saveSourceModel}. Bind the
118
- * {@link SaveConflictPolicy} token in a `DiagramModule` to choose a policy;
119
- * left unbound it resolves to {@link DEFAULT_SAVE_CONFLICT_POLICY}
120
- * (`overwrite`, last-write-wins). Read via {@link saveConflictPolicy} so the
121
- * fallback is applied even when inversify injects `undefined` for an unbound
122
- * `@optional()` member.
114
+ * Selected {@link SaveDeliveryPolicy} for {@link saveSourceModel}. Bind the
115
+ * {@link SaveDeliveryPolicy} token in a `DiagramModule` to choose a policy;
116
+ * left unbound it resolves to {@link DEFAULT_SAVE_DELIVERY_POLICY}. Read via
117
+ * {@link saveDeliveryPolicy} so the fallback is applied even when inversify
118
+ * injects `undefined` for an unbound `@optional()` member.
123
119
  */
124
- protected readonly boundSaveConflictPolicy?: SaveConflictPolicy;
120
+ protected readonly boundSaveDeliveryPolicy?: SaveDeliveryPolicy;
125
121
  /** Disposables created during {@link doLoadSourceModel}; drained on session disposal. */
126
122
  protected toDispose: DisposableCollection;
127
123
  /**
@@ -335,31 +331,55 @@ export declare class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel =
335
331
  * captured (e.g. an adopter-specific status or palette refresh). Default: none.
336
332
  */
337
333
  protected onSourceModelSettled(_document: AstDocument<AstNode, never>): Action[];
338
- /** The effective {@link SaveConflictPolicy}: the bound option, or {@link DEFAULT_SAVE_CONFLICT_POLICY} when unbound. */
339
- protected get saveConflictPolicy(): SaveConflictPolicy;
334
+ /** The effective {@link SaveDeliveryPolicy}: the bound option, or {@link DEFAULT_SAVE_DELIVERY_POLICY} when unbound. */
335
+ protected get saveDeliveryPolicy(): SaveDeliveryPolicy;
340
336
  /**
341
- * Default save flow: route through `ModelService.save`. The framework
342
- * serialise-and-persist machinery handles serialisation (via the
343
- * language-specific `Serializer` bound at `services.serializer.Serializer`),
344
- * the multi-client text-document update, the rebuild, and the eventual
345
- * `WritableFileSystemProvider.writeFile`.
337
+ * Default save flow: persist the store's current text for every document this
338
+ * diagram owns.
346
339
  *
347
- * The configured {@link SaveConflictPolicy} (see {@link saveConflictPolicy})
348
- * decides how a concurrent edit that advanced the document is handled:
349
- * - `overwrite` (default): no based-on guard, await, propagate failures
350
- * last-write-wins, correct for a single-editor head.
351
- * - `reject`: guard on the captured `state.version`, await, surface a
352
- * `ConflictError` (and any other failure) to the GLSP save action.
353
- * - `drop-and-log`: guard, fire-and-forget, log + swallow failures — a stale
354
- * diagram save is dropped because a concurrent form/code edit already wrote
355
- * the truth, and GLSP exposes no save-failure back-channel.
340
+ * **A save persists, it does not author.** Every diagram gesture already
341
+ * reached the store through `ModelService.update`, so the store holds the
342
+ * settled text and disk is the only thing behind. Re-serializing from the AST
343
+ * here cannot improve on that text and can only damage it: a serializer
344
+ * normalises formatting and carries no comments, so a save would reflow and
345
+ * strip a document nothing changed which is what a pure bounds drag does to
346
+ * the semantic file when only its layout moved.
347
+ *
348
+ * **The write set is the primary plus every tracked secondary**
349
+ * (`AbstractHydraniumGlspState.trackSecondaryDocument`), so a document the
350
+ * diagram wrote is persisted whether or not it is the one the client named.
351
+ * The primary is flushed first, then secondaries in tracking order. A
352
+ * document no client holds open is skipped — there is no stored text to
353
+ * persist.
354
+ *
355
+ * **A save therefore names documents the gesture did not aim at**, which is
356
+ * why an unchanged one is not rewritten even though the user asked for a
357
+ * save: the mtime would move on a file they never touched.
358
+ * `AstDocumentManager.save` decides that per document and announces the save
359
+ * either way.
360
+ *
361
+ * The configured {@link SaveDeliveryPolicy} (see {@link saveDeliveryPolicy})
362
+ * decides await-vs-fire-and-forget and failure handling. It carries no
363
+ * based-on guard: the guard exists to stop a stale writer overwriting a newer
364
+ * document, and a flush persists the store — which already holds every other
365
+ * client's change, including the one that advanced the version.
356
366
  *
357
367
  * Returns `MaybePromise<void>` to match upstream `SourceModelStorage`:
358
- * resolves with the persist under `overwrite`/`reject`, returns synchronously
359
- * under `drop-and-log`. Adopters that bypass `ModelService` (writing through
360
- * `WritableFileSystemProvider` directly) still override the whole method.
368
+ * resolves with the flush under `await`, returns synchronously under
369
+ * `fire-and-forget`. Adopters that bypass `AstDocumentManager` (writing
370
+ * through `WritableFileSystemProvider` directly) still override the whole
371
+ * method.
361
372
  */
362
373
  saveSourceModel(action: SaveModelAction): MaybePromise<void>;
374
+ /**
375
+ * Save the stored text of `primaryUri` and every tracked secondary.
376
+ *
377
+ * Deduplicated, because a state that tracks its own primary as a secondary
378
+ * would otherwise save it twice and fire two save notifications for one
379
+ * save. A document no client holds open is skipped: there is no stored text
380
+ * to persist, and `AstDocumentManager.save` throws on one.
381
+ */
382
+ protected flushWriteSet(primaryUri: string): Promise<void>;
363
383
  /**
364
384
  * Normalise GLSP's `sourceUri` — which may be a filesystem PATH or a URI
365
385
  * string — to the URI string the workspace keys documents by.
@@ -1 +1 @@
1
- {"version":3,"file":"hydranium-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D;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IACH,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,YAAY,CAAC,IAAI,CAAC;IAqB5D;;;;;;;OAOG;cACa,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAShE;;;;;;;;;;;;;;;;OAgBG;IACH,SAAS,CAAC,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAIrD;;;;;;;;;;;;;;;;;;;OAmBG;IACH,SAAS,CAAC,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM;IAW1D;;;;;;;;;;;;;;;;;;;OAmBG;IACH,SAAS,CAAC,UAAU,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM;IAWrD;;;;;;;;;;;;OAYG;IACG,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ/C,eAAe,CAAC,cAAc,EAAE,aAAa,GAAG,IAAI;IAIpD;;;;;OAKG;IACH,OAAO,IAAI,IAAI;CAQjB"}
@@ -23,7 +23,7 @@ import { URI } from '@hydranium/langium';
23
23
  import { AstDocument } from '@hydranium/core';
24
24
  import { DiagnosticSeverity } from 'vscode-languageserver-types';
25
25
  import { HydraniumTypes } from '../state/hydranium-shared-core-services.js';
26
- import { DEFAULT_SAVE_CONFLICT_POLICY, SaveConflictPolicy } from './save-conflict-policy.js';
26
+ import { DEFAULT_SAVE_DELIVERY_POLICY, SaveDeliveryPolicy } from './save-delivery-policy.js';
27
27
  /**
28
28
  * A save action arrived with nowhere to write to. A save action carries no
29
29
  * request id, so it falls through to the error handler and `message` becomes
@@ -108,17 +108,14 @@ function isStructuralDiagnostic(diagnostic) {
108
108
  *
109
109
  * Adopters with richer needs override the seams ({@link isStructurallyBroken},
110
110
  * {@link onParseErrorChanged}, {@link onSourceModelSettled}) rather than the
111
- * whole flow, and select a {@link SaveConflictPolicy} via the bound option to
112
- * tune how {@link saveSourceModel} reacts to a concurrent edit.
111
+ * whole flow, and select a {@link SaveDeliveryPolicy} via the bound option to
112
+ * tune how {@link saveSourceModel} delivers its result.
113
113
  *
114
- * **Default `saveSourceModel` flow.** Delegates to `ModelService.save`, which
115
- * serialises through the language-specific `Serializer` bound at
116
- * `services.serializer.Serializer` (resolved per-URI via `ServiceRegistry`),
117
- * updates the multi-client text-document store, drives a rebuild, and writes the
118
- * result via the `WritableFileSystemProvider`. The bound
119
- * {@link SaveConflictPolicy} (default {@link DEFAULT_SAVE_CONFLICT_POLICY},
120
- * `overwrite`) decides the based-on-version guard, await-vs-fire-and-forget, and
121
- * failure handling.
114
+ * **Default `saveSourceModel` flow.** Flushes the stored text of the primary and
115
+ * every tracked secondary via `AstDocumentManager.save`, with no serializer in
116
+ * the path the update path already put the settled text in the store. The
117
+ * bound {@link SaveDeliveryPolicy} (default {@link DEFAULT_SAVE_DELIVERY_POLICY},
118
+ * `await`) decides await-vs-fire-and-forget and failure handling.
122
119
  *
123
120
  * **tempId filter.** GLSP's `DefaultGlobalActionProvider` spins up a
124
121
  * throwaway per-diagram-type container with upstream's {@link TEMPORARY_CLIENT_ID}
@@ -150,14 +147,13 @@ let HydraniumGlspStorage = class HydraniumGlspStorage {
150
147
  */
151
148
  modelValidator;
152
149
  /**
153
- * Selected {@link SaveConflictPolicy} for {@link saveSourceModel}. Bind the
154
- * {@link SaveConflictPolicy} token in a `DiagramModule` to choose a policy;
155
- * left unbound it resolves to {@link DEFAULT_SAVE_CONFLICT_POLICY}
156
- * (`overwrite`, last-write-wins). Read via {@link saveConflictPolicy} so the
157
- * fallback is applied even when inversify injects `undefined` for an unbound
158
- * `@optional()` member.
150
+ * Selected {@link SaveDeliveryPolicy} for {@link saveSourceModel}. Bind the
151
+ * {@link SaveDeliveryPolicy} token in a `DiagramModule` to choose a policy;
152
+ * left unbound it resolves to {@link DEFAULT_SAVE_DELIVERY_POLICY}. Read via
153
+ * {@link saveDeliveryPolicy} so the fallback is applied even when inversify
154
+ * injects `undefined` for an unbound `@optional()` member.
159
155
  */
160
- boundSaveConflictPolicy;
156
+ boundSaveDeliveryPolicy;
161
157
  /** Disposables created during {@link doLoadSourceModel}; drained on session disposal. */
162
158
  toDispose = new DisposableCollection();
163
159
  /**
@@ -528,31 +524,46 @@ let HydraniumGlspStorage = class HydraniumGlspStorage {
528
524
  onSourceModelSettled(_document) {
529
525
  return [];
530
526
  }
531
- /** The effective {@link SaveConflictPolicy}: the bound option, or {@link DEFAULT_SAVE_CONFLICT_POLICY} when unbound. */
532
- get saveConflictPolicy() {
533
- return this.boundSaveConflictPolicy ?? DEFAULT_SAVE_CONFLICT_POLICY;
527
+ /** The effective {@link SaveDeliveryPolicy}: the bound option, or {@link DEFAULT_SAVE_DELIVERY_POLICY} when unbound. */
528
+ get saveDeliveryPolicy() {
529
+ return this.boundSaveDeliveryPolicy ?? DEFAULT_SAVE_DELIVERY_POLICY;
534
530
  }
535
531
  /**
536
- * Default save flow: route through `ModelService.save`. The framework
537
- * serialise-and-persist machinery handles serialisation (via the
538
- * language-specific `Serializer` bound at `services.serializer.Serializer`),
539
- * the multi-client text-document update, the rebuild, and the eventual
540
- * `WritableFileSystemProvider.writeFile`.
532
+ * Default save flow: persist the store's current text for every document this
533
+ * diagram owns.
541
534
  *
542
- * The configured {@link SaveConflictPolicy} (see {@link saveConflictPolicy})
543
- * decides how a concurrent edit that advanced the document is handled:
544
- * - `overwrite` (default): no based-on guard, await, propagate failures
545
- * last-write-wins, correct for a single-editor head.
546
- * - `reject`: guard on the captured `state.version`, await, surface a
547
- * `ConflictError` (and any other failure) to the GLSP save action.
548
- * - `drop-and-log`: guard, fire-and-forget, log + swallow failures — a stale
549
- * diagram save is dropped because a concurrent form/code edit already wrote
550
- * the truth, and GLSP exposes no save-failure back-channel.
535
+ * **A save persists, it does not author.** Every diagram gesture already
536
+ * reached the store through `ModelService.update`, so the store holds the
537
+ * settled text and disk is the only thing behind. Re-serializing from the AST
538
+ * here cannot improve on that text and can only damage it: a serializer
539
+ * normalises formatting and carries no comments, so a save would reflow and
540
+ * strip a document nothing changed which is what a pure bounds drag does to
541
+ * the semantic file when only its layout moved.
542
+ *
543
+ * **The write set is the primary plus every tracked secondary**
544
+ * (`AbstractHydraniumGlspState.trackSecondaryDocument`), so a document the
545
+ * diagram wrote is persisted whether or not it is the one the client named.
546
+ * The primary is flushed first, then secondaries in tracking order. A
547
+ * document no client holds open is skipped — there is no stored text to
548
+ * persist.
549
+ *
550
+ * **A save therefore names documents the gesture did not aim at**, which is
551
+ * why an unchanged one is not rewritten even though the user asked for a
552
+ * save: the mtime would move on a file they never touched.
553
+ * `AstDocumentManager.save` decides that per document and announces the save
554
+ * either way.
555
+ *
556
+ * The configured {@link SaveDeliveryPolicy} (see {@link saveDeliveryPolicy})
557
+ * decides await-vs-fire-and-forget and failure handling. It carries no
558
+ * based-on guard: the guard exists to stop a stale writer overwriting a newer
559
+ * document, and a flush persists the store — which already holds every other
560
+ * client's change, including the one that advanced the version.
551
561
  *
552
562
  * Returns `MaybePromise<void>` to match upstream `SourceModelStorage`:
553
- * resolves with the persist under `overwrite`/`reject`, returns synchronously
554
- * under `drop-and-log`. Adopters that bypass `ModelService` (writing through
555
- * `WritableFileSystemProvider` directly) still override the whole method.
563
+ * resolves with the flush under `await`, returns synchronously under
564
+ * `fire-and-forget`. Adopters that bypass `AstDocumentManager` (writing
565
+ * through `WritableFileSystemProvider` directly) still override the whole
566
+ * method.
556
567
  */
557
568
  saveSourceModel(action) {
558
569
  // Normalised for the same reason the load path is: `SaveModelAction.fileUri`
@@ -562,24 +573,33 @@ let HydraniumGlspStorage = class HydraniumGlspStorage {
562
573
  // the call site rather than inside `getFileUri` so that method's contract —
563
574
  // return what the action said — is unchanged for adopters overriding it.
564
575
  const uri = this.toSourceModelUri(this.getFileUri(action));
565
- const policy = this.saveConflictPolicy;
566
- const persisted = this.sharedServices.model.ModelService.save({
567
- uri,
568
- model: this.state.sourceRoot,
569
- clientId: this.state.clientId,
570
- baseVersion: policy.kind === 'overwrite' ? undefined : this.state.version
571
- }).then(() => undefined);
572
- if (policy.kind === 'drop-and-log') {
573
- // Fire-and-forget: the diagram save lost the race to a concurrent edit
574
- // that already persisted the truth, so it must neither block the action
575
- // nor surface. Log rather than leave an unhandled rejection.
576
+ const policy = this.saveDeliveryPolicy;
577
+ const persisted = this.flushWriteSet(uri);
578
+ if (policy.kind === 'fire-and-forget') {
579
+ // Log rather than leave an unhandled rejection: the promise is not
580
+ // returned, so nothing else will observe a failure.
576
581
  persisted.catch(error => this.logger.error(`Save failed for ${uri}: ${error instanceof Error ? error.message : String(error)}`));
577
582
  return undefined;
578
583
  }
579
- // overwrite / reject: await; a ConflictError (reject) or any other failure
580
- // propagates to GLSP's save-action handler.
584
+ // Awaited: any failure propagates to GLSP's save-action handler.
581
585
  return persisted;
582
586
  }
587
+ /**
588
+ * Save the stored text of `primaryUri` and every tracked secondary.
589
+ *
590
+ * Deduplicated, because a state that tracks its own primary as a secondary
591
+ * would otherwise save it twice and fire two save notifications for one
592
+ * save. A document no client holds open is skipped: there is no stored text
593
+ * to persist, and `AstDocumentManager.save` throws on one.
594
+ */
595
+ async flushWriteSet(primaryUri) {
596
+ const documents = this.sharedServices.workspace.AstDocumentManager;
597
+ for (const target of new Set([primaryUri, ...this.state.secondaryUris])) {
598
+ if (documents.isOpen(target)) {
599
+ await documents.save(target, this.state.clientId);
600
+ }
601
+ }
602
+ }
583
603
  /**
584
604
  * Normalise GLSP's `sourceUri` — which may be a filesystem PATH or a URI
585
605
  * string — to the URI string the workspace keys documents by.
@@ -726,10 +746,10 @@ __decorate([
726
746
  __metadata("design:type", Object)
727
747
  ], HydraniumGlspStorage.prototype, "modelValidator", void 0);
728
748
  __decorate([
729
- inject(SaveConflictPolicy),
749
+ inject(SaveDeliveryPolicy),
730
750
  optional(),
731
751
  __metadata("design:type", Object)
732
- ], HydraniumGlspStorage.prototype, "boundSaveConflictPolicy", void 0);
752
+ ], HydraniumGlspStorage.prototype, "boundSaveDeliveryPolicy", void 0);
733
753
  __decorate([
734
754
  postConstruct(),
735
755
  __metadata("design:type", Function),
@@ -1 +1 @@
1
- {"version":3,"file":"hydranium-glsp-storage.js","sourceRoot":"","sources":["../../src/storage/hydranium-glsp-storage.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;;;;;;;;;;AAElF,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAEJ,gBAAgB,EAGhB,oBAAoB,EACpB,YAAY,EAGZ,QAAQ,EACR,eAAe,EACf,MAAM,IAAI,UAAU,EAEpB,UAAU,EACV,sBAAsB,EACtB,cAAc,EAEd,cAAc,EAEd,iBAAiB,EAEjB,mBAAmB,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAExE,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAuF,MAAM,iBAAiB,CAAC;AACnI,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAGjE,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,4BAA4B,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE7F;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAC7C,2CAA2C,EAC3C,8CAA8C,CAChD,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAC5C,0CAA0C,EAC1C,2EAA2E,CAC7E,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,aAAa,CACtD,oDAAoD,EACpD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AC1B,CAAC;QACD,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,CAAC;QACpC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IAC5B,CAAC;CACH,CAAA;AA3nByC;IAAtC,MAAM,CAAC,UAAU,CAAC;8BAA6B,UAAU;oDAAC;AACG;IAA7D,MAAM,CAAC,cAAc,CAAC,kBAAkB,CAAC;;4DAA0D;AAC7D;IAAtC,MAAM,CAAC,UAAU,CAAC;;mDAA4E;AAC9C;IAAhD,MAAM,CAAC,oBAAoB,CAAC;;4DAA0D;AAC1C;IAA5C,MAAM,CAAC,gBAAgB,CAAC;;8DAAwD;AAC9B;IAAlD,MAAM,CAAC,sBAAsB,CAAC;;+DAA4F;AAClF;IAAxC,MAAM,CAAC,YAAY,CAAC;;0DAAuD;AASrB;IAAtD,MAAM,CAAC,cAAc,CAAC;IAAE,QAAQ,EAAE;;4DAAoD;AAS5B;IAA1D,MAAM,CAAC,kBAAkB,CAAC;IAAE,QAAQ,EAAE;;qEAAiE;AAqC9F;IADT,aAAa,EAAE;;;;gDAcf;AA7ES,oBAAoB;IADhC,UAAU,EAAE;GACA,oBAAoB,CA8nBhC"}
@@ -7,5 +7,5 @@
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
9
  export * from './hydranium-glsp-storage.js';
10
- export * from './save-conflict-policy.js';
10
+ export * from './save-delivery-policy.js';
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -7,5 +7,5 @@
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
9
  export * from './hydranium-glsp-storage.js';
10
- export * from './save-conflict-policy.js';
10
+ export * from './save-delivery-policy.js';
11
11
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,46 @@
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
+ /**
10
+ * How `HydraniumGlspStorage.saveSourceModel` delivers its result: whether the
11
+ * GLSP save action awaits the write, and what happens on failure.
12
+ *
13
+ * The two are not independent — fire-and-forget plus rethrow would leave an
14
+ * unhandled rejection — so each arm bundles them into one coherent, nameable
15
+ * policy an adopter selects whole. It is a *selection of configuration*,
16
+ * delivered as a bound option (see the {@link SaveDeliveryPolicy} symbol) rather
17
+ * than a behaviour hook.
18
+ *
19
+ * **Neither arm guards on a based-on version.** A save flushes the store's
20
+ * settled text rather than authoring from the diagram's captured model, and the
21
+ * store already holds every other client's change — so a guard here refuses a
22
+ * write whose content is already correct. The gate that does exist sits on the
23
+ * update path, per operation, where the diagram authors.
24
+ */
25
+ export type SaveDeliveryPolicy =
26
+ /** Await the write and propagate any failure to the GLSP save action. The default. */
27
+ {
28
+ kind: 'await';
29
+ }
30
+ /**
31
+ * Fire-and-forget, logging and swallowing every failure. Correct when a
32
+ * failed diagram save must neither block the action nor surface as an error.
33
+ */
34
+ | {
35
+ kind: 'fire-and-forget';
36
+ };
37
+ /** The policy applied when no {@link SaveDeliveryPolicy} option is bound. */
38
+ export declare const DEFAULT_SAVE_DELIVERY_POLICY: SaveDeliveryPolicy;
39
+ /**
40
+ * DI token for the {@link SaveDeliveryPolicy} option. Bind a constant value in a
41
+ * `DiagramModule` to select a non-default policy; left unbound,
42
+ * `HydraniumGlspStorage` falls back to {@link DEFAULT_SAVE_DELIVERY_POLICY}.
43
+ * Shares its name with the type, the way a `class` is both a value and a type.
44
+ */
45
+ export declare const SaveDeliveryPolicy: unique symbol;
46
+ //# sourceMappingURL=save-delivery-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"save-delivery-policy.d.ts","sourceRoot":"","sources":["../../src/storage/save-delivery-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,kBAAkB;AAC3B,sFAAsF;AACpF;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE;AACnB;;;GAGG;GACD;IAAE,IAAI,EAAE,iBAAiB,CAAA;CAAE,CAAC;AAEjC,6EAA6E;AAC7E,eAAO,MAAM,4BAA4B,EAAE,kBAAsC,CAAC;AAElF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,eAA+B,CAAC"}
@@ -6,14 +6,13 @@
6
6
  *
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
- /** The policy applied when no {@link SaveConflictPolicy} option is bound. */
10
- export const DEFAULT_SAVE_CONFLICT_POLICY = { kind: 'overwrite' };
9
+ /** The policy applied when no {@link SaveDeliveryPolicy} option is bound. */
10
+ export const DEFAULT_SAVE_DELIVERY_POLICY = { kind: 'await' };
11
11
  /**
12
- * DI token for the {@link SaveConflictPolicy} option. Bind a constant value in a
12
+ * DI token for the {@link SaveDeliveryPolicy} option. Bind a constant value in a
13
13
  * `DiagramModule` to select a non-default policy; left unbound,
14
- * `HydraniumGlspStorage` falls back to
15
- * {@link DEFAULT_SAVE_CONFLICT_POLICY}. Shares its name with the type, the way a
16
- * `class` is both a value and a type.
14
+ * `HydraniumGlspStorage` falls back to {@link DEFAULT_SAVE_DELIVERY_POLICY}.
15
+ * Shares its name with the type, the way a `class` is both a value and a type.
17
16
  */
18
- export const SaveConflictPolicy = Symbol('SaveConflictPolicy');
19
- //# sourceMappingURL=save-conflict-policy.js.map
17
+ export const SaveDeliveryPolicy = Symbol('SaveDeliveryPolicy');
18
+ //# sourceMappingURL=save-delivery-policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"save-delivery-policy.js","sourceRoot":"","sources":["../../src/storage/save-delivery-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AA2BlF,6EAA6E;AAC7E,MAAM,CAAC,MAAM,4BAA4B,GAAuB,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAElF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hydranium/glsp-server",
3
- "version": "1.0.0-next.67",
3
+ "version": "1.0.0-next.70",
4
4
  "description": "GLSP protocol head for the hydranium framework. Peer of @hydranium/core/lsp and @hydranium/data-server; built on @hydranium/core.",
5
5
  "keywords": [
6
6
  "hydranium",
@@ -87,9 +87,9 @@
87
87
  "devDependencies": {
88
88
  "@eclipse-glsp/protocol": "2.7.0",
89
89
  "@eclipse-glsp/server": "2.7.0",
90
- "@hydranium/core": "1.0.0-next.67",
91
- "@hydranium/langium": "1.0.0-next.67",
92
- "@hydranium/protocol": "1.0.0-next.67",
90
+ "@hydranium/core": "1.0.0-next.70",
91
+ "@hydranium/langium": "1.0.0-next.70",
92
+ "@hydranium/protocol": "1.0.0-next.70",
93
93
  "inversify": "6.2.2",
94
94
  "reflect-metadata": "0.2.2",
95
95
  "rimraf": "^5.0.0",
@@ -100,9 +100,9 @@
100
100
  "peerDependencies": {
101
101
  "@eclipse-glsp/protocol": "^2.6.0",
102
102
  "@eclipse-glsp/server": "^2.6.0",
103
- "@hydranium/core": "1.0.0-next.67",
104
- "@hydranium/langium": "1.0.0-next.67",
105
- "@hydranium/protocol": "1.0.0-next.67",
103
+ "@hydranium/core": "1.0.0-next.70",
104
+ "@hydranium/langium": "1.0.0-next.70",
105
+ "@hydranium/protocol": "1.0.0-next.70",
106
106
  "inversify": "^6.0.0",
107
107
  "reflect-metadata": "^0.2.2",
108
108
  "vscode-jsonrpc": "9.0.1",
@@ -40,7 +40,7 @@ import { DiagnosticSeverity } from 'vscode-languageserver-types';
40
40
  import { type AbstractHydraniumGlspState } from '../state/abstract-hydranium-glsp-state.js';
41
41
  import { type HydraniumGlspSubmissionHandler } from '../submission/hydranium-glsp-submission-handler.js';
42
42
  import { HydraniumTypes } from '../state/hydranium-shared-core-services.js';
43
- import { DEFAULT_SAVE_CONFLICT_POLICY, SaveConflictPolicy } from './save-conflict-policy.js';
43
+ import { DEFAULT_SAVE_DELIVERY_POLICY, SaveDeliveryPolicy } from './save-delivery-policy.js';
44
44
 
45
45
  /**
46
46
  * A save action arrived with nowhere to write to. A save action carries no
@@ -141,17 +141,14 @@ function isStructuralDiagnostic(diagnostic: unknown): boolean {
141
141
  *
142
142
  * Adopters with richer needs override the seams ({@link isStructurallyBroken},
143
143
  * {@link onParseErrorChanged}, {@link onSourceModelSettled}) rather than the
144
- * whole flow, and select a {@link SaveConflictPolicy} via the bound option to
145
- * tune how {@link saveSourceModel} reacts to a concurrent edit.
144
+ * whole flow, and select a {@link SaveDeliveryPolicy} via the bound option to
145
+ * tune how {@link saveSourceModel} delivers its result.
146
146
  *
147
- * **Default `saveSourceModel` flow.** Delegates to `ModelService.save`, which
148
- * serialises through the language-specific `Serializer` bound at
149
- * `services.serializer.Serializer` (resolved per-URI via `ServiceRegistry`),
150
- * updates the multi-client text-document store, drives a rebuild, and writes the
151
- * result via the `WritableFileSystemProvider`. The bound
152
- * {@link SaveConflictPolicy} (default {@link DEFAULT_SAVE_CONFLICT_POLICY},
153
- * `overwrite`) decides the based-on-version guard, await-vs-fire-and-forget, and
154
- * failure handling.
147
+ * **Default `saveSourceModel` flow.** Flushes the stored text of the primary and
148
+ * every tracked secondary via `AstDocumentManager.save`, with no serializer in
149
+ * the path the update path already put the settled text in the store. The
150
+ * bound {@link SaveDeliveryPolicy} (default {@link DEFAULT_SAVE_DELIVERY_POLICY},
151
+ * `await`) decides await-vs-fire-and-forget and failure handling.
155
152
  *
156
153
  * **tempId filter.** GLSP's `DefaultGlobalActionProvider` spins up a
157
154
  * throwaway per-diagram-type container with upstream's {@link TEMPORARY_CLIENT_ID}
@@ -188,14 +185,13 @@ export class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel = string>
188
185
  @inject(ModelValidator) @optional() protected readonly modelValidator?: ModelValidator;
189
186
 
190
187
  /**
191
- * Selected {@link SaveConflictPolicy} for {@link saveSourceModel}. Bind the
192
- * {@link SaveConflictPolicy} token in a `DiagramModule` to choose a policy;
193
- * left unbound it resolves to {@link DEFAULT_SAVE_CONFLICT_POLICY}
194
- * (`overwrite`, last-write-wins). Read via {@link saveConflictPolicy} so the
195
- * fallback is applied even when inversify injects `undefined` for an unbound
196
- * `@optional()` member.
188
+ * Selected {@link SaveDeliveryPolicy} for {@link saveSourceModel}. Bind the
189
+ * {@link SaveDeliveryPolicy} token in a `DiagramModule` to choose a policy;
190
+ * left unbound it resolves to {@link DEFAULT_SAVE_DELIVERY_POLICY}. Read via
191
+ * {@link saveDeliveryPolicy} so the fallback is applied even when inversify
192
+ * injects `undefined` for an unbound `@optional()` member.
197
193
  */
198
- @inject(SaveConflictPolicy) @optional() protected readonly boundSaveConflictPolicy?: SaveConflictPolicy;
194
+ @inject(SaveDeliveryPolicy) @optional() protected readonly boundSaveDeliveryPolicy?: SaveDeliveryPolicy;
199
195
 
200
196
  /** Disposables created during {@link doLoadSourceModel}; drained on session disposal. */
201
197
  protected toDispose = new DisposableCollection();
@@ -604,32 +600,47 @@ export class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel = string>
604
600
  return [];
605
601
  }
606
602
 
607
- /** The effective {@link SaveConflictPolicy}: the bound option, or {@link DEFAULT_SAVE_CONFLICT_POLICY} when unbound. */
608
- protected get saveConflictPolicy(): SaveConflictPolicy {
609
- return this.boundSaveConflictPolicy ?? DEFAULT_SAVE_CONFLICT_POLICY;
603
+ /** The effective {@link SaveDeliveryPolicy}: the bound option, or {@link DEFAULT_SAVE_DELIVERY_POLICY} when unbound. */
604
+ protected get saveDeliveryPolicy(): SaveDeliveryPolicy {
605
+ return this.boundSaveDeliveryPolicy ?? DEFAULT_SAVE_DELIVERY_POLICY;
610
606
  }
611
607
 
612
608
  /**
613
- * Default save flow: route through `ModelService.save`. The framework
614
- * serialise-and-persist machinery handles serialisation (via the
615
- * language-specific `Serializer` bound at `services.serializer.Serializer`),
616
- * the multi-client text-document update, the rebuild, and the eventual
617
- * `WritableFileSystemProvider.writeFile`.
609
+ * Default save flow: persist the store's current text for every document this
610
+ * diagram owns.
618
611
  *
619
- * The configured {@link SaveConflictPolicy} (see {@link saveConflictPolicy})
620
- * decides how a concurrent edit that advanced the document is handled:
621
- * - `overwrite` (default): no based-on guard, await, propagate failures
622
- * last-write-wins, correct for a single-editor head.
623
- * - `reject`: guard on the captured `state.version`, await, surface a
624
- * `ConflictError` (and any other failure) to the GLSP save action.
625
- * - `drop-and-log`: guard, fire-and-forget, log + swallow failures — a stale
626
- * diagram save is dropped because a concurrent form/code edit already wrote
627
- * the truth, and GLSP exposes no save-failure back-channel.
612
+ * **A save persists, it does not author.** Every diagram gesture already
613
+ * reached the store through `ModelService.update`, so the store holds the
614
+ * settled text and disk is the only thing behind. Re-serializing from the AST
615
+ * here cannot improve on that text and can only damage it: a serializer
616
+ * normalises formatting and carries no comments, so a save would reflow and
617
+ * strip a document nothing changed which is what a pure bounds drag does to
618
+ * the semantic file when only its layout moved.
619
+ *
620
+ * **The write set is the primary plus every tracked secondary**
621
+ * (`AbstractHydraniumGlspState.trackSecondaryDocument`), so a document the
622
+ * diagram wrote is persisted whether or not it is the one the client named.
623
+ * The primary is flushed first, then secondaries in tracking order. A
624
+ * document no client holds open is skipped — there is no stored text to
625
+ * persist.
626
+ *
627
+ * **A save therefore names documents the gesture did not aim at**, which is
628
+ * why an unchanged one is not rewritten even though the user asked for a
629
+ * save: the mtime would move on a file they never touched.
630
+ * `AstDocumentManager.save` decides that per document and announces the save
631
+ * either way.
632
+ *
633
+ * The configured {@link SaveDeliveryPolicy} (see {@link saveDeliveryPolicy})
634
+ * decides await-vs-fire-and-forget and failure handling. It carries no
635
+ * based-on guard: the guard exists to stop a stale writer overwriting a newer
636
+ * document, and a flush persists the store — which already holds every other
637
+ * client's change, including the one that advanced the version.
628
638
  *
629
639
  * Returns `MaybePromise<void>` to match upstream `SourceModelStorage`:
630
- * resolves with the persist under `overwrite`/`reject`, returns synchronously
631
- * under `drop-and-log`. Adopters that bypass `ModelService` (writing through
632
- * `WritableFileSystemProvider` directly) still override the whole method.
640
+ * resolves with the flush under `await`, returns synchronously under
641
+ * `fire-and-forget`. Adopters that bypass `AstDocumentManager` (writing
642
+ * through `WritableFileSystemProvider` directly) still override the whole
643
+ * method.
633
644
  */
634
645
  saveSourceModel(action: SaveModelAction): MaybePromise<void> {
635
646
  // Normalised for the same reason the load path is: `SaveModelAction.fileUri`
@@ -639,26 +650,36 @@ export class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel = string>
639
650
  // the call site rather than inside `getFileUri` so that method's contract —
640
651
  // return what the action said — is unchanged for adopters overriding it.
641
652
  const uri = this.toSourceModelUri(this.getFileUri(action));
642
- const policy = this.saveConflictPolicy;
643
- const persisted = this.sharedServices.model.ModelService.save({
644
- uri,
645
- model: this.state.sourceRoot,
646
- clientId: this.state.clientId,
647
- baseVersion: policy.kind === 'overwrite' ? undefined : this.state.version
648
- }).then(() => undefined);
649
-
650
- if (policy.kind === 'drop-and-log') {
651
- // Fire-and-forget: the diagram save lost the race to a concurrent edit
652
- // that already persisted the truth, so it must neither block the action
653
- // nor surface. Log rather than leave an unhandled rejection.
653
+ const policy = this.saveDeliveryPolicy;
654
+ const persisted = this.flushWriteSet(uri);
655
+
656
+ if (policy.kind === 'fire-and-forget') {
657
+ // Log rather than leave an unhandled rejection: the promise is not
658
+ // returned, so nothing else will observe a failure.
654
659
  persisted.catch(error => this.logger.error(`Save failed for ${uri}: ${error instanceof Error ? error.message : String(error)}`));
655
660
  return undefined;
656
661
  }
657
- // overwrite / reject: await; a ConflictError (reject) or any other failure
658
- // propagates to GLSP's save-action handler.
662
+ // Awaited: any failure propagates to GLSP's save-action handler.
659
663
  return persisted;
660
664
  }
661
665
 
666
+ /**
667
+ * Save the stored text of `primaryUri` and every tracked secondary.
668
+ *
669
+ * Deduplicated, because a state that tracks its own primary as a secondary
670
+ * would otherwise save it twice and fire two save notifications for one
671
+ * save. A document no client holds open is skipped: there is no stored text
672
+ * to persist, and `AstDocumentManager.save` throws on one.
673
+ */
674
+ protected async flushWriteSet(primaryUri: string): Promise<void> {
675
+ const documents = this.sharedServices.workspace.AstDocumentManager;
676
+ for (const target of new Set([primaryUri, ...this.state.secondaryUris])) {
677
+ if (documents.isOpen(target)) {
678
+ await documents.save(target, this.state.clientId);
679
+ }
680
+ }
681
+ }
682
+
662
683
  /**
663
684
  * Normalise GLSP's `sourceUri` — which may be a filesystem PATH or a URI
664
685
  * string — to the URI string the workspace keys documents by.
@@ -8,4 +8,4 @@
8
8
  ********************************************************************************/
9
9
 
10
10
  export * from './hydranium-glsp-storage.js';
11
- export * from './save-conflict-policy.js';
11
+ export * from './save-delivery-policy.js';
@@ -0,0 +1,44 @@
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
+
10
+ /**
11
+ * How `HydraniumGlspStorage.saveSourceModel` delivers its result: whether the
12
+ * GLSP save action awaits the write, and what happens on failure.
13
+ *
14
+ * The two are not independent — fire-and-forget plus rethrow would leave an
15
+ * unhandled rejection — so each arm bundles them into one coherent, nameable
16
+ * policy an adopter selects whole. It is a *selection of configuration*,
17
+ * delivered as a bound option (see the {@link SaveDeliveryPolicy} symbol) rather
18
+ * than a behaviour hook.
19
+ *
20
+ * **Neither arm guards on a based-on version.** A save flushes the store's
21
+ * settled text rather than authoring from the diagram's captured model, and the
22
+ * store already holds every other client's change — so a guard here refuses a
23
+ * write whose content is already correct. The gate that does exist sits on the
24
+ * update path, per operation, where the diagram authors.
25
+ */
26
+ export type SaveDeliveryPolicy =
27
+ /** Await the write and propagate any failure to the GLSP save action. The default. */
28
+ | { kind: 'await' }
29
+ /**
30
+ * Fire-and-forget, logging and swallowing every failure. Correct when a
31
+ * failed diagram save must neither block the action nor surface as an error.
32
+ */
33
+ | { kind: 'fire-and-forget' };
34
+
35
+ /** The policy applied when no {@link SaveDeliveryPolicy} option is bound. */
36
+ export const DEFAULT_SAVE_DELIVERY_POLICY: SaveDeliveryPolicy = { kind: 'await' };
37
+
38
+ /**
39
+ * DI token for the {@link SaveDeliveryPolicy} option. Bind a constant value in a
40
+ * `DiagramModule` to select a non-default policy; left unbound,
41
+ * `HydraniumGlspStorage` falls back to {@link DEFAULT_SAVE_DELIVERY_POLICY}.
42
+ * Shares its name with the type, the way a `class` is both a value and a type.
43
+ */
44
+ export const SaveDeliveryPolicy = Symbol('SaveDeliveryPolicy');
@@ -1,56 +0,0 @@
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
- /**
10
- * How `HydraniumGlspStorage.saveSourceModel` reacts when a concurrent edit has
11
- * advanced the document past the version this diagram was last captured at.
12
- *
13
- * A save spans otherwise-independent choices — whether to guard on the captured
14
- * based-on version, whether the GLSP save action awaits the persist, and what
15
- * happens on failure. Each arm bundles those into one coherent, nameable policy
16
- * so an adopter selects a whole behaviour rather than assembling an incoherent
17
- * mix: fire-and-forget plus rethrow would leave an unhandled rejection. It is a
18
- * *selection of configuration*, delivered as a bound option (see the
19
- * {@link SaveConflictPolicy} symbol) rather than a behaviour hook.
20
- */
21
- export type SaveConflictPolicy =
22
- /**
23
- * Last-write-wins: no based-on guard, await the persist, propagate any
24
- * failure to the GLSP save action. The default; correct for a single-editor
25
- * head where nothing races the save.
26
- */
27
- {
28
- kind: 'overwrite';
29
- }
30
- /**
31
- * Guard on the captured version, await the persist, and surface a
32
- * `ConflictError` (and any other failure) to the GLSP save action.
33
- */
34
- | {
35
- kind: 'reject';
36
- }
37
- /**
38
- * Guard on the captured version, fire-and-forget, and log + swallow every
39
- * failure. Correct when another editor of the same document may already have
40
- * written the truth, so a stale diagram save is benign and must neither
41
- * block the action nor surface as an error.
42
- */
43
- | {
44
- kind: 'drop-and-log';
45
- };
46
- /** The policy applied when no {@link SaveConflictPolicy} option is bound. */
47
- export declare const DEFAULT_SAVE_CONFLICT_POLICY: SaveConflictPolicy;
48
- /**
49
- * DI token for the {@link SaveConflictPolicy} option. Bind a constant value in a
50
- * `DiagramModule` to select a non-default policy; left unbound,
51
- * `HydraniumGlspStorage` falls back to
52
- * {@link DEFAULT_SAVE_CONFLICT_POLICY}. Shares its name with the type, the way a
53
- * `class` is both a value and a type.
54
- */
55
- export declare const SaveConflictPolicy: unique symbol;
56
- //# sourceMappingURL=save-conflict-policy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"save-conflict-policy.d.ts","sourceRoot":"","sources":["../../src/storage/save-conflict-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,kBAAkB;AAC3B;;;;GAIG;AACD;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE;AACvB;;;GAGG;GACD;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE;AACpB;;;;;GAKG;GACD;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,CAAC;AAE9B,6EAA6E;AAC7E,eAAO,MAAM,4BAA4B,EAAE,kBAA0C,CAAC;AAEtF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,eAA+B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"save-conflict-policy.js","sourceRoot":"","sources":["../../src/storage/save-conflict-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAkClF,6EAA6E;AAC7E,MAAM,CAAC,MAAM,4BAA4B,GAAuB,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;AAEtF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC"}
@@ -1,52 +0,0 @@
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
-
10
- /**
11
- * How `HydraniumGlspStorage.saveSourceModel` reacts when a concurrent edit has
12
- * advanced the document past the version this diagram was last captured at.
13
- *
14
- * A save spans otherwise-independent choices — whether to guard on the captured
15
- * based-on version, whether the GLSP save action awaits the persist, and what
16
- * happens on failure. Each arm bundles those into one coherent, nameable policy
17
- * so an adopter selects a whole behaviour rather than assembling an incoherent
18
- * mix: fire-and-forget plus rethrow would leave an unhandled rejection. It is a
19
- * *selection of configuration*, delivered as a bound option (see the
20
- * {@link SaveConflictPolicy} symbol) rather than a behaviour hook.
21
- */
22
- export type SaveConflictPolicy =
23
- /**
24
- * Last-write-wins: no based-on guard, await the persist, propagate any
25
- * failure to the GLSP save action. The default; correct for a single-editor
26
- * head where nothing races the save.
27
- */
28
- | { kind: 'overwrite' }
29
- /**
30
- * Guard on the captured version, await the persist, and surface a
31
- * `ConflictError` (and any other failure) to the GLSP save action.
32
- */
33
- | { kind: 'reject' }
34
- /**
35
- * Guard on the captured version, fire-and-forget, and log + swallow every
36
- * failure. Correct when another editor of the same document may already have
37
- * written the truth, so a stale diagram save is benign and must neither
38
- * block the action nor surface as an error.
39
- */
40
- | { kind: 'drop-and-log' };
41
-
42
- /** The policy applied when no {@link SaveConflictPolicy} option is bound. */
43
- export const DEFAULT_SAVE_CONFLICT_POLICY: SaveConflictPolicy = { kind: 'overwrite' };
44
-
45
- /**
46
- * DI token for the {@link SaveConflictPolicy} option. Bind a constant value in a
47
- * `DiagramModule` to select a non-default policy; left unbound,
48
- * `HydraniumGlspStorage` falls back to
49
- * {@link DEFAULT_SAVE_CONFLICT_POLICY}. Shares its name with the type, the way a
50
- * `class` is both a value and a type.
51
- */
52
- export const SaveConflictPolicy = Symbol('SaveConflictPolicy');