@inceptionstack/roundhouse 0.3.11 → 0.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cli/doctor/checks/credentials.ts +1 -1
- package/src/cli/setup.ts +3 -3
- package/src/config.ts +19 -5
package/package.json
CHANGED
|
@@ -22,7 +22,7 @@ export const credentialChecks: DoctorCheck[] = [
|
|
|
22
22
|
return {
|
|
23
23
|
id: "telegram-token", category: "credentials", name: "Telegram bot token",
|
|
24
24
|
status: "fail", summary: "TELEGRAM_BOT_TOKEN not set",
|
|
25
|
-
details: ["Set TELEGRAM_BOT_TOKEN in your environment or ~/.roundhouse
|
|
25
|
+
details: ["Set TELEGRAM_BOT_TOKEN in your environment or ~/.roundhouse/.env"],
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
if (!/^\d+:[A-Za-z0-9_-]+$/.test(token)) {
|
package/src/cli/setup.ts
CHANGED
|
@@ -630,7 +630,7 @@ async function stepConfigure(
|
|
|
630
630
|
}
|
|
631
631
|
|
|
632
632
|
await atomicWriteText(ENV_PATH, envLines.join("\n") + "\n");
|
|
633
|
-
ok(`~/.roundhouse
|
|
633
|
+
ok(`~/.roundhouse/.env${opts.psst ? " (non-secret config only)" : ""}`);
|
|
634
634
|
}
|
|
635
635
|
|
|
636
636
|
async function stepPair(opts: SetupOptions, botInfo: BotInfo): Promise<PairResult | null> {
|
|
@@ -873,7 +873,7 @@ export async function cmdSetup(argv: string[]): Promise<void> {
|
|
|
873
873
|
}
|
|
874
874
|
log(` Bot: @${botInfo.username}`);
|
|
875
875
|
log(` Memory: ${opts.extensions.some((e) => e.includes("pi-memory")) ? "agent-managed" : "roundhouse-managed"}`);
|
|
876
|
-
log(` Secrets: ${opts.psst ? "psst vault (encrypted)" : "~/.roundhouse
|
|
876
|
+
log(` Secrets: ${opts.psst ? "psst vault (encrypted)" : "~/.roundhouse/.env (plaintext)"}`);
|
|
877
877
|
log(` Send /status to @${botInfo.username} on Telegram.\n`);
|
|
878
878
|
} catch (err: any) {
|
|
879
879
|
log("\n━━━━━━━━━━━━━━━━━━━");
|
|
@@ -993,7 +993,7 @@ function printDryRun(opts: SetupOptions): void {
|
|
|
993
993
|
log(` Set defaultProvider: ${opts.provider}`);
|
|
994
994
|
log(` Set defaultModel: ${opts.model}`);
|
|
995
995
|
log(`Would write: ~/.roundhouse/gateway.config.json`);
|
|
996
|
-
log(`Would write: ~/.roundhouse
|
|
996
|
+
log(`Would write: ~/.roundhouse/.env${opts.psst ? " (non-secret config only)" : ""}`);
|
|
997
997
|
log(`Would register ${BOT_COMMANDS.length} bot commands`);
|
|
998
998
|
if (opts.systemd) log(`Would install systemd service`);
|
|
999
999
|
log("\nNo changes made.\n");
|
package/src/config.ts
CHANGED
|
@@ -21,7 +21,10 @@ export const LEGACY_CONFIG_DIR = resolve(homedir(), ".config", "roundhouse");
|
|
|
21
21
|
/** Active config directory — use ROUNDHOUSE_DIR */
|
|
22
22
|
export const CONFIG_DIR = ROUNDHOUSE_DIR;
|
|
23
23
|
export const CONFIG_PATH = resolve(ROUNDHOUSE_DIR, "gateway.config.json");
|
|
24
|
-
export const ENV_FILE_PATH = resolve(ROUNDHOUSE_DIR, "env");
|
|
24
|
+
export const ENV_FILE_PATH = resolve(ROUNDHOUSE_DIR, ".env");
|
|
25
|
+
|
|
26
|
+
/** Legacy env file name (deprecated) */
|
|
27
|
+
export const LEGACY_ENV_FILE_PATH = resolve(ROUNDHOUSE_DIR, "env");
|
|
25
28
|
|
|
26
29
|
/** Cron directories */
|
|
27
30
|
export const CRON_JOBS_DIR = resolve(ROUNDHOUSE_DIR, "crons");
|
|
@@ -109,15 +112,26 @@ export async function resolveConfigPath(): Promise<{ path: string; legacy: boole
|
|
|
109
112
|
let envFileWarned = false;
|
|
110
113
|
|
|
111
114
|
export async function resolveEnvFilePath(): Promise<string> {
|
|
115
|
+
// Canonical: ~/.roundhouse/.env
|
|
112
116
|
if (await fileExists(ENV_FILE_PATH)) return ENV_FILE_PATH;
|
|
113
|
-
|
|
114
|
-
if (await fileExists(
|
|
117
|
+
// Legacy: ~/.roundhouse/env (old name, same directory)
|
|
118
|
+
if (await fileExists(LEGACY_ENV_FILE_PATH)) {
|
|
119
|
+
if (!envFileWarned) {
|
|
120
|
+
envFileWarned = true;
|
|
121
|
+
console.warn(`[roundhouse] \u26a0\ufe0f Env file found at legacy path: ${LEGACY_ENV_FILE_PATH}`);
|
|
122
|
+
console.warn(`[roundhouse] Rename it to ${ENV_FILE_PATH} \u2014 legacy name will be removed in a future version.`);
|
|
123
|
+
}
|
|
124
|
+
return LEGACY_ENV_FILE_PATH;
|
|
125
|
+
}
|
|
126
|
+
// Legacy: ~/.config/roundhouse/env (old directory)
|
|
127
|
+
const legacyDirEnv = resolve(LEGACY_CONFIG_DIR, "env");
|
|
128
|
+
if (await fileExists(legacyDirEnv)) {
|
|
115
129
|
if (!envFileWarned) {
|
|
116
130
|
envFileWarned = true;
|
|
117
|
-
console.warn(`[roundhouse] \u26a0\ufe0f Env file found at legacy path: ${
|
|
131
|
+
console.warn(`[roundhouse] \u26a0\ufe0f Env file found at legacy path: ${legacyDirEnv}`);
|
|
118
132
|
console.warn(`[roundhouse] Move it to ${ENV_FILE_PATH} \u2014 legacy path will be removed in a future version.`);
|
|
119
133
|
}
|
|
120
|
-
return
|
|
134
|
+
return legacyDirEnv;
|
|
121
135
|
}
|
|
122
136
|
return ENV_FILE_PATH;
|
|
123
137
|
}
|