/** * OpenKernel — Public Kernel API * * kernel.execute() / pause() / resume() / cancel() / status() * kernel.subscribe() / registerWorker() / registerProvider() * kernel.registerPlugin() / registerPolicy() * * This is the single entry point. Harnesses, CLIs, n8n, bots all go through here. */ import { EventBus } from './event-bus.js'; import { ProviderManager } from './provider-manager.js'; import { CapabilityRouter } from './router.js'; import { WorkerRuntime } from './worker-runtime.js'; import { Scheduler } from './scheduler.js'; import { CheckpointEngine } from './checkpoint-engine.js'; import { MissionEngine } from './mission-engine.js'; import { Orchestrator } from './orchestrator.js'; import { PluginManager } from './plugin-manager.js'; import { PolicyEngine } from './policies.js'; import { VerificationEngine } from './verification-engine.js'; import { RecoveryManager } from './recovery-manager.js'; import { KernelCommandRegistry } from './command-system.js'; import { MissionPlanner } from './planner.js'; import type { Federation } from './federation/federation.js'; import type { CommandResult, EventHandler, KernelEvent, KernelEventType, KernelLike, Logger, Mission, MissionInput, Plugin, Policy, ProviderInterface, WorkerDefinition, MissionStatus } from './types.js'; export interface KernelOptions { logger?: Logger; storageDir?: string; loadBuiltinWorkers?: boolean; } export declare class Kernel implements KernelLike { readonly eventBus: EventBus; readonly providerManager: ProviderManager; readonly router: CapabilityRouter; readonly workerRuntime: WorkerRuntime; readonly scheduler: Scheduler; readonly checkpoints: CheckpointEngine; readonly missionEngine: MissionEngine; readonly orchestrator: Orchestrator; readonly plugins: PluginManager; readonly policies: PolicyEngine; readonly verification: VerificationEngine; readonly recovery: RecoveryManager; readonly logger: Logger; /** Canonical OpenKernel slash-command surface (/status, /workers, /goal …). */ readonly commands: KernelCommandRegistry; /** Decomposes a goal into phases when a mission is run with `autoPlan`. */ readonly planner: MissionPlanner; /** * The mesh node this kernel is part of, once `infinicode serve`/`mcp` wires it * in via {@link attachFederation}. Undefined when running stand-alone. Node * commands (/nodes, /node, /activity …) read it off the command context. */ federation?: Federation; private missions; constructor(options?: KernelOptions); /** Attach the federation mesh node so node/mesh slash-commands can reach it. */ attachFederation(federation: Federation): void; execute(input: MissionInput): Promise; pause(missionId: string): Promise; resume(missionId: string): Promise; cancel(missionId: string): Promise; status(missionId: string): Promise; /** * Execute a canonical OpenKernel slash-command (e.g. "/status", "/goal build X"). * The same registry backs the CLI console and the notification plugins. */ command(input: string): Promise; /** Reset a mission's failed/skipped tasks and re-run them. */ retry(missionId: string): Promise; subscribe(types: KernelEventType[], handler: EventHandler): () => void; subscribeAll(handler: EventHandler): () => void; registerWorker(definition: WorkerDefinition): void; registerProvider(providerId: string, provider: ProviderInterface): void; registerPlugin(plugin: Plugin): Promise; registerPolicy(policy: Policy): void; /** Set the default policy used for routing when a mission doesn't specify one. */ setDefaultPolicy(name: Policy['name']): void; getMission(missionId: string): Mission | undefined; listMissions(): Mission[]; /** Emit a NOTIFICATION event that plugins (Telegram/Discord/Slack) can consume. */ notify(message: string, missionId?: string): void; listPlugins(): Plugin[]; getEventHistory(): KernelEvent[]; destroy(): void; } export declare function createKernel(options?: KernelOptions): Kernel;