import type { PluginInfo } from '../protocol/common.js'; /** Plugin installation scopes that can be changed through the CLI. */ export type PluginScope = 'user' | 'project' | 'local'; export type PluginToggleOptions = { /** Directory used to resolve project and local plugin state. */ cwd?: string; /** Omit to let qodercli infer the installed plugin's scope. */ scope?: PluginScope; /** Optional qodercli executable or qoder Worker runtime entry override. */ cliPath?: string; env?: Record; }; export type PluginResources = { skills: { name: string; description?: string; argumentHint?: string; }[]; agents: { name: string; description?: string; color?: string; }[]; mcpServers: { name: string; description?: string; type?: string; }[]; commands: { name: string; description?: string; argumentHint?: string; }[]; hooks: { event: string; matcher?: string; type: string; }[]; }; export type PluginDetails = PluginInfo & { id: string; source: string; version: string; scope: string; enabled: boolean; canDisable: boolean; displayName?: string; description?: string; installedAt?: string; lastUpdated?: string; resources: PluginResources; }; export type InstallPluginResult = { pluginId: string; version: string; path: string; }; export type UninstallPluginResult = { pluginId: string; fullyRemoved: boolean; reverseDependents: string[]; }; export type PluginValidationSeverity = 'error' | 'warning'; export type PluginValidationPhase = 'target' | 'manifest' | 'component' | 'load-simulation' | 'installability'; export type PluginValidationPosition = { line: number; character: number; }; export type PluginValidationLocation = { path: string; jsonPointer?: string; range?: { start: PluginValidationPosition; end: PluginValidationPosition; }; }; export type PluginValidationDiagnostic = { severity: PluginValidationSeverity; code: string; message: string; phase: PluginValidationPhase; location?: PluginValidationLocation; suggestion?: string; }; export type PluginValidationReport = { schemaVersion: 1; validator: { name: 'qodercli'; version: string; }; valid: boolean; target: { inputPath: string; resolvedPath: string; manifestPath?: string; }; plugin?: { name: string; version?: string; displayName?: string; }; diagnostics: PluginValidationDiagnostic[]; summary: { errorCount: number; warningCount: number; componentCount: number; }; resources?: PluginResources; }; export type ValidatePluginOptions = { /** Optional qodercli executable or qoder Worker runtime entry override. */ cliPath?: string; env?: Record; signal?: AbortSignal; };