mastracode 0.21.0-alpha.8 → 0.21.0
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 +68 -0
- package/dist/{chunk-ZKEXPYKG.js → chunk-D6URMYIX.js} +38 -15
- package/dist/chunk-D6URMYIX.js.map +1 -0
- package/dist/{chunk-5K3EX2EI.cjs → chunk-LLIZDIV6.cjs} +37 -14
- package/dist/chunk-LLIZDIV6.cjs.map +1 -0
- package/dist/cli.cjs +5 -5
- package/dist/cli.js +1 -1
- package/dist/tui/components/mcp-selector.d.ts.map +1 -1
- package/dist/tui/components/multi-step-progress.d.ts.map +1 -1
- package/dist/tui/components/thread-selector.d.ts.map +1 -1
- package/dist/tui/components/tool-approval-dialog.d.ts +2 -0
- package/dist/tui/components/tool-approval-dialog.d.ts.map +1 -1
- package/dist/tui/key-input.d.ts +2 -0
- package/dist/tui/key-input.d.ts.map +1 -0
- package/dist/tui.cjs +11 -11
- package/dist/tui.js +1 -1
- package/package.json +8 -8
- package/dist/chunk-5K3EX2EI.cjs.map +0 -1
- package/dist/chunk-ZKEXPYKG.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,73 @@
|
|
|
1
1
|
# mastracode
|
|
2
2
|
|
|
3
|
+
## 0.21.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Added support for overriding Mastra Code's config directory so embedded and programmatic setups can store project configs outside the default `.mastracode` path. ([#13751](https://github.com/mastra-ai/mastra/pull/13751))
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Mastra Code's `ask_user` interactive picker now wraps long option labels across multiple rows with a `↳` continuation marker, instead of truncating them at the box edge. Arrow keys still navigate item-to-item (not row-to-row), so picking remains predictable when options span multiple lines. ([#17054](https://github.com/mastra-ai/mastra/pull/17054))
|
|
12
|
+
|
|
13
|
+
- Fixed custom slash commands so unresolved @ references remain literal instead of rendering read errors. ([#17032](https://github.com/mastra-ai/mastra/pull/17032))
|
|
14
|
+
|
|
15
|
+
- Fixed Mastra Code type checking to avoid out-of-memory failures. ([#17070](https://github.com/mastra-ai/mastra/pull/17070))
|
|
16
|
+
|
|
17
|
+
- Fixed slash commands so they run immediately while the agent is active instead of being queued, while message-sending slash commands still show pending UI until accepted. ([#16790](https://github.com/mastra-ai/mastra/pull/16790))
|
|
18
|
+
|
|
19
|
+
Improved Ctrl+F follow-up queueing for slash commands and replaced synchronous git branch detection with an async version to reduce event loop blocking during streaming.
|
|
20
|
+
|
|
21
|
+
- **Fixed tool approval and other in-app keyboard shortcuts in modern terminals.** ([#17071](https://github.com/mastra-ai/mastra/pull/17071))
|
|
22
|
+
|
|
23
|
+
In iTerm2, Ghostty, WezTerm, kitty and similar terminals, pressing `y` / `n` / `a` / `Y` on the tool approval dialog did nothing. The same was true for the `r` key on `/mcp` (reload servers), the `c` key on `/threads` (clone thread), and the space / enter shortcut on multi-step progress collapse.
|
|
24
|
+
|
|
25
|
+
The root cause was the Kitty keyboard protocol that pi-tui enables on supported terminals: printable keys arrive as CSI-u escape sequences (`\x1b[121u` for `y`) instead of raw bytes, so direct character comparisons silently dropped every press. Apple Terminal.app wasn't affected because it doesn't advertise the protocol.
|
|
26
|
+
|
|
27
|
+
All four surfaces now decode their shortcut keys through pi-tui's keyboard helpers so the same press works regardless of which keyboard protocol the terminal negotiates. `Shift+y` correctly maps to the uppercase `Y` YOLO shortcut; `Ctrl+Y` and `Alt+Y` no longer alias `Y`.
|
|
28
|
+
|
|
29
|
+
- Replaced the update notification modal with an inline component so it renders in the conversation flow and is scrollable on any terminal size. Changelog entries now display their full text instead of being truncated, with natural word-wrapping inside the bordered box. ([#16920](https://github.com/mastra-ai/mastra/pull/16920))
|
|
30
|
+
|
|
31
|
+
- Added signal delivery option attributes API that conditionally merges branch `attributes` based on whether a signal is delivered to an active agent run (`ifActive.attributes`) or an idle run (`ifIdle.attributes`). This enables contextual signal delivery — for example, tagging user messages as `while-active` when the agent is actively working. ([#16923](https://github.com/mastra-ai/mastra/pull/16923))
|
|
32
|
+
|
|
33
|
+
- Fixed MastraCode observer attachment mode persistence so Auto/On/Off choices are applied consistently across thread reloads. ([#16922](https://github.com/mastra-ai/mastra/pull/16922))
|
|
34
|
+
|
|
35
|
+
- Fixed mode switching delay — Shift+Tab now updates instantly. Fixed modal lag when opening /om and /models. Fixed duplicate messages appearing when queueing with Ctrl+F. Blocked mode switching while agent is active. ([#17008](https://github.com/mastra-ai/mastra/pull/17008))
|
|
36
|
+
|
|
37
|
+
- Improved responsiveness during streaming: reduced animation and text input lag by eliminating remaining event-loop blockers. Dynamic instruction building now uses async git branch detection and parallel binary resolution, and AGENTS.md reminders render compact loaded path notices without reading instruction files during streaming. ([#16951](https://github.com/mastra-ai/mastra/pull/16951))
|
|
38
|
+
|
|
39
|
+
- Fix Mastra Code TUI crash when ask_user option labels are wider than the terminal — long labels now wrap inside the bordered box, matching how question text already wraps. Reported in #17002. ([#17005](https://github.com/mastra-ai/mastra/pull/17005))
|
|
40
|
+
|
|
41
|
+
- Route Unix socket signal PubSub traffic through per-thread socket paths under `/tmp/mc/<resourceId>/<threadId>.sock` and guard concurrent socket initialization. ([#16939](https://github.com/mastra-ai/mastra/pull/16939))
|
|
42
|
+
|
|
43
|
+
- Suppressed noisy gateway fetch errors when models.dev is unreachable. The registry no longer retries or logs errors on network failure since all model data is already bundled at publish time. ([#16984](https://github.com/mastra-ai/mastra/pull/16984))
|
|
44
|
+
|
|
45
|
+
- Updated dependencies [[`cfa2e3a`](https://github.com/mastra-ai/mastra/commit/cfa2e3a5292322f48bb28b4d257d631da7f9d3cc), [`0cbece9`](https://github.com/mastra-ai/mastra/commit/0cbece9d832cb134a74cdbf3682d390a058215a4), [`008baaf`](https://github.com/mastra-ai/mastra/commit/008baafd8d851f831407045aebead5a2e3342eff), [`2f5f58a`](https://github.com/mastra-ai/mastra/commit/2f5f58a9a8bb13bcdc6789db221eef7c9bf1ff02), [`2f5f58a`](https://github.com/mastra-ai/mastra/commit/2f5f58a9a8bb13bcdc6789db221eef7c9bf1ff02), [`7dfe1bc`](https://github.com/mastra-ai/mastra/commit/7dfe1bcfe71d261a6fd6bbf29b1dec49d78fb98f), [`ac442a4`](https://github.com/mastra-ai/mastra/commit/ac442a42fda0354ac2bcea772bf6691cb3e9dbb3), [`b7286f4`](https://github.com/mastra-ai/mastra/commit/b7286f4308267f5fd70e6bfee10dba9472640906), [`9d2c663`](https://github.com/mastra-ai/mastra/commit/9d2c663b88f5b12bc3fea1c97f40b4eeb3665df1), [`6096445`](https://github.com/mastra-ai/mastra/commit/60964459733f0ab384584d95e19c36607ffdf7b0), [`d72dc4b`](https://github.com/mastra-ai/mastra/commit/d72dc4b12d832546c05c20255fa96fe4eb515900), [`a481027`](https://github.com/mastra-ai/mastra/commit/a481027b549ba1018414990c8f045eaee7b9f413), [`1e5c067`](https://github.com/mastra-ai/mastra/commit/1e5c067d2e20a781af670578180d1ee249806d41), [`168fa09`](https://github.com/mastra-ai/mastra/commit/168fa09d6b39114cb8c13bd06f1dccb9bc81c6cd), [`df1947a`](https://github.com/mastra-ai/mastra/commit/df1947affa40f742067542251fac7ca759492ef4), [`ee59b74`](https://github.com/mastra-ai/mastra/commit/ee59b743ce73ad11784b4d9c6fbba8568edee1c8), [`a97b1a0`](https://github.com/mastra-ai/mastra/commit/a97b1a0abaed83946c3519d1e0f680d0815b8a67), [`008baaf`](https://github.com/mastra-ai/mastra/commit/008baafd8d851f831407045aebead5a2e3342eff), [`801baa0`](https://github.com/mastra-ai/mastra/commit/801baa07cccdbaec1d00942a92bdc831111744a2), [`8116436`](https://github.com/mastra-ai/mastra/commit/81164363eb225d774e41ff27da6a5ea611406688), [`c35b962`](https://github.com/mastra-ai/mastra/commit/c35b9625c7e854fcfdeee226a3338a750d0ff211), [`c27c4b9`](https://github.com/mastra-ai/mastra/commit/c27c4b9f137df5414fca4e45896aceccff6b0ed5), [`08b3b59`](https://github.com/mastra-ai/mastra/commit/08b3b590dd960dee6c9a6e39272f8927d803db6e), [`b3c3b18`](https://github.com/mastra-ai/mastra/commit/b3c3b189121489a3a51a8fd8204b569be9a89fe5), [`4084113`](https://github.com/mastra-ai/mastra/commit/408411370fc48a822e8b616b3b63f9409774e0e9), [`70cb714`](https://github.com/mastra-ai/mastra/commit/70cb7149c8f16f478e15b58498254a53181750a4), [`91cf0e0`](https://github.com/mastra-ai/mastra/commit/91cf0e027e511b871481a8576b56b7af83b15afd), [`c86f70d`](https://github.com/mastra-ai/mastra/commit/c86f70d11170c71701daf7b49366cd04d3a3f108), [`7f9da22`](https://github.com/mastra-ai/mastra/commit/7f9da22efd5aa595e138a31de55a5f0f2f28b33d)]:
|
|
46
|
+
- @mastra/core@1.37.0
|
|
47
|
+
- @mastra/memory@1.20.0
|
|
48
|
+
- @mastra/observability@1.14.0
|
|
49
|
+
- @mastra/fastembed@1.1.1
|
|
50
|
+
- @mastra/mcp@1.8.1
|
|
51
|
+
|
|
52
|
+
## 0.21.0-alpha.10
|
|
53
|
+
|
|
54
|
+
### Patch Changes
|
|
55
|
+
|
|
56
|
+
- Updated dependencies [[`d72dc4b`](https://github.com/mastra-ai/mastra/commit/d72dc4b12d832546c05c20255fa96fe4eb515900)]:
|
|
57
|
+
- @mastra/core@1.37.0-alpha.9
|
|
58
|
+
|
|
59
|
+
## 0.21.0-alpha.9
|
|
60
|
+
|
|
61
|
+
### Patch Changes
|
|
62
|
+
|
|
63
|
+
- **Fixed tool approval and other in-app keyboard shortcuts in modern terminals.** ([#17071](https://github.com/mastra-ai/mastra/pull/17071))
|
|
64
|
+
|
|
65
|
+
In iTerm2, Ghostty, WezTerm, kitty and similar terminals, pressing `y` / `n` / `a` / `Y` on the tool approval dialog did nothing. The same was true for the `r` key on `/mcp` (reload servers), the `c` key on `/threads` (clone thread), and the space / enter shortcut on multi-step progress collapse.
|
|
66
|
+
|
|
67
|
+
The root cause was the Kitty keyboard protocol that pi-tui enables on supported terminals: printable keys arrive as CSI-u escape sequences (`\x1b[121u` for `y`) instead of raw bytes, so direct character comparisons silently dropped every press. Apple Terminal.app wasn't affected because it doesn't advertise the protocol.
|
|
68
|
+
|
|
69
|
+
All four surfaces now decode their shortcut keys through pi-tui's keyboard helpers so the same press works regardless of which keyboard protocol the terminal negotiates. `Shift+y` correctly maps to the uppercase `Y` YOLO shortcut; `Ctrl+Y` and `Alt+Y` no longer alias `Y`.
|
|
70
|
+
|
|
3
71
|
## 0.21.0-alpha.8
|
|
4
72
|
|
|
5
73
|
### Patch Changes
|
|
@@ -2,7 +2,7 @@ import { tintHex, mastra, theme, getMarkdownTheme, CHAT_INDENT, BOX_INDENT, getT
|
|
|
2
2
|
import { getOAuthProviders, detectProject, DEFAULT_CONFIG_DIR, getUserId, getCurrentGitBranchAsync, getUserName, PROVIDER_DEFAULT_MODELS, getAppDataDir } from './chunk-5FT2NNFO.js';
|
|
3
3
|
import { MC_TOOLS, getToolCategory, TOOL_CATEGORIES } from './chunk-TTAAM2XR.js';
|
|
4
4
|
import { exec, spawn, execFile, execSync, execFileSync } from 'child_process';
|
|
5
|
-
import { visibleWidth, Box, Text, Spacer, Input, Container, fuzzyFilter, getKeybindings, Markdown, ProcessTerminal, TUI, Editor, matchesKey, CombinedAutocompleteProvider, SelectList, wrapTextWithAnsi, SettingsList } from '@mariozechner/pi-tui';
|
|
5
|
+
import { visibleWidth, Box, Text, Spacer, Input, Container, fuzzyFilter, getKeybindings, Markdown, ProcessTerminal, TUI, Editor, matchesKey, CombinedAutocompleteProvider, SelectList, wrapTextWithAnsi, SettingsList, parseKey } from '@mariozechner/pi-tui';
|
|
6
6
|
import chalk10 from 'chalk';
|
|
7
7
|
import fs2, { statSync, readFileSync, realpathSync, promises, unlinkSync } from 'fs';
|
|
8
8
|
import * as path5 from 'path';
|
|
@@ -1106,7 +1106,7 @@ function getInstallCommand(pm, version) {
|
|
|
1106
1106
|
}
|
|
1107
1107
|
function getCurrentVersion() {
|
|
1108
1108
|
{
|
|
1109
|
-
return "0.21.0
|
|
1109
|
+
return "0.21.0";
|
|
1110
1110
|
}
|
|
1111
1111
|
}
|
|
1112
1112
|
async function fetchLatestVersion() {
|
|
@@ -3264,6 +3264,17 @@ Example hooks.json:
|
|
|
3264
3264
|
lines.push(` /hooks reload - Reload config from disk`);
|
|
3265
3265
|
ctx.showInfo(lines.join("\n"));
|
|
3266
3266
|
}
|
|
3267
|
+
var SHIFT_LETTER_RE = /^shift\+([a-z])$/;
|
|
3268
|
+
function decodePrintableShortcut(data) {
|
|
3269
|
+
const key = parseKey(data);
|
|
3270
|
+
if (key === void 0) return void 0;
|
|
3271
|
+
if (key.length === 1) return key;
|
|
3272
|
+
const shifted = SHIFT_LETTER_RE.exec(key);
|
|
3273
|
+
if (shifted) return shifted[1].toUpperCase();
|
|
3274
|
+
return void 0;
|
|
3275
|
+
}
|
|
3276
|
+
|
|
3277
|
+
// src/tui/components/mcp-selector.ts
|
|
3267
3278
|
var CONNECTED_ACTIONS = [
|
|
3268
3279
|
{ label: "View tools", key: "tools" },
|
|
3269
3280
|
{ label: "View logs", key: "logs" },
|
|
@@ -3451,7 +3462,7 @@ var McpSelectorComponent = class extends Box {
|
|
|
3451
3462
|
if (this.selectedIndex < this.statuses.length) {
|
|
3452
3463
|
this.openSubMenu();
|
|
3453
3464
|
}
|
|
3454
|
-
} else if (data === "r") {
|
|
3465
|
+
} else if (decodePrintableShortcut(data) === "r") {
|
|
3455
3466
|
this.doReloadAll();
|
|
3456
3467
|
} else if (kb.matches(data, "tui.select.cancel")) {
|
|
3457
3468
|
this.stopPolling();
|
|
@@ -7738,6 +7749,7 @@ var ToolApprovalDialogComponent = class extends Box {
|
|
|
7738
7749
|
args;
|
|
7739
7750
|
categoryLabel;
|
|
7740
7751
|
onAction;
|
|
7752
|
+
resolved = false;
|
|
7741
7753
|
// Focusable implementation
|
|
7742
7754
|
_focused = false;
|
|
7743
7755
|
get focused() {
|
|
@@ -7808,20 +7820,31 @@ var ToolApprovalDialogComponent = class extends Box {
|
|
|
7808
7820
|
}
|
|
7809
7821
|
return lines.join("\n");
|
|
7810
7822
|
}
|
|
7823
|
+
emit(action) {
|
|
7824
|
+
if (this.resolved) return;
|
|
7825
|
+
this.resolved = true;
|
|
7826
|
+
this.onAction(action);
|
|
7827
|
+
}
|
|
7811
7828
|
handleInput(data) {
|
|
7829
|
+
if (this.resolved) return;
|
|
7812
7830
|
const kb = getKeybindings();
|
|
7813
7831
|
if (kb.matches(data, "tui.select.cancel")) {
|
|
7814
|
-
this.
|
|
7832
|
+
this.emit({ type: "decline" });
|
|
7815
7833
|
return;
|
|
7816
7834
|
}
|
|
7817
|
-
|
|
7818
|
-
|
|
7819
|
-
|
|
7820
|
-
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
|
|
7835
|
+
switch (decodePrintableShortcut(data)) {
|
|
7836
|
+
case "y":
|
|
7837
|
+
this.emit({ type: "approve" });
|
|
7838
|
+
break;
|
|
7839
|
+
case "n":
|
|
7840
|
+
this.emit({ type: "decline" });
|
|
7841
|
+
break;
|
|
7842
|
+
case "a":
|
|
7843
|
+
this.emit({ type: "always_allow_category" });
|
|
7844
|
+
break;
|
|
7845
|
+
case "Y":
|
|
7846
|
+
this.emit({ type: "yolo" });
|
|
7847
|
+
break;
|
|
7825
7848
|
}
|
|
7826
7849
|
}
|
|
7827
7850
|
render(maxWidth) {
|
|
@@ -9593,7 +9616,7 @@ var ThreadSelectorComponent = class extends Box {
|
|
|
9593
9616
|
}
|
|
9594
9617
|
} else if (kb.matches(keyData, "tui.select.cancel")) {
|
|
9595
9618
|
this.onCancelCallback();
|
|
9596
|
-
} else if (keyData === "c" && this.onCloneCallback && !this.searchInput.getValue()) {
|
|
9619
|
+
} else if (decodePrintableShortcut(keyData) === "c" && this.onCloneCallback && !this.searchInput.getValue()) {
|
|
9597
9620
|
const selected = this.filteredThreads[this.selectedIndex];
|
|
9598
9621
|
if (selected) {
|
|
9599
9622
|
this.onCloneCallback(selected);
|
|
@@ -18094,5 +18117,5 @@ Would you like to update now?`;
|
|
|
18094
18117
|
};
|
|
18095
18118
|
|
|
18096
18119
|
export { AssistantMessageComponent, LoginDialogComponent, LoginSelectorComponent, MastraTUI, ModelSelectorComponent, OMProgressComponent, ToolExecutionComponentEnhanced, UserMessageComponent, createTUIState, detectTerminalTheme, formatOMStatus, getCurrentVersion };
|
|
18097
|
-
//# sourceMappingURL=chunk-
|
|
18098
|
-
//# sourceMappingURL=chunk-
|
|
18120
|
+
//# sourceMappingURL=chunk-D6URMYIX.js.map
|
|
18121
|
+
//# sourceMappingURL=chunk-D6URMYIX.js.map
|