@mandujs/mcp 0.32.1 → 0.32.3
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 +2 -2
- package/src/tools/brain.ts +19 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mandujs/mcp",
|
|
3
|
-
"version": "0.32.
|
|
3
|
+
"version": "0.32.3",
|
|
4
4
|
"description": "Mandu MCP Server - Agent-native interface for Mandu framework operations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@mandujs/core": "^0.
|
|
37
|
+
"@mandujs/core": "^0.46.0",
|
|
38
38
|
"@mandujs/ate": "^0.25.1",
|
|
39
39
|
"@mandujs/skills": "^0.19.0",
|
|
40
40
|
"@modelcontextprotocol/sdk": "^1.25.3"
|
package/src/tools/brain.ts
CHANGED
|
@@ -163,7 +163,7 @@ export const brainToolDefinitions: Tool[] = [
|
|
|
163
163
|
{
|
|
164
164
|
name: "mandu.brain.status",
|
|
165
165
|
description:
|
|
166
|
-
"Check which LLM adapter is active for brain (openai / anthropic /
|
|
166
|
+
"Check which LLM adapter is active for brain (openai / anthropic / template) and whether auth tokens are present. Read-only — does not call an LLM or spawn subprocesses.",
|
|
167
167
|
annotations: { readOnlyHint: true },
|
|
168
168
|
inputSchema: {
|
|
169
169
|
type: "object",
|
|
@@ -221,8 +221,11 @@ let mcpWarningUnsubscribe: (() => void) | null = null;
|
|
|
221
221
|
* suggestion mapping is pinned without spinning up a credential store.
|
|
222
222
|
*
|
|
223
223
|
* - openai / anthropic tiers → point at the LLM-heal loop + guard doctor.
|
|
224
|
-
* -
|
|
225
|
-
* quality.
|
|
224
|
+
* - template tier (with login prompt) → point at `mandu brain login` for
|
|
225
|
+
* higher quality. Unknown tiers return an empty list.
|
|
226
|
+
*
|
|
227
|
+
* Issue #235 follow-up — the local Ollama tier was removed; the only
|
|
228
|
+
* non-cloud fallback is now `template` (deterministic, no LLM).
|
|
226
229
|
*/
|
|
227
230
|
export function buildBrainStatusSuggestions(activeTier: string): string[] {
|
|
228
231
|
const suggestions: string[] = [];
|
|
@@ -233,7 +236,7 @@ export function buildBrainStatusSuggestions(activeTier: string): string[] {
|
|
|
233
236
|
suggestions.push(
|
|
234
237
|
"Call mandu.brain.doctor after a mandu.guard.check failure to get LLM-assisted diagnosis + patch suggestions.",
|
|
235
238
|
);
|
|
236
|
-
} else if (activeTier === "
|
|
239
|
+
} else if (activeTier === "template") {
|
|
237
240
|
suggestions.push(
|
|
238
241
|
"Run `mandu brain login --provider=openai` (or --provider=anthropic) to unlock higher-quality LLM-assisted heal + doctor output.",
|
|
239
242
|
);
|
|
@@ -701,9 +704,18 @@ export function brainTools(projectRoot: string, server?: Server, monitor?: Activ
|
|
|
701
704
|
// Issue #237 Concern 4 — surface next-step suggestions keyed to the
|
|
702
705
|
// active tier so agents can find the LLM invocation paths without
|
|
703
706
|
// grep-archaeology. LLM tiers point at ate.heal / brain.doctor;
|
|
704
|
-
//
|
|
707
|
+
// template tier points at `mandu brain login` for an upgrade.
|
|
705
708
|
const suggestions = buildBrainStatusSuggestions(resolution.resolved);
|
|
706
709
|
|
|
710
|
+
// Issue #235 follow-up — the resolver now exposes `needsLogin: true`
|
|
711
|
+
// when the only reason it fell back to template is that no cloud
|
|
712
|
+
// token exists yet. Surface it so agents can short-circuit a chat
|
|
713
|
+
// round-trip to ask the user for `mandu brain login`.
|
|
714
|
+
const needsLogin = resolution.needsLogin === true;
|
|
715
|
+
const loginHint = needsLogin
|
|
716
|
+
? "No cloud token detected — run `mandu brain login --provider=openai` (or --provider=anthropic) to unlock LLM-backed adapters."
|
|
717
|
+
: undefined;
|
|
718
|
+
|
|
707
719
|
return {
|
|
708
720
|
content: [
|
|
709
721
|
{
|
|
@@ -713,6 +725,8 @@ export function brainTools(projectRoot: string, server?: Server, monitor?: Activ
|
|
|
713
725
|
active_tier: resolution.resolved,
|
|
714
726
|
reason: resolution.reason,
|
|
715
727
|
backend: store.backendName,
|
|
728
|
+
needs_login: needsLogin,
|
|
729
|
+
login_hint: loginHint,
|
|
716
730
|
providers,
|
|
717
731
|
suggestions,
|
|
718
732
|
},
|