@ateam-ai/mcp 0.4.30 → 0.4.32
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 +26 -9
package/package.json
CHANGED
package/src/tools.js
CHANGED
|
@@ -3160,6 +3160,7 @@ const handlers = {
|
|
|
3160
3160
|
const phases = [];
|
|
3161
3161
|
let isNewSkill = false;
|
|
3162
3162
|
let _connectorToolPush = null;
|
|
3163
|
+
let writeBranch = "dev"; // github/patch default; overwritten by the actual response branch
|
|
3163
3164
|
const _diff = { arrays_merged: [], arrays_replaced: [], scalars_changed: [], sections_replaced: [] };
|
|
3164
3165
|
|
|
3165
3166
|
// Two backing stores, chosen EXPLICITLY by `source` (never inferred):
|
|
@@ -3416,12 +3417,17 @@ const handlers = {
|
|
|
3416
3417
|
phases.push({ phase: "local_write", status: "done" });
|
|
3417
3418
|
}
|
|
3418
3419
|
} else {
|
|
3419
|
-
|
|
3420
|
+
// github/patch writes to `dev` by default (agents don't edit prod
|
|
3421
|
+
// directly). Capture the ACTUAL branch it committed to — do NOT assume
|
|
3422
|
+
// 'main'; mislabeling it strands the change off `main` until an explicit
|
|
3423
|
+
// ateam_github_promote (was: the result hardcoded branch:"main").
|
|
3424
|
+
const ghResp = await post(`/deploy/solutions/${solution_id}/github/patch`, {
|
|
3420
3425
|
path: filePath,
|
|
3421
3426
|
content: JSON.stringify(patched, null, 2),
|
|
3422
3427
|
message,
|
|
3423
3428
|
}, sid, { timeoutMs: 30_000 });
|
|
3424
|
-
|
|
3429
|
+
writeBranch = ghResp?.branch || writeBranch;
|
|
3430
|
+
phases.push({ phase: "github_write", status: "done", branch: writeBranch });
|
|
3425
3431
|
}
|
|
3426
3432
|
} catch (err) {
|
|
3427
3433
|
const store = isLocal ? "Builder store (local)" : "GitHub";
|
|
@@ -3472,12 +3478,18 @@ const handlers = {
|
|
|
3472
3478
|
// the redeploy with ateam_redeploy(solution_id, skill_id).
|
|
3473
3479
|
let redeployResult;
|
|
3474
3480
|
try {
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
+
const rdEndpoint = (target === "skill" && skill_id)
|
|
3482
|
+
? `/deploy/solutions/${solution_id}/skills/${skill_id}/redeploy`
|
|
3483
|
+
: `/deploy/solutions/${solution_id}/redeploy`;
|
|
3484
|
+
// Async-first, same as ateam_redeploy: a bulk (solution) redeploy of a
|
|
3485
|
+
// many-skill solution takes >100s and 524s on the sync path — the patch
|
|
3486
|
+
// then LOOKED like it failed / never reached Core. Kick async + poll;
|
|
3487
|
+
// fall back to sync for older backends.
|
|
3488
|
+
const kicked = await post(rdEndpoint, { async: true }, sid, { timeoutMs: 30_000 });
|
|
3489
|
+
redeployResult = (kicked?.async && kicked.job_id)
|
|
3490
|
+
? await pollDeployJob(kicked.job_id, sid, { label: skill_id ? `redeploy-skill ${skill_id}` : "redeploy-bulk", maxMs: 15 * 60_000, intervalMs: 2000 })
|
|
3491
|
+
: kicked;
|
|
3492
|
+
phases.push({ phase: "redeploy", status: redeployResult?.ok === false ? "error" : "done" });
|
|
3481
3493
|
} catch (err) {
|
|
3482
3494
|
// Partial success: patch is saved to GitHub, only redeploy failed.
|
|
3483
3495
|
// Return ok:true so the agent doesn't think the patch was lost.
|
|
@@ -3520,7 +3532,12 @@ const handlers = {
|
|
|
3520
3532
|
ok: true,
|
|
3521
3533
|
solution_id,
|
|
3522
3534
|
source: isLocal ? "local" : "github",
|
|
3523
|
-
...(isLocal ? {} : {
|
|
3535
|
+
...(isLocal ? {} : {
|
|
3536
|
+
branch: writeBranch,
|
|
3537
|
+
// Be explicit: a github write lands on `dev`, not prod. The change is
|
|
3538
|
+
// NOT on `main` until an explicit ateam_github_promote(dev→main).
|
|
3539
|
+
...(writeBranch !== "main" && { _branch_note: `Committed to "${writeBranch}" (not main). Run ateam_github_promote(solution_id) to ship dev→main; otherwise a future build_and_run(main) won't include this.` }),
|
|
3540
|
+
}),
|
|
3524
3541
|
phases,
|
|
3525
3542
|
// The full patched definition can be 10s of KB and pushes the rest of the
|
|
3526
3543
|
// result (redeploy status, widget_health) past the ~50KB output ceiling,
|