refactor: rename HAPI_BOT_URL to HAPI_SERVER_URL

The project is no longer primarily a bot - it now provides HTTP API,
Socket.IO, SSE, and web app backend services. This rename reflects the
broader scope of server functionality.

Updates references in:
- cli/src/configuration.ts (core config)
- cli/src/ui/logger.ts (remote logging)
- cli/src/ui/doctor.ts (diagnostics)
- cli/src/commands/auth.ts (auth status)
- cli/src/daemon/daemon.integration.test.ts (test comments)
- README.md (quickstart docs)
- cli/README.md (CLI docs)
- cli/CLAUDE.md (dev docs)
This commit is contained in:
weishu
2025-12-24 19:15:47 +08:00
parent 4017590af9
commit 958e78dc6e
8 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ npx @twsxtd/hapi server
```bash
# If the server is not on localhost:3006
export HAPI_BOT_URL="https://your-domain.example"
export HAPI_SERVER_URL="https://your-domain.example"
npx @twsxtd/hapi
```
+1 -1
View File
@@ -139,7 +139,7 @@ User interface components.
hapi daemon start
# With custom bot URL (for local development):
HAPI_BOT_URL=http://localhost:3006 CLI_API_TOKEN=your_token hapi daemon start
HAPI_SERVER_URL=http://localhost:3006 CLI_API_TOKEN=your_token hapi daemon start
# Stop the daemon:
hapi daemon stop
+1 -1
View File
@@ -66,7 +66,7 @@ See `src/configuration.ts` for all options.
### Required
- `CLI_API_TOKEN` - Shared secret; must match the server. Can be set via env or `~/.hapi/settings.json` (env wins).
- `HAPI_BOT_URL` - Server base URL (default: http://localhost:3006).
- `HAPI_SERVER_URL` - Server base URL (default: http://localhost:3006).
### Optional
+1 -1
View File
@@ -20,7 +20,7 @@ export async function handleAuthCommand(args: string[]): Promise<void> {
const hasToken = Boolean(envToken || settingsToken)
const tokenSource = envToken ? 'environment' : (settingsToken ? 'settings file' : 'none')
console.log(chalk.bold('\nDirect Connect Status\n'))
console.log(chalk.gray(` HAPI_BOT_URL: ${configuration.serverUrl}`))
console.log(chalk.gray(` HAPI_SERVER_URL: ${configuration.serverUrl}`))
console.log(chalk.gray(` CLI_API_TOKEN: ${hasToken ? 'set' : 'missing'}`))
console.log(chalk.gray(` Token Source: ${tokenSource}`))
console.log(chalk.gray(` Machine ID: ${settings.machineId ?? 'not set'}`))
+2 -2
View File
@@ -27,8 +27,8 @@ class Configuration {
public readonly isExperimentalEnabled: boolean
constructor() {
// Bot server configuration
this.serverUrl = process.env.HAPI_BOT_URL || 'http://localhost:3006'
// Server configuration
this.serverUrl = process.env.HAPI_SERVER_URL || 'http://localhost:3006'
this._cliApiToken = process.env.CLI_API_TOKEN || ''
// Check if we're running as daemon based on process args
+1 -1
View File
@@ -11,7 +11,7 @@
*
* The integration test environment uses .env.integration-test which sets:
* - HAPI_HOME=~/.hapi-dev-test (DIFFERENT from dev's ~/.hapi-dev!)
* - HAPI_BOT_URL=http://localhost:3006 (local hapi-server)
* - HAPI_SERVER_URL=http://localhost:3006 (local hapi-server)
* - CLI_API_TOKEN=... (must match the server)
*/
+2 -2
View File
@@ -24,7 +24,7 @@ export function getEnvironmentInfo(): Record<string, any> {
return {
PWD: process.env.PWD,
HAPI_HOME: process.env.HAPI_HOME,
HAPI_BOT_URL: process.env.HAPI_BOT_URL,
HAPI_SERVER_URL: process.env.HAPI_SERVER_URL,
HAPI_PROJECT_ROOT: process.env.HAPI_PROJECT_ROOT,
CLI_API_TOKEN_SET: Boolean(process.env.CLI_API_TOKEN),
DANGEROUSLY_LOG_TO_SERVER_FOR_AI_AUTO_DEBUGGING: process.env.DANGEROUSLY_LOG_TO_SERVER_FOR_AI_AUTO_DEBUGGING,
@@ -114,7 +114,7 @@ export async function runDoctorCommand(filter?: 'all' | 'daemon'): Promise<void>
console.log(chalk.bold('\n🌍 Environment Variables'));
const env = getEnvironmentInfo();
console.log(`HAPI_HOME: ${env.HAPI_HOME ? chalk.green(env.HAPI_HOME) : chalk.gray('not set')}`);
console.log(`HAPI_BOT_URL: ${env.HAPI_BOT_URL ? chalk.green(env.HAPI_BOT_URL) : chalk.gray('not set')}`);
console.log(`HAPI_SERVER_URL: ${env.HAPI_SERVER_URL ? chalk.green(env.HAPI_SERVER_URL) : chalk.gray('not set')}`);
console.log(`CLI_API_TOKEN: ${env.CLI_API_TOKEN_SET ? chalk.green('set') : chalk.gray('not set')}`);
console.log(`DANGEROUSLY_LOG_TO_SERVER: ${env.DANGEROUSLY_LOG_TO_SERVER_FOR_AI_AUTO_DEBUGGING ? chalk.yellow('ENABLED') : chalk.gray('not set')}`);
console.log(`DEBUG: ${env.DEBUG ? chalk.green(env.DEBUG) : chalk.gray('not set')}`);
+2 -2
View File
@@ -52,8 +52,8 @@ class Logger {
) {
// Remote logging enabled only when explicitly set with server URL
if (process.env.DANGEROUSLY_LOG_TO_SERVER_FOR_AI_AUTO_DEBUGGING
&& process.env.HAPI_BOT_URL) {
this.dangerouslyUnencryptedServerLoggingUrl = process.env.HAPI_BOT_URL
&& process.env.HAPI_SERVER_URL) {
this.dangerouslyUnencryptedServerLoggingUrl = process.env.HAPI_SERVER_URL
console.log(chalk.yellow('[REMOTE LOGGING] Sending logs to server for AI debugging'))
}
}