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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/README.md +20 -5
  2. package/lib/browser/start-glsp-server-in-worker.d.ts +30 -39
  3. package/lib/browser/start-glsp-server-in-worker.d.ts.map +1 -1
  4. package/lib/browser/start-glsp-server-in-worker.js +43 -8
  5. package/lib/browser/start-glsp-server-in-worker.js.map +1 -1
  6. package/lib/command/hydranium-glsp-command-stack.d.ts +27 -0
  7. package/lib/command/hydranium-glsp-command-stack.d.ts.map +1 -0
  8. package/lib/command/hydranium-glsp-command-stack.js +53 -0
  9. package/lib/command/hydranium-glsp-command-stack.js.map +1 -0
  10. package/lib/command/hydranium-glsp-recording-command.d.ts +22 -22
  11. package/lib/command/hydranium-glsp-recording-command.d.ts.map +1 -1
  12. package/lib/command/hydranium-glsp-recording-command.js +25 -26
  13. package/lib/command/hydranium-glsp-recording-command.js.map +1 -1
  14. package/lib/command/index.d.ts +1 -0
  15. package/lib/command/index.d.ts.map +1 -1
  16. package/lib/command/index.js +1 -0
  17. package/lib/command/index.js.map +1 -1
  18. package/lib/launcher/abstract-hydranium-glsp-diagram-module.d.ts +12 -3
  19. package/lib/launcher/abstract-hydranium-glsp-diagram-module.d.ts.map +1 -1
  20. package/lib/launcher/abstract-hydranium-glsp-diagram-module.js +18 -2
  21. package/lib/launcher/abstract-hydranium-glsp-diagram-module.js.map +1 -1
  22. package/lib/launcher/hydranium-glsp-server.d.ts +10 -6
  23. package/lib/launcher/hydranium-glsp-server.d.ts.map +1 -1
  24. package/lib/launcher/hydranium-glsp-server.js +16 -6
  25. package/lib/launcher/hydranium-glsp-server.js.map +1 -1
  26. package/lib/messages/index.d.ts +24 -0
  27. package/lib/messages/index.d.ts.map +1 -0
  28. package/lib/messages/index.js +24 -0
  29. package/lib/messages/index.js.map +1 -0
  30. package/lib/node/start-glsp-server.d.ts +1 -1
  31. package/lib/node/start-glsp-server.d.ts.map +1 -1
  32. package/lib/node/start-glsp-server.js +2 -2
  33. package/lib/node/start-glsp-server.js.map +1 -1
  34. package/lib/state/abstract-hydranium-glsp-state.d.ts +110 -43
  35. package/lib/state/abstract-hydranium-glsp-state.d.ts.map +1 -1
  36. package/lib/state/abstract-hydranium-glsp-state.js +139 -60
  37. package/lib/state/abstract-hydranium-glsp-state.js.map +1 -1
  38. package/lib/state/full-text-hydranium-glsp-state.d.ts +6 -6
  39. package/lib/state/full-text-hydranium-glsp-state.d.ts.map +1 -1
  40. package/lib/state/full-text-hydranium-glsp-state.js +6 -10
  41. package/lib/state/full-text-hydranium-glsp-state.js.map +1 -1
  42. package/lib/state/reconcile-source-model-write.d.ts +9 -8
  43. package/lib/state/reconcile-source-model-write.d.ts.map +1 -1
  44. package/lib/state/reconcile-source-model-write.js +8 -8
  45. package/lib/state/reconcile-source-model-write.js.map +1 -1
  46. package/lib/state/reconciling-multi-document-glsp-state.d.ts +59 -59
  47. package/lib/state/reconciling-multi-document-glsp-state.d.ts.map +1 -1
  48. package/lib/state/reconciling-multi-document-glsp-state.js +84 -82
  49. package/lib/state/reconciling-multi-document-glsp-state.js.map +1 -1
  50. package/lib/state/reconciling-transfer-hydranium-glsp-state.d.ts +19 -18
  51. package/lib/state/reconciling-transfer-hydranium-glsp-state.d.ts.map +1 -1
  52. package/lib/state/reconciling-transfer-hydranium-glsp-state.js +26 -30
  53. package/lib/state/reconciling-transfer-hydranium-glsp-state.js.map +1 -1
  54. package/lib/storage/hydranium-glsp-request-save-model-action-handler.d.ts +30 -0
  55. package/lib/storage/hydranium-glsp-request-save-model-action-handler.d.ts.map +1 -0
  56. package/lib/storage/hydranium-glsp-request-save-model-action-handler.js +47 -0
  57. package/lib/storage/hydranium-glsp-request-save-model-action-handler.js.map +1 -0
  58. package/lib/storage/hydranium-glsp-storage.d.ts +295 -79
  59. package/lib/storage/hydranium-glsp-storage.d.ts.map +1 -1
  60. package/lib/storage/hydranium-glsp-storage.js +435 -94
  61. package/lib/storage/hydranium-glsp-storage.js.map +1 -1
  62. package/lib/storage/index.d.ts +2 -1
  63. package/lib/storage/index.d.ts.map +1 -1
  64. package/lib/storage/index.js +2 -1
  65. package/lib/storage/index.js.map +1 -1
  66. package/lib/storage/save-delivery-policy.d.ts +46 -0
  67. package/lib/storage/save-delivery-policy.d.ts.map +1 -0
  68. package/lib/storage/{save-conflict-policy.js → save-delivery-policy.js} +7 -8
  69. package/lib/storage/save-delivery-policy.js.map +1 -0
  70. package/lib/validation/diagnostic-markers.d.ts +2 -2
  71. package/lib/validation/diagnostic-markers.d.ts.map +1 -1
  72. package/lib/validation/diagnostic-markers.js +7 -0
  73. package/lib/validation/diagnostic-markers.js.map +1 -1
  74. package/lib/validation/hydranium-glsp-model-validator.d.ts.map +1 -1
  75. package/lib/validation/hydranium-glsp-model-validator.js +1 -1
  76. package/lib/validation/hydranium-glsp-model-validator.js.map +1 -1
  77. package/package.json +17 -8
  78. package/src/browser/start-glsp-server-in-worker.ts +41 -44
  79. package/src/command/hydranium-glsp-command-stack.ts +36 -0
  80. package/src/command/hydranium-glsp-recording-command.ts +26 -26
  81. package/src/command/index.ts +1 -0
  82. package/src/launcher/abstract-hydranium-glsp-diagram-module.ts +27 -3
  83. package/src/launcher/hydranium-glsp-server.ts +16 -6
  84. package/src/messages/index.ts +30 -0
  85. package/src/node/start-glsp-server.ts +2 -3
  86. package/src/state/abstract-hydranium-glsp-state.ts +174 -73
  87. package/src/state/full-text-hydranium-glsp-state.ts +7 -11
  88. package/src/state/reconcile-source-model-write.ts +18 -15
  89. package/src/state/reconciling-multi-document-glsp-state.ts +86 -83
  90. package/src/state/reconciling-transfer-hydranium-glsp-state.ts +27 -31
  91. package/src/storage/hydranium-glsp-request-save-model-action-handler.ts +40 -0
  92. package/src/storage/hydranium-glsp-storage.ts +497 -103
  93. package/src/storage/index.ts +2 -1
  94. package/src/storage/save-delivery-policy.ts +44 -0
  95. package/src/validation/diagnostic-markers.ts +10 -3
  96. package/src/validation/hydranium-glsp-model-validator.ts +3 -3
  97. package/lib/storage/save-conflict-policy.d.ts +0 -56
  98. package/lib/storage/save-conflict-policy.d.ts.map +0 -1
  99. package/lib/storage/save-conflict-policy.js.map +0 -1
  100. package/src/storage/save-conflict-policy.ts +0 -52
@@ -1 +1 @@
1
- {"version":3,"file":"abstract-hydranium-glsp-diagram-module.d.ts","sourceRoot":"","sources":["../../src/launcher/abstract-hydranium-glsp-diagram-module.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAI3F;AA0BD;;;;;;;;;;;;;;GAcG;AACH,8BACsB,kCAAmC,SAAQ,aAAa;IAC3E;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,QAAQ,CAAC,eAAe,IAAI,gBAAgB;cAEnC,SAAS,CACzB,IAAI,EAAE,UAAU,CAAC,IAAI,EACrB,MAAM,EAAE,UAAU,CAAC,MAAM,EACzB,OAAO,EAAE,UAAU,CAAC,OAAO,EAC3B,MAAM,EAAE,UAAU,CAAC,MAAM,GACzB,IAAI;CAIT"}
1
+ {"version":3,"file":"abstract-hydranium-glsp-diagram-module.d.ts","sourceRoot":"","sources":["../../src/launcher/abstract-hydranium-glsp-diagram-module.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,aAAa,EACb,KAAK,oBAAoB,EAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAM3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAI3F;AA0BD;;;;;;;;;;;;;;GAcG;AACH,8BACsB,kCAAmC,SAAQ,aAAa;IAC3E;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,QAAQ,CAAC,eAAe,IAAI,gBAAgB;cAEnC,SAAS,CACzB,IAAI,EAAE,UAAU,CAAC,IAAI,EACrB,MAAM,EAAE,UAAU,CAAC,MAAM,EACzB,OAAO,EAAE,UAAU,CAAC,OAAO,EAC3B,MAAM,EAAE,UAAU,CAAC,MAAM,GACzB,IAAI;IAKP,0GAA0G;cACvF,gBAAgB,IAAI,aAAa,CAAC,YAAY,CAAC;IAIlE;;;OAGG;cACgB,uBAAuB,CAAC,OAAO,EAAE,oBAAoB,CAAC,wBAAwB,CAAC,GAAG,IAAI;CAI3G"}
@@ -16,6 +16,8 @@ import { DiagramModule } from '@eclipse-glsp/server';
16
16
  import { injectable } from 'inversify';
17
17
  import { typedMetadata } from '@hydranium/core';
18
18
  import { HydraniumTypes } from '../state/hydranium-shared-core-services.js';
19
+ import { HydraniumGlspRequestSaveModelActionHandler } from '../storage/hydranium-glsp-request-save-model-action-handler.js';
20
+ import { HydraniumGlspCommandStack } from '../command/hydranium-glsp-command-stack.js';
19
21
  /**
20
22
  * Bind {@link HydraniumTypes}.DiagramLanguage on a GLSP **session** container
21
23
  * to the services of `metadata`'s grammar.
@@ -23,8 +25,10 @@ import { HydraniumTypes } from '../state/hydranium-shared-core-services.js';
23
25
  * Exported separately from {@link AbstractHydraniumGlspDiagramModule} for adopters
24
26
  * whose diagram module already extends an intermediate base of their own and
25
27
  * cannot take the framework base class; call it from `configure` after
26
- * `super.configure(...)`. The base class is the preferred entry point because
27
- * it makes the declaration non-optional.
28
+ * `super.configure(...)`, add {@link HydraniumGlspRequestSaveModelActionHandler}
29
+ * in `configureActionHandlers`, and return {@link HydraniumGlspCommandStack} from
30
+ * `bindCommandStack`, all of which the base also does. The base class is the
31
+ * preferred entry point because it makes the declaration non-optional.
28
32
  *
29
33
  * **Why the session tier.** GLSP builds its app container once per process,
30
34
  * before any document exists, so a per-language service bound there can only
@@ -92,6 +96,18 @@ let AbstractHydraniumGlspDiagramModule = class AbstractHydraniumGlspDiagramModul
92
96
  super.configure(bind, unbind, isBound, rebind);
93
97
  bindDiagramLanguage(bind, this.declareLanguage());
94
98
  }
99
+ /** {@link HydraniumGlspCommandStack}, so the diagram is dirty exactly while a document it has open is. */
100
+ bindCommandStack() {
101
+ return HydraniumGlspCommandStack;
102
+ }
103
+ /**
104
+ * Adds {@link HydraniumGlspRequestSaveModelActionHandler}, the save the
105
+ * Theia client sends, beside GLSP's own save handler.
106
+ */
107
+ configureActionHandlers(binding) {
108
+ super.configureActionHandlers(binding);
109
+ binding.add(HydraniumGlspRequestSaveModelActionHandler);
110
+ }
95
111
  };
96
112
  AbstractHydraniumGlspDiagramModule = __decorate([
97
113
  injectable()
@@ -1 +1 @@
1
- {"version":3,"file":"abstract-hydranium-glsp-diagram-module.js","sourceRoot":"","sources":["../../src/launcher/abstract-hydranium-glsp-diagram-module.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;;;;;;;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAmB,MAAM,WAAW,CAAC;AAExD,OAAO,EAA0D,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACxG,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAq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AQ,CAAC,UAAU,qDAAqD;YAC1G,yBAAyB,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI;YACrF,0EAA0E,CAC/E,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AACnB,CAAC;AAED;;;;;;;;;;;;;;GAcG;AAEI,IAAe,kCAAkC,GAAjD,MAAe,kCAAmC,SAAQ,aAAa;IAgBxD,SAAS,CACzB,IAAqB,EACrB,MAAyB,EACzB,OAA2B,EAC3B,MAAyB;QAEzB,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAC/C,mBAAmB,CAAC,IAAI,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,0GAA0G;IACvF,gBAAgB;QAChC,OAAO,yBAAyB,CAAC;IACpC,CAAC;IAED;;;OAGG;IACgB,uBAAuB,CAAC,OAAuD;QAC/F,KAAK,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;QACvC,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAC;IAC3D,CAAC;CACH,CAAA;AAvCqB,kCAAkC;IADvD,UAAU,EAAE;GACS,kCAAkC,CAuCvD"}
@@ -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 all — not 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
@@ -46,9 +47,12 @@ export declare class HydraniumGlspServer extends DefaultGLSPServer {
46
47
  /**
47
48
  * Lifted verbatim from `@eclipse-glsp/server` 2.7.0's
48
49
  * {@link DefaultGLSPServer.handleClientRequest}, with the detail computation
49
- * delegated to {@link requestFailureDetail}. Nothing else here — the
50
- * timeout branch, the response dispatch, the nested send-failure handling —
51
- * relates to that fallback.
50
+ * delegated to {@link requestFailureDetail}, and one addition: a failed
51
+ * {@link RequestSaveModelAction} also raises the error notification a failed
52
+ * `SaveModelAction` raises. A rejection reaches only the client's log, and a
53
+ * Theia host only logs a rejected save, so without it a save that failed
54
+ * would tell the user nothing. Nothing else here — the timeout branch, the
55
+ * response dispatch, the nested send-failure handling — relates to either.
52
56
  *
53
57
  * **This body does not track upstream.** A release that changes request
54
58
  * handling would silently not apply, on the path every request takes. There
@@ -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;AAI9B;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBACa,mBAAoB,SAAQ,iBAAiB;IACvD;;;;;;;;OAQG;IACH,SAAS,CAAC,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS;IAOlE;;;;;;;;;;;;;;;;OAgBG;cACsB,mBAAmB,CACzC,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,aAAa,CAAC,cAAc,CAAC,EACrC,QAAQ,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC;CA4BlB"}
@@ -13,6 +13,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
13
13
  return c > 3 && r && Object.defineProperty(target, key, r), r;
14
14
  };
15
15
  import { DefaultGLSPServer, GLSPServerError, RejectAction } from '@eclipse-glsp/server';
16
+ import { RequestSaveModelAction } from '@hydranium/protocol';
16
17
  import { injectable } from 'inversify';
17
18
  /**
18
19
  * The GLSP server the framework binds in place of upstream's
@@ -23,9 +24,10 @@ import { injectable } from 'inversify';
23
24
  * `error.cause?.toString()` whenever the error is a {@link GLSPServerError},
24
25
  * and that one value feeds both the server log and the client's
25
26
  * {@link RejectAction}. A {@link GLSPServerError} carrying no `cause` therefore
26
- * reaches no reader at all — not 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
27
+ * reaches its readers as `undefined` — the log line and the client's
28
+ * action-dispatcher warning both print it — while a plain `Error` survives,
29
+ * because the other branch reads the error itself. The typed error is the trap,
30
+ * and it is the one upstream's own
29
31
  * `getOrThrow` helper raises: that helper's signature cannot pass a `cause`, so
30
32
  * an adopter using the sanctioned helper has no fix available on their side.
31
33
  * Restating the cause at each throw site is the alternative, and it costs
@@ -58,9 +60,12 @@ let HydraniumGlspServer = class HydraniumGlspServer extends DefaultGLSPServer {
58
60
  /**
59
61
  * Lifted verbatim from `@eclipse-glsp/server` 2.7.0's
60
62
  * {@link DefaultGLSPServer.handleClientRequest}, with the detail computation
61
- * delegated to {@link requestFailureDetail}. Nothing else here — the
62
- * timeout branch, the response dispatch, the nested send-failure handling —
63
- * relates to that fallback.
63
+ * delegated to {@link requestFailureDetail}, and one addition: a failed
64
+ * {@link RequestSaveModelAction} also raises the error notification a failed
65
+ * `SaveModelAction` raises. A rejection reaches only the client's log, and a
66
+ * Theia host only logs a rejected save, so without it a save that failed
67
+ * would tell the user nothing. Nothing else here — the timeout branch, the
68
+ * response dispatch, the nested send-failure handling — relates to either.
64
69
  *
65
70
  * **This body does not track upstream.** A release that changes request
66
71
  * handling would silently not apply, on the path every request takes. There
@@ -87,6 +92,11 @@ let HydraniumGlspServer = class HydraniumGlspServer extends DefaultGLSPServer {
87
92
  detail
88
93
  });
89
94
  this.sendResponseToClient(clientId, reject);
95
+ // Inside the guard: `process` does not await this method, so a
96
+ // closed connection throwing here would be an unhandled rejection.
97
+ if (action.kind === RequestSaveModelAction.KIND) {
98
+ this.handleProcessError({ clientId, action }, error);
99
+ }
90
100
  }
91
101
  catch (sendError) {
92
102
  this.logger.error(`Failed to send rejection for request '${action.requestId}':`, sendError);
@@ -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,M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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;AAlEY,mBAAmB;IAD/B,UAAU,EAAE;GACA,mBAAmB,CAkE/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, DIAGRAM_SESSION_REFUSED, 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,EACJ,4BAA4B,EAC5B,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EACpB,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, DIAGRAM_SESSION_REFUSED, 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,EACJ,4BAA4B,EAC5B,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EACpB,MAAM,sCAAsC,CAAC"}
@@ -8,7 +8,7 @@
8
8
  ********************************************************************************/
9
9
  import { type Logger as GlspLogger, type ServerModule } from '@eclipse-glsp/server/node.js';
10
10
  import { type ContainerModule } from 'inversify';
11
- import type { Logger } from '@hydranium/protocol';
11
+ import { type Logger } from '@hydranium/protocol';
12
12
  import type * as net from 'node:net';
13
13
  import type { IntegratedServer } from '@hydranium/core';
14
14
  import type { LspConnectionLike } from '@hydranium/core/node';
@@ -1 +1 @@
1
- {"version":3,"file":"start-glsp-server.d.ts","sourceRoot":"","sources":["../../src/node/start-glsp-server.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,KAAK,MAAM,I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AAC,MAAM,KAAK,IAAI,CAAC;CAC7D;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACxD,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,iBAAiB,GAAG,iBAAiB,CA+E7E"}
@@ -8,7 +8,7 @@
8
8
  ********************************************************************************/
9
9
  import { SocketServerLauncher, createAppModule, defaultSocketLaunchOptions } from '@eclipse-glsp/server/node.js';
10
10
  import { Container } from 'inversify';
11
- import { Deferred } from '@hydranium/langium';
11
+ import { Deferred } from '@hydranium/protocol';
12
12
  import { createGlspFrameworkOverrides } from '../launcher/glsp-framework-overrides.js';
13
13
  import { createGlspServerOverrides } from '../launcher/glsp-server-overrides.js';
14
14
  /**
@@ -64,7 +64,7 @@ export function startGlspServer(options) {
64
64
  if (options.lspConnection && options.portCommand) {
65
65
  options.lspConnection.onRequest(options.portCommand, () => portHandle.port);
66
66
  }
67
- lifecycle?.info(`[GlspServer] Ready to accept new client requests on port: ${address.port}`);
67
+ lifecycle?.info(`[GlspServer] Ready to accept new client requests on ${address.address} port: ${address.port}`);
68
68
  started.resolve();
69
69
  }
70
70
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"start-glsp-server.js","sourceRoot":"","sources":["../../src/node/start-glsp-server.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAIJ,oBAAoB,EACpB,eAAe,EACf,0BAA0B,EAC5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,SAAS,EAAwB,MAAM,WAAW,CAAC;AAE5D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,OAAO,EAAE,4BAA4B,EAAE,MAAM,yCAAyC,CAAC;AACvF,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAgGjF;;;;;;;;;;;;;;GA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CAAC,IAAI,CAAC;YAC1B,CAAC;YACD,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;YAC9B,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE;SAC5B,CAAC;IACL,CAAC;AACJ,CAAC"}
@@ -9,8 +9,8 @@
9
9
  import { DefaultModelState, type MaybePromise } from '@eclipse-glsp/server';
10
10
  import { Emitter, type Event } from 'vscode-jsonrpc';
11
11
  import { type AstNode, DocumentState } from '@hydranium/langium';
12
- import { type HydraniumScopeProvider, type LanguageTarget, type NameProvider, type ReferenceCandidateProvider, type ServerLanguageServices, type ServerSharedServices } from '@hydranium/core';
13
- import type { ConflictResolver, Logger, Tracer } from '@hydranium/protocol';
12
+ import { type ClientSession, type HydraniumScopeProvider, type LanguageTarget, type NameProvider, type ReferenceCandidateProvider, type ServerLanguageServices, type ServerSharedServices } from '@hydranium/core';
13
+ import { type BasedOn, type SnapshotVersion, type ConflictResolver, type Logger, type Tracer } from '@hydranium/protocol';
14
14
  import { type HydraniumGlspIndex } from './hydranium-glsp-index.js';
15
15
  import { ModelReadyTimeoutError } from './model-ready-timeout-error.js';
16
16
  /**
@@ -71,12 +71,31 @@ export declare abstract class AbstractHydraniumGlspState<TRoot extends AstNode,
71
71
  protected readonly baseTracer: Tracer;
72
72
  /** Narrows {@link DefaultModelState.index} to the framework-extended index type. */
73
73
  readonly index: HydraniumGlspIndex;
74
+ /**
75
+ * The client session this diagram works as, registered under `clientId` by
76
+ * the source-model storage and ended with the GLSP client session.
77
+ * `undefined` for GLSP's placeholder client, and when the id was held by
78
+ * another participant, in which case the diagram does not load.
79
+ *
80
+ * Every write of the diagram goes through this session, which writes only a
81
+ * document it has open and opens nothing. A one-shot write to a document
82
+ * outside the write set goes through
83
+ * {@link ClientSession.withOpen}, and a document the diagram brings into
84
+ * existence through {@link ClientSession.create}.
85
+ */
86
+ modelSession?: ClientSession<AstNode>;
87
+ /**
88
+ * {@link modelSession}, or a throw without one: the diagram never loaded or
89
+ * has ended. Looking `clientId` up through `ModelService.getSession` instead
90
+ * would write as whichever participant holds that id.
91
+ */
92
+ protected requireModelSession(): ClientSession<AstNode>;
74
93
  protected _sourceUri: string;
75
94
  protected _sourceRoot: TRoot;
76
95
  protected _tracer?: Tracer;
77
- protected _version: number;
78
- /** Based-on versions of the secondary write set, keyed by URI. See {@link trackSecondaryDocument}. */
79
- protected readonly _secondaryVersions: Map<string, number>;
96
+ protected _basedOn: SnapshotVersion;
97
+ /** Snapshot versions of the secondary write set, keyed by URI. See {@link trackSecondaryDocument}. */
98
+ protected readonly _secondaryVersions: Map<string, SnapshotVersion>;
80
99
  /** Backing emitter for {@link onSecondaryUrisChanged}; fired only on a membership change. */
81
100
  protected readonly secondaryUrisChangedEmitter: Emitter<void>;
82
101
  /** Default of one minute. */
@@ -170,27 +189,35 @@ export declare abstract class AbstractHydraniumGlspState<TRoot extends AstNode,
170
189
  /** URI-tagged once {@link setSourceRoot} has run; the class-tagged injected {@link baseTracer} before that. */
171
190
  get tracer(): Tracer;
172
191
  /**
173
- * Text-document version captured at the last {@link setSourceRoot}
174
- * call. Mirrors the server-side `TextDocuments.version(uri)` counter
175
- * at that point in time — frozen until the next `setSourceRoot`, then
176
- * re-read from `LangiumDocuments`.
192
+ * Snapshot version taken at the last {@link setSourceRoot} call — frozen
193
+ * until the next one, then re-read from the document store.
177
194
  *
178
195
  * Threaded by `HydraniumGlspRecordingCommand` into
179
- * {@link updateSourceModel}'s optional `version` parameter so the
180
- * downstream `ModelService.update` / `.save` call can opt into the
181
- * conflict gate against the captured based-on version. See
196
+ * {@link updateSourceModel} so the downstream session `update` / `save`
197
+ * gates against what the command was authored on. See
182
198
  * `@hydranium/protocol#ConflictError` for the detection contract.
183
199
  *
200
+ * **This, not a number read at write time, is what a write must be gated
201
+ * on.** A version read when the write is issued is the store's current one,
202
+ * so it matches by construction and the gate can never fire.
203
+ */
204
+ get basedOn(): SnapshotVersion;
205
+ /**
206
+ * Text-document version of {@link basedOn}. Mirrors the server-side
207
+ * `TextDocuments.version(uri)` counter as of the snapshot, or is
208
+ * `NO_MATCHING_VERSION` when the store's text could not be tied to the
209
+ * root (see {@link readSnapshotVersion}).
210
+ *
184
211
  * Falls back to `0` when the document is absent from `LangiumDocuments`
185
- * at capture time — the same observable state callers see for a doc
186
- * that was never opened. Callers that need to distinguish
212
+ * when the snapshot is taken — the same observable state callers see for a
213
+ * doc that was never opened. Callers that need to distinguish
187
214
  * "never-versioned" from "v0" must consult the document registry
188
215
  * directly.
189
216
  */
190
217
  get version(): number;
191
218
  /**
192
- * Register `uri` as a document this state also writes, capturing its current
193
- * text-document version.
219
+ * Register `uri` as a document this state also writes, snapshotting its
220
+ * current text-document version.
194
221
  *
195
222
  * A diagram whose layout lives in its own file, or whose canvas creates
196
223
  * elements in a referenced semantic document, writes more than the document
@@ -203,7 +230,7 @@ export declare abstract class AbstractHydraniumGlspState<TRoot extends AstNode,
203
230
  * identified once the operation names the node. What the framework supplies
204
231
  * is the part an adopter cannot reconstruct after the fact — the version each
205
232
  * document was at BEFORE the command mutated anything (see
206
- * {@link capturedVersionOf}). Idempotent; registering the primary is ignored,
233
+ * {@link snapshotVersionOf}). Idempotent; registering the primary is ignored,
207
234
  * since {@link version} already tracks it. Registering a URI not already in
208
235
  * the set fires {@link onSecondaryUrisChanged}.
209
236
  */
@@ -215,14 +242,15 @@ export declare abstract class AbstractHydraniumGlspState<TRoot extends AstNode,
215
242
  untrackSecondaryDocuments(): void;
216
243
  /**
217
244
  * Fires whenever the secondary write set gains or loses a URI — never when a
218
- * tracked document's captured version is merely refreshed, which happens on
245
+ * tracked document's snapshot version is merely refreshed, which happens on
219
246
  * every {@link setSourceRoot} and changes nothing a subscriber cares about.
220
247
  *
221
248
  * **This exists so no caller has to know when the set can change.** The set is
222
249
  * usually discovered rather than known, and the discovery point is an
223
- * operation handler naming a node — not a capture. A subscriber that instead
224
- * re-derived the set after each capture would miss exactly that case, and miss
225
- * it silently: the document would simply never be watched, with nothing logged.
250
+ * operation handler naming a node — not a read of the source root. A
251
+ * subscriber that instead re-derived the set after each such read would miss
252
+ * exactly that case, and miss it silently: the document would simply never be
253
+ * watched, with nothing logged.
226
254
  * Announcing the change here moves the obligation to the one place that can
227
255
  * always discharge it.
228
256
  *
@@ -235,25 +263,43 @@ export declare abstract class AbstractHydraniumGlspState<TRoot extends AstNode,
235
263
  /** Registered secondary document URIs, in registration order. */
236
264
  get secondaryUris(): readonly string[];
237
265
  /**
238
- * Based-on version captured for `uri` — {@link version} for the primary, the
239
- * value captured at {@link trackSecondaryDocument} (refreshed by
240
- * {@link setSourceRoot}) for a secondary, `undefined` for anything untracked.
266
+ * Snapshot version for `uri` — {@link basedOn} for the primary, the version
267
+ * taken at {@link trackSecondaryDocument} (refreshed by {@link setSourceRoot})
268
+ * for a secondary, `undefined` for anything untracked.
241
269
  *
242
- * `undefined` rather than `0` for an untracked URI deliberately: `0` is a real
270
+ * `undefined` rather than v0 for an untracked URI deliberately: `0` is a real
243
271
  * version meaning "present but never edited", so collapsing the two would let
244
- * a caller gate a write against a document it never captured.
272
+ * a caller gate a write against a document this state never read.
245
273
  */
246
- capturedVersionOf(uri: string): number | undefined;
274
+ snapshotVersionOf(uri: string): SnapshotVersion | undefined;
247
275
  /**
248
- * Read a document's current text-document version through the model service's
249
- * canonicalizing gateway, so a URI spelled through a symlink still resolves to
250
- * the document keyed by its real path rather than stranding at `0` (which
251
- * would silently weaken the conflict gate). Optional-chained on `textDocument`
252
- * so a fixture that omits it does not throw; real Langium documents always
253
- * populate it.
276
+ * Read a document's version out of the live store and mark it as a snapshot,
277
+ * through the model service's canonicalizing gateway so a URI spelled through
278
+ * a symlink still resolves to the document keyed by its real path rather than
279
+ * stranding at `0` (which would silently weaken the conflict gate).
280
+ *
281
+ * **Call this only at the point the source root is read.** It is the one
282
+ * place the framework turns a live version into a snapshot one, and the value
283
+ * is true only because that is where it is called. Called at write time it
284
+ * answers with the version the write is about to be compared against, so the
285
+ * gate passes unconditionally.
286
+ *
287
+ * Falls back to v0 for a URI neither store knows, matching what
288
+ * {@link version} reports for a document that was never opened.
289
+ *
290
+ * **The version of the text store, which the gate compares against.**
291
+ * When the store holds the text the root was parsed from, that is its
292
+ * version, even while the built document still carries an older number.
293
+ * When the store holds other text, `NO_MATCHING_VERSION`, so the write
294
+ * conflicts instead of overwriting text the root never saw: the
295
+ * reconciling states reconcile it, `FullTextHydraniumGlspState` throws the
296
+ * `ConflictError`. When the root keeps no syntax tree to read its text
297
+ * from, the built document's text stands in for it, unless the built
298
+ * document IS the store's, whose text says nothing about what was parsed;
299
+ * that also gets `NO_MATCHING_VERSION`.
254
300
  */
255
- protected readDocumentVersion(uri: string): number;
256
- /** Re-read every registered secondary's version from the document store. */
301
+ protected readSnapshotVersion(uri: string): SnapshotVersion;
302
+ /** Re-take every registered secondary's snapshot version from the document store. */
257
303
  protected refreshSecondaryVersions(): void;
258
304
  /**
259
305
  * Re-capture the source root from the current Langium document,
@@ -263,6 +309,18 @@ export declare abstract class AbstractHydraniumGlspState<TRoot extends AstNode,
263
309
  * handlers) must see the root the freshly built document carries.
264
310
  */
265
311
  protected refreshSourceRoot(): void;
312
+ /**
313
+ * The root that `uri`'s text parses to (the text store's, or the built
314
+ * document's when the store holds none), read once the document has
315
+ * validated; `undefined` when it cannot be read.
316
+ *
317
+ * **Parsed afresh, never the built root.** Operation handlers edit the
318
+ * built root in place, so until a rebuild replaces it, it already holds
319
+ * the edit being reconciled, and replaying the edit onto it applies it
320
+ * twice. The root is parsed, not linked: an encoder hook reading a
321
+ * reference's `ref` sees `undefined` on it.
322
+ */
323
+ protected readCurrentRoot(uri: string): Promise<AstNode | undefined>;
266
324
  /**
267
325
  * Wait until the captured document reaches `state`, then run
268
326
  * {@link onReadyRefreshed} so consumers see a fresh AST. Wraps the
@@ -320,14 +378,23 @@ export declare abstract class AbstractHydraniumGlspState<TRoot extends AstNode,
320
378
  * `JsonModelState` shape meet the framework state via structural
321
379
  * intersection at the recording-command call site.
322
380
  *
323
- * `version` is the based-on text-document version captured at command
324
- * start by `HydraniumGlspRecordingCommand.execute`. Adopters that
325
- * route through `ModelService.update` / `.save` pass it as the args'
326
- * `version` field to opt into the conflict gate; adopters that don't
327
- * care (or whose write path doesn't go through `ModelService`) ignore
328
- * the parameter. Undefined when the writer is not the recording-command
329
- * (e.g. external storage refresh paths).
381
+ * `basedOn` is the snapshot version taken at command start by
382
+ * `HydraniumGlspRecordingCommand.execute`. Adopters that write through the
383
+ * diagram's session forward it as the args' `basedOn` field; adopters whose
384
+ * write path doesn't go through the session ignore it.
385
+ * `'anything'` when the writer is not the recording command (an external
386
+ * storage refresh, an undo replaying a recorded patch), which is a write
387
+ * authored against no particular server version.
388
+ *
389
+ * **Optional, and every implementation must default it to {@link basedOn}
390
+ * rather than to `'anything'`.** Optional is forced: GLSP's `JsonModelState`
391
+ * declares a one-parameter `updateSourceModel` and calls it with one
392
+ * argument, so a second required parameter makes the state unassignable to
393
+ * the slot it has to fill. Defaulting to the state's own snapshot version is
394
+ * what keeps that from costing anything — an operation handler calling
395
+ * `updateSourceModel(model)` gets the gate, and skipping it has to be typed
396
+ * out as `'anything'`.
330
397
  */
331
- abstract updateSourceModel(model: TSourceModel, version?: number): MaybePromise<void>;
398
+ abstract updateSourceModel(model: TSourceModel, basedOn?: BasedOn): MaybePromise<void>;
332
399
  }
333
400
  //# sourceMappingURL=abstract-hydranium-glsp-state.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"abstract-hydranium-glsp-state.d.ts","sourceRoot":"","sources":["../../src/state/abstract-hydranium-glsp-state.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,iBAAiB,EAAE,KAAK,YAAY,EAAkB,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,KAAK,OAAO,EAAE,aAAa,EAAO,MAAM,oBAAoB,CAAC;AACtE,OAAO,EACJ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