Skip to content

GLSP-1682: Import GLSP component repositories with preserved history - #2

Merged
tortmayr merged 583 commits into
mainfrom
1682-initial-contribution
Sep 3, 2026
Merged

GLSP-1682: Import GLSP component repositories with preserved history#2
tortmayr merged 583 commits into
mainfrom
1682-initial-contribution

Conversation

@tortmayr

@tortmayr tortmayr commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

What it does

Isolates the clean initial contribution for glsp-core: the
history-preserving import of three existing Eclipse GLSP repositories, with
none of the later glsp-core-specific restructuring on top. This branch exists
to make the imported history reviewable on its own (see the ECA note below);
the full working monorepo is #1.

Import map:

Source repository Subtrees imported Target in glsp-core
eclipse-glsp/glsp dev-packages/ dev-packages/
eclipse-glsp/glsp-client packages/, examples/ packages/, examples/
eclipse-glsp/glsp-server-node packages/, examples/ packages/, examples/
  • Each source history was path-scoped with git-filter-repo (keeping only the contributed subtrees, preserving author/date/message) and joined with git merge --allow-unrelated-histories.
  • The result is the initial commit plus three two-parent import merges; each merge's second parent keeps the full per-file history of the imported code reachable.
  • No workspace/build setup, CI, or restructuring is included here — those are done natively in GLSP-1682: Consolidate client, server, and dev packages into a single monorepo #1.

Part of: eclipse-glsp/glsp#1682

How to test

This branch is the raw imported history for provenance review — it is not a
buildable monorepo (the workspace wiring lives in #1). Verify history
preservation:

git log --follow -- packages/client/src/base/action-dispatcher.ts   # traverses into original glsp-client history
git blame packages/graph/src/gmodel-serializer.ts                   # original authors/dates preserved
git shortlog -sne 1682-initial-contribution                         # full original contributor set
  • Verified locally: git log --follow reaches the pre-import source commits; all original contributor identities are present.

Follow-ups

  • ECA check coverage: this branch carries ~573 commits, but GitHub's PR-commits REST API is capped at 250, so the Eclipse ECA check can only inspect the newest 250 and cannot report on the older imported commits. Those are not new contributions — they were ECA-validated when originally merged into their source eclipse-glsp/* repositories. Requesting an EF-side ECA override for this history-import PR.
  • The monorepo restructuring, workspace setup, and GitHub workflows are in GLSP-1682: Consolidate client, server, and dev packages into a single monorepo #1.

Changelog

  • This PR should be mentioned in the changelog
  • This PR introduces a breaking change (if yes, provide more details below for the changelog and the migration guide)

tortmayr and others added 30 commits May 16, 2024 10:18
- Refactor `DiagramLoader` to catch and log errors that occur when invoking startup hooks
- This ensures both: failure of one hook does not affect execution of following hooks and if  a hook fails for any reason we provide the reason in the log output
- Refactor `RestoreViewportHandler` to use the actual dom id of the root element for querying/focusing the graph. This ensures that the focusing also works if the root model element is not of type `graph`.

Fixes eclipse-glsp/glsp#1309
* Improve handling of change bounds

- Introduce change bounds manager to centralize bounds-related services
-- Bounds changes through position snapping and movement restriction
-- Validation for size and position of an element
-- Customizable methods for when to use move and resize options

- Introduce change bounds tracker for moves and resizes
-- Tracker calculates move on diagram and calculates move and resizes
-- Tracker supports options on which parts of the process are applied

- Provide moveable wrappers for resize and routing handles

Fixes eclipse-glsp/glsp#1337

- Extend current resize capabilities
-- Introduce mode for symmetric resize
-- Introduce one-dimensional resize on top, right, bottom and left side

Fixes eclipse-glsp/glsp#1338
Fixes eclipse-glsp/glsp#1339

- Fix elements moving during resizing when hitting minimum bounds
-- Store calculated minimum size from layouter in element
-- Adapt resize so we do not produce invalid sized bounds

Fixes eclipse-glsp/glsp#1340

Minor:
- Ensure we get proper cursor feedback when hovering over resize handle
- Add additional convenience functions
- Add origin viewport command for convenience

Contributed on behalf of Axon Ivy AG
…#347)

Default event prevention should be handled by the `ICopyPasteHandler` implementation.
e.g. The default `ServerCopyPasteHandler` has guard clauses to check wether a copy or paste operation should be executed (diagram must be active and selection >0). It only default prevents if this condition is met.
Currently we bypass this special check and always default prevent which causes issues in scenarios where the diagram is nested into a surrounding application frame or is currently not focused (e.g.) hidden
- Allow resizable elements to specify resize handle location
- Use correct feedback (move) on ghost element move (not resize)
- Centralize most move/resize feedback in change bounds manager
- Do not draw grid on hidden SVG as we do not have transformation data
- Ensure we also apply move feedback if we do not have ghost element
- Ensure that the container feedback considers the insert position
- Extract container insert management into manager class
- Avoid unnecessary TYPES.* for classes
- Fix typos
- Remove circular dependencies by fixing index imports

Contributed on behalf of Axon Ivy AG
Switch to root level index generation.
- Remove all sub directory index.ts files
- Update `generate:Index` script to single file
- Update import paths
- (Check and fix copyright headers)
Fixes eclipse-glsp/glsp#1346

Co-authored-by: Martin Fleck <mfleck@eclipsesource.com>
- Ensure GridManager properly tracks state if action is used on startup
- Ensure DebugManager properly tracks state if action is used on startup
- Avoid cursor feedback interfering with edge edit feedback in disposal
- Avoid unnecessary disposal calls by calling mouseUp on mouseMove
- Fix issue with non-resizable elements not being movable
- Fix calculation of position on diagram for nested HTML elements
- More flexibility for hiddenBoundingRect
- Make EdgeCreationTool more customizable
* Minor Improvements

- Ensure we render/unhide tracked ghost element as soon as possible
- Add ghost element bounds data to arguments sent to server

* PR Feedback

- Remove snapper argument
- New: Add utility function to check if a bound object is valid
- New: Make SVG exporter a little bit more flexible
For some reason our created target elements are not actually instanceof
Element even though everything is in their prototype chain. So instead,
we now check whether it is an element with tag (HTML, SVG, Math) and
whether it has a style property.
* Configure fork and join nodes as not resizable

Update type hints configuration for workflow example to make fork and join nodes not resizable
=> we have test cases for both resizable and non-resizable elements in the diagram

Refactor createDefault hint functions to allow partial overriding of default properties

* Align edge-creation-checker condition with java server

i..e only allow decision nodes as sources for weighted edges
- Add `replace` property to `ModulConfiguration` interface. When resolving feature modules of the replace property, any potential already configured module with the same id will be replaced with the defined module. If there is nothing to replace, the module will be added to the end of the resolved configuration
- Add check for non-unique feature module ids to `resolveContainerConfiguration` function.
- Add option to enable additional debug logging when loading feature modules. This is usefull during development to get insights about why the container modules are not loaded as expected
- Add dedicated `featureIds` to all default modules. If no featureId is provided the number id of the module is reused for creating the featureId. While this works perfectly fine, it makes debugging harder because feature modules are hard to indentify based on their featureid.
With this change its now easier to derive the corresponding feature module from the featureid.

Fixes eclipse-glsp/glsp#1349
- Adjust name of `SResizeHandle` and `SResizeHandleview` to the gmodel namespace
and reexport under the old name as deprecated for backwards compatibility.

- Ensure that all diagram modules are constructed as `FeatureModules` instead of plain `ContainerModules`

- Rename modules that still have the glsp prefix and also reexport under old deprecated name
Mostly non-breaking changes. Some definitions have moved to the sprotty-protocol package.
However, we can mitigate all potential breaks with our @eclipse-glsp/sprotty reexport.

Fixes eclipse-glsp/glsp#1253
- Update next dependencies
- Update changelog
- Update copyright headers
- Add vscode-json rpc as explicit dependency to server package.
  This ensures that we are still using the same version as the client side in mono repo scenarios where multiple versions of vscode-jsonrpc are resolved
* Enhance Grid functionality and customizability

- Ensure grid is applied on normal graph view without projections
- Allow grid color to be specified through CSS
- Add more properties to the graph for re-use

* Properly escape grid color values

Color definitions with a # need to be escaped to be properly rendered
when used in a background image url
- Use our GLSPAbstractUIExtension instead of AbstractUIExtension
- Fix focus issue with GlspEditLabelUI
- Ensure that the change bounds tool does not dispatch `ChangeRoutingPointsAction` if there are not valid element moves.
- Ensure that duplicate detection in `resolveContainerConfiguration` properly stringifies symboles.
- Update `onSelect` method of autocomplete Widget to dispatch a `input` event instead of a `keyup` event. (Since autocompleter 8.x the suggestion update uses `input` instead of `keyup`
- Enable task editor in standalone example by adding an explicit standaloneTaskEditorModule.
Fixes eclipse-glsp/glsp#1347

In addition:
- Update dependencies and align with sprotty
- Use fixed version of vscode-jsonrpc to avoid conflicts with Theia
- Restore original container configuration order in `workflow-diagram-module`
  (was changed on accident in eclipse-glsp/glsp-client#355)
- Refactor grind background image rendering to a css only approach
- Use @jsx annotion for view files
  Use @jsx annotation instead of const JSX definition for view files. Adapt eslint config to ignore 
  unused svg and html imports to avoid explict deactivation of the rule in each view file.
  Reason
  - Sprotty base views also use annotations
   - Annotations are more robust. E.g. mocha tests with ts-node fail with an unused local error  
   when using JSX const

- Add tests for `initializeDiagramContainer`
- Cleanup GLSPProjectionView overrides


- Also add Grid properties if grid is not visible
- Adjust variable naming in default grid css
- Change visibility of private fields to protected for better extensibility
- Update to latest protocol version
  - This introduces a minor unavoidable API break because GIssue has changed from a class to an interface definition
- Ensure that actions queued with `dispatchAfterNextUpdate` are also dispatched after the initial `SetModelAction`
- Fix copyright header violations
Update the NodeDocumentationNavigationTargetProvider to not rely on the tasks name which is currently unreliable (see eclipse-glsp/glsp#1351) and instead relies on the `text` property of the tasks label.
- Update example1.wf
- Remove projection specific css styles for hiding the projection bars on mouse enter/leave over the diagram. This is not a generic feature only certain integration types support it (Theia//VS Code) so it should be handled in the integration specific code base
-  Fix timing issue in `GLSPCommandStack` when notifying `GModelRootListeners` after a model change. Properly wait until the listeners a notified before completing the returned promise. This ensures that all model listeners have received the updated model information before the next action is processed by the dispatcher.
- Introduce `dispatcherAfterNextUpdate` method in `GLSPActionDispatcher` that allows to delay the dispatching of actions until the next model update is processed from the server. (Now actions can be queued from both  client and server)
- Update changelog
- Add `defaultToolsEnabled` flag to `ToolManager` which is true if currently only the default tools are enabled i.e. no tools have been enabled explicitly
- Avoid (re)activation of default tools if the are already enabled
- Remove unused GRID_STYLE property


Co-authored-by: Martin Fleck <mfleck@eclipsesource.com>
Also allow partial configuration of `ViewerOptions` when using the `createDiagramOptionsModule` utility function
Properly CSS escape the root id before using it as query selector
tortmayr added 9 commits June 22, 2026 14:16
- Convert all Chai-style BDD assertions (`.to.be.true`,
  `.to.deep.equal`, `.to.include.members`, ...) across the CLI specs
  to native Vitest matchers; they previously passed only via Vitest's
  bundled Chai-compatible API
- Drop the now-redundant eslint-plugin-chai-friendly and restore the
  plain no-unused-expressions rule, since the converted assertions are
  method calls rather than bare expression statements
- Remove the stale mocha global from the shared eslint base config

Also:
- Add a root test:coverage script
- Drop dead ctrf/ and .nyc_output/ entries from .gitignore

Part of: eclipse-glsp/glsp#1635
* GLSP-1635: Migrate test stack to Vitest

- Replace Mocha/Chai/Sinon with Vitest across all packages; specs
  import the test API explicitly from 'vitest' (no globals). Remove the
  obsolete Mocha/nyc config, the chai-based test helpers, and the
  placeholder graph spec
- Consume the shared @eclipse-glsp/vitest-config (via @eclipse-glsp/dev)
  through a single flat root vite.config.ts that globs every package's
  specs, so one `vitest run` covers the repo and produces a merged
  coverage report; drop the now-redundant per-package vite configs and
  test scripts
- Type-check specs through a composite tsconfig.test.json (root plus a
  per-package config) built by `compile:test`, which `pnpm test` runs
  before `vitest run`
- Extend the plain @eclipse-glsp/ts-config now that the separate
  '/vitest' variant and the vitest/globals types are gone
- Run `pnpm test` / `pnpm test:coverage` in CI and drop the obsolete
  CTRF "Publish Test Report" step (Vitest's github-actions reporter
  annotates failures inline) along with the redundant `:ci` scripts
- Update the VS Code launch configs to debug tests via Vitest

Also:
- Move the raw-http e2e helper out of '*.spec.ts' into a test/ folder so
  it is no longer treated as a spec or shipped in the published package
- Tidy .gitignore: ignore '*.tsbuildinfo' and drop the now-dead **/ctrf,
  .nyc_output/, and yarn-error.log entries
- Import GModelElement from the @eclipse-glsp/graph entry point instead
  of a deep lib/ path

Part of: eclipse-glsp/glsp#1635

* Address review comments

- Assert the auto-bound service (`bind(SubTarget)`) in the binding-target
  spec instead of `bind(Target)`, which is bound unconditionally and so
  never actually verified the auto-bind behavior
-Improve ignore file handling for the index generation command.
-Now has reverse lookup up the parent hierachy similar to .gitignore
* GLSP-1635: Migrate test framework from Mocha to Vitest

- Replace the Mocha/Chai/nyc/Sinon setup with Vitest: consume the
  @eclipse-glsp/dev next packages, drop .mocharc/.nycrc, and point all
  test scripts at `vitest run`
- Drive the whole monorepo from a single flat Vitest config at the repo
  root instead of per-package configs, yielding one merged coverage report
- Type-check specs separately via composite tsconfig.test.json projects,
  since Vitest only transpiles; wire them through a `compile:test` step so
  `pnpm test` type-checks specs before running them
- Import the test API explicitly in every spec (no ambient globals) and
  load reflect-metadata once via root setup files for the DI specs
- Replace the custom expectToThrowAsync helper with Vitest's native
  rejects.toThrow() / toThrow() matchers and drop the obsolete test-util
  module
- Keep test-only code out of the published packages by excluding specs and
  test/ helper directories from both the build and the packed files
- Switch CI and contributor docs to Vitest: run `pnpm test`, and remove the
  now-obsolete test-report step and the redundant per-package and :ci test
  scripts
- Clean up leftover tooling artifacts: ignore *.tsbuildinfo so the new
  per-config build-info is covered, and drop the obsolete nyc/CTRF ignores
  and clean targets
- Run the workflow-standalone example's TS scripts via Node's native type
  stripping instead of ts-node, which the Mocha toolchain used to provide
  transitively: convert the scripts to ESM (.mts), drop the ts-node
  dependency, and raise the Node engine floor to 22.18 where stripping is
  unflagged

Also:
- Fix indentation in the local /fix skill doc

Part of: eclipse-glsp/glsp#1635

* GLSP-1635: Restore container load spy in default-modules tests

- Add an afterEach to restore the spy created on container.load,
  since container.restore() only resets Inversify bindings and would
  otherwise leave the method permanently spied across tests

Part of: eclipse-glsp/glsp#1635
- Convert leftover chai-style assertions (e.g. `expect(x).true;`) to
  real Vitest matchers (`toBe(true)`); after the Vitest migration these
  were silent no-ops that asserted nothing
- Remove the `*.spec` eslint overrides: the updated eslint-config
  enables core `no-unused-expressions` (which now catches such no-op
  assertions even in tests) and namespace checks pass cleanly, so both
  overrides are redundant

Also:
- Refresh pnpm-lock.yaml for the bumped @eclipse-glsp/eslint-config
- Drop the chai-friendly no-unused-expressions and spec-only
  import-x/namespace eslint overrides, both workarounds for the
  Mocha/chai/sinon era that Vitest no longer needs
- Remove the now-unused eslint-plugin-chai-friendly dependency
- Refactor changeCSSClass/changeCodiconClass to use classList.toggle
  so they no longer rely on the disabled rule
@tortmayr

tortmayr commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

More details on how the partial history has been extracted:

Summary

Merge three GLSP repos into one monorepo, keeping full per-file history
(author/date/message).

Import map:

  • glspdev-packages/
  • glsp-clientpackages/, examples/
  • glsp-server-nodepackages/, examples/

Tooling: git-filter-repo
(the tool the git project recommends over git filter-branch).

Method — per source repo:

  1. Extract: git filter-repo --path <dir>/ [...] on a fresh clone → keeps
    only the contributed paths, prunes now-empty commits, preserves
    author/date/message (SHAs change because the tree changes).
  2. Merge: fetch the filtered history into glsp-core, then
    git merge --allow-unrelated-histories <tip>. Disjoint subtrees ⇒ no
    conflicts; the merge's 2nd parent keeps the imported history reachable.

Result — branch 1682-initial-contribution: Initial commit + 3
two-parent import merges, no restructuring.

Source Extracted at Filtered tip Merge commit
glsp 5326104 4a06bfbb c5748278
glsp-client 33dd7c7 dca1b813 3a584699
glsp-server-node b7aa363 d0524393 797a0704

Verify: git log --follow -- <file>, git blame <file>,
git shortlog -sne 1682-initial-contribution.

ECA caveat: ~573 commits; GitHub's PR-commits API caps at 250, so the ECA
check sees only the newest 250. The older commits are not new contributions —
they were ECA-validated in their origin repos; this branch isolates the
imported history for direct review.

Executed command history

Source default branches: glsp and glsp-client use master,
glsp-server-node uses main.

# --- start from the existing glsp-core repo (already at the initial commit a0dd2915) ---
git clone https://github.com/eclipse-glsp/glsp-core.git
cd glsp-core

# === 1. glsp -> dev-packages/ ===
git clone https://github.com/eclipse-glsp/glsp.git ../glsp-filtered
git -C ../glsp-filtered filter-repo --path dev-packages/
git remote add glsp-dev ../glsp-filtered
git fetch glsp-dev
git merge --allow-unrelated-histories glsp-dev/master       # -> c5748278

# === 2. glsp-client -> packages/ + examples/ ===
git clone https://github.com/eclipse-glsp/glsp-client.git ../glsp-client-filtered
git -C ../glsp-client-filtered filter-repo --path packages/ --path examples/
git remote add glsp-client ../glsp-client-filtered
git fetch glsp-client
git merge --allow-unrelated-histories glsp-client/master    # -> 3a584699

# === 3. glsp-server-node -> packages/ + examples/ ===
git clone https://github.com/eclipse-glsp/glsp-server-node.git ../glsp-server-node-filtered
git -C ../glsp-server-node-filtered filter-repo --path packages/ --path examples/
git remote add glsp-server ../glsp-server-node-filtered
git fetch glsp-server
git merge --allow-unrelated-histories glsp-server/main      # -> 797a0704

# --- drop the temporary import remotes; mark the clean contribution ---
git remote remove glsp-dev
git remote remove glsp-client
git remote remove glsp-server
git branch 1682-initial-contribution                        # points at 797a0704

Exports render the diagram through the hidden viewer, so the hidden
bounds updater collected bounds and routing points for the export clone
but never cleaned them up. The stale entries leaked into the next
computedBounds action, causing 'Model element not found' server errors
when elements had been deleted in the meantime.

- Always reset collected bounds data and routing points in postUpdate,
  regardless of the rendering cause or errors during computation

Fixes eclipse-glsp/glsp#1717
@tortmayr
tortmayr force-pushed the 1682-initial-contribution branch from 797a070 to 1ecfdac Compare July 22, 2026 22:04
@tortmayr tortmayr closed this Aug 17, 2026
@tortmayr tortmayr reopened this Aug 17, 2026
martin-fleck-at and others added 13 commits August 25, 2026 15:51
…ied (#149)

A single unresolvable element in a ComputedBoundsAction aborted the whole
batch: the client had already measured every element, but one stale id threw
and the server dropped the remaining bounds, alignments and routes along with
the model update the client was waiting for.

- resolve elements via index.find / index.findByClass so an unknown id yields
  undefined instead of throwing
- report a route with fewer than two points as not applicable rather than as
  an error, a client may have nothing to report for an unmeasured edge yet
- log a skipped entry and still submit the model
- log skipped routes at debug, not warn, an edge the client has not finished
  routing is expected on the initial layout pass
- split the apply step into applyElementBounds, applyAlignments and
  applyRoutes so adopters can override one kind on its own
- leave applyRoutingPoints strict, an unknown id in
  ChangeRoutingPointsOperationHandler is a real error

applyRoute now returns GEdge | undefined; noted in the changelog under
potentially breaking changes.

Relates to eclipse-glsp/glsp#1727
Validation markers are established as client-side feedback and get a
random id from the client model index, so the server cannot resolve them
and rejects the entire computedBounds action.

- Mark GIssueMarker as feedback element so client-only elements can be
  told apart from what the server sent
- Skip feedback elements and their routes when answering a server
  RequestBoundsAction; local bounds requests still report them
- Reset collected bounds and routes when a new hidden rendering starts,
  as a failing view or vdom patch skips postUpdate and its cleanup
- Add specs for both leak paths, the interrupted rendering and the
  local request that keeps reporting markers

* Mark the dangling feedback edge as feedback element

The edge drawn while connecting is created from the adopter's own edge
type, so it was not recognizable as client-side feedback and its route
was reported to the server, which cannot resolve its id either.

- Enable feedbackFeature on the drawn edge so the bounds pass keeps its
  route out of server requests
- Add enableFeatures to the model utilities, which copies the feature
  set the element type shares with all its instances before extending it
- Cover the marking, the untouched shared feature set and the route
  filtering for both server and local requests

* Add changelog entries for the computed bounds fixes

- Record the export bounds leak fix, which shipped without an entry and
  is therefore missing from the 2.8.0 section
- Record keeping client-side feedback elements out of server bounds
  requests, including the new enableFeatures utility

* Mark all client-only elements as feedback and simplify the route filter

- Record the feedback flag while decorating so the route filter no longer
  re-resolves ids through the root index, which failed open on a miss
- Mark InsertIndicator and MarqueeNode through their DEFAULT_FEATURES, the
  way FeedbackEdgeEnd already does
- Mark added template elements and their children, so a ghost element
  subtree stays out of server-bound requests as well
- Build the extended feature set with createFeatureSet instead of
  hand-rolling the copy
- Cover the factory copy of a marked model, whose marking only survives
  because the factory takes over the features of the element it is handed
- Point the changelog entry at the pull request instead of the issue

* Treat a route with less than two points as a missing route

- Routers report an unroutable edge with an empty route, e.g. when an endpoint
  is not in the model or has no anchor yet, which the truthiness check on the
  calculated route let through
- Fall back to the source and target points instead, so the server no longer
  rejects an entire computedBounds action over a single degenerate route
- Element navigation now reads a defined first point where an empty route
  previously yielded undefined

* Make the per-element route of a hidden rendering overridable

- Route the collection through calcElementRoute so a subclass can substitute a
  route or leave an element out, instead of correcting the collected routes
  after the base class has pushed them
- Keep the feedback bookkeeping in decorate so an override cannot drop it
- Document skipping as the seam for an element whose geometry is not measured
  yet, where a router either declines or works from the placeholder size

* Apply prettier formatting to SECURITY.md

- Normalise the list markers the security-handbook template introduced, so
  format:check passes again

* Tighten the feedback marking and skip unroutable edges

- Mark the reconnect feedback edge of the edge-edit tool, which is built
  the same way as the dangling edge of the edge-creation tool and had its
  route reported to the server on reconnect
- Mark an issue marker where client-side validation creates it instead of
  in the constructor, which the registration overwrites right after it
  ran. Markers a server sends as part of the model keep reporting bounds
- Reference the collected hidden root weakly and drop it on clean up, so
  a finished rendering does not keep a copy of the whole model alive
- Skip a route of fewer than two points when collecting routes, instead
  of approximating it from the endpoint positions, which fabricated a
  route at the origin for an edge with an unresolvable endpoint
- Revert the fallback in calcElementAndRoute, an unroutable edge is the
  concern of the bounds pass alone. Applying such an entry leniently is
  tracked in eclipse-glsp/glsp#1727, where the node server part landed

Fixes eclipse-glsp/glsp#1725
Launching with port 0 lets the operating system pick a free port, but the
launcher kept both that port and the server socket to itself. An embedder that
needs to hand the port to a client, or to observe accepted connections, had to
parse the startup message off stdout or reach for the protected server field.

- add `listening`, a deferred that resolves with the bound address once the
  socket is up and rejects if it never gets there
- add `port`, a snapshot of the port currently bound, undefined while not
  listening
- add an `onConnection` event to the socket and websocket launchers, fired for
  every accepted socket before the JSON-RPC connection is built on it, so a
  listener can still see the client handshake
- arm a fresh deferred per run, so a settled promise is never handed to the
  next launch
- split the socket event handling into onListening, onError, failToListen and
  acceptConnection so adopters can override one step
- report a socket error through the logger before shutting down, it was
  previously discarded

Exposing this surfaced that a restarted launcher could not be shut down: the
launchers registered their cleanup in the constructor, but
DisposableCollection.dispose pops every entry it holds, so the first shutdown
emptied the collection and the second reported success while the server socket
stayed bound and the client sessions stayed alive.

- add a registerDisposables hook to GLSPServerLauncher, called once per launch,
  and move the netServer, websocket server and server-instance cleanup into it
- disposing a launcher that was never started is now a no-op instead of
  closing an undefined server

Details
- keep an unresolved `listening` promise across `resetListening`, so a caller
  that grabbed it before `start` is no longer handed an orphaned one that
  never settles
- close the HTTP server the websocket launcher mounts on, `ws` leaves a
  server it did not create itself listening, so every restart added another
- guard the websocket disposable against a shutdown that lands before
  `run` assigned the server, the throw aborted the whole dispose loop and
  silently skipped the server-instance cleanup
- bail out of `run` when a shutdown arrived while the options were still
  resolving, instead of binding a socket nobody closes
- lift `listening` and `port` to `JsonRpcGLSPServerLauncher`, both launchers
  sit on a `net.Server` so they share `net.AddressInfo`
- carry the upgrade request on the websocket `onConnection` payload, it is
  the only place its headers and query are still available
- rename `onListening` and `onError` to `handleListening` and `handleError`,
  so `onX` no longer means both an event and a handler
- drop the redundant rejection catch, the `Deferred` constructor already
  attaches one
- declare `netServer` optional, it really is undefined before the first
  launch
- construct the websocket server via the `WebSocketServer` export, `ws` only
  ships the `Server` alias from its CommonJS entry, so the old import was
  unresolvable from ESM
- cover the websocket launcher with a spec and share the port helpers with
  the socket one

Fixes eclipse-glsp/glsp#1729
Result-contract fixes
- Emit dispatchedCommands from the create-edges dry run so the SDK stops
  replacing the verdicts with an output-validation error
- Bind outputSchema and the success() payload to a shared O generic, so a
  handler declaring one shape and emitting another no longer compiles
- Report actual undo/redo counts by re-checking the command stack per
  iteration instead of echoing the requested count
- Count echoed identities rather than inputs when reporting how many
  nodes and edges were modified

Behaviour fixes
- Save to an explicit fileUri even when the command stack is clean, so
  save-as no longer no-ops
- Reject bounds changes on non-node elements and any change targeting the
  diagram root, both of which core silently drops or misapplies
- Surface an error for node and edge entries that request no change
  rather than counting them as modified
- Throw on unknown ids in validate-diagram and set-view instead of
  reporting an empty, clean-looking result
- Fall back to the first new element when the created type differs from
  the requested elementTypeId

Registration gating
- Add isSupportedByDiagramType(), evaluated per diagram type at harvest,
  and drop unsupported handlers before they reach the MCP catalog
- Gate layout on it so it is no longer advertised without a LayoutEngine
- Probe only handlers that declare the hook, keeping the harvest clear of
  unrelated @PostConstruct side effects
- Keep canRegister() for connected-client capability, which the harvest
  container cannot answer

Schema and doc fixes
- Add a shared elementIdsAllowingEmpty fragment for set-selection, and
  require integer undo and redo counts
- Describe modify-nodes positions as parent-relative and create-nodes
  positions as absolute
- Write the validate-diagram dedup separator as an escape rather than raw
  NUL bytes, which had git classifying the source file as binary
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Import the dev-packages subtree (cli, config, config-test, dev,
eslint-config, prettier-config, ts-config, vitest-config) from the
eclipse-glsp/glsp meta-repository, preserving the commit history scoped
to that subtree. Surrounding repo files (pnpm/workspace setup, CI,
metadata) are intentionally excluded and will be set up separately.

Part of eclipse-glsp/glsp#1682.
… subtree merge)

Import the packages (client, glsp-sprotty, protocol) and examples
(workflow-glsp, workflow-standalone) subtrees from eclipse-glsp/glsp-client,
preserving the commit history scoped to those subtrees. Surrounding repo
files (pnpm/workspace setup, CI, metadata) are intentionally excluded and
will be set up separately.

Part of eclipse-glsp/glsp#1682.
…rving subtree merge)

Import the packages (graph, layout-elk, server, server-mcp) and examples
(workflow-server and its bundled/mcp-demo variants) subtrees from
eclipse-glsp/glsp-server-node, preserving the commit history scoped to
those subtrees. Surrounding repo files (pnpm/workspace setup, CI,
metadata) are intentionally excluded and will be set up separately.

Part of eclipse-glsp/glsp#1682.
@tortmayr
tortmayr force-pushed the 1682-initial-contribution branch from 1ecfdac to 94754a9 Compare September 2, 2026 13:17
@tortmayr
tortmayr merged commit 94754a9 into main Sep 3, 2026
1 check passed
@tortmayr
tortmayr deleted the 1682-initial-contribution branch September 3, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants