@ateam-ai/mcp 0.3.6 → 0.3.7
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 +49 -19
package/package.json
CHANGED
package/src/tools.js
CHANGED
|
@@ -1451,11 +1451,35 @@ const handlers = {
|
|
|
1451
1451
|
};
|
|
1452
1452
|
}
|
|
1453
1453
|
|
|
1454
|
+
// Phase 2.5: Restart connectors that have source code (upload triggers stop+start)
|
|
1455
|
+
if (effectiveMcpStore && Object.keys(effectiveMcpStore).length > 0) {
|
|
1456
|
+
const connectorResults = [];
|
|
1457
|
+
for (const [connId, files] of Object.entries(effectiveMcpStore)) {
|
|
1458
|
+
if (!Array.isArray(files) || files.length === 0) continue;
|
|
1459
|
+
try {
|
|
1460
|
+
const uploadResult = await post(
|
|
1461
|
+
`/deploy/solutions/${solutionId}/connectors/${connId}/upload`,
|
|
1462
|
+
{ files },
|
|
1463
|
+
sid,
|
|
1464
|
+
{ timeoutMs: 120_000 },
|
|
1465
|
+
);
|
|
1466
|
+
connectorResults.push({ id: connId, ok: true, tools: uploadResult.tools || 0 });
|
|
1467
|
+
} catch (err) {
|
|
1468
|
+
connectorResults.push({ id: connId, ok: false, error: err.message });
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
phases.push({
|
|
1472
|
+
phase: "connector_restart",
|
|
1473
|
+
status: connectorResults.every(r => r.ok) ? "done" : "partial",
|
|
1474
|
+
connectors: connectorResults,
|
|
1475
|
+
});
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1454
1478
|
// Phase 3: Health check (with brief wait for propagation)
|
|
1455
1479
|
let health;
|
|
1456
1480
|
try {
|
|
1457
1481
|
await sleep(2000);
|
|
1458
|
-
health = await get(`/deploy/solutions/${
|
|
1482
|
+
health = await get(`/deploy/solutions/${solutionId}/health`, sid);
|
|
1459
1483
|
phases.push({ phase: "health", status: "done" });
|
|
1460
1484
|
} catch (err) {
|
|
1461
1485
|
health = { error: err.message };
|
|
@@ -1469,7 +1493,7 @@ const handlers = {
|
|
|
1469
1493
|
if (skillId) {
|
|
1470
1494
|
try {
|
|
1471
1495
|
test_result = await post(
|
|
1472
|
-
`/deploy/solutions/${
|
|
1496
|
+
`/deploy/solutions/${solutionId}/skills/${skillId}/test`,
|
|
1473
1497
|
{ message: test_message },
|
|
1474
1498
|
sid,
|
|
1475
1499
|
{ timeoutMs: 90_000 },
|
|
@@ -1482,28 +1506,34 @@ const handlers = {
|
|
|
1482
1506
|
}
|
|
1483
1507
|
}
|
|
1484
1508
|
|
|
1485
|
-
// Phase 5: GitHub push (
|
|
1509
|
+
// Phase 5: GitHub push (skip if we just pulled from GitHub — don't overwrite source of truth)
|
|
1486
1510
|
let github_result;
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1511
|
+
if (github) {
|
|
1512
|
+
// We pulled from GitHub → GitHub IS the source of truth. Don't push stale Core state back.
|
|
1513
|
+
github_result = { skipped: true, reason: 'Deployed from GitHub — skipping push-back to avoid overwriting source of truth.' };
|
|
1514
|
+
phases.push({ phase: "github", status: "skipped", reason: "pulled_from_github" });
|
|
1515
|
+
} else {
|
|
1516
|
+
try {
|
|
1517
|
+
github_result = await post(
|
|
1518
|
+
`/deploy/solutions/${solutionId}/github/push`,
|
|
1519
|
+
{ message: `Deploy: ${solution.name || solutionId}` },
|
|
1520
|
+
sid,
|
|
1521
|
+
{ timeoutMs: 60_000 },
|
|
1522
|
+
);
|
|
1523
|
+
phases.push({
|
|
1524
|
+
phase: "github",
|
|
1525
|
+
status: github_result.skipped ? "skipped" : "done",
|
|
1526
|
+
...(github_result.repo_url && { repo_url: github_result.repo_url }),
|
|
1527
|
+
});
|
|
1528
|
+
} catch (err) {
|
|
1529
|
+
github_result = { error: err.message };
|
|
1530
|
+
phases.push({ phase: "github", status: "error", error: err.message });
|
|
1531
|
+
}
|
|
1502
1532
|
}
|
|
1503
1533
|
|
|
1504
1534
|
return {
|
|
1505
1535
|
ok: true,
|
|
1506
|
-
solution_id:
|
|
1536
|
+
solution_id: solutionId,
|
|
1507
1537
|
branch: 'main',
|
|
1508
1538
|
phases,
|
|
1509
1539
|
deploy: {
|