godot-cli 0.16.2 → 0.17.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/dist/commands/configure.js +24 -1
- package/dist/commands/configure.js.map +1 -1
- package/dist/commands/install-plugin.js +99 -7
- package/dist/commands/install-plugin.js.map +1 -1
- package/dist/commands/login.js +53 -15
- package/dist/commands/login.js.map +1 -1
- package/dist/lib/configure-agent.d.ts +20 -0
- package/dist/lib/configure-agent.js +115 -0
- package/dist/lib/configure-agent.js.map +1 -0
- package/dist/lib/enroll.d.ts +21 -0
- package/dist/lib/enroll.js +100 -0
- package/dist/lib/enroll.js.map +1 -0
- package/dist/lib/install-server.d.ts +25 -0
- package/dist/lib/install-server.js +234 -0
- package/dist/lib/install-server.js.map +1 -0
- package/dist/lib/setup-mcp.d.ts +28 -0
- package/dist/lib/setup-mcp.js +61 -1
- package/dist/lib/setup-mcp.js.map +1 -1
- package/dist/lib/types.d.ts +138 -0
- package/dist/lib.d.ts +4 -1
- package/dist/lib.js +3 -0
- package/dist/lib.js.map +1 -1
- package/dist/utils/addon-deps.js +2 -2
- package/dist/utils/addon-deps.js.map +1 -1
- package/dist/utils/agents.d.ts +12 -0
- package/dist/utils/agents.js +24 -0
- package/dist/utils/agents.js.map +1 -1
- package/dist/utils/cloud-login.d.ts +22 -4
- package/dist/utils/cloud-login.js +40 -17
- package/dist/utils/cloud-login.js.map +1 -1
- package/dist/utils/connection.d.ts +4 -7
- package/dist/utils/connection.js +8 -10
- package/dist/utils/connection.js.map +1 -1
- package/dist/utils/enroll.d.ts +39 -0
- package/dist/utils/enroll.js +66 -0
- package/dist/utils/enroll.js.map +1 -0
- package/dist/utils/machine-credentials.d.ts +74 -0
- package/dist/utils/machine-credentials.js +182 -0
- package/dist/utils/machine-credentials.js.map +1 -0
- package/dist/utils/project-identity.d.ts +76 -0
- package/dist/utils/project-identity.js +111 -0
- package/dist/utils/project-identity.js.map +1 -0
- package/dist/utils/project-marker.d.ts +64 -0
- package/dist/utils/project-marker.js +192 -0
- package/dist/utils/project-marker.js.map +1 -0
- package/dist/utils/server-source.d.ts +84 -0
- package/dist/utils/server-source.js +217 -0
- package/dist/utils/server-source.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { InstallServerOptions, InstallServerResult } from './types.js';
|
|
2
|
+
/** Relative path of the CLI-managed server dir inside a project (design 06: "the CLI's managed directory"). */
|
|
3
|
+
export declare const MANAGED_SERVER_REL_DIR: string;
|
|
4
|
+
/** Absolute path of the CLI-managed server directory for a project. */
|
|
5
|
+
export declare function getManagedServerDir(projectPath: string): string;
|
|
6
|
+
/** Absolute path of the managed server executable for a project (the file the `configure` proxy spawns). */
|
|
7
|
+
export declare function getManagedServerExecutablePath(projectPath: string, platform?: NodeJS.Platform): string;
|
|
8
|
+
/**
|
|
9
|
+
* Install the shared `gamedev-mcp-server` binary into the CLI-managed directory
|
|
10
|
+
* `<project>/.ai-game-dev/server/` — the `install-plugin --with-server` flow (D12).
|
|
11
|
+
*
|
|
12
|
+
* 1. Download path (default): resolve the host RID, download the RID-matched
|
|
13
|
+
* `gamedev-mcp-server-<rid>.zip` from github.com only (fail-closed host
|
|
14
|
+
* trust), download the release `SHA256SUMS`, and VERIFY the zip's SHA256
|
|
15
|
+
* against the manifest BEFORE extraction (fail-closed — any non-`verified`
|
|
16
|
+
* verdict aborts and leaves the project untouched). Then extract + swap.
|
|
17
|
+
* 2. Local path (`--server-source`): copy a trusted local server dir / `.zip`
|
|
18
|
+
* into the managed dir with no network + no checksum (the local artifact is
|
|
19
|
+
* trusted). Offline / dev / CI.
|
|
20
|
+
*
|
|
21
|
+
* Library-safe: no stdout noise, no `process.exit`, no throws past the boundary;
|
|
22
|
+
* returns a `{ kind }` union. Materializes into a temp sibling and swaps only on
|
|
23
|
+
* full success, so a partial download/extract is rolled back.
|
|
24
|
+
*/
|
|
25
|
+
export declare function installServer(opts: InstallServerOptions): Promise<InstallServerResult>;
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import { DEFAULT_SERVER_VERSION, detectHostRid, serverDownloadUrl, serverAssetName, serverExecutableFileName, sha256SumsUrl, assertTrustedServerUrl, verifyZipChecksum, checksumFailureReason, sha256Hex, } from '../utils/server-source.js';
|
|
4
|
+
import { parseZip } from '../utils/unzip.js';
|
|
5
|
+
import { emitProgress } from './progress.js';
|
|
6
|
+
/** Relative path of the CLI-managed server dir inside a project (design 06: "the CLI's managed directory"). */
|
|
7
|
+
export const MANAGED_SERVER_REL_DIR = path.join('.ai-game-dev', 'server');
|
|
8
|
+
/** Absolute path of the CLI-managed server directory for a project. */
|
|
9
|
+
export function getManagedServerDir(projectPath) {
|
|
10
|
+
return path.join(projectPath, MANAGED_SERVER_REL_DIR);
|
|
11
|
+
}
|
|
12
|
+
/** Absolute path of the managed server executable for a project (the file the `configure` proxy spawns). */
|
|
13
|
+
export function getManagedServerExecutablePath(projectPath, platform = process.platform) {
|
|
14
|
+
return path.join(getManagedServerDir(projectPath), serverExecutableFileName(platform));
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Install the shared `gamedev-mcp-server` binary into the CLI-managed directory
|
|
18
|
+
* `<project>/.ai-game-dev/server/` — the `install-plugin --with-server` flow (D12).
|
|
19
|
+
*
|
|
20
|
+
* 1. Download path (default): resolve the host RID, download the RID-matched
|
|
21
|
+
* `gamedev-mcp-server-<rid>.zip` from github.com only (fail-closed host
|
|
22
|
+
* trust), download the release `SHA256SUMS`, and VERIFY the zip's SHA256
|
|
23
|
+
* against the manifest BEFORE extraction (fail-closed — any non-`verified`
|
|
24
|
+
* verdict aborts and leaves the project untouched). Then extract + swap.
|
|
25
|
+
* 2. Local path (`--server-source`): copy a trusted local server dir / `.zip`
|
|
26
|
+
* into the managed dir with no network + no checksum (the local artifact is
|
|
27
|
+
* trusted). Offline / dev / CI.
|
|
28
|
+
*
|
|
29
|
+
* Library-safe: no stdout noise, no `process.exit`, no throws past the boundary;
|
|
30
|
+
* returns a `{ kind }` union. Materializes into a temp sibling and swaps only on
|
|
31
|
+
* full success, so a partial download/extract is rolled back.
|
|
32
|
+
*/
|
|
33
|
+
export async function installServer(opts) {
|
|
34
|
+
const warnings = [];
|
|
35
|
+
const platform = process.platform;
|
|
36
|
+
try {
|
|
37
|
+
const projectPath = path.resolve(opts.godotProjectPath);
|
|
38
|
+
if (!fs.existsSync(projectPath)) {
|
|
39
|
+
throw new Error(`Project path does not exist: ${projectPath}`);
|
|
40
|
+
}
|
|
41
|
+
const serverDir = getManagedServerDir(projectPath);
|
|
42
|
+
if (opts.source !== undefined && opts.source !== '') {
|
|
43
|
+
return installFromLocal(projectPath, serverDir, opts.source, platform, warnings, opts.onProgress);
|
|
44
|
+
}
|
|
45
|
+
return await installFromDownload(projectPath, serverDir, platform, warnings, opts);
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
return {
|
|
49
|
+
kind: 'failure',
|
|
50
|
+
success: false,
|
|
51
|
+
warnings,
|
|
52
|
+
error: err instanceof Error ? err : new Error(String(err)),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
async function installFromDownload(projectPath, serverDir, platform, warnings, opts) {
|
|
57
|
+
const rid = (opts.rid ?? detectHostRid()).trim();
|
|
58
|
+
if (rid.includes('unknown')) {
|
|
59
|
+
throw new Error(`Cannot detect a supported host RID (got "${rid}"). Use --server-source <path> to install a server binary manually.`);
|
|
60
|
+
}
|
|
61
|
+
const version = (opts.version ?? DEFAULT_SERVER_VERSION).trim();
|
|
62
|
+
if (version === '') {
|
|
63
|
+
throw new Error('No server version to download. Pass --server-version <x.y.z> or --server-source <path>.');
|
|
64
|
+
}
|
|
65
|
+
const url = serverDownloadUrl(version, rid);
|
|
66
|
+
assertTrustedServerUrl(url);
|
|
67
|
+
const assetName = serverAssetName(rid);
|
|
68
|
+
const fetchImpl = opts.fetchImpl ?? globalThis.fetch;
|
|
69
|
+
emitProgress(opts.onProgress, {
|
|
70
|
+
phase: 'server-downloading',
|
|
71
|
+
message: `Downloading ${assetName} (${version}) from ${url}`,
|
|
72
|
+
url,
|
|
73
|
+
});
|
|
74
|
+
const zipResponse = await fetchImpl(url);
|
|
75
|
+
if (!zipResponse.ok) {
|
|
76
|
+
throw new Error(`Failed to download server ${version} for ${rid}: HTTP ${zipResponse.status} ${zipResponse.statusText} from ${url}. ` +
|
|
77
|
+
`Verify the release v${version} exists with a ${assetName} asset, or use --server-source <path>.`);
|
|
78
|
+
}
|
|
79
|
+
const archive = Buffer.from(await zipResponse.arrayBuffer());
|
|
80
|
+
// Fail-closed integrity: download SHA256SUMS + verify BEFORE extraction.
|
|
81
|
+
const sumsUrl = sha256SumsUrl(version);
|
|
82
|
+
assertTrustedServerUrl(sumsUrl);
|
|
83
|
+
emitProgress(opts.onProgress, { phase: 'server-verifying', message: `Verifying against ${sumsUrl}` });
|
|
84
|
+
const sumsResponse = await fetchImpl(sumsUrl);
|
|
85
|
+
if (!sumsResponse.ok) {
|
|
86
|
+
throw new Error(`Refusing to install an unverified server: could not download ${sumsUrl} (HTTP ${sumsResponse.status}). ` +
|
|
87
|
+
`The release must publish a SHA256SUMS manifest.`);
|
|
88
|
+
}
|
|
89
|
+
const sumsText = await sumsResponse.text();
|
|
90
|
+
const actualDigest = sha256Hex(archive);
|
|
91
|
+
const verdict = verifyZipChecksum(sumsText, assetName, actualDigest);
|
|
92
|
+
if (verdict !== 'verified') {
|
|
93
|
+
throw new Error(`Refusing to install server ${version} for ${rid}: ${checksumFailureReason(verdict, assetName)} (fail-closed).`);
|
|
94
|
+
}
|
|
95
|
+
emitProgress(opts.onProgress, { phase: 'server-extracting', message: 'Extracting verified server zip' });
|
|
96
|
+
const entries = parseZip(archive);
|
|
97
|
+
stageThenSwap(projectPath, serverDir, (staging) => extractServerEntries(entries, staging));
|
|
98
|
+
const executablePath = resolveExecutable(serverDir, platform);
|
|
99
|
+
if (executablePath === null) {
|
|
100
|
+
throw new Error(`Server zip extracted but no ${serverExecutableFileName(platform)} was found under ${serverDir} — the archive is not a valid server release.`);
|
|
101
|
+
}
|
|
102
|
+
makeExecutable(executablePath, platform);
|
|
103
|
+
emitProgress(opts.onProgress, {
|
|
104
|
+
phase: 'server-materialized',
|
|
105
|
+
message: `Downloaded + verified server to ${serverDir}`,
|
|
106
|
+
serverDir,
|
|
107
|
+
source: 'download',
|
|
108
|
+
});
|
|
109
|
+
return {
|
|
110
|
+
kind: 'success',
|
|
111
|
+
success: true,
|
|
112
|
+
source: 'download',
|
|
113
|
+
rid,
|
|
114
|
+
version,
|
|
115
|
+
serverDir,
|
|
116
|
+
executablePath,
|
|
117
|
+
downloadUrl: url,
|
|
118
|
+
warnings,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function installFromLocal(projectPath, serverDir, source, platform, warnings, onProgress) {
|
|
122
|
+
const resolved = path.resolve(source);
|
|
123
|
+
if (!fs.existsSync(resolved)) {
|
|
124
|
+
throw new Error(`--server-source ${resolved} does not exist.`);
|
|
125
|
+
}
|
|
126
|
+
emitProgress(onProgress, { phase: 'server-extracting', message: `Installing server from ${resolved}` });
|
|
127
|
+
const stat = fs.statSync(resolved);
|
|
128
|
+
if (stat.isFile() && resolved.toLowerCase().endsWith('.zip')) {
|
|
129
|
+
const entries = parseZip(fs.readFileSync(resolved));
|
|
130
|
+
stageThenSwap(projectPath, serverDir, (staging) => extractServerEntries(entries, staging));
|
|
131
|
+
}
|
|
132
|
+
else if (stat.isDirectory()) {
|
|
133
|
+
stageThenSwap(projectPath, serverDir, (staging) => {
|
|
134
|
+
fs.cpSync(resolved, staging, { recursive: true });
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
throw new Error(`--server-source ${resolved} must be a directory or a .zip archive.`);
|
|
139
|
+
}
|
|
140
|
+
const executablePath = resolveExecutable(serverDir, platform);
|
|
141
|
+
if (executablePath === null) {
|
|
142
|
+
throw new Error(`--server-source ${resolved} did not yield a ${serverExecutableFileName(platform)} under ${serverDir}.`);
|
|
143
|
+
}
|
|
144
|
+
makeExecutable(executablePath, platform);
|
|
145
|
+
emitProgress(onProgress, {
|
|
146
|
+
phase: 'server-materialized',
|
|
147
|
+
message: `Copied server from ${resolved}`,
|
|
148
|
+
serverDir,
|
|
149
|
+
source: 'local',
|
|
150
|
+
});
|
|
151
|
+
return {
|
|
152
|
+
kind: 'success',
|
|
153
|
+
success: true,
|
|
154
|
+
source: 'local',
|
|
155
|
+
rid: detectHostRid(),
|
|
156
|
+
version: '',
|
|
157
|
+
serverDir,
|
|
158
|
+
executablePath,
|
|
159
|
+
warnings,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Write every zip entry into `staging` (no `addons/` prefix stripping — the
|
|
164
|
+
* server zip expands to the binary + deps at the archive root). Path-safety:
|
|
165
|
+
* reject zip-slip `../` traversal escaping the staging dir.
|
|
166
|
+
*/
|
|
167
|
+
function extractServerEntries(entries, staging) {
|
|
168
|
+
for (const entry of entries) {
|
|
169
|
+
if (entry.path === '')
|
|
170
|
+
continue;
|
|
171
|
+
const target = path.resolve(staging, entry.path);
|
|
172
|
+
if (target !== staging && !target.startsWith(staging + path.sep)) {
|
|
173
|
+
throw new Error(`Refusing to extract entry escaping the server dir: ${entry.path}`);
|
|
174
|
+
}
|
|
175
|
+
if (entry.isDirectory) {
|
|
176
|
+
fs.mkdirSync(target, { recursive: true });
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
180
|
+
fs.writeFileSync(target, entry.bytes);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
/** Locate the server executable at the managed-dir root, else one level down. Null when absent. */
|
|
184
|
+
function resolveExecutable(serverDir, platform) {
|
|
185
|
+
const exeName = serverExecutableFileName(platform);
|
|
186
|
+
const atRoot = path.join(serverDir, exeName);
|
|
187
|
+
if (fs.existsSync(atRoot))
|
|
188
|
+
return atRoot;
|
|
189
|
+
// Self-contained builds sometimes nest under a single top dir; search one level.
|
|
190
|
+
let children;
|
|
191
|
+
try {
|
|
192
|
+
children = fs.readdirSync(serverDir);
|
|
193
|
+
}
|
|
194
|
+
catch {
|
|
195
|
+
return null;
|
|
196
|
+
}
|
|
197
|
+
for (const child of children) {
|
|
198
|
+
const candidate = path.join(serverDir, child, exeName);
|
|
199
|
+
if (fs.existsSync(candidate))
|
|
200
|
+
return candidate;
|
|
201
|
+
}
|
|
202
|
+
return null;
|
|
203
|
+
}
|
|
204
|
+
/** Mark the executable runnable on POSIX (no-op on Windows). Best-effort. */
|
|
205
|
+
function makeExecutable(executablePath, platform) {
|
|
206
|
+
if (platform === 'win32')
|
|
207
|
+
return;
|
|
208
|
+
try {
|
|
209
|
+
fs.chmodSync(executablePath, 0o755);
|
|
210
|
+
}
|
|
211
|
+
catch {
|
|
212
|
+
// Best-effort; never fail the install over a chmod.
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Fill a fresh staging sibling, then atomically swap it into `serverDir`. A mid-
|
|
217
|
+
* fill failure discards staging and leaves any existing managed server untouched.
|
|
218
|
+
*/
|
|
219
|
+
function stageThenSwap(projectPath, serverDir, fill) {
|
|
220
|
+
const serverReal = path.resolve(serverDir);
|
|
221
|
+
const staging = path.resolve(projectPath, `.gamedev-server-staging-${process.pid}-${Date.now()}`);
|
|
222
|
+
fs.rmSync(staging, { recursive: true, force: true });
|
|
223
|
+
fs.mkdirSync(staging, { recursive: true });
|
|
224
|
+
try {
|
|
225
|
+
fill(staging);
|
|
226
|
+
fs.rmSync(serverReal, { recursive: true, force: true });
|
|
227
|
+
fs.mkdirSync(path.dirname(serverReal), { recursive: true });
|
|
228
|
+
fs.renameSync(staging, serverReal);
|
|
229
|
+
}
|
|
230
|
+
finally {
|
|
231
|
+
fs.rmSync(staging, { recursive: true, force: true });
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
//# sourceMappingURL=install-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-server.js","sourceRoot":"","sources":["../../src/lib/install-server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,wBAAwB,EACxB,aAAa,EACb,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,SAAS,GACV,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAiB,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG7C,+GAA+G;AAC/G,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;AAE1E,uEAAuE;AACvE,MAAM,UAAU,mBAAmB,CAAC,WAAmB;IACrD,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,sBAAsB,CAAC,CAAC;AACxD,CAAC;AAED,4GAA4G;AAC5G,MAAM,UAAU,8BAA8B,CAC5C,WAAmB,EACnB,WAA4B,OAAO,CAAC,QAAQ;IAE5C,OAAO,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,EAAE,wBAAwB,CAAC,QAAQ,CAAC,CAAC,CAAC;AACzF,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,IAA0B;IAC5D,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IAElC,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC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tD,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,aAAa,CAAC,WAAmB,EAAE,SAAiB,EAAE,IAA+B;IAC5F,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC3C,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,2BAA2B,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAClG,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACrD,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3C,IAAI,CAAC;QACH,IAAI,CAAC,OAAO,CAAC,CAAC;QACd,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACxD,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5D,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACrC,CAAC;YAAS,CAAC;QACT,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC;AACH,CAAC"}
|
package/dist/lib/setup-mcp.d.ts
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
import { CLOUD_MCP_URL, DEFAULT_CUSTOM_HOST } from '../utils/connection.js';
|
|
2
2
|
import type { SetupMcpOptions, SetupMcpResult } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Decide whether `setup-mcp` writes a static `Authorization: Bearer` header for a
|
|
5
|
+
* given agent + credential (design decision D11 / auth Flow A & C, mirroring the
|
|
6
|
+
* shared b6 configurators' `SupportsOAuth` policy).
|
|
7
|
+
*
|
|
8
|
+
* OAuth-capable interactive clients (Claude Code, Cursor, Codex, Copilot, …)
|
|
9
|
+
* perform native RFC 9728 discovery + OAuth against the hosted endpoint (Flow A).
|
|
10
|
+
* A static Bearer header BOTH fails there (the hosted AS rejects the token with
|
|
11
|
+
* 401) AND suppresses the client's own OAuth handshake ("OAuth fallback is
|
|
12
|
+
* disabled when headers.Authorization is set"), so it must be omitted — the
|
|
13
|
+
* config stays URL-only `{type,url}`.
|
|
14
|
+
*
|
|
15
|
+
* A header is written ONLY for the Flow C fallback:
|
|
16
|
+
* - `supportsOAuth === false` — a client that cannot OAuth and needs a static
|
|
17
|
+
* token against a required-auth (typically self-hosted) endpoint; OR
|
|
18
|
+
* - an EXPLICIT PAT opt-in — the caller passed the token explicitly (`--token`
|
|
19
|
+
* / the library `token` arg), a deliberate Flow C request.
|
|
20
|
+
*
|
|
21
|
+
* A token that is only present ambiently (the `GODOT_MCP_TOKEN` env a prior
|
|
22
|
+
* `login` set) is NOT an opt-in: for an OAuth-capable client it is ignored so the
|
|
23
|
+
* native handshake runs. This is the flagship g1 fix — `login` + `setup-mcp
|
|
24
|
+
* claude-code .` must no longer emit a header.
|
|
25
|
+
*/
|
|
26
|
+
export declare function shouldWriteAuthHeader(input: {
|
|
27
|
+
hasToken: boolean;
|
|
28
|
+
explicitToken: boolean;
|
|
29
|
+
supportsOAuth: boolean;
|
|
30
|
+
}): boolean;
|
|
3
31
|
/**
|
|
4
32
|
* Write MCP configuration for the given AI agent so it can talk to a Godot-MCP
|
|
5
33
|
* server. Library-safe: no stdout noise, no process.exit, no throws past the
|
package/dist/lib/setup-mcp.js
CHANGED
|
@@ -33,6 +33,41 @@ function resolveMcpClientUrl(optUrl) {
|
|
|
33
33
|
return trimmed;
|
|
34
34
|
return trimmed + MCP_HUB_PATH;
|
|
35
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Decide whether `setup-mcp` writes a static `Authorization: Bearer` header for a
|
|
38
|
+
* given agent + credential (design decision D11 / auth Flow A & C, mirroring the
|
|
39
|
+
* shared b6 configurators' `SupportsOAuth` policy).
|
|
40
|
+
*
|
|
41
|
+
* OAuth-capable interactive clients (Claude Code, Cursor, Codex, Copilot, …)
|
|
42
|
+
* perform native RFC 9728 discovery + OAuth against the hosted endpoint (Flow A).
|
|
43
|
+
* A static Bearer header BOTH fails there (the hosted AS rejects the token with
|
|
44
|
+
* 401) AND suppresses the client's own OAuth handshake ("OAuth fallback is
|
|
45
|
+
* disabled when headers.Authorization is set"), so it must be omitted — the
|
|
46
|
+
* config stays URL-only `{type,url}`.
|
|
47
|
+
*
|
|
48
|
+
* A header is written ONLY for the Flow C fallback:
|
|
49
|
+
* - `supportsOAuth === false` — a client that cannot OAuth and needs a static
|
|
50
|
+
* token against a required-auth (typically self-hosted) endpoint; OR
|
|
51
|
+
* - an EXPLICIT PAT opt-in — the caller passed the token explicitly (`--token`
|
|
52
|
+
* / the library `token` arg), a deliberate Flow C request.
|
|
53
|
+
*
|
|
54
|
+
* A token that is only present ambiently (the `GODOT_MCP_TOKEN` env a prior
|
|
55
|
+
* `login` set) is NOT an opt-in: for an OAuth-capable client it is ignored so the
|
|
56
|
+
* native handshake runs. This is the flagship g1 fix — `login` + `setup-mcp
|
|
57
|
+
* claude-code .` must no longer emit a header.
|
|
58
|
+
*/
|
|
59
|
+
export function shouldWriteAuthHeader(input) {
|
|
60
|
+
if (!input.hasToken)
|
|
61
|
+
return false;
|
|
62
|
+
if (input.supportsOAuth === false)
|
|
63
|
+
return true;
|
|
64
|
+
return input.explicitToken;
|
|
65
|
+
}
|
|
66
|
+
/** True when `configPath` resolves inside `projectPath` (a project-scoped, likely VCS-tracked file). */
|
|
67
|
+
function isInsideProject(projectPath, configPath) {
|
|
68
|
+
const rel = path.relative(projectPath, configPath);
|
|
69
|
+
return rel.length > 0 && !rel.startsWith('..') && !path.isAbsolute(rel);
|
|
70
|
+
}
|
|
36
71
|
/**
|
|
37
72
|
* Write MCP configuration for the given AI agent so it can talk to a Godot-MCP
|
|
38
73
|
* server. Library-safe: no stdout noise, no process.exit, no throws past the
|
|
@@ -80,10 +115,35 @@ export async function setupMcp(opts) {
|
|
|
80
115
|
message: `Configuring ${agent.name} for ${projectPath}`,
|
|
81
116
|
});
|
|
82
117
|
const serverUrl = resolveMcpClientUrl(opts.url);
|
|
118
|
+
// A token supplied EXPLICITLY by the caller (`--token` / the library `token`
|
|
119
|
+
// arg) is a deliberate Flow C PAT opt-in; a token that is only present in the
|
|
120
|
+
// ambient `GODOT_MCP_TOKEN` env (e.g. one a prior `login` set) is NOT.
|
|
121
|
+
const explicitToken = typeof opts.token === 'string' && opts.token.length > 0;
|
|
83
122
|
const token = opts.token ?? normalizeEnv(process.env[ENV_TOKEN]) ?? '';
|
|
84
|
-
|
|
123
|
+
// OAuth-aware header gate (design D11 / auth Flow A & C): OAuth-capable clients
|
|
124
|
+
// get a credential-free, URL-only config so their native RFC 9728 OAuth runs;
|
|
125
|
+
// a static Authorization header is written only for a non-OAuth client or an
|
|
126
|
+
// explicit PAT opt-in. See `shouldWriteAuthHeader`.
|
|
127
|
+
const authRequired = shouldWriteAuthHeader({
|
|
128
|
+
hasToken: token.length > 0,
|
|
129
|
+
explicitToken,
|
|
130
|
+
supportsOAuth: agent.supportsOAuth,
|
|
131
|
+
});
|
|
85
132
|
const configPath = agent.getConfigPath(projectPath);
|
|
86
133
|
const props = agent.getHttpProps(serverUrl, token, authRequired);
|
|
134
|
+
// Flow C safety: a static PAT written into a project-scoped config file is a
|
|
135
|
+
// VCS leak risk — warn so the user prefers an env var / user-scoped config (or
|
|
136
|
+
// relies on native OAuth by omitting the token). Gate on whether a static
|
|
137
|
+
// header was ACTUALLY emitted into `props`, not merely on `authRequired`:
|
|
138
|
+
// agents whose `getHttpProps` ignore the token (e.g. Codex / Antigravity)
|
|
139
|
+
// write no `headers`, so an explicit `--token` there must NOT raise a "leaked
|
|
140
|
+
// credential" warning about a header that was never written to the file.
|
|
141
|
+
const wroteAuthHeader = Boolean(props.headers);
|
|
142
|
+
if (wroteAuthHeader && isInsideProject(projectPath, configPath)) {
|
|
143
|
+
warnings.push(`Wrote a static Authorization (PAT) header into the project-scoped config ${configPath}. ` +
|
|
144
|
+
`Committing this file would leak the credential — prefer setting ${ENV_TOKEN} in your ` +
|
|
145
|
+
`environment or a user-scoped config, or omit the token to use the client's native OAuth.`);
|
|
146
|
+
}
|
|
87
147
|
if (agent.configFormat === 'toml') {
|
|
88
148
|
writeTomlAgentConfig(configPath, agent.bodyPath, MCP_SERVER_NAME, props, agent.httpRemoveKeys);
|
|
89
149
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-mcp.js","sourceRoot":"","sources":["../../src/lib/setup-mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,QAAQ,EACR,SAAS,EACT,YAAY,GACb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGtD;;;GAGG;AACH,SAAS,YAAY,CAAC,GAAuB;IAC3C,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACxC,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IAC3B,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC3C,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,mBAA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CAAC"}
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -26,6 +26,28 @@ export type ProgressEvent = {
|
|
|
26
26
|
phase: 'csproj-patched';
|
|
27
27
|
message: string;
|
|
28
28
|
csprojPath: string;
|
|
29
|
+
} | {
|
|
30
|
+
phase: 'server-downloading';
|
|
31
|
+
message: string;
|
|
32
|
+
url: string;
|
|
33
|
+
} | {
|
|
34
|
+
phase: 'server-verifying';
|
|
35
|
+
message: string;
|
|
36
|
+
} | {
|
|
37
|
+
phase: 'server-extracting';
|
|
38
|
+
message: string;
|
|
39
|
+
} | {
|
|
40
|
+
phase: 'server-materialized';
|
|
41
|
+
message: string;
|
|
42
|
+
serverDir: string;
|
|
43
|
+
source: 'download' | 'local';
|
|
44
|
+
} | {
|
|
45
|
+
phase: 'enroll-redeeming';
|
|
46
|
+
message: string;
|
|
47
|
+
} | {
|
|
48
|
+
phase: 'enroll-redeemed';
|
|
49
|
+
message: string;
|
|
50
|
+
serverTarget: string;
|
|
29
51
|
} | {
|
|
30
52
|
phase: 'project-scaffolded';
|
|
31
53
|
message: string;
|
|
@@ -476,3 +498,119 @@ export interface InstallExtensionFailure {
|
|
|
476
498
|
error: Error;
|
|
477
499
|
}
|
|
478
500
|
export type InstallExtensionResult = InstallExtensionSuccess | InstallExtensionFailure;
|
|
501
|
+
export interface InstallServerOptions {
|
|
502
|
+
/** Absolute or relative path to the Godot project root (holds the managed server dir). */
|
|
503
|
+
godotProjectPath: string;
|
|
504
|
+
/**
|
|
505
|
+
* Local path to install the server from instead of downloading it (offline /
|
|
506
|
+
* dev / CI — the `--server-source` flag). May be a directory containing the
|
|
507
|
+
* server binary, or a `.zip` archive of one. When set, no network call is made
|
|
508
|
+
* and no checksum is verified (the local artifact is trusted).
|
|
509
|
+
*/
|
|
510
|
+
source?: string;
|
|
511
|
+
/**
|
|
512
|
+
* Shared-server version to download (`v<version>` release on GameDev-MCP-Server).
|
|
513
|
+
* Defaults to the addon's pinned `ServerVersion`. Ignored when `source` is set.
|
|
514
|
+
*/
|
|
515
|
+
version?: string;
|
|
516
|
+
/** Host RID override (`<os>-<arch>`). Defaults to the detected host RID. */
|
|
517
|
+
rid?: string;
|
|
518
|
+
/** Injectable fetch for tests (mock the GitHub download). Used only on the download path. */
|
|
519
|
+
fetchImpl?: typeof fetch;
|
|
520
|
+
onProgress?: ProgressCallback;
|
|
521
|
+
}
|
|
522
|
+
export interface InstallServerSuccess {
|
|
523
|
+
kind: 'success';
|
|
524
|
+
success: true;
|
|
525
|
+
/** Where the server binary came from. */
|
|
526
|
+
source: 'download' | 'local';
|
|
527
|
+
/** The host RID the binary was resolved for. */
|
|
528
|
+
rid: string;
|
|
529
|
+
/** The downloaded server version (empty on the local path). */
|
|
530
|
+
version: string;
|
|
531
|
+
/** Absolute path to the CLI-managed server directory the binary was extracted into. */
|
|
532
|
+
serverDir: string;
|
|
533
|
+
/** Absolute path to the resolved server executable. */
|
|
534
|
+
executablePath: string;
|
|
535
|
+
/** The download URL used (download path only). */
|
|
536
|
+
downloadUrl?: string;
|
|
537
|
+
warnings: string[];
|
|
538
|
+
}
|
|
539
|
+
export interface InstallServerFailure {
|
|
540
|
+
kind: 'failure';
|
|
541
|
+
success: false;
|
|
542
|
+
warnings: string[];
|
|
543
|
+
error: Error;
|
|
544
|
+
}
|
|
545
|
+
export type InstallServerResult = InstallServerSuccess | InstallServerFailure;
|
|
546
|
+
export interface EnrollPluginOptions {
|
|
547
|
+
/** Absolute or relative path to the Godot project root (holds the project marker). */
|
|
548
|
+
godotProjectPath: string;
|
|
549
|
+
/** The D13 enrollment code to redeem. */
|
|
550
|
+
code: string;
|
|
551
|
+
/** Cloud AS base URL to redeem against (default https://ai-game.dev). */
|
|
552
|
+
baseUrl?: string;
|
|
553
|
+
/** Override the machine credential store directory (tests only). */
|
|
554
|
+
storeBaseDir?: string;
|
|
555
|
+
/** Injectable fetch for the redeem round-trip (tests). */
|
|
556
|
+
fetchImpl?: typeof fetch;
|
|
557
|
+
onProgress?: ProgressCallback;
|
|
558
|
+
}
|
|
559
|
+
export interface EnrollPluginSuccess {
|
|
560
|
+
kind: 'success';
|
|
561
|
+
success: true;
|
|
562
|
+
/** The server target the enrollment code was minted for (recorded in the marker). */
|
|
563
|
+
serverTarget: string;
|
|
564
|
+
/** The D14 routing pin recorded in the marker. */
|
|
565
|
+
pin: string;
|
|
566
|
+
/** The deterministic local port recorded for a localhost target (undefined for a hosted target). */
|
|
567
|
+
port?: number;
|
|
568
|
+
/** Absolute path to the machine credential store the plugin credential was written to. */
|
|
569
|
+
credentialsPath: string;
|
|
570
|
+
/** Absolute path to the project marker written. */
|
|
571
|
+
markerPath: string;
|
|
572
|
+
/** Absolute paths of any existing project-local agent configs whose URL was pin-upserted. */
|
|
573
|
+
pinnedConfigs: string[];
|
|
574
|
+
warnings: string[];
|
|
575
|
+
}
|
|
576
|
+
export interface EnrollPluginFailure {
|
|
577
|
+
kind: 'failure';
|
|
578
|
+
success: false;
|
|
579
|
+
warnings: string[];
|
|
580
|
+
error: Error;
|
|
581
|
+
}
|
|
582
|
+
export type EnrollPluginResult = EnrollPluginSuccess | EnrollPluginFailure;
|
|
583
|
+
export interface ConfigureAgentOptions {
|
|
584
|
+
/** Absolute or relative path to the Godot project root (locates the managed server binary + is the config target). */
|
|
585
|
+
godotProjectPath: string;
|
|
586
|
+
/** The agent id to configure (forwarded verbatim to the server binary's `configure --agent`). */
|
|
587
|
+
agentId: string;
|
|
588
|
+
/** Explicit MCP server URL override (forwarded as `--url`). */
|
|
589
|
+
url?: string;
|
|
590
|
+
/** Injectable `child_process.spawn` for tests (mock the server binary). */
|
|
591
|
+
spawnImpl?: typeof import('child_process').spawn;
|
|
592
|
+
onProgress?: ProgressCallback;
|
|
593
|
+
}
|
|
594
|
+
export interface ConfigureAgentSuccess {
|
|
595
|
+
kind: 'success';
|
|
596
|
+
success: true;
|
|
597
|
+
agentId: string;
|
|
598
|
+
/** Absolute path to the managed server binary that was proxied to. */
|
|
599
|
+
serverBinaryPath: string;
|
|
600
|
+
/** The argv passed to the server binary (after the executable), for diagnostics. */
|
|
601
|
+
args: string[];
|
|
602
|
+
/** The server binary's exit code (0 on success). */
|
|
603
|
+
exitCode: number;
|
|
604
|
+
/** The server binary's captured stdout+stderr (surfaced to the user by the command). */
|
|
605
|
+
output: string;
|
|
606
|
+
warnings: string[];
|
|
607
|
+
}
|
|
608
|
+
export interface ConfigureAgentFailure {
|
|
609
|
+
kind: 'failure';
|
|
610
|
+
success: false;
|
|
611
|
+
/** The server binary's exit code when it ran and failed; undefined when it could not be launched. */
|
|
612
|
+
exitCode?: number;
|
|
613
|
+
warnings: string[];
|
|
614
|
+
error: Error;
|
|
615
|
+
}
|
|
616
|
+
export type ConfigureAgentResult = ConfigureAgentSuccess | ConfigureAgentFailure;
|
package/dist/lib.d.ts
CHANGED
|
@@ -6,6 +6,9 @@ export { setupMcp, listAgentIds } from './lib/setup-mcp.js';
|
|
|
6
6
|
export { setupSkills } from './lib/setup-skills.js';
|
|
7
7
|
export { installPlugin, removePlugin } from './lib/install-plugin.js';
|
|
8
8
|
export { installExtension } from './lib/install-extension.js';
|
|
9
|
+
export { installServer } from './lib/install-server.js';
|
|
10
|
+
export { enrollPlugin } from './lib/enroll.js';
|
|
11
|
+
export { configureAgentViaServer } from './lib/configure-agent.js';
|
|
9
12
|
export { EXTENSIONS_CATALOG, findExtension, hasVersion } from './utils/extensions-catalog.js';
|
|
10
13
|
export type { ExtensionDescriptor, ExtensionTool } from './utils/extensions-catalog.js';
|
|
11
|
-
export type { ProgressEvent, ProgressCallback, ResultKind, OpenProjectOptions, OpenProjectResult, OpenProjectSuccess, OpenProjectFailure, OpenProjectAuthOption, OpenProjectConnectionMode, BuildProjectOptions, BuildProjectResult, BuildProjectSuccess, BuildProjectFailure, BuildSkipReason, CreateProjectOptions, CreateProjectResult, CreateProjectSuccess, CreateProjectFailure, RunToolOptions, RunToolResult, RunToolSuccess, RunToolFailure, RunToolFailureReason, RunSystemToolOptions, RunSystemToolResult, RunSystemToolSuccess, RunSystemToolFailure, SetupMcpOptions, SetupMcpResult, SetupMcpSuccess, SetupMcpFailure, SetupSkillsOptions, SetupSkillsResult, SetupSkillsSuccess, SetupSkillsFailure, InstallPluginOptions, InstallPluginResult, InstallPluginSuccess, InstallPluginFailure, AddonMaterializeOutcome, CsprojPatchOutcome, RemovePluginOptions, RemovePluginResult, RemovePluginSuccess, RemovePluginFailure, InstallExtensionOptions, InstallExtensionResult, InstallExtensionSuccess, InstallExtensionFailure, ExtensionInstallOutcome, } from './lib/types.js';
|
|
14
|
+
export type { ProgressEvent, ProgressCallback, ResultKind, OpenProjectOptions, OpenProjectResult, OpenProjectSuccess, OpenProjectFailure, OpenProjectAuthOption, OpenProjectConnectionMode, BuildProjectOptions, BuildProjectResult, BuildProjectSuccess, BuildProjectFailure, BuildSkipReason, CreateProjectOptions, CreateProjectResult, CreateProjectSuccess, CreateProjectFailure, RunToolOptions, RunToolResult, RunToolSuccess, RunToolFailure, RunToolFailureReason, RunSystemToolOptions, RunSystemToolResult, RunSystemToolSuccess, RunSystemToolFailure, SetupMcpOptions, SetupMcpResult, SetupMcpSuccess, SetupMcpFailure, SetupSkillsOptions, SetupSkillsResult, SetupSkillsSuccess, SetupSkillsFailure, InstallPluginOptions, InstallPluginResult, InstallPluginSuccess, InstallPluginFailure, AddonMaterializeOutcome, CsprojPatchOutcome, RemovePluginOptions, RemovePluginResult, RemovePluginSuccess, RemovePluginFailure, InstallExtensionOptions, InstallExtensionResult, InstallExtensionSuccess, InstallExtensionFailure, ExtensionInstallOutcome, InstallServerOptions, InstallServerResult, InstallServerSuccess, InstallServerFailure, EnrollPluginOptions, EnrollPluginResult, EnrollPluginSuccess, EnrollPluginFailure, ConfigureAgentOptions, ConfigureAgentResult, ConfigureAgentSuccess, ConfigureAgentFailure, } from './lib/types.js';
|
package/dist/lib.js
CHANGED
|
@@ -20,6 +20,9 @@ export { setupMcp, listAgentIds } from './lib/setup-mcp.js';
|
|
|
20
20
|
export { setupSkills } from './lib/setup-skills.js';
|
|
21
21
|
export { installPlugin, removePlugin } from './lib/install-plugin.js';
|
|
22
22
|
export { installExtension } from './lib/install-extension.js';
|
|
23
|
+
export { installServer } from './lib/install-server.js';
|
|
24
|
+
export { enrollPlugin } from './lib/enroll.js';
|
|
25
|
+
export { configureAgentViaServer } from './lib/configure-agent.js';
|
|
23
26
|
// Shared extension catalog (single-sourced from addons/godot_mcp/extensions.catalog.json)
|
|
24
27
|
// + its lookup helpers, so the app can render the same list the dock + CLI install from.
|
|
25
28
|
export { EXTENSIONS_CATALOG, findExtension, hasVersion } from './utils/extensions-catalog.js';
|
package/dist/lib.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,EAAE;AACF,eAAe;AACf,+EAA+E;AAC/E,wDAAwD;AACxD,oDAAoD;AACpD,yEAAyE;AACzE,4DAA4D;AAC5D,+EAA+E;AAC/E,gEAAgE;AAChE,6EAA6E;AAC7E,EAAE;AACF,0EAA0E;AAC1E,4CAA4C;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,EAAE;AACF,eAAe;AACf,+EAA+E;AAC/E,wDAAwD;AACxD,oDAAoD;AACpD,yEAAyE;AACzE,4DAA4D;AAC5D,+EAA+E;AAC/E,gEAAgE;AAChE,6EAA6E;AAC7E,EAAE;AACF,0EAA0E;AAC1E,4CAA4C;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,0FAA0F;AAC1F,yFAAyF;AACzF,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC"}
|
package/dist/utils/addon-deps.js
CHANGED
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
* addon csproj (ReflectorNet first, then McpPlugin).
|
|
20
20
|
*/
|
|
21
21
|
export const ADDON_PACKAGE_REFERENCES = [
|
|
22
|
-
{ id: 'com.IvanMurzak.ReflectorNet', version: '5.3.
|
|
23
|
-
{ id: 'com.IvanMurzak.McpPlugin', version: '
|
|
22
|
+
{ id: 'com.IvanMurzak.ReflectorNet', version: '5.3.2' },
|
|
23
|
+
{ id: 'com.IvanMurzak.McpPlugin', version: '7.0.0' },
|
|
24
24
|
];
|
|
25
25
|
/**
|
|
26
26
|
* The exact `<EmbeddedResource>`s the consumer's project `.csproj` needs, single-sourced
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addon-deps.js","sourceRoot":"","sources":["../../src/utils/addon-deps.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,mFAAmF;AACnF,oEAAoE;AACpE,8EAA8E;AAC9E,yEAAyE;AACzE,EAAE;AACF,6EAA6E;AAC7E,kFAAkF;AAClF,8EAA8E;AAC9E,4EAA4E;AAC5E,iFAAiF;AACjF,iFAAiF;AACjF,+CAA+C;AAC/C,EAAE;AACF,sEAAsE;AAwBtE;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAqC;IACxE,EAAE,EAAE,EAAE,6BAA6B,EAAE,OAAO,EAAE,OAAO,EAAE;IACvD,EAAE,EAAE,EAAE,0BAA0B,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"addon-deps.js","sourceRoot":"","sources":["../../src/utils/addon-deps.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,mFAAmF;AACnF,oEAAoE;AACpE,8EAA8E;AAC9E,yEAAyE;AACzE,EAAE;AACF,6EAA6E;AAC7E,kFAAkF;AAClF,8EAA8E;AAC9E,4EAA4E;AAC5E,iFAAiF;AACjF,iFAAiF;AACjF,+CAA+C;AAC/C,EAAE;AACF,sEAAsE;AAwBtE;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAqC;IACxE,EAAE,EAAE,EAAE,6BAA6B,EAAE,OAAO,EAAE,OAAO,EAAE;IACvD,EAAE,EAAE,EAAE,0BAA0B,EAAE,OAAO,EAAE,OAAO,EAAE;CAC5C,CAAC;AAEX;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAqC;IACxE;QACE,OAAO,EAAE,0CAA0C;QACnD,WAAW,EAAE,mCAAmC;KACjD;CACO,CAAC;AAEX,wFAAwF;AACxF,MAAM,CAAC,MAAM,yBAAyB,GAAG,mCAAmC,CAAC"}
|
package/dist/utils/agents.d.ts
CHANGED
|
@@ -30,6 +30,18 @@ export interface AgentDefinition {
|
|
|
30
30
|
/** Config-file serialization format. `toml` is the Codex branch. */
|
|
31
31
|
configFormat: 'json' | 'toml';
|
|
32
32
|
bodyPath: string;
|
|
33
|
+
/**
|
|
34
|
+
* Whether this MCP client performs native RFC 9728 OAuth against the hosted
|
|
35
|
+
* endpoint (auth Flow A). Default policy is `true`, mirroring the shared b6
|
|
36
|
+
* configurators / decision D11: OAuth-capable clients get a credential-free,
|
|
37
|
+
* URL-only `{type,url}` config so their own OAuth handshake runs, and
|
|
38
|
+
* `setup-mcp` OMITS the static `Authorization` header for them — a static
|
|
39
|
+
* header both fails against the hosted AS (401) and suppresses the client's
|
|
40
|
+
* OAuth fallback ("OAuth fallback is disabled when headers.Authorization is
|
|
41
|
+
* set"). Set `false` only for a client that cannot OAuth and needs a static
|
|
42
|
+
* token against a required-auth (typically self-hosted) endpoint (Flow C).
|
|
43
|
+
*/
|
|
44
|
+
supportsOAuth: boolean;
|
|
33
45
|
/** Resolve the absolute config-file path for a given project root. */
|
|
34
46
|
getConfigPath(projectPath: string): string;
|
|
35
47
|
/** Build the HTTP server entry written under `bodyPath[MCP_SERVER_NAME]`. */
|