mastracode 0.32.6 → 0.33.0-alpha.1
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/CHANGELOG.md +41 -0
- package/README.md +1 -1
- package/dist/cli.cjs +2 -2
- package/dist/cli.js +2 -2
- package/dist/tui/commands/mcp.d.ts.map +1 -1
- package/dist/tui/commands/models-pack.d.ts.map +1 -1
- package/dist/tui/components/mcp-selector.d.ts +13 -0
- package/dist/tui/components/mcp-selector.d.ts.map +1 -1
- package/dist/tui/display.d.ts +12 -0
- package/dist/tui/display.d.ts.map +1 -1
- package/dist/tui/handlers/prompts.d.ts.map +1 -1
- package/dist/tui/handlers/tool.d.ts.map +1 -1
- package/dist/tui/setup.d.ts.map +1 -1
- package/dist/{tui-CdyS5uec.cjs → tui-Bqf7lCPV.cjs} +189 -16
- package/dist/tui-Bqf7lCPV.cjs.map +1 -0
- package/dist/{tui-BUEL6cTY.js → tui-PMpovaIn.js} +190 -17
- package/dist/tui-PMpovaIn.js.map +1 -0
- package/dist/tui.cjs +1 -1
- package/dist/tui.js +1 -1
- package/package.json +14 -14
- package/dist/tui-BUEL6cTY.js.map +0 -1
- package/dist/tui-CdyS5uec.cjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
# mastracode
|
|
2
2
|
|
|
3
|
+
## 0.33.0-alpha.1
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Added the ability to disable MCP servers without editing configuration files. ([#20834](https://github.com/mastra-ai/mastra/pull/20834))
|
|
8
|
+
|
|
9
|
+
- **Disable and enable servers**: Run `/mcp disable <server-name|all>` to turn servers off and `/mcp enable <server-name|all>` to turn them back on, or toggle individual servers from the interactive `/mcp` selector.
|
|
10
|
+
- **Global scope**: Add `--global` to apply the change to every project. `/mcp disable all --global` acts as a kill switch for all MCP servers.
|
|
11
|
+
- **Persistence**: Disabled servers stay visible in `/mcp status` with a marker for the scope that disabled them, their tools are removed from the agent, and the state survives restarts.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- dependencies updates: ([#19783](https://github.com/mastra-ai/mastra/pull/19783))
|
|
16
|
+
- Updated dependency [`posthog-node@^5.46.1` ↗︎](https://www.npmjs.com/package/posthog-node/v/5.46.1) (from `^5.37.0`, in `dependencies`)
|
|
17
|
+
|
|
18
|
+
- dependencies updates: ([#20406](https://github.com/mastra-ai/mastra/pull/20406))
|
|
19
|
+
- Updated dependency [`@aws-sdk/credential-providers@^3.1095.0` ↗︎](https://www.npmjs.com/package/@aws-sdk/credential-providers/v/3.1095.0) (from `^3.864.0`, in `dependencies`)
|
|
20
|
+
|
|
21
|
+
- Fixed notifications for assistant questions, plan approvals, sandbox access requests, and tool approvals so the bell, system notification, and Notification hooks fire the moment Mastra Code starts waiting for input — even while an earlier prompt is still pending. Fixes #20398. ([#20857](https://github.com/mastra-ai/mastra/pull/20857))
|
|
22
|
+
|
|
23
|
+
- Fixed custom provider models saved with a stray `mastracode/` prefix in settings, which broke selecting and using them after choosing them from `/models` (#20799) ([#20804](https://github.com/mastra-ai/mastra/pull/20804))
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [[`e7109ee`](https://github.com/mastra-ai/mastra/commit/e7109ee6f731bacc79c885906f3c7dca8d8f013a), [`ae0e985`](https://github.com/mastra-ai/mastra/commit/ae0e985e8f1186a8ecfcf0de6dd36ac12ef85324), [`e7109ee`](https://github.com/mastra-ai/mastra/commit/e7109ee6f731bacc79c885906f3c7dca8d8f013a), [`772c0c8`](https://github.com/mastra-ai/mastra/commit/772c0c897cec383258de2e6178147f8014767c7b), [`772c0c8`](https://github.com/mastra-ai/mastra/commit/772c0c897cec383258de2e6178147f8014767c7b), [`f5a17d9`](https://github.com/mastra-ai/mastra/commit/f5a17d95c19e7d4149996932bd8d1905089f031d), [`578bf2e`](https://github.com/mastra-ai/mastra/commit/578bf2e6a88e9d5b8bf502204e15a95dfbb679ae), [`06b2d87`](https://github.com/mastra-ai/mastra/commit/06b2d87e63bcdd0ed59215c6789692b9b12de376), [`ac01d63`](https://github.com/mastra-ai/mastra/commit/ac01d6355974aec73fdb8781449ed12bac582094), [`8627c23`](https://github.com/mastra-ai/mastra/commit/8627c23d794485fb97d533fc2a7a8323bfec2225), [`a810a05`](https://github.com/mastra-ai/mastra/commit/a810a058f62ad407cfc1701e0be36ae91145d7cf), [`26ff3b9`](https://github.com/mastra-ai/mastra/commit/26ff3b9144132bd8570e4796d436fb57a9a2bf24), [`3ff2be3`](https://github.com/mastra-ai/mastra/commit/3ff2be3a5a579d2e2d7084ba0624ec24faadce4d), [`f8da216`](https://github.com/mastra-ai/mastra/commit/f8da21633e7eb0e31c9ce0fc30567870d19416d3), [`e7a5da4`](https://github.com/mastra-ai/mastra/commit/e7a5da4ef8e4dd452d2f232961b4e682a85ffe43), [`c71e307`](https://github.com/mastra-ai/mastra/commit/c71e3077e69eae3f25aa628e3778f153a9d6ab36), [`e7a5da4`](https://github.com/mastra-ai/mastra/commit/e7a5da4ef8e4dd452d2f232961b4e682a85ffe43), [`a4f6806`](https://github.com/mastra-ai/mastra/commit/a4f68065d082af57770e7ee3d34996fdc914dbd1), [`6104347`](https://github.com/mastra-ai/mastra/commit/61043473ba6bfd0a25156824e853e13165562e6c), [`ffdfa25`](https://github.com/mastra-ai/mastra/commit/ffdfa25b5cdf3ecfd0c5a2e96363c3ba50995ce9), [`0ce1d05`](https://github.com/mastra-ai/mastra/commit/0ce1d054586c5d348543d2749067b40adbc9b783), [`6698e16`](https://github.com/mastra-ai/mastra/commit/6698e168d74e054fc3efa97b19025fb2d1dafc45), [`45bfb88`](https://github.com/mastra-ai/mastra/commit/45bfb88fd52f1dd3be20e2a38905777c96499c90), [`e3b9307`](https://github.com/mastra-ai/mastra/commit/e3b9307098daefbfae2a52ae2ef51bc9fc701190), [`d6834c5`](https://github.com/mastra-ai/mastra/commit/d6834c5a7866b16734d23900163c2414ed70d791), [`c52d346`](https://github.com/mastra-ai/mastra/commit/c52d3462ec831a5d95926ecd3d3373f5928ad2e5), [`0023e79`](https://github.com/mastra-ai/mastra/commit/0023e7919431078280abd11c89d1edeae35fcc69), [`c2ad51e`](https://github.com/mastra-ai/mastra/commit/c2ad51e2467f901eecba8c9f4a45e22a50bd7c18), [`3dc97ea`](https://github.com/mastra-ai/mastra/commit/3dc97ea415fad353b48a13095fad1835933cc12a), [`3d01cd3`](https://github.com/mastra-ai/mastra/commit/3d01cd387321b6f9c5cac31d487c84bf51b19c78), [`7bf3086`](https://github.com/mastra-ai/mastra/commit/7bf308663f0115ca74ad20554ade740f06640859), [`a8dd139`](https://github.com/mastra-ai/mastra/commit/a8dd1391a9fe9a6632c25809ef236980afa9a020), [`e5786be`](https://github.com/mastra-ai/mastra/commit/e5786be02bb903073082bd9d6da880ebaacc343f), [`e5786be`](https://github.com/mastra-ai/mastra/commit/e5786be02bb903073082bd9d6da880ebaacc343f), [`d6c63e4`](https://github.com/mastra-ai/mastra/commit/d6c63e4b757babb95a735d0e421d4dac67c1dcf1), [`2093fbd`](https://github.com/mastra-ai/mastra/commit/2093fbd53bb744bae19ec89f6d73db9a66fbe8a7), [`e7a5da4`](https://github.com/mastra-ai/mastra/commit/e7a5da4ef8e4dd452d2f232961b4e682a85ffe43), [`e4d3761`](https://github.com/mastra-ai/mastra/commit/e4d376143cf3322885a7e6e4048e536ce441f785), [`7b4393d`](https://github.com/mastra-ai/mastra/commit/7b4393d557411fdcf07b0e30e5acaf7cc85154ae)]:
|
|
26
|
+
- @mastra/code-sdk@1.2.0-alpha.1
|
|
27
|
+
- @mastra/core@1.58.0-alpha.1
|
|
28
|
+
- @mastra/libsql@1.20.0-alpha.0
|
|
29
|
+
- @mastra/pg@1.20.0-alpha.0
|
|
30
|
+
- @mastra/schema-compat@1.3.6-alpha.0
|
|
31
|
+
- @mastra/observability@1.16.6-alpha.0
|
|
32
|
+
- @mastra/mcp@1.16.0-alpha.0
|
|
33
|
+
- @mastra/memory@1.26.1-alpha.0
|
|
34
|
+
- @mastra/duckdb@1.6.1-alpha.0
|
|
35
|
+
|
|
36
|
+
## 0.32.7-alpha.0
|
|
37
|
+
|
|
38
|
+
### Patch Changes
|
|
39
|
+
|
|
40
|
+
- Updated dependencies [[`45a9147`](https://github.com/mastra-ai/mastra/commit/45a914741f578754d79d8b7de7b4e4f304d8e14a), [`990611b`](https://github.com/mastra-ai/mastra/commit/990611ba76eb876d86c9c594371ae5f02f94b432), [`ed5d606`](https://github.com/mastra-ai/mastra/commit/ed5d606739c5e3fbdfa9f272df7809aa5ab43b1d)]:
|
|
41
|
+
- @mastra/core@1.58.0-alpha.0
|
|
42
|
+
- @mastra/code-sdk@1.1.4-alpha.0
|
|
43
|
+
|
|
3
44
|
## 0.32.6
|
|
4
45
|
|
|
5
46
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -98,7 +98,7 @@ Select a suggestion with arrow keys and press Tab to insert it.
|
|
|
98
98
|
| `/cost` | Show token usage and estimated costs |
|
|
99
99
|
| `/review` | Review a GitHub pull request |
|
|
100
100
|
| `/hooks` | Show/reload configured hooks |
|
|
101
|
-
| `/mcp` | Show/reload MCP server connections
|
|
101
|
+
| `/mcp` | Show/reload MCP server connections, disable or enable servers |
|
|
102
102
|
| `/sandbox` | Manage allowed paths (add/remove dirs) |
|
|
103
103
|
| `/permissions` | View/manage tool approval permissions |
|
|
104
104
|
| `/plugins` | Install and manage trusted Mastra Code plugins |
|
package/dist/cli.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const require_tui = require("./tui-
|
|
2
|
+
const require_tui = require("./tui-Bqf7lCPV.cjs");
|
|
3
3
|
let _mastra_code_sdk = require("@mastra/code-sdk");
|
|
4
4
|
let fs = require("fs");
|
|
5
5
|
fs = require_tui.__toESM(fs, 1);
|
|
@@ -13,7 +13,7 @@ let _mastra_code_sdk_utils_stdin_pipe = require("@mastra/code-sdk/utils/stdin-pi
|
|
|
13
13
|
let _mastra_code_sdk_utils_thread_lock = require("@mastra/code-sdk/utils/thread-lock");
|
|
14
14
|
//#region src/version.ts
|
|
15
15
|
function getCurrentVersion() {
|
|
16
|
-
return "0.
|
|
16
|
+
return "0.33.0-alpha.1";
|
|
17
17
|
}
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region src/main.ts
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { d as detectTerminalTheme, f as applyThemeMode, t as MastraTUI, v as restoreTerminalForeground } from "./tui-
|
|
2
|
+
import { d as detectTerminalTheme, f as applyThemeMode, t as MastraTUI, v as restoreTerminalForeground } from "./tui-PMpovaIn.js";
|
|
3
3
|
import { createMastraCode } from "@mastra/code-sdk";
|
|
4
4
|
import fs from "fs";
|
|
5
5
|
import { createMastraCodeAnalytics } from "@mastra/code-sdk/analytics";
|
|
@@ -12,7 +12,7 @@ import { drainPipedStdin, reopenStdinFromTTY } from "@mastra/code-sdk/utils/stdi
|
|
|
12
12
|
import { releaseAllThreadLocks } from "@mastra/code-sdk/utils/thread-lock";
|
|
13
13
|
//#region src/version.ts
|
|
14
14
|
function getCurrentVersion() {
|
|
15
|
-
return "0.
|
|
15
|
+
return "0.33.0-alpha.1";
|
|
16
16
|
}
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region src/main.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/tui/commands/mcp.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/tui/commands/mcp.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuH9F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models-pack.d.ts","sourceRoot":"","sources":["../../../src/tui/commands/models-pack.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AACxF,OAAO,KAAK,EAAE,QAAQ,EAAuC,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"models-pack.d.ts","sourceRoot":"","sources":["../../../src/tui/commands/models-pack.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AACxF,OAAO,KAAK,EAAE,QAAQ,EAAuC,MAAM,mCAAmC,CAAC;AASvG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAS3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAItD,OAAO,EAAE,4BAA4B,EAAE,CAAC;AAaxC,wBAAgB,aAAa,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAMpD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CA2B9D;AAmQD,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,QAAQ,EACd,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACpC,cAAc,CAAC,EAAE,MAAM,EACvB,SAAS,UAAO,GACf,IAAI,CAmBN;AAoMD,wBAAsB,uBAAuB,CAAC,GAAG,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAyNrF"}
|
|
@@ -34,6 +34,17 @@ export interface McpSelectorOptions {
|
|
|
34
34
|
onAuthenticateServer: (name: string) => Promise<McpServerStatus>;
|
|
35
35
|
/** Callback to cancel a pending OAuth flow for a server by name — resolves true if one was cancelled */
|
|
36
36
|
onCancelAuthenticateServer: (name: string) => Promise<boolean>;
|
|
37
|
+
/**
|
|
38
|
+
* Callback to disable/enable a server by name. `global: true` applies the
|
|
39
|
+
* change across every project instead of just this one. Rebuilds all
|
|
40
|
+
* connections (like reload), so it returns fresh statuses/skipped.
|
|
41
|
+
*/
|
|
42
|
+
onSetServerDisabled: (name: string, disabled: boolean, options?: {
|
|
43
|
+
global?: boolean;
|
|
44
|
+
}) => Promise<{
|
|
45
|
+
statuses: McpServerStatus[];
|
|
46
|
+
skipped: McpSkippedServer[];
|
|
47
|
+
}>;
|
|
37
48
|
/** Get captured stderr logs for a server */
|
|
38
49
|
getServerLogs: (name: string) => string[];
|
|
39
50
|
/** Show an info message in the chat area */
|
|
@@ -51,6 +62,7 @@ export declare class McpSelectorComponent extends Box implements Focusable {
|
|
|
51
62
|
private onReconnectServerCallback;
|
|
52
63
|
private onAuthenticateServerCallback;
|
|
53
64
|
private onCancelAuthenticateServerCallback;
|
|
65
|
+
private onSetServerDisabledCallback;
|
|
54
66
|
private getServerLogsCallback;
|
|
55
67
|
private showInfoCallback;
|
|
56
68
|
private onCloseCallback;
|
|
@@ -85,6 +97,7 @@ export declare class McpSelectorComponent extends Box implements Focusable {
|
|
|
85
97
|
private openSubMenu;
|
|
86
98
|
private handleSubMenuInput;
|
|
87
99
|
private executeAction;
|
|
100
|
+
private doSetServerDisabled;
|
|
88
101
|
private doReloadAll;
|
|
89
102
|
private doReconnectServer;
|
|
90
103
|
private doAuthenticateServer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-selector.d.ts","sourceRoot":"","sources":["../../../src/tui/components/mcp-selector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,GAAG,EAA2C,MAAM,wBAAwB,CAAC;AACtF,OAAO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OAAO,CAErB;IACD,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAEzB;gBAEW,OAAO,EAAE,kBAAkB;IAoBvC,OAAO,CAAC,OAAO;IAkBf,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,UAAU;IA+FlB;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,oBAAoB;IA2B5B,OAAO,CAAC,WAAW;IAOnB,oDAAoD;IACpD,OAAO,IAAI,IAAI;IAIf,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAwD/B,OAAO,CAAC,WAAW;IA0BnB,OAAO,CAAC,kBAAkB;IAwB1B,OAAO,CAAC,aAAa;IA0DrB,OAAO,CAAC,mBAAmB;IAoD3B,OAAO,CAAC,WAAW;IA0CnB,OAAO,CAAC,iBAAiB;IAwDzB,OAAO,CAAC,oBAAoB;IAmF5B,OAAO,CAAC,sBAAsB;IAyB9B,OAAO,CAAC,YAAY;IAuBpB,OAAO,CAAC,SAAS;IAajB,OAAO,CAAC,QAAQ;CAmCjB"}
|
package/dist/tui/display.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AgentControllerEvent } from '@mastra/core/agent-controller';
|
|
1
2
|
import type { NotificationReason } from './notify.js';
|
|
2
3
|
import type { TUIState } from './state.js';
|
|
3
4
|
export declare function showError(state: TUIState, message: string): void;
|
|
@@ -11,4 +12,15 @@ export declare function showFormattedError(state: TUIState, event: {
|
|
|
11
12
|
maxRetries?: number;
|
|
12
13
|
} | Error): void;
|
|
13
14
|
export declare function notify(state: TUIState, reason: NotificationReason, message?: string): void;
|
|
15
|
+
/**
|
|
16
|
+
* Fire the notification for an input-request event the moment it is received,
|
|
17
|
+
* before the event enters the TUI's serialized dispatch queue. A pending prompt
|
|
18
|
+
* blocks that queue until the user answers, so any notify call living inside a
|
|
19
|
+
* queued handler is starved exactly when the user has walked away. This helper
|
|
20
|
+
* runs synchronously in the controller subscription listener instead.
|
|
21
|
+
*
|
|
22
|
+
* Non-input-request events are a no-op. Never throws: a notification failure
|
|
23
|
+
* must not break event delivery.
|
|
24
|
+
*/
|
|
25
|
+
export declare function notifyForInputRequest(state: TUIState, event: AgentControllerEvent): void;
|
|
14
26
|
//# sourceMappingURL=display.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../src/tui/display.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../src/tui/display.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAG1E,OAAO,KAAK,EAAoB,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAExE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAgB3C,wBAAgB,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAIhE;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAI/D;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,QAAQ,EACf,KAAK,EACD;IACE,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GACD,KAAK,GACR,IAAI,CAoCN;AA0BD,wBAAgB,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAO1F;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,oBAAoB,GAAG,IAAI,CA0BxF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/tui/handlers/prompts.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAQ/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAatD;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,mBAAmB,EACxB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,EACxD,aAAa,CAAC,EAAE,oBAAoB,GACnC,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/tui/handlers/prompts.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAQ/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAatD;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,mBAAmB,EACxB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,EACxD,aAAa,CAAC,EAAE,oBAAoB,GACnC,OAAO,CAAC,IAAI,CAAC,CA+Kf;AAED;;;;;;GAMG;AACH,wBAAsB,0BAA0B,CAC9C,GAAG,EAAE,mBAAmB,EACxB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CAwDf;AAqDD,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,mBAAmB,EACxB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC,CA2If"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../src/tui/handlers/tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAWH,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AAUjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAOtD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE5D;AAuBD,wBAAgB,wBAAwB,IAAI,IAAI,CAK/C;AAkGD,wBAAgB,qBAAqB,IAAI,IAAI,CAI5C;AAwBD,wBAAgB,6BAA6B,CAC3C,GAAG,EAAE,mBAAmB,EACxB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,OAAO,GACZ,0BAA0B,GAAG,SAAS,CAsCxC;AA0ED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAgCxD;AAED,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,mBAAmB,EACxB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,OAAO,GACZ,IAAI,
|
|
1
|
+
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../src/tui/handlers/tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAWH,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AAUjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAOtD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE5D;AAuBD,wBAAgB,wBAAwB,IAAI,IAAI,CAK/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AAG,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAiDnH"}
|
package/dist/tui/setup.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/tui/setup.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAQ3C,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,QAAQ,EACf,SAAS,EAAE;IACT,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C,GACA,IAAI,CA+KN;AA8BD,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAwD9F;AAsBD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/tui/setup.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAQ3C,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,QAAQ,EACf,SAAS,EAAE;IACT,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C,GACA,IAAI,CA+KN;AA8BD,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAwD9F;AAsBD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CA8IvD;AAMD,wBAAsB,uBAAuB,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CA0B5E;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAkBtE;AAED,2DAA2D;AAC3D,wBAAsB,yBAAyB,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAG9E;AAMD,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,QAAQ,EACf,SAAS,EAAE;IACT,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;CACvB,GACA,MAAM,IAAI,CAyCZ;AAMD,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAqB5G;AAMD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAIzD;AAMD,wBAAsB,wBAAwB,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAkG7E;AAMD,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAWxE"}
|
|
@@ -2925,6 +2925,13 @@ function decodePrintableShortcut(data) {
|
|
|
2925
2925
|
* MCP server selector component for managing MCP server connections.
|
|
2926
2926
|
* Uses pi-tui overlay pattern with navigation.
|
|
2927
2927
|
*/
|
|
2928
|
+
const DISABLE_ACTIONS = [{
|
|
2929
|
+
label: "Disable (this project)",
|
|
2930
|
+
key: "disable"
|
|
2931
|
+
}, {
|
|
2932
|
+
label: "Disable globally (all projects)",
|
|
2933
|
+
key: "disable-global"
|
|
2934
|
+
}];
|
|
2928
2935
|
const CONNECTED_ACTIONS = [
|
|
2929
2936
|
{
|
|
2930
2937
|
label: "View tools",
|
|
@@ -2937,7 +2944,8 @@ const CONNECTED_ACTIONS = [
|
|
|
2937
2944
|
{
|
|
2938
2945
|
label: "Reconnect",
|
|
2939
2946
|
key: "reconnect"
|
|
2940
|
-
}
|
|
2947
|
+
},
|
|
2948
|
+
...DISABLE_ACTIONS
|
|
2941
2949
|
];
|
|
2942
2950
|
const FAILED_ACTIONS = [
|
|
2943
2951
|
{
|
|
@@ -2951,7 +2959,8 @@ const FAILED_ACTIONS = [
|
|
|
2951
2959
|
{
|
|
2952
2960
|
label: "Reconnect",
|
|
2953
2961
|
key: "reconnect"
|
|
2954
|
-
}
|
|
2962
|
+
},
|
|
2963
|
+
...DISABLE_ACTIONS
|
|
2955
2964
|
];
|
|
2956
2965
|
const NEEDS_AUTH_ACTIONS = [
|
|
2957
2966
|
{
|
|
@@ -2969,8 +2978,17 @@ const NEEDS_AUTH_ACTIONS = [
|
|
|
2969
2978
|
{
|
|
2970
2979
|
label: "Reconnect",
|
|
2971
2980
|
key: "reconnect"
|
|
2972
|
-
}
|
|
2981
|
+
},
|
|
2982
|
+
...DISABLE_ACTIONS
|
|
2973
2983
|
];
|
|
2984
|
+
const DISABLED_ACTIONS = [{
|
|
2985
|
+
label: "Enable",
|
|
2986
|
+
key: "enable"
|
|
2987
|
+
}];
|
|
2988
|
+
const DISABLED_GLOBAL_ACTIONS = [{
|
|
2989
|
+
label: "Enable globally (all projects)",
|
|
2990
|
+
key: "enable-global"
|
|
2991
|
+
}];
|
|
2974
2992
|
const CONNECTING_ACTIONS = [{
|
|
2975
2993
|
label: "Waiting for connection...",
|
|
2976
2994
|
key: "none"
|
|
@@ -2989,6 +3007,7 @@ var McpSelectorComponent = class extends _earendil_works_pi_tui.Box {
|
|
|
2989
3007
|
onReconnectServerCallback;
|
|
2990
3008
|
onAuthenticateServerCallback;
|
|
2991
3009
|
onCancelAuthenticateServerCallback;
|
|
3010
|
+
onSetServerDisabledCallback;
|
|
2992
3011
|
getServerLogsCallback;
|
|
2993
3012
|
showInfoCallback;
|
|
2994
3013
|
onCloseCallback;
|
|
@@ -3018,6 +3037,7 @@ var McpSelectorComponent = class extends _earendil_works_pi_tui.Box {
|
|
|
3018
3037
|
this.onReconnectServerCallback = options.onReconnectServer;
|
|
3019
3038
|
this.onAuthenticateServerCallback = options.onAuthenticateServer;
|
|
3020
3039
|
this.onCancelAuthenticateServerCallback = options.onCancelAuthenticateServer;
|
|
3040
|
+
this.onSetServerDisabledCallback = options.onSetServerDisabled;
|
|
3021
3041
|
this.getServerLogsCallback = options.getServerLogs;
|
|
3022
3042
|
this.showInfoCallback = options.showInfo;
|
|
3023
3043
|
this.onCloseCallback = options.onClose;
|
|
@@ -3049,7 +3069,10 @@ var McpSelectorComponent = class extends _earendil_works_pi_tui.Box {
|
|
|
3049
3069
|
const isSelected = i === this.selectedIndex && !this.subMenuOpen;
|
|
3050
3070
|
let icon;
|
|
3051
3071
|
let stateText;
|
|
3052
|
-
if (
|
|
3072
|
+
if (status.disabled) {
|
|
3073
|
+
icon = theme.fg("muted", "⊘");
|
|
3074
|
+
stateText = theme.fg("muted", status.disabledScope === "global" ? "disabled (global)" : "disabled");
|
|
3075
|
+
} else if (this._reloading) {
|
|
3053
3076
|
icon = theme.fg("warning", "⟳");
|
|
3054
3077
|
stateText = theme.fg("warning", "reconnecting...");
|
|
3055
3078
|
} else if (this.isAuthenticating(status)) {
|
|
@@ -3167,7 +3190,8 @@ var McpSelectorComponent = class extends _earendil_works_pi_tui.Box {
|
|
|
3167
3190
|
openSubMenu() {
|
|
3168
3191
|
const status = this.statuses[this.selectedIndex];
|
|
3169
3192
|
if (!status) return;
|
|
3170
|
-
if (
|
|
3193
|
+
if (status.disabled) this.subMenuActions = status.disabledScope === "global" ? DISABLED_GLOBAL_ACTIONS : DISABLED_ACTIONS;
|
|
3194
|
+
else if (this.isAuthenticating(status)) this.subMenuActions = AUTHENTICATING_ACTIONS;
|
|
3171
3195
|
else if (status.connecting) this.subMenuActions = CONNECTING_ACTIONS;
|
|
3172
3196
|
else if (status.connected) this.subMenuActions = CONNECTED_ACTIONS;
|
|
3173
3197
|
else if (status.needsAuth) this.subMenuActions = NEEDS_AUTH_ACTIONS;
|
|
@@ -3220,8 +3244,49 @@ var McpSelectorComponent = class extends _earendil_works_pi_tui.Box {
|
|
|
3220
3244
|
this.subMenuOpen = false;
|
|
3221
3245
|
this.doCancelAuthentication(status);
|
|
3222
3246
|
break;
|
|
3247
|
+
case "disable":
|
|
3248
|
+
this.subMenuOpen = false;
|
|
3249
|
+
this.doSetServerDisabled(status, true, false);
|
|
3250
|
+
break;
|
|
3251
|
+
case "disable-global":
|
|
3252
|
+
this.subMenuOpen = false;
|
|
3253
|
+
this.doSetServerDisabled(status, true, true);
|
|
3254
|
+
break;
|
|
3255
|
+
case "enable":
|
|
3256
|
+
this.subMenuOpen = false;
|
|
3257
|
+
this.doSetServerDisabled(status, false, false);
|
|
3258
|
+
break;
|
|
3259
|
+
case "enable-global":
|
|
3260
|
+
this.subMenuOpen = false;
|
|
3261
|
+
this.doSetServerDisabled(status, false, true);
|
|
3262
|
+
break;
|
|
3223
3263
|
}
|
|
3224
3264
|
}
|
|
3265
|
+
doSetServerDisabled(status, disabled, global) {
|
|
3266
|
+
const name = status.name;
|
|
3267
|
+
this._reloading = true;
|
|
3268
|
+
this.updateList();
|
|
3269
|
+
this.onSetServerDisabledCallback(name, disabled, { global }).then((result) => {
|
|
3270
|
+
this.statuses = result.statuses;
|
|
3271
|
+
this.skipped = result.skipped;
|
|
3272
|
+
this._authenticating.clear();
|
|
3273
|
+
this._cancelling.clear();
|
|
3274
|
+
const total = this.getTotalItems();
|
|
3275
|
+
if (this.selectedIndex >= total) this.selectedIndex = Math.max(0, total - 1);
|
|
3276
|
+
const updated = result.statuses.find((s) => s.name === name);
|
|
3277
|
+
if (disabled) this.showInfoCallback(global ? `MCP: Disabled "${name}" globally (all projects). Re-enable it from /mcp.` : `MCP: Disabled "${name}". Re-enable it from /mcp.`);
|
|
3278
|
+
else if (updated?.disabled) this.showInfoCallback(updated.disabledScope === "global" ? `MCP: "${name}" is still disabled globally — use "Enable globally" to re-enable it.` : `MCP: "${name}" is still disabled in this project — use "Enable" to re-enable it.`);
|
|
3279
|
+
else if (updated?.connected) this.showInfoCallback(`MCP: Enabled "${name}" — ${updated.toolCount} tool(s)`);
|
|
3280
|
+
else if (updated?.needsAuth) this.showInfoCallback(`MCP: Enabled "${name}" — needs authentication \u2192 run /mcp to authenticate`);
|
|
3281
|
+
else this.showInfoCallback(`MCP: Enabled "${name}" but it failed to connect: ${updated?.error ?? "Unknown error"}`);
|
|
3282
|
+
}).catch((err) => {
|
|
3283
|
+
const errMsg = err instanceof Error ? err.message : String(err);
|
|
3284
|
+
this.showInfoCallback(`MCP: Failed to ${disabled ? "disable" : "enable"} "${name}": ${errMsg}`);
|
|
3285
|
+
}).finally(() => {
|
|
3286
|
+
this._reloading = false;
|
|
3287
|
+
this.updateList();
|
|
3288
|
+
});
|
|
3289
|
+
}
|
|
3225
3290
|
doReloadAll() {
|
|
3226
3291
|
this._reloading = true;
|
|
3227
3292
|
this.updateList();
|
|
@@ -3236,7 +3301,7 @@ var McpSelectorComponent = class extends _earendil_works_pi_tui.Box {
|
|
|
3236
3301
|
const connected = result.statuses.filter((s) => s.connected);
|
|
3237
3302
|
const totalTools = connected.reduce((sum, s) => sum + s.toolCount, 0);
|
|
3238
3303
|
this.showInfoCallback(`MCP: Reloaded. ${connected.length} server(s) connected, ${totalTools} tool(s).`);
|
|
3239
|
-
for (const s of result.statuses.filter((s) => !s.connected)) if (s.needsAuth) this.showInfoCallback(`MCP: \u26a0 "${s.name}" needs authentication \u2192 run /mcp to authenticate`);
|
|
3304
|
+
for (const s of result.statuses.filter((s) => !s.connected && !s.disabled)) if (s.needsAuth) this.showInfoCallback(`MCP: \u26a0 "${s.name}" needs authentication \u2192 run /mcp to authenticate`);
|
|
3240
3305
|
else this.showInfoCallback(`MCP: Failed to connect to "${s.name}": ${s.error ?? "Unknown error"}`);
|
|
3241
3306
|
}).catch(() => {
|
|
3242
3307
|
this.showInfoCallback("MCP: Reload failed. Retrying may help.");
|
|
@@ -3487,6 +3552,36 @@ function notify(state, reason, message) {
|
|
|
3487
3552
|
hookManager: state.hookManager
|
|
3488
3553
|
});
|
|
3489
3554
|
}
|
|
3555
|
+
/**
|
|
3556
|
+
* Fire the notification for an input-request event the moment it is received,
|
|
3557
|
+
* before the event enters the TUI's serialized dispatch queue. A pending prompt
|
|
3558
|
+
* blocks that queue until the user answers, so any notify call living inside a
|
|
3559
|
+
* queued handler is starved exactly when the user has walked away. This helper
|
|
3560
|
+
* runs synchronously in the controller subscription listener instead.
|
|
3561
|
+
*
|
|
3562
|
+
* Non-input-request events are a no-op. Never throws: a notification failure
|
|
3563
|
+
* must not break event delivery.
|
|
3564
|
+
*/
|
|
3565
|
+
function notifyForInputRequest(state, event) {
|
|
3566
|
+
try {
|
|
3567
|
+
if (event.type === "tool_approval_required") {
|
|
3568
|
+
notify(state, "tool_approval", `Approve ${event.toolName}?`);
|
|
3569
|
+
return;
|
|
3570
|
+
}
|
|
3571
|
+
if (event.type === "tool_suspended") {
|
|
3572
|
+
const payload = event.suspendPayload ?? {};
|
|
3573
|
+
if (event.toolName === "request_access" || payload.kind === "sandbox_access_request") notify(state, "sandbox_access", `Sandbox access requested: ${String(payload.path ?? "")}`);
|
|
3574
|
+
else if (event.toolName === "ask_user") notify(state, "ask_question", String(payload.question ?? ""));
|
|
3575
|
+
else if (event.toolName === "submit_plan") {
|
|
3576
|
+
const planPath = String(payload.path ?? "");
|
|
3577
|
+
notify(state, "plan_approval", planPath ? `Plan "${planPath}" requires approval` : "Plan requires your approval");
|
|
3578
|
+
}
|
|
3579
|
+
}
|
|
3580
|
+
} catch (err) {
|
|
3581
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
3582
|
+
process.stderr.write(`[notify error] ${msg}\n`);
|
|
3583
|
+
}
|
|
3584
|
+
}
|
|
3490
3585
|
//#endregion
|
|
3491
3586
|
//#region src/tui/open-url.ts
|
|
3492
3587
|
/**
|
|
@@ -3530,6 +3625,13 @@ async function handleMcpCommand(ctx, args) {
|
|
|
3530
3625
|
showTextStatus(ctx);
|
|
3531
3626
|
return;
|
|
3532
3627
|
}
|
|
3628
|
+
if (subcommand === "disable" || subcommand === "enable") {
|
|
3629
|
+
const rest = args.slice(1);
|
|
3630
|
+
const global = rest.includes("--global") || rest.includes("-g");
|
|
3631
|
+
const target = rest.find((a) => a !== "--global" && a !== "-g");
|
|
3632
|
+
await setDisabled(ctx, subcommand === "disable", target, global);
|
|
3633
|
+
return;
|
|
3634
|
+
}
|
|
3533
3635
|
const paths = mm.getConfigPaths();
|
|
3534
3636
|
if (!mm.hasServers()) {
|
|
3535
3637
|
ctx.showInfo(`No MCP servers configured.
|
|
@@ -3568,6 +3670,13 @@ Add servers to:
|
|
|
3568
3670
|
onCancelAuthenticateServer: async (name) => {
|
|
3569
3671
|
return mm.cancelServerAuthentication(name);
|
|
3570
3672
|
},
|
|
3673
|
+
onSetServerDisabled: async (name, disabled, options) => {
|
|
3674
|
+
await mm.setServerDisabled(name, disabled, options);
|
|
3675
|
+
return {
|
|
3676
|
+
statuses: mm.getServerStatuses(),
|
|
3677
|
+
skipped: mm.getSkippedServers()
|
|
3678
|
+
};
|
|
3679
|
+
},
|
|
3571
3680
|
getServerLogs: (name) => {
|
|
3572
3681
|
return mm.getServerLogs(name);
|
|
3573
3682
|
},
|
|
@@ -3585,6 +3694,44 @@ Add servers to:
|
|
|
3585
3694
|
});
|
|
3586
3695
|
selector.focused = true;
|
|
3587
3696
|
}
|
|
3697
|
+
async function setDisabled(ctx, disabled, target, global) {
|
|
3698
|
+
const mm = ctx.mcpManager;
|
|
3699
|
+
if (!mm) return;
|
|
3700
|
+
const verb = disabled ? "disable" : "enable";
|
|
3701
|
+
if (!target) {
|
|
3702
|
+
ctx.showInfo(`Usage: /mcp ${verb} <server-name|all> [--global]`);
|
|
3703
|
+
return;
|
|
3704
|
+
}
|
|
3705
|
+
const scopeSuffix = global ? " --global" : "";
|
|
3706
|
+
const scopeLabel = global ? " globally (all projects)" : "";
|
|
3707
|
+
if (target === "all") {
|
|
3708
|
+
ctx.showInfo(`MCP: ${disabled ? "Disabling" : "Enabling"} all servers${scopeLabel}...`);
|
|
3709
|
+
await mm.setAllDisabled(disabled, { global });
|
|
3710
|
+
if (disabled) ctx.showInfo(`MCP: All servers disabled${scopeLabel}. Re-enable with /mcp enable all${scopeSuffix}.`);
|
|
3711
|
+
else {
|
|
3712
|
+
const statuses = mm.getServerStatuses();
|
|
3713
|
+
const connected = statuses.filter((s) => s.connected);
|
|
3714
|
+
const totalTools = connected.reduce((sum, s) => sum + s.toolCount, 0);
|
|
3715
|
+
ctx.showInfo(`MCP: All servers enabled${scopeLabel}. ${connected.length} server(s) connected, ${totalTools} tool(s).`);
|
|
3716
|
+
const stillDisabled = statuses.filter((s) => s.disabled);
|
|
3717
|
+
if (!global && mm.isAllDisabledGlobally()) ctx.showInfo("MCP: All MCP is still disabled globally — re-enable with /mcp enable all --global.");
|
|
3718
|
+
else if (stillDisabled.length > 0) {
|
|
3719
|
+
const otherScope = global ? "in this project" : "globally";
|
|
3720
|
+
const otherSuffix = global ? "" : " --global";
|
|
3721
|
+
ctx.showInfo(`MCP: Still disabled ${otherScope}: ${stillDisabled.map((s) => s.name).join(", ")} — re-enable with /mcp enable <name|all>${otherSuffix}.`);
|
|
3722
|
+
}
|
|
3723
|
+
}
|
|
3724
|
+
return;
|
|
3725
|
+
}
|
|
3726
|
+
ctx.showInfo(`MCP: ${disabled ? "Disabling" : "Enabling"} "${target}"${scopeLabel}...`);
|
|
3727
|
+
const status = await mm.setServerDisabled(target, disabled, { global });
|
|
3728
|
+
if (disabled) if (status.disabled) ctx.showInfo(`MCP: Disabled "${target}"${scopeLabel}. Re-enable with /mcp enable ${target}${scopeSuffix}.`);
|
|
3729
|
+
else ctx.showInfo(`MCP: Failed to disable "${target}": ${status.error ?? "Unknown error"}`);
|
|
3730
|
+
else if (status.disabled) ctx.showInfo(mm.isAllDisabledGlobally() ? `MCP: "${target}" is still disabled — all MCP is disabled globally. Re-enable with /mcp enable all --global.` : status.disabledScope === "global" ? `MCP: "${target}" is still disabled globally — re-enable with /mcp enable ${target} --global.` : `MCP: "${target}" is still disabled in this project — re-enable with /mcp enable ${target}.`);
|
|
3731
|
+
else if (status.connected) ctx.showInfo(`MCP: Enabled "${target}" — ${status.toolCount} tool(s)`);
|
|
3732
|
+
else if (status.needsAuth) ctx.showInfo(`MCP: Enabled "${target}" — needs authentication \u2192 run /mcp to authenticate`);
|
|
3733
|
+
else ctx.showInfo(`MCP: Failed to enable "${target}": ${status.error ?? "Unknown error"}`);
|
|
3734
|
+
}
|
|
3588
3735
|
async function reloadServers(ctx) {
|
|
3589
3736
|
const mm = ctx.mcpManager;
|
|
3590
3737
|
if (!mm) return;
|
|
@@ -3595,7 +3742,7 @@ async function reloadServers(ctx) {
|
|
|
3595
3742
|
const connected = statuses.filter((s) => s.connected);
|
|
3596
3743
|
const totalTools = connected.reduce((sum, s) => sum + s.toolCount, 0);
|
|
3597
3744
|
ctx.showInfo(`MCP: Reloaded. ${connected.length} server(s) connected, ${totalTools} tool(s).`);
|
|
3598
|
-
for (const s of statuses.filter((s) => !s.connected)) if (s.needsAuth) ctx.showInfo(`MCP: \u26a0 "${s.name}" needs authentication \u2192 run /mcp to authenticate`);
|
|
3745
|
+
for (const s of statuses.filter((s) => !s.connected && !s.disabled)) if (s.needsAuth) ctx.showInfo(`MCP: \u26a0 "${s.name}" needs authentication \u2192 run /mcp to authenticate`);
|
|
3599
3746
|
else ctx.showInfo(`MCP: Failed to connect to "${s.name}": ${s.error}`);
|
|
3600
3747
|
} catch (error) {
|
|
3601
3748
|
ctx.showError(`MCP reload failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
@@ -3612,9 +3759,13 @@ function showTextStatus(ctx) {
|
|
|
3612
3759
|
lines.push(` Global: ${paths.global}`);
|
|
3613
3760
|
lines.push(` Claude: ${paths.claude}`);
|
|
3614
3761
|
lines.push("");
|
|
3762
|
+
if (mm.isAllDisabledGlobally()) {
|
|
3763
|
+
lines.push(` \u2298 All MCP is disabled globally — re-enable via /mcp enable all --global`);
|
|
3764
|
+
lines.push("");
|
|
3765
|
+
}
|
|
3615
3766
|
for (const status of statuses) {
|
|
3616
|
-
const icon = status.authenticating ? "⚠" : status.connecting ? "⟳" : status.connected ? "✓" : status.needsAuth ? "⚠" : "✗";
|
|
3617
|
-
const state = status.authenticating ? "authenticating — cancel via /mcp" : status.connecting ? "connecting..." : status.connected ? "connected" : status.needsAuth ? "needs auth — authenticate via /mcp" : `error: ${status.error}`;
|
|
3767
|
+
const icon = status.disabled ? "⊘" : status.authenticating ? "⚠" : status.connecting ? "⟳" : status.connected ? "✓" : status.needsAuth ? "⚠" : "✗";
|
|
3768
|
+
const state = status.disabled ? status.disabledScope === "global" ? `disabled globally — enable via /mcp enable ${status.name} --global` : `disabled — enable via /mcp enable ${status.name}` : status.authenticating ? "authenticating — cancel via /mcp" : status.connecting ? "connecting..." : status.connected ? "connected" : status.needsAuth ? "needs auth — authenticate via /mcp" : `error: ${status.error}`;
|
|
3618
3769
|
lines.push(` ${icon} ${status.name} [${status.transport}] (${state})`);
|
|
3619
3770
|
if (status.toolNames.length > 0) for (const toolName of status.toolNames) lines.push(` - ${toolName}`);
|
|
3620
3771
|
}
|
|
@@ -3625,6 +3776,8 @@ function showTextStatus(ctx) {
|
|
|
3625
3776
|
}
|
|
3626
3777
|
lines.push("");
|
|
3627
3778
|
lines.push(` /mcp reload - Disconnect and reconnect all servers`);
|
|
3779
|
+
lines.push(` /mcp disable <name|all> [--global] - Disable server(s) for this project or globally (persists)`);
|
|
3780
|
+
lines.push(` /mcp enable <name|all> [--global] - Re-enable disabled server(s)`);
|
|
3628
3781
|
ctx.showInfo(lines.join("\n"));
|
|
3629
3782
|
}
|
|
3630
3783
|
//#endregion
|
|
@@ -8559,7 +8712,6 @@ function handleToolApprovalRequired(ctx, toolCallId, toolName, args) {
|
|
|
8559
8712
|
const { state } = ctx;
|
|
8560
8713
|
const category = (0, _mastra_code_sdk_permissions.getToolCategory)(toolName);
|
|
8561
8714
|
const categoryLabel = category ? _mastra_code_sdk_permissions.TOOL_CATEGORIES[category]?.label : void 0;
|
|
8562
|
-
ctx.notify("tool_approval", `Approve ${toolName}?`);
|
|
8563
8715
|
const firePermissionResult = (decision) => {
|
|
8564
8716
|
state.hookManager?.runPermissionResult("tool_approval", toolCallId, toolName, decision, args).catch(() => {});
|
|
8565
8717
|
};
|
|
@@ -11275,7 +11427,8 @@ async function selectModel(ctx, title, modeColor, currentModelId) {
|
|
|
11275
11427
|
onSelect: async (model) => {
|
|
11276
11428
|
ctx.state.ui.hideOverlay();
|
|
11277
11429
|
await promptForApiKeyIfNeeded(ctx.state.ui, model, ctx.authStorage);
|
|
11278
|
-
|
|
11430
|
+
const { customProviders } = (0, _mastra_code_sdk_onboarding_settings.loadSettings)();
|
|
11431
|
+
resolve((0, _mastra_code_sdk_onboarding_settings.stripMastraCodeCustomProviderPrefix)(model.id, customProviders));
|
|
11279
11432
|
},
|
|
11280
11433
|
onCancel: () => {
|
|
11281
11434
|
ctx.state.ui.hideOverlay();
|
|
@@ -16308,7 +16461,6 @@ async function handleAskQuestion(ctx, toolCallId, question, options, selectionMo
|
|
|
16308
16461
|
showModalOverlay(state.ui, dialog, { widthPercent: .7 });
|
|
16309
16462
|
dialog.focused = true;
|
|
16310
16463
|
}
|
|
16311
|
-
ctx.notify("ask_question", question);
|
|
16312
16464
|
});
|
|
16313
16465
|
}
|
|
16314
16466
|
/**
|
|
@@ -16370,7 +16522,6 @@ async function handleSandboxAccessRequest(ctx, toolCallId, requestedPath, reason
|
|
|
16370
16522
|
};
|
|
16371
16523
|
if (state.activeInlineQuestion) state.pendingInlineQuestions.push(activate);
|
|
16372
16524
|
else activate();
|
|
16373
|
-
ctx.notify("sandbox_access", `Sandbox access requested: ${requestedPath}`);
|
|
16374
16525
|
});
|
|
16375
16526
|
}
|
|
16376
16527
|
/**
|
|
@@ -16494,7 +16645,6 @@ async function handlePlanApproval(ctx, toolCallId, submittedPath) {
|
|
|
16494
16645
|
state.ui.requestRender();
|
|
16495
16646
|
state.chatContainer.invalidate();
|
|
16496
16647
|
state.ui.setFocus(approvalComponent);
|
|
16497
|
-
ctx.notify("plan_approval", `Plan "${resolvedTitle}" requires approval`);
|
|
16498
16648
|
});
|
|
16499
16649
|
}
|
|
16500
16650
|
//#endregion
|
|
@@ -19982,7 +20132,29 @@ function setupAutocomplete(state) {
|
|
|
19982
20132
|
},
|
|
19983
20133
|
{
|
|
19984
20134
|
name: "mcp",
|
|
19985
|
-
description: "Show/reload MCP server connections"
|
|
20135
|
+
description: "Show/reload/enable/disable MCP server connections",
|
|
20136
|
+
getArgumentCompletions: (argumentPrefix) => [
|
|
20137
|
+
{
|
|
20138
|
+
value: "reload",
|
|
20139
|
+
label: "reload",
|
|
20140
|
+
description: "Disconnect and reconnect all servers"
|
|
20141
|
+
},
|
|
20142
|
+
{
|
|
20143
|
+
value: "status",
|
|
20144
|
+
label: "status",
|
|
20145
|
+
description: "Show server status as text"
|
|
20146
|
+
},
|
|
20147
|
+
{
|
|
20148
|
+
value: "disable",
|
|
20149
|
+
label: "disable",
|
|
20150
|
+
description: "Disable a server or all servers"
|
|
20151
|
+
},
|
|
20152
|
+
{
|
|
20153
|
+
value: "enable",
|
|
20154
|
+
label: "enable",
|
|
20155
|
+
description: "Re-enable a server or all servers"
|
|
20156
|
+
}
|
|
20157
|
+
].filter((command) => command.value.startsWith(argumentPrefix.toLowerCase()))
|
|
19986
20158
|
},
|
|
19987
20159
|
{
|
|
19988
20160
|
name: "thread:tag-dir",
|
|
@@ -20225,6 +20397,7 @@ function setupKeyHandlers(state, callbacks) {
|
|
|
20225
20397
|
function subscribeToAgentController(state, handleEvent) {
|
|
20226
20398
|
let eventQueue = Promise.resolve();
|
|
20227
20399
|
const listener = (event) => {
|
|
20400
|
+
notifyForInputRequest(state, event);
|
|
20228
20401
|
eventQueue = eventQueue.then(async () => {
|
|
20229
20402
|
try {
|
|
20230
20403
|
await handleEvent(event);
|
|
@@ -21814,4 +21987,4 @@ Object.defineProperty(exports, "theme", {
|
|
|
21814
21987
|
}
|
|
21815
21988
|
});
|
|
21816
21989
|
|
|
21817
|
-
//# sourceMappingURL=tui-
|
|
21990
|
+
//# sourceMappingURL=tui-Bqf7lCPV.cjs.map
|