import { type CronAdapterConfig, type CronAdapterStartResult } from "@mono-agent/cron-adapter"; import { type CronOperatorJob, type CronOperatorMutationResult, type CronOperatorOverview, type CronOperatorRunDetail, type CronOperatorRunPage, type CronOperatorRunSummary, type CronOperatorService } from "@mono-agent/operator-adapter"; import { type ChannelConfigViewSection } from "@mono-agent/agent-contracts"; import { type CronControlStore } from "./cron-control-store.js"; import type { MonoAgentAppLogger } from "./channels.js"; export interface CronOperatorServiceInput { readonly config: CronAdapterConfig; readonly configView: () => ChannelConfigViewSection | Promise; readonly store?: CronControlStore; readonly adapter?: CronAdapterStartResult; readonly effectiveEnabledByJobId?: ReadonlyMap; readonly degradedReason?: string; readonly degradation?: CronOperatorDegradationController; readonly onEffectiveEnabledChanged?: () => void; readonly now?: () => Date; readonly logger?: MonoAgentAppLogger; } export interface CronOperatorDegradationController { reason(): string | undefined; degrade(reason: string): void; } export declare function createCronOperatorDegradationController(initialReason?: string): CronOperatorDegradationController; /** Build the agent-owned service shared by every operator UI (web now, TUI later). */ export declare function createCronOperatorService(input: CronOperatorServiceInput): CronOperatorService; /** Stable indirection lets cron and TUI drivers start/reload independently. */ export declare class CronOperatorRegistry implements CronOperatorService { private service; private live; get configured(): boolean; /** * `live` marks the binding made by a started channel — the only one holding a * control store and a running adapter, and therefore the only one that can * enable operator actions. * * A non-live bind never replaces a live one. `loadConfig` runs again long * after start (rendering a channel config view re-enters it), and letting * that store-less, adapter-less service take over silently disabled run-now * and runtime-enable for the rest of the process lifetime. */ bind(service: CronOperatorService, options?: { readonly live?: boolean; }): void; /** * Drops the live claim while keeping the bound service readable, so a stopped * channel's next `loadConfig` may take over the read-only surface. */ demote(): void; clear(): void; overview(): CronOperatorOverview | Promise; runs(input: { readonly jobId: string; readonly limit: number; readonly before?: string; }): CronOperatorRunPage | Promise; run(input: { readonly jobId: string; readonly runId: string; }): CronOperatorRunDetail | Promise; configView(): ChannelConfigViewSection | Promise; runNow(jobId: string, input: Parameters[1]): CronOperatorMutationResult<{ readonly run: CronOperatorRunSummary; }> | Promise>; setEffectiveEnabled(jobId: string, enabled: boolean, input: Parameters[2]): CronOperatorMutationResult<{ readonly job: CronOperatorJob; }> | Promise>; private requireService; } //# sourceMappingURL=cron-operator-service.d.ts.map