import { listAcpSessionEntries, readAcpSessionEntry } from "../acp/runtime/session-meta.js"; import { loadSessionStore, resolveStorePath } from "../config/sessions.js"; import type { OpenClawConfig } from "../config/types.openclaw.js"; import { isCronJobActive } from "../cron/active-jobs.js"; import { readCronRunLogEntriesSync, resolveCronRunLogPath } from "../cron/run-log.js"; import type { CronRunLogEntry } from "../cron/run-log.js"; import { loadCronStoreSync, resolveCronStorePath } from "../cron/store.js"; import type { CronStoreFile } from "../cron/types.js"; import { getAgentRunContext } from "../infra/agent-events.js"; import { getSessionBindingService } from "../infra/outbound/session-binding-service.js"; import { parseAgentSessionKey } from "../routing/session-key.js"; import { deriveSessionChatTypeFromKey } from "../sessions/session-chat-type-shared.js"; import { deleteTaskRecordById, ensureTaskRegistryReady, getTaskById, hasActiveTaskForChildSessionKey, listTaskRecords, markTaskLostById, markTaskTerminalById, maybeDeliverTaskTerminalUpdate, resolveTaskForLookupToken, setTaskCleanupAfterById } from "./runtime-internal.js"; import type { TaskAuditSummary } from "./task-registry.audit.js"; import type { TaskRecord, TaskRegistrySummary, TaskStatus } from "./task-registry.types.js"; type TaskRegistryMaintenanceRuntime = { listAcpSessionEntries: typeof listAcpSessionEntries; readAcpSessionEntry: typeof readAcpSessionEntry; closeAcpSession?: (params: { cfg: OpenClawConfig; sessionKey: string; reason: string; }) => Promise; listSessionBindingsBySession?: ReturnType["listBySession"]; unbindSessionBindings?: ReturnType["unbind"]; loadSessionStore: typeof loadSessionStore; resolveStorePath: typeof resolveStorePath; deriveSessionChatTypeFromKey?: typeof deriveSessionChatTypeFromKey; isCronJobActive: typeof isCronJobActive; getAgentRunContext: typeof getAgentRunContext; parseAgentSessionKey: typeof parseAgentSessionKey; hasActiveTaskForChildSessionKey: typeof hasActiveTaskForChildSessionKey; deleteTaskRecordById: typeof deleteTaskRecordById; ensureTaskRegistryReady: typeof ensureTaskRegistryReady; getTaskById: typeof getTaskById; listTaskRecords: typeof listTaskRecords; markTaskLostById: typeof markTaskLostById; markTaskTerminalById: typeof markTaskTerminalById; maybeDeliverTaskTerminalUpdate: typeof maybeDeliverTaskTerminalUpdate; resolveTaskForLookupToken: typeof resolveTaskForLookupToken; setTaskCleanupAfterById: typeof setTaskCleanupAfterById; isCronRuntimeAuthoritative: () => boolean; resolveCronStorePath: typeof resolveCronStorePath; loadCronStoreSync: typeof loadCronStoreSync; resolveCronRunLogPath: typeof resolveCronRunLogPath; readCronRunLogEntriesSync: typeof readCronRunLogEntriesSync; }; export type TaskRegistryMaintenanceSummary = { reconciled: number; recovered: number; cleanupStamped: number; pruned: number; }; type CronRecoveryContext = { storePath: string; store?: CronStoreFile | null; runLogsByJobId: Map; }; export declare function reconcileTaskRecordForOperatorInspection(task: TaskRecord, context?: CronRecoveryContext): TaskRecord; export declare function reconcileInspectableTasks(): TaskRecord[]; export type ActiveTaskRestartBlocker = { taskId: string; status: Extract; runtime: TaskRecord["runtime"]; runId?: string; label?: string; title?: string; }; export declare function getInspectableActiveTaskRestartBlockers(): ActiveTaskRestartBlocker[]; export declare function getInspectableTaskRegistrySummary(): TaskRegistrySummary; export declare function getInspectableTaskAuditSummary(): TaskAuditSummary; export declare function reconcileTaskLookupToken(token: string): TaskRecord | undefined; export declare function previewTaskRegistryMaintenance(): TaskRegistryMaintenanceSummary; export declare function runTaskRegistryMaintenance(): Promise; export declare function sweepTaskRegistry(): Promise; export declare function startTaskRegistryMaintenance(): void; export declare function stopTaskRegistryMaintenance(): void; export declare const stopTaskRegistryMaintenanceForTests: typeof stopTaskRegistryMaintenance; export declare function setTaskRegistryMaintenanceRuntimeForTests(runtime: TaskRegistryMaintenanceRuntime): void; export declare function resetTaskRegistryMaintenanceRuntimeForTests(): void; export declare function configureTaskRegistryMaintenance(options: { cronStorePath?: string; cronRuntimeAuthoritative?: boolean; }): void; export declare function getReconciledTaskById(taskId: string): TaskRecord | undefined; export {};