test(plugins): include source external plugin contracts

This commit is contained in:
Peter Steinberger
2026-05-02 17:45:01 +01:00
parent a0d5372613
commit 4e312d9b0e

View File

@@ -69,31 +69,7 @@ function readJsonRecord(filePath: string): Record<string, unknown> | undefined {
}
}
function collectExcludedPackagedExtensionDirs(): ReadonlySet<string> {
const packageJson = readJsonRecord(path.join(OPENCLAW_PACKAGE_ROOT, "package.json"));
const files = packageJson?.files;
if (!Array.isArray(files)) {
return new Set();
}
const excluded = new Set<string>();
for (const entry of files) {
if (typeof entry !== "string") {
continue;
}
const match = /^!dist\/extensions\/([^/]+)\/\*\*$/u.exec(entry);
if (match?.[1]) {
excluded.add(match[1]);
}
}
return excluded;
}
const EXCLUDED_PACKAGED_EXTENSION_DIRS = collectExcludedPackagedExtensionDirs();
function readBundledCapabilityManifest(pluginDir: string): BundledCapabilityManifest | undefined {
if (EXCLUDED_PACKAGED_EXTENSION_DIRS.has(path.basename(pluginDir))) {
return undefined;
}
const packageJson = readJsonRecord(path.join(pluginDir, "package.json"));
const packageManifest = getPackageManifestMetadata(packageJson as PackageManifest);
const extensions = normalizeBundledPluginStringList(packageManifest?.extensions);