@extentos/mcp-server 0.1.7 → 0.2.0
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/generated/schemas.d.ts.map +1 -1
- package/dist/generated/schemas.js +4 -18
- package/dist/generated/schemas.js.map +1 -1
- package/dist/tools/data/connectionPageConfig.d.ts +7 -0
- package/dist/tools/data/connectionPageConfig.d.ts.map +1 -0
- package/dist/tools/data/connectionPageConfig.js +64 -0
- package/dist/tools/data/connectionPageConfig.js.map +1 -0
- package/dist/tools/definitions.d.ts.map +1 -1
- package/dist/tools/definitions.js +135 -2
- package/dist/tools/definitions.js.map +1 -1
- package/dist/tools/handlers/connectionPageConfig.d.ts +6 -0
- package/dist/tools/handlers/connectionPageConfig.d.ts.map +1 -0
- package/dist/tools/handlers/connectionPageConfig.js +385 -0
- package/dist/tools/handlers/connectionPageConfig.js.map +1 -0
- package/dist/tools/handlers/generateConnectionModule.d.ts +1 -1
- package/dist/tools/handlers/generateConnectionModule.d.ts.map +1 -1
- package/dist/tools/handlers/generateConnectionModule.js +143 -13
- package/dist/tools/handlers/generateConnectionModule.js.map +1 -1
- package/dist/tools/handlers/getCredentialGuide.js +5 -4
- package/dist/tools/handlers/getCredentialGuide.js.map +1 -1
- package/dist/tools/handlers/getDisplayState.d.ts +3 -0
- package/dist/tools/handlers/getDisplayState.d.ts.map +1 -0
- package/dist/tools/handlers/getDisplayState.js +78 -0
- package/dist/tools/handlers/getDisplayState.js.map +1 -0
- package/dist/tools/handlers/getEventLog.d.ts.map +1 -1
- package/dist/tools/handlers/getEventLog.js +1 -0
- package/dist/tools/handlers/getEventLog.js.map +1 -1
- package/dist/tools/handlers/injectInput.d.ts +3 -0
- package/dist/tools/handlers/injectInput.d.ts.map +1 -0
- package/dist/tools/handlers/injectInput.js +88 -0
- package/dist/tools/handlers/injectInput.js.map +1 -0
- package/dist/tools/handlers/inspectIntegration.d.ts.map +1 -1
- package/dist/tools/handlers/inspectIntegration.js +2 -2
- package/dist/tools/handlers/inspectIntegration.js.map +1 -1
- package/dist/tools/handlers/validateIntegration.d.ts.map +1 -1
- package/dist/tools/handlers/validateIntegration.js +3 -3
- package/dist/tools/handlers/validateIntegration.js.map +1 -1
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/registry.js +9 -0
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/util/backendClient.d.ts +1 -0
- package/dist/tools/util/backendClient.d.ts.map +1 -1
- package/dist/tools/util/backendClient.js +3 -0
- package/dist/tools/util/backendClient.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
// MCP sync-bridge handlers for the managed connection-page config — P1d of
|
|
2
|
+
// shared-context/connection-page-managed-config-plan.md. This is the surface
|
|
3
|
+
// that makes "the agent edits the dashboard-managed connection page" real:
|
|
4
|
+
//
|
|
5
|
+
// getConnectionPageConfig — read the dashboard/server config for an app.
|
|
6
|
+
// setConnectionPageConfig — persist it (makes the app MANAGED), authed by the
|
|
7
|
+
// account-link Bearer in ~/.extentos/auth.json.
|
|
8
|
+
//
|
|
9
|
+
// The committed extentos.connection-page.json file-sync ops (regenerate ←
|
|
10
|
+
// server / adopt → server) build on these in part 2.
|
|
11
|
+
//
|
|
12
|
+
// Source-of-truth model (plan §2): when a server config exists the app is
|
|
13
|
+
// MANAGED — the dashboard/server is the single authority and the SDK applies
|
|
14
|
+
// server.overlay(defaults) at render time; the committed JSON is its generated
|
|
15
|
+
// offline mirror. When absent the app is UNMANAGED (committed file → code
|
|
16
|
+
// ExtentosTheme → defaults). Writing here flips an app to MANAGED.
|
|
17
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
18
|
+
import { join } from "node:path";
|
|
19
|
+
import { backendFetch } from "../util/backendClient.js";
|
|
20
|
+
import { findUnknownConnectionPageKeys } from "../data/connectionPageConfig.js";
|
|
21
|
+
import { hashGeneratedContent } from "../util/generatedHash.js";
|
|
22
|
+
import { okResponse, errorResponse } from "../response.js";
|
|
23
|
+
function parseAppPackage(raw) {
|
|
24
|
+
if (!raw || typeof raw !== "object") {
|
|
25
|
+
return {
|
|
26
|
+
error: errorResponse({
|
|
27
|
+
code: "invalid_arguments",
|
|
28
|
+
message: "Requires an object argument with `appPackage`.",
|
|
29
|
+
fixHint: "Pass { appPackage: \"com.example.myapp\" }.",
|
|
30
|
+
retryable: false,
|
|
31
|
+
}),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
const v = raw.appPackage;
|
|
35
|
+
if (typeof v !== "string" || v.trim().length === 0) {
|
|
36
|
+
return {
|
|
37
|
+
error: errorResponse({
|
|
38
|
+
code: "invalid_arguments",
|
|
39
|
+
message: "`appPackage` is required and must be a non-empty string (the app's package / bundle id).",
|
|
40
|
+
fixHint: "Pass the developer's package/bundle id, e.g. com.example.myapp.",
|
|
41
|
+
retryable: false,
|
|
42
|
+
}),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return { value: v.trim() };
|
|
46
|
+
}
|
|
47
|
+
export async function handleGetConnectionPageConfig(raw) {
|
|
48
|
+
const pkg = parseAppPackage(raw);
|
|
49
|
+
if ("error" in pkg)
|
|
50
|
+
return pkg.error;
|
|
51
|
+
// Reuse the package-keyed SDK read (most-recent row for this package — the
|
|
52
|
+
// same value the device sees). The dev's own write is that row.
|
|
53
|
+
const res = await backendFetch("/api/connection-config", {
|
|
54
|
+
headers: { "x-extentos-app-id": pkg.value },
|
|
55
|
+
});
|
|
56
|
+
if (!res.ok) {
|
|
57
|
+
return errorResponse({
|
|
58
|
+
code: "backend_error",
|
|
59
|
+
message: `Failed to read connection-page config for ${pkg.value} (HTTP ${res.status}).${res.errorText ? ` ${res.errorText}` : ""}`,
|
|
60
|
+
fixHint: "Check the MCP can reach api.extentos.com and that GET /api/connection-config is deployed. Retry if the failure looks transient.",
|
|
61
|
+
retryable: res.status === 0 || res.status >= 500,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
const config = res.data?.config ?? null;
|
|
65
|
+
return okResponse({
|
|
66
|
+
managed: config !== null,
|
|
67
|
+
projectInstallId: pkg.value,
|
|
68
|
+
config,
|
|
69
|
+
summary: config
|
|
70
|
+
? `${pkg.value} is MANAGED — the dashboard/server config drives the connection page (schemaVersion ${config.schemaVersion ?? 1}); the SDK applies server.overlay(defaults) at render time. Run regenerateConnectionPageFile to mirror it into the committed extentos.connection-page.json.`
|
|
71
|
+
: `${pkg.value} is UNMANAGED — no server config row. The connection page uses the committed extentos.connection-page.json → code ExtentosTheme → built-in defaults. Use setConnectionPageConfig (or the web dashboard's Connection section) to manage it.`,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
export async function handleSetConnectionPageConfig(raw) {
|
|
75
|
+
const pkg = parseAppPackage(raw);
|
|
76
|
+
if ("error" in pkg)
|
|
77
|
+
return pkg.error;
|
|
78
|
+
const obj = raw;
|
|
79
|
+
const configRaw = obj.config;
|
|
80
|
+
if (!configRaw || typeof configRaw !== "object" || Array.isArray(configRaw)) {
|
|
81
|
+
return errorResponse({
|
|
82
|
+
code: "invalid_arguments",
|
|
83
|
+
message: "`config` is required and must be an object { schemaVersion?, sections?, appearance? }.",
|
|
84
|
+
fixHint: "e.g. { appPackage: \"com.example.myapp\", config: { appearance: { colors: { accent: \"#3b82f6\" } }, sections: { toggles: false } } }.",
|
|
85
|
+
retryable: false,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
const cfg = configRaw;
|
|
89
|
+
// Schema validation: keys the embedded connection-page schema doesn't define
|
|
90
|
+
// are surfaced as a WARNING, not a hard error — additive-only contract, a
|
|
91
|
+
// newer dashboard may add keys this validator predates. Catches the classic
|
|
92
|
+
// typo class (sections.triggers → sections.voiceCommands).
|
|
93
|
+
const unknownKeys = findUnknownConnectionPageKeys(cfg);
|
|
94
|
+
const schemaVersion = typeof cfg.schemaVersion === "number" ? cfg.schemaVersion : 1;
|
|
95
|
+
const sections = cfg.sections === undefined ? null : cfg.sections;
|
|
96
|
+
const appearance = cfg.appearance === undefined ? null : cfg.appearance;
|
|
97
|
+
const isObjectOrNull = (v) => v === null || (typeof v === "object" && !Array.isArray(v));
|
|
98
|
+
if (!isObjectOrNull(sections)) {
|
|
99
|
+
return errorResponse({
|
|
100
|
+
code: "invalid_arguments",
|
|
101
|
+
message: "`config.sections` must be an object (e.g. { capabilities, toggles, voiceCommands }) when present.",
|
|
102
|
+
fixHint: "Pass config.sections as a boolean map, e.g. { capabilities: true, toggles: false, voiceCommands: true }.",
|
|
103
|
+
retryable: false,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
if (!isObjectOrNull(appearance)) {
|
|
107
|
+
return errorResponse({
|
|
108
|
+
code: "invalid_arguments",
|
|
109
|
+
message: "`config.appearance` must be an object (e.g. { colors, typography, shapes }) when present.",
|
|
110
|
+
fixHint: "Pass config.appearance as a token map, e.g. { colors: { accent: \"#3b82f6\" } }.",
|
|
111
|
+
retryable: false,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
const res = await backendFetch("/api/connection-config", {
|
|
115
|
+
method: "POST",
|
|
116
|
+
body: { projectInstallId: pkg.value, schemaVersion, sections, appearance },
|
|
117
|
+
});
|
|
118
|
+
if (res.status === 401) {
|
|
119
|
+
return errorResponse({
|
|
120
|
+
code: "account_required",
|
|
121
|
+
message: "Writing connection-page config needs a linked Extentos account. Run `extentos-mcp login` (or `npx -p @extentos/mcp-server extentos-mcp login`) and approve in the browser, then retry.",
|
|
122
|
+
fixHint: "Run `extentos-mcp login`, approve in the browser, then call setConnectionPageConfig again.",
|
|
123
|
+
retryable: false,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
if (!res.ok) {
|
|
127
|
+
return errorResponse({
|
|
128
|
+
code: "backend_error",
|
|
129
|
+
message: `Failed to write connection-page config for ${pkg.value} (HTTP ${res.status}).${res.errorText ? ` ${res.errorText}` : ""}`,
|
|
130
|
+
fixHint: "Check the MCP can reach api.extentos.com and that POST /api/connection-config is deployed. Retry if the failure looks transient.",
|
|
131
|
+
retryable: res.status === 0 || res.status >= 500,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
return okResponse({
|
|
135
|
+
status: "ok",
|
|
136
|
+
projectInstallId: pkg.value,
|
|
137
|
+
config: { schemaVersion, sections, appearance },
|
|
138
|
+
...(unknownKeys.length
|
|
139
|
+
? {
|
|
140
|
+
unknownKeys,
|
|
141
|
+
warning: `Persisted, but these keys aren't defined by the connection-page schema and the SDK will ignore them: ${unknownKeys.join(", ")}. Check for typos (e.g. sections.triggers → sections.voiceCommands).`,
|
|
142
|
+
}
|
|
143
|
+
: {}),
|
|
144
|
+
summary: `Saved connection-page config for ${pkg.value} — it is now MANAGED (the dashboard/server drives the connection page; the SDK fetches it at render time). Run regenerateConnectionPageFile to mirror it into the committed extentos.connection-page.json so the repo reflects the dashboard and works offline.`,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
// ── part 2: committed-file sync (the generated mirror) ───────────────────────
|
|
148
|
+
//
|
|
149
|
+
// The committed extentos.connection-page.json is a GENERATED MIRROR of the
|
|
150
|
+
// server config (lockfile-style), not a hand-authored peer — so the repo
|
|
151
|
+
// reflects the dashboard and the app themes correctly offline. Two explicit
|
|
152
|
+
// one-way ops, never an auto-merge (plan §2):
|
|
153
|
+
// regenerateConnectionPageFile — file ← server (routine; "the dashboard
|
|
154
|
+
// changes the code tokens" made real).
|
|
155
|
+
// adoptConnectionPageFile — file → server (deliberate one-time seed;
|
|
156
|
+
// content-hash drift-detected, asks before
|
|
157
|
+
// clobbering the server with local edits).
|
|
158
|
+
// Android-only for now. iOS file-sync is Phase 4 (the iOS bundle asset location
|
|
159
|
+
// isn't finalized); the SDK *fetch* path is already platform-neutral, so iOS
|
|
160
|
+
// can be managed via the dashboard / setConnectionPageConfig meanwhile.
|
|
161
|
+
const ANDROID_ASSET_PATH = "app/src/main/assets/extentos.connection-page.json";
|
|
162
|
+
const GENERATED_MARKER = "GENERATED MIRROR of the Extentos dashboard connection-page config — do not hand-edit. " +
|
|
163
|
+
"Edit in the dashboard (or via setConnectionPageConfig), then run regenerateConnectionPageFile. " +
|
|
164
|
+
"Hand edits are overwritten on the next regenerate; to push local edits up instead, run adoptConnectionPageFile.";
|
|
165
|
+
function parsePlatform(obj) {
|
|
166
|
+
return obj.platform === "ios" ? "ios" : "android";
|
|
167
|
+
}
|
|
168
|
+
function resolveAssetPath(platform) {
|
|
169
|
+
if (platform === "android")
|
|
170
|
+
return { path: ANDROID_ASSET_PATH };
|
|
171
|
+
return {
|
|
172
|
+
error: errorResponse({
|
|
173
|
+
code: "not_supported",
|
|
174
|
+
message: "iOS connection-page file-sync lands in Phase 4 — the iOS bundle asset location isn't finalized. The SDK fetch path is platform-neutral and already works, so manage iOS via the web dashboard or setConnectionPageConfig for now.",
|
|
175
|
+
fixHint: "Pass platform: \"android\", or manage the iOS config via the dashboard / setConnectionPageConfig.",
|
|
176
|
+
retryable: false,
|
|
177
|
+
}),
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
// Stable, marker-free canonical form so two configs compare by SEMANTICS (what
|
|
181
|
+
// the SDK reads) — not formatting or the _comment marker.
|
|
182
|
+
function stableStringify(v) {
|
|
183
|
+
if (v === null || typeof v !== "object")
|
|
184
|
+
return JSON.stringify(v) ?? "null";
|
|
185
|
+
if (Array.isArray(v))
|
|
186
|
+
return `[${v.map(stableStringify).join(",")}]`;
|
|
187
|
+
const o = v;
|
|
188
|
+
const keys = Object.keys(o)
|
|
189
|
+
.filter((k) => !k.startsWith("_"))
|
|
190
|
+
.sort();
|
|
191
|
+
return `{${keys.map((k) => `${JSON.stringify(k)}:${stableStringify(o[k])}`).join(",")}}`;
|
|
192
|
+
}
|
|
193
|
+
function canonicalConfig(cfg) {
|
|
194
|
+
return stableStringify({
|
|
195
|
+
schemaVersion: typeof cfg.schemaVersion === "number" ? cfg.schemaVersion : 1,
|
|
196
|
+
sections: cfg.sections ?? null,
|
|
197
|
+
appearance: cfg.appearance ?? null,
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
function buildMirrorFile(cfg) {
|
|
201
|
+
const obj = { _comment: GENERATED_MARKER, schemaVersion: cfg.schemaVersion };
|
|
202
|
+
if (cfg.sections != null)
|
|
203
|
+
obj.sections = cfg.sections;
|
|
204
|
+
if (cfg.appearance != null)
|
|
205
|
+
obj.appearance = cfg.appearance;
|
|
206
|
+
return `${JSON.stringify(obj, null, 2)}\n`;
|
|
207
|
+
}
|
|
208
|
+
function safeParseJsonObject(text) {
|
|
209
|
+
try {
|
|
210
|
+
const v = JSON.parse(text);
|
|
211
|
+
return v && typeof v === "object" && !Array.isArray(v) ? v : null;
|
|
212
|
+
}
|
|
213
|
+
catch {
|
|
214
|
+
return null;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
// Read the server config (package-keyed), normalizing the failure into an
|
|
218
|
+
// McpContent error the caller can return directly.
|
|
219
|
+
async function readServerConfig(appPackage) {
|
|
220
|
+
const res = await backendFetch("/api/connection-config", {
|
|
221
|
+
headers: { "x-extentos-app-id": appPackage },
|
|
222
|
+
});
|
|
223
|
+
if (!res.ok) {
|
|
224
|
+
return {
|
|
225
|
+
error: errorResponse({
|
|
226
|
+
code: "backend_error",
|
|
227
|
+
message: `Failed to read connection-page config for ${appPackage} (HTTP ${res.status}).${res.errorText ? ` ${res.errorText}` : ""}`,
|
|
228
|
+
fixHint: "Check the MCP can reach api.extentos.com and that GET /api/connection-config is deployed.",
|
|
229
|
+
retryable: res.status === 0 || res.status >= 500,
|
|
230
|
+
}),
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
return { config: res.data?.config ?? null };
|
|
234
|
+
}
|
|
235
|
+
export async function handleRegenerateConnectionPageFile(raw) {
|
|
236
|
+
const pkg = parseAppPackage(raw);
|
|
237
|
+
if ("error" in pkg)
|
|
238
|
+
return pkg.error;
|
|
239
|
+
const obj = raw;
|
|
240
|
+
const pathRes = resolveAssetPath(parsePlatform(obj));
|
|
241
|
+
if ("error" in pathRes)
|
|
242
|
+
return pathRes.error;
|
|
243
|
+
const projectPath = typeof obj.projectPath === "string" && obj.projectPath.length > 0 ? obj.projectPath : undefined;
|
|
244
|
+
const server = await readServerConfig(pkg.value);
|
|
245
|
+
if ("error" in server)
|
|
246
|
+
return server.error;
|
|
247
|
+
if (!server.config) {
|
|
248
|
+
return okResponse({
|
|
249
|
+
status: "unmanaged",
|
|
250
|
+
projectInstallId: pkg.value,
|
|
251
|
+
summary: `${pkg.value} is UNMANAGED — there is no server config to mirror, so there is nothing to regenerate. The committed extentos.connection-page.json (if any) is itself the source of truth here. Make it managed first (setConnectionPageConfig / dashboard), or adoptConnectionPageFile to seed the current committed file up to the server.`,
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
const schemaVersion = typeof server.config.schemaVersion === "number" ? server.config.schemaVersion : 1;
|
|
255
|
+
const sections = server.config.sections ?? null;
|
|
256
|
+
const appearance = server.config.appearance ?? null;
|
|
257
|
+
const content = buildMirrorFile({ schemaVersion, sections, appearance });
|
|
258
|
+
// Drift note (informational — server is authoritative, so regenerate
|
|
259
|
+
// overwrites): if a committed file exists and differs semantically, the dev's
|
|
260
|
+
// local edits will be replaced; point them at adopt if they meant to keep them.
|
|
261
|
+
let drift;
|
|
262
|
+
if (projectPath) {
|
|
263
|
+
const abs = join(projectPath, pathRes.path);
|
|
264
|
+
if (existsSync(abs)) {
|
|
265
|
+
const parsed = safeParseJsonObject(readFileSync(abs, "utf8"));
|
|
266
|
+
if (parsed && canonicalConfig(parsed) !== canonicalConfig(server.config)) {
|
|
267
|
+
drift = {
|
|
268
|
+
existingDiffersFromServer: true,
|
|
269
|
+
existingHash: hashGeneratedContent(canonicalConfig(parsed)),
|
|
270
|
+
serverHash: hashGeneratedContent(canonicalConfig(server.config)),
|
|
271
|
+
note: "The committed file differs from the server; regenerating overwrites it with the dashboard's version. If you meant to KEEP the local edits, run adoptConnectionPageFile (file → server) instead.",
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return okResponse({
|
|
277
|
+
status: "ok",
|
|
278
|
+
projectInstallId: pkg.value,
|
|
279
|
+
file: { path: pathRes.path, action: "create", content },
|
|
280
|
+
...(drift ? { drift } : {}),
|
|
281
|
+
summary: `Generated the connection-page mirror for ${pkg.value}. Write it to ${pathRes.path} (it carries a generated marker — edits belong in the dashboard).${drift ? " NOTE: this overwrites a locally-different committed file — see drift." : ""}`,
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
export async function handleAdoptConnectionPageFile(raw) {
|
|
285
|
+
const pkg = parseAppPackage(raw);
|
|
286
|
+
if ("error" in pkg)
|
|
287
|
+
return pkg.error;
|
|
288
|
+
const obj = raw;
|
|
289
|
+
const pathRes = resolveAssetPath(parsePlatform(obj));
|
|
290
|
+
if ("error" in pathRes)
|
|
291
|
+
return pathRes.error;
|
|
292
|
+
const projectPath = typeof obj.projectPath === "string" && obj.projectPath.length > 0 ? obj.projectPath : undefined;
|
|
293
|
+
if (!projectPath) {
|
|
294
|
+
return errorResponse({
|
|
295
|
+
code: "invalid_arguments",
|
|
296
|
+
message: "`projectPath` (absolute path to the project root) is required to read the committed extentos.connection-page.json.",
|
|
297
|
+
fixHint: "Pass projectPath — the directory containing app/src/main/assets/extentos.connection-page.json.",
|
|
298
|
+
retryable: false,
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
const confirm = obj.confirm === true;
|
|
302
|
+
const abs = join(projectPath, pathRes.path);
|
|
303
|
+
if (!existsSync(abs)) {
|
|
304
|
+
return errorResponse({
|
|
305
|
+
code: "file_not_found",
|
|
306
|
+
message: `No committed config at ${pathRes.path} — nothing to adopt.`,
|
|
307
|
+
fixHint: "Create that file first, or author the config directly with setConnectionPageConfig.",
|
|
308
|
+
retryable: false,
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
const parsed = safeParseJsonObject(readFileSync(abs, "utf8"));
|
|
312
|
+
if (!parsed) {
|
|
313
|
+
return errorResponse({
|
|
314
|
+
code: "invalid_file",
|
|
315
|
+
message: `${pathRes.path} is not a valid JSON object.`,
|
|
316
|
+
fixHint: "Fix the JSON, or regenerate it from the server with regenerateConnectionPageFile.",
|
|
317
|
+
retryable: false,
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
const unknownKeys = findUnknownConnectionPageKeys(parsed);
|
|
321
|
+
const schemaVersion = typeof parsed.schemaVersion === "number" ? parsed.schemaVersion : 1;
|
|
322
|
+
const sections = parsed.sections ?? null;
|
|
323
|
+
const appearance = parsed.appearance ?? null;
|
|
324
|
+
const server = await readServerConfig(pkg.value);
|
|
325
|
+
if ("error" in server)
|
|
326
|
+
return server.error;
|
|
327
|
+
// Drift gate: only relevant when a managed server config ALREADY exists.
|
|
328
|
+
// Equal → no-op. Differs + not confirmed → ask (never silently clobber).
|
|
329
|
+
if (server.config) {
|
|
330
|
+
const fileCanon = canonicalConfig(parsed);
|
|
331
|
+
const serverCanon = canonicalConfig(server.config);
|
|
332
|
+
if (fileCanon === serverCanon) {
|
|
333
|
+
return okResponse({
|
|
334
|
+
status: "in_sync",
|
|
335
|
+
projectInstallId: pkg.value,
|
|
336
|
+
summary: `${pathRes.path} already matches the server config for ${pkg.value} — nothing to adopt.`,
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
if (!confirm) {
|
|
340
|
+
return okResponse({
|
|
341
|
+
status: "needs_confirmation",
|
|
342
|
+
projectInstallId: pkg.value,
|
|
343
|
+
drift: {
|
|
344
|
+
fileHash: hashGeneratedContent(fileCanon),
|
|
345
|
+
serverHash: hashGeneratedContent(serverCanon),
|
|
346
|
+
fileConfig: { schemaVersion, sections, appearance },
|
|
347
|
+
serverConfig: server.config,
|
|
348
|
+
},
|
|
349
|
+
instruction: `${pkg.value} already has a MANAGED server config that DIFFERS from the committed ${pathRes.path}. Adopting OVERWRITES the dashboard's current config with the committed file. Show the developer both versions (drift.fileConfig vs drift.serverConfig); only if they confirm the FILE should win, re-call adoptConnectionPageFile with confirm: true. If instead the SERVER should win, run regenerateConnectionPageFile to bring the file back in line.`,
|
|
350
|
+
summary: "Drift detected — refusing to clobber the server silently. Re-call with confirm: true to push the file up, or regenerateConnectionPageFile to pull the server down.",
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
// No server config (clean seed) OR confirmed overwrite → write file → server.
|
|
355
|
+
const res = await backendFetch("/api/connection-config", {
|
|
356
|
+
method: "POST",
|
|
357
|
+
body: { projectInstallId: pkg.value, schemaVersion, sections, appearance },
|
|
358
|
+
});
|
|
359
|
+
if (res.status === 401) {
|
|
360
|
+
return errorResponse({
|
|
361
|
+
code: "account_required",
|
|
362
|
+
message: "Adopting the file to the server needs a linked Extentos account. Run `extentos-mcp login` and approve in the browser, then retry.",
|
|
363
|
+
fixHint: "Run `extentos-mcp login`, approve in the browser, then call adoptConnectionPageFile again.",
|
|
364
|
+
retryable: false,
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
if (!res.ok) {
|
|
368
|
+
return errorResponse({
|
|
369
|
+
code: "backend_error",
|
|
370
|
+
message: `Failed to adopt ${pathRes.path} to the server for ${pkg.value} (HTTP ${res.status}).${res.errorText ? ` ${res.errorText}` : ""}`,
|
|
371
|
+
fixHint: "Check the MCP can reach api.extentos.com and that POST /api/connection-config is deployed.",
|
|
372
|
+
retryable: res.status === 0 || res.status >= 500,
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
return okResponse({
|
|
376
|
+
status: "ok",
|
|
377
|
+
projectInstallId: pkg.value,
|
|
378
|
+
config: { schemaVersion, sections, appearance },
|
|
379
|
+
...(unknownKeys.length
|
|
380
|
+
? { unknownKeys, warning: `Adopted, but these keys aren't in the schema and the SDK ignores them: ${unknownKeys.join(", ")}.` }
|
|
381
|
+
: {}),
|
|
382
|
+
summary: `Adopted ${pathRes.path} to the server for ${pkg.value} — it is now the MANAGED source of truth. Going forward, edit via the dashboard / setConnectionPageConfig and run regenerateConnectionPageFile to keep the committed file mirrored.`,
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
//# sourceMappingURL=connectionPageConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connectionPageConfig.js","sourceRoot":"","sources":["../../../src/tools/handlers/connectionPageConfig.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,6EAA6E;AAC7E,2EAA2E;AAC3E,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;AAChF,4EAA4E;AAC5E,EAAE;AACF,0EAA0E;AAC1E,qDAAqD;AACrD,EAAE;AACF,0EAA0E;AAC1E,6EAA6E;AAC7E,+EAA+E;AAC/E,0EAA0E;AAC1E,mEAAmE;AAEnE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAmB,MAAM,gBAAgB,CAAC;AAY5E,SAAS,eAAe,CAAC,GAAY;IACnC,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QACpC,OAAO;YACL,KAAK,EAAE,aAAa,CAAC;gBACnB,IAAI,EAAE,mBAAmB;gBACzB,OAAO,EAAE,gDAAgD;gBACzD,OAAO,EAAE,6CAA6C;gBACtD,SAAS,EAAE,KAAK;aACjB,CAAC;SACH,CAAC;IACJ,CAAC;IACD,MAAM,CAAC,GAAI,GAA+B,CAAC,UAAU,CAAC;IACtD,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnD,OAAO;YACL,KAAK,EAAE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AAI,GAAG;SACjD,CAAC,CAAC;IACL,CAAC;IAED,OAAO,UAAU,CAAC;QAChB,MAAM,EAAE,IAAI;QACZ,gBAAgB,EAAE,GAAG,CAAC,KAAK;QAC3B,MAAM,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE;QAC/C,GAAG,CAAC,WAAW,CAAC,MAAM;YACpB,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,0EAA0E,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;YAC/H,CAAC,CAAC,EAAE,CAAC;QACP,OAAO,EAAE,WAAW,OAAO,CAAC,IAAI,sBAAsB,GAAG,CAAC,KAAK,qLAAqL;KACrP,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type McpContent } from "../response.js";
|
|
2
|
-
export declare function handleGenerateConnectionModule(raw: unknown): McpContent
|
|
2
|
+
export declare function handleGenerateConnectionModule(raw: unknown): Promise<McpContent>;
|
|
3
3
|
//# sourceMappingURL=generateConnectionModule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateConnectionModule.d.ts","sourceRoot":"","sources":["../../../src/tools/handlers/generateConnectionModule.ts"],"names":[],"mappings":"AAcA,OAAO,EAA6B,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"generateConnectionModule.d.ts","sourceRoot":"","sources":["../../../src/tools/handlers/generateConnectionModule.ts"],"names":[],"mappings":"AAcA,OAAO,EAA6B,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AA+T5E,wBAAsB,8BAA8B,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CA2CtF"}
|