mirror of
https://github.com/wu736139669/hapi.git
synced 2026-10-27 22:51:43 +00:00
c2b886896bdc6dd4135e656be3584f43310deea4
Implements comprehensive token management with intelligent priority resolution. Token sources (highest to lowest priority): environment variable, settings file, interactive prompt. Changes include: - Updated home directory from ~/.happy to ~/.config/hapi (env var: HAPI_HOME_DIR) - Added cliApiToken field to Settings interface for persistent storage - Made cliApiToken mutable in Configuration class (private field with getter/setter) - Created ui/tokenInit.ts module for token initialization with fallback prompt - Enhanced auth command: login (interactive input), logout (clear token), status (show source) - Updated doctor command to correctly identify token source and mask saved token in output - Token initialization called early in startup flow to ensure availability before API use
hapi
Monorepo with three Bun workspace packages:
cli/(hapi): CLI (npm package) exposinghapi/hapi-mcpserver/(hapi-server): backend API + Telegram bot server, servesweb/dist/web/(hapi-web): web frontend (Vite) building toweb/dist/
Commands
Run from the repo root:
bun install
bun run typecheck
bun run build
Languages
TypeScript
99.5%
CSS
0.2%
JavaScript
0.2%