fix(plugins): load official hosted plugins from bundled resources

This commit is contained in:
2026-09-01 18:20:24 +08:00
parent 52e2a97a12
commit 1530ac7740
23 changed files with 835 additions and 48 deletions

View File

@@ -621,8 +621,12 @@ export async function verifyBundledCodingPluginResources({
}
const sdkAssetPaths = packageFiles.filter((file) => SDK_ASSET_PATH_PATTERN.test(file));
if (sdkAssetPaths.length === 0) throw new Error(`Packaged coding plugin has no SDK assets: ${packageName}`);
const adapterId = packagedCapability.adapterId;
if (packagedCapability.schemaVersion === 1 && sdkAssetPaths.length === 0) {
throw new Error(`Packaged schema-1 coding plugin has no SDK assets: ${packageName}`);
}
const adapterId = packagedCapability.schemaVersion === 2
? packagedCapability.pluginId
: packagedCapability.adapterId;
const tools = Array.isArray(packagedCapability.tools) ? packagedCapability.tools : [];
const toolNames = tools.map((tool) => tool?.name);
if (typeof adapterId !== 'string' || adapterId.length === 0 || tools.length === 0