@hydranium/glsp-client 0.0.0-stage → 1.0.0-next

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 (73) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +97 -2
  3. package/lib/action-dispatcher.d.ts +89 -0
  4. package/lib/action-dispatcher.d.ts.map +1 -0
  5. package/lib/action-dispatcher.js +257 -0
  6. package/lib/action-dispatcher.js.map +1 -0
  7. package/lib/diagram-load-failed.d.ts +20 -0
  8. package/lib/diagram-load-failed.d.ts.map +1 -0
  9. package/lib/diagram-load-failed.js +24 -0
  10. package/lib/diagram-load-failed.js.map +1 -0
  11. package/lib/diagram-loader.d.ts +124 -0
  12. package/lib/diagram-loader.d.ts.map +1 -0
  13. package/lib/diagram-loader.js +154 -0
  14. package/lib/diagram-loader.js.map +1 -0
  15. package/lib/edge.d.ts +40 -0
  16. package/lib/edge.d.ts.map +1 -0
  17. package/lib/edge.js +56 -0
  18. package/lib/edge.js.map +1 -0
  19. package/lib/glsp-client-module.d.ts +36 -0
  20. package/lib/glsp-client-module.d.ts.map +1 -0
  21. package/lib/glsp-client-module.js +63 -0
  22. package/lib/glsp-client-module.js.map +1 -0
  23. package/lib/glsp-client.d.ts +17 -0
  24. package/lib/glsp-client.d.ts.map +1 -0
  25. package/lib/glsp-client.js +23 -0
  26. package/lib/glsp-client.js.map +1 -0
  27. package/lib/hidden-bounds-updater.d.ts +119 -0
  28. package/lib/hidden-bounds-updater.d.ts.map +1 -0
  29. package/lib/hidden-bounds-updater.js +210 -0
  30. package/lib/hidden-bounds-updater.js.map +1 -0
  31. package/lib/index.d.ts +19 -0
  32. package/lib/index.d.ts.map +1 -0
  33. package/lib/index.js +40 -0
  34. package/lib/index.js.map +1 -0
  35. package/lib/messages/index.d.ts +10 -0
  36. package/lib/messages/index.d.ts.map +1 -0
  37. package/lib/messages/index.js +20 -0
  38. package/lib/messages/index.js.map +1 -0
  39. package/lib/sprotty-logger-adapter.d.ts +61 -0
  40. package/lib/sprotty-logger-adapter.d.ts.map +1 -0
  41. package/lib/sprotty-logger-adapter.js +130 -0
  42. package/lib/sprotty-logger-adapter.js.map +1 -0
  43. package/lib/status-overlay.d.ts +23 -0
  44. package/lib/status-overlay.d.ts.map +1 -0
  45. package/lib/status-overlay.js +52 -0
  46. package/lib/status-overlay.js.map +1 -0
  47. package/lib/testing/bind-recorder.d.ts +67 -0
  48. package/lib/testing/bind-recorder.d.ts.map +1 -0
  49. package/lib/testing/bind-recorder.js +72 -0
  50. package/lib/testing/bind-recorder.js.map +1 -0
  51. package/lib/testing/index.d.ts +10 -0
  52. package/lib/testing/index.d.ts.map +1 -0
  53. package/lib/testing/index.js +28 -0
  54. package/lib/testing/index.js.map +1 -0
  55. package/lib/types.d.ts +27 -0
  56. package/lib/types.d.ts.map +1 -0
  57. package/lib/types.js +33 -0
  58. package/lib/types.js.map +1 -0
  59. package/package.json +79 -4
  60. package/src/action-dispatcher.ts +273 -0
  61. package/src/diagram-load-failed.ts +22 -0
  62. package/src/diagram-loader.ts +173 -0
  63. package/src/edge.ts +65 -0
  64. package/src/glsp-client-module.ts +75 -0
  65. package/src/glsp-client.ts +20 -0
  66. package/src/hidden-bounds-updater.ts +210 -0
  67. package/src/index.ts +24 -0
  68. package/src/messages/index.ts +17 -0
  69. package/src/sprotty-logger-adapter.ts +121 -0
  70. package/src/status-overlay.ts +43 -0
  71. package/src/testing/bind-recorder.ts +126 -0
  72. package/src/testing/index.ts +13 -0
  73. package/src/types.ts +34 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 CrossBreeze, EclipseSource and others.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,98 @@
1
- # Temporary Holding Version
1
+ # `@hydranium/glsp-client`
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The host-neutral client classes for the
4
+ [Hydranium](https://github.com/eclipse-emfcloud/hydranium) GLSP head, the
5
+ companion of `@hydranium/glsp-server`. Install it to mount a Hydranium diagram
6
+ in any GLSP host: a Theia frontend through `@hydranium/glsp-client-theia`, a
7
+ VS Code webview, or a plain browser page. It builds on `@eclipse-glsp/client`.
8
+
9
+ ## What it gives you
10
+
11
+ - Load failures reported through your logger and shown on the diagram's
12
+ status overlay, instead of vanishing as an uncaught rejection.
13
+ - Action traffic and bounds measurements in your log, so a slow diagram names
14
+ its cost.
15
+ - Edge routes repaired before they go to the server while sprotty has not
16
+ measured the obstacles yet.
17
+ - sprotty's own errors, such as an element type with no view, in your log
18
+ rather than dropped.
19
+ - An edge whose labels keep finite bounds without bendpoints, so fit to
20
+ screen frames the diagram instead of blanking it.
21
+ - One binder that mounts all of it in a diagram container.
22
+
23
+ ## Install
24
+
25
+ ```bash
26
+ npm install @hydranium/glsp-client
27
+ ```
28
+
29
+ | Peer | Range |
30
+ | ---------------------- | ------------- |
31
+ | `@eclipse-glsp/client` | `^2.6.0` |
32
+ | `@hydranium/protocol` | `^1.0.0-next` |
33
+ | `inversify` | `^6.0.0` |
34
+ | `snabbdom` | `^3.5.1` |
35
+
36
+ ## Wiring
37
+
38
+ Call `createGlspClientModule` from a container module your host adds after
39
+ GLSP's default modules, since it replaces tokens those modules bind:
40
+
41
+ <!-- snippet-preamble
42
+ import type { Logger } from '@hydranium/protocol';
43
+ declare const logger: Logger;
44
+ -->
45
+
46
+ ```ts
47
+ import { createGlspClientModule } from '@hydranium/glsp-client';
48
+ import { ContainerModule } from 'inversify';
49
+
50
+ const hostModule = new ContainerModule((bind, unbind, isBound, rebind) => {
51
+ createGlspClientModule({ bind, unbind, isBound, rebind }, { logger });
52
+ });
53
+ ```
54
+
55
+ Pass your `Logger` from `@hydranium/protocol`, which replaces any binding on
56
+ `HydraniumClientTypes.Logger`, or bind that token yourself and pass none; with
57
+ neither, a `ConsoleLogger` is bound.
58
+ Bind `HydraniumClientTypes.Clock` to drive time in a test. To render the load
59
+ failure in the user's language, subclass `HydraniumDiagramLoader`, override
60
+ `loadFailureLabel` and rebind `DiagramLoader` after the call. In Theia, call
61
+ `createGlspClientTheiaModule` from `@hydranium/glsp-client-theia` instead,
62
+ which does all of this with the Output channel.
63
+
64
+ In your diagram module, call `configureHydraniumModelElements` in place of
65
+ GLSP's `configureDefaultModelElements`, and register your own edge types with
66
+ `HydraniumGEdge` in place of `GEdge`: GLSP's edge gives a label on an edge
67
+ without bendpoints `NaN` bounds, and a fit to screen over such a label blanks
68
+ the canvas. The class is fixed per registered type, so a type registered with
69
+ `GEdge` keeps the defect.
70
+
71
+ For a browser page, see *Host in a browser* in
72
+ [Adopting Hydranium](https://github.com/eclipse-emfcloud/hydranium/blob/main/docs/ADOPTING.md).
73
+
74
+ ## Entry points
75
+
76
+ | Subpath | Use it for | Runs in |
77
+ | ------------ | ------------------------------------------------- | --------------- |
78
+ | `.` | The classes, the binder and the DI tokens | browser |
79
+ | `./messages` | The codes of the messages this package raises | browser-neutral |
80
+ | `./testing` | A binding recorder for testing your modules | browser-neutral |
81
+
82
+ The root loads `@eclipse-glsp/client`, whose graph imports stylesheets, so
83
+ your bundler needs a CSS loader. The subpaths need a TypeScript
84
+ `moduleResolution` that reads `exports` (`NodeNext` or `Bundler`); see
85
+ *Requirements* in
86
+ [Adopting Hydranium](https://github.com/eclipse-emfcloud/hydranium/blob/main/docs/ADOPTING.md).
87
+
88
+ ## Status
89
+
90
+ Alpha: every release is a prerelease that may break the API, so pin an exact
91
+ version. Guides and known limitations:
92
+ [Adopting Hydranium](https://github.com/eclipse-emfcloud/hydranium/blob/main/docs/ADOPTING.md).
93
+
94
+ ## License
95
+
96
+ `MIT` — see this package's [`LICENSE`](./LICENSE), and the repository
97
+ [`NOTICE.md`](https://github.com/eclipse-emfcloud/hydranium/blob/main/NOTICE.md)
98
+ for third-party notices.
@@ -0,0 +1,89 @@
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 { type Action, CheckEdgeResultAction, GLSPActionDispatcher, RequestCheckEdgeAction } from '@eclipse-glsp/client';
10
+ import { type Clock, type Logger, type Stopwatch, type Tracer } from '@hydranium/protocol';
11
+ /** Default subset of action kinds the framework dispatcher will log: the GLSP
12
+ * traffic an observer reading the log typically wants to see. All
13
+ * are standard `@eclipse-glsp/client` kinds; adopters with custom action kinds
14
+ * extend via `extraLoggedKinds`. */
15
+ export declare const HYDRANIUM_DEFAULT_LOGGED_KINDS: ReadonlySet<string>;
16
+ /** Default request → response kind pairs for GLSP 'flow' actions that do NOT
17
+ * carry a requestId/responseId — so the dispatcher matches by kind (FIFO).
18
+ * Id-based matching still wins when a requestId is present. */
19
+ export declare const HYDRANIUM_DEFAULT_KIND_PAIRS: ReadonlyMap<string, string>;
20
+ /** Additive options. Adopters with custom action kinds pass extras here; the
21
+ * framework defaults always apply (you cannot un-log a kind the framework
22
+ * considers worth logging — subclass + override `dispatch` if you must). */
23
+ export interface HydraniumGlspActionDispatcherOptions {
24
+ readonly extraLoggedKinds?: Iterable<string>;
25
+ readonly extraKindPairs?: Iterable<readonly [string, string]>;
26
+ /** Replaces the default `summarize` body entirely. Use for adopter-domain
27
+ * action kinds where the framework default returns ''. */
28
+ readonly summarize?: (action: Action) => string;
29
+ }
30
+ /**
31
+ * Wraps every dispatch so action traffic appears in the host's log, the Theia
32
+ * Output channel or a page's console, interleaved with server log lines where
33
+ * the host shows both. Instrumenting the dispatcher
34
+ * (rather than per-kind handlers) catches ResponseActions that bypass the
35
+ * handler pipeline.
36
+ *
37
+ * The framework defaults cover the standard GLSP kinds worth logging, not every
38
+ * kind the protocol defines. Adopters with custom kinds either pass
39
+ * `extraLoggedKinds` / `extraKindPairs` to the constructor (via a
40
+ * `toDynamicValue` binding) or subclass and override.
41
+ */
42
+ export declare class HydraniumGlspActionDispatcher extends GLSPActionDispatcher {
43
+ protected readonly hydraniumLogger: Logger;
44
+ protected readonly tracer: Tracer;
45
+ /** Times each request to its response: the diagram container's {@link Clock}, or a `SystemClock`. */
46
+ protected readonly clock: Clock;
47
+ protected readonly loggedKinds: ReadonlySet<string>;
48
+ protected readonly kindPairs: ReadonlyMap<string, string>;
49
+ protected readonly kindPairsReverse: ReadonlyMap<string, string>;
50
+ protected pairCounter: number;
51
+ /** Pending requests keyed by requestId (for actions that carry one). */
52
+ protected pendingById: Map<string, {
53
+ id: number;
54
+ sinceRequest: Stopwatch;
55
+ }>;
56
+ /** FIFO queue per response kind, used for `flow` pairs without requestId/responseId. */
57
+ protected pendingByKind: Map<string, {
58
+ id: number;
59
+ sinceRequest: Stopwatch;
60
+ }[]>;
61
+ constructor(options?: HydraniumGlspActionDispatcherOptions);
62
+ initialize(): Promise<void>;
63
+ /**
64
+ * Register the one-shot 'model initialized' timing line. Instrumentation
65
+ * only — guarded so a tracer failure degrades logging rather than aborting
66
+ * diagram init. `initialize()` runs inside `DiagramLoader.load()`, whose
67
+ * caller (`GLSPDiagramWidget.onAfterAttach`) neither awaits nor catches the
68
+ * returned promise; an error thrown here would therefore escape as an
69
+ * uncaught rejection that blanks the diagram with no server-side signal.
70
+ */
71
+ protected registerInitTiming(): void;
72
+ dispatch(action: Action): Promise<void>;
73
+ protected logAction(action: Action): void;
74
+ protected classify(action: Action): {
75
+ verb: string;
76
+ direction: string;
77
+ };
78
+ /** Emit `[request #N]` on the request side, `[response #N, Xms]` on the matching response side.
79
+ * Match first by requestId/responseId, then by known kind pairs (FIFO). */
80
+ protected trackPair(action: Action): string;
81
+ protected formatResponse(entry: {
82
+ id: number;
83
+ sinceRequest: Stopwatch;
84
+ }): string;
85
+ protected summarize(action: Action): string;
86
+ /** An edge check and, on the result, its verdict, so the log shows why an edge tool refused a target. */
87
+ protected formatEdgeCheck(action: RequestCheckEdgeAction | CheckEdgeResultAction): string;
88
+ }
89
+ //# sourceMappingURL=action-dispatcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-dispatcher.d.ts","sourceRoot":"","sources":["../src/action-dispatcher.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,KAAK,MAAM,EACX,qBAAqB,EAErB,oBAAoB,EAOpB,sBAAsB,EAaxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,KAAK,SAAS,EAAe,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAIxG;;;qCAGqC;AACrC,eAAO,MAAM,8BAA8B,EAAE,WAAW,CAAC,MAAM,CAiB7D,CAAC;AAEH;;gEAEgE;AAChE,eAAO,MAAM,4BAA4B,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAInE,CAAC;AAEH;;6EAE6E;AAC7E,MAAM,WAAW,oCAAoC;IAClD,QAAQ,CAAC,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AS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAgBtE;IAED;gFAC4E;IAC5E,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CA+B1C;IAED,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,SAAS,CAAA;KAAE,GAAG,MAAM,CAG/E;IAED,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAsC1C;IAED,yGAAyG;IACzG,SAAS,CAAC,eAAe,CAAC,MAAM,EAAE,sBAAsB,GAAG,qBAAqB,GAAG,MAAM,CAGxF;CACH"}
@@ -0,0 +1,257 @@
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
+ var __metadata = (this && this.__metadata) || function (k, v) {
17
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
18
+ };
19
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
20
+ return function (target, key) { decorator(target, key, paramIndex); }
21
+ };
22
+ Object.defineProperty(exports, "__esModule", { value: true });
23
+ exports.HydraniumGlspActionDispatcher = exports.HYDRANIUM_DEFAULT_KIND_PAIRS = exports.HYDRANIUM_DEFAULT_LOGGED_KINDS = void 0;
24
+ const client_1 = require("@eclipse-glsp/client");
25
+ const protocol_1 = require("@hydranium/protocol");
26
+ const inversify_1 = require("inversify");
27
+ const types_1 = require("./types");
28
+ /** Default subset of action kinds the framework dispatcher will log: the GLSP
29
+ * traffic an observer reading the log typically wants to see. All
30
+ * are standard `@eclipse-glsp/client` kinds; adopters with custom action kinds
31
+ * extend via `extraLoggedKinds`. */
32
+ exports.HYDRANIUM_DEFAULT_LOGGED_KINDS = new Set([
33
+ client_1.SetModelAction.KIND,
34
+ client_1.UpdateModelAction.KIND,
35
+ client_1.RequestBoundsAction.KIND,
36
+ client_1.ComputedBoundsAction.KIND,
37
+ client_1.SetDirtyStateAction.KIND,
38
+ client_1.SetEditModeAction.KIND,
39
+ client_1.SetMarkersAction.KIND,
40
+ client_1.SetTypeHintsAction.KIND,
41
+ client_1.StatusAction.KIND,
42
+ client_1.MessageAction.KIND,
43
+ client_1.RejectAction.KIND,
44
+ client_1.RequestContextActions.KIND,
45
+ client_1.RequestModelAction.KIND,
46
+ client_1.RequestTypeHintsAction.KIND,
47
+ client_1.RequestCheckEdgeAction.KIND,
48
+ client_1.CheckEdgeResultAction.KIND
49
+ ]);
50
+ /** Default request → response kind pairs for GLSP 'flow' actions that do NOT
51
+ * carry a requestId/responseId — so the dispatcher matches by kind (FIFO).
52
+ * Id-based matching still wins when a requestId is present. */
53
+ exports.HYDRANIUM_DEFAULT_KIND_PAIRS = new Map([
54
+ [client_1.RequestModelAction.KIND, client_1.SetModelAction.KIND],
55
+ [client_1.RequestTypeHintsAction.KIND, client_1.SetTypeHintsAction.KIND],
56
+ [client_1.RequestBoundsAction.KIND, client_1.ComputedBoundsAction.KIND]
57
+ ]);
58
+ /**
59
+ * Wraps every dispatch so action traffic appears in the host's log, the Theia
60
+ * Output channel or a page's console, interleaved with server log lines where
61
+ * the host shows both. Instrumenting the dispatcher
62
+ * (rather than per-kind handlers) catches ResponseActions that bypass the
63
+ * handler pipeline.
64
+ *
65
+ * The framework defaults cover the standard GLSP kinds worth logging, not every
66
+ * kind the protocol defines. Adopters with custom kinds either pass
67
+ * `extraLoggedKinds` / `extraKindPairs` to the constructor (via a
68
+ * `toDynamicValue` binding) or subclass and override.
69
+ */
70
+ let HydraniumGlspActionDispatcher = class HydraniumGlspActionDispatcher extends client_1.GLSPActionDispatcher {
71
+ hydraniumLogger;
72
+ tracer;
73
+ /** Times each request to its response: the diagram container's {@link Clock}, or a `SystemClock`. */
74
+ clock = new protocol_1.SystemClock();
75
+ loggedKinds;
76
+ kindPairs;
77
+ kindPairsReverse;
78
+ pairCounter = 0;
79
+ /** Pending requests keyed by requestId (for actions that carry one). */
80
+ pendingById = new Map();
81
+ /** FIFO queue per response kind, used for `flow` pairs without requestId/responseId. */
82
+ pendingByKind = new Map();
83
+ constructor(options) {
84
+ super();
85
+ const extraLogged = options?.extraLoggedKinds ? Array.from(options.extraLoggedKinds) : [];
86
+ this.loggedKinds = new Set([...exports.HYDRANIUM_DEFAULT_LOGGED_KINDS, ...extraLogged]);
87
+ const extraPairs = options?.extraKindPairs ? Array.from(options.extraKindPairs) : [];
88
+ const pairs = new Map([...exports.HYDRANIUM_DEFAULT_KIND_PAIRS, ...extraPairs]);
89
+ this.kindPairs = pairs;
90
+ this.kindPairsReverse = new Map(Array.from(pairs, ([req, res]) => [res, req]));
91
+ if (options?.summarize) {
92
+ this.summarize = options.summarize;
93
+ }
94
+ }
95
+ initialize() {
96
+ // `initialize()` is called many times; super is idempotent, but our callback registration
97
+ // isn't. Register the timing log only on the first call (when super.initialized is unset).
98
+ if (!this.initialized) {
99
+ this.registerInitTiming();
100
+ }
101
+ return super.initialize();
102
+ }
103
+ /**
104
+ * Register the one-shot 'model initialized' timing line. Instrumentation
105
+ * only — guarded so a tracer failure degrades logging rather than aborting
106
+ * diagram init. `initialize()` runs inside `DiagramLoader.load()`, whose
107
+ * caller (`GLSPDiagramWidget.onAfterAttach`) neither awaits nor catches the
108
+ * returned promise; an error thrown here would therefore escape as an
109
+ * uncaught rejection that blanks the diagram with no server-side signal.
110
+ */
111
+ registerInitTiming() {
112
+ try {
113
+ this.tracer.time('Model initialized', () => this.onceModelInitialized(), 'info', { logAfterMs: 0 });
114
+ }
115
+ catch (err) {
116
+ this.hydraniumLogger.error('Failed to register model-initialized timing instrumentation', err);
117
+ }
118
+ }
119
+ dispatch(action) {
120
+ if (this.loggedKinds.has(action.kind)) {
121
+ this.logAction(action);
122
+ }
123
+ return super.dispatch(action);
124
+ }
125
+ logAction(action) {
126
+ const { verb, direction } = this.classify(action);
127
+ const summary = this.summarize(action);
128
+ const timing = this.trackPair(action);
129
+ const parts = [`${verb} action '${action.kind}'`, `[${direction}]`];
130
+ if (summary) {
131
+ parts.push(`[${summary}]`);
132
+ }
133
+ if (timing) {
134
+ parts.push(timing);
135
+ }
136
+ this.hydraniumLogger.trace(parts.join(' '));
137
+ }
138
+ classify(action) {
139
+ // GLSP marks client-produced computedBounds as ServerAction to suppress forwarding; stays local.
140
+ if (client_1.LocalComputedBoundsAction.is(action)) {
141
+ return { verb: 'Process', direction: 'client → client' };
142
+ }
143
+ // Marked by GLSPModelSource.messageReceived — arrived from the server.
144
+ if (client_1.ServerAction.is(action)) {
145
+ return { verb: 'Receive', direction: 'server → client' };
146
+ }
147
+ // GLSPModelSource is registered as handler for every server-handled kind (configureServeActions),
148
+ // so its presence means the action will be forwarded to the server.
149
+ const handlers = this.actionHandlerRegistry.get(action.kind);
150
+ if (handlers.some(handler => handler instanceof client_1.GLSPModelSource)) {
151
+ return { verb: 'Send', direction: 'client → server' };
152
+ }
153
+ return { verb: 'Process', direction: 'client → client' };
154
+ }
155
+ /** Emit `[request #N]` on the request side, `[response #N, Xms]` on the matching response side.
156
+ * Match first by requestId/responseId, then by known kind pairs (FIFO). */
157
+ trackPair(action) {
158
+ // Response side.
159
+ if (client_1.ResponseAction.hasValidResponseId(action)) {
160
+ const entry = this.pendingById.get(action.responseId);
161
+ if (entry) {
162
+ this.pendingById.delete(action.responseId);
163
+ return this.formatResponse(entry);
164
+ }
165
+ }
166
+ if (this.kindPairsReverse.has(action.kind)) {
167
+ const queue = this.pendingByKind.get(action.kind);
168
+ const entry = queue?.shift();
169
+ if (entry) {
170
+ return this.formatResponse(entry);
171
+ }
172
+ }
173
+ // Request side.
174
+ if (client_1.RequestAction.is(action) && action.requestId) {
175
+ const entry = { id: ++this.pairCounter, sinceRequest: this.clock.stopwatch() };
176
+ this.pendingById.set(action.requestId, entry);
177
+ return `[request #${entry.id}]`;
178
+ }
179
+ if (this.kindPairs.has(action.kind)) {
180
+ const responseKind = this.kindPairs.get(action.kind);
181
+ const entry = { id: ++this.pairCounter, sinceRequest: this.clock.stopwatch() };
182
+ const queue = this.pendingByKind.get(responseKind) ?? [];
183
+ queue.push(entry);
184
+ this.pendingByKind.set(responseKind, queue);
185
+ return `[request #${entry.id}]`;
186
+ }
187
+ return '';
188
+ }
189
+ formatResponse(entry) {
190
+ const elapsed = Math.round(entry.sinceRequest.elapsedMs);
191
+ return `[response #${entry.id}, ${elapsed}ms]`;
192
+ }
193
+ summarize(action) {
194
+ if (client_1.SetModelAction.is(action) || client_1.UpdateModelAction.is(action)) {
195
+ const root = action.newRoot;
196
+ return `rootType=${root?.type ?? 'none'} children=${root?.children?.length ?? 0}`;
197
+ }
198
+ if (client_1.RequestBoundsAction.is(action)) {
199
+ return `rootType=${action.newRoot.type} children=${action.newRoot.children?.length ?? 0}`;
200
+ }
201
+ if (client_1.ComputedBoundsAction.is(action)) {
202
+ return `bounds=${action.bounds.length}`;
203
+ }
204
+ if (client_1.SetDirtyStateAction.is(action)) {
205
+ return `isDirty=${action.isDirty} reason=${action.reason ?? 'n/a'}`;
206
+ }
207
+ if (client_1.SetEditModeAction.is(action)) {
208
+ return `editMode=${action.editMode}`;
209
+ }
210
+ if (client_1.SetMarkersAction.is(action)) {
211
+ return `markers=${action.markers.length}`;
212
+ }
213
+ if (client_1.StatusAction.is(action) || client_1.MessageAction.is(action)) {
214
+ // severity=NONE with empty message is the conventional 'clear' signal.
215
+ const clear = action.severity === 'NONE' && !action.message ? ' (clear)' : '';
216
+ return `severity=${action.severity} message="${action.message.slice(0, 160)}"${clear}`;
217
+ }
218
+ if (client_1.RejectAction.is(action)) {
219
+ return `reason="${action.message.slice(0, 160)}"`;
220
+ }
221
+ if (client_1.SetTypeHintsAction.is(action)) {
222
+ return `shapes=${action.shapeHints.length} edges=${action.edgeHints.length}`;
223
+ }
224
+ if (client_1.RequestContextActions.is(action)) {
225
+ return `contextId=${action.contextId}`;
226
+ }
227
+ if (client_1.RequestCheckEdgeAction.is(action) || client_1.CheckEdgeResultAction.is(action)) {
228
+ return this.formatEdgeCheck(action);
229
+ }
230
+ return '';
231
+ }
232
+ /** An edge check and, on the result, its verdict, so the log shows why an edge tool refused a target. */
233
+ formatEdgeCheck(action) {
234
+ const verdict = client_1.CheckEdgeResultAction.is(action) ? ` isValid=${action.isValid}` : '';
235
+ return `edgeType=${action.edgeType} source=${action.sourceElementId} target=${action.targetElementId ?? 'none'}${verdict}`;
236
+ }
237
+ };
238
+ exports.HydraniumGlspActionDispatcher = HydraniumGlspActionDispatcher;
239
+ __decorate([
240
+ (0, inversify_1.inject)(types_1.HydraniumClientTypes.Logger),
241
+ __metadata("design:type", Object)
242
+ ], HydraniumGlspActionDispatcher.prototype, "hydraniumLogger", void 0);
243
+ __decorate([
244
+ (0, inversify_1.inject)(types_1.HydraniumClientTypes.Tracer),
245
+ __metadata("design:type", Object)
246
+ ], HydraniumGlspActionDispatcher.prototype, "tracer", void 0);
247
+ __decorate([
248
+ (0, inversify_1.inject)(types_1.HydraniumClientTypes.Clock),
249
+ (0, inversify_1.optional)(),
250
+ __metadata("design:type", Object)
251
+ ], HydraniumGlspActionDispatcher.prototype, "clock", void 0);
252
+ exports.HydraniumGlspActionDispatcher = HydraniumGlspActionDispatcher = __decorate([
253
+ (0, inversify_1.injectable)(),
254
+ __param(0, (0, inversify_1.unmanaged)()),
255
+ __metadata("design:paramtypes", [Object])
256
+ ], HydraniumGlspActionDispatcher);
257
+ //# sourceMappingURL=action-dispatcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-dispatcher.js","sourceRoot":"","sources":["../src/action-dispatcher.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;AAElF,iDAwB8B;AAC9B,kDAAwG;AACxG,yCAAoE;AACpE,mCAA+C;AAE/C;;;qCAGqC;AACxB,QAAA,8BAA8B,GAAwB,IAAI,GAAG,CAAS;IAChF,uBAAc,CAAC,IAAI;IACnB,0BAAiB,CAAC,IAAI;IACtB,4BAAmB,CAAC,IAAI;IACxB,6BAAoB,CAAC,IAAI;IACzB,4BAAmB,CAAC,IAAI;IACxB,0BAAiB,CAAC,IAAI;IACtB,yBAAgB,CAAC,IAAI;IACrB,2BAAkB,CAAC,IAAI;IACvB,qBAAY,CAAC,IAAI;IACjB,sBAAa,CAAC,IAAI;IAClB,qBAAY,CAAC,IAAI;IACjB,8BAAqB,CAAC,IAAI;IAC1B,2BAAkB,CAAC,IAAI;IACvB,+BAAsB,CAAC,IAAI;IAC3B,+BAAsB,CAAC,IAAI;IAC3B,8BAAqB,CAAC,IAAI;CAC5B,CAAC,CAAC;AAEH;;gEAEgE;AACnD,QAAA,4BAA4B,GAAgC,IAAI,GAAG,CAAiB;IAC9F,CAAC,2BAAkB,CAAC,IAAI,EAAE,uBAAc,CAAC,IAAI,CAAC;IAC9C,CAAC,+BAAsB,CAAC,IAAI,EAAE,2BAAkB,CAAC,IAAI,CAAC;IACtD,CAAC,4BAAmB,CAAC,IAAI,EAAE,6BAAoB,CAAC,IAAI,CAAC;CACvD,CAAC,CAAC;AAaH;;;;;;;;;;;GAWG;AAEI,IAAM,6BAA6B,GAAnC,MAAM,6BAA8B,SAAQ,6BAAoB;IACZ,eAAe,CAAU;IACzB,MAAM,CAA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,eAAe,CAAC,MAAsD;QAC7E,MAAM,OAAO,GAAG,8BAAqB,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrF,OAAO,YAAY,MAAM,CAAC,QAAQ,WAAW,MAAM,CAAC,eAAe,WAAW,MAAM,CAAC,eAAe,IAAI,MAAM,GAAG,OAAO,EAAE,CAAC;IAC9H,CAAC;CACH,CAAA;;AAjL0D;IAAvD,IAAA,kBAAM,EAAC,4BAAoB,CAAC,MAAM,CAAC;;sEAA6C;AACzB;IAAvD,IAAA,kBAAM,EAAC,4BAAoB,CAAC,MAAM,CAAC;;6DAAoC;AAEL;IAAlE,IAAA,kBAAM,EAAC,4BAAoB,CAAC,KAAK,CAAC;IAAE,IAAA,oBAAQ,GAAE;;4DAAqD;wCAJ1F,6BAA6B;IADzC,IAAA,sBAAU,GAAE;IAiBG,WAAA,IAAA,qBAAS,GAAE,CAAA;;GAhBd,6BAA6B,CAkLzC"}
@@ -0,0 +1,20 @@
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
+ * What a user reads when a diagram load fails: `reason` is the described
11
+ * error. Formatted in English by `HydraniumDiagramLoader`; a host that knows
12
+ * the reading user's locale renders the same sentence under a key of its own
13
+ * by overriding its `loadFailureLabel`, as the Theia loader does.
14
+ *
15
+ * In a module of its own, apart from the loader that raises it, so the
16
+ * `./messages` barrel loads no `@eclipse-glsp/client`: a bundle that only
17
+ * translates the code must not need GLSP's stylesheets.
18
+ */
19
+ export declare const DIAGRAM_LOAD_FAILED: import("@hydranium/protocol").MessageDefinition<"Diagram failed to load: {reason}">;
20
+ //# sourceMappingURL=diagram-load-failed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagram-load-failed.d.ts","sourceRoot":"","sources":["../src/diagram-load-failed.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAIlF;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB,qFAAiG,CAAC"}
@@ -0,0 +1,24 @@
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.DIAGRAM_LOAD_FAILED = void 0;
12
+ const protocol_1 = require("@hydranium/protocol");
13
+ /**
14
+ * What a user reads when a diagram load fails: `reason` is the described
15
+ * error. Formatted in English by `HydraniumDiagramLoader`; a host that knows
16
+ * the reading user's locale renders the same sentence under a key of its own
17
+ * by overriding its `loadFailureLabel`, as the Theia loader does.
18
+ *
19
+ * In a module of its own, apart from the loader that raises it, so the
20
+ * `./messages` barrel loads no `@eclipse-glsp/client`: a bundle that only
21
+ * translates the code must not need GLSP's stylesheets.
22
+ */
23
+ exports.DIAGRAM_LOAD_FAILED = (0, protocol_1.defineMessage)('hydranium/glsp-client/diagram-load-failed', 'Diagram failed to load: {reason}');
24
+ //# sourceMappingURL=diagram-load-failed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagram-load-failed.js","sourceRoot":"","sources":["../src/diagram-load-failed.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAElF,kDAAoD;AAEpD;;;;;;;;;GASG;AACU,QAAA,mBAAmB,GAAG,IAAA,wBAAa,EAAC,2CAA2C,EAAE,kCAAkC,CAAC,CAAC"}