import { type Database } from "./database.js"; type Scope = { accountId: string; workspaceId: string; }; /** * Where an app stored a connector's shared-account tool data: a collection * (`collection:`) or its SQL database (`sql`). Reads of a marked target * need a workspace member who may use that connector themselves * (docs/app-server-code.md, "Stored tool data"). */ export type SiteToolDataSource = { target: string; /** The connector's canonical server id, or `vault` for vault secrets. */ connector: string; /** The account route the data came from (the connector when unknown). */ route: string; /** The route is a workspace-shared account. */ shared: boolean; }; export declare const siteToolDataTarget: (kind: "collection" | "sql", name?: string) => string; export declare const SITE_TOOL_DATA_RESET_GRACE_MS = 60000; /** * Mark targets before the data is stored. Marks stay until a manager resets * the target, which removes them; a later write marks it again. * A write (`restart`) restarts an existing mark's time, so the reset grace is * measured from the mark just before that write. Keeping a mark for data * already stored (a sync edit) leaves its time alone, so a reset right after * still lifts it. Either way a shared-account source raises the mark's * `shared` flag; it is never lowered here. */ export declare function markSiteToolData(db: Database, scope: Scope, siteId: string, sources: readonly SiteToolDataSource[], options?: { restart?: boolean; }): Promise; /** A manager reset a target's data: its earlier marks no longer count. */ export declare function resetSiteToolData(db: Database, scope: Scope, siteId: string, target: string): Promise; /** * The app's marked targets, plus each shared sync's target (from its * definition, so a sync saved by an earlier release counts before its next * run marks it; deleted ones too until their target is reset, since their * data stays). */ export declare function listSiteToolDataSources(db: Database, scope: Scope, siteId: string): Promise<{ marks: SiteToolDataSource[]; sharedSyncActions: Array<{ action: unknown; deletedAt: Date | null; }>; resets: Map; }>; export {};