@ateam-ai/mcp 0.4.37 → 0.4.38
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/package.json +1 -1
- package/src/tools.js +34 -4
package/package.json
CHANGED
package/src/tools.js
CHANGED
|
@@ -1026,6 +1026,7 @@ export const tools = [
|
|
|
1026
1026
|
" • github:true + files:[] — GitHub state at `ref` as BASE, your files overlay on top (incoming wins).\n" +
|
|
1027
1027
|
" • files:[] (no github) — default MERGE with GitHub state at `ref`. Refuses if no GitHub base exists (no silent nuke).\n" +
|
|
1028
1028
|
" • files:[] + replace:true — full replace. Wipes connector dir + writes only the provided files. Use deliberately.\n\n" +
|
|
1029
|
+
"Multi-file connectors (server.js + dashboard HTML + RN bundle + package/manifest): pass each file with content_base64 (a single-line, escape-safe base64 string) instead of content — so you don't hand-escape ~90KB of HTML/JS/JSON inside one tool call. This is the CANONICAL agent path for a full connector; do NOT hand-roll `curl` against the raw endpoint (that skips connector registration / PAT provisioning).\n\n" +
|
|
1029
1030
|
"Common traps this design prevents:\n" +
|
|
1030
1031
|
" • Pre-fix bug (2026-06-06): sending just ui-dist HTML wiped server.js + node_modules — connector broke until a full re-upload. Now: those files merge with the GitHub base.\n" +
|
|
1031
1032
|
" • Pre-fix bug: github:true silently read from `main` even when patches were on `dev`. Now: defaults to dev; pass ref:'main' to opt into the legacy path.",
|
|
@@ -1054,11 +1055,12 @@ export const tools = [
|
|
|
1054
1055
|
type: "object",
|
|
1055
1056
|
properties: {
|
|
1056
1057
|
path: { type: "string", description: "Relative file path (e.g. 'server.js', 'ui-dist/panel/index.html')" },
|
|
1057
|
-
content: { type: "string", description: "File content" },
|
|
1058
|
+
content: { type: "string", description: "File content as an inline string. Prefer content_base64 when the content has complex escaping (HTML/JS/JSON)." },
|
|
1059
|
+
content_base64: { type: "string", description: "File content as a single-line base64 string — escape-safe. PREFERRED for a multi-file connector so large HTML/JS/bundles don't need hand-escaping in the tool call. Provide exactly ONE of content / content_base64 per file." },
|
|
1058
1060
|
},
|
|
1059
|
-
required: ["path"
|
|
1061
|
+
required: ["path"],
|
|
1060
1062
|
},
|
|
1061
|
-
description: "Files to upload. By default merges with the GitHub state at `ref`. Set replace:true to wipe the connector dir and write only these files.",
|
|
1063
|
+
description: "Files to upload — each needs 'path' plus ONE of content (inline string) or content_base64 (escape-safe base64; preferred for multi-file connectors). By default merges with the GitHub state at `ref`. Set replace:true to wipe the connector dir and write only these files.",
|
|
1062
1064
|
},
|
|
1063
1065
|
replace: {
|
|
1064
1066
|
type: "boolean",
|
|
@@ -4463,12 +4465,40 @@ const handlers = {
|
|
|
4463
4465
|
},
|
|
4464
4466
|
|
|
4465
4467
|
ateam_upload_connector: async ({ solution_id, connector_id, github, files, ref, replace }, sid) => {
|
|
4468
|
+
// OPEN-32: accept content_base64 per file (single-line, escape-safe) and
|
|
4469
|
+
// decode it to plain content here, so an agent can upload a multi-file
|
|
4470
|
+
// connector without hand-escaping ~90KB of HTML/JS/JSON in one tool call —
|
|
4471
|
+
// and via THIS registered path (not a raw curl that skips PAT provisioning).
|
|
4472
|
+
let normFiles = files;
|
|
4473
|
+
if (Array.isArray(files)) {
|
|
4474
|
+
normFiles = files.map((f, i) => {
|
|
4475
|
+
if (!f || typeof f !== "object" || !f.path) {
|
|
4476
|
+
throw new Error(`ateam_upload_connector: files[${i}] must be an object with a 'path'.`);
|
|
4477
|
+
}
|
|
4478
|
+
const hasContent = typeof f.content === "string";
|
|
4479
|
+
const hasB64 = typeof f.content_base64 === "string";
|
|
4480
|
+
if (hasContent && hasB64) {
|
|
4481
|
+
throw new Error(`ateam_upload_connector: files[${i}] ("${f.path}") has BOTH content and content_base64 — provide exactly one.`);
|
|
4482
|
+
}
|
|
4483
|
+
if (!hasContent && !hasB64) {
|
|
4484
|
+
throw new Error(`ateam_upload_connector: files[${i}] ("${f.path}") needs 'content' (inline string) or 'content_base64' (escape-safe base64).`);
|
|
4485
|
+
}
|
|
4486
|
+
if (hasB64) {
|
|
4487
|
+
const decoded = Buffer.from(f.content_base64, "base64").toString("utf8");
|
|
4488
|
+
if (!decoded && f.content_base64.trim()) {
|
|
4489
|
+
throw new Error(`ateam_upload_connector: files[${i}] ("${f.path}") content_base64 did not decode to any content — check the encoding.`);
|
|
4490
|
+
}
|
|
4491
|
+
return { path: f.path, content: decoded };
|
|
4492
|
+
}
|
|
4493
|
+
return { path: f.path, content: f.content };
|
|
4494
|
+
});
|
|
4495
|
+
}
|
|
4466
4496
|
// Async-first: this runs npm install + build in Core (up to ~7min) and is a
|
|
4467
4497
|
// prime Cloudflare-524 culprit. Kick async → poll /deploy/jobs; fall back to
|
|
4468
4498
|
// sync for older backends that don't honor async. Mirrors ateam_github_pull.
|
|
4469
4499
|
const body = {
|
|
4470
4500
|
github,
|
|
4471
|
-
files,
|
|
4501
|
+
files: normFiles,
|
|
4472
4502
|
...(ref ? { ref } : {}),
|
|
4473
4503
|
...(replace === true ? { replace: true } : {}),
|
|
4474
4504
|
};
|