import type { OpenClawPluginServiceContext, PluginLogger } from '../openclaw-sdk.js'; import { WorkspaceContext } from '../core/workspace-context.js'; import { CorrectionObserver } from '@principles/core/runtime-v2'; export interface CorrectionObserverServiceShape { id: string; start: (ctx: OpenClawPluginServiceContext) => void; stop?: (ctx: OpenClawPluginServiceContext) => void; } /** * PRI-788 G2: 批量确认 signal_confirmations 里的 pending 候选。 * * 用每周期新鲜解析的 signal classifier 重新分类——检测时 LLM 不可用而入队的 * 候选,在通道恢复后由这里补确认:correction → 回写标志位 + 复用 realtime * STRONG 分流(同一限流桶/pain 身份派生);none → rejected;连续失败达上限 * → abandoned。classifier 本身不可用(通道仍死)时整批跳过、不计失败次数。 * * @returns 本轮 resolved(confirmed/rejected/abandoned)条数。 * @param isStale 可选:返回 true 时停止继续处理(服务已 stop / 已重启), * 用于让旧周期在 stop→start 之后不再写状态(单消费者边界的第二道闸)。 */ export declare function batchConfirmPendingSignals(wctx: WorkspaceContext, logger: PluginLogger, isStale?: () => boolean): Promise; /** * PRI-307: Resolve CorrectionObserver from .pd/config.yaml. * * States: * - disabled: feature flag off → return null, no noisy logs * - needs_setup: enabled but missing API key or profile → return null with structured reason * - ready/not_ready: enabled and configured → return observer instance */ export declare function resolveCorrectionObserver(wctx: WorkspaceContext, logger?: Pick): CorrectionObserver | null; export declare function runCorrectionObserverCycle(wctx: WorkspaceContext, logger: PluginLogger, isStale?: () => boolean): Promise; export declare const CorrectionObserverService: CorrectionObserverServiceShape;