import type { ThinkingLevel } from "@gajae-code/agent-core"; import type { Tool, UsageReport } from "@gajae-code/ai/core"; import { EventBus } from "../../utils/event-bus"; import type { Extension, ExtensionFactory, ExtensionRuntime as IExtensionRuntime, LoadExtensionsResult } from "./types"; export declare class ExtensionRuntimeNotInitializedError extends Error { constructor(); } /** * Extension runtime with throwing stubs for action methods. * These are replaced with real implementations during initialization. */ export declare class ExtensionRuntime implements IExtensionRuntime { flagValues: Map; pendingProviderRegistrations: Array<{ name: string; config: import("./types").ProviderConfig; sourceId: string; }>; sendMessage(): void; sendUserMessage(): Promise; appendEntry(): void; setLabel(): void; getActiveTools(): string[]; getAllTools(): string[]; resolveTool(): Pick | undefined; setActiveTools(): Promise; getCommands(): never; setModel(): Promise; getThinkingLevel(): ThinkingLevel; setThinkingLevel(): void; getThinkingVisibility(): "visible" | "hidden"; setThinkingVisibility(): void; cycleThinkingLevel(): ThinkingLevel | undefined; setThinkingLevelForControl(): Promise; setThinkingVisibilityForControl(): Promise; setModelTemporaryForControl(): Promise; fetchUsageReportsForControl(): Promise; getThinkingScopeForControl(): "session" | "global config"; getSessionName(): string | undefined; setSessionName(): Promise; } /** * Per-extension activation transaction over the shared runtime state. * * Registration writes from a factory are staged here (stage); the factory * completing without throwing is the validation step; commit copies the * staged mutations into the shared runtime; rollback discards them, so a * factory that fails midway leaves no registration behind (issue #4718). */ export declare class ExtensionActivationScope { #private; /** True while staged writes may still be added or committed. */ get open(): boolean; constructor(runtime: IExtensionRuntime); get flagValues(): Map; get pendingProviderRegistrations(): Array<{ name: string; config: import("./types").ProviderConfig; sourceId: string; }>; /** * Publish the staged mutations into the shared runtime as one transaction. * * Prior state is journaled before any live mutation so a throw partway * through publication is undone before it escapes: flag entries that did * not exist are removed, overwritten entries are restored, and the * provider queue is truncated to its prior length. The scope only becomes * terminal once publication has fully succeeded, so a failed commit * leaves the shared runtime exactly as it was (issue #4718). */ commit(): void; rollback(): void; } /** * Create an Extension from an inline factory function. */ export declare function loadExtensionFromFactory(factory: ExtensionFactory, cwd: string, eventBus: EventBus, runtime: IExtensionRuntime, name?: 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, eventBus?: EventBus, disabledExtensionIds?: string[]): Promise;