digital-ai-testing-mcp 2.3.3 → 2.4.0-beta.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/README.md +77 -34
- package/dist/api/access-level.d.ts +14 -0
- package/dist/api/access-level.d.ts.map +1 -1
- package/dist/api/access-level.js +17 -0
- package/dist/api/access-level.js.map +1 -1
- package/dist/api/client.d.ts +2 -2
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +15 -14
- package/dist/api/client.js.map +1 -1
- package/dist/api/update-check.d.ts +29 -0
- package/dist/api/update-check.d.ts.map +1 -0
- package/dist/api/update-check.js +71 -0
- package/dist/api/update-check.js.map +1 -0
- package/dist/cli/clients.d.ts +92 -0
- package/dist/cli/clients.d.ts.map +1 -0
- package/dist/cli/clients.js +372 -0
- package/dist/cli/clients.js.map +1 -0
- package/dist/cli/setup.d.ts +22 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +681 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/index.js +52 -10
- package/dist/index.js.map +1 -1
- package/dist/tools/meta-tools.d.ts.map +1 -1
- package/dist/tools/meta-tools.js +24 -6
- package/dist/tools/meta-tools.js.map +1 -1
- package/dist/utils/credential-store.d.ts +117 -0
- package/dist/utils/credential-store.d.ts.map +1 -0
- package/dist/utils/credential-store.js +343 -0
- package/dist/utils/credential-store.js.map +1 -0
- package/dist/utils/profile-loader.d.ts +42 -23
- package/dist/utils/profile-loader.d.ts.map +1 -1
- package/dist/utils/profile-loader.js +108 -21
- package/dist/utils/profile-loader.js.map +1 -1
- package/dist/utils/remediation.d.ts +2 -1
- package/dist/utils/remediation.d.ts.map +1 -1
- package/dist/utils/remediation.js +3 -2
- package/dist/utils/remediation.js.map +1 -1
- package/dist/utils/schema.d.ts +1 -1
- package/dist/utils/setup-guidance.d.ts +21 -0
- package/dist/utils/setup-guidance.d.ts.map +1 -0
- package/dist/utils/setup-guidance.js +87 -0
- package/dist/utils/setup-guidance.js.map +1 -0
- package/dist/utils/update-check.d.ts +66 -0
- package/dist/utils/update-check.d.ts.map +1 -0
- package/dist/utils/update-check.js +195 -0
- package/dist/utils/update-check.js.map +1 -0
- package/package.json +5 -1
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local credential store — named connection profiles in one file per user, read by profile-loader.ts.
|
|
3
|
+
*
|
|
4
|
+
* Location: MCP_CREDENTIAL_STORE_DIR, else %APPDATA%\digital-ai-testing (Windows) or
|
|
5
|
+
* $XDG_CONFIG_HOME/digital-ai-testing, else ~/.config/digital-ai-testing. File: profiles.json.
|
|
6
|
+
* MCP_CREDENTIAL_STORE=off disables it completely.
|
|
7
|
+
*
|
|
8
|
+
* { "version": 1, "default": "admin",
|
|
9
|
+
* "profiles": { "admin": { "url": "https://tenant.experitest.com", "keyStore": "os" },
|
|
10
|
+
* "qa": { "url": "https://tenant.experitest.com", "key": "…" } } }
|
|
11
|
+
*
|
|
12
|
+
* The store is ADDITIVE: environment variables always win (profile-loader.ts applies the precedence). This module only
|
|
13
|
+
* reads, validates and writes the file, and never throws on bad content: an unreadable file or a bad profile becomes
|
|
14
|
+
* an error / skipped entry with a reason, so the server can still start and say what is wrong.
|
|
15
|
+
*
|
|
16
|
+
* Where a profile's key lives:
|
|
17
|
+
* "keyStore": "os" — the OS keychain (macOS Keychain, Windows Credential Manager, Linux Secret Service) under service
|
|
18
|
+
* KEYCHAIN_SERVICE, account = profile name, through the OPTIONAL dependency @napi-rs/keyring. It is
|
|
19
|
+
* loaded lazily, only when a profile needs it; if it cannot load (no prebuilt binary, Linux without a
|
|
20
|
+
* keyring service) or has no entry, that profile is skipped with the reason.
|
|
21
|
+
* "key": "…" — plain-file mode: the key is in this file (user-only folder, mode 0600 where the OS honours it — on
|
|
22
|
+
* Windows the per-user %APPDATA% ACL is what protects it).
|
|
23
|
+
* Measured on Windows 11 (2026-11-17): library load 11–161 ms once per process, a key read ~3 ms.
|
|
24
|
+
*
|
|
25
|
+
* Credential values never leave this module except through profile-loader.ts.
|
|
26
|
+
*/
|
|
27
|
+
import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync, copyFileSync, chmodSync, rmSync } from 'node:fs';
|
|
28
|
+
import { createRequire } from 'node:module';
|
|
29
|
+
import { homedir } from 'node:os';
|
|
30
|
+
import { join } from 'node:path';
|
|
31
|
+
// ─── OS keychain ──────────────────────────────────────────────────────────────
|
|
32
|
+
export const KEYCHAIN_SERVICE = 'digital-ai-testing-mcp';
|
|
33
|
+
let _keychain;
|
|
34
|
+
let _keychainOverride;
|
|
35
|
+
/** Test hook: a fake keychain, null for "unavailable", undefined to go back to the real one. */
|
|
36
|
+
export function setKeychainForTests(k) {
|
|
37
|
+
_keychainOverride = k;
|
|
38
|
+
}
|
|
39
|
+
function shortError(e) {
|
|
40
|
+
return (e instanceof Error ? e.message : String(e)).split('\n')[0].slice(0, 200);
|
|
41
|
+
}
|
|
42
|
+
/** The OS keychain, loaded on first use. Never throws: an unusable keychain comes back as an error. */
|
|
43
|
+
export function getKeychain() {
|
|
44
|
+
if (_keychainOverride !== undefined) {
|
|
45
|
+
return _keychainOverride ? { keychain: _keychainOverride } : { error: 'the OS keychain is not available' };
|
|
46
|
+
}
|
|
47
|
+
if (!_keychain) {
|
|
48
|
+
try {
|
|
49
|
+
const { Entry } = createRequire(import.meta.url)('@napi-rs/keyring');
|
|
50
|
+
_keychain = {
|
|
51
|
+
keychain: {
|
|
52
|
+
get: (account) => new Entry(KEYCHAIN_SERVICE, account).getPassword(),
|
|
53
|
+
set: (account, secret) => new Entry(KEYCHAIN_SERVICE, account).setPassword(secret),
|
|
54
|
+
delete: (account) => new Entry(KEYCHAIN_SERVICE, account).deletePassword(),
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
catch (e) {
|
|
59
|
+
_keychain = { error: `the OS keychain library could not be loaded (${shortError(e)})` };
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return _keychain;
|
|
63
|
+
}
|
|
64
|
+
export const keychainLookup = (profile) => {
|
|
65
|
+
const { keychain, error } = getKeychain();
|
|
66
|
+
if (!keychain)
|
|
67
|
+
return { reason: `its key is in the OS keychain, which cannot be used here: ${error}` };
|
|
68
|
+
try {
|
|
69
|
+
const key = keychain.get(profile)?.trim();
|
|
70
|
+
return key
|
|
71
|
+
? { key }
|
|
72
|
+
: { reason: `its key is in the OS keychain, but there is no entry for it (service "${KEYCHAIN_SERVICE}", account "${profile}")` };
|
|
73
|
+
}
|
|
74
|
+
catch (e) {
|
|
75
|
+
return { reason: `its key is in the OS keychain, which could not be read (${shortError(e)})` };
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
/** Saves a profile's key in the keychain (for the setup command). Never throws. */
|
|
79
|
+
export function saveKeyToKeychain(profile, key) {
|
|
80
|
+
const { keychain, error } = getKeychain();
|
|
81
|
+
if (!keychain)
|
|
82
|
+
return { ok: false, error };
|
|
83
|
+
try {
|
|
84
|
+
keychain.set(profile, key);
|
|
85
|
+
return { ok: true };
|
|
86
|
+
}
|
|
87
|
+
catch (e) {
|
|
88
|
+
return { ok: false, error: `the OS keychain could not save it (${shortError(e)})` };
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/** Removes a profile's key from the keychain. `existed` is false when there was no entry. Never throws. */
|
|
92
|
+
export function deleteKeyFromKeychain(profile) {
|
|
93
|
+
const { keychain, error } = getKeychain();
|
|
94
|
+
if (!keychain)
|
|
95
|
+
return { ok: false, error };
|
|
96
|
+
try {
|
|
97
|
+
return { ok: true, existed: keychain.delete(profile) };
|
|
98
|
+
}
|
|
99
|
+
catch (e) {
|
|
100
|
+
return { ok: false, error: `the OS keychain could not delete it (${shortError(e)})` };
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
// ─── The profiles file ────────────────────────────────────────────────────────
|
|
104
|
+
export const STORE_FORMAT_VERSION = 1;
|
|
105
|
+
export const STORE_FILE_NAME = 'profiles.json';
|
|
106
|
+
/** Same shape as env profile names after lowercasing (DAI_PROFILE_QA_TEAM_* → qa_team). */
|
|
107
|
+
export const PROFILE_NAME_RE = /^[a-z0-9][a-z0-9_-]{0,63}$/;
|
|
108
|
+
export function isStoreEnabled(env = process.env) {
|
|
109
|
+
return !/^(off|false|0|no)$/i.test(env.MCP_CREDENTIAL_STORE?.trim() ?? '');
|
|
110
|
+
}
|
|
111
|
+
export function storeDir(env = process.env, platform = process.platform) {
|
|
112
|
+
const override = env.MCP_CREDENTIAL_STORE_DIR?.trim();
|
|
113
|
+
if (override)
|
|
114
|
+
return override;
|
|
115
|
+
if (platform === 'win32')
|
|
116
|
+
return join(env.APPDATA?.trim() || join(homedir(), 'AppData', 'Roaming'), 'digital-ai-testing');
|
|
117
|
+
return join(env.XDG_CONFIG_HOME?.trim() || join(homedir(), '.config'), 'digital-ai-testing');
|
|
118
|
+
}
|
|
119
|
+
export function storePath(env = process.env, platform = process.platform) {
|
|
120
|
+
return join(storeDir(env, platform), STORE_FILE_NAME);
|
|
121
|
+
}
|
|
122
|
+
/** An http(s) URL without trailing slashes, or null. */
|
|
123
|
+
export function validUrl(u) {
|
|
124
|
+
if (typeof u !== 'string' || !u.trim())
|
|
125
|
+
return null;
|
|
126
|
+
try {
|
|
127
|
+
const parsed = new URL(u.trim());
|
|
128
|
+
if (parsed.protocol !== 'https:' && parsed.protocol !== 'http:')
|
|
129
|
+
return null;
|
|
130
|
+
return u.trim().replace(/\/+$/, '');
|
|
131
|
+
}
|
|
132
|
+
catch {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
const NO_KEYCHAIN = () => ({ reason: 'its key is in the OS keychain, which is not read here' });
|
|
137
|
+
/**
|
|
138
|
+
* Validates parsed JSON (`raw` is whatever JSON.parse returned). `lookup` resolves "keyStore": "os" profiles — readStore
|
|
139
|
+
* passes the real keychain; tests pass a fake. Without one, such profiles are skipped.
|
|
140
|
+
*/
|
|
141
|
+
export function parseStore(raw, path, lookup = NO_KEYCHAIN) {
|
|
142
|
+
const base = { enabled: true, path, exists: true, profiles: {}, skipped: [] };
|
|
143
|
+
if (!raw || typeof raw !== 'object' || Array.isArray(raw))
|
|
144
|
+
return { ...base, error: 'the file is not a JSON object' };
|
|
145
|
+
const obj = raw;
|
|
146
|
+
if (typeof obj.version === 'number' && obj.version > STORE_FORMAT_VERSION) {
|
|
147
|
+
return { ...base, error: `the file uses format version ${obj.version}; this server reads version ${STORE_FORMAT_VERSION} — update the server` };
|
|
148
|
+
}
|
|
149
|
+
if (!obj.profiles || typeof obj.profiles !== 'object' || Array.isArray(obj.profiles)) {
|
|
150
|
+
return { ...base, error: 'the file has no "profiles" object' };
|
|
151
|
+
}
|
|
152
|
+
const seen = new Set();
|
|
153
|
+
for (const [rawName, rawProfile] of Object.entries(obj.profiles)) {
|
|
154
|
+
const name = rawName.trim().toLowerCase();
|
|
155
|
+
if (!PROFILE_NAME_RE.test(name)) {
|
|
156
|
+
base.skipped.push({ name: rawName, reason: 'invalid name (letters, digits, "_" and "-" only, up to 64)' });
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
if (seen.has(name)) {
|
|
160
|
+
base.skipped.push({ name: rawName, reason: `duplicate of "${name}" (names are not case-sensitive)` });
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
seen.add(name);
|
|
164
|
+
if (!rawProfile || typeof rawProfile !== 'object') {
|
|
165
|
+
base.skipped.push({ name, reason: 'not an object with "url" and "key" or "keyStore"' });
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
const p = rawProfile;
|
|
169
|
+
const url = validUrl(p.url);
|
|
170
|
+
if (!url) {
|
|
171
|
+
base.skipped.push({ name, reason: '"url" is missing or not an http(s) URL' });
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
if (p.keyStore !== undefined) {
|
|
175
|
+
if (p.keyStore !== 'os') {
|
|
176
|
+
base.skipped.push({ name, reason: `"keyStore" must be "os" (got ${JSON.stringify(String(p.keyStore)).slice(0, 40)})` });
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
if (p.key !== undefined) {
|
|
180
|
+
base.skipped.push({ name, reason: 'has both "key" and "keyStore" — keep one' });
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
const found = lookup(name);
|
|
184
|
+
if (!found.key) {
|
|
185
|
+
base.skipped.push({ name, reason: found.reason ?? 'its key is in the OS keychain, but it could not be read' });
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
base.profiles[name] = { url, key: found.key, keyStore: 'os' };
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
if (typeof p.key !== 'string' || !p.key.trim()) {
|
|
192
|
+
base.skipped.push({ name, reason: '"key" is missing or empty (or set "keyStore": "os" for a key in the OS keychain)' });
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
base.profiles[name] = { url, key: p.key.trim(), keyStore: 'file' };
|
|
196
|
+
}
|
|
197
|
+
if (obj.default !== undefined) {
|
|
198
|
+
const d = typeof obj.default === 'string' ? obj.default.trim().toLowerCase() : '';
|
|
199
|
+
if (d && d in base.profiles)
|
|
200
|
+
base.defaultProfile = d;
|
|
201
|
+
else
|
|
202
|
+
base.skipped.push({ name: '(default)', reason: `"default" names ${d ? `"${d}", which is not a usable profile` : 'no profile'}` });
|
|
203
|
+
}
|
|
204
|
+
return base;
|
|
205
|
+
}
|
|
206
|
+
/** " (line L, column C)" from a JSON.parse error, or "" — never any of the message's quoted input. */
|
|
207
|
+
export function jsonErrorPosition(e, text) {
|
|
208
|
+
const msg = e instanceof Error ? e.message : '';
|
|
209
|
+
const lc = /line (\d+) column (\d+)/.exec(msg);
|
|
210
|
+
if (lc)
|
|
211
|
+
return ` (line ${lc[1]}, column ${lc[2]})`;
|
|
212
|
+
const pos = /position (\d+)/.exec(msg);
|
|
213
|
+
if (!pos)
|
|
214
|
+
return '';
|
|
215
|
+
const before = text.slice(0, Number(pos[1])).split('\n');
|
|
216
|
+
return ` (line ${before.length}, column ${before[before.length - 1].length + 1})`;
|
|
217
|
+
}
|
|
218
|
+
/** Reads the store. Never throws. */
|
|
219
|
+
export function readStore(env = process.env) {
|
|
220
|
+
const path = storePath(env);
|
|
221
|
+
if (!isStoreEnabled(env))
|
|
222
|
+
return { enabled: false, path, exists: false, profiles: {}, skipped: [] };
|
|
223
|
+
if (!existsSync(path))
|
|
224
|
+
return { enabled: true, path, exists: false, profiles: {}, skipped: [] };
|
|
225
|
+
let text;
|
|
226
|
+
try {
|
|
227
|
+
text = readFileSync(path, 'utf8');
|
|
228
|
+
}
|
|
229
|
+
catch (e) {
|
|
230
|
+
return { enabled: true, path, exists: true, error: `the file could not be read (${e.code ?? 'error'})`, profiles: {}, skipped: [] };
|
|
231
|
+
}
|
|
232
|
+
let raw;
|
|
233
|
+
try {
|
|
234
|
+
raw = JSON.parse(text.replace(/^/, ''));
|
|
235
|
+
}
|
|
236
|
+
catch (e) {
|
|
237
|
+
// Only the position is reported: V8's JSON.parse messages can quote part of the input, which may be a key.
|
|
238
|
+
return { enabled: true, path, exists: true, error: `the file is not valid JSON${jsonErrorPosition(e, text)}`, profiles: {}, skipped: [] };
|
|
239
|
+
}
|
|
240
|
+
return parseStore(raw, path, keychainLookup);
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Writes the store atomically (temp file + rename) and keeps the previous version as profiles.json.bak.
|
|
244
|
+
* The folder and file are created user-only where the OS honours POSIX modes.
|
|
245
|
+
*/
|
|
246
|
+
export function writeStore(data, env = process.env) {
|
|
247
|
+
const dir = storeDir(env);
|
|
248
|
+
const path = storePath(env);
|
|
249
|
+
mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
250
|
+
const body = JSON.stringify({ ...data, version: STORE_FORMAT_VERSION }, null, 2) + '\n';
|
|
251
|
+
const tmp = `${path}.${process.pid}.tmp`;
|
|
252
|
+
writeFileSync(tmp, body, { encoding: 'utf8', mode: 0o600 });
|
|
253
|
+
if (existsSync(path))
|
|
254
|
+
copyFileSync(path, `${path}.bak`);
|
|
255
|
+
renameSync(tmp, path);
|
|
256
|
+
// The backup holds keys too, and a copy does not keep the source's mode.
|
|
257
|
+
for (const f of [path, `${path}.bak`]) {
|
|
258
|
+
try {
|
|
259
|
+
if (existsSync(f))
|
|
260
|
+
chmodSync(f, 0o600);
|
|
261
|
+
}
|
|
262
|
+
catch {
|
|
263
|
+
/* best effort — not meaningful on Windows */
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
return path;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Reads the file for editing. A missing file is an empty store. An unreadable file, invalid JSON, a wrong shape or a
|
|
270
|
+
* newer format version is an error: the caller must not write over it (setup offers `repair` instead).
|
|
271
|
+
*/
|
|
272
|
+
export function readStoreFileRaw(env = process.env) {
|
|
273
|
+
const path = storePath(env);
|
|
274
|
+
if (!existsSync(path))
|
|
275
|
+
return { exists: false, data: { version: STORE_FORMAT_VERSION, profiles: {} } };
|
|
276
|
+
let text;
|
|
277
|
+
try {
|
|
278
|
+
text = readFileSync(path, 'utf8');
|
|
279
|
+
}
|
|
280
|
+
catch (e) {
|
|
281
|
+
return { exists: true, error: `the file could not be read (${e.code ?? 'error'})` };
|
|
282
|
+
}
|
|
283
|
+
let raw;
|
|
284
|
+
try {
|
|
285
|
+
raw = JSON.parse(text.replace(/^/, ''));
|
|
286
|
+
}
|
|
287
|
+
catch (e) {
|
|
288
|
+
return { exists: true, error: `the file is not valid JSON${jsonErrorPosition(e, text)}` };
|
|
289
|
+
}
|
|
290
|
+
if (!raw || typeof raw !== 'object' || Array.isArray(raw))
|
|
291
|
+
return { exists: true, error: 'the file is not a JSON object' };
|
|
292
|
+
const obj = raw;
|
|
293
|
+
if (typeof obj.version === 'number' && obj.version > STORE_FORMAT_VERSION) {
|
|
294
|
+
return { exists: true, error: `the file uses format version ${obj.version}, newer than this version reads — update first` };
|
|
295
|
+
}
|
|
296
|
+
if (obj.profiles === undefined)
|
|
297
|
+
obj.profiles = {};
|
|
298
|
+
if (!obj.profiles || typeof obj.profiles !== 'object' || Array.isArray(obj.profiles)) {
|
|
299
|
+
return { exists: true, error: 'the file\'s "profiles" is not an object' };
|
|
300
|
+
}
|
|
301
|
+
return { exists: true, data: obj };
|
|
302
|
+
}
|
|
303
|
+
/** Finds a profile entry by name, ignoring case (names are case-insensitive). */
|
|
304
|
+
export function findRawProfileName(data, name) {
|
|
305
|
+
const wanted = name.trim().toLowerCase();
|
|
306
|
+
return Object.keys(data.profiles).find((k) => k.trim().toLowerCase() === wanted);
|
|
307
|
+
}
|
|
308
|
+
/** Restores profiles.json from profiles.json.bak; the replaced file is kept as profiles.json.before-repair. */
|
|
309
|
+
export function restoreStoreBackup(env = process.env) {
|
|
310
|
+
const path = storePath(env);
|
|
311
|
+
const bak = `${path}.bak`;
|
|
312
|
+
if (!existsSync(bak))
|
|
313
|
+
return { ok: false, error: `there is no backup (${bak})` };
|
|
314
|
+
let keptAs;
|
|
315
|
+
if (existsSync(path)) {
|
|
316
|
+
keptAs = `${path}.before-repair`;
|
|
317
|
+
copyFileSync(path, keptAs);
|
|
318
|
+
}
|
|
319
|
+
copyFileSync(bak, path);
|
|
320
|
+
for (const f of [path, keptAs]) {
|
|
321
|
+
try {
|
|
322
|
+
if (f)
|
|
323
|
+
chmodSync(f, 0o600);
|
|
324
|
+
}
|
|
325
|
+
catch {
|
|
326
|
+
/* best effort */
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
return { ok: true, keptAs };
|
|
330
|
+
}
|
|
331
|
+
/** Deletes profiles.json and every copy setup made of it (backup, before-repair). Returns the files removed. */
|
|
332
|
+
export function deleteStoreFiles(env = process.env) {
|
|
333
|
+
const path = storePath(env);
|
|
334
|
+
const removed = [];
|
|
335
|
+
for (const f of [path, `${path}.bak`, `${path}.before-repair`]) {
|
|
336
|
+
if (existsSync(f)) {
|
|
337
|
+
rmSync(f, { force: true });
|
|
338
|
+
removed.push(f);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
return removed;
|
|
342
|
+
}
|
|
343
|
+
//# sourceMappingURL=credential-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-store.js","sourceRoot":"","sources":["../../src/utils/credential-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC1H,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,iFAAiF;AAEjF,MAAM,CAAC,MAAM,gBAAgB,GAAG,wBAAwB,CAAC;AAkBzD,IAAI,SAA8D,CAAC;AACnE,IAAI,iBAA8C,CAAC;AAEnD,gGAAgG;AAChG,MAAM,UAAU,mBAAmB,CAAC,CAA8B;IAChE,iBAAiB,GAAG,CAAC,CAAC;AACxB,CAAC;AAED,SAAS,UAAU,CAAC,CAAU;IAC5B,OAAO,CAAC,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACnF,CAAC;AAED,uGAAuG;AACvG,MAAM,UAAU,WAAW;IACzB,IAAI,iBAAiB,KAAK,SAAS,EAAE,CAAC;QACpC,OAAO,iBAAiB,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,kCAAkC,EAAE,CAAC;IAC7G,CAAC;I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C;QACjC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC7B,CAAC;IACD,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACxB,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC;QAC/B,IAAI,CAAC;YACH,IAAI,CAAC;gBAAE,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QAC7B,CAAC;QAAC,MAAM,CAAC;YACP,iBAAiB;QACnB,CAAC;IACH,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC9B,CAAC;AAED,gHAAgH;AAChH,MAAM,UAAU,gBAAgB,CAAC,MAAyB,OAAO,CAAC,GAAG;IACnE,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;IAC5B,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,MAAM,EAAE,GAAG,IAAI,gBAAgB,CAAC,EAAE,CAAC;QAC/D,IAAI,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;YAClB,MAAM,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YAC3B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,30 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
* Environment profile loader.
|
|
3
|
-
*
|
|
4
|
-
* The default profile is always read from DIGITAL_AI_BASE_URL + DIGITAL_AI_ACCESS_KEY.
|
|
5
|
-
* Named profiles follow the pattern:
|
|
6
|
-
*
|
|
7
|
-
* DAI_PROFILE_{NAME}_URL=https://tenant.experitest.com/
|
|
8
|
-
* DAI_PROFILE_{NAME}_KEY=<access key>
|
|
9
|
-
*
|
|
10
|
-
* Key format is NOT a privilege indicator (a Cloud Admin may hold either an eyJ... JWT or a short
|
|
11
|
-
* aut_1_... key). A profile's access level is resolved from the API — see src/api/access-level.ts.
|
|
12
|
-
*
|
|
13
|
-
* Profile names are case-insensitive and normalised to lowercase internally.
|
|
14
|
-
* Examples:
|
|
15
|
-
* DAI_PROFILE_PRODUCTION_URL / DAI_PROFILE_PRODUCTION_KEY → "production"
|
|
16
|
-
* DAI_PROFILE_QA_TEAM_URL / DAI_PROFILE_QA_TEAM_KEY → "qa_team"
|
|
17
|
-
*
|
|
18
|
-
* Profiles are scanned on first access. Because ES module imports are evaluated
|
|
19
|
-
* before statement-level code in the importer (i.e. before dotenv.config() runs),
|
|
20
|
-
* eager evaluation at module load time would see empty env vars. The lazy singleton
|
|
21
|
-
* below ensures env vars are read only when the first profile function is called,
|
|
22
|
-
* by which point dotenv has already populated process.env.
|
|
23
|
-
*/
|
|
1
|
+
export type ProfileSource = 'env' | 'store';
|
|
24
2
|
export interface EnvironmentProfile {
|
|
25
3
|
name: string;
|
|
26
4
|
url: string;
|
|
5
|
+
source: ProfileSource;
|
|
6
|
+
/** Store profiles only: where the key is kept (OS keychain or the profiles file). */
|
|
7
|
+
keyStore?: 'os' | 'file';
|
|
27
8
|
}
|
|
9
|
+
/** Test helper: forget the cached profiles so the next call re-reads env and store. */
|
|
10
|
+
export declare function resetProfilesForTests(): void;
|
|
28
11
|
/** All configured profiles without their keys — safe to surface in tool responses. */
|
|
29
12
|
export declare function listProfiles(): EnvironmentProfile[];
|
|
30
13
|
/** Retrieve a profile's full credentials by name (case-insensitive). */
|
|
@@ -36,4 +19,40 @@ export declare function getProfileCredentials(name: string): {
|
|
|
36
19
|
export declare function profileExists(name: string): boolean;
|
|
37
20
|
/** Number of configured profiles (including default). */
|
|
38
21
|
export declare function profileCount(): number;
|
|
22
|
+
/**
|
|
23
|
+
* The connection the server starts on — for src/api/client.ts only (it carries the key). The environment's default
|
|
24
|
+
* is read live, exactly as before the store existed; the store is consulted only when neither default variable is set.
|
|
25
|
+
*/
|
|
26
|
+
export declare function getStartingProfile(): {
|
|
27
|
+
name: string;
|
|
28
|
+
url: string;
|
|
29
|
+
key: string;
|
|
30
|
+
source: ProfileSource;
|
|
31
|
+
} | undefined;
|
|
32
|
+
/** Same as getStartingProfile, without the key — safe for logs and tool output. */
|
|
33
|
+
export declare function describeStartingProfile(): EnvironmentProfile | undefined;
|
|
34
|
+
export interface StartupCredentialProblem {
|
|
35
|
+
/** Environment variables to name in the setup instructions. */
|
|
36
|
+
missing: string[];
|
|
37
|
+
/** Why the credential store did not supply a starting connection, when it exists. Never contains a key. */
|
|
38
|
+
storeNote?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Null when the server has a starting connection. Otherwise what is missing — used at startup to decide whether the
|
|
42
|
+
* server runs normally or in setup mode (src/utils/setup-guidance.ts). Checks presence only; never returns a value.
|
|
43
|
+
*/
|
|
44
|
+
export declare function startupCredentialProblem(): StartupCredentialProblem | null;
|
|
45
|
+
export interface StoreStatus {
|
|
46
|
+
enabled: boolean;
|
|
47
|
+
path: string;
|
|
48
|
+
exists: boolean;
|
|
49
|
+
error?: string;
|
|
50
|
+
skipped: Array<{
|
|
51
|
+
name: string;
|
|
52
|
+
reason: string;
|
|
53
|
+
}>;
|
|
54
|
+
shadowed: string[];
|
|
55
|
+
}
|
|
56
|
+
/** The credential store's state, without keys — for list_environments. */
|
|
57
|
+
export declare function getStoreStatus(): StoreStatus;
|
|
39
58
|
//# sourceMappingURL=profile-loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-loader.d.ts","sourceRoot":"","sources":["../../src/utils/profile-loader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"profile-loader.d.ts","sourceRoot":"","sources":["../../src/utils/profile-loader.ts"],"names":[],"mappings":"AA8BA,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,OAAO,CAAC;AAE5C,MAAM,WAAW,kBAAkB;IACjC,IA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M,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACjD,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,0EAA0E;AAC1E,wBAAgB,cAAc,IAAI,WAAW,CAG5C"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Connection profile loader — environment variables plus the local credential store.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Environment (always wins):
|
|
5
|
+
* DIGITAL_AI_BASE_URL + DIGITAL_AI_ACCESS_KEY → profile "default", the starting connection
|
|
6
|
+
* DAI_PROFILE_{NAME}_URL + DAI_PROFILE_{NAME}_KEY → profile "{name}"
|
|
6
7
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
8
|
+
* Credential store (src/utils/credential-store.ts, off with MCP_CREDENTIAL_STORE=off): its profiles are added under
|
|
9
|
+
* their own names, except a name the environment already defines (that store entry is "shadowed" and ignored). The
|
|
10
|
+
* store's default profile is the starting connection only when the environment sets NEITHER default variable; if it
|
|
11
|
+
* sets only one, the server reports the missing one (setup mode) instead of quietly mixing sources.
|
|
9
12
|
*
|
|
10
13
|
* Key format is NOT a privilege indicator (a Cloud Admin may hold either an eyJ... JWT or a short
|
|
11
14
|
* aut_1_... key). A profile's access level is resolved from the API — see src/api/access-level.ts.
|
|
@@ -20,19 +23,22 @@
|
|
|
20
23
|
* eager evaluation at module load time would see empty env vars. The lazy singleton
|
|
21
24
|
* below ensures env vars are read only when the first profile function is called,
|
|
22
25
|
* by which point dotenv has already populated process.env.
|
|
26
|
+
*
|
|
27
|
+
* Credentials are read only here (env and store) and handed out only to src/api/client.ts and access-level.ts.
|
|
23
28
|
*/
|
|
29
|
+
import { readStore } from './credential-store.js';
|
|
30
|
+
const DEFAULT_VARS = ['DIGITAL_AI_BASE_URL', 'DIGITAL_AI_ACCESS_KEY'];
|
|
31
|
+
function envDefault() {
|
|
32
|
+
const url = process.env.DIGITAL_AI_BASE_URL?.trim();
|
|
33
|
+
const key = process.env.DIGITAL_AI_ACCESS_KEY?.trim();
|
|
34
|
+
return url && key ? { url: url.replace(/\/$/, ''), key } : undefined;
|
|
35
|
+
}
|
|
24
36
|
function loadProfiles() {
|
|
25
37
|
const profiles = {};
|
|
26
38
|
// Always include the default profile from the primary env vars.
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
profiles['default'] = {
|
|
31
|
-
name: 'default',
|
|
32
|
-
url: defaultUrl.replace(/\/$/, ''),
|
|
33
|
-
key: defaultKey,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
39
|
+
const def = envDefault();
|
|
40
|
+
if (def)
|
|
41
|
+
profiles['default'] = { name: 'default', source: 'env', ...def };
|
|
36
42
|
// Scan for DAI_PROFILE_*_URL pattern.
|
|
37
43
|
for (const [envKey, value] of Object.entries(process.env)) {
|
|
38
44
|
if (!value)
|
|
@@ -49,21 +55,36 @@ function loadProfiles() {
|
|
|
49
55
|
name: profileName,
|
|
50
56
|
url: value.replace(/\/$/, ''),
|
|
51
57
|
key: apiKey,
|
|
58
|
+
source: 'env',
|
|
52
59
|
};
|
|
53
60
|
}
|
|
54
|
-
|
|
61
|
+
const store = readStore();
|
|
62
|
+
const shadowed = [];
|
|
63
|
+
for (const [name, p] of Object.entries(store.profiles)) {
|
|
64
|
+
if (name in profiles)
|
|
65
|
+
shadowed.push(name);
|
|
66
|
+
else
|
|
67
|
+
profiles[name] = { name, url: p.url, key: p.key, source: 'store', keyStore: p.keyStore };
|
|
68
|
+
}
|
|
69
|
+
return { profiles, store, shadowed };
|
|
55
70
|
}
|
|
56
71
|
// Lazily initialised on first access — ensures dotenv has run before we read env vars.
|
|
57
|
-
let
|
|
72
|
+
let _loaded = null;
|
|
73
|
+
function getLoaded() {
|
|
74
|
+
if (!_loaded)
|
|
75
|
+
_loaded = loadProfiles();
|
|
76
|
+
return _loaded;
|
|
77
|
+
}
|
|
58
78
|
function getProfiles() {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
79
|
+
return getLoaded().profiles;
|
|
80
|
+
}
|
|
81
|
+
/** Test helper: forget the cached profiles so the next call re-reads env and store. */
|
|
82
|
+
export function resetProfilesForTests() {
|
|
83
|
+
_loaded = null;
|
|
63
84
|
}
|
|
64
85
|
/** All configured profiles without their keys — safe to surface in tool responses. */
|
|
65
86
|
export function listProfiles() {
|
|
66
|
-
return Object.values(getProfiles()).map(({ name, url }) => ({ name, url }));
|
|
87
|
+
return Object.values(getProfiles()).map(({ name, url, source, keyStore }) => ({ name, url, source, ...(keyStore ? { keyStore } : {}) }));
|
|
67
88
|
}
|
|
68
89
|
/** Retrieve a profile's full credentials by name (case-insensitive). */
|
|
69
90
|
export function getProfileCredentials(name) {
|
|
@@ -78,4 +99,70 @@ export function profileExists(name) {
|
|
|
78
99
|
export function profileCount() {
|
|
79
100
|
return Object.keys(getProfiles()).length;
|
|
80
101
|
}
|
|
102
|
+
/** The store profile that starts the session when the environment sets neither default variable. */
|
|
103
|
+
function storeStartingName() {
|
|
104
|
+
if (DEFAULT_VARS.some((k) => process.env[k]?.trim()))
|
|
105
|
+
return undefined;
|
|
106
|
+
const { profiles, store } = getLoaded();
|
|
107
|
+
// A default that names a profile the environment also defines starts on the environment's version (env wins).
|
|
108
|
+
if (store.defaultProfile && store.defaultProfile in profiles)
|
|
109
|
+
return store.defaultProfile;
|
|
110
|
+
// No "default" at all and exactly one store profile: that one. A "default" that names a broken profile never
|
|
111
|
+
// falls through to another one.
|
|
112
|
+
const defaultGiven = store.skipped.some((s) => s.name === '(default)');
|
|
113
|
+
const fromStore = Object.values(profiles).filter((p) => p.source === 'store');
|
|
114
|
+
if (!store.defaultProfile && !defaultGiven && fromStore.length === 1)
|
|
115
|
+
return fromStore[0].name;
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* The connection the server starts on — for src/api/client.ts only (it carries the key). The environment's default
|
|
120
|
+
* is read live, exactly as before the store existed; the store is consulted only when neither default variable is set.
|
|
121
|
+
*/
|
|
122
|
+
export function getStartingProfile() {
|
|
123
|
+
const def = envDefault();
|
|
124
|
+
if (def)
|
|
125
|
+
return { name: 'default', source: 'env', ...def };
|
|
126
|
+
const name = storeStartingName();
|
|
127
|
+
const p = name ? getProfiles()[name] : undefined;
|
|
128
|
+
return p ? { name: p.name, url: p.url, key: p.key, source: p.source } : undefined;
|
|
129
|
+
}
|
|
130
|
+
/** Same as getStartingProfile, without the key — safe for logs and tool output. */
|
|
131
|
+
export function describeStartingProfile() {
|
|
132
|
+
const p = getStartingProfile();
|
|
133
|
+
return p ? { name: p.name, url: p.url, source: p.source } : undefined;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Null when the server has a starting connection. Otherwise what is missing — used at startup to decide whether the
|
|
137
|
+
* server runs normally or in setup mode (src/utils/setup-guidance.ts). Checks presence only; never returns a value.
|
|
138
|
+
*/
|
|
139
|
+
export function startupCredentialProblem() {
|
|
140
|
+
const missing = DEFAULT_VARS.filter((k) => !process.env[k]?.trim());
|
|
141
|
+
// Exactly one default variable set: report it rather than fall back to the store behind the user's back.
|
|
142
|
+
if (missing.length === 1)
|
|
143
|
+
return { missing };
|
|
144
|
+
if (getStartingProfile())
|
|
145
|
+
return null;
|
|
146
|
+
const { profiles, store } = getLoaded();
|
|
147
|
+
let storeNote;
|
|
148
|
+
if (store.error) {
|
|
149
|
+
storeNote = `The credential store at ${store.path} could not be used: ${store.error}.`;
|
|
150
|
+
}
|
|
151
|
+
else if (store.exists) {
|
|
152
|
+
const names = Object.values(profiles).filter((p) => p.source === 'store').map((p) => p.name);
|
|
153
|
+
storeNote =
|
|
154
|
+
names.length === 0
|
|
155
|
+
? `The credential store at ${store.path} has no usable profile.`
|
|
156
|
+
: `The credential store at ${store.path} has profiles (${names.join(', ')}) but no usable "default" naming the one to start with.`;
|
|
157
|
+
}
|
|
158
|
+
if (storeNote && store.skipped.length > 0) {
|
|
159
|
+
storeNote += ' Skipped: ' + store.skipped.map((s) => `${s.name} — ${s.reason}`).join('; ') + '.';
|
|
160
|
+
}
|
|
161
|
+
return { missing: [...DEFAULT_VARS], storeNote };
|
|
162
|
+
}
|
|
163
|
+
/** The credential store's state, without keys — for list_environments. */
|
|
164
|
+
export function getStoreStatus() {
|
|
165
|
+
const { store, shadowed } = getLoaded();
|
|
166
|
+
return { enabled: store.enabled, path: store.path, exists: store.exists, error: store.error, skipped: store.skipped, shadowed };
|
|
167
|
+
}
|
|
81
168
|
//# sourceMappingURL=profile-loader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-loader.js","sourceRoot":"","sources":["../../src/utils/profile-loader.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"profile-loader.js","sourceRoot":"","sources":["../../src/utils/profile-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,SAAS,EAAwB,MAAM,uBAAuB,CAAC;AAuBxE,MAAM,YAAY,GAAG,CAAC,qBAAqB,EAAE,uBAAuB,CAAU,CAAC;AAE/E,SAAS,UAAU;IACjB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,EAAE,CAAC;IACpD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,EAAE,CAAC;IACtD,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACvE,CAAC;AAED,SAAS,YAAY;IACnB,MAAM,QAAQ,GAAgC,EAAE,CAAC;IAEjD,gEAAgE;IAChE,MAAM,GAAG,GAAG,UAAU,EAAE,CAAC;IACzB,IAAI,GAAG;QAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,EA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