/** * SQLite persistence layer for Clawtomaton state. * * Stores identity, conversation history, heartbeat state, audit log, * and SOUL.md content. All data is local — the agent owns its own state. */ import type { ClawtomatonIdentity, SurvivalState, ConversationTurn, ActivationResult } from '../types.js'; import type { BunkerState, ThreatLevel } from '../bunker/types.js'; import type { TraderPosition, TraderTrade, TraderSnapshot, TraderStorage, GasEntry, RiskConfig, RiskStorage } from '@clawnch/clawncher-sdk'; export declare class StateStore { private db; constructor(stateDir: string); private migrate; saveIdentity(identity: ClawtomatonIdentity): void; getIdentity(): ClawtomatonIdentity | null; updateIdentityToken(tokenAddress: string, tokenSymbol: string, deployTxHash: string): void; saveActivation(result: ActivationResult): void; getActivation(): ActivationResult | null; isActivated(): boolean; saveSurvival(state: SurvivalState): void; getSurvival(): SurvivalState; addTurn(turn: ConversationTurn): void; getHistory(limit: number): ConversationTurn[]; getTurnCount(): number; clearHistory(): void; getHeartbeatLastRun(taskName: string): number; setHeartbeatLastRun(taskName: string, timestamp: number): void; isHeartbeatEnabled(taskName: string): boolean; setHeartbeatEnabled(taskName: string, enabled: boolean): void; audit(action: string, details: string, txHash?: string): void; getAuditLog(limit?: number): AuditEntry[]; set(key: string, value: string): void; get(key: string): string | null; delete(key: string): void; getSoul(): string; setSoul(content: string): void; saveBunkerState(state: BunkerState): void; getBunkerState(): BunkerState | null; updateBunkerThreat(level: ThreatLevel): void; addBunkerClone(cloneId: string): void; removeBunkerClone(cloneId: string): void; getOrders(): import('@clawnch/clawncher-sdk').Order[]; saveOrders(orders: import('@clawnch/clawncher-sdk').Order[]): void; getRiskConfig(): RiskConfig | null; saveRiskConfig(config: RiskConfig): void; getTraderPositions(): TraderPosition[]; saveTraderPositions(positions: TraderPosition[]): void; getTraderTrades(): TraderTrade[]; saveTraderTrades(trades: TraderTrade[]): void; getTraderSnapshots(): TraderSnapshot[]; saveTraderSnapshots(snapshots: TraderSnapshot[]): void; getGasLedger(): GasEntry[]; saveGasLedger(entries: GasEntry[]): void; /** * Get a TraderStorage adapter for use with ClawnchTrader. */ asTraderStorage(): TraderStorage; /** * Get a RiskStorage adapter for use with ClawnchOrders. */ asRiskStorage(): RiskStorage; getHerdBookmarks(): HerdBookmarkRow[]; saveHerdBookmark(objectType: string, objectId: string, blockchain: string | null, label: string | null): void; removeHerdBookmark(objectType: string, objectId: string): void; clearHerdBookmarks(): void; getHerdCache(key: string): string | null; setHerdCache(key: string, data: string, ttlSeconds: number): void; clearHerdCache(): void; /** Remove expired entries from herd_cache. Call periodically to prevent unbounded growth. */ pruneHerdCache(): number; close(): void; } export interface AuditEntry { id: number; timestamp: number; action: string; details: string; tx_hash: string | null; } export interface HerdBookmarkRow { object_type: string; object_id: string; blockchain: string | null; label: string | null; cached_at: number; } //# sourceMappingURL=index.d.ts.map