426
427
async fetchMarketplacePlugins(token: CancellationToken): Promise<IMarketplacePlugin[]> {
429
return [];
430
}
432
>
// Effective set: user-facing `chat.plugins.marketplaces` (default + user)
433
>
// unioned with the enterprise policy-only `chat.plugins.extraMarketplaces`.
434
>
// `parseMarketplaceReferences` dedupes by canonical id.
435
>
const { effectiveValues } = readConfiguredMarketplaces(this._configurationService);
436
>
const configRefs = parseMarketplaceReferences(effectiveValues);
437
>
438
>
// Merge marketplace references from Claude workspace settings.
439
>
// Workspace-defined refs take precedence (are primary) so that their
440
>
// displayLabel overrides any matching global marketplace entry.
441
>
// Only include workspace-sourced refs when the workspace is trusted.
442
>
let allRefs: IMarketplaceReference[];
443
>
if (this._workspaceTrustService.isWorkspaceTrusted()) {
444
>
const workspaceEntries = this._workspacePluginSettingsService.extraMarketplaces.get();
445
>
allRefs = deduplicateMarketplaceReferences(workspaceEntries.map(e => e.reference), configRefs);
446
>
} else {
447
allRefs = configRefs;
448
}
450
>
for (const value of effectiveValues) {
451
>
const parsed = typeof value === 'string'
452
>
? parseMarketplaceReference(value)
453
: (value && typeof value === 'object' ? parseMarketplaceObjectEntry(value as Parameters<typeof parseMarketplaceObjectEntry>[0]) : undefined);
455
this._logService.debug(`[PluginMarketplaceService] Ignoring invalid marketplace entry: ${String(value)}`);
456
}
458
>
459
>
const results = await Promise.all(
460
>
allRefs.map(ref => {
461
>
if (ref.kind === MarketplaceReferenceKind.GitHubShorthand && ref.githubRepo) {
462
>
return this._fetchFromGitHubRepo(ref, ref.githubRepo, token);
463
>
}
464
return this._fetchFromClonedRepo(ref, token);
466
>
);
467
>
const plugins = results.flat();
468
>
this._lastFetchedPluginsStore.set({ plugins, fetchedAt: Date.now() }, undefined);
469
>
return plugins;
470
>
}
471
472
private async _fetchFromGitHubRepo(reference: IMarketplaceReference, repo: string, token: CancellationToken): Promise<IMarketplacePlugin[]> {