import type { FlatScope } from '@pikku/core/scope'; import { KyselyScopeService } from '@pikku/kysely'; type Logger = { info: (msg: string) => void; warn: (msg: string) => void; error: (msg: string) => void; }; export declare const loadDeclaredScopes: (scopesMetaJsonFile: string, logger: Logger) => Promise; export type OpenedScopeService = { service: KyselyScopeService; destroy: () => Promise; }; /** * Opens a ScopeService against the project's configured database and brings the * `declared` marks up to date with the code. * * The sync is deliberate: the marks are otherwise only as fresh as the last app * boot, so an audit run straight after a code change would report stale * answers. It is safe to do here because syncing is purely additive — it * upserts and marks, and never deletes a scope or revokes a grant. */ export declare const openScopeService: ({ config, logger, }: { config: { rootDir: string; outDir: string; runtimeDir?: string; srcDirectories: string[]; }; logger: Logger; }, declared: FlatScope[], command: string) => Promise; /** * Renders undeclared scopes and the roles that would lose them — the blast * radius, shown before anything is deleted. */ export declare const reportStaleScopes: (stale: Array<{ scope: string; roles: string[]; }>, logger: Logger) => void; export {};