pi-ai-vault 0.9.0 → 0.9.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/package.json +2 -2
- package/src/cli.ts +15 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-ai-vault",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "pi extension for ai-vault: one machine-wide encrypted secret store plus live Bitwarden. Works in pi and in omp (the omp fork reads the same manifest).",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"security"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@xiaolikt/ai-vault": "0.9.
|
|
28
|
+
"@xiaolikt/ai-vault": "0.9.1"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@earendil-works/pi-coding-agent": "^1.5.0",
|
package/src/cli.ts
CHANGED
|
@@ -64,20 +64,29 @@ export function resolveBinary(): string | undefined {
|
|
|
64
64
|
// pip/npm layouts hoist differently: walk up from packages/pi-ai-vault/src.
|
|
65
65
|
let dir = dirname(fileURLToPath(import.meta.url));
|
|
66
66
|
for (let depth = 0; depth < 5; depth++) {
|
|
67
|
-
const
|
|
68
|
-
|
|
67
|
+
for (const name of process.platform === "win32" ? ["ai-vault.exe", "ai-vault.cmd", "ai-vault.ps1"] : ["ai-vault"]) {
|
|
68
|
+
const bundled = join(dir, "node_modules", ".bin", name);
|
|
69
|
+
if (existsSync(bundled)) return bundled;
|
|
70
|
+
}
|
|
69
71
|
const parent = dirname(dir);
|
|
70
72
|
if (parent === dir) break;
|
|
71
73
|
dir = parent;
|
|
72
74
|
}
|
|
73
75
|
|
|
76
|
+
// Windows has no execute bit and npm links .cmd/.ps1 wrappers beside the exe.
|
|
77
|
+
const names = process.platform === "win32" ? ["ai-vault.exe", "ai-vault.cmd", "ai-vault.ps1", "ai-vault"] : ["ai-vault"];
|
|
74
78
|
for (const entry of (process.env.PATH ?? "").split(delimiter)) {
|
|
75
79
|
if (!entry) continue;
|
|
76
|
-
const
|
|
77
|
-
|
|
80
|
+
for (const name of names) {
|
|
81
|
+
const candidate = join(entry, name);
|
|
82
|
+
if (existsSync(candidate)) return candidate;
|
|
83
|
+
}
|
|
78
84
|
}
|
|
79
|
-
for (const
|
|
80
|
-
|
|
85
|
+
for (const base of [join(homedir(), ".local", "bin"), join(homedir(), ".cargo", "bin"), join(homedir(), ".ai-vault", "bin")]) {
|
|
86
|
+
for (const name of names) {
|
|
87
|
+
const candidate = join(base, name);
|
|
88
|
+
if (existsSync(candidate)) return candidate;
|
|
89
|
+
}
|
|
81
90
|
}
|
|
82
91
|
return undefined;
|
|
83
92
|
}
|