{"version":3,"sources":["../src/adapter.ts","../src/initRandomSource.ts"],"sourcesContent":["import type * as SQLite from 'expo-sqlite';\nimport type { SQLiteAdapter } from '@equationalapplications/core-llm-wiki';\n\nexport function createExpoAdapter(db: SQLite.SQLiteDatabase): SQLiteAdapter {\n  const adapter: SQLiteAdapter = {\n    execAsync: (sql) => db.execAsync(sql),\n    runAsync: async (sql, params = []) => {\n      const result = await db.runAsync(sql, params as any[]);\n      return { changes: result.changes, lastInsertRowId: result.lastInsertRowId };\n    },\n    getAllAsync: (sql, params = []) => db.getAllAsync(sql, params as any[]),\n    getFirstAsync: (sql, params = []) => db.getFirstAsync(sql, params as any[]),\n    withTransactionAsync: <T>(fn: (tx: SQLiteAdapter) => Promise<T>): Promise<T> => {\n      // expo-sqlite only accepts () => Promise<void>; capture the result to satisfy the generic interface\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      let captured: any;\n      return db.withTransactionAsync(() => fn(adapter).then(v => { captured = v; })).then(() => captured as T);\n    },\n    closeAsync: () => db.closeAsync(),\n  };\n  return adapter;\n}\n","import { getRandomValues } from 'expo-crypto';\nimport { configureRandomSource } from '@equationalapplications/core-llm-wiki';\n\n// Install expo-crypto as the random source for Hermes / React Native, where\n// the global `crypto` API is absent. Runs once at module load — any import of\n// `@equationalapplications/expo-llm-wiki` or its `/factory` subpath activates it.\nconfigureRandomSource(getRandomValues);\n"],"mappings":";AAGO,SAAS,kBAAkB,IAA0C;AAC1E,QAAM,UAAyB;AAAA,IAC7B,WAAW,CAAC,QAAQ,GAAG,UAAU,GAAG;AAAA,IACpC,UAAU,OAAO,KAAK,SAAS,CAAC,MAAM;AACpC,YAAM,SAAS,MAAM,GAAG,SAAS,KAAK,MAAe;AACrD,aAAO,EAAE,SAAS,OAAO,SAAS,iBAAiB,OAAO,gBAAgB;AAAA,IAC5E;AAAA,IACA,aAAa,CAAC,KAAK,SAAS,CAAC,MAAM,GAAG,YAAY,KAAK,MAAe;AAAA,IACtE,eAAe,CAAC,KAAK,SAAS,CAAC,MAAM,GAAG,cAAc,KAAK,MAAe;AAAA,IAC1E,sBAAsB,CAAI,OAAsD;AAG9E,UAAI;AACJ,aAAO,GAAG,qBAAqB,MAAM,GAAG,OAAO,EAAE,KAAK,OAAK;AAAE,mBAAW;AAAA,MAAG,CAAC,CAAC,EAAE,KAAK,MAAM,QAAa;AAAA,IACzG;AAAA,IACA,YAAY,MAAM,GAAG,WAAW;AAAA,EAClC;AACA,SAAO;AACT;;;ACrBA,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AAKtC,sBAAsB,eAAe;","names":[]}