/** * OpenKernel — Plugin SDK * * Typed helpers for authoring plugins concisely. Provides a fluent * PluginBuilder and a definePlugin() shortcut. * * const myPlugin = definePlugin('my-plugin') * .version('1.0.0') * .description('Does things') * .subscribe(['MISSION_STARTED'], (e) => console.log(e)) * .command('greet', 'Greet someone', async (args) => console.log(args)) * .onRegister((kernel) => { ... }) * .onDestroy(() => { ... }) * .build(); */ import type { KernelEvent, KernelEventType, KernelLike, Plugin, PluginCommand, EventHandler } from '../types.js'; export interface PluginBuilder { version(v: string): this; description(d: string): this; subscribe(types: KernelEventType[], handler: EventHandler): this; command(name: string, description: string, handler: PluginCommand['handler']): this; onRegister(fn: (kernel: KernelLike) => void | Promise): this; onDestroy(fn: () => void | Promise): this; onEvent(handler: (event: KernelEvent) => void | Promise): this; build(): Plugin; } export declare function definePlugin(name: string): PluginBuilder;