Move state storage to Postgres
This commit is contained in:
parent
b4693f5609
commit
c3d2bf424e
18 changed files with 1667 additions and 470 deletions
|
|
@ -42,6 +42,7 @@ const envSchema = z.object({
|
|||
DISCORD_APPLICATION_ID: optionalNonEmptyString,
|
||||
DISCORD_GUILD_ID: optionalNonEmptyString,
|
||||
DISCORD_OWNER_ID: z.string().min(1, "DISCORD_OWNER_ID is required"),
|
||||
STATE_STORAGE_BACKEND: z.enum(["file", "postgres"]).default("postgres"),
|
||||
DATABASE_DSN: z.string().min(1).default("postgres://voidbot:voidbot@localhost:5432/voidbot"),
|
||||
VECTOR_STORE_KIND: z.enum(["local_json", "qdrant"]).default("local_json"),
|
||||
VECTOR_STORE_PATH: z.string().min(1).default(".voidbot/history-vector-store.json"),
|
||||
|
|
@ -102,6 +103,7 @@ export interface AppConfig {
|
|||
applicationId?: string;
|
||||
developmentGuildId?: string;
|
||||
ownerDiscordId: string;
|
||||
stateStorageBackend: "file" | "postgres";
|
||||
databaseDsn: string;
|
||||
enabledProviders: ProviderName[];
|
||||
ownerCodexMode: OwnerCodexMode;
|
||||
|
|
@ -260,6 +262,7 @@ export function loadConfig(env: NodeJS.ProcessEnv = process.env): AppConfig {
|
|||
applicationId: parsed.DISCORD_APPLICATION_ID,
|
||||
developmentGuildId: parsed.DISCORD_GUILD_ID,
|
||||
ownerDiscordId: parsed.DISCORD_OWNER_ID,
|
||||
stateStorageBackend: parsed.STATE_STORAGE_BACKEND,
|
||||
databaseDsn: parsed.DATABASE_DSN,
|
||||
enabledProviders: parseProviders(parsed.ENABLED_PROVIDERS),
|
||||
ownerCodexMode: parseOwnerCodexMode(parsed.OWNER_CODEX_MODE),
|
||||
|
|
|
|||
Loading…
Reference in a new issue