mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
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:
+1
-1
@@ -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
@@ -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
|
||||
|
||||
|
||||
@@ -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'}`))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
*/
|
||||
|
||||
|
||||
@@ -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')}`);
|
||||
|
||||
@@ -51,9 +51,9 @@ class Logger {
|
||||
public readonly logFilePath = getSessionLogPath()
|
||||
) {
|
||||
// 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
|
||||
if (process.env.DANGEROUSLY_LOG_TO_SERVER_FOR_AI_AUTO_DEBUGGING
|
||||
&& 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'))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user