import type { StorageProvider } from '../storage/index.js'; import { type CopilotPluginRequirements, type PluginMcpMetadata, type PluginComponentKind, type PluginFileDeployment, type PluginProviderContract, type PluginRepositoryMetadata, type PluginRuntimeManifest, type PluginUpstreamMetadata, type SquadPluginManifest } from './plugin-manifest.js'; export declare const PLUGIN_STATE_DIR = "plugins"; export declare const INSTALLED_PLUGINS_FILE: string; export declare const PLUGIN_LOCK_FILE: string; export declare const PLUGIN_RUNTIME_FILE: string; export declare const PLUGIN_AUDIT_FILE: string; export interface InstalledPluginFile extends PluginFileDeployment { sha256: string; } export interface InstalledPlugin { id: string; name: string; version: string; enabled: boolean; source: string; installed_at: string; roles: PluginComponentKind[]; copilot?: CopilotPluginRequirements; repository?: PluginRepositoryMetadata; upstream?: PluginUpstreamMetadata; mcp?: PluginMcpMetadata; providers?: PluginProviderContract[]; runtime?: PluginRuntimeManifest; files: InstalledPluginFile[]; } export interface InstalledPluginsState { plugins: InstalledPlugin[]; } export interface PluginLockEntry { id: string; version: string; source: string; manifest_sha256: string; files: InstalledPluginFile[]; installed_at: string; } export interface PluginLockState { plugins: Record; } export interface PluginRuntimeEntry { enabled: boolean; active_version: string; updated_at: string; } export interface PluginRuntimeState { plugins: Record; active: Partial>; } export type PluginAuditEventType = 'install' | 'enable' | 'disable' | 'switch' | 'uninstall' | 'verify' | 'provider_invoked' | 'provider_error' | 'execution_blocked'; export interface PluginAuditEvent { type: PluginAuditEventType; plugin_id: string; version: string; timestamp: string; message: string; } export interface PluginAuditState { events: PluginAuditEvent[]; } export interface PluginStates { installed: InstalledPluginsState; lock: PluginLockState; runtime: PluginRuntimeState; audit: PluginAuditState; } export interface ActivePluginContextOptions { /** * Maximum number of characters to include from each installed artifact. * Keeps spawned-agent prompts bounded while still proving the static guidance * is consumed. Defaults to 12k per artifact. */ maxArtifactChars?: number; } export declare function readPluginStates(storage: StorageProvider, stateRoot?: string): Promise; export declare function buildActivePluginContext(storage: StorageProvider, stateRoot?: string, options?: ActivePluginContextOptions): Promise; export declare function writePluginStates(storage: StorageProvider, states: PluginStates, stateRoot?: string): Promise; export declare function upsertInstalledPlugin(states: PluginStates, manifest: SquadPluginManifest, options: { source: string; manifestContent: string; files: InstalledPluginFile[]; now?: string; }): InstalledPlugin; export declare function setPluginEnabled(states: PluginStates, pluginId: string, enabled: boolean, now?: string): InstalledPlugin; export declare function switchActivePlugin(states: PluginStates, role: PluginComponentKind, pluginId: string, now?: string): InstalledPlugin; export declare function removeInstalledPlugin(states: PluginStates, pluginId: string, now?: string): InstalledPlugin; export declare function appendAuditEvent(audit: PluginAuditState, event: PluginAuditEvent): void; export declare function sha256(content: string | Uint8Array): string; //# sourceMappingURL=plugin-state.d.ts.map