From ffe84a9f173c71bbb3cbe24ba41061e17f83512d Mon Sep 17 00:00:00 2001 From: Brian Madison Date: Thu, 9 Apr 2026 08:51:57 -0500 Subject: [PATCH] fix(installer): pass version and repoUrl to manifest for custom plugins installFromResolution was passing empty strings for version and repoUrl, which the manifest stores as null. Now threads the repo URL from ui.js through resolvePlugin into each ResolvedModule, and passes the plugin version and URL to the manifest correctly. --- tools/installer/modules/custom-module-manager.js | 6 ++++-- tools/installer/modules/official-modules.js | 8 ++++---- tools/installer/ui.js | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/tools/installer/modules/custom-module-manager.js b/tools/installer/modules/custom-module-manager.js index 5e5766ee2..84b250931 100644 --- a/tools/installer/modules/custom-module-manager.js +++ b/tools/installer/modules/custom-module-manager.js @@ -188,15 +188,17 @@ class CustomModuleManager { * Results are cached in _resolutionCache keyed by module code. * @param {string} repoPath - Absolute path to the cloned repository * @param {Object} plugin - Raw plugin object from marketplace.json + * @param {string} [repoUrl] - Original GitHub URL for manifest tracking * @returns {Promise>} Array of ResolvedModule objects */ - async resolvePlugin(repoPath, plugin) { + async resolvePlugin(repoPath, plugin, repoUrl) { const { PluginResolver } = require('./plugin-resolver'); const resolver = new PluginResolver(); const resolved = await resolver.resolve(repoPath, plugin); - // Cache each resolved module by its code for lookup during install + // Stamp repo URL onto each resolved module for manifest tracking for (const mod of resolved) { + if (repoUrl) mod.repoUrl = repoUrl; CustomModuleManager._resolutionCache.set(mod.code, mod); } diff --git a/tools/installer/modules/official-modules.js b/tools/installer/modules/official-modules.js index a203dd85d..2e18c1a15 100644 --- a/tools/installer/modules/official-modules.js +++ b/tools/installer/modules/official-modules.js @@ -336,10 +336,10 @@ class OfficialModules { const manifestObj = new Manifest(); await manifestObj.addModule(bmadDir, resolved.code, { - version: resolved.version || '', - source: `custom:${resolved.pluginName}`, - npmPackage: '', - repoUrl: '', + version: resolved.version || null, + source: 'custom', + npmPackage: null, + repoUrl: resolved.repoUrl || null, }); return { success: true, module: resolved.code, path: targetPath, versionInfo: { version: resolved.version || '' } }; diff --git a/tools/installer/ui.js b/tools/installer/ui.js index 75b704f64..9908a462f 100644 --- a/tools/installer/ui.js +++ b/tools/installer/ui.js @@ -881,7 +881,7 @@ class UI { const allResolved = []; for (const plugin of plugins) { try { - const resolved = await customMgr.resolvePlugin(repoPath, plugin.rawPlugin); + const resolved = await customMgr.resolvePlugin(repoPath, plugin.rawPlugin, url.trim()); if (resolved.length > 0) { allResolved.push(...resolved); } else {