Skip to content

Refactor toolkit registry - #132

Merged
windchargerj merged 5 commits into
devfrom
pr/refactor/toolkit-registry
Aug 18, 2026
Merged

Refactor toolkit registry#132
windchargerj merged 5 commits into
devfrom
pr/refactor/toolkit-registry

Conversation

@windchargerj

Copy link
Copy Markdown
Collaborator

Toolkit registrations and discovery results now have separate owners.

What Changed

  • Added ToolkitScanner for host discovery, executable lookup, version probing, latest successful scan snapshots, and per-host failures.
  • Added ToolkitRegistry for registered toolkits and the default toolkit. It refreshes matching entries by physical location, updates availability, restores backends, and serializes persisted state.
  • ToolkitManager now coalesces concurrent scans, cancels a project's scan when the project closes, and exposes project-aware visibleToolkits, registeredToolkits, and registeredToolkit queries.
  • Successful scans update metadata and availability but do not delete user registrations. Failed host scans retain the previous snapshot; failed version probes retain the executable but mark it unavailable.
  • Persisted state normalizes legacy local and WSL/SSH host IDs to backendId, removes duplicate registrations at the same physical location, and preserves the default toolkit where possible.
  • Settings, the project wizard, run configurations, build execution, and metadata consumers use the project-aware queries.
  • Toolkit selectors use a live model that preserves selection, displays availability, and safely refreshes an open JetBrains popup.
  • Removed the legacy global mutation APIs and ToolkitChangedNotifier.

The resulting state flow looks like this:

flowchart TB
    Hosts["Platform hosts"] --> Scanner["ToolkitScanner"]
    User["User registrations<br/>and default toolkit"] --> Registry["ToolkitRegistry"]

    Scanner -->|"latest scan snapshot"| Manager["ToolkitManager"]
    Registry -->|"registered state"| Manager
    Manager -->|"refresh by location<br/>and availability"| Registry

    Manager -->|"project-aware queries"| Consumers["Settings, wizard,<br/>run configurations, build,<br/>metadata actions"]
    Manager -->|"ToolkitListener"| Selectors["Live toolkit selectors"]
Loading

The scanner observes installed hosts and executables, the registry owns the user's registrations and default choice, and the manager combines both into the project-aware state consumed by actions and selectors.

Why

  • A registration represents a user choice; a scan represents an observation that can be incomplete or fail. Discovery should report the environment, not silently rewrite user configuration.
  • A complete executable scan can mark missing installations unavailable, while a transient host failure can retain the last known snapshot. This distinguishes a real environment change from a temporary probe failure.
  • SSH host visibility depends on project configuration and credentials, so toolkit availability cannot be represented by one global list.
  • Separating scanner, registry, and orchestration makes the state rules explicit: the scanner reports what exists, the registry owns user choices, and the manager coordinates updates and notifications.

Impact

Discovery updates availability without overwriting registrations. Consumers receive live, project-aware toolkit state while retaining the user's selection.

@windchargerj
windchargerj marked this pull request as ready for review August 18, 2026 02:34
Base automatically changed from pr/refactor/toolkit-host-identity to dev August 18, 2026 02:36
@windchargerj
windchargerj force-pushed the pr/refactor/toolkit-registry branch from 79ea912 to e9e6362 Compare August 18, 2026 02:36
@windchargerj
windchargerj merged commit cd5e712 into dev Aug 18, 2026
1 check passed
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.

1 participant