@ateam-ai/mcp 0.3.5 → 0.3.6
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 +55 -16
package/package.json
CHANGED
package/src/tools.js
CHANGED
|
@@ -124,14 +124,18 @@ export const tools = [
|
|
|
124
124
|
inputSchema: {
|
|
125
125
|
type: "object",
|
|
126
126
|
properties: {
|
|
127
|
+
solution_id: {
|
|
128
|
+
type: "string",
|
|
129
|
+
description: "The solution ID. Use this INSTEAD of passing the full solution object — the solution definition is auto-pulled from GitHub. Required if solution object is omitted.",
|
|
130
|
+
},
|
|
127
131
|
solution: {
|
|
128
132
|
type: "object",
|
|
129
|
-
description: "
|
|
133
|
+
description: "Full solution definition. Required on first deploy. After first deploy, just pass solution_id instead — everything is auto-pulled from GitHub.",
|
|
130
134
|
},
|
|
131
135
|
skills: {
|
|
132
136
|
type: "array",
|
|
133
137
|
items: { type: "object" },
|
|
134
|
-
description: "
|
|
138
|
+
description: "Optional after first deploy: skill definitions. If omitted, auto-pulled from GitHub repo (skills/{id}/skill.json).",
|
|
135
139
|
},
|
|
136
140
|
connectors: {
|
|
137
141
|
type: "array",
|
|
@@ -155,7 +159,7 @@ export const tools = [
|
|
|
155
159
|
description: "Optional: which skill to test (defaults to the first skill).",
|
|
156
160
|
},
|
|
157
161
|
},
|
|
158
|
-
required: [
|
|
162
|
+
required: [],
|
|
159
163
|
},
|
|
160
164
|
},
|
|
161
165
|
{
|
|
@@ -1291,7 +1295,13 @@ const handlers = {
|
|
|
1291
1295
|
// Validates → Deploys → Health-checks → Optionally tests
|
|
1292
1296
|
// One call replaces: validate_solution + deploy_solution + get_solution(health)
|
|
1293
1297
|
|
|
1294
|
-
ateam_build_and_run: async ({ solution, skills, connectors, mcp_store, github, test_message, test_skill_id }, sid) => {
|
|
1298
|
+
ateam_build_and_run: async ({ solution_id: solIdArg, solution: solutionArg, skills, connectors, mcp_store, github, test_message, test_skill_id }, sid) => {
|
|
1299
|
+
let solution = solutionArg;
|
|
1300
|
+
// If only solution_id passed (no full solution), we'll pull from GitHub
|
|
1301
|
+
const solutionId = solution?.id || solIdArg;
|
|
1302
|
+
if (!solutionId) {
|
|
1303
|
+
return { ok: false, phase: "pre_check", error: "Provide either solution (object) or solution_id (string)." };
|
|
1304
|
+
}
|
|
1295
1305
|
const phases = [];
|
|
1296
1306
|
|
|
1297
1307
|
// Guard: reject large mcp_store — agent should use github_patch instead
|
|
@@ -1314,13 +1324,13 @@ const handlers = {
|
|
|
1314
1324
|
}
|
|
1315
1325
|
}
|
|
1316
1326
|
|
|
1317
|
-
// Phase 0: Auto-detect GitHub repo — if no mcp_store passed and repo exists, pull from GitHub
|
|
1327
|
+
// Phase 0: Auto-detect GitHub repo — if no mcp_store passed and repo exists, pull bundle from GitHub
|
|
1318
1328
|
let effectiveMcpStore = mcp_store;
|
|
1329
|
+
let effectiveSkills = skills;
|
|
1319
1330
|
if (!mcp_store) {
|
|
1320
1331
|
try {
|
|
1321
|
-
const ghStatus = await get(`/deploy/solutions/${
|
|
1332
|
+
const ghStatus = await get(`/deploy/solutions/${solutionId}/github/status`, sid);
|
|
1322
1333
|
if (ghStatus?.repo_url) {
|
|
1323
|
-
// Repo exists — auto-pull from GitHub
|
|
1324
1334
|
github = true;
|
|
1325
1335
|
}
|
|
1326
1336
|
} catch { /* no repo — first deploy, mcp_store expected */ }
|
|
@@ -1328,24 +1338,33 @@ const handlers = {
|
|
|
1328
1338
|
if (github && !mcp_store) {
|
|
1329
1339
|
try {
|
|
1330
1340
|
const pullResult = await post(
|
|
1331
|
-
`/deploy/solutions/${
|
|
1341
|
+
`/deploy/solutions/${solutionId}/github/pull-bundle`,
|
|
1332
1342
|
{},
|
|
1333
1343
|
sid,
|
|
1334
|
-
{ timeoutMs:
|
|
1344
|
+
{ timeoutMs: 60_000 },
|
|
1335
1345
|
);
|
|
1336
1346
|
if (!pullResult.ok) {
|
|
1337
1347
|
return {
|
|
1338
1348
|
ok: false,
|
|
1339
1349
|
phase: "github_pull",
|
|
1340
|
-
error: pullResult.error || "Failed to pull
|
|
1350
|
+
error: pullResult.error || "Failed to pull bundle from GitHub",
|
|
1341
1351
|
hint: pullResult.hint || "Deploy the solution first (with mcp_store) to auto-create the GitHub repo.",
|
|
1342
|
-
message: "Cannot pull
|
|
1352
|
+
message: "Cannot pull from GitHub. The repo may not exist yet — deploy with mcp_store first.",
|
|
1343
1353
|
};
|
|
1344
1354
|
}
|
|
1345
|
-
effectiveMcpStore = pullResult.mcp_store;
|
|
1355
|
+
effectiveMcpStore = pullResult.mcp_store || {};
|
|
1356
|
+
// Use solution from GitHub if not passed inline
|
|
1357
|
+
if (!solution && pullResult.solution) {
|
|
1358
|
+
solution = pullResult.solution;
|
|
1359
|
+
}
|
|
1360
|
+
// Use skills from GitHub if not passed inline
|
|
1361
|
+
if (!effectiveSkills?.length && pullResult.skills?.length) {
|
|
1362
|
+
effectiveSkills = pullResult.skills;
|
|
1363
|
+
}
|
|
1346
1364
|
phases.push({
|
|
1347
1365
|
phase: "github_pull",
|
|
1348
1366
|
status: "done",
|
|
1367
|
+
skills_found: pullResult.skills_found || 0,
|
|
1349
1368
|
connectors_found: pullResult.connectors_found || 0,
|
|
1350
1369
|
files_loaded: pullResult.files_loaded || 0,
|
|
1351
1370
|
});
|
|
@@ -1354,15 +1373,35 @@ const handlers = {
|
|
|
1354
1373
|
ok: false,
|
|
1355
1374
|
phase: "github_pull",
|
|
1356
1375
|
error: err.message,
|
|
1357
|
-
message: "Failed to pull
|
|
1376
|
+
message: "Failed to pull from GitHub. The repo may not exist yet — deploy with mcp_store first.",
|
|
1358
1377
|
};
|
|
1359
1378
|
}
|
|
1360
1379
|
}
|
|
1361
1380
|
|
|
1381
|
+
// Guard: solution required (either inline or from GitHub)
|
|
1382
|
+
if (!solution) {
|
|
1383
|
+
return {
|
|
1384
|
+
ok: false,
|
|
1385
|
+
phase: "pre_check",
|
|
1386
|
+
error: "No solution provided and none found in GitHub repo.",
|
|
1387
|
+
message: "Pass solution inline or ensure solution.json exists in the GitHub repo.",
|
|
1388
|
+
};
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
// Guard: skills required (either inline or from GitHub)
|
|
1392
|
+
if (!effectiveSkills?.length) {
|
|
1393
|
+
return {
|
|
1394
|
+
ok: false,
|
|
1395
|
+
phase: "pre_check",
|
|
1396
|
+
error: "No skills provided and none found in GitHub repo.",
|
|
1397
|
+
message: "Pass skills inline or ensure they exist in the GitHub repo (skills/{id}/skill.json).",
|
|
1398
|
+
};
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1362
1401
|
// Phase 1: Validate
|
|
1363
1402
|
let validation;
|
|
1364
1403
|
try {
|
|
1365
|
-
validation = await post("/validate/solution", { solution, skills, connectors, mcp_store: effectiveMcpStore }, sid, { timeoutMs: 120_000 });
|
|
1404
|
+
validation = await post("/validate/solution", { solution, skills: effectiveSkills, connectors, mcp_store: effectiveMcpStore }, sid, { timeoutMs: 120_000 });
|
|
1366
1405
|
phases.push({ phase: "validate", status: "done" });
|
|
1367
1406
|
} catch (err) {
|
|
1368
1407
|
return {
|
|
@@ -1388,7 +1427,7 @@ const handlers = {
|
|
|
1388
1427
|
// Phase 2: Deploy
|
|
1389
1428
|
let deploy;
|
|
1390
1429
|
try {
|
|
1391
|
-
deploy = await post("/deploy/solution", { solution, skills, connectors, mcp_store: effectiveMcpStore }, sid, { timeoutMs: 300_000, retries: 2 });
|
|
1430
|
+
deploy = await post("/deploy/solution", { solution, skills: effectiveSkills, connectors, mcp_store: effectiveMcpStore }, sid, { timeoutMs: 300_000, retries: 2 });
|
|
1392
1431
|
phases.push({ phase: "deploy", status: deploy.ok ? "done" : "failed" });
|
|
1393
1432
|
} catch (err) {
|
|
1394
1433
|
return {
|
|
@@ -1426,7 +1465,7 @@ const handlers = {
|
|
|
1426
1465
|
// Phase 4: Warm test (optional)
|
|
1427
1466
|
let test_result;
|
|
1428
1467
|
if (test_message) {
|
|
1429
|
-
const skillId = test_skill_id ||
|
|
1468
|
+
const skillId = test_skill_id || effectiveSkills?.[0]?.id;
|
|
1430
1469
|
if (skillId) {
|
|
1431
1470
|
try {
|
|
1432
1471
|
test_result = await post(
|