allagents 0.8.2 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +28 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -22743,26 +22743,42 @@ async function resolvePluginSpec(spec, options2 = {}) {
|
|
|
22743
22743
|
return null;
|
|
22744
22744
|
}
|
|
22745
22745
|
const marketplaceName = options2.marketplaceNameOverride ?? parsed.marketplaceName;
|
|
22746
|
-
|
|
22747
|
-
if (!
|
|
22748
|
-
|
|
22746
|
+
let marketplacePath = options2.marketplacePathOverride ?? null;
|
|
22747
|
+
if (!marketplacePath) {
|
|
22748
|
+
const marketplace = await getMarketplace(marketplaceName);
|
|
22749
|
+
if (!marketplace) {
|
|
22750
|
+
return null;
|
|
22751
|
+
}
|
|
22752
|
+
marketplacePath = marketplace.path;
|
|
22749
22753
|
}
|
|
22750
|
-
const manifestResult = await parseMarketplaceManifest(
|
|
22754
|
+
const manifestResult = await parseMarketplaceManifest(marketplacePath);
|
|
22751
22755
|
if (manifestResult.success) {
|
|
22752
22756
|
const pluginEntry = manifestResult.data.plugins.find((p) => p.name === parsed.plugin);
|
|
22753
22757
|
if (pluginEntry) {
|
|
22754
|
-
|
|
22755
|
-
|
|
22756
|
-
|
|
22757
|
-
|
|
22758
|
-
|
|
22759
|
-
|
|
22760
|
-
|
|
22758
|
+
if (typeof pluginEntry.source === "string") {
|
|
22759
|
+
const resolvedPath = resolve4(marketplacePath, pluginEntry.source);
|
|
22760
|
+
if (existsSync5(resolvedPath)) {
|
|
22761
|
+
return {
|
|
22762
|
+
path: resolvedPath,
|
|
22763
|
+
marketplace: marketplaceName,
|
|
22764
|
+
plugin: parsed.plugin
|
|
22765
|
+
};
|
|
22766
|
+
}
|
|
22767
|
+
} else {
|
|
22768
|
+
const fetchFn = options2.fetchFn ?? fetchPlugin;
|
|
22769
|
+
const fetchResult = await fetchFn(pluginEntry.source.url);
|
|
22770
|
+
if (fetchResult.success && fetchResult.cachePath) {
|
|
22771
|
+
return {
|
|
22772
|
+
path: fetchResult.cachePath,
|
|
22773
|
+
marketplace: marketplaceName,
|
|
22774
|
+
plugin: parsed.plugin
|
|
22775
|
+
};
|
|
22776
|
+
}
|
|
22761
22777
|
}
|
|
22762
22778
|
}
|
|
22763
22779
|
}
|
|
22764
22780
|
const subpath = options2.subpath ?? parsed.subpath ?? "plugins";
|
|
22765
|
-
const pluginPath = join6(
|
|
22781
|
+
const pluginPath = join6(marketplacePath, subpath, parsed.plugin);
|
|
22766
22782
|
if (!existsSync5(pluginPath)) {
|
|
22767
22783
|
return null;
|
|
22768
22784
|
}
|