@hydranium/glsp-server 1.0.0-next.7 → 1.0.0-next.71

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 (36) hide show
  1. package/README.md +11 -2
  2. package/lib/launcher/hydranium-glsp-server.d.ts +4 -3
  3. package/lib/launcher/hydranium-glsp-server.d.ts.map +1 -1
  4. package/lib/launcher/hydranium-glsp-server.js +4 -3
  5. package/lib/launcher/hydranium-glsp-server.js.map +1 -1
  6. package/lib/messages/index.d.ts +24 -0
  7. package/lib/messages/index.d.ts.map +1 -0
  8. package/lib/messages/index.js +24 -0
  9. package/lib/messages/index.js.map +1 -0
  10. package/lib/state/reconcile-source-model-write.d.ts.map +1 -1
  11. package/lib/state/reconcile-source-model-write.js +3 -3
  12. package/lib/state/reconcile-source-model-write.js.map +1 -1
  13. package/lib/storage/hydranium-glsp-storage.d.ts +177 -59
  14. package/lib/storage/hydranium-glsp-storage.d.ts.map +1 -1
  15. package/lib/storage/hydranium-glsp-storage.js +209 -80
  16. package/lib/storage/hydranium-glsp-storage.js.map +1 -1
  17. package/lib/storage/index.d.ts +1 -1
  18. package/lib/storage/index.js +1 -1
  19. package/lib/storage/save-delivery-policy.d.ts +46 -0
  20. package/lib/storage/save-delivery-policy.d.ts.map +1 -0
  21. package/lib/storage/{save-conflict-policy.js → save-delivery-policy.js} +7 -8
  22. package/lib/storage/save-delivery-policy.js.map +1 -0
  23. package/lib/validation/diagnostic-markers.js +7 -0
  24. package/lib/validation/diagnostic-markers.js.map +1 -1
  25. package/package.json +17 -8
  26. package/src/launcher/hydranium-glsp-server.ts +4 -3
  27. package/src/messages/index.ts +25 -0
  28. package/src/state/reconcile-source-model-write.ts +5 -3
  29. package/src/storage/hydranium-glsp-storage.ts +224 -79
  30. package/src/storage/index.ts +1 -1
  31. package/src/storage/save-delivery-policy.ts +44 -0
  32. package/src/validation/diagnostic-markers.ts +8 -1
  33. package/lib/storage/save-conflict-policy.d.ts +0 -56
  34. package/lib/storage/save-conflict-policy.d.ts.map +0 -1
  35. package/lib/storage/save-conflict-policy.js.map +0 -1
  36. package/src/storage/save-conflict-policy.ts +0 -52
@@ -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');