mastracode 0.7.0-alpha.2 → 0.8.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 CHANGED
@@ -1,5 +1,65 @@
1
1
  # mastracode
2
2
 
3
+ ## 0.8.0-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixed tool validation errors being hidden behind a generic 'see details above' message. All errors now display their actual error message consistently. ([#14168](https://github.com/mastra-ai/mastra/pull/14168))
8
+
9
+ - Updated dependencies [[`9cede11`](https://github.com/mastra-ai/mastra/commit/9cede110abac9d93072e0521bb3c8bcafb9fdadf), [`a59f126`](https://github.com/mastra-ai/mastra/commit/a59f1269104f54726699c5cdb98c72c93606d2df), [`c510833`](https://github.com/mastra-ai/mastra/commit/c5108333e8cbc19dafee5f8bfefbcb5ee935335c), [`7296fcc`](https://github.com/mastra-ai/mastra/commit/7296fcc599c876a68699a71c7054a16d5aaf2337), [`00c27f9`](https://github.com/mastra-ai/mastra/commit/00c27f9080731433230a61be69c44e39a7a7b4c7), [`977b49e`](https://github.com/mastra-ai/mastra/commit/977b49e23d8b050a2c6a6a91c0aa38b28d6388ee), [`ee19c9b`](https://github.com/mastra-ai/mastra/commit/ee19c9ba3ec3ed91feb214ad539bdc766c53bb01)]:
10
+ - @mastra/core@1.12.0-alpha.1
11
+ - @mastra/memory@1.7.0-alpha.1
12
+ - @mastra/mcp@1.2.0-alpha.0
13
+
14
+ ## 0.8.0-alpha.0
15
+
16
+ ### Minor Changes
17
+
18
+ - Added `mcpServers` option to `createMastraCode()` for programmatic MCP server configuration. Servers passed via this option are merged with file-based configs at highest priority, allowing you to define MCP servers directly in code: ([#13750](https://github.com/mastra-ai/mastra/pull/13750))
19
+
20
+ ```typescript
21
+ const { harness } = await createMastraCode({
22
+ mcpServers: {
23
+ filesystem: { command: 'npx', args: ['-y', '@modelcontextprotocol/server-filesystem', '/tmp'] },
24
+ remote: { url: 'https://mcp.example.com/sse', headers: { Authorization: 'Bearer tok' } },
25
+ },
26
+ });
27
+ ```
28
+
29
+ ### Patch Changes
30
+
31
+ - Fixed `mastracode` schema generation when running the CLI with Zod v4-compatible schemas. The CLI now produces valid object JSON Schema instead of failing on some tool input schemas. ([#14157](https://github.com/mastra-ai/mastra/pull/14157))
32
+
33
+ - Fixed /om model search in Kitty terminals so typed characters filter models again. ([#13996](https://github.com/mastra-ai/mastra/pull/13996))
34
+
35
+ - Updated dependencies [[`cddf895`](https://github.com/mastra-ai/mastra/commit/cddf895532b8ee7f9fa814136ec672f53d37a9ba), [`aede3cc`](https://github.com/mastra-ai/mastra/commit/aede3cc2a83b54bbd9e9a54c8aedcd1708b2ef87), [`c4c7dad`](https://github.com/mastra-ai/mastra/commit/c4c7dadfe2e4584f079f6c24bfabdb8c4981827f), [`b9a77b9`](https://github.com/mastra-ai/mastra/commit/b9a77b951fa6422077080b492cce74460d2f8fdd), [`45c3112`](https://github.com/mastra-ai/mastra/commit/45c31122666a0cc56b94727099fcb1871ed1b3f6), [`45c3112`](https://github.com/mastra-ai/mastra/commit/45c31122666a0cc56b94727099fcb1871ed1b3f6), [`5e7c287`](https://github.com/mastra-ai/mastra/commit/5e7c28701f2bce795dd5c811e4c3060bf2ea2242), [`7e17d3f`](https://github.com/mastra-ai/mastra/commit/7e17d3f656fdda2aad47c4beb8c491636d70820c)]:
36
+ - @mastra/core@1.12.0-alpha.0
37
+ - @mastra/mcp@1.2.0-alpha.0
38
+ - @mastra/memory@1.6.3-alpha.0
39
+
40
+ ## 0.7.0
41
+
42
+ ### Minor Changes
43
+
44
+ - Added headless non-interactive mode via `--prompt` / `-p` flag. Mastra Code can now run from scripts, CI/CD pipelines, and task orchestration systems without human interaction. All blocking interactions (tool approvals, questions, plan approvals, sandbox access) are auto-resolved. Supports `--timeout`, `--continue`, and `--format json` flags. Exit codes: 0 (success), 1 (error/aborted), 2 (timeout). ([#13648](https://github.com/mastra-ai/mastra/pull/13648))
45
+
46
+ ### Patch Changes
47
+
48
+ - Improve MastraCode image pasting for clipboard images, local image paths, and remote image URLs. ([#13953](https://github.com/mastra-ai/mastra/pull/13953))
49
+
50
+ - Improved web_search tool rendering in the TUI. Search results now display a clean list of titles and URLs with the search query in the header, instead of dumping raw JSON. ([#13870](https://github.com/mastra-ai/mastra/pull/13870))
51
+
52
+ - Improved the shell passthrough command (`! <command>`, e.g. `! ls -la`) to show output as it happens. Previously, running a command like `! ping example.com` would show nothing until the command finished. Now, stdout and stderr stream live into a bordered output box with a spinner that resolves to a success or failure indicator on completion. ([#13999](https://github.com/mastra-ai/mastra/pull/13999))
53
+
54
+ - Subagents now use the same file and command tools as the parent agent, ensuring consistent behavior across sandbox environments and workspaces. ([#13940](https://github.com/mastra-ai/mastra/pull/13940))
55
+
56
+ - Updated dependencies [[`4f71b43`](https://github.com/mastra-ai/mastra/commit/4f71b436a4a6b8839842d8da47b57b84509af56c), [`a070277`](https://github.com/mastra-ai/mastra/commit/a07027766ce195ba74d0783116d894cbab25d44c), [`b628b91`](https://github.com/mastra-ai/mastra/commit/b628b9128b372c0f54214d902b07279f03443900), [`332c014`](https://github.com/mastra-ai/mastra/commit/332c014e076b81edf7fe45b58205882726415e90), [`6b63153`](https://github.com/mastra-ai/mastra/commit/6b63153878ea841c0f4ce632ba66bb33e57e9c1b), [`c2d7a7c`](https://github.com/mastra-ai/mastra/commit/c2d7a7c48d89245188c81a9a436ad8b1d9f3872d), [`4246e34`](https://github.com/mastra-ai/mastra/commit/4246e34cec9c26636d0965942268e6d07c346671), [`b8837ee`](https://github.com/mastra-ai/mastra/commit/b8837ee77e2e84197609762bfabd8b3da326d30c), [`866cc2c`](https://github.com/mastra-ai/mastra/commit/866cc2cb1f0e3b314afab5194f69477fada745d1), [`5d950f7`](https://github.com/mastra-ai/mastra/commit/5d950f7bf426a215a1808f0abef7de5c8336ba1c), [`d3ad589`](https://github.com/mastra-ai/mastra/commit/d3ad589a39e66bb783513c4bbf912246bdf18c22), [`28c85b1`](https://github.com/mastra-ai/mastra/commit/28c85b184fc32b40f7f160483c982da6d388ecbd), [`e9a08fb`](https://github.com/mastra-ai/mastra/commit/e9a08fbef1ada7e50e961e2f54f55e8c10b4a45c), [`57c7391`](https://github.com/mastra-ai/mastra/commit/57c739108b9a6c9160352f0468dfe0428c03a234), [`1d0a8a8`](https://github.com/mastra-ai/mastra/commit/1d0a8a8acf33203d5744fc429b090ad8598aa8ed), [`18d91c3`](https://github.com/mastra-ai/mastra/commit/18d91c3b6e905cfd3ba50e7c7dc81164b6aa69ad), [`631ffd8`](https://github.com/mastra-ai/mastra/commit/631ffd82fed108648b448b28e6a90e38c5f53bf5), [`6bcbf8a`](https://github.com/mastra-ai/mastra/commit/6bcbf8a6774d5a53b21d61db8a45ce2593ca1616), [`aae2295`](https://github.com/mastra-ai/mastra/commit/aae2295838a2d329ad6640829e87934790ffe5b8), [`aa61f29`](https://github.com/mastra-ai/mastra/commit/aa61f29ff8095ce46a4ae16e46c4d8c79b2b685b), [`7ff3714`](https://github.com/mastra-ai/mastra/commit/7ff37148515439bb3be009a60e02c3e363299760), [`18c3a90`](https://github.com/mastra-ai/mastra/commit/18c3a90c9e48cf69500e308affeb8eba5860b2af), [`41d79a1`](https://github.com/mastra-ai/mastra/commit/41d79a14bd8cb6de1e2565fd0a04786bae2f211b), [`f35487b`](https://github.com/mastra-ai/mastra/commit/f35487bb2d46c636e22aa71d90025613ae38235a), [`6dc2192`](https://github.com/mastra-ai/mastra/commit/6dc21921aef0f0efab15cd0805fa3d18f277a76f), [`eeb3a3f`](https://github.com/mastra-ai/mastra/commit/eeb3a3f43aca10cf49479eed2a84b7d9ecea02ba), [`e673376`](https://github.com/mastra-ai/mastra/commit/e6733763ad1321aa7e5ae15096b9c2104f93b1f3), [`05f8d90`](https://github.com/mastra-ai/mastra/commit/05f8d9009290ce6aa03428b3add635268615db85), [`b2204c9`](https://github.com/mastra-ai/mastra/commit/b2204c98a42848bbfb6f0440f005dc2b6354f1cd), [`a1bf1e3`](https://github.com/mastra-ai/mastra/commit/a1bf1e385ed4c0ef6f11b56c5887442970d127f2), [`b6f647a`](https://github.com/mastra-ai/mastra/commit/b6f647ae2388e091f366581595feb957e37d5b40), [`0c57b8b`](https://github.com/mastra-ai/mastra/commit/0c57b8b0a69a97b5a4ae3f79be6c610f29f3cf7b), [`b081f27`](https://github.com/mastra-ai/mastra/commit/b081f272cf411716e1d6bd72ceac4bcee2657b19), [`4b8da97`](https://github.com/mastra-ai/mastra/commit/4b8da97a5ce306e97869df6c39535d9069e563db), [`682b7f7`](https://github.com/mastra-ai/mastra/commit/682b7f773b7940687ef22569e720fd4bc4fdb8fe), [`0c09eac`](https://github.com/mastra-ai/mastra/commit/0c09eacb1926f64cfdc9ae5c6d63385cf8c9f72c), [`6b9b93d`](https://github.com/mastra-ai/mastra/commit/6b9b93d6f459d1ba6e36f163abf62a085ddb3d64), [`d3ad589`](https://github.com/mastra-ai/mastra/commit/d3ad589a39e66bb783513c4bbf912246bdf18c22), [`b6f647a`](https://github.com/mastra-ai/mastra/commit/b6f647ae2388e091f366581595feb957e37d5b40), [`31b6067`](https://github.com/mastra-ai/mastra/commit/31b6067d0cc3ab10e1b29c36147f3b5266bc714a), [`797ac42`](https://github.com/mastra-ai/mastra/commit/797ac4276de231ad2d694d9aeca75980f6cd0419), [`0423bf4`](https://github.com/mastra-ai/mastra/commit/0423bf4292bd494565ef631bc4f2cc7b86b27390), [`0bc289e`](https://github.com/mastra-ai/mastra/commit/0bc289e2d476bf46c5b91c21969e8d0c6864691c), [`9b75a06`](https://github.com/mastra-ai/mastra/commit/9b75a06e53ebb0b950ba7c1e83a0142047185f46), [`4c3a1b1`](https://github.com/mastra-ai/mastra/commit/4c3a1b122ea083e003d71092f30f3b31680b01c0), [`256df35`](https://github.com/mastra-ai/mastra/commit/256df3571d62beb3ad4971faa432927cc140e603), [`b8837ee`](https://github.com/mastra-ai/mastra/commit/b8837ee77e2e84197609762bfabd8b3da326d30c), [`0c57b8b`](https://github.com/mastra-ai/mastra/commit/0c57b8b0a69a97b5a4ae3f79be6c610f29f3cf7b), [`85cc3b3`](https://github.com/mastra-ai/mastra/commit/85cc3b3b6f32ae4b083c26498f50d5b250ba944b), [`3ebdadf`](https://github.com/mastra-ai/mastra/commit/3ebdadfe517d16f29464f35baba8356771160369), [`d567299`](https://github.com/mastra-ai/mastra/commit/d567299cf81e02bd9d5221d4bc05967d6c224161), [`97ea28c`](https://github.com/mastra-ai/mastra/commit/97ea28c746e9e4147d56047bbb1c4a92417a3fec), [`d567299`](https://github.com/mastra-ai/mastra/commit/d567299cf81e02bd9d5221d4bc05967d6c224161), [`716ffe6`](https://github.com/mastra-ai/mastra/commit/716ffe68bed81f7c2690bc8581b9e140f7bf1c3d), [`8296332`](https://github.com/mastra-ai/mastra/commit/8296332de21c16e3dfc3d0b2d615720a6dc88f2f), [`4df2116`](https://github.com/mastra-ai/mastra/commit/4df211619dd922c047d396ca41cd7027c8c4c8e7), [`2219c1a`](https://github.com/mastra-ai/mastra/commit/2219c1acbd21da116da877f0036ffb985a9dd5a3), [`17c4145`](https://github.com/mastra-ai/mastra/commit/17c4145166099354545582335b5252bdfdfd908b)]:
57
+ - @mastra/core@1.11.0
58
+ - @mastra/libsql@1.7.0
59
+ - @mastra/pg@1.8.0
60
+ - @mastra/memory@1.6.2
61
+ - @mastra/mcp@1.1.0
62
+
3
63
  ## 0.7.0-alpha.2
4
64
 
5
65
  ### Patch Changes
@@ -726,7 +726,7 @@ function getInstallCommand(pm, version) {
726
726
  }
727
727
  function getCurrentVersion() {
728
728
  {
729
- return "0.7.0-alpha.2";
729
+ return "0.8.0-alpha.1";
730
730
  }
731
731
  }
732
732
  async function fetchLatestVersion() {
@@ -3774,6 +3774,35 @@ function parseTokenInput(input) {
3774
3774
  }
3775
3775
  return num;
3776
3776
  }
3777
+ var KITTY_CSI_U_REGEX = new RegExp("^\\x1b\\[(\\d+)(?::(\\d*))?(?::(\\d+))?(?:;(\\d+))?(?::(\\d+))?u$");
3778
+ var KITTY_MOD_SHIFT = 1;
3779
+ var KITTY_MOD_ALT = 2;
3780
+ var KITTY_MOD_CTRL = 4;
3781
+ function decodeKittyPrintable(data) {
3782
+ const match = data.match(KITTY_CSI_U_REGEX);
3783
+ if (!match) return void 0;
3784
+ const codepoint = Number.parseInt(match[1] ?? "", 10);
3785
+ if (!Number.isFinite(codepoint)) return void 0;
3786
+ const shiftedKey = match[2] && match[2].length > 0 ? Number.parseInt(match[2], 10) : void 0;
3787
+ const modValue = match[4] ? Number.parseInt(match[4], 10) : 1;
3788
+ const modifier = Number.isFinite(modValue) ? modValue - 1 : 0;
3789
+ if ((modifier & -194) !== 0) return void 0;
3790
+ if (modifier & (KITTY_MOD_ALT | KITTY_MOD_CTRL)) return void 0;
3791
+ let effectiveCodepoint = codepoint;
3792
+ if (modifier & KITTY_MOD_SHIFT && typeof shiftedKey === "number") {
3793
+ effectiveCodepoint = shiftedKey;
3794
+ }
3795
+ if (!Number.isFinite(effectiveCodepoint) || effectiveCodepoint < 32) return void 0;
3796
+ try {
3797
+ return String.fromCodePoint(effectiveCodepoint);
3798
+ } catch {
3799
+ return void 0;
3800
+ }
3801
+ }
3802
+ function normalizeSearchInput(data) {
3803
+ const kittyPrintable = decodeKittyPrintable(data);
3804
+ return kittyPrintable ?? data;
3805
+ }
3777
3806
  var ThresholdSubmenu = class extends piTui.Container {
3778
3807
  input;
3779
3808
  selectList;
@@ -3909,7 +3938,8 @@ var ModelSelectSubmenu = class extends piTui.Container {
3909
3938
  } else if (kb.matches(data, "selectCancel")) {
3910
3939
  this.onCancel();
3911
3940
  } else {
3912
- this.searchInput.handleInput(data);
3941
+ const normalized = normalizeSearchInput(data);
3942
+ this.searchInput.handleInput(normalized);
3913
3943
  this.filterModels(this.searchInput.getValue());
3914
3944
  this.tui.requestRender();
3915
3945
  }
@@ -5226,26 +5256,17 @@ function showFormattedError(state, event) {
5226
5256
  const error = "error" in event ? event.error : event;
5227
5257
  const parsed = parseError(error);
5228
5258
  state.chatContainer.addChild(new piTui.Spacer(1));
5229
- const errorMessage = error.message || String(error);
5230
- const isValidationError = errorMessage.toLowerCase().includes("validation failed") || errorMessage.toLowerCase().includes("required parameter") || errorMessage.includes("Required");
5231
- if (isValidationError) {
5232
- state.chatContainer.addChild(new piTui.Text(chunk3ZIPVVJW_cjs.theme.fg("error", "Tool validation error - see details above"), 1, 0));
5233
- state.chatContainer.addChild(
5234
- new piTui.Text(chunk3ZIPVVJW_cjs.theme.fg("muted", " Check the tool execution box for specific parameter requirements"), 1, 0)
5235
- );
5236
- } else {
5237
- let errorText = `Error: ${parsed.message}`;
5238
- const retryable = "retryable" in event ? event.retryable : parsed.retryable;
5239
- const retryDelay = "retryDelay" in event ? event.retryDelay : parsed.retryDelay;
5240
- if (retryable && retryDelay) {
5241
- const seconds = Math.ceil(retryDelay / 1e3);
5242
- errorText += chunk3ZIPVVJW_cjs.theme.fg("muted", ` (retry in ${seconds}s)`);
5243
- }
5244
- state.chatContainer.addChild(new piTui.Text(chunk3ZIPVVJW_cjs.theme.fg("error", errorText), 1, 0));
5245
- const hint = getErrorHint(parsed.type);
5246
- if (hint) {
5247
- state.chatContainer.addChild(new piTui.Text(chunk3ZIPVVJW_cjs.theme.fg("muted", ` Hint: ${hint}`), 1, 0));
5248
- }
5259
+ let errorText = `Error: ${parsed.message}`;
5260
+ const retryable = "retryable" in event ? event.retryable : parsed.retryable;
5261
+ const retryDelay = "retryDelay" in event ? event.retryDelay : parsed.retryDelay;
5262
+ if (retryable && retryDelay) {
5263
+ const seconds = Math.ceil(retryDelay / 1e3);
5264
+ errorText += chunk3ZIPVVJW_cjs.theme.fg("muted", ` (retry in ${seconds}s)`);
5265
+ }
5266
+ state.chatContainer.addChild(new piTui.Text(chunk3ZIPVVJW_cjs.theme.fg("error", errorText), 1, 0));
5267
+ const hint = getErrorHint(parsed.type);
5268
+ if (hint) {
5269
+ state.chatContainer.addChild(new piTui.Text(chunk3ZIPVVJW_cjs.theme.fg("muted", ` Hint: ${hint}`), 1, 0));
5249
5270
  }
5250
5271
  state.ui.requestRender();
5251
5272
  }
@@ -10898,5 +10919,5 @@ exports.createTUIState = createTUIState;
10898
10919
  exports.detectTerminalTheme = detectTerminalTheme;
10899
10920
  exports.formatOMStatus = formatOMStatus;
10900
10921
  exports.getCurrentVersion = getCurrentVersion;
10901
- //# sourceMappingURL=chunk-CFG5FPV7.cjs.map
10902
- //# sourceMappingURL=chunk-CFG5FPV7.cjs.map
10922
+ //# sourceMappingURL=chunk-7NVPXQWD.cjs.map
10923
+ //# sourceMappingURL=chunk-7NVPXQWD.cjs.map