fix(plugins): load official hosted plugins from bundled resources
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { CodingPluginToolDefinition } from '../../../shared/coding-plugins';
|
||||
import type { CapabilityBillingReceiptV1 } from '../../../shared/data-service';
|
||||
import {
|
||||
type BundledHostedRelease,
|
||||
MarketplaceHostedAdmissionError,
|
||||
MarketplaceHostedAdmissionResolver,
|
||||
} from '../hosted-admission';
|
||||
@@ -62,6 +63,7 @@ export interface WebSearchPluginAdapterOptions {
|
||||
readonly marketplace?: MarketplacePackageClientPort;
|
||||
readonly packageStore?: Pick<PluginPackageStore, 'getInstalled' | 'getInstalledRelease'>;
|
||||
readonly makeloreVersion?: string;
|
||||
readonly bundledReleases?: Readonly<Record<string, BundledHostedRelease>>;
|
||||
readonly admissionResolver?: MarketplaceHostedAdmissionResolver;
|
||||
}
|
||||
|
||||
@@ -230,6 +232,7 @@ export class WebSearchPluginAdapter implements CodingPluginAdapter {
|
||||
marketplace: options.marketplace,
|
||||
packageStore: options.packageStore,
|
||||
makeloreVersion: options.makeloreVersion,
|
||||
bundledReleases: options.bundledReleases,
|
||||
});
|
||||
} else {
|
||||
throw new TypeError('Web Search adapter requires Marketplace admission dependencies');
|
||||
@@ -237,6 +240,7 @@ export class WebSearchPluginAdapter implements CodingPluginAdapter {
|
||||
}
|
||||
|
||||
async inspect(_projectPath: string): Promise<PluginBackendProjection> {
|
||||
if (this.options.bundledReleases?.[PLUGIN_ID]) return { status: 'ready' };
|
||||
const installed = await this.options.packageStore?.getInstalled(PLUGIN_ID).catch(() => null);
|
||||
return installed ? { status: 'ready' } : { status: 'unconfigured' };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user