@ateam-ai/mcp 0.4.4 → 0.4.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/tools.js +36 -9
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.6",
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
@@ -764,7 +764,10 @@ export const tools = [
764
764
  "postMessage protocol, default export shape). You then fill in the component body. " +
765
765
  "Use kind='iframe' for web-only, 'rn' for mobile-only, 'adaptive' for both. " +
766
766
  "Auto-discovery (Phase 5 of the strip) picks up the new plugin at next deploy " +
767
- "without a manifest declaration.",
767
+ "without a manifest declaration. " +
768
+ "The scaffold MERGES into the existing connector (its server.js + other files are preserved) — " +
769
+ "works on both GitHub-backed and repo-less (locally-deployed) tenants; the merge base is the " +
770
+ "GitHub repo when connected, otherwise the deployed connector source.",
768
771
  inputSchema: {
769
772
  type: "object",
770
773
  properties: {
@@ -2847,7 +2850,17 @@ const handlers = {
2847
2850
 
2848
2851
  // Dry-run: return diff + would-be after-state without writing to GitHub
2849
2852
  // or redeploying. Lets an agent preview any destructive-looking edit.
2853
+ // would_write mirrors the EXACT persistence request the real run makes
2854
+ // (method/endpoint/body key) so create-vs-update routing bugs surface in
2855
+ // dry-run instead of only on the real write.
2850
2856
  if (dry_run) {
2857
+ const would_write = isLocal
2858
+ ? (target === "skill" && skill_id && isNewSkill
2859
+ ? { method: "POST", endpoint: `/deploy/solutions/${solution_id}/skills`, body_key: "skill", creates: true }
2860
+ : target === "skill" && skill_id
2861
+ ? { method: "PATCH", endpoint: `/deploy/solutions/${solution_id}/skills/${encodeURIComponent(skill_id)}`, body_key: "updates" }
2862
+ : { method: "PATCH", endpoint: `/deploy/solutions/${solution_id}`, body_key: "state_update" })
2863
+ : { method: "POST", endpoint: `/deploy/solutions/${solution_id}/github/patch`, body_key: "content" };
2851
2864
  return {
2852
2865
  ok: true,
2853
2866
  dry_run: true,
@@ -2857,6 +2870,7 @@ const handlers = {
2857
2870
  phases,
2858
2871
  _diff,
2859
2872
  after_state: patched,
2873
+ would_write,
2860
2874
  would_write_bytes: JSON.stringify(patched, null, 2).length,
2861
2875
  hint: "No changes applied. Remove dry_run:true to commit + redeploy.",
2862
2876
  };
@@ -2867,14 +2881,27 @@ const handlers = {
2867
2881
  const patchKeys = Object.keys(updates || {});
2868
2882
  const message = `Patch: ${target}${skill_id ? ` ${skill_id}` : ""} — ${patchKeys.join(", ")}`;
2869
2883
  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" });
2884
+ // Write the FULL patched object to the Builder store. The client-side
2885
+ // merge above already resolved _push/_delete/_update, so we send the
2886
+ // resolved object. THREE distinct Builder routes, each with its own
2887
+ // body contract (mismatching them 400s):
2888
+ // • NEW skill → POST /deploy/solutions/:id/skills { skill }
2889
+ // (creates via the Builder, applies the full definition, and
2890
+ // pushes the topology skills[] entry the PATCH route can't
2891
+ // create: it 404s on resolveSkillId / 400s "Updates object is
2892
+ // required". This was the japanese-tutor repo-less bug.)
2893
+ // • EXISTING skill → PATCH …/skills/:skillId { updates }
2894
+ // • Solution → PATCH /deploy/solutions/:id { state_update }
2895
+ if (target === "skill" && skill_id && isNewSkill) {
2896
+ await post(`/deploy/solutions/${solution_id}/skills`, { skill: patched }, sid, { timeoutMs: 30_000 });
2897
+ phases.push({ phase: "local_write", status: "done", created: true });
2898
+ } else if (target === "skill" && skill_id) {
2899
+ await patch(`/deploy/solutions/${solution_id}/skills/${encodeURIComponent(skill_id)}`, { updates: patched }, sid, { timeoutMs: 30_000 });
2900
+ phases.push({ phase: "local_write", status: "done" });
2901
+ } else {
2902
+ await patch(`/deploy/solutions/${solution_id}`, { state_update: patched }, sid, { timeoutMs: 30_000 });
2903
+ phases.push({ phase: "local_write", status: "done" });
2904
+ }
2878
2905
  } else {
2879
2906
  await post(`/deploy/solutions/${solution_id}/github/patch`, {
2880
2907
  path: filePath,