import type { GCToolDefinition } from "./sdk-types.js"; import type { HookDefinition, HookResult } from "./hooks.js"; import type { MemoryLayerDef } from "./plugin-types.js"; type HookEvent = "on_session_start" | "pre_tool_use" | "post_response" | "on_error"; type HookHandler = (ctx: Record) => Promise | HookResult; export interface GitagentPluginApi { /** Plugin identifier */ pluginId: string; /** Plugin directory path */ pluginDir: string; /** Resolved plugin config values */ config: Record; /** Register a tool the agent can use */ registerTool(def: GCToolDefinition): void; /** Register a lifecycle hook */ registerHook(event: HookEvent, handler: HookHandler): void; /** Append text to the system prompt */ addPrompt(text: string): void; /** Register a memory layer the agent can use */ registerMemoryLayer(layer: { name: string; path: string; description: string; }): void; /** Logger for plugin output */ logger: { info(msg: string): void; warn(msg: string): void; error(msg: string): void; }; } interface InternalPluginApi extends GitagentPluginApi { getTools(): GCToolDefinition[]; getHooks(): Record | null; getPrompt(): string; getMemoryLayers(): MemoryLayerDef[]; } export declare function createPluginApi(pluginId: string, pluginDir: string, config: Record): InternalPluginApi; export {};