feat!: redesign model config + auth profiles
This commit is contained in:
1 parent
bd2e003171
commit
b04c838c15
60 files changed
+2037
-790
No files matched your search
+9
-1
@@ -1,6 +1,5 @@
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { resolveUserPath } from "../utils.js";
|
||||
import type { ClawdbotConfig } from "./types.js";
|
||||
|
||||
/**
|
||||
@@ -33,6 +32,15 @@ export function resolveStateDir(
|
||||
return path.join(homedir(), ".clawdbot");
|
||||
}
|
||||
|
||||
function resolveUserPath(input: string): string {
|
||||
const trimmed = input.trim();
|
||||
if (!trimmed) return trimmed;
|
||||
if (trimmed.startsWith("~")) {
|
||||
return path.resolve(trimmed.replace("~", os.homedir()));
|
||||
}
|
||||
return path.resolve(trimmed);
|
||||
}
|
||||
|
||||
export const STATE_DIR_CLAWDBOT = resolveStateDir();
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user