mastracode 0.12.1-alpha.4 → 0.12.2-alpha.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 CHANGED
@@ -1,5 +1,25 @@
1
1
  # mastracode
2
2
 
3
+ ## 0.12.2-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Added collapsible output for shell passthrough (! commands). Output now defaults to 20 lines with Ctrl+E to expand/collapse, matching the existing tool call output behavior. ([#15092](https://github.com/mastra-ai/mastra/pull/15092))
8
+
9
+ - Updated dependencies [[`ef94400`](https://github.com/mastra-ai/mastra/commit/ef9440049402596b31f2ab976c5e4508f6cb6c91)]:
10
+ - @mastra/core@1.24.1-alpha.0
11
+
12
+ ## 0.12.1
13
+
14
+ ### Patch Changes
15
+
16
+ - Added support for Agent Skills spec directories (.agents/skills/) for skill discovery, both project-local and global (~/.agents/skills/) ([#15151](https://github.com/mastra-ai/mastra/pull/15151))
17
+
18
+ - Updated dependencies [[`8db7663`](https://github.com/mastra-ai/mastra/commit/8db7663c9a9c735828094c359d2e327fd4f8fba3), [`60b7d4a`](https://github.com/mastra-ai/mastra/commit/60b7d4a428c6caeca94f4740978359bb40c4ab37), [`ba6fa9c`](https://github.com/mastra-ai/mastra/commit/ba6fa9cc0f3e1912c49fd70d4c3bb8c44903ddaa), [`153e864`](https://github.com/mastra-ai/mastra/commit/153e86476b425db7cd0dc8490050096e92964a38), [`f308d62`](https://github.com/mastra-ai/mastra/commit/f308d6206a083eeaccbca782be062c57076935d7), [`715710d`](https://github.com/mastra-ai/mastra/commit/715710d12fa47cf88e09d41f13843eddc29327b0), [`378c6c4`](https://github.com/mastra-ai/mastra/commit/378c6c4755726e8d8cf83a14809b350b90d46c62), [`9f91fd5`](https://github.com/mastra-ai/mastra/commit/9f91fd538ab2a44f8cc740bcad8e51205f74fbea), [`ba6fa9c`](https://github.com/mastra-ai/mastra/commit/ba6fa9cc0f3e1912c49fd70d4c3bb8c44903ddaa), [`6f714ec`](https://github.com/mastra-ai/mastra/commit/6f714ec9a5614222761fd6ea3d53af1da9ab6034), [`98209a0`](https://github.com/mastra-ai/mastra/commit/98209a03c35c5479c25cca26ee0c63eff81e6d74), [`2bdb5fd`](https://github.com/mastra-ai/mastra/commit/2bdb5fd887bfd81bdb71c4a5db22a4fda99f2591)]:
19
+ - @mastra/core@1.24.0
20
+ - @mastra/memory@1.15.0
21
+ - @mastra/mcp@1.4.2
22
+
3
23
  ## 0.12.1-alpha.4
4
24
 
5
25
  ### Patch Changes
@@ -878,7 +878,7 @@ function getInstallCommand(pm, version) {
878
878
  }
879
879
  function getCurrentVersion() {
880
880
  {
881
- return "0.12.1-alpha.4";
881
+ return "0.12.2-alpha.0";
882
882
  }
883
883
  }
884
884
  async function fetchLatestVersion() {
@@ -2241,7 +2241,9 @@ function handleNewCommand(ctx) {
2241
2241
  state.chatContainer.clear();
2242
2242
  state.pendingTools.clear();
2243
2243
  state.allToolComponents = [];
2244
+ state.allSlashCommandComponents = [];
2244
2245
  state.allSystemReminderComponents = [];
2246
+ state.allShellComponents = [];
2245
2247
  state.harness.getDisplayState().modifiedFiles.clear();
2246
2248
  if (state.taskProgress) {
2247
2249
  state.taskProgress.updateTasks([]);
@@ -2312,6 +2314,7 @@ async function resetUIAfterClone(ctx, clonedTitle) {
2312
2314
  state.pendingTools.clear();
2313
2315
  state.allToolComponents = [];
2314
2316
  state.allSystemReminderComponents = [];
2317
+ state.allShellComponents = [];
2315
2318
  state.harness.getDisplayState().modifiedFiles.clear();
2316
2319
  if (state.taskProgress) {
2317
2320
  state.taskProgress.updateTasks([]);
@@ -2379,6 +2382,7 @@ async function handleResourceCommand(ctx, args) {
2379
2382
  state.pendingTools.clear();
2380
2383
  state.allToolComponents = [];
2381
2384
  state.allSystemReminderComponents = [];
2385
+ state.allShellComponents = [];
2382
2386
  state.pendingNewThread = false;
2383
2387
  await ctx.renderExistingMessages();
2384
2388
  ctx.showInfo(
@@ -2389,6 +2393,7 @@ async function handleResourceCommand(ctx, args) {
2389
2393
  state.pendingTools.clear();
2390
2394
  state.allToolComponents = [];
2391
2395
  state.allSystemReminderComponents = [];
2396
+ state.allShellComponents = [];
2392
2397
  state.pendingNewThread = true;
2393
2398
  ctx.showInfo(
2394
2399
  sub === "reset" ? `Resource ID reset to: ${defaultId} (no existing threads, a new one will be created)` : `Switched to resource: ${newId} (no existing threads, a new one will be created)`
@@ -2911,6 +2916,7 @@ async function handleThreadsCommand(ctx) {
2911
2916
  state.chatContainer.clear();
2912
2917
  state.allToolComponents = [];
2913
2918
  state.allSystemReminderComponents = [];
2919
+ state.allShellComponents = [];
2914
2920
  state.pendingTools.clear();
2915
2921
  await ctx.renderExistingMessages();
2916
2922
  ctx.showInfo(`Switched to: ${thread.title || thread.id}`);
@@ -6719,6 +6725,9 @@ function pruneChatContainer(state) {
6719
6725
  );
6720
6726
  state.allSlashCommandComponents = state.allSlashCommandComponents.filter((component) => !removed.has(component));
6721
6727
  state.allSystemReminderComponents = state.allSystemReminderComponents.filter((component) => !removed.has(component));
6728
+ state.allShellComponents = state.allShellComponents.filter(
6729
+ (component) => !removed.has(component)
6730
+ );
6722
6731
  }
6723
6732
 
6724
6733
  // src/tui/handlers/agent-lifecycle.ts
@@ -10700,6 +10709,7 @@ async function renderExistingMessages(state) {
10700
10709
  state.allToolComponents = [];
10701
10710
  state.allSlashCommandComponents = [];
10702
10711
  state.allSystemReminderComponents = [];
10712
+ state.allShellComponents = [];
10703
10713
  let previousTasksAcc = [];
10704
10714
  for (const message of messages) {
10705
10715
  if (message.role === "user") {
@@ -11174,6 +11184,9 @@ function setupKeyboardShortcuts(state, callbacks) {
11174
11184
  for (const reminder of state.allSystemReminderComponents) {
11175
11185
  reminder.setExpanded(state.toolOutputExpanded);
11176
11186
  }
11187
+ for (const shell of state.allShellComponents) {
11188
+ shell.setExpanded(state.toolOutputExpanded);
11189
+ }
11177
11190
  state.ui.requestRender();
11178
11191
  });
11179
11192
  state.editor.onAction("cycleMode", async () => {
@@ -11444,6 +11457,7 @@ async function renderExistingTasks(state) {
11444
11457
  }
11445
11458
  }
11446
11459
  var MAX_LINES = 200;
11460
+ var COLLAPSED_LINES3 = 20;
11447
11461
  function truncateAnsi3(str, maxWidth) {
11448
11462
  const plain = stripAnsi(str);
11449
11463
  if (plain.length <= maxWidth) return str;
@@ -11487,6 +11501,7 @@ var ShellStreamComponent = class extends Container {
11487
11501
  trailingPartial = "";
11488
11502
  exitCode;
11489
11503
  startTime = Date.now();
11504
+ expanded = false;
11490
11505
  constructor(command) {
11491
11506
  super();
11492
11507
  this.command = command;
@@ -11502,6 +11517,13 @@ var ShellStreamComponent = class extends Container {
11502
11517
  }
11503
11518
  this.rebuild();
11504
11519
  }
11520
+ setExpanded(expanded) {
11521
+ this.expanded = expanded;
11522
+ this.rebuild();
11523
+ }
11524
+ isExpanded() {
11525
+ return this.expanded;
11526
+ }
11505
11527
  finish(exitCode) {
11506
11528
  if (this.trailingPartial) {
11507
11529
  this.lines.push(this.trailingPartial);
@@ -11530,10 +11552,18 @@ var ShellStreamComponent = class extends Container {
11530
11552
  }
11531
11553
  while (displayLines.length > 0 && displayLines[0] === "") displayLines.shift();
11532
11554
  if (displayLines.length > 0) {
11533
- const borderedLines = displayLines.map((line) => {
11534
- const truncated = truncateAnsi3(line, maxLineWidth);
11535
- return border("\u2502") + " " + truncated;
11555
+ const maxVisible = this.expanded ? MAX_LINES : COLLAPSED_LINES3;
11556
+ const truncated = displayLines.length > maxVisible;
11557
+ const visibleLines = truncated ? displayLines.slice(-maxVisible) : displayLines;
11558
+ const borderedLines = visibleLines.map((line) => {
11559
+ const truncatedLine = truncateAnsi3(line, maxLineWidth);
11560
+ return border("\u2502") + " " + truncatedLine;
11536
11561
  });
11562
+ if (truncated) {
11563
+ const remaining = displayLines.length - maxVisible;
11564
+ const action = this.expanded ? "collapse" : "expand";
11565
+ borderedLines.push(border("\u2502") + " " + theme.fg("muted", `... ${remaining} more lines (Ctrl+E to ${action})`));
11566
+ }
11537
11567
  const displayOutput = borderedLines.join("\n");
11538
11568
  if (displayOutput.trim()) {
11539
11569
  this.addChild(new Text(displayOutput, 0, 0));
@@ -11554,6 +11584,10 @@ async function handleShellPassthrough(state, command) {
11554
11584
  return;
11555
11585
  }
11556
11586
  const component = new ShellStreamComponent(command);
11587
+ if (state.toolOutputExpanded) {
11588
+ component.setExpanded(true);
11589
+ }
11590
+ state.allShellComponents.push(component);
11557
11591
  state.chatContainer.addChild(component);
11558
11592
  state.ui.requestRender();
11559
11593
  try {
@@ -12215,6 +12249,7 @@ function createTUIState(options) {
12215
12249
  allToolComponents: [],
12216
12250
  allSlashCommandComponents: [],
12217
12251
  allSystemReminderComponents: [],
12252
+ allShellComponents: [],
12218
12253
  pendingSubagents: /* @__PURE__ */ new Map(),
12219
12254
  toolOutputExpanded: false,
12220
12255
  hideThinkingBlock: true,
@@ -13098,5 +13133,5 @@ var LoginSelectorComponent = class extends Box {
13098
13133
  };
13099
13134
 
13100
13135
  export { AssistantMessageComponent, LoginDialogComponent, LoginSelectorComponent, MastraTUI, ModelSelectorComponent, OMProgressComponent, ToolExecutionComponentEnhanced, UserMessageComponent, createTUIState, detectTerminalTheme, formatOMStatus, getCurrentVersion };
13101
- //# sourceMappingURL=chunk-GCZLXMNR.js.map
13102
- //# sourceMappingURL=chunk-GCZLXMNR.js.map
13136
+ //# sourceMappingURL=chunk-Q2D3N3LV.js.map
13137
+ //# sourceMappingURL=chunk-Q2D3N3LV.js.map