mirror of
https://github.com/stablyai/orca.git
synced 2026-11-01 09:37:33 +00:00
fix(ai-vault): require node:sqlite backup support in remote SQLite probes (#24086)
* fix(ai-vault): require the full SyncDatabase node:sqlite surface in host SQLite probes The SSH and WSL OpenCode probes admitted any Node with DatabaseSync, so Node 22.13-22.15 hosts (no backup export) skipped the pinned-runtime fallback. Share one admission predicate with isSqliteAvailable() and embed its source in both probe scripts. * build(cli): list the node:sqlite admission predicate in the CLI project --------- Co-authored-by: m4air <m4air@m4airs-Air.localdomain>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Source of the node:sqlite admission check, embedded in remote/WSL probe scripts so a
|
||||
* host's Node passes exactly when `isSqliteAvailable()` would admit it there.
|
||||
* Why `backup`: it landed with the DatabaseSync options SyncDatabase relies on (Node 22.16),
|
||||
* so Node 22.13–22.15 must take the pinned-runtime fallback.
|
||||
*/
|
||||
export const NODE_SQLITE_READER_API_SOURCE =
|
||||
"(m)=>typeof m==='object'&&m!==null&&typeof m.DatabaseSync==='function'&&typeof m.backup==='function'"
|
||||
|
||||
/** In-process twin of {@link NODE_SQLITE_READER_API_SOURCE}; a parity test keeps them equal. */
|
||||
export function hasNodeSqliteReaderApi(sqlite: unknown): boolean {
|
||||
return (
|
||||
typeof sqlite === 'object' &&
|
||||
sqlite !== null &&
|
||||
'DatabaseSync' in sqlite &&
|
||||
typeof sqlite.DatabaseSync === 'function' &&
|
||||
'backup' in sqlite &&
|
||||
typeof sqlite.backup === 'function'
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user