@hydranium/glsp-client-theia 1.0.0-next.32 → 1.0.0-next.321

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 (87) hide show
  1. package/README.md +60 -98
  2. package/lib/browser/client-contribution.d.ts +87 -25
  3. package/lib/browser/client-contribution.d.ts.map +1 -1
  4. package/lib/browser/client-contribution.js +233 -53
  5. package/lib/browser/client-contribution.js.map +1 -1
  6. package/lib/browser/diagram-only-marker-manager.d.ts.map +1 -1
  7. package/lib/browser/diagram-only-marker-manager.js.map +1 -1
  8. package/lib/browser/diagram-widget.d.ts +43 -25
  9. package/lib/browser/diagram-widget.d.ts.map +1 -1
  10. package/lib/browser/diagram-widget.js +76 -26
  11. package/lib/browser/diagram-widget.js.map +1 -1
  12. package/lib/browser/glsp-client-theia-module.d.ts +12 -5
  13. package/lib/browser/glsp-client-theia-module.d.ts.map +1 -1
  14. package/lib/browser/glsp-client-theia-module.js +27 -12
  15. package/lib/browser/glsp-client-theia-module.js.map +1 -1
  16. package/lib/browser/glsp-diagram-manager.d.ts +40 -1
  17. package/lib/browser/glsp-diagram-manager.d.ts.map +1 -1
  18. package/lib/browser/glsp-diagram-manager.js +100 -0
  19. package/lib/browser/glsp-diagram-manager.js.map +1 -1
  20. package/lib/browser/glsp-message-service.d.ts.map +1 -1
  21. package/lib/browser/glsp-message-service.js.map +1 -1
  22. package/lib/browser/glsp-saveable.d.ts +67 -0
  23. package/lib/browser/glsp-saveable.d.ts.map +1 -0
  24. package/lib/browser/glsp-saveable.js +110 -0
  25. package/lib/browser/glsp-saveable.js.map +1 -0
  26. package/lib/browser/glsp-theia-frontend-module.d.ts.map +1 -1
  27. package/lib/browser/glsp-theia-frontend-module.js +4 -1
  28. package/lib/browser/glsp-theia-frontend-module.js.map +1 -1
  29. package/lib/browser/hydranium-glsp-diagram-configuration.d.ts +3 -1
  30. package/lib/browser/hydranium-glsp-diagram-configuration.d.ts.map +1 -1
  31. package/lib/browser/hydranium-glsp-diagram-configuration.js +3 -1
  32. package/lib/browser/hydranium-glsp-diagram-configuration.js.map +1 -1
  33. package/lib/browser/index.d.ts +4 -3
  34. package/lib/browser/index.d.ts.map +1 -1
  35. package/lib/browser/index.js +7 -5
  36. package/lib/browser/index.js.map +1 -1
  37. package/lib/browser/theia-diagram-loader.d.ts +25 -0
  38. package/lib/browser/theia-diagram-loader.d.ts.map +1 -0
  39. package/lib/browser/theia-diagram-loader.js +42 -0
  40. package/lib/browser/theia-diagram-loader.js.map +1 -0
  41. package/lib/browser/window-session.d.ts +57 -0
  42. package/lib/browser/window-session.d.ts.map +1 -0
  43. package/lib/browser/window-session.js +102 -0
  44. package/lib/browser/window-session.js.map +1 -0
  45. package/lib/node/connection-container-module.js.map +1 -1
  46. package/lib/node/glsp-server-connection-handler.d.ts +11 -20
  47. package/lib/node/glsp-server-connection-handler.d.ts.map +1 -1
  48. package/lib/node/glsp-server-connection-handler.js +12 -15
  49. package/lib/node/glsp-server-connection-handler.js.map +1 -1
  50. package/package.json +37 -46
  51. package/src/browser/client-contribution.ts +254 -55
  52. package/src/browser/diagram-widget.ts +80 -28
  53. package/src/browser/glsp-client-theia-module.ts +34 -13
  54. package/src/browser/glsp-diagram-manager.ts +112 -3
  55. package/src/browser/glsp-saveable.ts +111 -0
  56. package/src/browser/glsp-theia-frontend-module.ts +4 -1
  57. package/src/browser/hydranium-glsp-diagram-configuration.ts +3 -1
  58. package/src/browser/index.ts +12 -5
  59. package/src/browser/theia-diagram-loader.ts +31 -0
  60. package/src/browser/window-session.ts +114 -0
  61. package/src/node/glsp-server-connection-handler.ts +12 -24
  62. package/style/diagram-loading.css +2 -5
  63. package/lib/browser/action-dispatcher.d.ts +0 -85
  64. package/lib/browser/action-dispatcher.d.ts.map +0 -1
  65. package/lib/browser/action-dispatcher.js +0 -238
  66. package/lib/browser/action-dispatcher.js.map +0 -1
  67. package/lib/browser/diagram-loader.d.ts +0 -123
  68. package/lib/browser/diagram-loader.d.ts.map +0 -1
  69. package/lib/browser/diagram-loader.js +0 -153
  70. package/lib/browser/diagram-loader.js.map +0 -1
  71. package/lib/browser/hidden-bounds-updater.d.ts +0 -122
  72. package/lib/browser/hidden-bounds-updater.d.ts.map +0 -1
  73. package/lib/browser/hidden-bounds-updater.js +0 -207
  74. package/lib/browser/hidden-bounds-updater.js.map +0 -1
  75. package/lib/testing/bind-recorder.d.ts +0 -67
  76. package/lib/testing/bind-recorder.d.ts.map +0 -1
  77. package/lib/testing/bind-recorder.js +0 -72
  78. package/lib/testing/bind-recorder.js.map +0 -1
  79. package/lib/testing/index.d.ts +0 -10
  80. package/lib/testing/index.d.ts.map +0 -1
  81. package/lib/testing/index.js +0 -30
  82. package/lib/testing/index.js.map +0 -1
  83. package/src/browser/action-dispatcher.ts +0 -257
  84. package/src/browser/diagram-loader.ts +0 -173
  85. package/src/browser/hidden-bounds-updater.ts +0 -212
  86. package/src/testing/bind-recorder.ts +0 -126
  87. package/src/testing/index.ts +0 -15
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2026 CrossBreeze, EclipseSource and others.
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the MIT License which is available in the project root.
7
+ *
8
+ * SPDX-License-Identifier: MIT
9
+ ********************************************************************************/
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.HydraniumGlspSaveable = void 0;
12
+ const protocol_1 = require("@hydranium/protocol");
13
+ // The module path, not the package root: the root also loads GLSP's diagram
14
+ // widget, which touches DOM globals at module load, and this module's unit tests
15
+ // load it in Node.
16
+ const glsp_saveable_1 = require("@eclipse-glsp/theia-integration/lib/browser/diagram/glsp-saveable");
17
+ /**
18
+ * A `GLSPSaveable` whose every save is a request the server answers, and which
19
+ * stays dirty until that answer arrives.
20
+ *
21
+ * GLSP's sends a `SaveModelAction`, which the server does not answer. It takes
22
+ * the next dirty-state change to clean as the answer, but the editor context
23
+ * reports a change only when the dirty flag changes: the second of two saves
24
+ * gets no answer, and a failed save gets none either. Here each save sends a
25
+ * `RequestSaveModelAction` and settles on the response to that request only:
26
+ * it resolves when the server has saved, rejects when the server rejects it,
27
+ * and rejects when {@link saveTimeout} runs out. A save sent while another is
28
+ * pending is a request of its own, so an edit made between the two is saved.
29
+ *
30
+ * GLSP's also reports not dirty from the moment it sends a save. Theia's exit
31
+ * check asks only whether anything is dirty, so the window closes over a save
32
+ * the server has not finished, and a page reloaded right after Ctrl+S gives no
33
+ * warning. Here the saveable is dirty while any save is pending. GLSP's also
34
+ * gives up after 2 s, and Theia's Save All then counts the save as failed and
35
+ * closes the window anyway, so a slow save of a large model is cut off.
36
+ *
37
+ * The dirty flag still comes from the server. An edit whose dirty-state change
38
+ * has not arrived when Save All runs does not make the saveable dirty, so that
39
+ * edit is not saved.
40
+ *
41
+ * The server answers only where the diagram module registers the request's
42
+ * handler; `AbstractHydraniumGlspDiagramModule` does. A server without it does
43
+ * not advertise the request, and against such a server the saveable is GLSP's:
44
+ * it sends a `SaveModelAction` and reports dirty as GLSP's does. It does not
45
+ * keep only the dirty-while-pending half there, because GLSP's tracks one
46
+ * pending save and a second save overwrites it, so the first would never
47
+ * report clean.
48
+ *
49
+ * The answer means the server has done what its save does, which is not always
50
+ * the disk write: under the `fire-and-forget` `SaveDeliveryPolicy` the server
51
+ * answers before the write finishes and answers a failed write as saved, so a
52
+ * window closed on that answer can still lose the write.
53
+ */
54
+ class HydraniumGlspSaveable extends glsp_saveable_1.GLSPSaveable {
55
+ /**
56
+ * How long a save waits for the server's response before it rejects. The
57
+ * server answers up to its language-client settle bound after the write, so
58
+ * this exceeds that bound with room for the write itself; a save that
59
+ * rejects in Theia's Save All lets the window close over it.
60
+ */
61
+ saveTimeout = 20_000;
62
+ /** The saves sent and not yet settled. */
63
+ pendingSaves = new Set();
64
+ get dirty() {
65
+ if (!this.serverAnswersSaves()) {
66
+ return super.dirty;
67
+ }
68
+ return this.editorContextService.isDirty || this.pendingSaves.size > 0;
69
+ }
70
+ save() {
71
+ if (!this.serverAnswersSaves()) {
72
+ return super.save();
73
+ }
74
+ if (this.editorContextService.isDirty) {
75
+ return this.sendSave();
76
+ }
77
+ // Nothing new to save, but a save still pending has not finished.
78
+ return Promise.all(this.pendingSaves).then(() => undefined);
79
+ }
80
+ /**
81
+ * Whether the server answers a {@link RequestSaveModelAction}. GLSP's model
82
+ * source registers a handler for each kind the server advertises before it
83
+ * requests the model, so the dispatcher knows it from the first save on.
84
+ */
85
+ serverAnswersSaves() {
86
+ return this.actionDispatcher.hasHandler(protocol_1.RequestSaveModelAction.create());
87
+ }
88
+ sendSave() {
89
+ // `request` with a bound of our own rather than GLSP's `requestUntil`:
90
+ // that one forgets a request when it times out, so a late response is
91
+ // dispatched as an action no client handler takes, which rejects.
92
+ // Here a late response settles the forgotten request and nothing else.
93
+ const response = this.actionDispatcher.request(protocol_1.RequestSaveModelAction.create());
94
+ let timer;
95
+ const timedOut = new Promise((_resolve, reject) => {
96
+ timer = setTimeout(() => reject(new Error('Save operation timed out')), this.saveTimeout);
97
+ });
98
+ const saving = Promise.race([response, timedOut])
99
+ .then(() => undefined)
100
+ .finally(() => {
101
+ clearTimeout(timer);
102
+ this.pendingSaves.delete(saving);
103
+ this.onDirtyChangedEmitter.fire(undefined);
104
+ });
105
+ this.pendingSaves.add(saving);
106
+ return saving;
107
+ }
108
+ }
109
+ exports.HydraniumGlspSaveable = HydraniumGlspSaveable;
110
+ //# sourceMappingURL=glsp-saveable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glsp-saveable.js","sourceRoot":"","sources":["../../src/browser/glsp-saveable.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAElF,kDAA6D;AAC7D,4EAA4E;AAC5E,iFAAiF;AACjF,mBAAmB;AACnB,qGAAiG;AAEjG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,2BAAmC,SAAQ,4BAAY;IACpD;;;;;OAKG;IACgB,WAAW,GAAG,M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AC;IAEhE,oFAAoF;IACpF,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,oBAAoB,EAAE,UAAU,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAE3F,8FAA8F;IAC9F,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,cAAc,EAAE,UAAU,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAEnF;;;;;;;;;;OAUG;IACH,SAAS,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE/C;;;;;;;;;OASG;IACH,SAAS,CAAC,sBAAsB,IAAI,UAAU,CAAC,OAAO,CAAC,sBAAsB,CAAC,GAAG,sBAAsB,GAAG,SAAS,CAElH;IAED;;;;;;;OAOG;IACM,UAAU,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAOnD;IAEQ,wBAAwB,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAEjE;IAEQ,0BAA0B,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAWnE;IAEQ,uBAAuB,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAGhE;IAED;;;;;;;;;;;;;;;;OAgBG;IACM,wBAAwB,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAGjE;CACH"}
@@ -10,8 +10,9 @@
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
11
  exports.AbstractHydraniumGlspTheiaFrontendModule = exports.SkipClientContribution = void 0;
12
12
  const theia_integration_1 = require("@eclipse-glsp/theia-integration");
13
- const browser_1 = require("@hydranium/client-theia/lib/browser");
13
+ const browser_1 = require("@hydranium/client-theia/browser");
14
14
  const diagram_widget_1 = require("./diagram-widget");
15
+ const window_session_1 = require("./window-session");
15
16
  /**
16
17
  * Sentinel returned from {@link AbstractHydraniumGlspTheiaFrontendModule.bindClientContribution}
17
18
  * to mean "this module deliberately does not bind a GLSPClientContribution"
@@ -84,6 +85,8 @@ class AbstractHydraniumGlspTheiaFrontendModule extends theia_integration_1.GLSPT
84
85
  */
85
86
  initialize(context) {
86
87
  super.initialize(context);
88
+ (0, browser_1.bindConnectionReporter)(context.bind, context.isBound);
89
+ (0, window_session_1.bindWindowSessionService)(context.bind, context.isBound);
87
90
  if (this.logLevelPreference) {
88
91
  (0, browser_1.bindLogLevelPreference)(context.bind, this.logLevelPreference);
89
92
  }
@@ -1 +1 @@
1
- {"version":3,"file":"glsp-theia-frontend-module.js","sourceRoot":"","sources":["../../src/browser/glsp-theia-frontend-module.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAElF,uEAQyC;AAEzC,iEAA6E;AAE7E,qDAA8D;AAE9D;;;;;;GAMG;AACU,QAAA,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAAC,qDAAqD,CAAC,CAAC;AAGxG;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAsB,wCAAyC,SAAQ,2CAAuB;IAU3F;;;;;;;;;;OAUG;IACgB,kBAAkB,CAAU;IAE/C;;;;;;;;;OASG;IACO,sBAAsB;QAC7B,OAAO,SAAS,CAAC;IACpB,CAAC;IAED;;;;;;;OAOG;IACM,UAAU,CAAC,OAAyB;QAC1C,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC1B,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC3B,IAAA,gCAAsB,EAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;QACjE,CAAC;IACJ,CAAC;IAEQ,wBAAwB,CAAC,OAAyB;QACxD,OAAO,CAAC,IAAI,CAAC,wCAAoB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;IACpE,CAAC;IAEQ,0BAA0B,CAAC,OAAyB;QAC1D,MAAM,YAAY,GAAG,IAAI,CAAC,sBAAsB,EAAE,CAAC;QACnD,IAAI,YAAY,KAAK,8BAAsB,EAAE,CAAC;YAC3C,OAAO;QACV,CAAC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;;;OAgBG;IACM,wBAAwB,CAAC,OAAyB;QACxD,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;QACxC,OAAO,CAAC,MAAM,CAAC,qCAAiB,CAAC,CAAC,EAAE,CAAC,2CAA0B,CAAC,CAAC;IACpE,CAAC;CACH"}
@@ -18,7 +18,9 @@ import { type Container } from '@theia/core/shared/inversify';
18
18
  * **When to suppress.** A head with a co-resident LSP that publishes its
19
19
  * diagnostics over standard LSP `publishDiagnostics` would otherwise list each
20
20
  * error twice: GLSP's `TheiaMarkerManager` pushes the *same* errors again under
21
- * a different marker owner, and Theia shows the union across owners. The GLSP
21
+ * a different marker owner, and Theia shows the union across owners. One shared
22
+ * owner would not merge them either: each write replaces that owner's markers
23
+ * for the file, so the two heads would overwrite each other's. The GLSP
22
24
  * path is also open-diagram-scoped (markers clear when the diagram closes), so
23
25
  * for such a head it cannot reproduce the LSP head's persistent, cross-file
24
26
  * Problems entries — it is only ever a flickering duplicate. A graphical-only
@@ -1 +1 @@
1
- {"version":3,"file":"hydranium-glsp-diagram-configuration.d.ts","sourceRoot":"","sources":["../../src/browser/hydranium-glsp-diagram-configuration.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAAE,wBAAwB,EAA6D,MAAM,iCAAiC,CAAC;AACtI,OAAO,EAAE,KAAK,SAAS,EAAc,MAAM,8BAA8B,CAAC;AAG1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,8BACsB,yCAA0C,SAAQ,wBAAwB;IAC7F;;;;;OAKG;IACH,SAAS,CAAC,8BAA8B,UAAQ;cAE7B,mBAAmB,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;CAOpE"}
1
+ {"version":3,"file":"hydranium-glsp-diagram-configuration.d.ts","sourceRoot":"","sources":["../../src/browser/hydranium-glsp-diagram-configuration.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAAE,wBAAwB,EAA6D,MAAM,iCAAiC,CAAC;AACtI,OAAO,EAAE,KAAK,SAAS,EAAc,MAAM,8BAA8B,CAAC;AAG1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,8BACsB,yCAA0C,SAAQ,wBAAwB;IAC7F;;;;;OAKG;IACH,SAAS,CAAC,8BAA8B,UAAQ;IAEhD,UAAmB,mBAAmB,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAMjE;CACH"}
@@ -28,7 +28,9 @@ const diagram_only_marker_manager_js_1 = require("./diagram-only-marker-manager.
28
28
  * **When to suppress.** A head with a co-resident LSP that publishes its
29
29
  * diagnostics over standard LSP `publishDiagnostics` would otherwise list each
30
30
  * error twice: GLSP's `TheiaMarkerManager` pushes the *same* errors again under
31
- * a different marker owner, and Theia shows the union across owners. The GLSP
31
+ * a different marker owner, and Theia shows the union across owners. One shared
32
+ * owner would not merge them either: each write replaces that owner's markers
33
+ * for the file, so the two heads would overwrite each other's. The GLSP
32
34
  * path is also open-diagram-scoped (markers clear when the diagram closes), so
33
35
  * for such a head it cannot reproduce the LSP head's persistent, cross-file
34
36
  * Problems entries — it is only ever a flickering duplicate. A graphical-only
@@ -1 +1 @@
1
- {"version":3,"file":"hydranium-glsp-diagram-configuration.js","sourceRoot":"","sources":["../../src/browser/hydranium-glsp-diagram-configuration.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;AAGlF,uEAAsI;AACtI,4DAA0E;AAC1E,qFAA6E;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEI,IAAe,yCAAyC,GAAxD,MAAe,yCAA0C,SAAQ,4CAAwB;IAC7F;;;;;OAKG;IACO,8BAA8B,GAAG,IAAI,CAAC;IAE7B,mBAAmB,CAAC,SAAoB;QACxD,IAAA,kDAA8B,EAAC,SAAS,EAAE,IAAI,CAAC,yBAAyB,CAAC,CAAC;QAC1E,MAAM,oBAAoB,GAAG,IAAI,CAAC,8BAA8B;YAC7D,CAAC,CAAC,IAAI,CAAC,kBAAkB;YACzB,CAAC,CAAC,GAA0B,EAAE,CAAC,IAAI,0DAAyB,EAAE,CAAC;QAClE,IAAA,6CAAyB,EAAC,SAAS,EAAE,oBAAoB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAChF,CAAC;CACH,CAAA;AAhBqB,8FAAyC;oDAAzC,yCAAyC;IAD9D,IAAA,sBAAU,GAAE;GACS,yCAAyC,CAgB9D"}
1
+ {"version":3,"file":"hydranium-glsp-diagram-configuration.js","sourceRoot":"","sources":["../../src/browser/hydranium-glsp-diagram-configuration.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;AAGlF,uEAAsI;AACtI,4DAA0E;AAC1E,qFAA6E;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEI,IAAe,yCAAyC,GAAxD,MAAe,yCAA0C,SAAQ,4CAAwB;IAC7F;;;;;OAKG;IACO,8BAA8B,GAAG,IAAI,CAAC;IAE7B,mBAAmB,CAAC,SAAoB;QACxD,IAAA,kDAA8B,EAAC,SAAS,EAAE,IAAI,CAAC,yBAAyB,CAAC,CAAC;QAC1E,MAAM,oBAAoB,GAAG,IAAI,CAAC,8BAA8B;YAC7D,CAAC,CAAC,IAAI,CAAC,kBAAkB;YACzB,CAAC,CAAC,GAA0B,EAAE,CAAC,IAAI,0DAAyB,EAAE,CAAC;QAClE,IAAA,6CAAyB,EAAC,SAAS,EAAE,oBAAoB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAChF,CAAC;CACH,CAAA;;oDAhBqB,yCAAyC;IAD9D,IAAA,sBAAU,GAAE;GACS,yCAAyC,CAgB9D"}
@@ -6,15 +6,16 @@
6
6
  *
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
- export * from './action-dispatcher';
10
9
  export * from './client-contribution';
11
- export * from './diagram-loader';
12
10
  export * from './diagram-only-marker-manager';
13
11
  export * from './diagram-widget';
14
12
  export * from './glsp-client-theia-module';
15
13
  export * from './glsp-diagram-manager';
16
14
  export * from './glsp-message-service';
15
+ export * from './glsp-saveable';
17
16
  export * from './glsp-theia-frontend-module';
18
- export * from './hidden-bounds-updater';
19
17
  export * from './hydranium-glsp-diagram-configuration';
18
+ export * from './theia-diagram-loader';
19
+ export * from './window-session';
20
+ export type { GLSPDiagramLanguage } from '@eclipse-glsp/theia-integration/lib/common';
20
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAIlF,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,wCAAwC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAMlF,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wCAAwC,CAAC;AACvD,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AAKjC,YAAY,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC"}
@@ -22,17 +22,19 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
22
22
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- // Browser-side framework primitives for GLSP-on-Theia adopters.
26
- // The cross-head Output-channel logger lives in `@hydranium/client-theia/browser`.
27
- __exportStar(require("./action-dispatcher"), exports);
25
+ // Browser-side framework primitives for GLSP-on-Theia adopters. The
26
+ // host-neutral classes (the dispatcher, loader, updater, overlay and client)
27
+ // are `@hydranium/glsp-client`'s; the cross-head Output-channel logger lives
28
+ // in `@hydranium/client-theia/browser`.
28
29
  __exportStar(require("./client-contribution"), exports);
29
- __exportStar(require("./diagram-loader"), exports);
30
30
  __exportStar(require("./diagram-only-marker-manager"), exports);
31
31
  __exportStar(require("./diagram-widget"), exports);
32
32
  __exportStar(require("./glsp-client-theia-module"), exports);
33
33
  __exportStar(require("./glsp-diagram-manager"), exports);
34
34
  __exportStar(require("./glsp-message-service"), exports);
35
+ __exportStar(require("./glsp-saveable"), exports);
35
36
  __exportStar(require("./glsp-theia-frontend-module"), exports);
36
- __exportStar(require("./hidden-bounds-updater"), exports);
37
37
  __exportStar(require("./hydranium-glsp-diagram-configuration"), exports);
38
+ __exportStar(require("./theia-diagram-loader"), exports);
39
+ __exportStar(require("./window-session"), exports);
38
40
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;;AAElF,gEAAgE;AAChE,mFAAmF;AACnF,sDAAoC;AACpC,wDAAsC;AACtC,mDAAiC;AACjC,gEAA8C;AAC9C,mDAAiC;AACjC,6DAA2C;AAC3C,yDAAuC;AACvC,yDAAuC;AACvC,+DAA6C;AAC7C,0DAAwC;AACxC,yEAAuD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;;AAElF,oEAAoE;AACpE,6EAA6E;AAC7E,6EAA6E;AAC7E,wCAAwC;AACxC,wDAAsC;AACtC,gEAA8C;AAC9C,mDAAiC;AACjC,6DAA2C;AAC3C,yDAAuC;AACvC,yDAAuC;AACvC,kDAAgC;AAChC,+DAA6C;AAC7C,yEAAuD;AACvD,yDAAuC;AACvC,mDAAiC"}
@@ -0,0 +1,25 @@
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
+ import { HydraniumDiagramLoader } from '@hydranium/glsp-client';
10
+ /**
11
+ * The framework loader rendering its failure through Theia's catalogue, which
12
+ * knows the reading user's locale where the neutral loader does not.
13
+ *
14
+ * The key and the English are inline literals, because `theia nls-extract`
15
+ * drops a key it cannot resolve. The English must match
16
+ * `DIAGRAM_LOAD_FAILED`'s text in `@hydranium/glsp-client`; a test holds them
17
+ * equal.
18
+ *
19
+ * Bound by `createGlspClientTheiaModule` via `rebind(DiagramLoader)`, after
20
+ * `createGlspClientModule` bound the neutral loader.
21
+ */
22
+ export declare class HydraniumGlspTheiaDiagramLoader extends HydraniumDiagramLoader {
23
+ loadFailureLabel(err: unknown): string;
24
+ }
25
+ //# sourceMappingURL=theia-diagram-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theia-diagram-loader.d.ts","sourceRoot":"","sources":["../../src/browser/theia-diagram-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAIhE;;;;;;;;;;;GAWG;AACH,qBACa,+BAAgC,SAAQ,sBAAsB;IAC/D,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAE9C;CACH"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2026 CrossBreeze, EclipseSource and others.
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the MIT License which is available in the project root.
7
+ *
8
+ * SPDX-License-Identifier: MIT
9
+ ********************************************************************************/
10
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
11
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
12
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
13
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
14
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.HydraniumGlspTheiaDiagramLoader = void 0;
18
+ const glsp_client_1 = require("@hydranium/glsp-client");
19
+ const core_1 = require("@theia/core");
20
+ const inversify_1 = require("@theia/core/shared/inversify");
21
+ /**
22
+ * The framework loader rendering its failure through Theia's catalogue, which
23
+ * knows the reading user's locale where the neutral loader does not.
24
+ *
25
+ * The key and the English are inline literals, because `theia nls-extract`
26
+ * drops a key it cannot resolve. The English must match
27
+ * `DIAGRAM_LOAD_FAILED`'s text in `@hydranium/glsp-client`; a test holds them
28
+ * equal.
29
+ *
30
+ * Bound by `createGlspClientTheiaModule` via `rebind(DiagramLoader)`, after
31
+ * `createGlspClientModule` bound the neutral loader.
32
+ */
33
+ let HydraniumGlspTheiaDiagramLoader = class HydraniumGlspTheiaDiagramLoader extends glsp_client_1.HydraniumDiagramLoader {
34
+ loadFailureLabel(err) {
35
+ return core_1.nls.localize('hydranium/glsp-client-theia/diagram-load-failed', 'Diagram failed to load: {0}', this.formatError(err));
36
+ }
37
+ };
38
+ exports.HydraniumGlspTheiaDiagramLoader = HydraniumGlspTheiaDiagramLoader;
39
+ exports.HydraniumGlspTheiaDiagramLoader = HydraniumGlspTheiaDiagramLoader = __decorate([
40
+ (0, inversify_1.injectable)()
41
+ ], HydraniumGlspTheiaDiagramLoader);
42
+ //# sourceMappingURL=theia-diagram-loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theia-diagram-loader.js","sourceRoot":"","sources":["../../src/browser/theia-diagram-loader.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;AAElF,wDAAgE;AAChE,sCAAkC;AAClC,4DAA0D;AAE1D;;;;;;;;;;;GAWG;AAEI,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,oCAAsB;IAC/D,gBAAgB,CAAC,GAAY;QACnC,OAAO,UAAG,CAAC,QAAQ,CAAC,iDAAiD,EAAE,6BAA6B,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;IAChI,CAAC;CACH,CAAA;;0CAJY,+BAA+B;IAD3C,IAAA,sBAAU,GAAE;GACA,+BAA+B,CAI3C"}
@@ -0,0 +1,57 @@
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
+ import { FrontendApplicationContribution } from '@theia/core/lib/browser/frontend-application-contribution';
10
+ import { type interfaces } from '@theia/core/shared/inversify';
11
+ /** The `sessionStorage` key of the window's {@link WindowSession}. */
12
+ export declare const WINDOW_SESSION_KEY = "hydranium.glsp.windowSession";
13
+ /** Holds the id of the window session the last page in the tab left, for the next page to take up. */
14
+ export declare const RELEASED_WINDOW_SESSION_KEY = "hydranium.glsp.releasedWindowSession";
15
+ /** The window's part of every diagram client id it opens, and the token its diagrams resume with. */
16
+ export interface WindowSession {
17
+ readonly id: string;
18
+ readonly resumeToken: string;
19
+ }
20
+ export declare function isWindowSession(value: unknown): value is WindowSession;
21
+ export declare const WindowSessionService: unique symbol;
22
+ /**
23
+ * The page's window session: the one the last page in this tab left, so a
24
+ * reload resumes its diagrams, and a new one otherwise.
25
+ *
26
+ * A reload only has a session to resume on a server that outlives the page; a
27
+ * server started per frontend, as a Theia plugin host's is, is new after one.
28
+ */
29
+ export interface WindowSessionService {
30
+ current(): WindowSession;
31
+ }
32
+ /**
33
+ * Keeps the window session in `sessionStorage` and hands it on only as the page
34
+ * leaves. A duplicated tab copies `sessionStorage` while the original page is
35
+ * still live, so the copy finds no released session and draws its own; taking
36
+ * the original's would end the original's diagram sessions. Where
37
+ * `sessionStorage` is unavailable the session lasts for the page, and a reload
38
+ * resumes nothing.
39
+ *
40
+ * Claimed as the frontend starts, not with the first diagram: until then the
41
+ * released mark stays, and a tab duplicated meanwhile would take it too. A page
42
+ * restored from the back-forward cache takes the mark back, since Theia
43
+ * before 1.75 leaves it live without a reload.
44
+ */
45
+ export declare class DefaultWindowSessionService implements WindowSessionService, FrontendApplicationContribution {
46
+ protected session?: WindowSession;
47
+ initialize(): void;
48
+ current(): WindowSession;
49
+ protected claim(): WindowSession;
50
+ protected parse(text: string | null): WindowSession | undefined;
51
+ }
52
+ /**
53
+ * Bind {@link WindowSessionService} once per container, and claim it as the
54
+ * frontend starts. An adopter rebinds {@link WindowSessionService}.
55
+ */
56
+ export declare function bindWindowSessionService(bind: interfaces.Bind, isBound: interfaces.IsBound): void;
57
+ //# sourceMappingURL=window-session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"window-session.d.ts","sourceRoot":"","sources":["../../src/browser/window-session.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAIlF,OAAO,EAAE,+BAA+B,EAAE,MAAM,2DAA2D,CAAC;AAC5G,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE3E,sEAAsE;AACtE,eAAO,MAAM,kBAAkB,iCAAiC,CAAC;AACjE,sGAAsG;AACtG,eAAO,MAAM,2BAA2B,yCAAyC,CAAC;AAElF,qGAAqG;AACrG,MAAM,WAAW,aAAa;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC/B;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAOtE;AAED,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IAClC,OAAO,IAAI,aAAa,CAAC;CAC3B;AAED;;;;;;;;;;;;GAYG;AACH,qBACa,2BAA4B,YAAW,oBAAoB,EAAE,+BAA+B;IACtG,SAAS,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;IAElC,UAAU,IAAI,IAAI,CAEjB;IAED,OAAO,IAAI,aAAa,CAGvB;IAED,SAAS,CAAC,KAAK,IAAI,aAAa,CAkB/B;IAED,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,aAAa,GAAG,SAAS,CAO9D;CACH;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,GAAG,IAAI,CAMjG"}
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2026 CrossBreeze, EclipseSource and others.
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the MIT License which is available in the project root.
7
+ *
8
+ * SPDX-License-Identifier: MIT
9
+ ********************************************************************************/
10
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
11
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
12
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
13
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
14
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.DefaultWindowSessionService = exports.WindowSessionService = exports.RELEASED_WINDOW_SESSION_KEY = exports.WINDOW_SESSION_KEY = void 0;
18
+ exports.isWindowSession = isWindowSession;
19
+ exports.bindWindowSessionService = bindWindowSessionService;
20
+ const protocol_1 = require("@hydranium/protocol");
21
+ // Not the `@theia/core/lib/browser` barrel, which touches DOM globals at load.
22
+ const frontend_application_contribution_1 = require("@theia/core/lib/browser/frontend-application-contribution");
23
+ const inversify_1 = require("@theia/core/shared/inversify");
24
+ /** The `sessionStorage` key of the window's {@link WindowSession}. */
25
+ exports.WINDOW_SESSION_KEY = 'hydranium.glsp.windowSession';
26
+ /** Holds the id of the window session the last page in the tab left, for the next page to take up. */
27
+ exports.RELEASED_WINDOW_SESSION_KEY = 'hydranium.glsp.releasedWindowSession';
28
+ function isWindowSession(value) {
29
+ return (typeof value === 'object' &&
30
+ value !== null &&
31
+ typeof value.id === 'string' &&
32
+ typeof value.resumeToken === 'string');
33
+ }
34
+ exports.WindowSessionService = Symbol('WindowSessionService');
35
+ /**
36
+ * Keeps the window session in `sessionStorage` and hands it on only as the page
37
+ * leaves. A duplicated tab copies `sessionStorage` while the original page is
38
+ * still live, so the copy finds no released session and draws its own; taking
39
+ * the original's would end the original's diagram sessions. Where
40
+ * `sessionStorage` is unavailable the session lasts for the page, and a reload
41
+ * resumes nothing.
42
+ *
43
+ * Claimed as the frontend starts, not with the first diagram: until then the
44
+ * released mark stays, and a tab duplicated meanwhile would take it too. A page
45
+ * restored from the back-forward cache takes the mark back, since Theia
46
+ * before 1.75 leaves it live without a reload.
47
+ */
48
+ let DefaultWindowSessionService = class DefaultWindowSessionService {
49
+ session;
50
+ initialize() {
51
+ this.current();
52
+ }
53
+ current() {
54
+ this.session ??= this.claim();
55
+ return this.session;
56
+ }
57
+ claim() {
58
+ const created = { id: (0, protocol_1.randomUuid)(), resumeToken: (0, protocol_1.randomUuid)() };
59
+ try {
60
+ const storage = globalThis.sessionStorage;
61
+ const stored = this.parse(storage.getItem(exports.WINDOW_SESSION_KEY));
62
+ const session = stored && storage.getItem(exports.RELEASED_WINDOW_SESSION_KEY) === stored.id ? stored : created;
63
+ storage.setItem(exports.WINDOW_SESSION_KEY, JSON.stringify(session));
64
+ storage.removeItem(exports.RELEASED_WINDOW_SESSION_KEY);
65
+ globalThis.addEventListener?.('pagehide', () => storage.setItem(exports.RELEASED_WINDOW_SESSION_KEY, session.id));
66
+ globalThis.addEventListener?.('pageshow', event => {
67
+ if (event.persisted) {
68
+ storage.removeItem(exports.RELEASED_WINDOW_SESSION_KEY);
69
+ }
70
+ });
71
+ return session;
72
+ }
73
+ catch {
74
+ return created;
75
+ }
76
+ }
77
+ parse(text) {
78
+ try {
79
+ const value = text ? JSON.parse(text) : undefined;
80
+ return isWindowSession(value) ? value : undefined;
81
+ }
82
+ catch {
83
+ return undefined;
84
+ }
85
+ }
86
+ };
87
+ exports.DefaultWindowSessionService = DefaultWindowSessionService;
88
+ exports.DefaultWindowSessionService = DefaultWindowSessionService = __decorate([
89
+ (0, inversify_1.injectable)()
90
+ ], DefaultWindowSessionService);
91
+ /**
92
+ * Bind {@link WindowSessionService} once per container, and claim it as the
93
+ * frontend starts. An adopter rebinds {@link WindowSessionService}.
94
+ */
95
+ function bindWindowSessionService(bind, isBound) {
96
+ if (!isBound(exports.WindowSessionService)) {
97
+ bind(DefaultWindowSessionService).toSelf().inSingletonScope();
98
+ bind(exports.WindowSessionService).toService(DefaultWindowSessionService);
99
+ bind(frontend_application_contribution_1.FrontendApplicationContribution).toService(exports.WindowSessionService);
100
+ }
101
+ }
102
+ //# sourceMappingURL=window-session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"window-session.js","sourceRoot":"","sources":["../../src/browser/window-session.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;AAElF,kDAAiD;AACjD,+EAA+E;AAC/E,iHAA4G;AAC5G,4D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ACzE,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"connection-container-module.js","sourceRoot":"","sources":["../../src/node/connection-container-module.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;AAgBlF,kFAUC;AAxBD,sCAAgD;AAChD,4GAAuG;AACvG,4DAAgF;AAEhF;;;;;;;;;GASG;AACH,SAAgB,mCAAmC,CAAC,YAAmD;IACpG,MAAM,8BAA8B,GAAG,uDAAyB,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;QAClF,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;QAC/C,IAAI,CAAC,wBAAiB,CAAC;aACnB,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;aAC9D,gBAAgB,EAAE,CAAC;IAC1B,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;QAC/B,IAAI,CAAC,uDAAyB,CAAC,CAAC,eAAe,CAAC,8BAA8B,CAAC,CAAC;IACnF,CAAC,CAAC,CAAC;AACN,CAAC"}
1
+ {"version":3,"file":"connection-container-module.js","sourceRoot":"","sources":["../../src/node/connection-container-module.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAElF,sCAAgD;AAChD,4GAAuG;AACvG,4DAAgF;AAEhF;;;;;;;;;GASG;AACH,6CAAoD,YAAmD;IACpG,MAAM,8BAA8B,GAAG,uDAAyB,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;QAClF,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;QAC/C,IAAI,CAAC,wBAAiB,CAAC;aACnB,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;aAC9D,gBAAgB,EAAE,CAAC;IAC1B,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;QAC/B,IAAI,CAAC,uDAAyB,CAAC,CAAC,eAAe,CAAC,8BAA8B,CAAC,CAAC;IACnF,CAAC,CAAC,CAAC;AACN,CAAC"}
@@ -6,8 +6,7 @@
6
6
  *
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
- import { AbstractSocketForwardingConnectionHandler } from '@hydranium/client-theia/lib/node';
10
- import { type Channel, type Disposable } from '@theia/core';
9
+ import { AbstractSocketForwardingConnectionHandler } from '@hydranium/client-theia/node';
11
10
  import type * as net from 'net';
12
11
  /** Options for `GlspServerConnectionHandler`. The language contribution
13
12
  * id determines the per-language servicePath that Theia routes browser-frontend
@@ -16,15 +15,7 @@ import type * as net from 'net';
16
15
  export interface GlspServerConnectionHandlerOptions {
17
16
  readonly languageContributionId: string;
18
17
  readonly portCommand: string;
19
- /**
20
- * Product name for the connect-failure dialog this handler raises.
21
- *
22
- * It reaches the adopter's UI verbatim, so the framework default leaks a
23
- * framework noun into a product that is not ours. Not a translation concern —
24
- * routing it through a catalogue would ask an adopter to "translate" English
25
- * into their own product name, and would make their branding
26
- * locale-dependent.
27
- */
18
+ /** Name of the server in this handler's log lines. */
28
19
  readonly serverName?: string;
29
20
  readonly findPortTimeout?: number;
30
21
  readonly findPortAttempts?: number;
@@ -42,18 +33,18 @@ export interface GlspServerConnectionHandlerOptions {
42
33
  /**
43
34
  * Bridges a Theia browser-frontend channel to a GLSP server's TCP socket.
44
35
  *
45
- * The port-discovery + buffer-and-replay race fix + connect orchestration live
46
- * on the cross-head {@link AbstractSocketForwardingConnectionHandler} base; this
47
- * subclass supplies only the GLSP specifics — the per-language servicePath
36
+ * The port discovery, the buffer-and-replay race fix, the connect orchestration
37
+ * and the byte forwarder live on the cross-head
38
+ * {@link AbstractSocketForwardingConnectionHandler} base; this subclass supplies
39
+ * only the GLSP specifics — the per-language servicePath
48
40
  * (`GLSPContribution.servicePath + '/' + languageContributionId`), the port
49
- * command, the log labels — and plugs in `@eclipse-glsp/theia-integration`'s
50
- * `SocketConnectionForwarder` as the byte relay. Adopters with different
51
- * language ids or command names subclass with a one-line `super({...})` call.
52
- * Sibling of `@hydranium/data-client-theia`'s `DataServerConnectionHandler`,
53
- * which subclasses the same base with its own GLSP-free forwarder.
41
+ * command, the log labels. Adopters with different language ids or command
42
+ * names subclass with a one-line `super({...})` call.
54
43
  */
55
44
  export declare class GlspServerConnectionHandler extends AbstractSocketForwardingConnectionHandler {
56
45
  constructor(options: GlspServerConnectionHandlerOptions);
57
- protected forwardToSocketConnection(clientChannel: Channel, socket: net.Socket): Disposable;
46
+ /** Logged only: the frontend contribution reports the failed start, and a
47
+ * second notification would duplicate it. */
48
+ protected reportConnectFailure(): void;
58
49
  }
59
50
  //# sourceMappingURL=glsp-server-connection-handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"glsp-server-connection-handler.d.ts","sourceRoot":"","sources":["../../src/node/glsp-server-connection-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAIlF,OAAO,EAAE,yCAAyC,EAAE,MAAM,kCAAkC,CAAC;AAC7F,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,KAAK,KAAK,GAAG,MAAM,KAAK,CAAC;AAEhC;;;iDAGiD;AACjD,MAAM,WAAW,kCAAkC;IAChD,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAC;IACxC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B;;;;;;;;OAQG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,gBAAgB,CAAC,E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