import type { ClientChromeItem, MoxxyRequirement, Plugin, PluginHostHandle, RequirementCheck, RequirementIssue, ResolvedPluginManifest } from '@moxxy/sdk'; import type { PluginHostOptions, PluginLoader } from './host-options.js'; export type { PluginHostOptions, PluginLoader }; export interface RegisterStaticOptions { /** * Static requirements to enforce before registration. Mirrors the * `moxxy.requirements` field a discovered plugin's package.json would * carry; passed explicitly here because statically-imported builtins * don't go through `discoverPlugins()`. */ readonly requirements?: ReadonlyArray; } export type PluginSkipSource = 'static' | 'discovered'; export type PluginSkipReason = 'unmet_requirements' | 'load_error'; export interface PluginSkipRecord { readonly pluginName: string; readonly source: PluginSkipSource; readonly reason: PluginSkipReason; readonly message: string; readonly packageName?: string; readonly issues?: ReadonlyArray; readonly hints: ReadonlyArray; } export declare class PluginRequirementError extends Error { readonly pluginName: string; readonly check: RequirementCheck; constructor(pluginName: string, check: RequirementCheck); } export declare class PluginHost implements PluginHostHandle { private readonly opts; private readonly loaded; private readonly skipped; constructor(opts: PluginHostOptions); list(): ReadonlyArray<{ name: string; version: string; loaded: boolean; /** * True when this plugin was DISCOVERED from `~/.moxxy/plugins` (installed on * demand), false when it was statically bundled into the binary. Discovered * plugins carry a manifest (registerDiscovered); bundled ones don't * (registerStatic). Lets the UI tell "built-in" from "installed". */ installed: boolean; kinds: ReadonlyArray; }>; /** * The skills folder of every loaded plugin: `package.json#moxxy.plugin.skills` * (against the package's own folder) or the plugin's `skillsDir`. The skill * loader reads them between the builtin skills and the user's own. */ skillDirs(): string[]; listSkipped(): ReadonlyArray; /** * The plugin that contributed the named tool — the `loaded` map key, i.e. * the package name for discovered plugins and the declared plugin name for * statically bundled ones. Linear scan over per-plugin name lists: the * registries are small (~40 plugins × a handful of tools) and callers * (security routing, audit views) are not hot paths. */ ownerOfTool(toolName: string): string | undefined; /** Wire-safe client chrome, namespaced and sanitized at the host boundary. */ listClientChrome(): ReadonlyArray; registerStatic(plugin: Plugin, opts?: RegisterStaticOptions): void; registerDiscovered(plugin: Plugin, manifest: ResolvedPluginManifest): void; discoverAndLoad(extraPaths?: ReadonlyArray): Promise>; unload(name: string): Promise; reload(): Promise; private applyPlugin; private assertRequirementsReady; private refreshDispatcher; private recordRequirementSkip; private recordLoadError; private clearSkip; } //# sourceMappingURL=host.d.ts.map