import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri"; import { ICommandService } from "@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service"; import { IDialogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service"; import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service"; import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service"; import { INotificationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service"; import { IProgressService } from "@codingame/monaco-vscode-api/vscode/vs/platform/progress/common/progress.service"; import { ITerminalService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service"; import { IEnsureRepositoryOptions, IPullRepositoryOptions } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/agentPluginRepositoryService"; import { IMarketplacePlugin, IPluginSourceDescriptor, PluginSourceKind } from "../common/plugins/pluginMarketplaceService.js"; import { IPluginSource } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/pluginSource"; import { IPluginGitService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/pluginGitService.service"; declare abstract class AbstractGitPluginSource implements IPluginSource { protected readonly _commandService: ICommandService; protected readonly _fileService: IFileService; protected readonly _logService: ILogService; protected readonly _notificationService: INotificationService; protected readonly _pluginGit: IPluginGitService; protected readonly _progressService: IProgressService; abstract readonly kind: PluginSourceKind; constructor(_commandService: ICommandService, _fileService: IFileService, _logService: ILogService, _notificationService: INotificationService, _pluginGit: IPluginGitService, _progressService: IProgressService); abstract getInstallUri(cacheRoot: URI, descriptor: IPluginSourceDescriptor): URI; abstract getLabel(descriptor: IPluginSourceDescriptor): string; protected abstract _cloneUrl(descriptor: IPluginSourceDescriptor): string; protected abstract _displayLabel(descriptor: IPluginSourceDescriptor): string; getCleanupTarget(cacheRoot: URI, descriptor: IPluginSourceDescriptor): URI | undefined; /** * Returns the on-disk directory of the cloned repository. Subclasses that * support a sub-path within a repository should override this to return the * repository root, while {@link getInstallUri} returns root + sub-path. */ protected _getRepoDir(cacheRoot: URI, descriptor: IPluginSourceDescriptor): URI; ensure(cacheRoot: URI, plugin: IMarketplacePlugin, options?: IEnsureRepositoryOptions): Promise; update(cacheRoot: URI, plugin: IMarketplacePlugin, options?: IPullRepositoryOptions): Promise; private _cloneRepository; private _checkoutRevision; } export declare class RelativePathPluginSource implements IPluginSource { readonly kind = PluginSourceKind.RelativePath; getInstallUri(_cacheRoot: URI, _descriptor: IPluginSourceDescriptor): URI; ensure(_cacheRoot: URI, _plugin: IMarketplacePlugin, _options?: IEnsureRepositoryOptions): Promise; update(_cacheRoot: URI, _plugin: IMarketplacePlugin, _options?: IPullRepositoryOptions): Promise; getCleanupTarget(_cacheRoot: URI, _descriptor: IPluginSourceDescriptor): URI | undefined; getLabel(descriptor: IPluginSourceDescriptor): string; } export declare class GitHubPluginSource extends AbstractGitPluginSource { readonly kind = PluginSourceKind.GitHub; /** Returns the URI where the plugin content lives (repo root + optional sub-path). */ getInstallUri(cacheRoot: URI, descriptor: IPluginSourceDescriptor): URI; /** Returns the cloned repository root (without sub-path). */ protected _getRepoDir(cacheRoot: URI, descriptor: IPluginSourceDescriptor): URI; getLabel(descriptor: IPluginSourceDescriptor): string; protected _cloneUrl(descriptor: IPluginSourceDescriptor): string; protected _displayLabel(descriptor: IPluginSourceDescriptor): string; } export declare class GitUrlPluginSource extends AbstractGitPluginSource { readonly kind = PluginSourceKind.GitUrl; getInstallUri(cacheRoot: URI, descriptor: IPluginSourceDescriptor): URI; getLabel(descriptor: IPluginSourceDescriptor): string; protected _cloneUrl(descriptor: IPluginSourceDescriptor): string; protected _displayLabel(descriptor: IPluginSourceDescriptor): string; private _gitUrlCacheSegments; } export declare abstract class AbstractPackagePluginSource implements IPluginSource { protected readonly _dialogService: IDialogService; protected readonly _fileService: IFileService; protected readonly _logService: ILogService; protected readonly _notificationService: INotificationService; protected readonly _progressService: IProgressService; protected readonly _terminalService: ITerminalService; abstract readonly kind: PluginSourceKind; constructor(_dialogService: IDialogService, _fileService: IFileService, _logService: ILogService, _notificationService: INotificationService, _progressService: IProgressService, _terminalService: ITerminalService); abstract getInstallUri(cacheRoot: URI, descriptor: IPluginSourceDescriptor): URI; abstract getLabel(descriptor: IPluginSourceDescriptor): string; getCleanupTarget(cacheRoot: URI, descriptor: IPluginSourceDescriptor): URI | undefined; /** * Return the parent directory (prefix / target) where the package * manager installs into. This is above the actual plugin content dir. */ protected abstract _getCacheDir(cacheRoot: URI, descriptor: IPluginSourceDescriptor): URI; /** Build the terminal command args for install. */ protected abstract _buildInstallArgs(installDir: URI, plugin: IMarketplacePlugin): string[]; /** Human-readable package manager name for messages. */ protected abstract get _managerName(): string; ensure(cacheRoot: URI, plugin: IMarketplacePlugin, _options?: IEnsureRepositoryOptions): Promise; update(cacheRoot: URI, plugin: IMarketplacePlugin, _options?: IPullRepositoryOptions): Promise; runInstall(installDir: URI, pluginDir: URI, plugin: IMarketplacePlugin, options?: { silent?: boolean; }): Promise<{ pluginDir: URI; } | undefined>; private _confirmTerminalCommand; private _runTerminalCommand; private _waitForTerminalCommandCompletion; } export declare class NpmPluginSource extends AbstractPackagePluginSource { readonly kind = PluginSourceKind.Npm; protected readonly _managerName = "npm"; getInstallUri(cacheRoot: URI, descriptor: IPluginSourceDescriptor): URI; getLabel(descriptor: IPluginSourceDescriptor): string; protected _getCacheDir(cacheRoot: URI, descriptor: IPluginSourceDescriptor): URI; protected _buildInstallArgs(installDir: URI, plugin: IMarketplacePlugin): string[]; } export declare class PipPluginSource extends AbstractPackagePluginSource { readonly kind = PluginSourceKind.Pip; protected readonly _managerName = "pip"; getInstallUri(cacheRoot: URI, descriptor: IPluginSourceDescriptor): URI; getLabel(descriptor: IPluginSourceDescriptor): string; protected _getCacheDir(cacheRoot: URI, descriptor: IPluginSourceDescriptor): URI; protected _buildInstallArgs(installDir: URI, plugin: IMarketplacePlugin): string[]; } export {};