@jpcasabiancai/cayenne 0.1.0 → 0.1.1
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/dist/cli.js +14 -12
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3101,6 +3101,14 @@ async function logout(db) {
|
|
|
3101
3101
|
}
|
|
3102
3102
|
|
|
3103
3103
|
// src/commands/doctor.ts
|
|
3104
|
+
async function probeBackend(url, anonKey, fetchFn = fetch) {
|
|
3105
|
+
try {
|
|
3106
|
+
await fetchFn(`${url}/auth/v1/health`, { headers: { apikey: anonKey } });
|
|
3107
|
+
return true;
|
|
3108
|
+
} catch {
|
|
3109
|
+
return false;
|
|
3110
|
+
}
|
|
3111
|
+
}
|
|
3104
3112
|
async function doctor(deps) {
|
|
3105
3113
|
const checks = [];
|
|
3106
3114
|
checks.push(
|
|
@@ -3571,11 +3579,12 @@ program.command("down").description("Stop the background service").action(async
|
|
|
3571
3579
|
});
|
|
3572
3580
|
program.command("doctor").description("Check the install and say how to fix what is broken").action(async () => {
|
|
3573
3581
|
const { exec: exec2, launchd, label } = service();
|
|
3574
|
-
let
|
|
3582
|
+
let backend = null;
|
|
3575
3583
|
try {
|
|
3576
|
-
|
|
3584
|
+
const cfg = config();
|
|
3585
|
+
backend = { url: cfg.supabaseUrl, anonKey: cfg.supabaseAnonKey };
|
|
3577
3586
|
} catch {
|
|
3578
|
-
|
|
3587
|
+
backend = null;
|
|
3579
3588
|
}
|
|
3580
3589
|
const checks = await doctor({
|
|
3581
3590
|
record: readInstallRecord(cayenneDir()),
|
|
@@ -3583,15 +3592,8 @@ program.command("doctor").description("Check the install and say how to fix what
|
|
|
3583
3592
|
claudeOnPath: await which(exec2, "claude"),
|
|
3584
3593
|
label,
|
|
3585
3594
|
launchd,
|
|
3586
|
-
backendUrl,
|
|
3587
|
-
probe:
|
|
3588
|
-
try {
|
|
3589
|
-
const res = await fetch(`${url}/auth/v1/health`);
|
|
3590
|
-
return res.ok;
|
|
3591
|
-
} catch {
|
|
3592
|
-
return false;
|
|
3593
|
-
}
|
|
3594
|
-
}
|
|
3595
|
+
backendUrl: backend?.url ?? null,
|
|
3596
|
+
probe: (url) => probeBackend(url, backend?.anonKey ?? "")
|
|
3595
3597
|
});
|
|
3596
3598
|
for (const c of checks) {
|
|
3597
3599
|
console.log(`${c.ok ? "ok " : "FAIL"} ${c.name}: ${c.detail}`);
|