mastracode 0.50.0 → 0.50.1-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,33 @@
1
1
  # mastracode
2
2
 
3
+ ## 0.50.1-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixed `ask_user` questions not firing permission hooks. A pending question now fires `PermissionRequest` with `permission_kind: "ask_question"`, and answering or skipping it fires `PermissionResult` with decision `answered` or `dismissed`. Integrations that show a blocked state for approvals, such as terminal multiplexers, now also show it while a question waits for an answer. ([#30301](https://github.com/mastra-ai/mastra/pull/30301))
8
+
9
+ `PermissionResult` now reports the `run_id` of its `PermissionRequest`. With background tools enabled, the result was previously dropped when the user answered after the suspended run had ended.
10
+
11
+ - Improved the error shown when a provider blocks a request. The CLI now suggests retrying, rephrasing, or switching models instead of only saying the content was filtered. ([#30294](https://github.com/mastra-ai/mastra/pull/30294))
12
+
13
+ - Updated dependencies [[`2788a6d`](https://github.com/mastra-ai/mastra/commit/2788a6d959ec16c454d1ac6564d546f47be8f1eb), [`be9831d`](https://github.com/mastra-ai/mastra/commit/be9831d78983cace224cc60b617dcbbef993c6b6), [`1bac054`](https://github.com/mastra-ai/mastra/commit/1bac054f7a9089d112f2b4732caef0fe9801df71), [`f51098e`](https://github.com/mastra-ai/mastra/commit/f51098e60cbb47a9eac5e458d6d85cd4ef162926), [`51c340a`](https://github.com/mastra-ai/mastra/commit/51c340a7824530b348e157cb6f71094522e2b5c2), [`2788a6d`](https://github.com/mastra-ai/mastra/commit/2788a6d959ec16c454d1ac6564d546f47be8f1eb), [`0d22884`](https://github.com/mastra-ai/mastra/commit/0d228849b8c6867938860fb19a1e92a0a8c77f27), [`7b646a0`](https://github.com/mastra-ai/mastra/commit/7b646a07a8da8aa84ca2a0a4564369c9d2462af5), [`51c340a`](https://github.com/mastra-ai/mastra/commit/51c340a7824530b348e157cb6f71094522e2b5c2), [`7fd6830`](https://github.com/mastra-ai/mastra/commit/7fd6830a26ac38060fa02675b2daef82f2c0ef2e), [`99ec3bd`](https://github.com/mastra-ai/mastra/commit/99ec3bd582a79d85d4c0c09b50ed9ed0830c79d5), [`70f3eba`](https://github.com/mastra-ai/mastra/commit/70f3eba5ecb9870d21582455fb55137663766d50), [`a21d692`](https://github.com/mastra-ai/mastra/commit/a21d69244449f1d478ccb4b7b548e0e0bd202947), [`cb5f3a5`](https://github.com/mastra-ai/mastra/commit/cb5f3a5c7964e9304c9b2a9141ab971158fe16d4), [`af1d6bd`](https://github.com/mastra-ai/mastra/commit/af1d6bdfd25b5ad9c640802585d0478d6f79f00a), [`8ac8822`](https://github.com/mastra-ai/mastra/commit/8ac88228d67a5b3987084adeb40364a333347c97), [`3c1b528`](https://github.com/mastra-ai/mastra/commit/3c1b528b6eadf54528931e299e98f592a5d3e302), [`6d14d0e`](https://github.com/mastra-ai/mastra/commit/6d14d0edc4fb03e800d8d86e7e7fa00bf3943b56), [`8559e74`](https://github.com/mastra-ai/mastra/commit/8559e74767d2baf74e29f408e5dfa41a0d1007b0), [`7b9130f`](https://github.com/mastra-ai/mastra/commit/7b9130f50ec0d68daae4ef11bbfaf2d3bc9454ed), [`0278a5c`](https://github.com/mastra-ai/mastra/commit/0278a5ce834fad3cced73cfd19336a34d1bc8f10), [`ddb52d5`](https://github.com/mastra-ai/mastra/commit/ddb52d535d646870311766e6736efe17e7df5b65), [`a86a47c`](https://github.com/mastra-ai/mastra/commit/a86a47c7ef92aa3a48b6663336235a43b7535aaa), [`8559e74`](https://github.com/mastra-ai/mastra/commit/8559e74767d2baf74e29f408e5dfa41a0d1007b0), [`8559e74`](https://github.com/mastra-ai/mastra/commit/8559e74767d2baf74e29f408e5dfa41a0d1007b0), [`7b646a0`](https://github.com/mastra-ai/mastra/commit/7b646a07a8da8aa84ca2a0a4564369c9d2462af5), [`8acea4c`](https://github.com/mastra-ai/mastra/commit/8acea4cc5b97dcfd1e1179f9b40ca34c05f255cf)]:
14
+ - @mastra/libsql@1.30.1-alpha.0
15
+ - @mastra/code-sdk@1.19.1-alpha.1
16
+ - @mastra/core@1.84.0-alpha.1
17
+ - @mastra/observability@1.24.1-alpha.0
18
+ - @mastra/memory@1.41.2-alpha.0
19
+ - @mastra/pg@1.36.1-alpha.0
20
+ - @mastra/mcp@2.9.0
21
+
22
+ ## 0.50.1-alpha.0
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies [[`be818ec`](https://github.com/mastra-ai/mastra/commit/be818ecb53fbbc6715511d08a8f845a5bd361c4c), [`175b4b5`](https://github.com/mastra-ai/mastra/commit/175b4b5194bd74d82a79c2567aec44ef0cfafa80), [`5266060`](https://github.com/mastra-ai/mastra/commit/5266060ccd0766a14b94109dc4bc9c3d29a1b8f5), [`175b4b5`](https://github.com/mastra-ai/mastra/commit/175b4b5194bd74d82a79c2567aec44ef0cfafa80), [`9abbec6`](https://github.com/mastra-ai/mastra/commit/9abbec671ccf0826550241d1f1c2d7ff89e5b95b)]:
27
+ - @mastra/github-signals@0.5.3-alpha.0
28
+ - @mastra/core@1.84.0-alpha.0
29
+ - @mastra/code-sdk@1.19.1-alpha.0
30
+
3
31
  ## 0.50.0
4
32
 
5
33
  ### Minor Changes
package/dist/cli.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const require_tui = require("./tui-BTQZwEmk.cjs");
2
+ const require_tui = require("./tui-edzCSg8-.cjs");
3
3
  let _mastra_code_sdk = require("@mastra/code-sdk");
4
4
  let child_process = require("child_process");
5
5
  let fs = require("fs");
@@ -265,7 +265,7 @@ async function runUpdateCommand({ args = [], output = process.stdout, errorOutpu
265
265
  }
266
266
  // src/version.ts
267
267
  function getCurrentVersion() {
268
- return "0.50.0";
268
+ return "0.50.1-alpha.1";
269
269
  }
270
270
  /** Whether the invocation is `mastracode --version` or `mastracode -v`. */
271
271
  function isVersionCommand(argv) {
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { D as closeActiveBrowser, E as activeBrowserGeneration, O as discardBrowser, T as TUI_CO_AUTHOR, _ as normalizeThemePreference, a as formatUpdateHeader, g as applyThemePreference, i as formatUpToDate, k as replaceActiveBrowser, n as formatInstallingLabel, o as formatUpdateOutcome, r as formatRegistryError, t as MastraTUI } from "./tui-B0cnvlSQ.js";
2
+ import { D as closeActiveBrowser, E as activeBrowserGeneration, O as discardBrowser, T as TUI_CO_AUTHOR, _ as normalizeThemePreference, a as formatUpdateHeader, g as applyThemePreference, i as formatUpToDate, k as replaceActiveBrowser, n as formatInstallingLabel, o as formatUpdateOutcome, r as formatRegistryError, t as MastraTUI } from "./tui-t0Xga0co.js";
3
3
  import { createMastraCode, resolveSubagentsSetting } from "@mastra/code-sdk";
4
4
  import { spawn } from "child_process";
5
5
  import fs from "fs";
@@ -264,7 +264,7 @@ async function runUpdateCommand({ args = [], output = process.stdout, errorOutpu
264
264
  }
265
265
  // src/version.ts
266
266
  function getCurrentVersion() {
267
- return "0.50.0";
267
+ return "0.50.1-alpha.1";
268
268
  }
269
269
  /** Whether the invocation is `mastracode --version` or `mastracode -v`. */
270
270
  function isVersionCommand(argv) {
@@ -3,7 +3,7 @@ name: mastracode
3
3
  description: Documentation for mastracode. Use when working with mastracode APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "mastracode"
6
- version: "0.50.0"
6
+ version: "0.50.1-alpha.1"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.50.0",
2
+ "version": "0.50.1-alpha.1",
3
3
  "package": "mastracode",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -1 +1 @@
1
- {"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../src/tui/display.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAM1E,OAAO,KAAK,EAAoB,kBAAkB,EAAE,MAAM,aAAa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7F"}
@@ -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;AAS/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,CA4Kf;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,CAuDf;AAyFD,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,mBAAmB,EACxB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC,CAuMf"}
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;AAS/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,CA8Kf;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,CAuDf;AAyFD,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,mBAAmB,EACxB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC,CAuMf"}
@@ -5988,6 +5988,7 @@ function getErrorHint(errorType) {
5988
5988
  case "auth": return "Use /connect to authenticate with a provider";
5989
5989
  case "model_not_found": return "Use /model to select a different model";
5990
5990
  case "context_length": return "Use /new to start a fresh conversation";
5991
+ case "content_filter": return "Retry, rephrase, or use /model to switch models";
5991
5992
  case "rate_limit": return "Wait a moment and try again";
5992
5993
  case "quota": return "Check the provider account's billing or usage allowance, or switch to another account";
5993
5994
  case "network": return "Check your internet connection";
@@ -6075,6 +6076,7 @@ function runPermissionHooksForEvent(state, event) {
6075
6076
  if (event.type === "tool_suspended") {
6076
6077
  const payload = event.suspendPayload ?? {};
6077
6078
  if (event.toolName === "request_access" || payload.kind === "sandbox_access_request") hookMgr.runPermissionRequest("sandbox_access", event.toolCallId, event.toolName, payload).catch(() => {});
6079
+ else if (event.toolName === "ask_user") hookMgr.runPermissionRequest("ask_question", event.toolCallId, event.toolName, payload).catch(() => {});
6078
6080
  else if (event.toolName === "submit_plan") hookMgr.runPermissionRequest("plan_approval", event.toolCallId, event.toolName, payload).catch(() => {});
6079
6081
  }
6080
6082
  } catch (err) {
@@ -26160,12 +26162,16 @@ async function handleAskQuestion(ctx, toolCallId, question, options, selectionMo
26160
26162
  if (event.type !== "tool_suspension_cancelled" || event.toolCallId !== toolCallId) return;
26161
26163
  if (cancelled) return;
26162
26164
  cancelled = true;
26163
- unsubscribeCancel();
26164
26165
  retract();
26165
- resolve();
26166
+ finish("dismissed");
26166
26167
  }) ?? (() => {});
26167
- const finish = () => {
26168
+ const finish = (decision) => {
26168
26169
  unsubscribeCancel();
26170
+ state.hookManager?.runPermissionResult("ask_question", toolCallId, "ask_user", decision, {
26171
+ question,
26172
+ options,
26173
+ selectionMode
26174
+ }).catch(() => {});
26169
26175
  resolve();
26170
26176
  };
26171
26177
  if (state.options.inlineQuestions) {
@@ -26200,7 +26206,7 @@ async function handleAskQuestion(ctx, toolCallId, question, options, selectionMo
26200
26206
  toolCallId,
26201
26207
  resumeData: answer
26202
26208
  });
26203
- finish();
26209
+ finish("answered");
26204
26210
  processNextInlineQuestion(state);
26205
26211
  },
26206
26212
  onSubmitMulti: (answers) => {
@@ -26209,7 +26215,7 @@ async function handleAskQuestion(ctx, toolCallId, question, options, selectionMo
26209
26215
  toolCallId,
26210
26216
  resumeData: answers
26211
26217
  });
26212
- finish();
26218
+ finish("answered");
26213
26219
  processNextInlineQuestion(state);
26214
26220
  },
26215
26221
  onCancel: () => {
@@ -26218,7 +26224,7 @@ async function handleAskQuestion(ctx, toolCallId, question, options, selectionMo
26218
26224
  toolCallId,
26219
26225
  resumeData: "(skipped)"
26220
26226
  });
26221
- finish();
26227
+ finish("dismissed");
26222
26228
  processNextInlineQuestion(state);
26223
26229
  }
26224
26230
  });
@@ -26235,7 +26241,7 @@ async function handleAskQuestion(ctx, toolCallId, question, options, selectionMo
26235
26241
  toolCallId,
26236
26242
  resumeData: answer
26237
26243
  });
26238
- finish();
26244
+ finish("answered");
26239
26245
  processNextInlineQuestion(state);
26240
26246
  },
26241
26247
  onSubmitMulti: (answers) => {
@@ -26244,7 +26250,7 @@ async function handleAskQuestion(ctx, toolCallId, question, options, selectionMo
26244
26250
  toolCallId,
26245
26251
  resumeData: answers
26246
26252
  });
26247
- finish();
26253
+ finish("answered");
26248
26254
  processNextInlineQuestion(state);
26249
26255
  },
26250
26256
  onCancel: () => {
@@ -26253,7 +26259,7 @@ async function handleAskQuestion(ctx, toolCallId, question, options, selectionMo
26253
26259
  toolCallId,
26254
26260
  resumeData: "(skipped)"
26255
26261
  });
26256
- finish();
26262
+ finish("dismissed");
26257
26263
  processNextInlineQuestion(state);
26258
26264
  }
26259
26265
  }, state.ui);
@@ -26269,7 +26275,7 @@ async function handleAskQuestion(ctx, toolCallId, question, options, selectionMo
26269
26275
  toolCallId,
26270
26276
  resumeData: "(skipped)"
26271
26277
  });
26272
- finish();
26278
+ finish("dismissed");
26273
26279
  processNextInlineQuestion(state);
26274
26280
  }
26275
26281
  };
@@ -26292,7 +26298,7 @@ async function handleAskQuestion(ctx, toolCallId, question, options, selectionMo
26292
26298
  toolCallId,
26293
26299
  resumeData: answer
26294
26300
  });
26295
- finish();
26301
+ finish("answered");
26296
26302
  },
26297
26303
  onSubmitMulti: (answers) => {
26298
26304
  state.ui.hideOverlay();
@@ -26300,7 +26306,7 @@ async function handleAskQuestion(ctx, toolCallId, question, options, selectionMo
26300
26306
  toolCallId,
26301
26307
  resumeData: answers
26302
26308
  });
26303
- finish();
26309
+ finish("answered");
26304
26310
  },
26305
26311
  onCancel: () => {
26306
26312
  state.ui.hideOverlay();
@@ -26308,7 +26314,7 @@ async function handleAskQuestion(ctx, toolCallId, question, options, selectionMo
26308
26314
  toolCallId,
26309
26315
  resumeData: "(skipped)"
26310
26316
  });
26311
- finish();
26317
+ finish("dismissed");
26312
26318
  }
26313
26319
  });
26314
26320
  showModalOverlay(state.ui, dialog, { widthPercent: .7 });
@@ -30155,4 +30161,4 @@ Object.defineProperty(exports, "theme", {
30155
30161
  }
30156
30162
  });
30157
30163
 
30158
- //# sourceMappingURL=tui-BTQZwEmk.cjs.map
30164
+ //# sourceMappingURL=tui-edzCSg8-.cjs.map