@ateam-ai/mcp 0.3.24 → 0.3.25
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 +57 -1
package/package.json
CHANGED
package/src/tools.js
CHANGED
|
@@ -1947,7 +1947,39 @@ const handlers = {
|
|
|
1947
1947
|
return post(`/deploy/mcp-store/${connector_id}`, { files: resolved }, sid);
|
|
1948
1948
|
},
|
|
1949
1949
|
|
|
1950
|
-
ateam_list_solutions: async (_args, sid) =>
|
|
1950
|
+
ateam_list_solutions: async (_args, sid) => {
|
|
1951
|
+
const raw = await get("/deploy/solutions", sid);
|
|
1952
|
+
// Enrich each solution with GitHub metadata (repo_url, branch, CLAUDE.md)
|
|
1953
|
+
// so an agent sees everything it needs to clone + onboard in one call.
|
|
1954
|
+
// Fetches run in parallel; failures are non-fatal (fall back to the raw row).
|
|
1955
|
+
const solutions = Array.isArray(raw?.solutions) ? raw.solutions : Array.isArray(raw) ? raw : [];
|
|
1956
|
+
const enriched = await Promise.all(solutions.map(async (s) => {
|
|
1957
|
+
const out = { ...s };
|
|
1958
|
+
try {
|
|
1959
|
+
const gh = await get(`/deploy/solutions/${s.id}/github/status`, sid);
|
|
1960
|
+
if (gh?.exists && gh.repo_url) {
|
|
1961
|
+
out.repo_url = gh.repo_url;
|
|
1962
|
+
out.github_full_name = gh.full_name || null;
|
|
1963
|
+
out.default_branch = gh.default_branch || "main";
|
|
1964
|
+
out.latest_commit_sha = gh.latest_commit?.sha || null;
|
|
1965
|
+
// Probe for agent-onboarding doc; swallow 404 etc.
|
|
1966
|
+
try {
|
|
1967
|
+
const probe = await get(`/deploy/solutions/${s.id}/github/read?path=CLAUDE.md`, sid);
|
|
1968
|
+
out.has_claude_md = Boolean(probe?.content);
|
|
1969
|
+
} catch { out.has_claude_md = false; }
|
|
1970
|
+
out.local_dev_quickstart = {
|
|
1971
|
+
_note: "Share these 3 lines with a developer (or their agent). They will clone the repo and, if CLAUDE.md is present, their agent sees the full onboarding on session start.",
|
|
1972
|
+
clone: `git clone ${gh.repo_url}`,
|
|
1973
|
+
cd: `cd ${(gh.full_name || "").split("/").pop() || s.id}`,
|
|
1974
|
+
auth_in_new_session: `ateam_auth(api_key: "adas_<tenant>_<hex>")`,
|
|
1975
|
+
needs_github_collaborator_access: !gh.repo_url.includes("public") ? true : false,
|
|
1976
|
+
};
|
|
1977
|
+
}
|
|
1978
|
+
} catch { /* non-fatal — leave the row as-is */ }
|
|
1979
|
+
return out;
|
|
1980
|
+
}));
|
|
1981
|
+
return { ...raw, solutions: enriched };
|
|
1982
|
+
},
|
|
1951
1983
|
|
|
1952
1984
|
ateam_get_solution: async ({ solution_id, view, skill_id }, sid) => {
|
|
1953
1985
|
const base = `/deploy/solutions/${solution_id}`;
|
|
@@ -2335,6 +2367,30 @@ export async function handleToolCall(name, args, sessionId) {
|
|
|
2335
2367
|
last_tool_used: ctx.lastToolName || null,
|
|
2336
2368
|
};
|
|
2337
2369
|
}
|
|
2370
|
+
// If authenticated, attach a tenant onboarding block so the agent can
|
|
2371
|
+
// discover existing solutions + their repo URLs without extra round-trips.
|
|
2372
|
+
// This is what lets a fresh agent clone the right repo on first greet.
|
|
2373
|
+
try {
|
|
2374
|
+
const creds = getCredentials(sessionId);
|
|
2375
|
+
if (creds?.apiKey || creds?.masterKey) {
|
|
2376
|
+
const listed = await handlers.ateam_list_solutions({}, sessionId);
|
|
2377
|
+
const solutions = Array.isArray(listed?.solutions) ? listed.solutions : [];
|
|
2378
|
+
if (solutions.length > 0) {
|
|
2379
|
+
result.tenant_onboarding = {
|
|
2380
|
+
_note: "The authed key can see these solutions. For LOCAL development: clone the repo_url and open any Claude-Code-compatible agent in that directory — it will auto-load CLAUDE.md on session start. For REMOTE-only work: call ateam_github_read(solution_id, 'CLAUDE.md') to fetch the onboarding doc. If `git clone` returns 403, ask the solution owner to add your GitHub account as a collaborator on the repo (GitHub access is separate from the A-Team API key).",
|
|
2381
|
+
tenant: creds.tenant || null,
|
|
2382
|
+
solutions: solutions.map((s) => ({
|
|
2383
|
+
id: s.id,
|
|
2384
|
+
name: s.name,
|
|
2385
|
+
repo_url: s.repo_url || null,
|
|
2386
|
+
default_branch: s.default_branch || "main",
|
|
2387
|
+
has_claude_md: s.has_claude_md ?? null,
|
|
2388
|
+
clone_command: s.repo_url ? `git clone ${s.repo_url}` : null,
|
|
2389
|
+
})),
|
|
2390
|
+
};
|
|
2391
|
+
}
|
|
2392
|
+
}
|
|
2393
|
+
} catch { /* non-fatal — unauthed sessions or API blips shouldn't break bootstrap */ }
|
|
2338
2394
|
}
|
|
2339
2395
|
|
|
2340
2396
|
return {
|