import type { AppSignal, AIPlannerProvider, AgentPlan, PolicyRule, BudgetState, ToolExecutionContext } from "@loomic/types"; import { type ContextAssemblerConfig } from "./context-assembler.js"; import { type GovernorVerdict } from "./governor.js"; import { type ExecutionResult } from "./executor.js"; import type { ApprovalQueue } from "./approval-queue.js"; import { UIComposer } from "./ui-composer.js"; import { ToolRegistry } from "./tool-registry.js"; import { RuntimeEventEmitter } from "./event-emitter.js"; import { type PromptBuilderConfig } from "./prompt-builder.js"; export type CycleResult = { cycleId: string; signal: AppSignal; plan: AgentPlan | undefined; verdict: GovernorVerdict | undefined; execution: ExecutionResult | undefined; durationMs: number; error: string | undefined; phase: "context" | "planning" | "governor" | "execution" | undefined; }; export type RunLoopConfig = { planner: AIPlannerProvider; policies: PolicyRule[]; budgets: BudgetState; contextConfig: Omit; ui: UIComposer; tools: ToolRegistry; emitter: RuntimeEventEmitter; /** Minimum ms between cycles (debounce). Default: 0 (no debounce). */ debounceMs?: number; /** Tool execution context */ executionContext: ToolExecutionContext; /** Prompt builder config for customizing messages sent to the planner. */ promptConfig?: PromptBuilderConfig | undefined; /** Optional approval queue for require-approval verdicts. */ approvalQueue?: ApprovalQueue; }; /** * RunLoop — encapsulates per-instance cycle state (counter, debounce). * Supports multiple concurrent runtime instances without shared globals. */ export declare class RunLoop { private cycleCounter; private lastCycleTime; private readonly config; constructor(config: RunLoopConfig); private nextCycleId; /** Reset counters (for testing). */ _reset(): void; processSignal(signal: AppSignal): Promise; } export declare function _resetCycleCounter(): void; export declare function _resetDebounce(): void; /** * processSignal — standalone function (backward-compatible). * Delegates to the shared runCycle implementation using module-level state. */ export declare function processSignal(signal: AppSignal, config: RunLoopConfig): Promise; //# sourceMappingURL=run-loop.d.ts.map