import { CancellationToken } from "../../../../../base/common/cancellation.js"; import { URI } from "../../../../../sessions/sessions.web.main.internal.js"; import { IMarketplaceReference } from "./marketplaceReference.js"; import { IInstallPluginFromSourceOptions, IInstallPluginFromSourceResult, IUpdateAllPluginsOptions, IUpdateAllPluginsResult } from "./pluginInstallService.js"; import { IMarketplacePlugin } from "./pluginMarketplaceService.js"; export declare const IPluginInstallService: import("../../../../../platform/instantiation/common/instantiation.js").ServiceIdentifier; export interface IPluginInstallService { readonly _serviceBrand: undefined; /** * Clones the marketplace repository (if not already cached) and registers * the plugin in the marketplace service's installed plugins storage. */ installPlugin(plugin: IMarketplacePlugin, token?: CancellationToken): Promise; /** Validates policy and obtains user trust for a marketplace before installing from it. */ ensureMarketplaceTrusted(reference: IMarketplaceReference, token?: CancellationToken): Promise; /** * Removes the exact installed plugin entry and performs best-effort source cleanup. * Returns `false` when no installed entry matches the URI. */ uninstallPlugin(pluginUri: URI): Promise; /** * Installs a plugin directly from a source location string. Accepts * GitHub shorthand (`owner/repo`), a full git clone URL, or a local * folder path (`file://` URI, absolute path, or `~`-prefixed path). * For git sources, clones the repository, reads marketplace metadata to * discover plugins, and registers the selected plugin. For local folders, * detects whether the folder is a marketplace or a standalone plugin and * registers it under the appropriate configuration. * An explicit `path` installs only the standalone or marketplace-declared plugin in that repository subdirectory. * * Returns a result with an optional error message (e.g. invalid source or * no plugins found); callers are responsible for surfacing it. When * {@link IInstallPluginFromSourceOptions.plugin} is set, targets a specific * plugin, installs it, and returns it in * {@link IInstallPluginFromSourceResult.matchedPlugin}. */ installPluginFromSource(source: string, options?: IInstallPluginFromSourceOptions): Promise; /** * Synchronously validates the format of a plugin source string. * Returns an error message if the format is invalid, or undefined if valid. */ validatePluginSource(source: string): string | undefined; /** * Updates an installed plugin and replaces its installed URI when the source location changes. */ updatePlugin(plugin: IMarketplacePlugin, silent?: boolean, token?: CancellationToken): Promise; /** * Updates all installed plugins. First pulls each unique marketplace * repository, then updates non-relative-path plugins individually * (git pull, npm install, pip install, etc.). Git sources are refreshed * even when their source descriptors have not changed. */ updateAllPlugins(options: IUpdateAllPluginsOptions, token: CancellationToken): Promise; /** * Returns the URI where a marketplace plugin would be installed on disk. * Used to determine whether a marketplace plugin is already installed. */ getPluginInstallUri(plugin: IMarketplacePlugin): URI; }