@@ -20,6 +20,26 @@ const distExtensionsRoot = path.join(packageRoot, "dist", "extensions");
|
20 | 20 | const excludedPackageExtensionDirs = collectRootPackageExcludedExtensionDirs({ cwd: packageRoot }); |
21 | 21 | const installedLayoutEnv = "OPENCLAW_BUNDLED_CHANNEL_SMOKE_INSTALLED_LAYOUT"; |
22 | 22 | |
| 23 | +function collectExcludedDistExtensionIds() { |
| 24 | +const packageJsonPath = path.join(packageRoot, "package.json"); |
| 25 | +if (!fs.existsSync(packageJsonPath)) { |
| 26 | +return new Set(); |
| 27 | +} |
| 28 | +const packageJson = readJson(packageJsonPath); |
| 29 | +const files = Array.isArray(packageJson.files) ? packageJson.files : []; |
| 30 | +const excludedIds = new Set(); |
| 31 | +for (const entry of files) { |
| 32 | +if (typeof entry !== "string") { |
| 33 | +continue; |
| 34 | +} |
| 35 | +const match = /^!dist\/extensions\/([^/*]+)\/\*\*$/u.exec(entry.replaceAll("\\", "/")); |
| 36 | +if (match) { |
| 37 | +excludedIds.add(match[1]); |
| 38 | +} |
| 39 | +} |
| 40 | +return excludedIds; |
| 41 | +} |
| 42 | + |
23 | 43 | function packageRootLooksInstalled(root) { |
24 | 44 | return root.replaceAll("\\", "/").endsWith("/node_modules/openclaw"); |
25 | 45 | } |
@@ -71,10 +91,14 @@ function extensionEntryToDistFilename(entry) {
|
71 | 91 | |
72 | 92 | function collectBundledChannelEntryFiles() { |
73 | 93 | const files = []; |
| 94 | +const excludedDistExtensionIds = collectExcludedDistExtensionIds(); |
74 | 95 | for (const dirent of fs.readdirSync(distExtensionsRoot, { withFileTypes: true })) { |
75 | 96 | if (!dirent.isDirectory()) { |
76 | 97 | continue; |
77 | 98 | } |
| 99 | +if (excludedDistExtensionIds.has(dirent.name)) { |
| 100 | +continue; |
| 101 | +} |
78 | 102 | const extensionRoot = path.join(distExtensionsRoot, dirent.name); |
79 | 103 | const packageJsonPath = path.join(extensionRoot, "package.json"); |
80 | 104 | if (!fs.existsSync(packageJsonPath)) { |
|