diff --git a/src/infra/node-pairing.ts b/src/infra/node-pairing.ts index e98a2b556..4c762b023 100644 --- a/src/infra/node-pairing.ts +++ b/src/infra/node-pairing.ts @@ -1,7 +1,7 @@ import { randomUUID } from "node:crypto"; import fs from "node:fs/promises"; -import os from "node:os"; import path from "node:path"; +import { resolveStateDir } from "../config/paths.js"; export type NodePairingPendingRequest = { requestId: string; @@ -48,12 +48,8 @@ type NodePairingStateFile = { const PENDING_TTL_MS = 5 * 60 * 1000; -function defaultBaseDir() { - return path.join(os.homedir(), ".clawdbot"); -} - function resolvePaths(baseDir?: string) { - const root = baseDir ?? defaultBaseDir(); + const root = baseDir ?? resolveStateDir(); const dir = path.join(root, "nodes"); return { dir, diff --git a/src/infra/voicewake.ts b/src/infra/voicewake.ts index 379c634b0..6ffb3c53f 100644 --- a/src/infra/voicewake.ts +++ b/src/infra/voicewake.ts @@ -1,7 +1,7 @@ import { randomUUID } from "node:crypto"; import fs from "node:fs/promises"; -import os from "node:os"; import path from "node:path"; +import { resolveStateDir } from "../config/paths.js"; export type VoiceWakeConfig = { triggers: string[]; @@ -10,12 +10,8 @@ export type VoiceWakeConfig = { const DEFAULT_TRIGGERS = ["clawd", "claude", "computer"]; -function defaultBaseDir() { - return path.join(os.homedir(), ".clawdbot"); -} - function resolvePath(baseDir?: string) { - const root = baseDir ?? defaultBaseDir(); + const root = baseDir ?? resolveStateDir(); return path.join(root, "settings", "voicewake.json"); }