Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 18, 2026

Implements plugin upgrade system supporting JavaScript, Lua, Python, WASM, and external executables with version-range compatibility checking and selective upgrade control.

Architecture

Models

  • PluginInfo - Plugin metadata with MinClientVersion/MaxClientVersion compatibility bounds
  • PluginType enum - Five plugin types (JS=1, Lua=2, Python=3, WASM=4, ExternalExecutable=5)
  • PluginRespDTO - Server response wrapper
  • Extended AppType with Plugin = 3 constant

Services

  • PluginCompatibilityChecker - Static version validation with semantic versioning
  • PluginUpdateService - Plugin retrieval, filtering, and mandatory/optional separation
  • VersionService.ValidatePlugins() - HTTP endpoint integration

Client API

  • PluginBootstrapExtensions - Four extension methods on GeneralClientBootstrap:
    • GetAvailablePluginUpdatesAsync() - Fetch compatible plugins for current client version
    • SelectPluginsForUpgrade() - User-controlled selection (VS Code pattern)
    • GetRequiredPluginUpdatesForClientUpgradeAsync() - Auto-determine minimum versions for target client
    • ValidatePluginCompatibilityForUpgrade() - Pre-flight compatibility check

Usage

// Configure plugin endpoint
var config = new Configinfo {
    PluginUpdateUrl = "https://api.example.com/plugins",
    ClientVersion = "1.0.0",
    // ... existing config
};

// Get compatible plugins
var available = await PluginBootstrapExtensions.GetAvailablePluginUpdatesAsync(
    globalConfig, PlatformType.Windows);

// User selects subset (mandatory plugins auto-included)
var selected = PluginBootstrapExtensions.SelectPluginsForUpgrade(
    available, userSelectedIds);

// Before client upgrade to 2.0.0, check plugin compatibility
var required = await PluginBootstrapExtensions.GetRequiredPluginUpdatesForClientUpgradeAsync(
    globalConfig, "2.0.0", platform, currentPluginVersions);

Server Contract

POST /plugins with ClientVersion, Platform, optional PluginId returns:

{
  "code": 200,
  "body": [{
    "pluginId": "js-plugin-1",
    "version": "1.2.0",
    "pluginType": 1,
    "minClientVersion": "1.0.0",
    "maxClientVersion": "2.0.0",
    "url": "https://cdn.example.com/plugin.zip",
    "isMandatory": false
  }]
}

Implementation Notes

  • Projects using linked source files (ClientCore, Core, Bowl) required explicit file references in .csproj
  • Error handling swallows exceptions to prevent upgrade failures from blocking app launch
  • Lists initialized to empty collections in GlobalConfigInfo for null safety
  • Backward compatible - no changes to existing update flow
Original prompt

This section details on the original issue you should resolve

<issue_title>[FEATURE] Plugin Upgrade Functionality</issue_title>
<issue_description>### Feature Description

1.There are several plugins in the client, each with its own version. The plugins are in the form of JS/Lua/Python (embedded script engine), WASM, or "external executable program + protocol".
2.The client has its own version, and there is a clear range of plugin versions that the client can adapt to. If a plugin version is higher or lower than the adaptable range of the current client version, it will cause the client to run abnormally.
3.It is necessary to allow users to decide whether to upgrade each plugin to a specified version, just like in VS Code.
4.When the client initiates an upgrade request, it automatically matches the minimum supported plugin version corresponding to the latest client version.

Operating System Version (Optional)

No response

CPU Instruction Set Architecture (Optional)

No response</issue_description>

<agent_instructions>Thoroughly understand the existing code of GeneralUpdate, and on this basis, implement the features mentioned in Issue #105.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits January 18, 2026 16:47
Co-authored-by: JusterZhu <11714536+JusterZhu@users.noreply.github.com>
Co-authored-by: JusterZhu <11714536+JusterZhu@users.noreply.github.com>
Co-authored-by: JusterZhu <11714536+JusterZhu@users.noreply.github.com>
…ents

Co-authored-by: JusterZhu <11714536+JusterZhu@users.noreply.github.com>
Copilot AI changed the title [WIP] Add plugin upgrade functionality for client versioning Add plugin upgrade functionality with version compatibility management Jan 18, 2026
Copilot AI requested a review from JusterZhu January 18, 2026 17:03
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.

[FEATURE] Plugin Upgrade Functionality

2 participants