mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 22:03:48 +00:00
10 lines
535 B
JavaScript
10 lines
535 B
JavaScript
import { Database } from "bun:sqlite";
|
|
|
|
const db = new Database("/root/.local/share/openhandoff/rivetkit/databases/2e443238457137bf.db", { readonly: true });
|
|
const rows = db.query("SELECT hex(key) as k, value as v FROM kv WHERE hex(key) LIKE ? ORDER BY key").all("07%");
|
|
const out = rows.map((r) => {
|
|
const bytes = new Uint8Array(r.v);
|
|
const txt = new TextDecoder().decode(bytes).replace(/[\x00-\x1F\x7F-\xFF]/g, ".");
|
|
return { k: r.k, vlen: bytes.length, txt: txt.slice(0, 260) };
|
|
});
|
|
console.log(JSON.stringify(out, null, 2));
|