import type { SqliteAdapter as Database } from '../db/sqlite-adapter.js'; import type { SyncAllResult } from './sync-all.js'; import type { ActiveEconomyCloudStorage } from './cloud-storage.js'; import type { SyncOptions } from '../types/index.js'; /** * Machine-local mtime cache path: `HASNA_ECONOMY_INGEST_CACHE` when set, else * `/economy/ingest-cache.json`. Never under the app data home. */ export declare function getIngestCachePath(): string; /** * Push every ingest-table row a scratch store holds to the shared API. The * economy-otel sidecar uses this in hosted mode: same readers, same * idempotent /v1/ingest upserts, no SQLite under the app home. */ export declare function pushIngestRows(cloud: ActiveEconomyCloudStorage, scratch: Database): Promise<{ posted: boolean; ingested: Record; total: number; }>; export interface CloudSyncOptions extends SyncOptions { /** Claude/Takumi JSONL root override (tests). */ projectsDir?: string; /** Ingest-state cache path override (tests). Defaults to getIngestCachePath(). */ cachePath?: string; /** Re-process every file (ignore the mtime cache). */ force?: boolean; /** Tag this run's rows with the current machine id. */ backfillMachine?: boolean; /** Recalculate zero-cost requests from pricing before pushing. */ recalculate?: boolean; } export interface CloudSyncResult extends SyncAllResult { /** True when at least one row was pushed to the shared API in this run. */ posted: boolean; /** Per-table row counts accepted by /v1/ingest (absent when nothing posted). */ ingested?: Record; /** Total rows accepted by /v1/ingest (absent when nothing posted). */ total?: number; } /** * Cloud-client equivalent of `economy sync`: read this machine's on-box * provider files, ingest them through the existing readers, and push the * produced rows to the shared API. Returns the same per-source result shape as * the local syncAll, plus what the server accepted. */ export declare function syncAllToCloud(cloud: ActiveEconomyCloudStorage, opts?: CloudSyncOptions): Promise; export interface CloudBillingSyncOptions { days?: number; anthropic?: boolean; openai?: boolean; gemini?: boolean; } export interface CloudBillingSyncResult { /** Per-provider outcome; a provider failure does not stop the others. */ providers: Record; totalUsd: number; posted: boolean; ingested?: Record; total?: number; } /** * Cloud-client equivalent of `economy billing sync`: fetch provider billing * from the provider APIs and push the billing_daily rows to the shared API. */ export declare function billingSyncToCloud(cloud: ActiveEconomyCloudStorage, opts?: CloudBillingSyncOptions): Promise; //# sourceMappingURL=cloud-ingest.d.ts.map