refactor(open-sse): remove reverse coupling open-sse -> src (E2)
Move clineAuth into open-sse/shared (src re-exports back). Add standalone open-sse/shared/machineId for codex session hashing (no @/lib/dataDir). sttCore receives sttConfig via param instead of importing AI_PROVIDERS. No behavior change; gate: no regression (26 known-fails unchanged). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
19
open-sse/shared/machineId.js
Normal file
19
open-sse/shared/machineId.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import { machineIdSync } from "node-machine-id";
|
||||
import crypto from "node:crypto";
|
||||
|
||||
let cachedRawId = null;
|
||||
|
||||
function loadRawMachineId() {
|
||||
if (cachedRawId) return cachedRawId;
|
||||
try {
|
||||
cachedRawId = machineIdSync();
|
||||
} catch {
|
||||
cachedRawId = crypto.randomUUID();
|
||||
}
|
||||
return cachedRawId;
|
||||
}
|
||||
|
||||
export async function getConsistentMachineId(salt = "endpoint-proxy-salt") {
|
||||
const rawId = loadRawMachineId();
|
||||
return crypto.createHash("sha256").update(rawId + salt).digest("hex").substring(0, 16);
|
||||
}
|
||||
Reference in New Issue
Block a user