/** * Extension loader - loads TypeScript extension modules using jiti. * */ import { type EventBus } from "../event-bus.js"; import type { Extension, ExtensionFactory, ExtensionLoadIssue, ExtensionRuntime, LoadExtensionsResult } from "./types.js"; /** * Create a runtime with throwing stubs for action methods. * Runner.bindCore() replaces these with real implementations. */ export declare function createExtensionRuntime(): ExtensionRuntime; /** * Create an Extension from an inline factory function. */ export declare function loadExtensionFromFactory(factory: ExtensionFactory, cwd: string, eventBus: EventBus, runtime: ExtensionRuntime, extensionPath?: string, displayName?: string): Promise; /** * Load extensions from paths. */ export declare function loadExtensions(paths: string[], cwd: string, eventBus?: EventBus): Promise; /** * Discover and load extensions from standard locations. */ export declare function discoverAndLoadExtensions(configuredPaths: string[], cwd: string, agentDir?: string, eventBus?: EventBus): Promise; /** * Whether a discovered plugin sits in the working tree, and therefore came with * the repository as far as anyone but its installer can tell. * * All three project paths count: `/.claude/skills` (the vendor convention * for repo-committed plugins) and `/.agents/plugins` + `/.hoocode/plugins` * (hoocode's own project-scope install homes). An earlier version listed only the * first, reasoning that the hoocode homes held plugins "the user installed * deliberately" — true of the person who ran the install, and false for every * collaborator who clones the result. Location cannot tell those two apart, so it * is the wrong thing to ask; {@link isWorkspaceTrusted} asks the right one. */ export declare function isProjectSuppliedPlugin(pluginRoot: string, cwd: string): boolean; /** * Whether a plugin's **executable** capabilities (hooks, MCP servers) should be * withheld: it lives in the working tree and this machine has not trusted the * workspace. * * Passive capabilities always load. Reading a repository's skill text is what * opening the repository already implies; starting its processes is not. */ export declare function shouldWithholdExecutables(pluginRoot: string, cwd: string, agentDir?: string): boolean; /** * Standard plugin discovery directories, highest precedence first. * * `.agents/plugins/` is the cross-vendor, primary home and is listed ahead of the * `.hoocode/plugins/` fallback at each scope, so an `.agents`-installed plugin * wins over a same-id `.hoocode` one (discoverPlugins is first-wins by id). * Project scope beats global. The global surfaces live next to the agent dir * (`~/.agents`, `~/.claude` alongside `~/.hoocode`), so they stay parameterized * on `agentDir` rather than hardcoding the home directory. * * Two of these are *production homes* for plugins hoocode authored, and two are * skills directories: * * - `/.agents/plugins` is the legacy project-local install home. Nothing * writes there any more; it is read so plugins installed by older versions * keep working. * - `.claude/skills` (project and personal) implements Claude Code's * skills-directory plugins: a folder there carrying `.claude-plugin/plugin.json` * is a plugin, and a folder with only a `SKILL.md` stays a plain skill — * `parsePluginDir` returns null for the latter, which is exactly the vendor's * own rule, so no special-casing is needed here. * * See docs/plugin-system-architecture.md §5.3 and §5.7. */ export declare function defaultPluginDirs(cwd: string, agentDir?: string): string[]; /** * Discover plugins under `pluginDirs` and load each as a synthetic extension into * the given runtime/event bus. Clears the extension MCP registry first so reloads * rebuild the set cleanly. */ export declare function loadPlugins(pluginDirs: string[], cwd: string, eventBus: EventBus, runtime: ExtensionRuntime): Promise<{ extensions: Extension[]; errors: ExtensionLoadIssue[]; }>; //# sourceMappingURL=loader.d.ts.map