wispy-cli 2.6.0 → 2.6.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/core/config.mjs +15 -2
- package/package.json +1 -1
package/core/config.mjs
CHANGED
|
@@ -63,12 +63,25 @@ export const PROVIDERS = {
|
|
|
63
63
|
};
|
|
64
64
|
|
|
65
65
|
async function tryKeychainKey(service) {
|
|
66
|
+
if (process.platform !== "darwin") return null;
|
|
66
67
|
try {
|
|
67
68
|
const { execFile } = await import("node:child_process");
|
|
68
69
|
const { promisify } = await import("node:util");
|
|
69
70
|
const exec = promisify(execFile);
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
|
|
72
|
+
// Try multiple account names: wispy, poropo (OpenClaw compat), then no account (any)
|
|
73
|
+
const accounts = ["wispy", "poropo"];
|
|
74
|
+
for (const account of accounts) {
|
|
75
|
+
try {
|
|
76
|
+
const { stdout } = await exec("security", ["find-generic-password", "-s", service, "-a", account, "-w"], { timeout: 2000 });
|
|
77
|
+
if (stdout.trim()) return stdout.trim();
|
|
78
|
+
} catch { /* try next */ }
|
|
79
|
+
}
|
|
80
|
+
// Fallback: no account filter (finds any entry with this service name)
|
|
81
|
+
try {
|
|
82
|
+
const { stdout } = await exec("security", ["find-generic-password", "-s", service, "-w"], { timeout: 2000 });
|
|
83
|
+
return stdout.trim() || null;
|
|
84
|
+
} catch { return null; }
|
|
72
85
|
} catch { return null; }
|
|
73
86
|
}
|
|
74
87
|
|