pluginMarketplaceService.ts ×11

Frontier kind: Code frontier

unlabeled · c_2badb4332b0a

14 tests · 30686 LOC · 156 files · introduces 0 tests · 85 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
11 ranges85 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
3156 ranges30686 lines · 156 files · Browse complete extent
All tests (intent)
14 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 85 introduced LOC across 11 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.ts 85 introduced LOC · 11 ranges

Open complete file

313
314 constructor(
315 > @IConfigurationService private readonly _configurationService: IConfigurationService, pluginMarketplaceService.ts
316 > @IRequestService private readonly _requestService: IRequestService,
317 > @IEnvironmentService environmentService: IEnvironmentService,
318 > @IFileService private readonly _fileService: IFileService,
319 > @IAgentPluginRepositoryService private readonly _pluginRepositoryService: IAgentPluginRepositoryService,
320 > @ILogService private readonly _logService: ILogService,
321 > @IStorageService private readonly _storageService: IStorageService,
322 > @IWorkspacePluginSettingsService private readonly _workspacePluginSettingsService: IWorkspacePluginSettingsService,
323 > @IWorkspaceTrustManagementService private readonly _workspaceTrustService: IWorkspaceTrustManagementService,
324 > @IExtensionsWorkbenchService private readonly _extensionsWorkbenchService: IExtensionsWorkbenchService,
325 > ) {
326 > super();
327 >
328 > // File-backed store for installed plugins. The old cache location
329 > // is passed so the store can rebase URIs during migration.
330 > const oldCacheRoot = joinPath(environmentService.cacheHome, 'agentPlugins');
331 > this._installedPluginsStore = this._register(
332 > new FileBackedInstalledPluginsStore(
333 > _pluginRepositoryService.agentPluginsHome,
334 > oldCacheRoot,
335 > _fileService,
336 > _logService,
337 > _storageService,
338 > )
339 > );
340 >
341 > this._trustedMarketplacesStore = this._register(
342 > trustedMarketplacesMemento(StorageScope.APPLICATION, StorageTarget.MACHINE, _storageService)
343 > );
344 >
345 > this._lastFetchedPluginsStore = this._register(
346 > lastFetchedPluginsMemento(StorageScope.APPLICATION, StorageTarget.MACHINE, _storageService)
347 > );
348 >
349 > this.lastFetchedPlugins = this._lastFetchedPluginsStore.map(s => {
350 const revived = revive(s) as IStoredLastFetchedPlugins;
351 return revived.plugins.map(ensureSourceDescriptor);
353 >
354 > this.installedPlugins = this._installedPluginsStore.value.map(entries => {
355 const result: IMarketplaceInstalledPlugin[] = [];
356 for (const e of entries) {
361 }
362 return result;
364 >
365 > // Aggregate recommended plugin keys from all providers.
366 > // Currently sourced from Claude workspace settings; more providers can be
367 > // added here via additional observables in the derived computation.
368 > // Only expose recommendations when the workspace is trusted.
369 > const workspaceTrusted = observableFromEvent(this, this._workspaceTrustService.onDidChangeTrust, () => this._workspaceTrustService.isWorkspaceTrusted());
370 > this.recommendedPlugins = derived(reader => {
371 if (!workspaceTrusted.read(reader)) {
372 return new Set<string>();
380 }
381 return keys;
383 >
384 > this.onDidChangeMarketplaces = Event.any(
385 > Event.filter(
386 > _configurationService.onDidChangeConfiguration,
387 > e => e.affectsConfiguration(ChatConfiguration.PluginsEnabled) || e.affectsConfiguration(ChatConfiguration.PluginMarketplaces) || e.affectsConfiguration(ChatConfiguration.ExtraMarketplaces),
388 > ) as Event<unknown> as Event<void>,
389 > Event.fromObservableLight(this._workspacePluginSettingsService.extraMarketplaces),
390 > Event.map(this._workspaceTrustService.onDidChangeTrust, () => { }),
391 > );
392 >
393 > this._register(runWhenGlobalIdle(() => {
394 > // Schedule periodic update checks when auto-update is enabled.
395 > this._scheduleUpdateCheck();
396 > this._register(Event.filter(
397 > _configurationService.onDidChangeConfiguration,
398 > e => e.affectsConfiguration(AutoUpdateConfigurationKey),
399 > )(() => this._scheduleUpdateCheck()));
400 > }));
401 >
402 > // Hydrate plugin metadata for installed entries that are not yet in
403 > // the in-memory cache (e.g. after restart when installed.json is read
404 > // but the metadata map is empty). Modern entries match by plugin name;
405 > // older entries without names fall back to matching by install URI.
406 > this._register(autorun(reader => {
407 > const entries = this._installedPluginsStore.value.read(reader);
408 > const unhydrated = entries.filter(e => !this._pluginMetadata.has(e.pluginUri.toString()));
409 > if (unhydrated.length > 0) {
410 this._hydratePluginMetadata(unhydrated);
411 }
413 > }
414
415 override dispose(): void {
416 > if (this._updateCheckTimer !== undefined) { pluginMarketplaceService.ts
417 clearTimeout(this._updateCheckTimer);
418 this._updateCheckTimer = undefined;
419 }
420 > super.dispose(); pluginMarketplaceService.ts
421 > }
422
423 clearUpdatesAvailable(): void {
762
763 private _isAutoUpdateEnabled(): boolean {
764 > return this._extensionsWorkbenchService.getAutoUpdateValue() !== 'off'; pluginMarketplaceService.ts
765 > }
766
767 /**
770 */
771 private _scheduleUpdateCheck(): void {
772 > if (this._updateCheckTimer !== undefined) { pluginMarketplaceService.ts
773 clearTimeout(this._updateCheckTimer);
774 this._updateCheckTimer = undefined;
775 }
777 > if (!this._isAutoUpdateEnabled()) {
778 return;
779 }
788
789 this._updateCheckTimer = setTimeout(() => this._runUpdateCheck(), delay);
791
792 private async _runUpdateCheck(): Promise<void> {