@hydranium/glsp-server 1.0.0-next.10
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.
- package/LICENSE +21 -0
- package/README.md +97 -0
- package/lib/browser/index.d.ts +10 -0
- package/lib/browser/index.d.ts.map +1 -0
- package/lib/browser/index.js +15 -0
- package/lib/browser/index.js.map +1 -0
- package/lib/browser/start-glsp-server-in-worker.d.ts +121 -0
- package/lib/browser/start-glsp-server-in-worker.d.ts.map +1 -0
- package/lib/browser/start-glsp-server-in-worker.js +102 -0
- package/lib/browser/start-glsp-server-in-worker.js.map +1 -0
- package/lib/command/hydranium-glsp-recording-command.d.ts +132 -0
- package/lib/command/hydranium-glsp-recording-command.d.ts.map +1 -0
- package/lib/command/hydranium-glsp-recording-command.js +159 -0
- package/lib/command/hydranium-glsp-recording-command.js.map +1 -0
- package/lib/command/index.d.ts +10 -0
- package/lib/command/index.d.ts.map +1 -0
- package/lib/command/index.js +10 -0
- package/lib/command/index.js.map +1 -0
- package/lib/computed-bounds/hydranium-glsp-computed-bounds-action-handler.d.ts +61 -0
- package/lib/computed-bounds/hydranium-glsp-computed-bounds-action-handler.d.ts.map +1 -0
- package/lib/computed-bounds/hydranium-glsp-computed-bounds-action-handler.js +93 -0
- package/lib/computed-bounds/hydranium-glsp-computed-bounds-action-handler.js.map +1 -0
- package/lib/computed-bounds/index.d.ts +10 -0
- package/lib/computed-bounds/index.d.ts.map +1 -0
- package/lib/computed-bounds/index.js +10 -0
- package/lib/computed-bounds/index.js.map +1 -0
- package/lib/dispatcher/index.d.ts +10 -0
- package/lib/dispatcher/index.d.ts.map +1 -0
- package/lib/dispatcher/index.js +10 -0
- package/lib/dispatcher/index.js.map +1 -0
- package/lib/dispatcher/server-action-dispatcher.d.ts +52 -0
- package/lib/dispatcher/server-action-dispatcher.d.ts.map +1 -0
- package/lib/dispatcher/server-action-dispatcher.js +79 -0
- package/lib/dispatcher/server-action-dispatcher.js.map +1 -0
- package/lib/index.d.ts +19 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +20 -0
- package/lib/index.js.map +1 -0
- package/lib/launcher/abstract-hydranium-glsp-diagram-module.d.ts +75 -0
- package/lib/launcher/abstract-hydranium-glsp-diagram-module.d.ts.map +1 -0
- package/lib/launcher/abstract-hydranium-glsp-diagram-module.js +100 -0
- package/lib/launcher/abstract-hydranium-glsp-diagram-module.js.map +1 -0
- package/lib/launcher/glsp-app-module.d.ts +87 -0
- package/lib/launcher/glsp-app-module.d.ts.map +1 -0
- package/lib/launcher/glsp-app-module.js +71 -0
- package/lib/launcher/glsp-app-module.js.map +1 -0
- package/lib/launcher/glsp-framework-overrides.d.ts +32 -0
- package/lib/launcher/glsp-framework-overrides.d.ts.map +1 -0
- package/lib/launcher/glsp-framework-overrides.js +49 -0
- package/lib/launcher/glsp-framework-overrides.js.map +1 -0
- package/lib/launcher/glsp-server-overrides.d.ts +39 -0
- package/lib/launcher/glsp-server-overrides.d.ts.map +1 -0
- package/lib/launcher/glsp-server-overrides.js +45 -0
- package/lib/launcher/glsp-server-overrides.js.map +1 -0
- package/lib/launcher/hydranium-glsp-server.d.ts +62 -0
- package/lib/launcher/hydranium-glsp-server.d.ts.map +1 -0
- package/lib/launcher/hydranium-glsp-server.js +101 -0
- package/lib/launcher/hydranium-glsp-server.js.map +1 -0
- package/lib/launcher/index.d.ts +12 -0
- package/lib/launcher/index.d.ts.map +1 -0
- package/lib/launcher/index.js +22 -0
- package/lib/launcher/index.js.map +1 -0
- package/lib/logging/glsp-client-logger.d.ts +110 -0
- package/lib/logging/glsp-client-logger.d.ts.map +1 -0
- package/lib/logging/glsp-client-logger.js +151 -0
- package/lib/logging/glsp-client-logger.js.map +1 -0
- package/lib/logging/index.d.ts +10 -0
- package/lib/logging/index.d.ts.map +1 -0
- package/lib/logging/index.js +10 -0
- package/lib/logging/index.js.map +1 -0
- package/lib/node/index.d.ts +10 -0
- package/lib/node/index.d.ts.map +1 -0
- package/lib/node/index.js +13 -0
- package/lib/node/index.js.map +1 -0
- package/lib/node/start-glsp-server.d.ts +122 -0
- package/lib/node/start-glsp-server.d.ts.map +1 -0
- package/lib/node/start-glsp-server.js +103 -0
- package/lib/node/start-glsp-server.js.map +1 -0
- package/lib/state/abstract-hydranium-glsp-state.d.ts +333 -0
- package/lib/state/abstract-hydranium-glsp-state.d.ts.map +1 -0
- package/lib/state/abstract-hydranium-glsp-state.js +451 -0
- package/lib/state/abstract-hydranium-glsp-state.js.map +1 -0
- package/lib/state/full-text-hydranium-glsp-state.d.ts +43 -0
- package/lib/state/full-text-hydranium-glsp-state.d.ts.map +1 -0
- package/lib/state/full-text-hydranium-glsp-state.js +60 -0
- package/lib/state/full-text-hydranium-glsp-state.js.map +1 -0
- package/lib/state/hydranium-glsp-index.d.ts +220 -0
- package/lib/state/hydranium-glsp-index.d.ts.map +1 -0
- package/lib/state/hydranium-glsp-index.js +320 -0
- package/lib/state/hydranium-glsp-index.js.map +1 -0
- package/lib/state/hydranium-shared-core-services.d.ts +90 -0
- package/lib/state/hydranium-shared-core-services.d.ts.map +1 -0
- package/lib/state/hydranium-shared-core-services.js +89 -0
- package/lib/state/hydranium-shared-core-services.js.map +1 -0
- package/lib/state/index.d.ts +17 -0
- package/lib/state/index.d.ts.map +1 -0
- package/lib/state/index.js +17 -0
- package/lib/state/index.js.map +1 -0
- package/lib/state/model-ready-timeout-error.d.ts +28 -0
- package/lib/state/model-ready-timeout-error.d.ts.map +1 -0
- package/lib/state/model-ready-timeout-error.js +36 -0
- package/lib/state/model-ready-timeout-error.js.map +1 -0
- package/lib/state/reconcile-source-model-write.d.ts +43 -0
- package/lib/state/reconcile-source-model-write.d.ts.map +1 -0
- package/lib/state/reconcile-source-model-write.js +47 -0
- package/lib/state/reconcile-source-model-write.js.map +1 -0
- package/lib/state/reconciling-multi-document-glsp-state.d.ts +164 -0
- package/lib/state/reconciling-multi-document-glsp-state.d.ts.map +1 -0
- package/lib/state/reconciling-multi-document-glsp-state.js +222 -0
- package/lib/state/reconciling-multi-document-glsp-state.js.map +1 -0
- package/lib/state/reconciling-transfer-hydranium-glsp-state.d.ts +91 -0
- package/lib/state/reconciling-transfer-hydranium-glsp-state.d.ts.map +1 -0
- package/lib/state/reconciling-transfer-hydranium-glsp-state.js +129 -0
- package/lib/state/reconciling-transfer-hydranium-glsp-state.js.map +1 -0
- package/lib/storage/hydranium-glsp-storage.d.ts +348 -0
- package/lib/storage/hydranium-glsp-storage.d.ts.map +1 -0
- package/lib/storage/hydranium-glsp-storage.js +634 -0
- package/lib/storage/hydranium-glsp-storage.js.map +1 -0
- package/lib/storage/index.d.ts +11 -0
- package/lib/storage/index.d.ts.map +1 -0
- package/lib/storage/index.js +11 -0
- package/lib/storage/index.js.map +1 -0
- package/lib/storage/save-conflict-policy.d.ts +56 -0
- package/lib/storage/save-conflict-policy.d.ts.map +1 -0
- package/lib/storage/save-conflict-policy.js +19 -0
- package/lib/storage/save-conflict-policy.js.map +1 -0
- package/lib/submission/hydranium-glsp-submission-handler.d.ts +109 -0
- package/lib/submission/hydranium-glsp-submission-handler.d.ts.map +1 -0
- package/lib/submission/hydranium-glsp-submission-handler.js +157 -0
- package/lib/submission/hydranium-glsp-submission-handler.js.map +1 -0
- package/lib/submission/index.d.ts +10 -0
- package/lib/submission/index.d.ts.map +1 -0
- package/lib/submission/index.js +10 -0
- package/lib/submission/index.js.map +1 -0
- package/lib/testing/glsp-harness.d.ts +170 -0
- package/lib/testing/glsp-harness.d.ts.map +1 -0
- package/lib/testing/glsp-harness.js +231 -0
- package/lib/testing/glsp-harness.js.map +1 -0
- package/lib/testing/index.d.ts +11 -0
- package/lib/testing/index.d.ts.map +1 -0
- package/lib/testing/index.js +13 -0
- package/lib/testing/index.js.map +1 -0
- package/lib/testing/make-noop-glsp-logger.d.ts +42 -0
- package/lib/testing/make-noop-glsp-logger.d.ts.map +1 -0
- package/lib/testing/make-noop-glsp-logger.js +47 -0
- package/lib/testing/make-noop-glsp-logger.js.map +1 -0
- package/lib/util/index.d.ts +10 -0
- package/lib/util/index.d.ts.map +1 -0
- package/lib/util/index.js +10 -0
- package/lib/util/index.js.map +1 -0
- package/lib/util/service-identifier.d.ts +46 -0
- package/lib/util/service-identifier.d.ts.map +1 -0
- package/lib/util/service-identifier.js +47 -0
- package/lib/util/service-identifier.js.map +1 -0
- package/lib/validation/diagnostic-markers.d.ts +48 -0
- package/lib/validation/diagnostic-markers.d.ts.map +1 -0
- package/lib/validation/diagnostic-markers.js +68 -0
- package/lib/validation/diagnostic-markers.js.map +1 -0
- package/lib/validation/hydranium-glsp-model-validator.d.ts +51 -0
- package/lib/validation/hydranium-glsp-model-validator.d.ts.map +1 -0
- package/lib/validation/hydranium-glsp-model-validator.js +118 -0
- package/lib/validation/hydranium-glsp-model-validator.js.map +1 -0
- package/lib/validation/index.d.ts +11 -0
- package/lib/validation/index.d.ts.map +1 -0
- package/lib/validation/index.js +11 -0
- package/lib/validation/index.js.map +1 -0
- package/package.json +111 -0
- package/src/browser/index.ts +15 -0
- package/src/browser/start-glsp-server-in-worker.ts +202 -0
- package/src/command/hydranium-glsp-recording-command.ts +183 -0
- package/src/command/index.ts +10 -0
- package/src/computed-bounds/hydranium-glsp-computed-bounds-action-handler.ts +103 -0
- package/src/computed-bounds/index.ts +10 -0
- package/src/dispatcher/index.ts +10 -0
- package/src/dispatcher/server-action-dispatcher.ts +72 -0
- package/src/index.ts +20 -0
- package/src/launcher/abstract-hydranium-glsp-diagram-module.ts +117 -0
- package/src/launcher/glsp-app-module.ts +106 -0
- package/src/launcher/glsp-framework-overrides.ts +51 -0
- package/src/launcher/glsp-server-overrides.ts +46 -0
- package/src/launcher/hydranium-glsp-server.ts +104 -0
- package/src/launcher/index.ts +22 -0
- package/src/logging/glsp-client-logger.ts +184 -0
- package/src/logging/index.ts +10 -0
- package/src/node/index.ts +13 -0
- package/src/node/start-glsp-server.ts +214 -0
- package/src/state/abstract-hydranium-glsp-state.ts +503 -0
- package/src/state/full-text-hydranium-glsp-state.ts +63 -0
- package/src/state/hydranium-glsp-index.ts +337 -0
- package/src/state/hydranium-shared-core-services.ts +92 -0
- package/src/state/index.ts +17 -0
- package/src/state/model-ready-timeout-error.ts +33 -0
- package/src/state/reconcile-source-model-write.ts +77 -0
- package/src/state/reconciling-multi-document-glsp-state.ts +248 -0
- package/src/state/reconciling-transfer-hydranium-glsp-state.ts +132 -0
- package/src/storage/hydranium-glsp-storage.ts +660 -0
- package/src/storage/index.ts +11 -0
- package/src/storage/save-conflict-policy.ts +52 -0
- package/src/submission/hydranium-glsp-submission-handler.ts +170 -0
- package/src/submission/index.ts +10 -0
- package/src/testing/glsp-harness.ts +422 -0
- package/src/testing/index.ts +14 -0
- package/src/testing/make-noop-glsp-logger.ts +66 -0
- package/src/util/index.ts +10 -0
- package/src/util/service-identifier.ts +49 -0
- package/src/validation/diagnostic-markers.ts +93 -0
- package/src/validation/hydranium-glsp-model-validator.ts +105 -0
- package/src/validation/index.ts +11 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023-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 { JsonRecordingCommand } from '@eclipse-glsp/server';
|
|
10
|
+
/**
|
|
11
|
+
* GLSP {@link JsonRecordingCommand} base shared by all hydranium adopters.
|
|
12
|
+
* Adds two things on top of GLSP's class:
|
|
13
|
+
*
|
|
14
|
+
* 1. A **time-labelled execute wrapper** so log lines record how long a
|
|
15
|
+
* user-facing operation takes end-to-end — including the `postChange`
|
|
16
|
+
* source-model update that re-parses the document. Otherwise the diff +
|
|
17
|
+
* patch + persist work happens silently and is hard to attribute when
|
|
18
|
+
* something is slow.
|
|
19
|
+
* 2. A typed `state` field that exposes `updateSourceModel` for the
|
|
20
|
+
* `postChange` bridge AND the framework `logger` for time-labelled
|
|
21
|
+
* logging. GLSP's base class only types `modelState: JsonModelState`,
|
|
22
|
+
* which lacks the framework's logger surface.
|
|
23
|
+
*
|
|
24
|
+
* **Optional undo/redo bridge hooks.** An adopter command can supply
|
|
25
|
+
* `undoAction` / `redoAction` callbacks invoked alongside the patch apply, to
|
|
26
|
+
* re-emit a side-effect the patch itself does not carry. Provided as optional
|
|
27
|
+
* constructor args so adopters get that composition surface without
|
|
28
|
+
* subclassing. Operation handlers that don't need bridge callbacks omit them.
|
|
29
|
+
*
|
|
30
|
+
* **postChange semantics.** GLSP's `JsonRecordingCommand.postChange` calls
|
|
31
|
+
* `modelState.updateSourceModel(newModel)` with the model only. The
|
|
32
|
+
* framework lift overrides `postChange` so it also threads the based-on
|
|
33
|
+
* version captured at command start — letting the downstream
|
|
34
|
+
* `ModelService.update` opt into the `ConflictError` gate. Undo / redo
|
|
35
|
+
* postChange calls run with version `undefined` (no gating): the user
|
|
36
|
+
* authored against the recorded patch, not against a specific server
|
|
37
|
+
* version, so re-applying it should succeed regardless of intervening
|
|
38
|
+
* edits. The recorded patch itself encodes the semantic intent.
|
|
39
|
+
*/
|
|
40
|
+
export class HydraniumGlspRecordingCommand extends JsonRecordingCommand {
|
|
41
|
+
label;
|
|
42
|
+
undoAction;
|
|
43
|
+
redoAction;
|
|
44
|
+
/**
|
|
45
|
+
* Based-on version captured at {@link execute} start; threaded into
|
|
46
|
+
* {@link postChange} so {@link AbstractHydraniumGlspState.updateSourceModel}
|
|
47
|
+
* sees the version the user authored against. Cleared after `execute`
|
|
48
|
+
* returns so undo / redo paths fall through to `updateSourceModel`
|
|
49
|
+
* without a version (no gating).
|
|
50
|
+
*/
|
|
51
|
+
activeVersion;
|
|
52
|
+
/**
|
|
53
|
+
* Source-model snapshots captured at {@link execute} — the state the
|
|
54
|
+
* command left ({@link afterSnapshot}) and the state it started from
|
|
55
|
+
* ({@link beforeSnapshot}). {@link undo} / {@link redo} reconcile the
|
|
56
|
+
* recorded transition against the *current* source model via the state's
|
|
57
|
+
* {@link AbstractHydraniumGlspState.conflictResolver}, so under the default
|
|
58
|
+
* reconciling policy a concurrent edit to another field survives and a
|
|
59
|
+
* same-field collision is dropped rather than clobbered.
|
|
60
|
+
*/
|
|
61
|
+
beforeSnapshot;
|
|
62
|
+
afterSnapshot;
|
|
63
|
+
constructor(modelState,
|
|
64
|
+
/** Human-readable label for the operation; appears in the timing-pair log line. */
|
|
65
|
+
label, doExecute,
|
|
66
|
+
/** Optional bridge invoked alongside undo patch application; for adopters
|
|
67
|
+
* that need to re-emit a side-effect the patch does not carry. */
|
|
68
|
+
undoAction,
|
|
69
|
+
/** Optional bridge invoked alongside redo patch application. */
|
|
70
|
+
redoAction) {
|
|
71
|
+
super(modelState, doExecute);
|
|
72
|
+
this.label = label;
|
|
73
|
+
this.undoAction = undoAction;
|
|
74
|
+
this.redoAction = redoAction;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Time-label the full execute path: pre-state snapshot + `doExecute` +
|
|
78
|
+
* post-state snapshot + patch-derive + `postChange` (which writes back
|
|
79
|
+
* via {@link AbstractHydraniumGlspState.updateSourceModel}). The label combines
|
|
80
|
+
* the operation name with the source-uri-stamped logger.
|
|
81
|
+
*
|
|
82
|
+
* Captures {@link AbstractHydraniumGlspState.version} at start so {@link postChange}
|
|
83
|
+
* can thread the based-on version into `updateSourceModel`. The capture
|
|
84
|
+
* is `try`/`finally`-scoped so undo / redo paths invoked later do not
|
|
85
|
+
* see a stale captured version.
|
|
86
|
+
*/
|
|
87
|
+
async execute() {
|
|
88
|
+
const logger = this.modelState.logger.for('HydraniumGlspRecordingCommand');
|
|
89
|
+
this.activeVersion = this.modelState.version;
|
|
90
|
+
logger.debug(`Executing '${this.label}' (based-on doc.version=v${this.activeVersion})`);
|
|
91
|
+
this.beforeSnapshot = this.deepClone(await this.getJsonObject());
|
|
92
|
+
try {
|
|
93
|
+
await this.modelState.tracer.for('HydraniumGlspRecordingCommand').time(`Execute command '${this.label}'`, () => super.execute());
|
|
94
|
+
}
|
|
95
|
+
finally {
|
|
96
|
+
this.activeVersion = undefined;
|
|
97
|
+
}
|
|
98
|
+
this.afterSnapshot = this.deepClone(await this.getJsonObject());
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Override of GLSP's {@link JsonRecordingCommand.postChange} so the
|
|
102
|
+
* call to {@link AbstractHydraniumGlspState.updateSourceModel} threads the
|
|
103
|
+
* captured based-on version alongside the new model.
|
|
104
|
+
*
|
|
105
|
+
* During {@link execute} the version is the snapshot captured at
|
|
106
|
+
* command start; during {@link undo} / {@link redo} it is `undefined`
|
|
107
|
+
* — replaying a recorded patch does not author against a specific
|
|
108
|
+
* server version, so no gate applies.
|
|
109
|
+
*/
|
|
110
|
+
postChange(newModel) {
|
|
111
|
+
return this.modelState.updateSourceModel(newModel, this.activeVersion);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Reconcile the recorded `after → before` transition against the
|
|
115
|
+
* *current* source model via the state's
|
|
116
|
+
* {@link AbstractHydraniumGlspState.conflictResolver}, invoke the optional adopter
|
|
117
|
+
* `undoAction`, and persist via `postChange`. Under the default reconciling
|
|
118
|
+
* policy the revert is replayed guarded by `test` ops, so a concurrent edit
|
|
119
|
+
* to another field is preserved (merged) and a same-field collision is
|
|
120
|
+
* dropped rather than clobbered; a force policy clobbers (last-writer-wins).
|
|
121
|
+
* On anything but a clean merge the undo is a logged no-op — the side-effect
|
|
122
|
+
* bridge and `postChange` only run on a merged result, preserving a
|
|
123
|
+
* "bridge before commit" order.
|
|
124
|
+
*/
|
|
125
|
+
async undo() {
|
|
126
|
+
if (!this.undoPatch || this.beforeSnapshot === undefined || this.afterSnapshot === undefined) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const logger = this.modelState.logger.for('HydraniumGlspRecordingCommand');
|
|
130
|
+
logger.debug(`Undoing '${this.label}' at doc.version=v${this.modelState.version}`);
|
|
131
|
+
const outcome = await this.modelState.conflictResolver.resolve(this.afterSnapshot, this.beforeSnapshot, async () => this.getJsonObject());
|
|
132
|
+
if (outcome.status !== 'merged') {
|
|
133
|
+
logger.warn(`Undo '${this.label}' skipped (${outcome.status}); a foreign edit changed a shared field since the command ran`);
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
await this.undoAction?.();
|
|
137
|
+
await this.postChange?.(outcome.merged);
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Reconcile the recorded `before → after` transition against the current
|
|
141
|
+
* source model, invoke the optional adopter `redoAction`, and persist via
|
|
142
|
+
* `postChange`. Same guarded merge / drop semantics as {@link undo}.
|
|
143
|
+
*/
|
|
144
|
+
async redo() {
|
|
145
|
+
if (!this.redoPatch || this.beforeSnapshot === undefined || this.afterSnapshot === undefined) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const logger = this.modelState.logger.for('HydraniumGlspRecordingCommand');
|
|
149
|
+
logger.debug(`Redoing '${this.label}' at doc.version=v${this.modelState.version}`);
|
|
150
|
+
const outcome = await this.modelState.conflictResolver.resolve(this.beforeSnapshot, this.afterSnapshot, async () => this.getJsonObject());
|
|
151
|
+
if (outcome.status !== 'merged') {
|
|
152
|
+
logger.warn(`Redo '${this.label}' skipped (${outcome.status}); a foreign edit changed a shared field since the undo`);
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
await this.redoAction?.();
|
|
156
|
+
await this.postChange?.(outcome.merged);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=hydranium-glsp-recording-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hydranium-glsp-recording-command.js","sourceRoot":"","sources":["../../src/command/hydranium-glsp-recording-command.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAuC,oBAAoB,EAAqB,MAAM,sBAAsB,CAAC;AAiBpH;;;;;;;;;;;;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CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;QAC3E,MAAM,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC,KAAK,qBAAqB,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC;QACnF,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,aAAa,EAAE,KAAK,IAAI,EAAE,CAChH,IAAI,CAAC,aAAa,EAAE,CACtB,CAAC;QACF,IAAI,OAAO,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC/B,MAAM,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,KAAK,cAAc,OAAO,CAAC,MAAM,yDAAyD,CAAC,CAAC;YACtH,OAAO;QACV,CAAC;QACD,MAAM,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC;QAC1B,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;CACH"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
export * from './hydranium-glsp-recording-command.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/command/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,cAAc,uCAAuC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
export * from './hydranium-glsp-recording-command.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/command/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,cAAc,uCAAuC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
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, type ComputedBoundsAction, ComputedBoundsActionHandler, type GModelRoot, type MaybePromise } from '@eclipse-glsp/server';
|
|
10
|
+
import { type AstNode } from '@hydranium/langium';
|
|
11
|
+
import { type AbstractHydraniumGlspState } from '../state/abstract-hydranium-glsp-state.js';
|
|
12
|
+
import { type HydraniumGlspSubmissionHandler } from '../submission/hydranium-glsp-submission-handler.js';
|
|
13
|
+
/**
|
|
14
|
+
* GLSP {@link ComputedBoundsActionHandler} base shared by all hydranium
|
|
15
|
+
* adopters. Adds handshake-aware revision-mismatch logging on top of the
|
|
16
|
+
* upstream handler.
|
|
17
|
+
*
|
|
18
|
+
* **Why the lift.** GLSP's base silently returns `[]` on a revision
|
|
19
|
+
* mismatch — benign for stale post-drag bounds (the user moved an element,
|
|
20
|
+
* the server-side GModel got re-rendered before the client's pre-move
|
|
21
|
+
* `computedBounds` arrived; dropping the stale frame is correct). But
|
|
22
|
+
* catastrophic during the initial `requestModel → setModel` handshake: if the
|
|
23
|
+
* very first `computedBounds` arrives with a revision the server has already
|
|
24
|
+
* bumped, the subsequent `SetModelAction` response never fires and the diagram
|
|
25
|
+
* stays stuck at "model loading…". Adopters need this initial-handshake case
|
|
26
|
+
* surfaced as a warning so the failure mode is visible in logs.
|
|
27
|
+
*
|
|
28
|
+
* **Handshake detection** uses
|
|
29
|
+
* {@link HydraniumGlspSubmissionHandler.hasPendingInitialRequest} — true
|
|
30
|
+
* while a `RequestModelAction` has been accepted but the corresponding
|
|
31
|
+
* `SetModelAction` has not yet been dispatched. Adopters that override
|
|
32
|
+
* `submitModel` flow must preserve the `hasPendingInitialRequest` semantics
|
|
33
|
+
* for this logging to remain accurate.
|
|
34
|
+
*
|
|
35
|
+
* **Customisation.** The class is shipped non-abstract because the default
|
|
36
|
+
* body fits common adopters, which bind it directly. Adopters with
|
|
37
|
+
* bounds-specific cleanup subclass and override `applyBounds`.
|
|
38
|
+
*/
|
|
39
|
+
export declare class HydraniumGlspComputedBoundsActionHandler extends ComputedBoundsActionHandler {
|
|
40
|
+
protected readonly modelState: AbstractHydraniumGlspState<AstNode, unknown>;
|
|
41
|
+
protected readonly submissionHandler: HydraniumGlspSubmissionHandler<AstNode, unknown>;
|
|
42
|
+
execute(action: ComputedBoundsAction): MaybePromise<Action[]>;
|
|
43
|
+
/**
|
|
44
|
+
* Defensively filter routes that lack the source+target endpoints upstream
|
|
45
|
+
* `applyRoute` requires (`newRoutingPoints.length >= 2`). Without this,
|
|
46
|
+
* the upstream handler throws `GLSPServerError: Invalid Route!` and the
|
|
47
|
+
* entire `computedBounds` action is rejected — the diagram never settles.
|
|
48
|
+
*
|
|
49
|
+
* The race that produces these routes is benign and common on the
|
|
50
|
+
* initial layout pass: the GModel factory emits an edge with no explicit
|
|
51
|
+
* `routingPoints`, the client schedules the edge for routing but submits
|
|
52
|
+
* `computedBounds` before the routing pass finishes, so the route shows
|
|
53
|
+
* up with 0 or 1 point. Subsequent `computedBounds` actions carry the
|
|
54
|
+
* fully-routed edges; dropping the incomplete ones here is lossless.
|
|
55
|
+
*
|
|
56
|
+
* Adopters with bounds-specific cleanup — clearing ALL routes so the client
|
|
57
|
+
* re-routes on the next layout, say — override and replace this filter.
|
|
58
|
+
*/
|
|
59
|
+
protected applyBounds(root: GModelRoot, action: ComputedBoundsAction): void;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=hydranium-glsp-computed-bounds-action-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hydranium-glsp-computed-bounds-action-handler.d.ts","sourceRoot":"","sources":["../../src/computed-bounds/hydranium-glsp-computed-bounds-action-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,KAAK,MAAM,EACX,KAAK,oBAAoB,EACzB,2BAA2B,EAC3B,KAAK,UAAU,EACf,KAAK,YAAY,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAC5F,OAAO,EAAE,KAAK,8BAA8B,EAAE,MAAM,oDAAoD,CAAC;AAEzG;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBACa,wCAAyC,SAAQ,2BAA2B;IACtF,mBAA2B,UAAU,EAAE,0BAA0B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACpF,mBAA2B,iBAAiB,EAAE,8BAA8B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAEtF,OAAO,CAAC,MAAM,EAAE,oBAAoB,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC;IAqBtE;;;;;;;;;;;;;;;OAeG;cACgB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,oBAAoB,GAAG,IAAI;CAatF"}
|
|
@@ -0,0 +1,93 @@
|
|
|
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
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
10
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
11
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
12
|
+
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;
|
|
13
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14
|
+
};
|
|
15
|
+
import { ComputedBoundsActionHandler } from '@eclipse-glsp/server';
|
|
16
|
+
import { injectable } from 'inversify';
|
|
17
|
+
/**
|
|
18
|
+
* GLSP {@link ComputedBoundsActionHandler} base shared by all hydranium
|
|
19
|
+
* adopters. Adds handshake-aware revision-mismatch logging on top of the
|
|
20
|
+
* upstream handler.
|
|
21
|
+
*
|
|
22
|
+
* **Why the lift.** GLSP's base silently returns `[]` on a revision
|
|
23
|
+
* mismatch — benign for stale post-drag bounds (the user moved an element,
|
|
24
|
+
* the server-side GModel got re-rendered before the client's pre-move
|
|
25
|
+
* `computedBounds` arrived; dropping the stale frame is correct). But
|
|
26
|
+
* catastrophic during the initial `requestModel → setModel` handshake: if the
|
|
27
|
+
* very first `computedBounds` arrives with a revision the server has already
|
|
28
|
+
* bumped, the subsequent `SetModelAction` response never fires and the diagram
|
|
29
|
+
* stays stuck at "model loading…". Adopters need this initial-handshake case
|
|
30
|
+
* surfaced as a warning so the failure mode is visible in logs.
|
|
31
|
+
*
|
|
32
|
+
* **Handshake detection** uses
|
|
33
|
+
* {@link HydraniumGlspSubmissionHandler.hasPendingInitialRequest} — true
|
|
34
|
+
* while a `RequestModelAction` has been accepted but the corresponding
|
|
35
|
+
* `SetModelAction` has not yet been dispatched. Adopters that override
|
|
36
|
+
* `submitModel` flow must preserve the `hasPendingInitialRequest` semantics
|
|
37
|
+
* for this logging to remain accurate.
|
|
38
|
+
*
|
|
39
|
+
* **Customisation.** The class is shipped non-abstract because the default
|
|
40
|
+
* body fits common adopters, which bind it directly. Adopters with
|
|
41
|
+
* bounds-specific cleanup subclass and override `applyBounds`.
|
|
42
|
+
*/
|
|
43
|
+
let HydraniumGlspComputedBoundsActionHandler = class HydraniumGlspComputedBoundsActionHandler extends ComputedBoundsActionHandler {
|
|
44
|
+
execute(action) {
|
|
45
|
+
this.modelState.logger.debug(`ComputedBoundsActionHandler.execute entered: action.revision=${action.revision}`);
|
|
46
|
+
const model = this.modelState.root;
|
|
47
|
+
if (action.revision !== model.revision) {
|
|
48
|
+
if (this.submissionHandler.hasPendingInitialRequest()) {
|
|
49
|
+
this.modelState.logger.warn(`ComputedBounds rejected (initial handshake): action.revision=${action.revision} model.revision=${model.revision} — ` +
|
|
50
|
+
'initial SetModelAction will not fire (empty diagram)');
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
this.modelState.logger.debug(`ComputedBounds dropped (stale): action.revision=${action.revision} model.revision=${model.revision} — ` +
|
|
54
|
+
'bounds belong to a superseded GModel; safe to ignore');
|
|
55
|
+
}
|
|
56
|
+
return [];
|
|
57
|
+
}
|
|
58
|
+
this.modelState.logger.trace(`ComputedBounds accepted: revision=${action.revision}, bounds=${action.bounds?.length ?? 0}`);
|
|
59
|
+
return super.execute(action);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Defensively filter routes that lack the source+target endpoints upstream
|
|
63
|
+
* `applyRoute` requires (`newRoutingPoints.length >= 2`). Without this,
|
|
64
|
+
* the upstream handler throws `GLSPServerError: Invalid Route!` and the
|
|
65
|
+
* entire `computedBounds` action is rejected — the diagram never settles.
|
|
66
|
+
*
|
|
67
|
+
* The race that produces these routes is benign and common on the
|
|
68
|
+
* initial layout pass: the GModel factory emits an edge with no explicit
|
|
69
|
+
* `routingPoints`, the client schedules the edge for routing but submits
|
|
70
|
+
* `computedBounds` before the routing pass finishes, so the route shows
|
|
71
|
+
* up with 0 or 1 point. Subsequent `computedBounds` actions carry the
|
|
72
|
+
* fully-routed edges; dropping the incomplete ones here is lossless.
|
|
73
|
+
*
|
|
74
|
+
* Adopters with bounds-specific cleanup — clearing ALL routes so the client
|
|
75
|
+
* re-routes on the next layout, say — override and replace this filter.
|
|
76
|
+
*/
|
|
77
|
+
applyBounds(root, action) {
|
|
78
|
+
if (action.routes && action.routes.length > 0) {
|
|
79
|
+
const original = action.routes.length;
|
|
80
|
+
action.routes = action.routes.filter(route => (route.newRoutingPoints?.length ?? 0) >= 2);
|
|
81
|
+
const dropped = original - action.routes.length;
|
|
82
|
+
if (dropped > 0) {
|
|
83
|
+
this.modelState.logger.debug(`ComputedBounds dropped ${dropped}/${original} route(s) with <2 routing points — client hasn't finished routing yet`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
super.applyBounds(root, action);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
HydraniumGlspComputedBoundsActionHandler = __decorate([
|
|
90
|
+
injectable()
|
|
91
|
+
], HydraniumGlspComputedBoundsActionHandler);
|
|
92
|
+
export { HydraniumGlspComputedBoundsActionHandler };
|
|
93
|
+
//# sourceMappingURL=hydranium-glsp-computed-bounds-action-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hydranium-glsp-computed-bounds-action-handler.js","sourceRoot":"","sources":["../../src/computed-bounds/hydranium-glsp-computed-bounds-action-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;;;;;;;AAElF,OAAO,EAGJ,2BAA2B,EAG7B,MAAM,sBAAsB,CAAC;AAE9B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C,MAAM,CAAC,MAAM,CAAC;YACtC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,EAAE,MAAM,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;YAC1F,MAAM,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;YAChD,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;gBACf,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CACzB,0BAA0B,OAAO,IAAI,QAAQ,uEAAuE,CACtH,CAAC;YACL,CAAC;QACJ,CAAC;QACD,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACnC,CAAC;CACH,CAAA;AAtDY,wCAAwC;IADpD,UAAU,EAAE;GACA,wCAAwC,CAsDpD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
export * from './hydranium-glsp-computed-bounds-action-handler.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/computed-bounds/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,cAAc,oDAAoD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
export * from './hydranium-glsp-computed-bounds-action-handler.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/computed-bounds/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,cAAc,oDAAoD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
export * from './server-action-dispatcher.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dispatcher/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,cAAc,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
export * from './server-action-dispatcher.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dispatcher/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,cAAc,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023-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, DefaultActionDispatcher } from '@eclipse-glsp/server';
|
|
10
|
+
import { type Tracer } from '@hydranium/protocol';
|
|
11
|
+
import { type GlspClientLogger } from '../logging/glsp-client-logger.js';
|
|
12
|
+
/**
|
|
13
|
+
* Server-side action dispatcher with built-in traffic observability:
|
|
14
|
+
* every {@link DefaultActionDispatcher.dispatch} call is wrapped in a
|
|
15
|
+
* {@link Tracer.time} pair that records the dispatch direction
|
|
16
|
+
* (`→ client` vs `→ server`) and timing.
|
|
17
|
+
*
|
|
18
|
+
* **Why this lives in the framework (vs left as an adopter override).**
|
|
19
|
+
* Debugging GLSP state, storage, and submission flows depends heavily on
|
|
20
|
+
* seeing each action with timing and direction — especially when bringing
|
|
21
|
+
* up a new adopter against an empty/partial diagram before its submission
|
|
22
|
+
* flow is complete. Providing this dispatcher in the framework gives every
|
|
23
|
+
* adopter the same observability primitive from the very first GLSP-head
|
|
24
|
+
* launch.
|
|
25
|
+
*
|
|
26
|
+
* **Extension points.**
|
|
27
|
+
* - {@link loggedKinds} — if set, filter the log lines (the dispatch
|
|
28
|
+
* still happens; only the bracketed timing line is suppressed). Default
|
|
29
|
+
* `undefined` means **every** action's dispatch is timed and logged.
|
|
30
|
+
* - {@link summarize} — return a non-empty string to append `[summary]`
|
|
31
|
+
* to the log line; default returns `''` (no extra bracket).
|
|
32
|
+
*
|
|
33
|
+
* Adopters bind it in a per-diagram module, as the `ActionDispatcher` service.
|
|
34
|
+
*/
|
|
35
|
+
export declare class HydraniumGlspServerActionDispatcher extends DefaultActionDispatcher {
|
|
36
|
+
/** Narrowed from `Logger`; DI binds {@link GlspClientLogger}. */
|
|
37
|
+
protected readonly logger: GlspClientLogger;
|
|
38
|
+
/** Caller-tagged tracer (auto-componented with this class name, like the logger). */
|
|
39
|
+
protected readonly tracer: Tracer;
|
|
40
|
+
/**
|
|
41
|
+
* If set, the timing log line is emitted only when `action.kind` is in
|
|
42
|
+
* this set. Subclasses override via field reassignment.
|
|
43
|
+
*/
|
|
44
|
+
protected readonly loggedKinds: ReadonlySet<string> | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Override to enrich the log line with payload-specific detail. Return an
|
|
47
|
+
* empty string to suppress the bracket. Default returns `''`.
|
|
48
|
+
*/
|
|
49
|
+
protected summarize(_action: Action): string;
|
|
50
|
+
dispatch(action: Action): Promise<void>;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=server-action-dispatcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-action-dispatcher.d.ts","sourceRoot":"","sources":["../../src/dispatcher/server-action-dispatcher.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,MAAM,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE5E,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBACa,mCAAoC,SAAQ,uBAAuB;IAC7E,iEAAiE;IACjE,mBAA2B,MAAM,EAAE,gBAAgB,CAAC;IAEpD,qFAAqF;IACtD,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAElE;;;OAGG;IACH,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAAa;IAE5E;;;OAGG;IACH,SAAS,CAAC,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAInC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAWlD"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023-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
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
10
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
11
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
12
|
+
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;
|
|
13
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14
|
+
};
|
|
15
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
16
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
17
|
+
};
|
|
18
|
+
import { DefaultActionDispatcher } from '@eclipse-glsp/server';
|
|
19
|
+
import { inject, injectable } from 'inversify';
|
|
20
|
+
import { HydraniumTypes } from '../state/hydranium-shared-core-services.js';
|
|
21
|
+
/**
|
|
22
|
+
* Server-side action dispatcher with built-in traffic observability:
|
|
23
|
+
* every {@link DefaultActionDispatcher.dispatch} call is wrapped in a
|
|
24
|
+
* {@link Tracer.time} pair that records the dispatch direction
|
|
25
|
+
* (`→ client` vs `→ server`) and timing.
|
|
26
|
+
*
|
|
27
|
+
* **Why this lives in the framework (vs left as an adopter override).**
|
|
28
|
+
* Debugging GLSP state, storage, and submission flows depends heavily on
|
|
29
|
+
* seeing each action with timing and direction — especially when bringing
|
|
30
|
+
* up a new adopter against an empty/partial diagram before its submission
|
|
31
|
+
* flow is complete. Providing this dispatcher in the framework gives every
|
|
32
|
+
* adopter the same observability primitive from the very first GLSP-head
|
|
33
|
+
* launch.
|
|
34
|
+
*
|
|
35
|
+
* **Extension points.**
|
|
36
|
+
* - {@link loggedKinds} — if set, filter the log lines (the dispatch
|
|
37
|
+
* still happens; only the bracketed timing line is suppressed). Default
|
|
38
|
+
* `undefined` means **every** action's dispatch is timed and logged.
|
|
39
|
+
* - {@link summarize} — return a non-empty string to append `[summary]`
|
|
40
|
+
* to the log line; default returns `''` (no extra bracket).
|
|
41
|
+
*
|
|
42
|
+
* Adopters bind it in a per-diagram module, as the `ActionDispatcher` service.
|
|
43
|
+
*/
|
|
44
|
+
let HydraniumGlspServerActionDispatcher = class HydraniumGlspServerActionDispatcher extends DefaultActionDispatcher {
|
|
45
|
+
/** Caller-tagged tracer (auto-componented with this class name, like the logger). */
|
|
46
|
+
tracer;
|
|
47
|
+
/**
|
|
48
|
+
* If set, the timing log line is emitted only when `action.kind` is in
|
|
49
|
+
* this set. Subclasses override via field reassignment.
|
|
50
|
+
*/
|
|
51
|
+
loggedKinds = undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Override to enrich the log line with payload-specific detail. Return an
|
|
54
|
+
* empty string to suppress the bracket. Default returns `''`.
|
|
55
|
+
*/
|
|
56
|
+
summarize(_action) {
|
|
57
|
+
return '';
|
|
58
|
+
}
|
|
59
|
+
dispatch(action) {
|
|
60
|
+
if (this.loggedKinds && !this.loggedKinds.has(action.kind)) {
|
|
61
|
+
return super.dispatch(action);
|
|
62
|
+
}
|
|
63
|
+
const direction = this.clientActionForwarder.shouldForwardToClient(action) ? '→ client' : '→ server';
|
|
64
|
+
const summary = this.summarize(action);
|
|
65
|
+
const label = summary
|
|
66
|
+
? `Dispatch action '${action.kind}' ${direction} [${summary}]`
|
|
67
|
+
: `Dispatch action '${action.kind}' ${direction}`;
|
|
68
|
+
return this.tracer.time(label, () => super.dispatch(action));
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
__decorate([
|
|
72
|
+
inject(HydraniumTypes.Tracer),
|
|
73
|
+
__metadata("design:type", Object)
|
|
74
|
+
], HydraniumGlspServerActionDispatcher.prototype, "tracer", void 0);
|
|
75
|
+
HydraniumGlspServerActionDispatcher = __decorate([
|
|
76
|
+
injectable()
|
|
77
|
+
], HydraniumGlspServerActionDispatcher);
|
|
78
|
+
export { HydraniumGlspServerActionDispatcher };
|
|
79
|
+
//# sourceMappingURL=server-action-dispatcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-action-dispatcher.js","sourceRoot":"","sources":["../../src/dispatcher/server-action-dispatcher.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;;;;;;;;;;AAElF,OAAO,EAAe,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAG/C,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEI,IAAM,mCAAmC,GAAzC,MAAM,mCAAoC,SAAQ,uBAAuB;IAI7E,qFAAqF;IACnC,MAAM,CAAU;IAElE;;;OAGG;IACgB,WAAW,GAAoC,SAAS,CAAC;IAE5E;;;OAGG;IACO,SAAS,CAAC,OAAe;QAChC,OAAO,EAAE,CAAC;IACb,CAAC;IAEQ,QAAQ,CAAC,MAAc;QAC7B,IAAI,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1D,OAAO,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC;QACD,MAAM,SAAS,GAAG,IAAI,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC;QACrG,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACvC,MAAM,KAAK,GAAG,OAAO;YAClB,CAAC,CAAC,oBAAoB,MAAM,CAAC,IAAI,KAAK,SAAS,KAAK,OAAO,GAAG;YAC9D,CAAC,CAAC,oBAAoB,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QACrD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAChE,CAAC;CACH,CAAA;AA3BoD;IAAjD,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC;;mEAAoC;AALxD,mCAAmC;IAD/C,UAAU,EAAE;GACA,mCAAmC,CAgC/C"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
export * from './command/index.js';
|
|
10
|
+
export * from './computed-bounds/index.js';
|
|
11
|
+
export * from './dispatcher/index.js';
|
|
12
|
+
export * from './launcher/index.js';
|
|
13
|
+
export * from './logging/index.js';
|
|
14
|
+
export * from './state/index.js';
|
|
15
|
+
export * from './storage/index.js';
|
|
16
|
+
export * from './submission/index.js';
|
|
17
|
+
export * from './util/index.js';
|
|
18
|
+
export * from './validation/index.js';
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC"}
|
package/lib/index.js
ADDED
|
@@ -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
|
+
// Public API barrel for `@hydranium/glsp-server` — the GLSP protocol head.
|
|
10
|
+
export * from './command/index.js';
|
|
11
|
+
export * from './computed-bounds/index.js';
|
|
12
|
+
export * from './dispatcher/index.js';
|
|
13
|
+
export * from './launcher/index.js';
|
|
14
|
+
export * from './logging/index.js';
|
|
15
|
+
export * from './state/index.js';
|
|
16
|
+
export * from './storage/index.js';
|
|
17
|
+
export * from './submission/index.js';
|
|
18
|
+
export * from './util/index.js';
|
|
19
|
+
export * from './validation/index.js';
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,2EAA2E;AAC3E,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC"}
|