import { type MigrationRunResult } from "./migrate.js"; export interface LocalProviderRecord { id: string; key: string; displayName: string; connectorVersion: string; createdAt: string; updatedAt: string; } export interface LocalUsageSnapshotRecord { id: string; providerKey: string; collectedAt: string; service: string; metric: string; unit: string; value: number; providerAccountRef?: string; metadataJson: Record; } export interface LocalBillingSnapshotRecord { id: string; providerKey: string; collectedAt: string; periodStart: string; periodEnd: string; amountMinor: number; currency: string; status: string; providerAccountRef?: string; metadataJson: Record; } export interface LocalServiceHealthSnapshotRecord { id: string; providerKey: string; collectedAt: string; service: string; region?: string; status: "ok" | "degraded" | "down" | "unknown"; message?: string; metadataJson: Record; } export interface LocalCostEstimateRecord { id: string; providerKey: string; collectedAt: string; periodStart: string; periodEnd: string; estimatedAmountMinor: number; currency: string; confidence: "low" | "medium" | "high"; providerAccountRef?: string; metadataJson: Record; } export interface LocalAlertRecord { id: string; providerKey?: string; createdAt: string; severity: "info" | "warning" | "critical"; category: string; title: string; message: string; metadataJson: Record; } export interface LocalReportRunRecord { id: string; createdAt: string; reportDate: string; language: "ko" | "en"; deliveryTarget: "stdout" | "local-file" | "slack"; status: "rendered" | "sent" | "error"; metadataJson: Record; } export interface LocalEmergencyActionRunRecord { id: string; providerKey: string; actionKey: string; mode: "requirements_only" | "manual" | "dry_run"; readiness: string; requestedAt: string; confirmedAt?: string; status: "viewed" | "dry_run" | "blocked" | "error"; reasonCode: string; targetLabelRedacted?: string; targetHash?: string; resultSummary: string; errorCode?: string; localOnly: true; secretsReturned: false; metadataJson: Record; } export type LocalAiUsageProviderKey = "codex-cli" | "codex-app" | "claude-cli" | "claude-app"; export type LocalAiUsageSourceScope = "dedicated" | "shared_fallback"; export type LocalAiUsageCoverage = "complete" | "partial"; export type LocalAiUsageGranularity = "day" | "week" | "month"; export interface LocalAiUsageDailyInput { providerKey: LocalAiUsageProviderKey; usageDate: string; timezone: string; sourceScope: LocalAiUsageSourceScope; observedAt: string; firstActivityAt: string | null; latestActivityAt: string | null; activityCount: number; sessionCount: number; turnCount: number; toolCallCount: number; inputTokens: number | null; outputTokens: number | null; cacheTokens: number | null; reasoningTokens: number | null; totalTokens: number | null; coverage: LocalAiUsageCoverage; parserVersion: string; localOnly: true; secretsReturned: false; } export interface LocalAiUsageHistoryQuery { dbPath: string; from: string; to: string; granularity: LocalAiUsageGranularity; providerKeys?: readonly LocalAiUsageProviderKey[]; } export interface LocalAiUsageHistoryRow { providerKey: LocalAiUsageProviderKey; periodStart: string; periodEnd: string; timezone: string; sourceScope: LocalAiUsageSourceScope; observedAt: string; firstActivityAt: string | null; latestActivityAt: string | null; activityCount: number; sessionCount: number; turnCount: number; toolCallCount: number; inputTokens: number | null; outputTokens: number | null; cacheTokens: number | null; reasoningTokens: number | null; totalTokens: number | null; coverage: LocalAiUsageCoverage; } export interface LocalStore { appliedMigrationIds: string[]; providers: LocalProviderRecord[]; usageSnapshots: LocalUsageSnapshotRecord[]; billingSnapshots: LocalBillingSnapshotRecord[]; serviceHealthSnapshots: LocalServiceHealthSnapshotRecord[]; costEstimates: LocalCostEstimateRecord[]; alerts: LocalAlertRecord[]; reportRuns: LocalReportRunRecord[]; emergencyActionRuns: LocalEmergencyActionRunRecord[]; } export interface LocalStoreOptions { dbPath: string; } export interface LocalProviderCollectionInput { dbPath: string; provider: { key: string; displayName: string; connectorVersion: string; }; collectedAt: string; status: "ok" | "partial" | "error"; snapshots: { usage: readonly LocalUsageSnapshotInput[]; billing: readonly LocalBillingSnapshotInput[]; serviceHealth: readonly LocalServiceHealthSnapshotInput[]; costEstimates: readonly LocalCostEstimateInput[]; }; alerts: readonly LocalAlertInput[]; } export interface LocalUsageSnapshotInput { provider: string; collectedAt: string; service?: string; metric: string; unit: string; value: number; providerAccountRef?: string; } export interface LocalBillingSnapshotInput { provider: string; collectedAt: string; periodStart: string; periodEnd: string; amountMinor: number; currency: string; status: string; providerAccountRef?: string; } export interface LocalServiceHealthSnapshotInput { provider: string; collectedAt: string; service: string; region?: string; status: "ok" | "degraded" | "down" | "unknown"; message?: string; } export interface LocalCostEstimateInput { provider: string; collectedAt: string; periodStart: string; periodEnd: string; estimatedAmountMinor: number; currency: string; confidence: "low" | "medium" | "high"; providerAccountRef?: string; } export interface LocalAlertInput { provider?: string; createdAt: string; severity: "info" | "warning" | "critical"; category: string; title: string; message: string; } export interface LocalReportRunInput { dbPath: string; createdAt: string; reportDate: string; language: "ko" | "en"; deliveryTarget: "stdout" | "local-file" | "slack"; status: "rendered" | "sent" | "error"; } export interface LocalEmergencyActionRunInput { dbPath: string; providerKey: string; actionKey: string; mode: "requirements_only" | "manual" | "dry_run"; readiness: string; requestedAt: string; confirmedAt?: string; status: "viewed" | "dry_run" | "blocked" | "error"; reasonCode: string; targetLabelRedacted?: string; targetHash?: string; resultSummary: string; errorCode?: string; localOnly: true; secretsReturned: false; } export declare function initializeLocalStore(options: LocalStoreOptions): Promise; export declare function readLocalStore(options: LocalStoreOptions): Promise; export declare function saveLocalProviderCollection(input: LocalProviderCollectionInput): Promise; export declare function saveLocalAiUsageDaily(input: { dbPath: string; rows: readonly LocalAiUsageDailyInput[]; }): Promise; export declare function readLocalAiUsageHistory(input: LocalAiUsageHistoryQuery): Promise; export declare function recordLocalReportRun(input: LocalReportRunInput): Promise; export declare function recordEmergencyActionRun(input: LocalEmergencyActionRunInput): Promise; //# sourceMappingURL=local-store.d.ts.map