@project-ava-supernova/core 0.2.186 → 0.2.188
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/agent/agent.d.ts +2 -1
- package/dist/agent/agent.d.ts.map +1 -1
- package/dist/agent/agent.js +22 -4
- package/dist/agent/agent.js.map +1 -1
- package/dist/agent/system-prompt.d.ts.map +1 -1
- package/dist/agent/system-prompt.js +13 -1
- package/dist/agent/system-prompt.js.map +1 -1
- package/dist/docs/content/features.d.ts.map +1 -1
- package/dist/docs/content/features.js +2 -1
- package/dist/docs/content/features.js.map +1 -1
- package/dist/docs/i18n/translations.d.ts.map +1 -1
- package/dist/docs/i18n/translations.js +1 -1
- package/dist/docs/i18n/translations.js.map +1 -1
- package/dist/i18n/keep-english.d.ts.map +1 -1
- package/dist/i18n/keep-english.js +0 -4
- package/dist/i18n/keep-english.js.map +1 -1
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +169 -33
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +169 -33
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +167 -32
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +170 -33
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +169 -33
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +169 -33
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +169 -33
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/id.d.ts.map +1 -1
- package/dist/i18n/locales/id.js +169 -33
- package/dist/i18n/locales/id.js.map +1 -1
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +169 -33
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +169 -33
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/ko.d.ts.map +1 -1
- package/dist/i18n/locales/ko.js +169 -33
- package/dist/i18n/locales/ko.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +169 -33
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +169 -33
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +169 -33
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +169 -33
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/th.d.ts.map +1 -1
- package/dist/i18n/locales/th.js +169 -33
- package/dist/i18n/locales/th.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +169 -33
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/uk.d.ts.map +1 -1
- package/dist/i18n/locales/uk.js +169 -33
- package/dist/i18n/locales/uk.js.map +1 -1
- package/dist/i18n/locales/vi.d.ts.map +1 -1
- package/dist/i18n/locales/vi.js +169 -33
- package/dist/i18n/locales/vi.js.map +1 -1
- package/dist/i18n/locales/zh-CN.d.ts.map +1 -1
- package/dist/i18n/locales/zh-CN.js +169 -33
- package/dist/i18n/locales/zh-CN.js.map +1 -1
- package/dist/i18n/locales/zh-TW.d.ts.map +1 -1
- package/dist/i18n/locales/zh-TW.js +169 -33
- package/dist/i18n/locales/zh-TW.js.map +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/connection.d.ts +125 -0
- package/dist/mcp/connection.d.ts.map +1 -0
- package/dist/mcp/connection.js +249 -0
- package/dist/mcp/connection.js.map +1 -0
- package/dist/mcp/import.d.ts +47 -0
- package/dist/mcp/import.d.ts.map +1 -0
- package/dist/mcp/import.js +157 -0
- package/dist/mcp/import.js.map +1 -0
- package/dist/mcp/index.d.ts +30 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +17 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/manager.d.ts +144 -0
- package/dist/mcp/manager.d.ts.map +1 -0
- package/dist/mcp/manager.js +550 -0
- package/dist/mcp/manager.js.map +1 -0
- package/dist/mcp/oauth.d.ts +117 -0
- package/dist/mcp/oauth.d.ts.map +1 -0
- package/dist/mcp/oauth.js +382 -0
- package/dist/mcp/oauth.js.map +1 -0
- package/dist/mcp/page.d.ts +99 -0
- package/dist/mcp/page.d.ts.map +1 -0
- package/dist/mcp/page.js +287 -0
- package/dist/mcp/page.js.map +1 -0
- package/dist/mcp/permissions.d.ts +22 -0
- package/dist/mcp/permissions.d.ts.map +1 -0
- package/dist/mcp/permissions.js +35 -0
- package/dist/mcp/permissions.js.map +1 -0
- package/dist/mcp/registry.d.ts +63 -0
- package/dist/mcp/registry.d.ts.map +1 -0
- package/dist/mcp/registry.js +106 -0
- package/dist/mcp/registry.js.map +1 -0
- package/dist/mcp/risk.d.ts +23 -0
- package/dist/mcp/risk.d.ts.map +1 -0
- package/dist/mcp/risk.js +98 -0
- package/dist/mcp/risk.js.map +1 -0
- package/dist/mcp/secrets.d.ts +38 -0
- package/dist/mcp/secrets.d.ts.map +1 -0
- package/dist/mcp/secrets.js +82 -0
- package/dist/mcp/secrets.js.map +1 -0
- package/dist/mcp/servers-config.d.ts +107 -0
- package/dist/mcp/servers-config.d.ts.map +1 -0
- package/dist/mcp/servers-config.js +243 -0
- package/dist/mcp/servers-config.js.map +1 -0
- package/dist/mcp/setup.d.ts +75 -0
- package/dist/mcp/setup.d.ts.map +1 -0
- package/dist/mcp/setup.js +150 -0
- package/dist/mcp/setup.js.map +1 -0
- package/dist/mcp/suggested.d.ts +47 -0
- package/dist/mcp/suggested.d.ts.map +1 -0
- package/dist/mcp/suggested.js +91 -0
- package/dist/mcp/suggested.js.map +1 -0
- package/dist/mcp/tools.d.ts +30 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +83 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/tools/blender/build-model.d.ts +10 -0
- package/dist/tools/blender/build-model.d.ts.map +1 -1
- package/dist/tools/blender/build-model.js +11 -2
- package/dist/tools/blender/build-model.js.map +1 -1
- package/dist/tools/blender/live-setup.d.ts +63 -0
- package/dist/tools/blender/live-setup.d.ts.map +1 -0
- package/dist/tools/blender/live-setup.js +281 -0
- package/dist/tools/blender/live-setup.js.map +1 -0
- package/dist/tools/blender/live-tools.d.ts +83 -0
- package/dist/tools/blender/live-tools.d.ts.map +1 -0
- package/dist/tools/blender/live-tools.js +402 -0
- package/dist/tools/blender/live-tools.js.map +1 -0
- package/dist/tools/blender/live.d.ts +88 -0
- package/dist/tools/blender/live.d.ts.map +1 -0
- package/dist/tools/blender/live.js +285 -0
- package/dist/tools/blender/live.js.map +1 -0
- package/dist/tools/blender/runner-py.d.ts +7 -0
- package/dist/tools/blender/runner-py.d.ts.map +1 -1
- package/dist/tools/blender/runner-py.js +108 -100
- package/dist/tools/blender/runner-py.js.map +1 -1
- package/dist/tools/connection-tools.d.ts +61 -0
- package/dist/tools/connection-tools.d.ts.map +1 -0
- package/dist/tools/connection-tools.js +271 -0
- package/dist/tools/connection-tools.js.map +1 -0
- package/dist/tools/tool-registry.d.ts +2 -0
- package/dist/tools/tool-registry.d.ts.map +1 -1
- package/dist/tools/tool-registry.js +35 -1
- package/dist/tools/tool-registry.js.map +1 -1
- package/dist/tools/tool-request-words.d.ts.map +1 -1
- package/dist/tools/tool-request-words.js +34 -0
- package/dist/tools/tool-request-words.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bringing in his servers from Claude Desktop, Cursor and VS Code (plan
|
|
3
|
+
* 2026-11-17-mcp-servers, decision 4: only when he asks, never by itself).
|
|
4
|
+
*
|
|
5
|
+
* Their files are read, never changed. What comes across:
|
|
6
|
+
* - the command or address exactly as it is;
|
|
7
|
+
* - keys and passwords written in plain text in their files (env values and
|
|
8
|
+
* headers that look like secrets) MOVE into his keychain, and the entry
|
|
9
|
+
* says `${secret:<server>.<NAME>}` instead;
|
|
10
|
+
* - VS Code's `${input:…}` (asked for each time there) becomes a key slot he
|
|
11
|
+
* fills on the Connections page: its value was never in the file.
|
|
12
|
+
*
|
|
13
|
+
* A scan never reveals a secret: what it shows has them swapped out already.
|
|
14
|
+
*/
|
|
15
|
+
import { existsSync } from 'node:fs';
|
|
16
|
+
import { readFile } from 'node:fs/promises';
|
|
17
|
+
import { homedir } from 'node:os';
|
|
18
|
+
import { join } from 'node:path';
|
|
19
|
+
import { cleanServerId, describeEntry, fingerprint, isWebEntry, readEntry, readMcpFile } from './servers-config.js';
|
|
20
|
+
import { redactSecrets, riskNotes } from './risk.js';
|
|
21
|
+
export const MCP_IMPORT_APP_NAMES = {
|
|
22
|
+
'claude-desktop': 'Claude Desktop',
|
|
23
|
+
cursor: 'Cursor',
|
|
24
|
+
vscode: 'VS Code',
|
|
25
|
+
};
|
|
26
|
+
/** Where each app keeps its servers, on this computer. */
|
|
27
|
+
export function mcpImportPaths(platform = process.platform, home = homedir(), env = process.env) {
|
|
28
|
+
const appData = env.APPDATA || join(home, 'AppData', 'Roaming');
|
|
29
|
+
const support = platform === 'win32' ? appData : platform === 'darwin' ? join(home, 'Library', 'Application Support') : (env.XDG_CONFIG_HOME || join(home, '.config'));
|
|
30
|
+
return {
|
|
31
|
+
'claude-desktop': join(support, 'Claude', 'claude_desktop_config.json'),
|
|
32
|
+
cursor: join(home, '.cursor', 'mcp.json'),
|
|
33
|
+
vscode: join(support, 'Code', 'User', 'mcp.json'),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
const SECRET_NAME = /pass(word|wd)?|secret|token|api[_-]?key|access[_-]?key|private[_-]?key|credential|auth|pat$/i;
|
|
37
|
+
const SECRET_VALUE = /^(ghp_|github_pat_|sk-|xox[abpr]-|AKIA|AIza|glpat-|npm_)/;
|
|
38
|
+
/** Turn one of their entries into ours, moving secrets out. */
|
|
39
|
+
function convert(app, name, raw) {
|
|
40
|
+
const e = readEntry(raw);
|
|
41
|
+
if (!e)
|
|
42
|
+
return null;
|
|
43
|
+
const id = cleanServerId(name);
|
|
44
|
+
const secrets = {};
|
|
45
|
+
const slots = [];
|
|
46
|
+
// VS Code: ${input:x} was asked for each time; here it's a key he sets once.
|
|
47
|
+
const inputs = (v) => v.replace(/\$\{input:([^}]+)\}/g, (_m, x) => {
|
|
48
|
+
const slot = `${id}.${cleanServerId(x)}`;
|
|
49
|
+
if (!slots.includes(slot))
|
|
50
|
+
slots.push(slot);
|
|
51
|
+
return `\${secret:${slot}}`;
|
|
52
|
+
});
|
|
53
|
+
if (e.env) {
|
|
54
|
+
for (const [k, v] of Object.entries(e.env)) {
|
|
55
|
+
if (v.includes('${')) {
|
|
56
|
+
e.env[k] = inputs(v);
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
if (v && (SECRET_NAME.test(k) || SECRET_VALUE.test(v))) {
|
|
60
|
+
const slot = `${id}.${k}`;
|
|
61
|
+
secrets[slot] = v;
|
|
62
|
+
e.env[k] = `\${secret:${slot}}`;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (e.headers) {
|
|
67
|
+
for (const [k, v] of Object.entries(e.headers)) {
|
|
68
|
+
if (v.includes('${')) {
|
|
69
|
+
e.headers[k] = inputs(v);
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const schemed = /^(Bearer|Token|Basic)\s+(.+)$/i.exec(v);
|
|
73
|
+
if (schemed || /authorization|api[-_]?key|token|secret/i.test(k)) {
|
|
74
|
+
const slot = `${id}.${cleanServerId(k)}`;
|
|
75
|
+
secrets[slot] = schemed ? schemed[2] : v;
|
|
76
|
+
e.headers[k] = schemed ? `${schemed[1]} \${secret:${slot}}` : `\${secret:${slot}}`;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (e.args)
|
|
81
|
+
e.args = e.args.map(inputs);
|
|
82
|
+
if (e.url)
|
|
83
|
+
e.url = inputs(e.url);
|
|
84
|
+
// Their on/off and allow lists are theirs: he decides here afresh.
|
|
85
|
+
delete e.enabled;
|
|
86
|
+
delete e.allow;
|
|
87
|
+
// What's shown has any key or password left in the command masked.
|
|
88
|
+
const notes = riskNotes(e).map((n) => (n.code === 'plain-secret' && n.detail ? { ...n, detail: redactSecrets(n.detail) } : n));
|
|
89
|
+
return { app, name, id, entry: e, secrets, slots, shows: redactSecrets(describeEntry(e)), notes, online: isWebEntry(e) };
|
|
90
|
+
}
|
|
91
|
+
/** What each app has, ready to bring in. Reads only. */
|
|
92
|
+
export async function scanMcpImports(paths = mcpImportPaths()) {
|
|
93
|
+
const mine = (await readMcpFile()).file.mcpServers;
|
|
94
|
+
const out = [];
|
|
95
|
+
for (const app of Object.keys(paths)) {
|
|
96
|
+
const path = paths[app];
|
|
97
|
+
const src = { app, path, found: existsSync(path), servers: [] };
|
|
98
|
+
out.push(src);
|
|
99
|
+
if (!src.found)
|
|
100
|
+
continue;
|
|
101
|
+
try {
|
|
102
|
+
const text = await readFile(path, 'utf8');
|
|
103
|
+
const json = text.trim() ? JSON.parse(stripJsonComments(text)) : {};
|
|
104
|
+
const servers = (json.mcpServers ?? json.servers ?? {});
|
|
105
|
+
for (const [name, raw] of Object.entries(servers)) {
|
|
106
|
+
const c = convert(app, name, raw);
|
|
107
|
+
if (!c)
|
|
108
|
+
continue;
|
|
109
|
+
const have = mine[c.id];
|
|
110
|
+
src.servers.push({ ...c, here: !have ? 'no' : fingerprint(have) === fingerprint(c.entry) ? 'same' : 'different' });
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
catch (err) {
|
|
114
|
+
src.problem = err instanceof Error ? err.message : String(err);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return out;
|
|
118
|
+
}
|
|
119
|
+
/** VS Code's files may carry comments and trailing commas. */
|
|
120
|
+
function stripJsonComments(text) {
|
|
121
|
+
let out = '';
|
|
122
|
+
let inStr = false;
|
|
123
|
+
for (let i = 0; i < text.length; i++) {
|
|
124
|
+
const c = text[i];
|
|
125
|
+
if (inStr) {
|
|
126
|
+
out += c;
|
|
127
|
+
if (c === '\\') {
|
|
128
|
+
out += text[++i] ?? '';
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
if (c === '"')
|
|
132
|
+
inStr = false;
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
if (c === '"') {
|
|
136
|
+
inStr = true;
|
|
137
|
+
out += c;
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
if (c === '/' && text[i + 1] === '/') {
|
|
141
|
+
while (i < text.length && text[i] !== '\n')
|
|
142
|
+
i++;
|
|
143
|
+
out += '\n';
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
if (c === '/' && text[i + 1] === '*') {
|
|
147
|
+
i += 2;
|
|
148
|
+
while (i < text.length && !(text[i] === '*' && text[i + 1] === '/'))
|
|
149
|
+
i++;
|
|
150
|
+
i++;
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
out += c;
|
|
154
|
+
}
|
|
155
|
+
return out.replace(/,(\s*[}\]])/g, '$1');
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=import.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import.js","sourceRoot":"","sources":["../../src/mcp/import.ts"],"names":[],"mapp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C,EAAE,CAAC;YAAC,SAAS;QAAC,CAAC;QAC1I,GAAG,IAAI,CAAC,CAAC;IACX,CAAC;IACD,OAAO,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export { McpConnection, isLocalUrl } from './connection.js';
|
|
2
|
+
export type { McpServerConfig, McpTransportConfig, McpToolInfo, McpCallResult } from './connection.js';
|
|
3
|
+
export { mcpToolsForAva, avaToolName, riskFor } from './tools.js';
|
|
4
|
+
export type { McpToolOptions } from './tools.js';
|
|
5
|
+
export { checkServerUrl, isUnauthorized } from './connection.js';
|
|
6
|
+
export { McpServers, syncMcpTools } from './manager.js';
|
|
7
|
+
export type { McpServerState, McpServerStatus, McpToolStatus, McpScope } from './manager.js';
|
|
8
|
+
export { mcpConfigPath, projectMcpPath, readMcpFile, updateMcpFile, readProjectServers, readEntry, fingerprint, describeEntry, secretsUsed, cleanServerId, isWebEntry, } from './servers-config.js';
|
|
9
|
+
export type { McpFile, McpServerEntry, McpProjectAnswers } from './servers-config.js';
|
|
10
|
+
export { setMcpKeychain, hasMcpKeychain, getMcpSecret, setMcpSecret, mcpSecretNames, getMcpAuth, setMcpAuth } from './secrets.js';
|
|
11
|
+
export type { McpKeychain } from './secrets.js';
|
|
12
|
+
export { isUserMcpTool, mcpToolInMode, mcpToolAlwaysAllowed, USER_MCP_PREFIX } from './permissions.js';
|
|
13
|
+
export { mcpPage, splitCommandLine, MCP_HEAVY_TOOLS } from './page.js';
|
|
14
|
+
export type { McpDraft, McpPageState, McpPageServer, McpCheck } from './page.js';
|
|
15
|
+
export { riskNotes } from './risk.js';
|
|
16
|
+
export type { McpRiskCode, McpRiskNote } from './risk.js';
|
|
17
|
+
export { setMcpBrowserOpener, hasMcpBrowserOpener, checkSignInUrl, addressZone, fencedFetch, listenForSignIn, setMcpSignInPort, mcpAuthKey, isSignedIn, forgetSignIn, AvaOAuthProvider, } from './oauth.js';
|
|
18
|
+
export type { McpBrowserOpener, McpAuthRecord, McpSignInWords } from './oauth.js';
|
|
19
|
+
export { signInToServer } from './connection.js';
|
|
20
|
+
export { searchMcpRegistry, clearMcpRegistryCache } from './registry.js';
|
|
21
|
+
export type { McpRegistryServer, McpRegistryPackage, McpRegistryRemote } from './registry.js';
|
|
22
|
+
export { scanMcpImports, mcpImportPaths, MCP_IMPORT_APP_NAMES } from './import.js';
|
|
23
|
+
export type { McpImportApp, McpImportCandidate, McpImportSource } from './import.js';
|
|
24
|
+
export { checkProposal, addMcpServers, importMcpServers, settleMcpServers, statusInWords } from './setup.js';
|
|
25
|
+
export type { McpProposal, McpImportResult } from './setup.js';
|
|
26
|
+
export { redactSecrets } from './risk.js';
|
|
27
|
+
export type { McpAvaNote } from './servers-config.js';
|
|
28
|
+
export { MCP_SUGGESTIONS, suggestedScopes } from './suggested.js';
|
|
29
|
+
export type { McpSuggestion, McpSuggestionKind } from './suggested.js';
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC5D,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACvG,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAClE,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACxD,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7F,OAA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E,cAAc,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnF,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC7G,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAClE,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { McpConnection, isLocalUrl } from './connection.js';
|
|
2
|
+
export { mcpToolsForAva, avaToolName, riskFor } from './tools.js';
|
|
3
|
+
export { checkServerUrl, isUnauthorized } from './connection.js';
|
|
4
|
+
export { McpServers, syncMcpTools } from './manager.js';
|
|
5
|
+
export { mcpConfigPath, projectMcpPath, readMcpFile, updateMcpFile, readProjectServers, readEntry, fingerprint, describeEntry, secretsUsed, cleanServerId, isWebEntry, } from './servers-config.js';
|
|
6
|
+
export { setMcpKeychain, hasMcpKeychain, getMcpSecret, setMcpSecret, mcpSecretNames, getMcpAuth, setMcpAuth } from './secrets.js';
|
|
7
|
+
export { isUserMcpTool, mcpToolInMode, mcpToolAlwaysAllowed, USER_MCP_PREFIX } from './permissions.js';
|
|
8
|
+
export { mcpPage, splitCommandLine, MCP_HEAVY_TOOLS } from './page.js';
|
|
9
|
+
export { riskNotes } from './risk.js';
|
|
10
|
+
export { setMcpBrowserOpener, hasMcpBrowserOpener, checkSignInUrl, addressZone, fencedFetch, listenForSignIn, setMcpSignInPort, mcpAuthKey, isSignedIn, forgetSignIn, AvaOAuthProvider, } from './oauth.js';
|
|
11
|
+
export { signInToServer } from './connection.js';
|
|
12
|
+
export { searchMcpRegistry, clearMcpRegistryCache } from './registry.js';
|
|
13
|
+
export { scanMcpImports, mcpImportPaths, MCP_IMPORT_APP_NAMES } from './import.js';
|
|
14
|
+
export { checkProposal, addMcpServers, importMcpServers, settleMcpServers, statusInWords } from './setup.js';
|
|
15
|
+
export { redactSecrets } from './risk.js';
|
|
16
|
+
export { MCP_SUGGESTIONS, suggestedScopes } from './suggested.js';
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAElE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAExD,OAAO,EACL,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,kBAAkB,EAAE,SAAS,EAAE,WAAW,EACrG,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,GACtD,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAElI,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACvG,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEvE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EACL,mBAAmB,EAAE,mBAAmB,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EACnG,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,gBAAgB,GACzE,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnF,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE7G,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* McpServers — the person's MCP servers, running for the main chat
|
|
3
|
+
* (plan: Decisions/plans/2026-11-17-mcp-servers.md, Phase 1).
|
|
4
|
+
*
|
|
5
|
+
* - His servers (~/.ava/mcp.json) start when switched on; a project's own
|
|
6
|
+
* servers (.mcp.json) only after his yes for that project, and only while
|
|
7
|
+
* the command is the one he saw (servers-config.ts).
|
|
8
|
+
* - Each server has a status the Connections page shows (Phase 2): off,
|
|
9
|
+
* waiting for his yes, connecting, ready, needs a key, needs a sign-in, or
|
|
10
|
+
* what went wrong in the server's own words.
|
|
11
|
+
* - Its tools reach Ava as `mcp_<server>_<tool>`: asking first, untrusted
|
|
12
|
+
* output, mode rules in permissions.ts.
|
|
13
|
+
* - Both files are watched, so a change made in the other app (or by hand)
|
|
14
|
+
* shows up without a restart.
|
|
15
|
+
*
|
|
16
|
+
* Each app runs its own copy: the extension and the IDE are separate MCP
|
|
17
|
+
* clients, as two editors would be.
|
|
18
|
+
*/
|
|
19
|
+
import type { Tool } from '../tools/types.js';
|
|
20
|
+
import { type McpServerEntry } from './servers-config.js';
|
|
21
|
+
import { type McpSignInWords } from './oauth.js';
|
|
22
|
+
import { type McpRiskNote } from './risk.js';
|
|
23
|
+
export type McpServerState = 'off' | 'waiting' | 'connecting' | 'ready' | 'needs-key' | 'needs-signin' | 'error';
|
|
24
|
+
export type McpScope = 'user' | 'project';
|
|
25
|
+
export interface McpToolStatus {
|
|
26
|
+
/** The server's own name for it. */
|
|
27
|
+
name: string;
|
|
28
|
+
/** Ava's name for it (mcp_<server>_<tool>). */
|
|
29
|
+
avaName: string;
|
|
30
|
+
description: string;
|
|
31
|
+
readOnly: boolean;
|
|
32
|
+
allowed: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface McpServerStatus {
|
|
35
|
+
id: string;
|
|
36
|
+
scope: McpScope;
|
|
37
|
+
state: McpServerState;
|
|
38
|
+
/** What's wrong, or why it waits, in plain words (English: for logs and for Ava). */
|
|
39
|
+
message?: string;
|
|
40
|
+
/** Why, as a code the page says in his language. */
|
|
41
|
+
reason?: 'new' | 'changed' | 'declined' | 'shadowed' | 'stopped' | 'signin';
|
|
42
|
+
/** The keys it needs that aren't in the keychain (needs-key). */
|
|
43
|
+
missing?: string[];
|
|
44
|
+
/** What to point out about its command or address before it runs (risk.ts). */
|
|
45
|
+
notes: McpRiskNote[];
|
|
46
|
+
online: boolean;
|
|
47
|
+
/** The exact command or address (secrets left as ${secret:…}). */
|
|
48
|
+
shows: string;
|
|
49
|
+
fingerprint: string;
|
|
50
|
+
/** Secret names it uses. */
|
|
51
|
+
secrets: string[];
|
|
52
|
+
tools: McpToolStatus[];
|
|
53
|
+
/** The server's own name and version, once connected. */
|
|
54
|
+
server?: {
|
|
55
|
+
name: string;
|
|
56
|
+
version: string;
|
|
57
|
+
};
|
|
58
|
+
/** Ava's view of it and where it came from (only his own servers: a project's file can't speak for her). */
|
|
59
|
+
ava?: McpServerEntry['ava'];
|
|
60
|
+
/** An online server he has signed in to (oauth.ts). */
|
|
61
|
+
signedIn?: boolean;
|
|
62
|
+
/** His browser is open on its sign-in page. */
|
|
63
|
+
signingIn?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export declare class McpServers {
|
|
66
|
+
private static instance;
|
|
67
|
+
static current(): McpServers;
|
|
68
|
+
/** Tests: a fresh manager. */
|
|
69
|
+
static reset(): void;
|
|
70
|
+
private projectRoot;
|
|
71
|
+
private file;
|
|
72
|
+
private project;
|
|
73
|
+
private problems;
|
|
74
|
+
private readonly running;
|
|
75
|
+
/** Servers being started right now (a reload meanwhile mustn't start them twice). */
|
|
76
|
+
private readonly starting;
|
|
77
|
+
/** Each start's number: a restart meanwhile retires the start in flight. */
|
|
78
|
+
private readonly gens;
|
|
79
|
+
private readonly statuses;
|
|
80
|
+
/** Sign-ins in progress, by server. */
|
|
81
|
+
private readonly signingIn;
|
|
82
|
+
/** Why the last sign-in didn't finish, by server (until the next try). */
|
|
83
|
+
private readonly signInProblems;
|
|
84
|
+
/** The servers with a sign-in kept (keychain names, oauth.ts mcpAuthKey). */
|
|
85
|
+
private signedIn;
|
|
86
|
+
private readonly listeners;
|
|
87
|
+
private watchers;
|
|
88
|
+
private reloadChain;
|
|
89
|
+
private reloadTimer;
|
|
90
|
+
private started;
|
|
91
|
+
private constructor();
|
|
92
|
+
/** Start (or follow a new project folder). Safe to call again. */
|
|
93
|
+
start(projectRoot?: string | null): Promise<void>;
|
|
94
|
+
setProjectRoot(root: string | null): Promise<void>;
|
|
95
|
+
stopAll(): Promise<void>;
|
|
96
|
+
onChange(listener: () => void): () => void;
|
|
97
|
+
private emit;
|
|
98
|
+
status(): McpServerStatus[];
|
|
99
|
+
private authKey;
|
|
100
|
+
/** Problems reading the files, for the page. */
|
|
101
|
+
fileProblems(): string[];
|
|
102
|
+
get projectFolder(): string | null;
|
|
103
|
+
/** Has an app started it yet? (The Connections page can open before the chat does.) */
|
|
104
|
+
get isStarted(): boolean;
|
|
105
|
+
/** Every connected server's tools, as Ava tools. */
|
|
106
|
+
tools(): Tool[];
|
|
107
|
+
private toolByAvaName;
|
|
108
|
+
isAlwaysAllowed(avaName: string): boolean;
|
|
109
|
+
/** "Always allow" (or take it back) for one tool, remembered in ~/.ava/mcp.json. */
|
|
110
|
+
allowTool(avaName: string, on?: boolean): Promise<boolean>;
|
|
111
|
+
/** His yes (or no) to one of this project's servers. */
|
|
112
|
+
answerProjectServer(id: string, answer: 'yes' | 'not-now' | 'never'): Promise<void>;
|
|
113
|
+
/** Switch one of his servers on or off. */
|
|
114
|
+
setEnabled(id: string, on: boolean): Promise<void>;
|
|
115
|
+
/** Stop and start one server again. */
|
|
116
|
+
restart(scope: McpScope, id: string): Promise<void>;
|
|
117
|
+
/**
|
|
118
|
+
* Send him to an online server's sign-in page. Resolves once his browser
|
|
119
|
+
* is open on it (or fails with why it couldn't start); the rest happens in
|
|
120
|
+
* the background, and the server starts again once he's signed in.
|
|
121
|
+
*/
|
|
122
|
+
signIn(scope: McpScope, id: string, words?: McpSignInWords): Promise<void>;
|
|
123
|
+
/** Stop waiting for his browser. */
|
|
124
|
+
cancelSignIn(scope: McpScope, id: string): void;
|
|
125
|
+
/** Forget his sign-in to a server, and start it again (it will want one). */
|
|
126
|
+
signOut(scope: McpScope, id: string): Promise<void>;
|
|
127
|
+
/** An online server's address and headers, with its keys filled in. */
|
|
128
|
+
private webTransport;
|
|
129
|
+
/** Re-read both files and start/stop servers to match. Calls are queued. */
|
|
130
|
+
reload(): Promise<void>;
|
|
131
|
+
private doReload;
|
|
132
|
+
private readyStatus;
|
|
133
|
+
private connect;
|
|
134
|
+
private watchFiles;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Put the servers' tools in a registry, or take them away: call on start and
|
|
138
|
+
* on every change (`McpServers.current().onChange`).
|
|
139
|
+
*/
|
|
140
|
+
export declare function syncMcpTools(registry: {
|
|
141
|
+
register(t: Tool): void;
|
|
142
|
+
unregisterWhere(m: (n: string) => boolean): number;
|
|
143
|
+
}): number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