(xcodeBase: string)
| 44 | } |
| 45 | |
| 46 | function findXcodeDbFiles(xcodeBase: string): string[] { |
| 47 | const dbFiles: string[] = []; |
| 48 | try { |
| 49 | const machineIds = fs.readdirSync(xcodeBase, { withFileTypes: true }) |
| 50 | .filter(e => e.isDirectory()); |
| 51 | for (const mid of machineIds) { |
| 52 | const convDir = path.join(xcodeBase, mid.name, 'conversations'); |
| 53 | collectDbFilesFromDir(convDir, dbFiles); |
| 54 | } |
| 55 | } catch (e) { |
| 56 | console.debug(`Cannot read Xcode dir ${xcodeBase}:`, e instanceof Error ? e.message : e); |
| 57 | } |
| 58 | return dbFiles; |
| 59 | } |
| 60 | |
| 61 | /** Quote a string as a SQLite literal (doubling embedded quotes) so the |
| 62 | * conversation-ID allowlist checks are defence-in-depth rather than the |
no test coverage detected