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 {