mastracode 0.22.2-alpha.0 → 0.22.2

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,20 @@
1
1
  # mastracode
2
2
 
3
+ ## 0.22.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixed thread isolation bug where /new command did not abort the running stream, causing events from the old thread (subagent results, tool approvals, task updates) to leak into the new conversation. ([#17565](https://github.com/mastra-ai/mastra/pull/17565))
8
+
9
+ - Updated dependencies [[`f82cc72`](https://github.com/mastra-ai/mastra/commit/f82cc72edca0ce636fe18abaf2598d89a0c6bcca), [`fcf6027`](https://github.com/mastra-ai/mastra/commit/fcf602747f6771731dda268ff3493b836f9f0ee9)]:
10
+ - @mastra/core@1.41.0
11
+
12
+ ## 0.22.2-alpha.1
13
+
14
+ ### Patch Changes
15
+
16
+ - Fixed thread isolation bug where /new command did not abort the running stream, causing events from the old thread (subagent results, tool approvals, task updates) to leak into the new conversation. ([#17565](https://github.com/mastra-ai/mastra/pull/17565))
17
+
3
18
  ## 0.22.2-alpha.0
4
19
 
5
20
  ### Patch Changes
@@ -1,4 +1,4 @@
1
- import { tintHex, mastra, theme, getMarkdownTheme, CHAT_INDENT, BOX_INDENT, getTermWidth, ensureTerminalGlyphContrast, TERM_WIDTH_BUFFER, getEditorTheme, loadSettings, MEMORY_GATEWAY_PROVIDER, getAvailableModePacks, resolveThreadActiveModelPackId, saveSettings, getAvailableOmPacks, ONBOARDING_VERSION, THREAD_ACTIVE_MODEL_PACK_ID_KEY, BOX_INDENT_STR, resolveModel, ThreadLockError, getSelectListTheme, luminance, extendedColors, MEMORY_GATEWAY_DEFAULT_URL, getThemeMode, applyThemeMode, createBrowserFromSettings, setProfileProvider, getCustomProviderId, OBSERVABILITY_AUTH_PREFIX, checkProfileProviderMismatch, getSettingsListTheme, mastraBrand, GITHUB_SIGNALS_METADATA_KEY, toCustomProviderModelId } from './chunk-7ZTY5SBK.js';
1
+ import { tintHex, mastra, theme, getMarkdownTheme, CHAT_INDENT, BOX_INDENT, getTermWidth, ensureTerminalGlyphContrast, TERM_WIDTH_BUFFER, getEditorTheme, loadSettings, MEMORY_GATEWAY_PROVIDER, getAvailableModePacks, resolveThreadActiveModelPackId, saveSettings, getAvailableOmPacks, ONBOARDING_VERSION, THREAD_ACTIVE_MODEL_PACK_ID_KEY, BOX_INDENT_STR, resolveModel, ThreadLockError, getSelectListTheme, luminance, extendedColors, MEMORY_GATEWAY_DEFAULT_URL, getThemeMode, applyThemeMode, createBrowserFromSettings, setProfileProvider, getCustomProviderId, OBSERVABILITY_AUTH_PREFIX, checkProfileProviderMismatch, getSettingsListTheme, mastraBrand, GITHUB_SIGNALS_METADATA_KEY, toCustomProviderModelId } from './chunk-EXBGEHMR.js';
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-UOFNLVKF.js';
4
4
  import { exec, spawn, execFile, execSync, execFileSync } from 'child_process';
@@ -1173,7 +1173,7 @@ function getInstallCommand(pm, version) {
1173
1173
  }
1174
1174
  function getCurrentVersion() {
1175
1175
  {
1176
- return "0.22.2-alpha.0";
1176
+ return "0.22.2";
1177
1177
  }
1178
1178
  }
1179
1179
  async function fetchLatestVersion() {
@@ -9372,6 +9372,7 @@ ${escapeSkillBoundary(content)}
9372
9372
  // src/tui/commands/new.ts
9373
9373
  async function handleNewCommand(ctx) {
9374
9374
  const { state } = ctx;
9375
+ state.harness.abort();
9375
9376
  state.pendingNewThread = true;
9376
9377
  state.chatContainer.clear();
9377
9378
  state.pendingTools.clear();
@@ -14612,6 +14613,8 @@ async function handleObservabilityCommand(ctx, args) {
14612
14613
  );
14613
14614
  }
14614
14615
  }
14616
+
14617
+ // src/tui/commands/github.ts
14615
14618
  function isPlainObject(value) {
14616
14619
  return typeof value === "object" && value !== null && !Array.isArray(value);
14617
14620
  }
@@ -14641,7 +14644,7 @@ function parseGithubPRReference(input) {
14641
14644
  return void 0;
14642
14645
  }
14643
14646
  async function getCurrentGithubThread(ctx) {
14644
- const harness = ctx.state.harness;
14647
+ const harness = ctx.harness;
14645
14648
  const threadId = harness.getCurrentThreadId?.();
14646
14649
  if (!threadId) return {};
14647
14650
  const thread = (await harness.listThreads?.({ allResources: true }))?.find((item) => item.id === threadId);
@@ -14714,8 +14717,9 @@ async function syncGithubSubscriptions(ctx) {
14714
14717
  }
14715
14718
  }
14716
14719
  async function detectCurrentPullRequest(ctx) {
14720
+ const { execFile: execFile3 } = await import('child_process');
14717
14721
  return new Promise((resolve3) => {
14718
- execFile(
14722
+ execFile3(
14719
14723
  "gh",
14720
14724
  ["pr", "view", "--json", "url", "--jq", ".url"],
14721
14725
  { cwd: ctx.state.projectInfo.rootPath },
@@ -14725,21 +14729,6 @@ async function detectCurrentPullRequest(ctx) {
14725
14729
  );
14726
14730
  });
14727
14731
  }
14728
- async function tryAutoSubscribeToBranchPR(ctx) {
14729
- if (!loadSettings().signals.experimentalGithubSignals) return;
14730
- const githubSignalsProcessor = ctx.state.options?.githubSignals;
14731
- if (!githubSignalsProcessor?.subscribeThreadToPR) return;
14732
- const { threadId, resourceId } = await getCurrentGithubThread(ctx);
14733
- if (!threadId || !resourceId) return;
14734
- const currentPR = await detectCurrentPullRequest(ctx);
14735
- const pr = currentPR ? parseGithubPRReference(currentPR) : void 0;
14736
- if (!pr) return;
14737
- try {
14738
- const result = await githubSignalsProcessor.subscribeThreadToPR({ threadId, resourceId, pr });
14739
- ctx.showInfo(`Auto-subscribed to ${result.owner}/${result.repo}#${result.number} via GitHub Signals.`);
14740
- } catch {
14741
- }
14742
- }
14743
14732
  async function handleGithubCommand(ctx, args = []) {
14744
14733
  if (!loadSettings().signals.experimentalGithubSignals) {
14745
14734
  ctx.showError("Experimental GitHub signals are disabled. Enable them in /settings and restart MastraCode.");
@@ -15102,7 +15091,6 @@ function pruneChatContainer(state) {
15102
15091
  }
15103
15092
 
15104
15093
  // src/tui/handlers/agent-lifecycle.ts
15105
- var autoSubscribeCheckedThreads = /* @__PURE__ */ new Set();
15106
15094
  function handleAgentStart(ctx) {
15107
15095
  const { state } = ctx;
15108
15096
  state.goalManager.startActiveTimer();
@@ -15130,13 +15118,6 @@ function handleAgentEnd(ctx) {
15130
15118
  ctx.updateStatusLine();
15131
15119
  }
15132
15120
  });
15133
- const harness = state.harness;
15134
- const threadId = harness.getCurrentThreadId?.();
15135
- if (threadId && !autoSubscribeCheckedThreads.has(threadId)) {
15136
- autoSubscribeCheckedThreads.add(threadId);
15137
- tryAutoSubscribeToBranchPR(ctx).catch(() => {
15138
- });
15139
- }
15140
15121
  if (state.streamingComponent) {
15141
15122
  state.streamingComponent = void 0;
15142
15123
  state.streamingMessage = void 0;
@@ -19366,5 +19347,5 @@ Would you like to update now?`;
19366
19347
  };
19367
19348
 
19368
19349
  export { AssistantMessageComponent, LoginDialogComponent, LoginSelectorComponent, MastraTUI, ModelSelectorComponent, OMProgressComponent, ToolExecutionComponentEnhanced, UserMessageComponent, createTUIState, detectTerminalTheme, formatOMStatus, getCurrentVersion };
19369
- //# sourceMappingURL=chunk-KEEC6KZP.js.map
19370
- //# sourceMappingURL=chunk-KEEC6KZP.js.map
19350
+ //# sourceMappingURL=chunk-7ARENXCP.js.map
19351
+ //# sourceMappingURL=chunk-7ARENXCP.js.map