@inceptionstack/roundhouse 0.3.10 → 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
CHANGED
|
@@ -12,18 +12,28 @@ export const agentChecks: DoctorCheck[] = [
|
|
|
12
12
|
{
|
|
13
13
|
id: "pi-sdk", category: "agent", name: "Pi SDK",
|
|
14
14
|
async run() {
|
|
15
|
+
const PI_PKG = join("@mariozechner", "pi-coding-agent", "package.json");
|
|
16
|
+
const searchPaths = [
|
|
17
|
+
join(process.cwd(), "node_modules", PI_PKG),
|
|
18
|
+
];
|
|
19
|
+
// Also check global npm root
|
|
15
20
|
try {
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
const { execFileSync } = await import("node:child_process");
|
|
22
|
+
const globalRoot = execFileSync("npm", ["root", "-g"], { encoding: "utf8" }).trim();
|
|
23
|
+
searchPaths.push(join(globalRoot, PI_PKG));
|
|
24
|
+
} catch {}
|
|
25
|
+
for (const pkgPath of searchPaths) {
|
|
26
|
+
try {
|
|
27
|
+
const raw = await readFile(pkgPath, "utf8");
|
|
28
|
+
const ver = JSON.parse(raw).version;
|
|
29
|
+
return { id: "pi-sdk", category: "agent", name: "Pi SDK", status: "pass" as const, summary: `v${ver}` };
|
|
30
|
+
} catch {}
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
id: "pi-sdk", category: "agent", name: "Pi SDK", status: "fail" as const, summary: "not found",
|
|
23
34
|
details: ["@mariozechner/pi-coding-agent not installed"],
|
|
24
35
|
fix: { description: "Install pi SDK", command: "npm install @mariozechner/pi-coding-agent" },
|
|
25
36
|
};
|
|
26
|
-
}
|
|
27
37
|
},
|
|
28
38
|
},
|
|
29
39
|
|
|
@@ -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
|
@@ -181,7 +181,7 @@ export function parseSetupArgs(argv: string[]): SetupOptions {
|
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
// Validate
|
|
184
|
-
if (!opts.botToken) {
|
|
184
|
+
if (!opts.botToken && !opts.dryRun) {
|
|
185
185
|
throw new Error(
|
|
186
186
|
"Bot token required. Provide via:\n" +
|
|
187
187
|
" TELEGRAM_BOT_TOKEN=... roundhouse setup --user USERNAME\n" +
|
|
@@ -451,7 +451,11 @@ async function stepInstallPackages(opts: SetupOptions): Promise<void> {
|
|
|
451
451
|
}
|
|
452
452
|
|
|
453
453
|
async function stepStoreSecrets(opts: SetupOptions, botInfo: BotInfo): Promise<void> {
|
|
454
|
-
if (!opts.psst)
|
|
454
|
+
if (!opts.psst) {
|
|
455
|
+
step("⑥", "Storing secrets...");
|
|
456
|
+
ok("Skipped (--no-psst)");
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
455
459
|
|
|
456
460
|
step("⑥", "Storing secrets in psst...");
|
|
457
461
|
|
|
@@ -626,7 +630,7 @@ async function stepConfigure(
|
|
|
626
630
|
}
|
|
627
631
|
|
|
628
632
|
await atomicWriteText(ENV_PATH, envLines.join("\n") + "\n");
|
|
629
|
-
ok(`~/.roundhouse
|
|
633
|
+
ok(`~/.roundhouse/.env${opts.psst ? " (non-secret config only)" : ""}`);
|
|
630
634
|
}
|
|
631
635
|
|
|
632
636
|
async function stepPair(opts: SetupOptions, botInfo: BotInfo): Promise<PairResult | null> {
|
|
@@ -869,7 +873,7 @@ export async function cmdSetup(argv: string[]): Promise<void> {
|
|
|
869
873
|
}
|
|
870
874
|
log(` Bot: @${botInfo.username}`);
|
|
871
875
|
log(` Memory: ${opts.extensions.some((e) => e.includes("pi-memory")) ? "agent-managed" : "roundhouse-managed"}`);
|
|
872
|
-
log(` Secrets: ${opts.psst ? "psst vault (encrypted)" : "~/.roundhouse
|
|
876
|
+
log(` Secrets: ${opts.psst ? "psst vault (encrypted)" : "~/.roundhouse/.env (plaintext)"}`);
|
|
873
877
|
log(` Send /status to @${botInfo.username} on Telegram.\n`);
|
|
874
878
|
} catch (err: any) {
|
|
875
879
|
log("\n━━━━━━━━━━━━━━━━━━━");
|
|
@@ -989,7 +993,7 @@ function printDryRun(opts: SetupOptions): void {
|
|
|
989
993
|
log(` Set defaultProvider: ${opts.provider}`);
|
|
990
994
|
log(` Set defaultModel: ${opts.model}`);
|
|
991
995
|
log(`Would write: ~/.roundhouse/gateway.config.json`);
|
|
992
|
-
log(`Would write: ~/.roundhouse
|
|
996
|
+
log(`Would write: ~/.roundhouse/.env${opts.psst ? " (non-secret config only)" : ""}`);
|
|
993
997
|
log(`Would register ${BOT_COMMANDS.length} bot commands`);
|
|
994
998
|
if (opts.systemd) log(`Would install systemd service`);
|
|
995
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
|
}
|