mastracode 0.9.0-alpha.0 → 0.9.0-alpha.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.
Files changed (73) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/{chunk-4T4EQHMT.cjs → chunk-36345FJE.cjs} +208 -37
  3. package/dist/chunk-36345FJE.cjs.map +1 -0
  4. package/dist/{chunk-26I7WX6E.cjs → chunk-36LFWM5K.cjs} +2127 -1225
  5. package/dist/chunk-36LFWM5K.cjs.map +1 -0
  6. package/dist/{chunk-2ME2G3BK.cjs → chunk-C7K52PPG.cjs} +230 -48
  7. package/dist/chunk-C7K52PPG.cjs.map +1 -0
  8. package/dist/{chunk-MGKFGGML.js → chunk-FUAFPKJF.js} +189 -18
  9. package/dist/chunk-FUAFPKJF.js.map +1 -0
  10. package/dist/{chunk-FVYFO3SW.js → chunk-UUS7G74S.js} +223 -49
  11. package/dist/chunk-UUS7G74S.js.map +1 -0
  12. package/dist/{chunk-O6C36DFS.js → chunk-V3RNMGBM.js} +1702 -800
  13. package/dist/chunk-V3RNMGBM.js.map +1 -0
  14. package/dist/cli.cjs +37 -33
  15. package/dist/cli.cjs.map +1 -1
  16. package/dist/cli.js +29 -24
  17. package/dist/cli.js.map +1 -1
  18. package/dist/headless.d.ts.map +1 -1
  19. package/dist/index.cjs +3 -3
  20. package/dist/index.js +1 -1
  21. package/dist/mcp/index.d.ts +1 -1
  22. package/dist/mcp/index.d.ts.map +1 -1
  23. package/dist/mcp/manager.d.ts +13 -0
  24. package/dist/mcp/manager.d.ts.map +1 -1
  25. package/dist/mcp/types.d.ts +2 -0
  26. package/dist/mcp/types.d.ts.map +1 -1
  27. package/dist/tui/commands/mcp.d.ts.map +1 -1
  28. package/dist/tui/commands/theme.d.ts.map +1 -1
  29. package/dist/tui/components/ask-question-inline.d.ts +50 -6
  30. package/dist/tui/components/ask-question-inline.d.ts.map +1 -1
  31. package/dist/tui/components/assistant-message.d.ts.map +1 -1
  32. package/dist/tui/components/custom-editor.d.ts +4 -0
  33. package/dist/tui/components/custom-editor.d.ts.map +1 -1
  34. package/dist/tui/components/diff-output.d.ts.map +1 -1
  35. package/dist/tui/components/error-display.d.ts.map +1 -1
  36. package/dist/tui/components/mcp-selector.d.ts +79 -0
  37. package/dist/tui/components/mcp-selector.d.ts.map +1 -0
  38. package/dist/tui/components/obi-loader.d.ts +1 -1
  39. package/dist/tui/components/obi-loader.d.ts.map +1 -1
  40. package/dist/tui/components/om-marker.d.ts.map +1 -1
  41. package/dist/tui/components/om-output.d.ts.map +1 -1
  42. package/dist/tui/components/om-progress.d.ts.map +1 -1
  43. package/dist/tui/components/plan-approval-inline.d.ts.map +1 -1
  44. package/dist/tui/components/slash-command.d.ts.map +1 -1
  45. package/dist/tui/components/system-reminder.d.ts.map +1 -1
  46. package/dist/tui/components/tool-execution-enhanced.d.ts +5 -1
  47. package/dist/tui/components/tool-execution-enhanced.d.ts.map +1 -1
  48. package/dist/tui/components/user-message.d.ts +1 -1
  49. package/dist/tui/components/user-message.d.ts.map +1 -1
  50. package/dist/tui/detect-theme.d.ts +6 -1
  51. package/dist/tui/detect-theme.d.ts.map +1 -1
  52. package/dist/tui/handlers/message.d.ts +6 -0
  53. package/dist/tui/handlers/message.d.ts.map +1 -1
  54. package/dist/tui/handlers/prompts.d.ts.map +1 -1
  55. package/dist/tui/handlers/tool.d.ts +7 -0
  56. package/dist/tui/handlers/tool.d.ts.map +1 -1
  57. package/dist/tui/mastra-tui.d.ts.map +1 -1
  58. package/dist/tui/render-messages.d.ts.map +1 -1
  59. package/dist/tui/setup.d.ts.map +1 -1
  60. package/dist/tui/state.d.ts +4 -2
  61. package/dist/tui/state.d.ts.map +1 -1
  62. package/dist/tui/status-line.d.ts.map +1 -1
  63. package/dist/tui/theme.d.ts +73 -4
  64. package/dist/tui/theme.d.ts.map +1 -1
  65. package/dist/tui.cjs +19 -19
  66. package/dist/tui.js +2 -2
  67. package/package.json +7 -7
  68. package/dist/chunk-26I7WX6E.cjs.map +0 -1
  69. package/dist/chunk-2ME2G3BK.cjs.map +0 -1
  70. package/dist/chunk-4T4EQHMT.cjs.map +0 -1
  71. package/dist/chunk-FVYFO3SW.js.map +0 -1
  72. package/dist/chunk-MGKFGGML.js.map +0 -1
  73. package/dist/chunk-O6C36DFS.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,46 @@
1
1
  # mastracode
2
2
 
3
+ ## 0.9.0-alpha.2
4
+
5
+ ### Minor Changes
6
+
7
+ - Improved MCP server management with interactive `/mcp` selector UI. ([#14377](https://github.com/mastra-ai/mastra/pull/14377))
8
+ - **Fixed stderr flooding** — MCP child process debug output no longer corrupts the terminal. Server stderr is piped and buffered instead of inherited.
9
+ - **Fixed console.info race condition** — MCP status messages now display properly in the chat area instead of racing with TUI rendering.
10
+ - **Better error detection** — Failed MCP servers now correctly show as failed instead of showing as connected with 0 tools.
11
+ - **Interactive `/mcp` command** — Replaces text-only output with a navigable overlay (↑↓ to select, Enter for actions, Esc to close). Sub-menus offer View tools, View error, View logs, and Reconnect per server.
12
+ - **Per-server reconnect** — Reconnect individual servers from the `/mcp` selector without restarting all connections.
13
+ - **Live status polling** — The `/mcp` selector auto-refreshes while servers are still connecting.
14
+ - **Connecting state** — Servers show as 'connecting...' during initial startup, visible via `/mcp`.
15
+
16
+ **Example**
17
+
18
+ ```text
19
+ /mcp
20
+ ```
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [[`4444280`](https://github.com/mastra-ai/mastra/commit/444428094253e916ec077e66284e685fde67021e), [`dbb879a`](https://github.com/mastra-ai/mastra/commit/dbb879af0b809c668e9b3a9d8bac97d806caa267), [`dbb879a`](https://github.com/mastra-ai/mastra/commit/dbb879af0b809c668e9b3a9d8bac97d806caa267), [`b92d0c9`](https://github.com/mastra-ai/mastra/commit/b92d0c92ecc833bec9a99af98b3243839c1661be), [`8de3555`](https://github.com/mastra-ai/mastra/commit/8de355572c6fd838f863a3e7e6fe24d0947b774f), [`133ef20`](https://github.com/mastra-ai/mastra/commit/133ef20c39c696eb0dbbee26e77c8acfec14b8c6), [`4444280`](https://github.com/mastra-ai/mastra/commit/444428094253e916ec077e66284e685fde67021e)]:
25
+ - @mastra/core@1.14.0-alpha.2
26
+ - @mastra/pg@1.8.1-alpha.0
27
+ - @mastra/libsql@1.7.1-alpha.0
28
+ - @mastra/memory@1.8.3-alpha.1
29
+ - @mastra/mcp@1.3.0-alpha.1
30
+
31
+ ## 0.9.0-alpha.1
32
+
33
+ ### Minor Changes
34
+
35
+ - Added adaptive light and dark terminal themes with WCAG-compliant contrast. Editor input, messages, tool output, and interactive components now automatically adjust colors and borders for readability across terminal backgrounds. ([#14337](https://github.com/mastra-ai/mastra/pull/14337))
36
+
37
+ ### Patch Changes
38
+
39
+ - Fix rendering corruption in some terminal emulators by replacing the per-character gradient animation on the editor input border with a solid mode-color border. ([#14359](https://github.com/mastra-ai/mastra/pull/14359))
40
+
41
+ - Updated dependencies [[`b77aa19`](https://github.com/mastra-ai/mastra/commit/b77aa1981361c021f2c881bee8f0c703687f00da), [`dd6ca1c`](https://github.com/mastra-ai/mastra/commit/dd6ca1cdea3b8b6182f4cf61df41070ba0cc0deb), [`4cb4edf`](https://github.com/mastra-ai/mastra/commit/4cb4edf3c909d197ec356c1790d13270514ffef6)]:
42
+ - @mastra/core@1.13.3-alpha.1
43
+
3
44
  ## 0.9.0-alpha.0
4
45
 
5
46
  ### Minor Changes
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunk2ME2G3BK_cjs = require('./chunk-2ME2G3BK.cjs');
3
+ var chunkC7K52PPG_cjs = require('./chunk-C7K52PPG.cjs');
4
4
  var chunk45H2FFSL_cjs = require('./chunk-45H2FFSL.cjs');
5
5
  var chunkR6JK3DE3_cjs = require('./chunk-R6JK3DE3.cjs');
6
6
  var agent = require('@mastra/core/agent');
@@ -475,8 +475,8 @@ function getDynamicWorkspace({ requestContext, mastra: mastra2 }) {
475
475
  existing.setToolsConfig(isPlanMode ? { ...chunkR6JK3DE3_cjs.TOOL_NAME_OVERRIDES, ...planModeTools } : chunkR6JK3DE3_cjs.TOOL_NAME_OVERRIDES);
476
476
  return existing;
477
477
  }
478
- const userLsp = chunk2ME2G3BK_cjs.loadSettings().lsp ?? {};
479
- const mcModulePath = path.join(path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-4T4EQHMT.cjs', document.baseURI).href)))), "..");
478
+ const userLsp = chunkC7K52PPG_cjs.loadSettings().lsp ?? {};
479
+ const mcModulePath = path.join(path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-36345FJE.cjs', document.baseURI).href)))), "..");
480
480
  const lspConfig = {
481
481
  ...userLsp,
482
482
  packageRunner: userLsp.packageRunner || detectPackageRunner(projectPath),
@@ -1169,9 +1169,9 @@ function openaiApiKeyProvider(modelId, apiKey) {
1169
1169
  function resolveModel(modelId, options) {
1170
1170
  authStorage.reload();
1171
1171
  const [providerId, modelName] = modelId.split("/", 2);
1172
- const settings = chunk2ME2G3BK_cjs.loadSettings();
1172
+ const settings = chunkC7K52PPG_cjs.loadSettings();
1173
1173
  const customProvider = providerId && modelName ? settings.customProviders.find((provider) => {
1174
- return providerId === chunk2ME2G3BK_cjs.getCustomProviderId(provider.name);
1174
+ return providerId === chunkC7K52PPG_cjs.getCustomProviderId(provider.name);
1175
1175
  }) : void 0;
1176
1176
  if (customProvider) {
1177
1177
  return new llm.ModelRouterLanguageModel({
@@ -1932,7 +1932,38 @@ function createMcpManager(projectDir, extraServers) {
1932
1932
  let client = null;
1933
1933
  let tools = {};
1934
1934
  let serverStatuses = /* @__PURE__ */ new Map();
1935
+ let stderrLogs = /* @__PURE__ */ new Map();
1935
1936
  let initialized = false;
1937
+ const MAX_STDERR_LINES = 200;
1938
+ function captureStderr(serverName) {
1939
+ if (!client || typeof client.getServerStderr !== "function") return;
1940
+ const stream = client.getServerStderr(serverName);
1941
+ if (!stream) return;
1942
+ let buffer = "";
1943
+ const lines = stderrLogs.get(serverName) ?? [];
1944
+ stderrLogs.set(serverName, lines);
1945
+ stream.on("data", (chunk) => {
1946
+ buffer += chunk.toString();
1947
+ const parts = buffer.split("\n");
1948
+ buffer = parts.pop();
1949
+ for (const line of parts) {
1950
+ if (line.trim()) {
1951
+ lines.push(line);
1952
+ if (lines.length > MAX_STDERR_LINES) {
1953
+ lines.shift();
1954
+ }
1955
+ }
1956
+ }
1957
+ });
1958
+ stream.on("end", () => {
1959
+ if (buffer.trim()) {
1960
+ lines.push(buffer);
1961
+ if (lines.length > MAX_STDERR_LINES) {
1962
+ lines.shift();
1963
+ }
1964
+ }
1965
+ });
1966
+ }
1936
1967
  function buildServerDefs(servers) {
1937
1968
  const defs = {};
1938
1969
  for (const [name, cfg] of Object.entries(servers)) {
@@ -1943,7 +1974,7 @@ function createMcpManager(projectDir, extraServers) {
1943
1974
  requestInit: httpCfg.headers ? { headers: httpCfg.headers } : void 0
1944
1975
  };
1945
1976
  } else {
1946
- defs[name] = { command: cfg.command, args: cfg.args, env: cfg.env };
1977
+ defs[name] = { command: cfg.command, args: cfg.args, env: cfg.env, stderr: "pipe" };
1947
1978
  }
1948
1979
  }
1949
1980
  return defs;
@@ -1953,23 +1984,52 @@ function createMcpManager(projectDir, extraServers) {
1953
1984
  if (!servers || Object.keys(servers).length === 0) {
1954
1985
  return;
1955
1986
  }
1987
+ const serverNames = Object.keys(servers);
1988
+ for (const name of serverNames) {
1989
+ serverStatuses.set(name, {
1990
+ name,
1991
+ connected: false,
1992
+ connecting: true,
1993
+ toolCount: 0,
1994
+ toolNames: [],
1995
+ transport: getTransport(servers[name])
1996
+ });
1997
+ }
1956
1998
  client = new mcp.MCPClient({
1957
1999
  id: "mastra-code-mcp",
1958
2000
  servers: buildServerDefs(servers)
1959
2001
  });
1960
- const serverNames = Object.keys(servers);
1961
2002
  try {
1962
- tools = await client.listTools();
2003
+ const { toolsets, errors } = await client.listToolsetsWithErrors();
2004
+ for (const [serverName, serverTools] of Object.entries(toolsets)) {
2005
+ for (const [toolName, toolConfig] of Object.entries(serverTools)) {
2006
+ tools[`${serverName}_${toolName}`] = toolConfig;
2007
+ }
2008
+ }
1963
2009
  for (const name of serverNames) {
1964
- const prefix = `${name}_`;
1965
- const serverToolNames = Object.keys(tools).filter((t) => t.startsWith(prefix));
1966
- serverStatuses.set(name, {
1967
- name,
1968
- connected: true,
1969
- toolCount: serverToolNames.length,
1970
- toolNames: serverToolNames,
1971
- transport: getTransport(servers[name])
1972
- });
2010
+ const serverTools = toolsets[name];
2011
+ if (serverTools && Object.keys(serverTools).length > 0) {
2012
+ const toolNames = Object.keys(serverTools).map((t) => `${name}_${t}`);
2013
+ serverStatuses.set(name, {
2014
+ name,
2015
+ connected: true,
2016
+ toolCount: toolNames.length,
2017
+ toolNames,
2018
+ transport: getTransport(servers[name])
2019
+ });
2020
+ } else {
2021
+ serverStatuses.set(name, {
2022
+ name,
2023
+ connected: false,
2024
+ toolCount: 0,
2025
+ toolNames: [],
2026
+ transport: getTransport(servers[name]),
2027
+ error: errors[name] ?? "Failed to connect"
2028
+ });
2029
+ }
2030
+ }
2031
+ for (const name of serverNames) {
2032
+ captureStderr(name);
1973
2033
  }
1974
2034
  } catch (error) {
1975
2035
  const errMsg = error instanceof Error ? error.message : String(error);
@@ -2000,15 +2060,123 @@ function createMcpManager(projectDir, extraServers) {
2000
2060
  await connectAndCollectTools();
2001
2061
  initialized = true;
2002
2062
  },
2063
+ async initInBackground() {
2064
+ await this.init();
2065
+ const statuses = Array.from(serverStatuses.values());
2066
+ const connected = statuses.filter((s) => s.connected);
2067
+ const failed = statuses.filter((s) => !s.connected);
2068
+ return {
2069
+ connected,
2070
+ failed,
2071
+ skipped: [...config.skippedServers ?? []],
2072
+ totalTools: connected.reduce((sum, s) => sum + s.toolCount, 0)
2073
+ };
2074
+ },
2003
2075
  async reload() {
2004
2076
  await disconnect();
2005
2077
  config = applyExtraServers(loadMcpConfig(projectDir));
2006
2078
  tools = {};
2007
2079
  serverStatuses = /* @__PURE__ */ new Map();
2080
+ stderrLogs = /* @__PURE__ */ new Map();
2008
2081
  initialized = false;
2009
2082
  await connectAndCollectTools();
2010
2083
  initialized = true;
2011
2084
  },
2085
+ async reconnectServer(name) {
2086
+ const cfg = config.mcpServers?.[name];
2087
+ if (!cfg) {
2088
+ return {
2089
+ name,
2090
+ connected: false,
2091
+ toolCount: 0,
2092
+ toolNames: [],
2093
+ transport: "stdio",
2094
+ error: `Server "${name}" not found in config`
2095
+ };
2096
+ }
2097
+ if (!client) {
2098
+ return {
2099
+ name,
2100
+ connected: false,
2101
+ toolCount: 0,
2102
+ toolNames: [],
2103
+ transport: getTransport(cfg),
2104
+ error: "MCP client not initialized"
2105
+ };
2106
+ }
2107
+ const transport = getTransport(cfg);
2108
+ const prefix = `${name}_`;
2109
+ for (const key of Object.keys(tools)) {
2110
+ if (key.startsWith(prefix)) {
2111
+ delete tools[key];
2112
+ }
2113
+ }
2114
+ stderrLogs.delete(name);
2115
+ serverStatuses.set(name, {
2116
+ name,
2117
+ connected: false,
2118
+ connecting: true,
2119
+ toolCount: 0,
2120
+ toolNames: [],
2121
+ transport
2122
+ });
2123
+ try {
2124
+ await client.reconnectServer(name);
2125
+ captureStderr(name);
2126
+ const { toolsets, errors } = await client.listToolsetsWithErrors();
2127
+ const serverTools = toolsets[name];
2128
+ const serverError = errors[name];
2129
+ if (serverError) {
2130
+ const status = {
2131
+ name,
2132
+ connected: false,
2133
+ toolCount: 0,
2134
+ toolNames: [],
2135
+ transport,
2136
+ error: serverError
2137
+ };
2138
+ serverStatuses.set(name, status);
2139
+ return status;
2140
+ } else if (serverTools && Object.keys(serverTools).length > 0) {
2141
+ const toolNames = Object.keys(serverTools).map((t) => `${name}_${t}`);
2142
+ for (const [toolName, toolConfig] of Object.entries(serverTools)) {
2143
+ tools[`${name}_${toolName}`] = toolConfig;
2144
+ }
2145
+ const status = {
2146
+ name,
2147
+ connected: true,
2148
+ toolCount: toolNames.length,
2149
+ toolNames,
2150
+ transport
2151
+ };
2152
+ serverStatuses.set(name, status);
2153
+ return status;
2154
+ } else {
2155
+ const status = {
2156
+ name,
2157
+ connected: false,
2158
+ toolCount: 0,
2159
+ toolNames: [],
2160
+ transport,
2161
+ error: "Failed to connect"
2162
+ };
2163
+ serverStatuses.set(name, status);
2164
+ return status;
2165
+ }
2166
+ } catch (error) {
2167
+ const errMsg = error instanceof Error ? error.message : String(error);
2168
+ const status = {
2169
+ name,
2170
+ connected: false,
2171
+ toolCount: 0,
2172
+ toolNames: [],
2173
+ transport,
2174
+ error: errMsg
2175
+ };
2176
+ serverStatuses.set(name, status);
2177
+ return status;
2178
+ }
2179
+ },
2012
2180
  disconnect,
2013
2181
  getTools() {
2014
2182
  return { ...tools };
@@ -2033,6 +2201,9 @@ function createMcpManager(projectDir, extraServers) {
2033
2201
  },
2034
2202
  getConfig() {
2035
2203
  return config;
2204
+ },
2205
+ getServerLogs(name) {
2206
+ return [...stderrLogs.get(name) ?? []];
2036
2207
  }
2037
2208
  };
2038
2209
  }
@@ -2301,7 +2472,7 @@ async function createMastraCode(config) {
2301
2472
  project.resourceId = resourceIdOverride;
2302
2473
  project.resourceIdOverride = true;
2303
2474
  }
2304
- const globalSettings = chunk2ME2G3BK_cjs.loadSettings();
2475
+ const globalSettings = chunkC7K52PPG_cjs.loadSettings();
2305
2476
  const storageConfig = config?.storage ?? chunk45H2FFSL_cjs.getStorageConfig(project.rootPath, globalSettings.storage);
2306
2477
  const storageResult = await createStorage(storageConfig);
2307
2478
  const storage = storageResult.storage;
@@ -2328,21 +2499,21 @@ async function createMastraCode(config) {
2328
2499
  name: "Build",
2329
2500
  default: true,
2330
2501
  defaultModelId: "anthropic/claude-opus-4-6",
2331
- color: chunk2ME2G3BK_cjs.mastra.purple,
2502
+ color: chunkC7K52PPG_cjs.mastra.green,
2332
2503
  agent: codeAgent
2333
2504
  },
2334
2505
  {
2335
2506
  id: "plan",
2336
2507
  name: "Plan",
2337
2508
  defaultModelId: "openai/gpt-5.2-codex",
2338
- color: chunk2ME2G3BK_cjs.mastra.blue,
2509
+ color: chunkC7K52PPG_cjs.mastra.purple,
2339
2510
  agent: codeAgent
2340
2511
  },
2341
2512
  {
2342
2513
  id: "fast",
2343
2514
  name: "Fast",
2344
2515
  defaultModelId: "cerebras/zai-glm-4.7",
2345
- color: chunk2ME2G3BK_cjs.mastra.green,
2516
+ color: chunkC7K52PPG_cjs.mastra.orange,
2346
2517
  agent: codeAgent
2347
2518
  }
2348
2519
  ];
@@ -2375,10 +2546,10 @@ async function createMastraCode(config) {
2375
2546
  }
2376
2547
  } catch {
2377
2548
  }
2378
- const builtinPacks = chunk2ME2G3BK_cjs.getAvailableModePacks(startupAccess);
2379
- const builtinOmPacks = chunk2ME2G3BK_cjs.getAvailableOmPacks(startupAccess);
2380
- const effectiveDefaults = chunk2ME2G3BK_cjs.resolveModelDefaults(globalSettings, builtinPacks);
2381
- const effectiveOmModel = chunk2ME2G3BK_cjs.resolveOmModel(globalSettings, builtinOmPacks);
2549
+ const builtinPacks = chunkC7K52PPG_cjs.getAvailableModePacks(startupAccess);
2550
+ const builtinOmPacks = chunkC7K52PPG_cjs.getAvailableOmPacks(startupAccess);
2551
+ const effectiveDefaults = chunkC7K52PPG_cjs.resolveModelDefaults(globalSettings, builtinPacks);
2552
+ const effectiveOmModel = chunkC7K52PPG_cjs.resolveOmModel(globalSettings, builtinOmPacks);
2382
2553
  const modes = (config?.modes ?? defaultModes).map((mode) => {
2383
2554
  const savedModel = effectiveDefaults[mode.id];
2384
2555
  return savedModel ? { ...mode, defaultModelId: savedModel } : mode;
@@ -2463,32 +2634,32 @@ async function createMastraCode(config) {
2463
2634
  return true;
2464
2635
  }
2465
2636
  }
2466
- const customProvider = chunk2ME2G3BK_cjs.loadSettings().customProviders.find((entry) => {
2467
- return provider === chunk2ME2G3BK_cjs.getCustomProviderId(entry.name);
2637
+ const customProvider = chunkC7K52PPG_cjs.loadSettings().customProviders.find((entry) => {
2638
+ return provider === chunkC7K52PPG_cjs.getCustomProviderId(entry.name);
2468
2639
  });
2469
2640
  if (customProvider) {
2470
2641
  return true;
2471
2642
  }
2472
2643
  return void 0;
2473
2644
  },
2474
- modelUseCountProvider: () => chunk2ME2G3BK_cjs.loadSettings().modelUseCounts,
2645
+ modelUseCountProvider: () => chunkC7K52PPG_cjs.loadSettings().modelUseCounts,
2475
2646
  modelUseCountTracker: (modelId) => {
2476
2647
  try {
2477
- const settings = chunk2ME2G3BK_cjs.loadSettings();
2648
+ const settings = chunkC7K52PPG_cjs.loadSettings();
2478
2649
  settings.modelUseCounts[modelId] = (settings.modelUseCounts[modelId] ?? 0) + 1;
2479
- chunk2ME2G3BK_cjs.saveSettings(settings);
2650
+ chunkC7K52PPG_cjs.saveSettings(settings);
2480
2651
  } catch (error) {
2481
2652
  console.error("Failed to persist model usage count", error);
2482
2653
  }
2483
2654
  },
2484
2655
  customModelCatalogProvider: () => {
2485
- const settings = chunk2ME2G3BK_cjs.loadSettings();
2656
+ const settings = chunkC7K52PPG_cjs.loadSettings();
2486
2657
  const customModels = [];
2487
2658
  for (const provider of settings.customProviders) {
2488
- const providerId = chunk2ME2G3BK_cjs.getCustomProviderId(provider.name);
2659
+ const providerId = chunkC7K52PPG_cjs.getCustomProviderId(provider.name);
2489
2660
  for (const modelName of provider.models) {
2490
2661
  customModels.push({
2491
- id: chunk2ME2G3BK_cjs.toCustomProviderModelId(provider.name, modelName),
2662
+ id: chunkC7K52PPG_cjs.toCustomProviderModelId(provider.name, modelName),
2492
2663
  provider: providerId,
2493
2664
  modelName,
2494
2665
  hasApiKey: true,
@@ -2499,8 +2670,8 @@ async function createMastraCode(config) {
2499
2670
  return customModels;
2500
2671
  },
2501
2672
  threadLock: {
2502
- acquire: chunk2ME2G3BK_cjs.acquireThreadLock,
2503
- release: chunk2ME2G3BK_cjs.releaseThreadLock
2673
+ acquire: chunkC7K52PPG_cjs.acquireThreadLock,
2674
+ release: chunkC7K52PPG_cjs.releaseThreadLock
2504
2675
  }
2505
2676
  });
2506
2677
  if (hookManager) {
@@ -2517,5 +2688,5 @@ async function createMastraCode(config) {
2517
2688
 
2518
2689
  exports.createAuthStorage = createAuthStorage;
2519
2690
  exports.createMastraCode = createMastraCode;
2520
- //# sourceMappingURL=chunk-4T4EQHMT.cjs.map
2521
- //# sourceMappingURL=chunk-4T4EQHMT.cjs.map
2691
+ //# sourceMappingURL=chunk-36345FJE.cjs.map
2692
+ //# sourceMappingURL=chunk-36345FJE.cjs.map