Files
EvoScientist-WebUI/src/lib/server/dataDir.ts
T
m4 862cd4922e feat: unified model configuration — BFF auth, delegation JWT, thread model selection
- Multi-user auth (better-sqlite3 + scrypt) with admin/user roles and
  ES256 delegation JWT signing for EvoScientist Config API calls
- BFF config client sends Authorization: Bearer <service token> +
  X-Evo-Actor delegation JWT (design doc 7.3)
- Model registry admin API routes (GET/PUT registry, credential replace,
  provider test) proxying the backend with revision CAS
- ThreadModelSelection replaces model_override: PATCH CAS with
  expected_selection_revision, per-thread serialization, 409
  THREAD_MODEL_SELECTION_CONFLICT
- Run creation freezes a runtime snapshot per turn; command resumes reuse
  the turn's frozen snapshot from run metadata (design doc 7.2/8.2)
- Chat UI: ModelRef picker fed by GET /api/models selectable list; removed
  /model <name> command, localStorage preference, and set-default star
- Deleted lib/modelCommand.ts, lib/modelPreference.ts, lib/defaultModel.ts

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-07-21 18:50:17 +08:00

14 lines
454 B
TypeScript

import "server-only";
import { homedir } from "node:os";
import { join, resolve } from "node:path";
/** Root directory for WebUI-owned local state (users DB, delegation keys). */
export function webuiDataDir(): string {
const configured = process.env.EVOSCIENTIST_DATA_DIR?.trim();
if (!configured) return join(homedir(), ".evoscientist");
return configured.startsWith("~")
? join(homedir(), configured.slice(1))
: resolve(configured);
}