@ateam-ai/mcp 0.4.4 → 0.4.5

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/tools.js +32 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ateam-ai/mcp",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "mcpName": "io.github.ariekogan/ateam-mcp",
5
5
  "description": "A-Team MCP Server — build, validate, and deploy multi-agent solutions from any AI environment",
6
6
  "type": "module",
package/src/tools.js CHANGED
@@ -2847,7 +2847,17 @@ const handlers = {
2847
2847
 
2848
2848
  // Dry-run: return diff + would-be after-state without writing to GitHub
2849
2849
  // or redeploying. Lets an agent preview any destructive-looking edit.
2850
+ // would_write mirrors the EXACT persistence request the real run makes
2851
+ // (method/endpoint/body key) so create-vs-update routing bugs surface in
2852
+ // dry-run instead of only on the real write.
2850
2853
  if (dry_run) {
2854
+ const would_write = isLocal
2855
+ ? (target === "skill" && skill_id && isNewSkill
2856
+ ? { method: "POST", endpoint: `/deploy/solutions/${solution_id}/skills`, body_key: "skill", creates: true }
2857
+ : target === "skill" && skill_id
2858
+ ? { method: "PATCH", endpoint: `/deploy/solutions/${solution_id}/skills/${encodeURIComponent(skill_id)}`, body_key: "updates" }
2859
+ : { method: "PATCH", endpoint: `/deploy/solutions/${solution_id}`, body_key: "state_update" })
2860
+ : { method: "POST", endpoint: `/deploy/solutions/${solution_id}/github/patch`, body_key: "content" };
2851
2861
  return {
2852
2862
  ok: true,
2853
2863
  dry_run: true,
@@ -2857,6 +2867,7 @@ const handlers = {
2857
2867
  phases,
2858
2868
  _diff,
2859
2869
  after_state: patched,
2870
+ would_write,
2860
2871
  would_write_bytes: JSON.stringify(patched, null, 2).length,
2861
2872
  hint: "No changes applied. Remove dry_run:true to commit + redeploy.",
2862
2873
  };
@@ -2867,14 +2878,27 @@ const handlers = {
2867
2878
  const patchKeys = Object.keys(updates || {});
2868
2879
  const message = `Patch: ${target}${skill_id ? ` ${skill_id}` : ""} — ${patchKeys.join(", ")}`;
2869
2880
  if (isLocal) {
2870
- // Write the FULL patched object to the Builder store. Top-level keys are
2871
- // replaced (removals honored) the client-side merge above already
2872
- // resolved _push/_delete/_update, so we send the resolved object.
2873
- const endpoint = (target === "skill" && skill_id)
2874
- ? `/deploy/solutions/${solution_id}/skills/${encodeURIComponent(skill_id)}`
2875
- : `/deploy/solutions/${solution_id}`;
2876
- await patch(endpoint, { state_update: patched }, sid, { timeoutMs: 30_000 });
2877
- phases.push({ phase: "local_write", status: "done" });
2881
+ // Write the FULL patched object to the Builder store. The client-side
2882
+ // merge above already resolved _push/_delete/_update, so we send the
2883
+ // resolved object. THREE distinct Builder routes, each with its own
2884
+ // body contract (mismatching them 400s):
2885
+ // • NEW skill → POST /deploy/solutions/:id/skills { skill }
2886
+ // (creates via the Builder, applies the full definition, and
2887
+ // pushes the topology skills[] entry the PATCH route can't
2888
+ // create: it 404s on resolveSkillId / 400s "Updates object is
2889
+ // required". This was the japanese-tutor repo-less bug.)
2890
+ // • EXISTING skill → PATCH …/skills/:skillId { updates }
2891
+ // • Solution → PATCH /deploy/solutions/:id { state_update }
2892
+ if (target === "skill" && skill_id && isNewSkill) {
2893
+ await post(`/deploy/solutions/${solution_id}/skills`, { skill: patched }, sid, { timeoutMs: 30_000 });
2894
+ phases.push({ phase: "local_write", status: "done", created: true });
2895
+ } else if (target === "skill" && skill_id) {
2896
+ await patch(`/deploy/solutions/${solution_id}/skills/${encodeURIComponent(skill_id)}`, { updates: patched }, sid, { timeoutMs: 30_000 });
2897
+ phases.push({ phase: "local_write", status: "done" });
2898
+ } else {
2899
+ await patch(`/deploy/solutions/${solution_id}`, { state_update: patched }, sid, { timeoutMs: 30_000 });
2900
+ phases.push({ phase: "local_write", status: "done" });
2901
+ }
2878
2902
  } else {
2879
2903
  await post(`/deploy/solutions/${solution_id}/github/patch`, {
2880
2904
  path: filePath,