import type { DatabaseSync } from 'node:sqlite'; import type { FollowUp } from '@xopcai/gateway-contract'; import type { HomePrincipal } from './repository.js'; export type FollowUpRow = { id: string; owner_id: string; workspace_id: string; root_task_id: string; root_contract_hash: string; topic_ids_json: string; goal: string; criteria_json: string; locale: 'zh' | 'en'; agent_id: string; status: FollowUp['status']; revision: number; next_step: string; waiting_for: string; summary: string; auto_continue: number; remaining_steps: number; next_sequence: number; stop_pending: number; created_at: number; updated_at: number; }; export type FollowUpStepRow = { followup_id: string; sequence: number; task_id: string; action: string; contract_hash: string; source_hash: string; processed_run_id: string | null; created_at: number; }; export declare class HomeFollowUpRepository { private readonly db; private readonly principal; constructor(db: DatabaseSync, principal: HomePrincipal); findById(id: string): FollowUpRow | undefined; listSteps(followupId: string): FollowUpStepRow[]; update(id: string, patch: Partial>, now?: number): void; findOperation(operationId: string): { request_hash: string; result_id: string; } | undefined; insertOperation(operationId: string, requestHash: string, resultId: string): void; insertFollowUp(input: { id: string; rootTaskId: string; rootContractHash: string; topicIds: readonly string[]; goal: string; criteria: readonly string[]; locale: 'zh' | 'en'; agentId: string; firstStep: string; autoContinue: boolean; stepBudget: number; now: number; }): void; insertStep(input: { followupId: string; sequence: number; taskId: string; action: string; contractHash: string; sourceHash: string; createdAt: number; }): void; markStepProcessedRun(followupId: string, sequence: number, runId: string): void; listRecentIds(limit?: number): string[]; listRefreshable(): FollowUpRow[]; getTopicSourceKey(topicId: string): string; findLatestRootRunId(taskId: string): string | undefined; findLatestTaskConversationId(taskId: string): string | undefined; }