@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
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,
@@ -49,6 +49,15 @@ dependency is `uuid`. You must already have a composed hydranium shared services
49
49
  tree, a grammar, and a GModel factory of your own — there is no framework GModel
50
50
  factory.
51
51
 
52
+ **This head needs one line in your own root manifest, and the install works
53
+ without it right up until the server starts.** `@eclipse-glsp/*` depends on
54
+ `vscode-jsonrpc@8.2.0` exactly, while the Langium chain under hydranium pins the
55
+ transport at `9.0.1` — the version this package declares as its peer. Two
56
+ physical copies in one process throw `Unknown parameter structure auto` during
57
+ GLSP server init, and no peer declaration can prevent a nested copy. Add an
58
+ `overrides` block collapsing the chain and reinstall from scratch;
59
+ [Requirements](../../docs/adopting/requirements.md) gives the exact block.
60
+
52
61
  ## Exports
53
62
 
54
63
  | subpath | holds | platform |
@@ -16,9 +16,10 @@ import { type ClientSession, DefaultGLSPServer, type RequestAction, type Respons
16
16
  * `error.cause?.toString()` whenever the error is a {@link GLSPServerError},
17
17
  * and that one value feeds both the server log and the client's
18
18
  * {@link RejectAction}. A {@link GLSPServerError} carrying no `cause` therefore
19
- * reaches no reader at allnot the toast, not the details pane, not the log —
20
- * while a plain `Error` survives, because the other branch reads the error
21
- * itself. The typed error is the trap, and it is the one upstream's own
19
+ * reaches its readers as `undefined` — the log line and the client's
20
+ * action-dispatcher warning both print it — while a plain `Error` survives,
21
+ * because the other branch reads the error itself. The typed error is the trap,
22
+ * and it is the one upstream's own
22
23
  * `getOrThrow` helper raises: that helper's signature cannot pass a `cause`, so
23
24
  * an adopter using the sanctioned helper has no fix available on their side.
24
25
  * Restating the cause at each throw site is the alternative, and it costs
@@ -1 +1 @@
1
- {"version":3,"file":"hydranium-glsp-server.d.ts","sourceRoot":"","sources":["../../src/launcher/hydranium-glsp-server.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,KAAK,aAAa,EAClB,iBAAiB,EAGjB,KAAK,aAAa,EAClB,KAAK,cAAc,EACrB,MAAM,sBAAsB,CAAC;AAG9B;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBACa,mBAAoB,SAAQ,iBAAiB;IACvD;;;;;;;;OAQG;IACH,SAAS,CAAC,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS;IAOlE;;;;;;;;;;;;;OAaG;cACsB,mBAAmB,CACzC,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,aAAa,CAAC,cAAc,CAAC,EACrC,QAAQ,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC;CAuBlB"}
1
+ {"version":3,"file":"hydranium-glsp-server.d.ts","sourceRoot":"","sources":["../../src/launcher/hydranium-glsp-server.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,KAAK,aAAa,EAClB,iBAAiB,EAGjB,KAAK,aAAa,EAClB,KAAK,cAAc,EACrB,MAAM,sBAAsB,CAAC;AAG9B;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBACa,mBAAoB,SAAQ,iBAAiB;IACvD;;;;;;;;OAQG;IACH,SAAS,CAAC,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS;IAOlE;;;;;;;;;;;;;OAaG;cACsB,mBAAmB,CACzC,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,aAAa,CAAC,cAAc,CAAC,EACrC,QAAQ,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC;CAuBlB"}
@@ -23,9 +23,10 @@ import { injectable } from 'inversify';
23
23
  * `error.cause?.toString()` whenever the error is a {@link GLSPServerError},
24
24
  * and that one value feeds both the server log and the client's
25
25
  * {@link RejectAction}. A {@link GLSPServerError} carrying no `cause` therefore
26
- * reaches no reader at allnot the toast, not the details pane, not the log —
27
- * while a plain `Error` survives, because the other branch reads the error
28
- * itself. The typed error is the trap, and it is the one upstream's own
26
+ * reaches its readers as `undefined` — the log line and the client's
27
+ * action-dispatcher warning both print it — while a plain `Error` survives,
28
+ * because the other branch reads the error itself. The typed error is the trap,
29
+ * and it is the one upstream's own
29
30
  * `getOrThrow` helper raises: that helper's signature cannot pass a `cause`, so
30
31
  * an adopter using the sanctioned helper has no fix available on their side.
31
32
  * Restating the cause at each throw site is the alternative, and it costs
@@ -1 +1 @@
1
- {"version":3,"file":"hydranium-glsp-server.js","sourceRoot":"","sources":["../../src/launcher/hydranium-glsp-server.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;;;;;;;AAElF,OAAO,EAEJ,iBAAiB,EACjB,eAAe,EACf,YAAY,EAGd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEI,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,iBAAiB;IACvD;;;;;;;;OAQG;IACO,oBAAoB,CAAC,KAAc;QAC1C,IAAI,KAAK,YAAY,eAAe,EAAE,CAAC;YACpC,OAAO,KAAK,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC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Aa,CAAC,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YAC7D,IAAI,QAAQ,EAAE,CAAC;gBACZ,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;YACjD,CAAC;QACJ,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACvB,MAAM,MAAM,GAAG,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;YAChD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,6BAA6B,MAAM,CAAC,IAAI,MAAM,MAAM,CAAC,SAAS,IAAI,EAAE,MAAM,CAAC,CAAC;YAC9F,IAAI,CAAC;gBACF,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,6BAA6B,MAAM,CAAC,IAAI,MAAM,MAAM,CAAC,SAAS,GAAG,EAAE;oBACnG,UAAU,EAAE,MAAM,CAAC,SAAS;oBAC5B,MAAM;iBACR,CAAC,CAAC;gBACH,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YAC/C,CAAC;YAAC,OAAO,SAAkB,EAAE,CAAC;gBAC3B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,yCAAyC,MAAM,CAAC,SAAS,IAAI,EAAE,SAAS,CAAC,CAAC;YAC/F,CAAC;QACJ,CAAC;IACJ,CAAC;CACH,CAAA;AA1DY,mBAAmB;IAD/B,UAAU,EAAE;GACA,mBAAmB,CA0D/B"}
@@ -0,0 +1,24 @@
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
+ * Every user-facing message `@hydranium/glsp-server` raises.
11
+ *
12
+ * **Each one is rendered AT ITS RAISE SITE**, through the shared
13
+ * `MessageRenderer`, because GLSP's action protocol carries no slot for an
14
+ * identity on any of its actions — so the identity is gone the moment a raise
15
+ * site formats its text, and there is nothing at the error boundary to render
16
+ * from. That makes this head the one place where a new message can ship
17
+ * unrendered without any single chokepoint noticing, which is why the package's
18
+ * own test suite scans for a declaration reached by `.format()` instead.
19
+ *
20
+ * The barrel is also how an adopter rendering their own diagram chrome
21
+ * discovers the codes exist.
22
+ */
23
+ export { DIAGRAM_READONLY_PARSE_ERROR, SAVE_TARGET_UNKNOWN, SOURCE_URI_MISSING } from '../storage/hydranium-glsp-storage.js';
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,4BAA4B,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC"}
@@ -0,0 +1,24 @@
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
+ * Every user-facing message `@hydranium/glsp-server` raises.
11
+ *
12
+ * **Each one is rendered AT ITS RAISE SITE**, through the shared
13
+ * `MessageRenderer`, because GLSP's action protocol carries no slot for an
14
+ * identity on any of its actions — so the identity is gone the moment a raise
15
+ * site formats its text, and there is nothing at the error boundary to render
16
+ * from. That makes this head the one place where a new message can ship
17
+ * unrendered without any single chokepoint noticing, which is why the package's
18
+ * own test suite scans for a declaration reached by `.format()` instead.
19
+ *
20
+ * The barrel is also how an adopter rendering their own diagram chrome
21
+ * discovers the codes exist.
22
+ */
23
+ export { DIAGRAM_READONLY_PARSE_ERROR, SAVE_TARGET_UNKNOWN, SOURCE_URI_MISSING } from '../storage/hydranium-glsp-storage.js';
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,4BAA4B,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"reconcile-source-model-write.d.ts","sourceRoot":"","sources":["../../src/state/reconcile-source-model-write.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,MAAM,EAAmB,MAAM,qBAAqB,CAAC;AAE1F;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB,CAAC,MAAM;IAC1C;;;;OAIG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,uEAAuE;IACvE,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACvC,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,gFAAgF;IAChF,iBAAiB,IAAI,IAAI,CAAC;CAC5B;AAED;;;;;;;;GAQG;AACH,wBAAsB,yBAAyB,CAAC,MAAM,SAAS,MAAM,EAClE,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,KAAK,EAAE,qBAAqB,CAAC,MAAM,CAAC,GACpC,OAAO,CAAC,IAAI,CAAC,CA4Bf"}
1
+ {"version":3,"file":"reconcile-source-model-write.d.ts","sourceRoot":"","sources":["../../src/state/reconcile-source-model-write.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,MAAM,EAAmB,MAAM,qBAAqB,CAAC;AAE1F;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB,CAAC,MAAM;IAC1C;;;;OAIG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,uEAAuE;IACvE,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACvC,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,gFAAgF;IAChF,iBAAiB,IAAI,IAAI,CAAC;CAC5B;AAED;;;;;;;;GAQG;AACH,wBAAsB,yBAAyB,CAAC,MAAM,SAAS,MAAM,EAClE,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,KAAK,EAAE,qBAAqB,CAAC,MAAM,CAAC,GACpC,OAAO,CAAC,IAAI,CAAC,CA8Bf"}
@@ -30,15 +30,15 @@ export async function reconcileSourceModelWrite(model, version, hooks) {
30
30
  await hooks.persist(outcome.merged);
31
31
  return;
32
32
  case 'no-op':
33
- hooks.logger.debug(`updateSourceModel no-op (v${err.expected} → v${err.actual}); already in sync`);
33
+ hooks.logger.debug(`updateSourceModel no-op (v${err.expectedVersion} → v${err.actualVersion}); already in sync`);
34
34
  return;
35
35
  case 'conflict':
36
- hooks.logger.warn(`updateSourceModel conflict (v${err.expected} → v${err.actual}); dropping the diagram edit — ` +
36
+ hooks.logger.warn(`updateSourceModel conflict (v${err.expectedVersion} → v${err.actualVersion}); dropping the diagram edit — ` +
37
37
  'a foreign writer changed the same field');
38
38
  hooks.onConflictDropped();
39
39
  return;
40
40
  case 'unavailable':
41
- hooks.logger.warn(`updateSourceModel refetch unavailable (v${err.expected} → v${err.actual}); forcing without version`);
41
+ hooks.logger.warn(`updateSourceModel refetch unavailable (v${err.expectedVersion} → v${err.actualVersion}); forcing without version`);
42
42
  await hooks.persist(model);
43
43
  return;
44
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"reconcile-source-model-write.js","sourceRoot":"","sources":["../../src/state/reconcile-source-model-write.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAsC,eAAe,EAAE,MAAM,qBAAqB,CAAC;AA0B1F;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC5C,KAAa,EACb,OAA2B,EAC3B,KAAoC;IAEpC,IAAI,CAAC;QACF,MAAM,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACZ,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,GAAG,CAAC;QACb,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC5G,QAAQ,OAAO,CAAC,MAAM,EAAE,CAAC;YACtB,KAAK,QAAQ;gBACV,MAAM,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;gBACpC,OAAO;YACV,KAAK,OAAO;gBACT,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,6BAA6B,GAAG,CAAC,QAAQ,OAAO,GAAG,CAAC,MAAM,oBAAoB,CAAC,CAAC;gBACnG,OAAO;YACV,KAAK,UAAU;gBACZ,KAAK,CAAC,MAAM,CAAC,IAAI,CACd,gCAAgC,GAAG,CAAC,QAAQ,OAAO,GAAG,CAAC,MAAM,iCAAiC;oBAC3F,yCAAyC,CAC9C,CAAC;gBACF,KAAK,CAAC,iBAAiB,EAAE,CAAC;gBAC1B,OAAO;YACV,KAAK,aAAa;gBACf,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,2CAA2C,GAAG,CAAC,QAAQ,OAAO,GAAG,CAAC,MAAM,4BAA4B,CAAC,CAAC;gBACxH,MAAM,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;gBAC3B,OAAO;QACb,CAAC;IACJ,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"reconcile-source-model-write.js","sourceRoot":"","sources":["../../src/state/reconcile-source-model-write.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAsC,eAAe,EAAE,MAAM,qBAAqB,CAAC;AA0B1F;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC5C,KAAa,EACb,OAA2B,EAC3B,KAAoC;IAEpC,IAAI,CAAC;QACF,MAAM,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACZ,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,GAAG,CAAC;QACb,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC5G,QAAQ,OAAO,CAAC,MAAM,EAAE,CAAC;YACtB,KAAK,QAAQ;gBACV,MAAM,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;gBACpC,OAAO;YACV,KAAK,OAAO;gBACT,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,6BAA6B,GAAG,CAAC,eAAe,OAAO,GAAG,CAAC,aAAa,oBAAoB,CAAC,CAAC;gBACjH,OAAO;YACV,KAAK,UAAU;gBACZ,KAAK,CAAC,MAAM,CAAC,IAAI,CACd,gCAAgC,GAAG,CAAC,eAAe,OAAO,GAAG,CAAC,aAAa,iCAAiC;oBACzG,yCAAyC,CAC9C,CAAC;gBACF,KAAK,CAAC,iBAAiB,EAAE,CAAC;gBAC1B,OAAO;YACV,KAAK,aAAa;gBACf,KAAK,CAAC,MAAM,CAAC,IAAI,CACd,2CAA2C,GAAG,CAAC,eAAe,OAAO,GAAG,CAAC,aAAa,4BAA4B,CACpH,CAAC;gBACF,MAAM,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;gBAC3B,OAAO;QACb,CAAC;IACJ,CAAC;AACJ,CAAC"}
@@ -12,7 +12,46 @@ 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
+ /**
17
+ * A save action arrived with nowhere to write to. A save action carries no
18
+ * request id, so it falls through to the error handler and `message` becomes
19
+ * the toast text.
20
+ *
21
+ * Rendered at the raise site rather than by a carrier method, because GLSP's
22
+ * action protocol has no slot for an identity anywhere — every member of its
23
+ * message, status and reject actions is prose or an enum, and
24
+ * `MessageAction.details` is not a substitute since it is prose populated from
25
+ * `cause?.toString?.()`, and a Theia host shows it to a user on demand. So the
26
+ * throw is the last place that still knows which message this is.
27
+ */
28
+ export declare const SAVE_TARGET_UNKNOWN: import("@hydranium/protocol").MessageDefinition<"Could not determine where to save this model">;
29
+ /**
30
+ * A model request arrived without the source URI it is required to carry.
31
+ * Rendered at the raise site, like its save-path sibling and for the same
32
+ * reason.
33
+ */
34
+ export declare const SOURCE_URI_MISSING: import("@hydranium/protocol").MessageDefinition<"Could not open this model: the request did not say which document to load">;
35
+ /**
36
+ * Why the canvas has stopped accepting edits.
37
+ *
38
+ * **A READONLY canvas is otherwise indistinguishable from a broken one.** The
39
+ * client's answer to {@link SetEditModeAction} is to withdraw the tool palette,
40
+ * so the surface a reader was working in silently loses the only control it had,
41
+ * with the cause — a syntax error in a document that may not even be open —
42
+ * nowhere on screen. The mode flip is the mechanism; this is the only part of it
43
+ * a user can see.
44
+ *
45
+ * Rendered at the raise site, like its two siblings above and for the same
46
+ * reason: every member of GLSP's status action is prose or an enum.
47
+ *
48
+ * It names the recovery rather than the fault, because the fault already has a
49
+ * surface — the squiggle and the problems list, both of which say WHICH
50
+ * character — and repeating it here would put a second, less precise account of
51
+ * the same error on screen. What no other surface says is that the diagram is
52
+ * waiting on it.
53
+ */
54
+ export declare const DIAGRAM_READONLY_PARSE_ERROR: import("@hydranium/protocol").MessageDefinition<"Read-only: this document has a syntax error. Fix it to edit the diagram again.">;
16
55
  /**
17
56
  * GLSP source-model storage base shared by all hydranium adopters.
18
57
  * Provides the DI signature, the {@link ClientSessionListener} +
@@ -33,17 +72,14 @@ import { SaveConflictPolicy } from './save-conflict-policy.js';
33
72
  *
34
73
  * Adopters with richer needs override the seams ({@link isStructurallyBroken},
35
74
  * {@link onParseErrorChanged}, {@link onSourceModelSettled}) rather than the
36
- * whole flow, and select a {@link SaveConflictPolicy} via the bound option to
37
- * 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.
38
77
  *
39
- * **Default `saveSourceModel` flow.** Delegates to `ModelService.save`, which
40
- * serialises through the language-specific `Serializer` bound at
41
- * `services.serializer.Serializer` (resolved per-URI via `ServiceRegistry`),
42
- * updates the multi-client text-document store, drives a rebuild, and writes the
43
- * result via the `WritableFileSystemProvider`. The bound
44
- * {@link SaveConflictPolicy} (default {@link DEFAULT_SAVE_CONFLICT_POLICY},
45
- * `overwrite`) decides the based-on-version guard, await-vs-fire-and-forget, and
46
- * 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.
47
83
  *
48
84
  * **tempId filter.** GLSP's `DefaultGlobalActionProvider` spins up a
49
85
  * throwaway per-diagram-type container with upstream's {@link TEMPORARY_CLIENT_ID}
@@ -75,14 +111,13 @@ export declare class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel =
75
111
  */
76
112
  protected readonly modelValidator?: ModelValidator;
77
113
  /**
78
- * Selected {@link SaveConflictPolicy} for {@link saveSourceModel}. Bind the
79
- * {@link SaveConflictPolicy} token in a `DiagramModule` to choose a policy;
80
- * left unbound it resolves to {@link DEFAULT_SAVE_CONFLICT_POLICY}
81
- * (`overwrite`, last-write-wins). Read via {@link saveConflictPolicy} so the
82
- * fallback is applied even when inversify injects `undefined` for an unbound
83
- * `@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.
84
119
  */
85
- protected readonly boundSaveConflictPolicy?: SaveConflictPolicy;
120
+ protected readonly boundSaveDeliveryPolicy?: SaveDeliveryPolicy;
86
121
  /** Disposables created during {@link doLoadSourceModel}; drained on session disposal. */
87
122
  protected toDispose: DisposableCollection;
88
123
  /**
@@ -120,12 +155,29 @@ export declare class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel =
120
155
  loadSourceModel(action: RequestModelAction): MaybePromise<void>;
121
156
  protected doLoadSourceModel(action: RequestModelAction): Promise<void>;
122
157
  /**
123
- * Capture the initial settled root and apply the initial edit mode. `settled()`
124
- * strips diagnostics by phase contract, so the first edit mode is `EDITABLE`;
125
- * the first {@link handleModelUpdated} (at `Validated`, with diagnostics) flips
126
- * it READONLY if the document has structural parse errors. Edit-mode +
127
- * settle-hook actions are dispatched on a macrotask so the initial
158
+ * Capture the initial settled root and apply the initial edit mode. Edit-mode
159
+ * + settle-hook actions are dispatched on a macrotask so the initial
128
160
  * `requestModel → setModel` handshake isn't perturbed.
161
+ *
162
+ * **Whether the settled document carries diagnostics depends on how far it
163
+ * had already got, so the initial edit mode has two correct outcomes rather
164
+ * than one.** `settled()` strips nothing: it resolves AT OR ABOVE the
165
+ * integrity landmark and hands back the live document's own array. Its
166
+ * `AstDocument<TAst, never>` return type asserts emptiness for a document the
167
+ * wait had to DRIVE to that landmark, which is pre-validation — and for that
168
+ * one the mode here is `EDITABLE` and the flip to READONLY arrives with the
169
+ * first {@link handleModelUpdated}. A document already past `Validated` when
170
+ * the session opened resolves immediately with its diagnostics intact, and is
171
+ * decided correctly here with no later update owed. Any host that validates
172
+ * its workspace before a diagram is opened produces the second case, so
173
+ * neither is exceptional.
174
+ *
175
+ * **A correct decision is not a delivered one.** This dispatch happens inside
176
+ * the initial `requestModel`, before the client has the model — so the UI
177
+ * extensions that answer {@link onParseErrorChanged}'s actions are not yet
178
+ * constructed, and a canvas that opens READONLY over a broken document shows
179
+ * none of that feedback. The same timer carries {@link onSourceModelSettled},
180
+ * so an adopter's own initial actions have it too.
129
181
  */
130
182
  protected captureSettledRoot(rootUri: string, document: AstDocument<AstNode, never>): Promise<void>;
131
183
  /**
@@ -178,9 +230,10 @@ export declare class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel =
178
230
  *
179
231
  * Synchronous by construction — the phase-agnostic lookup door plus the shared
180
232
  * projection — so reacting to a secondary neither waits nor can force a build.
181
- * `settled()` is not an alternative: it strips diagnostics by phase contract,
182
- * and diagnostics are the reason {@link doUpdateAndSubmit} takes a separate
183
- * event document at all.
233
+ * `settled()` is not an alternative: besides being asynchronous, it cannot be
234
+ * relied on to carry diagnostics a document it has to drive to the landmark
235
+ * arrives pre-validation with an empty array — and diagnostics are the reason
236
+ * {@link doUpdateAndSubmit} takes a separate event document at all.
184
237
  */
185
238
  protected currentPrimaryDocument(): AstDocument<AstNode, unknown> | undefined;
186
239
  /**
@@ -222,8 +275,10 @@ export declare class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel =
222
275
  /**
223
276
  * Re-settle to a guaranteed fully-linked + reprojected root, capture it, and
224
277
  * (unless suppressed) resubmit a deduped external GModel. Diagnostics for the
225
- * edit-mode decision come from the event document (`settled()` strips them by
226
- * phase contract).
278
+ * edit-mode decision come from the event document, because the re-settled one
279
+ * cannot be relied on to have any: a document driven to the landmark arrives
280
+ * pre-validation, and this path re-settles precisely to escape a transient
281
+ * mid-rebuild snapshot.
227
282
  */
228
283
  protected doUpdateAndSubmit(rootUri: string, eventDocument: AstDocument<AstNode, unknown>): Promise<Action[]>;
229
284
  /**
@@ -241,12 +296,34 @@ export declare class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel =
241
296
  */
242
297
  protected isStructurallyBroken(document: AstDocument<AstNode, unknown>): boolean;
243
298
  /**
244
- * Seam: actions to emit when the structural-broken state transitions. Default:
245
- * a single {@link SetEditModeAction} toggling READONLY ↔ EDITABLE — editing is
246
- * disabled while the syntax is broken but re-enabled once it parses, a sound
247
- * generic for any Langium-backed diagram. Adopters override to add or replace
248
- * the transition feedback. The {@link AbstractHydraniumGlspState.editMode}
249
- * flip itself is owned by {@link refreshEditMode}.
299
+ * Seam: actions to emit when the structural-broken state transitions.
300
+ * Default: a {@link SetEditModeAction} toggling READONLY ↔ EDITABLE — editing
301
+ * is disabled while the syntax is broken but re-enabled once it parses, a
302
+ * sound generic for any Langium-backed diagram plus the
303
+ * {@link DIAGRAM_READONLY_PARSE_ERROR} band that says why, cleared on the way
304
+ * back. Adopters override to add or replace the transition feedback. The
305
+ * {@link AbstractHydraniumGlspState.editMode} flip itself is owned by
306
+ * {@link refreshEditMode}.
307
+ *
308
+ * **Both actions or neither, which is why they are one seam rather than
309
+ * two.** The mode flip removes the tool palette and the band is the only
310
+ * account of that, so an override that keeps one and drops the other produces
311
+ * either an unexplained loss of the palette or a warning about a restriction
312
+ * that is not in force.
313
+ *
314
+ * **The status is dispatched with no `timeout`, so it persists** — a
315
+ * time-limited band would describe a condition that outlasts it.
316
+ *
317
+ * **The slot is SHARED, and the other writer wins on one path.**
318
+ * `ModelSubmissionHandler`'s live validation writes the same slot, clearing
319
+ * it with `severity: 'NONE'` when it finishes, and an adopter dispatching its
320
+ * own `StatusAction` replaces this one too. Nothing re-asserts it. That is
321
+ * harmless while a document is being edited, because a resubmit is skipped
322
+ * once the AST is broken (see {@link doUpdateAndSubmit}) — but NOT at load:
323
+ * the initial `requestModel` submit is not that skipped path, so a diagram
324
+ * opened on an already-broken document shows this band and then loses it to
325
+ * the validation clear a moment later. Measured on a browser host, polling the
326
+ * overlay: no element, empty, the sentence, empty again.
250
327
  */
251
328
  protected onParseErrorChanged(_document: AstDocument<AstNode, unknown>, broken: boolean): Action[];
252
329
  /**
@@ -254,31 +331,55 @@ export declare class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel =
254
331
  * captured (e.g. an adopter-specific status or palette refresh). Default: none.
255
332
  */
256
333
  protected onSourceModelSettled(_document: AstDocument<AstNode, never>): Action[];
257
- /** The effective {@link SaveConflictPolicy}: the bound option, or {@link DEFAULT_SAVE_CONFLICT_POLICY} when unbound. */
258
- 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;
259
336
  /**
260
- * Default save flow: route through `ModelService.save`. The framework
261
- * serialise-and-persist machinery handles serialisation (via the
262
- * language-specific `Serializer` bound at `services.serializer.Serializer`),
263
- * the multi-client text-document update, the rebuild, and the eventual
264
- * `WritableFileSystemProvider.writeFile`.
337
+ * Default save flow: persist the store's current text for every document this
338
+ * diagram owns.
339
+ *
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.
265
354
  *
266
- * The configured {@link SaveConflictPolicy} (see {@link saveConflictPolicy})
267
- * decides how a concurrent edit that advanced the document is handled:
268
- * - `overwrite` (default): no based-on guard, await, propagate failures
269
- * last-write-wins, correct for a single-editor head.
270
- * - `reject`: guard on the captured `state.version`, await, surface a
271
- * `ConflictError` (and any other failure) to the GLSP save action.
272
- * - `drop-and-log`: guard, fire-and-forget, log + swallow failures — a stale
273
- * diagram save is dropped because a concurrent form/code edit already wrote
274
- * the truth, and GLSP exposes no save-failure back-channel.
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.
275
366
  *
276
367
  * Returns `MaybePromise<void>` to match upstream `SourceModelStorage`:
277
- * resolves with the persist under `overwrite`/`reject`, returns synchronously
278
- * under `drop-and-log`. Adopters that bypass `ModelService` (writing through
279
- * `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.
280
372
  */
281
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>;
282
383
  /**
283
384
  * Normalise GLSP's `sourceUri` — which may be a filesystem PATH or a URI
284
385
  * string — to the URI string the workspace keys documents by.
@@ -305,6 +406,17 @@ export declare class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel =
305
406
  *
306
407
  * Returns it VERBATIM, in whatever form the client sent;
307
408
  * {@link toSourceModelUri} is what normalises it.
409
+ *
410
+ * A model request DOES carry a request id, so a throw here takes the
411
+ * client-request path rather than the toast path — and on that path `detail`
412
+ * comes from `cause?.toString?.()`. A single-argument throw therefore reaches
413
+ * neither the server log nor the client console: both print `undefined`. So
414
+ * the two readers are addressed separately, as on the save path: `message`
415
+ * names what failed in the user's terms and is rendered, `cause` names the
416
+ * action and the option key that was missing and stays English. On THIS path
417
+ * the cause reaches only logs — `RejectAction.detail` is read by nothing but
418
+ * the client action-dispatcher's `logger.warn` — which is not what makes it
419
+ * English; its content is.
308
420
  */
309
421
  protected getSourceUri(action: RequestModelAction): string;
310
422
  /**
@@ -314,12 +426,18 @@ export declare class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel =
314
426
  * {@link AbstractHydraniumGlspState.setSourceRoot}.
315
427
  *
316
428
  * A save action carries no request id, so a throw here reaches the user as a
317
- * toast built from `message`, with `cause` behind its details control. The
318
- * two therefore address different readers and must not be collapsed: the
319
- * message names what failed in the user's terms, and the cause names which
320
- * lookups came back empty for whom. Neither can name the URI not having
321
- * one IS the failure, and both sources are written together, so the typed
322
- * `sourceUri` is equally empty whenever this fires.
429
+ * toast built from `message`, while `cause` travels in
430
+ * `MessageAction.details` **which a Theia host DOES put in front of a
431
+ * user**, as a "Show details" button on the toast opening a dialog. So the
432
+ * two are not split by reachability; they are split by AUDIENCE, which is
433
+ * the older rule and the one that holds here. The message names what failed
434
+ * in the user's terms and is rendered; the cause names which lookups came
435
+ * back empty for whom, and stays English because a wire action kind, an
436
+ * option key and a client id address whoever composes the system — a
437
+ * translated developer string is a worse outcome than an untranslated one.
438
+ * Neither can name the URI — not having one IS the failure, and both sources
439
+ * are written together, so the typed `sourceUri` is equally empty whenever
440
+ * this fires.
323
441
  */
324
442
  protected getFileUri(action: SaveModelAction): string;
325
443
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"hydranium-glsp-storage.d.ts","sourceRoot":"","sources":["../../src/storage/hydranium-glsp-storage.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EACJ,KAAK,MAAM,EACX,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,oBAAoB,EAEpB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EAGf,MAAM,IAAI,UAAU,EACpB,KAAK,YAAY,EAGjB,cAAc,EACd,KAAK,kBAAkB,EAEvB,KAAK,eAAe,EAEpB,KAAK,kBAAkB,EAEzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEtE,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,WAAW,EAAE,KAAK,qBAAqB,EAAE,KAAK,uBAAuB,EAAE,KAAK,oBAAoB,EAAE,MAA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