Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions LifeOS/install/LIFEOS/TOOLS/DeriveDenyHashes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
* token, so filtering here keeps the scan precise. Tune ALLOWLIST/STOPWORDS with
* --show-tokens.
*/
import { readFileSync, writeFileSync, existsSync, appendFileSync, readdirSync } from "node:fs";
import { readFileSync, writeFileSync, existsSync, appendFileSync, readdirSync, mkdirSync } from "node:fs";
import { homedir } from "node:os";
import { join } from "node:path";
import { join, dirname } from "node:path";
import { createHash, randomBytes } from "node:crypto";

const HOME = process.env.HOME || homedir();
Expand Down Expand Up @@ -198,6 +198,7 @@ function main(): void {
note: "Salted hashes of distinctive private tokens. No plaintext. Salt in .env (never ships).",
hashes,
};
mkdirSync(dirname(OUT_PATH), { recursive: true }); // self-create output dir (e.g. skills/_LIFEOS absent on a fresh/partial install)
writeFileSync(OUT_PATH, JSON.stringify(payload, null, 0) + "\n");
console.log(`[DeriveDenyHashes] wrote ${hashes.length} salted hashes -> ${OUT_PATH} (no plaintext)`);
}
Expand Down