import { type Database } from "./database.js"; import * as schema from "./schema.js"; import type { CredentialProfileEntryRow } from "./credential-profiles-schema.js"; export type CredentialProfileRow = typeof schema.credentialProfiles.$inferSelect; export declare class CredentialProfileSessionNotFoundError extends Error { readonly sessionId: string; constructor(sessionId: string); } /** The workspace profile (`sessionId` null) or one session's own profile. */ export declare function getCredentialProfile(db: Database, input: { workspaceId: string; sessionId: string | null; }): Promise; export type SaveCredentialProfileInput = { workspaceId: string; /** NULL: the workspace profile. */ sessionId: string | null; entries: CredentialProfileEntryRow[]; gitHelper: boolean | null; subjectId: string; /** The chat whose agent saves it, when an agent does. */ updatedBySessionId?: string | null; }; /** * Replace one level's profile. An empty profile (no entries, no git helper * setting) removes the row. Returns the stored row, or null when removed. */ export declare function saveCredentialProfile(db: Database, input: SaveCredentialProfileInput): Promise; export type CredentialProfileChainLink = { /** NULL for the workspace profile. */ sessionId: string | null; entries: CredentialProfileEntryRow[]; gitHelper: boolean | null; }; /** * The profiles that apply to a session, outermost first: the workspace * profile, then each session from the root ancestor down to the session * itself. Levels without a profile are omitted. */ export declare function listCredentialProfileChain(db: Database, input: { workspaceId: string; sessionId: string; }): Promise;