@elizaos/vault 2.0.0-alpha.537
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/README.md +159 -0
- package/dist/audit.d.ts +14 -0
- package/dist/audit.d.ts.map +1 -0
- package/dist/audit.js +27 -0
- package/dist/audit.js.map +1 -0
- package/dist/credentials.d.ts +58 -0
- package/dist/credentials.d.ts.map +1 -0
- package/dist/credentials.js +157 -0
- package/dist/credentials.js.map +1 -0
- package/dist/crypto.d.ts +18 -0
- package/dist/crypto.d.ts.map +1 -0
- package/dist/crypto.js +67 -0
- package/dist/crypto.js.map +1 -0
- package/dist/external-credentials.d.ts +62 -0
- package/dist/external-credentials.d.ts.map +1 -0
- package/dist/external-credentials.js +335 -0
- package/dist/external-credentials.js.map +1 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/install.d.ts +70 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +163 -0
- package/dist/install.js.map +1 -0
- package/dist/inventory.d.ts +140 -0
- package/dist/inventory.d.ts.map +1 -0
- package/dist/inventory.js +319 -0
- package/dist/inventory.js.map +1 -0
- package/dist/manager.d.ts +161 -0
- package/dist/manager.d.ts.map +1 -0
- package/dist/manager.js +466 -0
- package/dist/manager.js.map +1 -0
- package/dist/master-key.d.ts +86 -0
- package/dist/master-key.d.ts.map +1 -0
- package/dist/master-key.js +247 -0
- package/dist/master-key.js.map +1 -0
- package/dist/password-managers.d.ts +17 -0
- package/dist/password-managers.d.ts.map +1 -0
- package/dist/password-managers.js +59 -0
- package/dist/password-managers.js.map +1 -0
- package/dist/profiles.d.ts +68 -0
- package/dist/profiles.d.ts.map +1 -0
- package/dist/profiles.js +189 -0
- package/dist/profiles.js.map +1 -0
- package/dist/store.d.ts +22 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +137 -0
- package/dist/store.js.map +1 -0
- package/dist/testing.d.ts +32 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +70 -0
- package/dist/testing.js.map +1 -0
- package/dist/types.d.ts +56 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +12 -0
- package/dist/types.js.map +1 -0
- package/dist/vault.d.ts +77 -0
- package/dist/vault.d.ts.map +1 -0
- package/dist/vault.js +269 -0
- package/dist/vault.js.map +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External credential adapters for password-manager backends.
|
|
3
|
+
*
|
|
4
|
+
* Reads Login items out of `op` (1Password) and `bw` (Bitwarden) using the
|
|
5
|
+
* session token persisted by the secrets-manager installer at
|
|
6
|
+
* `pm.<backend>.session`. Returns a uniform shape so the manager layer can
|
|
7
|
+
* merge them with the in-house saved-logins list.
|
|
8
|
+
*
|
|
9
|
+
* list* → metadata only, never returns passwords
|
|
10
|
+
* reveal* → explicit second step, returns username + password (+ totp)
|
|
11
|
+
*
|
|
12
|
+
* The CLI is shelled out via an injected `ExecFn` so tests can stub the
|
|
13
|
+
* subprocess without spawning real processes.
|
|
14
|
+
*/
|
|
15
|
+
export class BackendNotSignedInError extends Error {
|
|
16
|
+
source;
|
|
17
|
+
constructor(source) {
|
|
18
|
+
super(`[${source}] not signed in — sign in via Settings → Secrets storage`);
|
|
19
|
+
this.source = source;
|
|
20
|
+
this.name = "BackendNotSignedInError";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export async function listOnePasswordLogins(vault, exec) {
|
|
24
|
+
const sessionArgs = await readOnePasswordSessionArgs(vault, exec);
|
|
25
|
+
// Step 1: list Login items as JSON. `--format=json` is the documented
|
|
26
|
+
// machine-readable form; the example in `op item list --help` chains it
|
|
27
|
+
// into `op item get -` which is what we do for username enrichment.
|
|
28
|
+
// When 1Password desktop integration is active, `sessionArgs` is empty
|
|
29
|
+
// and the CLI authenticates via the desktop app.
|
|
30
|
+
const listOut = await exec("op", [...sessionArgs, "item", "list", "--categories", "Login", "--format=json"], { timeoutMs: 10_000 });
|
|
31
|
+
const items = parseJsonArray(listOut.stdout);
|
|
32
|
+
if (items.length === 0)
|
|
33
|
+
return [];
|
|
34
|
+
// The 1Password CLI exposes the username as `additional_information` on
|
|
35
|
+
// every Login item summary. No per-item enrichment needed for the list
|
|
36
|
+
// view. Reveal still calls `op item get <id>` to fetch the password.
|
|
37
|
+
const out = [];
|
|
38
|
+
for (const item of items) {
|
|
39
|
+
const url = pickPrimaryUrl(item.urls);
|
|
40
|
+
const username = typeof item.additional_information === "string"
|
|
41
|
+
? item.additional_information
|
|
42
|
+
: "";
|
|
43
|
+
out.push({
|
|
44
|
+
source: "1password",
|
|
45
|
+
externalId: item.id,
|
|
46
|
+
title: typeof item.title === "string" && item.title.length > 0
|
|
47
|
+
? item.title
|
|
48
|
+
: item.id,
|
|
49
|
+
username,
|
|
50
|
+
domain: url ? extractHostname(url) : null,
|
|
51
|
+
url: url ?? null,
|
|
52
|
+
updatedAt: parseDate(item.updated_at),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return out;
|
|
56
|
+
}
|
|
57
|
+
export async function revealOnePasswordLogin(vault, exec, externalId) {
|
|
58
|
+
if (!externalId)
|
|
59
|
+
throw new TypeError("revealOnePasswordLogin: externalId required");
|
|
60
|
+
const sessionArgs = await readOnePasswordSessionArgs(vault, exec);
|
|
61
|
+
// `op item get <id> --format=json` includes the full `fields` array with
|
|
62
|
+
// values for username/password/totp.
|
|
63
|
+
const out = await exec("op", [...sessionArgs, "item", "get", externalId, "--format=json"], { timeoutMs: 10_000 });
|
|
64
|
+
const item = parseJsonObject(out.stdout);
|
|
65
|
+
const username = pickOnePasswordUsername(item) ?? "";
|
|
66
|
+
const password = pickOnePasswordField(item, "password") ?? "";
|
|
67
|
+
const totp = pickOnePasswordField(item, "one-time password") ??
|
|
68
|
+
pickOnePasswordField(item, "totp");
|
|
69
|
+
const url = pickPrimaryUrl(item.urls);
|
|
70
|
+
if (!password) {
|
|
71
|
+
throw new Error(`[1password] item ${externalId} has no password field`);
|
|
72
|
+
}
|
|
73
|
+
const reveal = {
|
|
74
|
+
source: "1password",
|
|
75
|
+
externalId: item.id,
|
|
76
|
+
title: typeof item.title === "string" && item.title.length > 0
|
|
77
|
+
? item.title
|
|
78
|
+
: item.id,
|
|
79
|
+
username,
|
|
80
|
+
domain: url ? extractHostname(url) : null,
|
|
81
|
+
url: url ?? null,
|
|
82
|
+
updatedAt: parseDate(item.updated_at),
|
|
83
|
+
password,
|
|
84
|
+
...(totp ? { totp } : {}),
|
|
85
|
+
};
|
|
86
|
+
return reveal;
|
|
87
|
+
}
|
|
88
|
+
function pickOnePasswordUsername(item) {
|
|
89
|
+
if (!item?.fields)
|
|
90
|
+
return null;
|
|
91
|
+
// `purpose: "USERNAME"` is the canonical marker for the Login.username slot.
|
|
92
|
+
const byPurpose = item.fields.find((f) => f.purpose === "USERNAME" && typeof f.value === "string");
|
|
93
|
+
if (byPurpose?.value)
|
|
94
|
+
return byPurpose.value;
|
|
95
|
+
// Fallback: label-based match for older CLIs.
|
|
96
|
+
const byLabel = item.fields.find((f) => f.label === "username" && typeof f.value === "string");
|
|
97
|
+
return byLabel?.value ?? null;
|
|
98
|
+
}
|
|
99
|
+
function pickOnePasswordField(item, label) {
|
|
100
|
+
if (!item.fields)
|
|
101
|
+
return null;
|
|
102
|
+
if (label === "password") {
|
|
103
|
+
const byPurpose = item.fields.find((f) => f.purpose === "PASSWORD" && typeof f.value === "string");
|
|
104
|
+
if (byPurpose?.value)
|
|
105
|
+
return byPurpose.value;
|
|
106
|
+
}
|
|
107
|
+
const lowered = label.toLowerCase();
|
|
108
|
+
const match = item.fields.find((f) => typeof f.label === "string" &&
|
|
109
|
+
f.label.toLowerCase() === lowered &&
|
|
110
|
+
typeof f.value === "string");
|
|
111
|
+
return match?.value ?? null;
|
|
112
|
+
}
|
|
113
|
+
export async function listBitwardenLogins(vault, exec) {
|
|
114
|
+
const session = await readSessionToken(vault, "bitwarden");
|
|
115
|
+
// `bw list items` returns ALL items (logins, secure notes, cards, etc.).
|
|
116
|
+
// Filter to type === 1 (login) on the JS side; bw doesn't accept a category
|
|
117
|
+
// filter on the list command.
|
|
118
|
+
const out = await exec("bw", ["list", "items"], {
|
|
119
|
+
env: { ...process.env, BW_SESSION: session },
|
|
120
|
+
timeoutMs: 15_000,
|
|
121
|
+
});
|
|
122
|
+
const items = parseJsonArray(out.stdout);
|
|
123
|
+
const result = [];
|
|
124
|
+
for (const item of items) {
|
|
125
|
+
if (item.type !== 1 || !item.login)
|
|
126
|
+
continue;
|
|
127
|
+
const url = pickBitwardenUrl(item.login.uris ?? null);
|
|
128
|
+
result.push({
|
|
129
|
+
source: "bitwarden",
|
|
130
|
+
externalId: item.id,
|
|
131
|
+
title: typeof item.name === "string" && item.name.length > 0
|
|
132
|
+
? item.name
|
|
133
|
+
: item.id,
|
|
134
|
+
username: typeof item.login.username === "string" ? item.login.username : "",
|
|
135
|
+
domain: url ? extractHostname(url) : null,
|
|
136
|
+
url: url ?? null,
|
|
137
|
+
updatedAt: parseDate(item.revisionDate),
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return result;
|
|
141
|
+
}
|
|
142
|
+
export async function revealBitwardenLogin(vault, exec, externalId) {
|
|
143
|
+
if (!externalId)
|
|
144
|
+
throw new TypeError("revealBitwardenLogin: externalId required");
|
|
145
|
+
const session = await readSessionToken(vault, "bitwarden");
|
|
146
|
+
const out = await exec("bw", ["get", "item", externalId], {
|
|
147
|
+
env: { ...process.env, BW_SESSION: session },
|
|
148
|
+
timeoutMs: 10_000,
|
|
149
|
+
});
|
|
150
|
+
const item = parseJsonObject(out.stdout);
|
|
151
|
+
if (item.type !== 1 || !item.login) {
|
|
152
|
+
throw new Error(`[bitwarden] item ${externalId} is not a login`);
|
|
153
|
+
}
|
|
154
|
+
const password = item.login.password ?? "";
|
|
155
|
+
if (!password) {
|
|
156
|
+
throw new Error(`[bitwarden] item ${externalId} has no password`);
|
|
157
|
+
}
|
|
158
|
+
const url = pickBitwardenUrl(item.login.uris ?? null);
|
|
159
|
+
return {
|
|
160
|
+
source: "bitwarden",
|
|
161
|
+
externalId: item.id,
|
|
162
|
+
title: typeof item.name === "string" && item.name.length > 0
|
|
163
|
+
? item.name
|
|
164
|
+
: item.id,
|
|
165
|
+
username: typeof item.login.username === "string" ? item.login.username : "",
|
|
166
|
+
domain: url ? extractHostname(url) : null,
|
|
167
|
+
url: url ?? null,
|
|
168
|
+
updatedAt: parseDate(item.revisionDate),
|
|
169
|
+
password,
|
|
170
|
+
...(item.login.totp ? { totp: item.login.totp } : {}),
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
function pickBitwardenUrl(uris) {
|
|
174
|
+
if (!uris || uris.length === 0)
|
|
175
|
+
return null;
|
|
176
|
+
for (const u of uris) {
|
|
177
|
+
if (typeof u.uri === "string" && u.uri.length > 0)
|
|
178
|
+
return u.uri;
|
|
179
|
+
}
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
// ── Shared helpers ────────────────────────────────────────────────────
|
|
183
|
+
async function readSessionToken(vault, source) {
|
|
184
|
+
const key = `pm.${source}.session`;
|
|
185
|
+
if (!(await vault.has(key)))
|
|
186
|
+
throw new BackendNotSignedInError(source);
|
|
187
|
+
const token = (await vault.get(key)).trim();
|
|
188
|
+
if (!token)
|
|
189
|
+
throw new BackendNotSignedInError(source);
|
|
190
|
+
return token;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Resolve op-invocation args (account + session) for one CLI call.
|
|
194
|
+
*
|
|
195
|
+
* 1Password 8's `op` CLI refuses to pick a default account when more than
|
|
196
|
+
* one is registered — `op whoami` exits 1 with "account is not signed in"
|
|
197
|
+
* even when the desktop app integration is fully active. The fix: probe
|
|
198
|
+
* `op account list` once, pick the first registered account's shorthand,
|
|
199
|
+
* and pass `--account=<shorthand>` on every subsequent call. Then desktop
|
|
200
|
+
* integration triggers the normal Touch ID flow and the session-token
|
|
201
|
+
* fallback is only used when no account is registered at all.
|
|
202
|
+
*
|
|
203
|
+
* Returns `["--account=<sh>"]` for desktop-app and
|
|
204
|
+
* `["--account=<sh>", "--session=<token>"]` for session-token.
|
|
205
|
+
*/
|
|
206
|
+
async function readOnePasswordSessionArgs(vault, exec) {
|
|
207
|
+
const account = await readDefaultOpAccount(exec);
|
|
208
|
+
const accountArg = account ? [`--account=${account}`] : [];
|
|
209
|
+
if (await isOnePasswordDesktopActiveWithExec(exec, accountArg)) {
|
|
210
|
+
return accountArg;
|
|
211
|
+
}
|
|
212
|
+
const session = await readSessionToken(vault, "1password");
|
|
213
|
+
return [...accountArg, `--session=${session}`];
|
|
214
|
+
}
|
|
215
|
+
async function readDefaultOpAccount(exec) {
|
|
216
|
+
try {
|
|
217
|
+
const out = await exec("op", ["account", "list", "--format=json"], {
|
|
218
|
+
timeoutMs: 3000,
|
|
219
|
+
});
|
|
220
|
+
const accounts = parseJsonArray(out.stdout);
|
|
221
|
+
for (const a of accounts) {
|
|
222
|
+
if (typeof a.shorthand === "string" && a.shorthand.length > 0) {
|
|
223
|
+
return a.shorthand;
|
|
224
|
+
}
|
|
225
|
+
// Fall back to the URL hostname as the shorthand 1Password generates
|
|
226
|
+
// (e.g. "my" for my.1password.com) when shorthand is absent.
|
|
227
|
+
if (typeof a.url === "string") {
|
|
228
|
+
const sub = a.url.split(".")[0];
|
|
229
|
+
if (sub)
|
|
230
|
+
return sub;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
return null;
|
|
234
|
+
}
|
|
235
|
+
catch {
|
|
236
|
+
return null;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
async function isOnePasswordDesktopActiveWithExec(exec, accountArg) {
|
|
240
|
+
// `op whoami` is special — even with desktop integration active, it
|
|
241
|
+
// refuses to run without a session token. A real vault query (e.g.
|
|
242
|
+
// `op vault list --format=json`) IS handled by desktop session
|
|
243
|
+
// delegation. Probe with that instead.
|
|
244
|
+
if (accountArg.length === 0)
|
|
245
|
+
return false;
|
|
246
|
+
try {
|
|
247
|
+
await exec("op", [...accountArg, "vault", "list", "--format=json"], {
|
|
248
|
+
timeoutMs: 3000,
|
|
249
|
+
});
|
|
250
|
+
return true;
|
|
251
|
+
}
|
|
252
|
+
catch {
|
|
253
|
+
return false;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
function pickPrimaryUrl(urls) {
|
|
257
|
+
if (!urls || urls.length === 0)
|
|
258
|
+
return null;
|
|
259
|
+
const primary = urls.find((u) => u.primary === true && typeof u.href === "string");
|
|
260
|
+
if (primary?.href)
|
|
261
|
+
return primary.href;
|
|
262
|
+
for (const u of urls) {
|
|
263
|
+
if (typeof u.href === "string" && u.href.length > 0)
|
|
264
|
+
return u.href;
|
|
265
|
+
}
|
|
266
|
+
return null;
|
|
267
|
+
}
|
|
268
|
+
function extractHostname(url) {
|
|
269
|
+
try {
|
|
270
|
+
const parsed = new URL(url.includes("://") ? url : `https://${url}`);
|
|
271
|
+
const host = parsed.hostname.toLowerCase();
|
|
272
|
+
return host.length > 0 ? host : null;
|
|
273
|
+
}
|
|
274
|
+
catch {
|
|
275
|
+
return null;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
function parseDate(value) {
|
|
279
|
+
if (!value)
|
|
280
|
+
return 0;
|
|
281
|
+
const ms = Date.parse(value);
|
|
282
|
+
return Number.isFinite(ms) ? ms : 0;
|
|
283
|
+
}
|
|
284
|
+
function parseJsonArray(raw) {
|
|
285
|
+
const trimmed = raw.trim();
|
|
286
|
+
if (trimmed.length === 0)
|
|
287
|
+
return [];
|
|
288
|
+
const parsed = JSON.parse(trimmed);
|
|
289
|
+
if (!Array.isArray(parsed)) {
|
|
290
|
+
throw new Error("expected JSON array, got non-array");
|
|
291
|
+
}
|
|
292
|
+
return parsed;
|
|
293
|
+
}
|
|
294
|
+
function parseJsonObject(raw) {
|
|
295
|
+
const trimmed = raw.trim();
|
|
296
|
+
if (trimmed.length === 0)
|
|
297
|
+
throw new Error("expected JSON object, got empty output");
|
|
298
|
+
const parsed = JSON.parse(trimmed);
|
|
299
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
300
|
+
throw new Error("expected JSON object, got non-object");
|
|
301
|
+
}
|
|
302
|
+
return parsed;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Production `ExecFn` wrapping `node:child_process.execFile`. Tests inject
|
|
306
|
+
* stubs instead of using this. Lives here so callers can `import` a single
|
|
307
|
+
* default rather than wiring `child_process` themselves.
|
|
308
|
+
*/
|
|
309
|
+
export function defaultExecFn() {
|
|
310
|
+
// Lazy require so the test environment doesn't accidentally run real
|
|
311
|
+
// subprocesses if a test forgets to inject a stub.
|
|
312
|
+
return async (cmd, args, opts) => {
|
|
313
|
+
const childProcess = await import("node:child_process");
|
|
314
|
+
return new Promise((resolve, reject) => {
|
|
315
|
+
const child = childProcess.execFile(cmd, [...args], {
|
|
316
|
+
...(opts.env ? { env: opts.env } : {}),
|
|
317
|
+
timeout: opts.timeoutMs ?? 10_000,
|
|
318
|
+
maxBuffer: 16 * 1024 * 1024,
|
|
319
|
+
encoding: "utf8",
|
|
320
|
+
}, (error, stdout, stderr) => {
|
|
321
|
+
if (error) {
|
|
322
|
+
reject(error);
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
// `encoding: "utf8"` forces stdout/stderr to strings.
|
|
326
|
+
resolve({ stdout, stderr });
|
|
327
|
+
});
|
|
328
|
+
if (opts.stdin !== undefined && child.stdin) {
|
|
329
|
+
child.stdin.write(opts.stdin);
|
|
330
|
+
child.stdin.end();
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
//# sourceMappingURL=external-credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"external-credentials.js","sourceRoot":"","sources":["../src/external-credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAw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|
+
*
|
|
6
|
+
* const vault = createVault();
|
|
7
|
+
* await vault.set("openrouter.apiKey", "sk-or-v1-...", { sensitive: true });
|
|
8
|
+
* await vault.set("ui.theme", "dark");
|
|
9
|
+
* const apiKey = await vault.get("openrouter.apiKey");
|
|
10
|
+
*
|
|
11
|
+
* One API for sensitive credentials and non-sensitive config. Sensitive
|
|
12
|
+
* values encrypted at rest with the master key in the OS keychain.
|
|
13
|
+
* Password-manager references (1Password, Proton Pass) are first-class
|
|
14
|
+
* — the value lives there, the vault stores only the reference.
|
|
15
|
+
*/
|
|
16
|
+
export { createVault, VaultMissError } from "./vault.js";
|
|
17
|
+
export type { CreateVaultOptions, SetOptions, Vault, } from "./vault.js";
|
|
18
|
+
export { defaultMasterKey, inMemoryMasterKey, MasterKeyUnavailableError, osKeychainMasterKey, passphraseMasterKey, passphraseMasterKeyFromEnv, } from "./master-key.js";
|
|
19
|
+
export type { MasterKeyResolver, OsKeychainOptions, PassphraseOptions, } from "./master-key.js";
|
|
20
|
+
export { encrypt, decrypt, generateMasterKey, KEY_BYTES, CryptoError, } from "./crypto.js";
|
|
21
|
+
export { PasswordManagerError, resolveReference, } from "./password-managers.js";
|
|
22
|
+
export { createManager, DEFAULT_PREFERENCES, } from "./manager.js";
|
|
23
|
+
export type { BackendId, BackendStatus, CreateManagerOptions, ListAllSavedLoginsOptions, ManagerPreferences, ManagerSetOptions, SecretsManager, UnifiedLoginListEntry, UnifiedLoginListResult, UnifiedLoginReveal, } from "./manager.js";
|
|
24
|
+
export { BackendNotSignedInError, defaultExecFn, listBitwardenLogins, listOnePasswordLogins, revealBitwardenLogin, revealOnePasswordLogin, } from "./external-credentials.js";
|
|
25
|
+
export type { ExecFn, ExternalLoginListEntry, ExternalLoginReveal, ExternalLoginSource, } from "./external-credentials.js";
|
|
26
|
+
export { BACKEND_INSTALL_SPECS, buildInstallCommand, currentPlatform, detectPackageManagers, resetInstallerCache, resolveRunnableMethods, } from "./install.js";
|
|
27
|
+
export type { BackendInstallSpec, InstallMethod, InstallMethodKind, PackageManagerAvailability, SupportedPlatform, } from "./install.js";
|
|
28
|
+
export type { AuditRecord, PasswordManagerReference, VaultDescriptor, VaultLogger, VaultStats, } from "./types.js";
|
|
29
|
+
export { deleteSavedLogin, getAutofillAllowed, getSavedLogin, listSavedLogins, setAutofillAllowed, setSavedLogin, } from "./credentials.js";
|
|
30
|
+
export type { SavedLogin, SavedLoginSummary } from "./credentials.js";
|
|
31
|
+
export { categorizeKey, inferProviderId, listVaultInventory, META_PREFIX, profileStorageKey, PROFILE_SEGMENT, readEntryMeta, removeEntryMeta, ROUTING_KEY, setEntryMeta, } from "./inventory.js";
|
|
32
|
+
export type { VaultEntryCategory, VaultEntryMeta, VaultEntryMetaRecord, VaultEntryMetaUpdate, VaultEntryProfile, } from "./inventory.js";
|
|
33
|
+
export { readRoutingConfig, resolveActiveValue, writeRoutingConfig, } from "./profiles.js";
|
|
34
|
+
export type { ResolutionContext, RoutingConfig, RoutingRule, RoutingScope, RoutingScopeKind, } from "./profiles.js";
|
|
35
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACzD,YAAY,EACV,kBAAkB,EAClB,UAAU,EACV,KAAK,GACN,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,yBAAyB,EACzB,mBAAmB,EACnB,mBAAmB,EACnB,0BAA0B,GAC3B,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,SAAS,EACT,WAAW,GACZ,MAAM,aAAa,CA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pB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,YAAY,EACZ,gBAAgB,GACjB,MAAM,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @elizaos/vault — simple secrets/config vault.
|
|
3
|
+
*
|
|
4
|
+
* import { createVault } from "@elizaos/vault";
|
|
5
|
+
*
|
|
6
|
+
* const vault = createVault();
|
|
7
|
+
* await vault.set("openrouter.apiKey", "sk-or-v1-...", { sensitive: true });
|
|
8
|
+
* await vault.set("ui.theme", "dark");
|
|
9
|
+
* const apiKey = await vault.get("openrouter.apiKey");
|
|
10
|
+
*
|
|
11
|
+
* One API for sensitive credentials and non-sensitive config. Sensitive
|
|
12
|
+
* values encrypted at rest with the master key in the OS keychain.
|
|
13
|
+
* Password-manager references (1Password, Proton Pass) are first-class
|
|
14
|
+
* — the value lives there, the vault stores only the reference.
|
|
15
|
+
*/
|
|
16
|
+
export { createVault, VaultMissError } from "./vault.js";
|
|
17
|
+
export { defaultMasterKey, inMemoryMasterKey, MasterKeyUnavailableError, osKeychainMasterKey, passphraseMasterKey, passphraseMasterKeyFromEnv, } from "./master-key.js";
|
|
18
|
+
export { encrypt, decrypt, generateMasterKey, KEY_BYTES, CryptoError, } from "./crypto.js";
|
|
19
|
+
export { PasswordManagerError, resolveReference, } from "./password-managers.js";
|
|
20
|
+
export { createManager, DEFAULT_PREFERENCES, } from "./manager.js";
|
|
21
|
+
export { BackendNotSignedInError, defaultExecFn, listBitwardenLogins, listOnePasswordLogins, revealBitwardenLogin, revealOnePasswordLogin, } from "./external-credentials.js";
|
|
22
|
+
export { BACKEND_INSTALL_SPECS, buildInstallCommand, currentPlatform, detectPackageManagers, resetInstallerCache, resolveRunnableMethods, } from "./install.js";
|
|
23
|
+
export { deleteSavedLogin, getAutofillAllowed, getSavedLogin, listSavedLogins, setAutofillAllowed, setSavedLogin, } from "./credentials.js";
|
|
24
|
+
export { categorizeKey, inferProviderId, listVaultInventory, META_PREFIX, profileStorageKey, PROFILE_SEGMENT, readEntryMeta, removeEntryMeta, ROUTING_KEY, setEntryMeta, } from "./inventory.js";
|
|
25
|
+
export { readRoutingConfig, resolveActiveValue, writeRoutingConfig, } from "./profiles.js";
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAOzD,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,yBAAyB,EACzB,mBAAmB,EACnB,mBAAmB,EACnB,0BAA0B,GAC3B,MAAM,iBAAiB,CAAC;AAOzB,OAAO,EACL,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,SAAS,EACT,WAAW,GACZ,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,aAAa,EACb,mBAAmB,GACpB,MAAM,cAAc,CAAC;AActB,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,2BAA2B,CAAC;AAQnC,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,cAAc,CAAC;AAiBtB,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,aAAa,GACd,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,eAAe,EACf,WAAW,EACX,YAAY,GACb,MAAM,gBAAgB,CAAC;AASxB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Install spec — what install methods exist for each external secrets-manager
|
|
3
|
+
* backend on which OS, and how to detect whether a given package manager is
|
|
4
|
+
* present on the host.
|
|
5
|
+
*
|
|
6
|
+
* Detection-only. The actual `child_process` execution and streaming live in
|
|
7
|
+
* the consumer (app-core's `secrets-manager-installer`); this module is pure
|
|
8
|
+
* data + small async checks so it stays usable from the vault package
|
|
9
|
+
* without pulling in spawn/PTY machinery.
|
|
10
|
+
*/
|
|
11
|
+
import type { BackendId } from "./manager.js";
|
|
12
|
+
/** A concrete way to install one CLI on one OS. */
|
|
13
|
+
export type InstallMethod = {
|
|
14
|
+
readonly kind: "brew";
|
|
15
|
+
/** brew formula or cask name. */
|
|
16
|
+
readonly package: string;
|
|
17
|
+
/** True for `brew install --cask <package>`. */
|
|
18
|
+
readonly cask: boolean;
|
|
19
|
+
} | {
|
|
20
|
+
readonly kind: "npm";
|
|
21
|
+
/** npm package name to install with `-g`. */
|
|
22
|
+
readonly package: string;
|
|
23
|
+
} | {
|
|
24
|
+
readonly kind: "manual";
|
|
25
|
+
readonly instructions: string;
|
|
26
|
+
readonly url: string;
|
|
27
|
+
};
|
|
28
|
+
export type InstallMethodKind = InstallMethod["kind"];
|
|
29
|
+
export type SupportedPlatform = "darwin" | "linux" | "win32";
|
|
30
|
+
/** Per-OS install methods for one backend. */
|
|
31
|
+
export interface BackendInstallSpec {
|
|
32
|
+
readonly id: BackendId;
|
|
33
|
+
/** First entry in each platform list is the preferred default. */
|
|
34
|
+
readonly methods: Readonly<Partial<Record<SupportedPlatform, readonly InstallMethod[]>>>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Install specs for each external backend.
|
|
38
|
+
*
|
|
39
|
+
* Sources:
|
|
40
|
+
* - 1Password CLI: `brew install --cask 1password-cli`
|
|
41
|
+
* (https://developer.1password.com/docs/cli/get-started)
|
|
42
|
+
* - Bitwarden CLI: `brew install bitwarden-cli` (formula, not cask) or
|
|
43
|
+
* `npm install -g @bitwarden/cli`
|
|
44
|
+
* (https://bitwarden.com/help/cli/)
|
|
45
|
+
* - Proton Pass CLI: vendor CLI is in beta, no automated install path yet.
|
|
46
|
+
*/
|
|
47
|
+
export declare const BACKEND_INSTALL_SPECS: Readonly<Record<Exclude<BackendId, "in-house">, BackendInstallSpec>>;
|
|
48
|
+
export interface PackageManagerAvailability {
|
|
49
|
+
readonly brew: boolean;
|
|
50
|
+
readonly npm: boolean;
|
|
51
|
+
}
|
|
52
|
+
export declare function detectPackageManagers(): Promise<PackageManagerAvailability>;
|
|
53
|
+
export declare function resetInstallerCache(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Resolve the install methods that are *runnable on this host* for a given
|
|
56
|
+
* backend. Manual methods are always returned (so the UI can show the doc
|
|
57
|
+
* link); brew/npm methods are filtered to those whose tool is present.
|
|
58
|
+
*/
|
|
59
|
+
export declare function resolveRunnableMethods(id: Exclude<BackendId, "in-house">, platform?: SupportedPlatform): Promise<readonly InstallMethod[]>;
|
|
60
|
+
export declare function currentPlatform(): SupportedPlatform;
|
|
61
|
+
/**
|
|
62
|
+
* Build the argv for a given install method. Caller spawns directly with
|
|
63
|
+
* argv (no shell interpolation). Returns null for `manual` — those have no
|
|
64
|
+
* automated execution path.
|
|
65
|
+
*/
|
|
66
|
+
export declare function buildInstallCommand(method: InstallMethod): {
|
|
67
|
+
command: string;
|
|
68
|
+
args: readonly string[];
|
|
69
|
+
} | null;
|
|
70
|
+
//# sourceMappingURL=install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot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