mastracode 0.15.0-alpha.2 → 0.15.0-alpha.8
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 +57 -0
- package/dist/agents/memory.d.ts.map +1 -1
- package/dist/agents/model.d.ts +4 -4
- package/dist/agents/model.d.ts.map +1 -1
- package/dist/{chunk-KHG4SBCU.cjs → chunk-7MMP7U7Y.cjs} +38 -33
- package/dist/chunk-7MMP7U7Y.cjs.map +1 -0
- package/dist/{chunk-AMPURF4V.js → chunk-D6MEBQTC.js} +3 -3
- package/dist/{chunk-AMPURF4V.js.map → chunk-D6MEBQTC.js.map} +1 -1
- package/dist/{chunk-3BQ6AUG2.js → chunk-F2J4KWM7.js} +10 -5
- package/dist/chunk-F2J4KWM7.js.map +1 -0
- package/dist/{chunk-YJDFUA4J.cjs → chunk-GHMB5KFW.cjs} +815 -790
- package/dist/chunk-GHMB5KFW.cjs.map +1 -0
- package/dist/{chunk-GPFPBYEB.cjs → chunk-IAVPPCZU.cjs} +3 -3
- package/dist/{chunk-GPFPBYEB.cjs.map → chunk-IAVPPCZU.cjs.map} +1 -1
- package/dist/{chunk-ROCFILXO.js → chunk-OS6ITP4R.js} +34 -9
- package/dist/chunk-OS6ITP4R.js.map +1 -0
- package/dist/cli.cjs +17 -17
- package/dist/cli.js +3 -3
- package/dist/index.cjs +3 -3
- package/dist/index.js +1 -1
- package/dist/tui/components/om-marker.d.ts +4 -0
- package/dist/tui/components/om-marker.d.ts.map +1 -1
- package/dist/tui/event-dispatch.d.ts.map +1 -1
- package/dist/tui/handlers/om.d.ts +1 -1
- package/dist/tui/handlers/om.d.ts.map +1 -1
- package/dist/tui/state.d.ts +1 -0
- package/dist/tui/state.d.ts.map +1 -1
- package/dist/tui.cjs +19 -19
- package/dist/tui.js +2 -2
- package/package.json +4 -4
- package/dist/chunk-3BQ6AUG2.js.map +0 -1
- package/dist/chunk-KHG4SBCU.cjs.map +0 -1
- package/dist/chunk-ROCFILXO.js.map +0 -1
- package/dist/chunk-YJDFUA4J.cjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,62 @@
|
|
|
1
1
|
# mastracode
|
|
2
2
|
|
|
3
|
+
## 0.15.0-alpha.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`1bd5104`](https://github.com/mastra-ai/mastra/commit/1bd51048b6da93507276d6623e3fd96a9e1a8944)]:
|
|
8
|
+
- @mastra/core@1.26.0-alpha.8
|
|
9
|
+
|
|
10
|
+
## 0.15.0-alpha.7
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Fix API key resolution to check stored key slot and env vars. ([#15483](https://github.com/mastra-ai/mastra/pull/15483))
|
|
15
|
+
|
|
16
|
+
`getAnthropicApiKey()` and `getOpenAIApiKey()` now check `authStorage.getStoredApiKey()` and `process.env` in addition to the main credential slot. Fixes API keys becoming invisible to `resolveModel` after OAuth connect/disconnect cycles.
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [[`8786a61`](https://github.com/mastra-ai/mastra/commit/8786a61fa54ba265f85eeff9985ca39863d18bb6), [`8fb2405`](https://github.com/mastra-ai/mastra/commit/8fb2405138f2d208b7962ad03f121ca25bcc28c5)]:
|
|
19
|
+
- @mastra/core@1.26.0-alpha.7
|
|
20
|
+
|
|
21
|
+
## 0.15.0-alpha.6
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [[`6315317`](https://github.com/mastra-ai/mastra/commit/63153175fe9a7b224e5be7c209bbebc01dd9b0d5), [`9d3b24b`](https://github.com/mastra-ai/mastra/commit/9d3b24b19407ae9c09586cf7766d38dc4dff4a69)]:
|
|
26
|
+
- @mastra/core@1.26.0-alpha.6
|
|
27
|
+
|
|
28
|
+
## 0.15.0-alpha.5
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- Updated dependencies [[`92dcf02`](https://github.com/mastra-ai/mastra/commit/92dcf029294210ac91b090900c1a0555a425c57a)]:
|
|
33
|
+
- @mastra/core@1.26.0-alpha.5
|
|
34
|
+
|
|
35
|
+
## 0.15.0-alpha.4
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- Fixed the observational memory reflection activation label in MastraCode so it describes the actual change to the observation pool. ([#15462](https://github.com/mastra-ai/mastra/pull/15462))
|
|
40
|
+
|
|
41
|
+
Reflection activations now render as `before → after obs tokens (-delta)` instead of implying that message tokens were removed. Observation activations still use the existing `-X msg tokens, +Y obs tokens` format.
|
|
42
|
+
|
|
43
|
+
- Updated the default Anthropic mode pack models. Users signed in with an Anthropic Max subscription now get `claude-opus-4-7` for `build` and `plan`, and API-key users get `claude-sonnet-4-6` for `build` and `plan`. The `fast` model is unchanged. ([#15458](https://github.com/mastra-ai/mastra/pull/15458))
|
|
44
|
+
|
|
45
|
+
- Improved observational memory activation output to show when a provider or model switch triggered buffered observation activation. ([#15420](https://github.com/mastra-ai/mastra/pull/15420))
|
|
46
|
+
|
|
47
|
+
- Updated dependencies [[`0474c2b`](https://github.com/mastra-ai/mastra/commit/0474c2b2e7c7e1ad8691dca031284841391ff1ef), [`f607106`](https://github.com/mastra-ai/mastra/commit/f607106854c6416c4a07d4082604b9f66d047221), [`f607106`](https://github.com/mastra-ai/mastra/commit/f607106854c6416c4a07d4082604b9f66d047221), [`62919a6`](https://github.com/mastra-ai/mastra/commit/62919a6ee0fbf3779ad21a97b1ec6696515d5104), [`0fd90a2`](https://github.com/mastra-ai/mastra/commit/0fd90a215caf5fca8099c15a67ca03e4427747a3), [`0fd90a2`](https://github.com/mastra-ai/mastra/commit/0fd90a215caf5fca8099c15a67ca03e4427747a3)]:
|
|
48
|
+
- @mastra/core@1.26.0-alpha.4
|
|
49
|
+
- @mastra/memory@1.16.0-alpha.2
|
|
50
|
+
|
|
51
|
+
## 0.15.0-alpha.3
|
|
52
|
+
|
|
53
|
+
### Patch Changes
|
|
54
|
+
|
|
55
|
+
- Updated dependencies [[`fdd54cf`](https://github.com/mastra-ai/mastra/commit/fdd54cf612a9af876e9fdd85e534454f6e7dd518), [`30456b6`](https://github.com/mastra-ai/mastra/commit/30456b6b08c8fd17e109dd093b73d93b65e83bc5), [`9d11a8c`](https://github.com/mastra-ai/mastra/commit/9d11a8c1c8924eb975a245a5884d40ca1b7e0491), [`d246696`](https://github.com/mastra-ai/mastra/commit/d246696139a3144a5b21b042d41c532688e957e1), [`354f9ce`](https://github.com/mastra-ai/mastra/commit/354f9ce1ca6af2074b6a196a23f8ec30012dccca), [`e9837b5`](https://github.com/mastra-ai/mastra/commit/e9837b53699e18711b09e0ca010a4106376f2653)]:
|
|
56
|
+
- @mastra/core@1.26.0-alpha.3
|
|
57
|
+
- @mastra/mcp@1.5.1-alpha.1
|
|
58
|
+
- @mastra/memory@1.16.0-alpha.1
|
|
59
|
+
|
|
3
60
|
## 0.15.0-alpha.2
|
|
4
61
|
|
|
5
62
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/agents/memory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAoExC;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,oBAAoB,EAAE,MAAM,CAAC,EAAE,YAAY,IAC3E,oBAAoB;IAAE,cAAc,EAAE,cAAc,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/agents/memory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAoExC;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,oBAAoB,EAAE,MAAM,CAAC,EAAE,YAAY,IAC3E,oBAAoB;IAAE,cAAc,EAAE,cAAc,CAAA;CAAE,YAqD/D"}
|
package/dist/agents/model.d.ts
CHANGED
|
@@ -8,13 +8,13 @@ import type { ThinkingLevel } from '../providers/openai-codex.js';
|
|
|
8
8
|
type ResolvedModel = ReturnType<typeof openaiCodexProvider> | ReturnType<typeof opencodeClaudeMaxProvider> | ModelRouterLanguageModel | ReturnType<ReturnType<typeof createAnthropic>> | ReturnType<ReturnType<typeof createOpenAI>>;
|
|
9
9
|
export declare function remapOpenAIModelForCodexOAuth(modelId: string): string;
|
|
10
10
|
/**
|
|
11
|
-
* Resolve the Anthropic API key
|
|
12
|
-
*
|
|
11
|
+
* Resolve the Anthropic API key.
|
|
12
|
+
* Main slot → dedicated apikey: slot → env var.
|
|
13
13
|
*/
|
|
14
14
|
export declare function getAnthropicApiKey(): string | undefined;
|
|
15
15
|
/**
|
|
16
|
-
* Resolve the OpenAI API key
|
|
17
|
-
*
|
|
16
|
+
* Resolve the OpenAI API key.
|
|
17
|
+
* Main slot → dedicated apikey: slot → env var.
|
|
18
18
|
*/
|
|
19
19
|
export declare function getOpenAIApiKey(): string | undefined;
|
|
20
20
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/agents/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAsC,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAChG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAInE,OAAO,EAGL,yBAAyB,EAE1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAIL,mBAAmB,EAEpB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAelE,KAAK,aAAa,GACd,UAAU,CAAC,OAAO,mBAAmB,CAAC,GACtC,UAAU,CAAC,OAAO,yBAAyB,CAAC,GAC5C,wBAAwB,GACxB,UAAU,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,GAC9C,UAAU,CAAC,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC;AAsBhD,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAoBrE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/agents/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAsC,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAChG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAInE,OAAO,EAGL,yBAAyB,EAE1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAIL,mBAAmB,EAEpB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAelE,KAAK,aAAa,GACd,UAAU,CAAC,OAAO,mBAAmB,CAAC,GACtC,UAAU,CAAC,OAAO,yBAAyB,CAAC,GAC5C,wBAAwB,GACxB,UAAU,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,GAC9C,UAAU,CAAC,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC;AAsBhD,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAoBrE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,GAAG,SAAS,CAQvD;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,MAAM,GAAG,SAAS,CAQpD;AA0BD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;IAAE,aAAa,CAAC,EAAE,aAAa,CAAC;IAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAAC,cAAc,CAAC,EAAE,cAAc,CAAA;CAAE,GACzG,aAAa,CAqJf;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAAE,cAAc,EAAE,EAAE;IAAE,cAAc,EAAE,cAAc,CAAA;CAAE,GAAG,aAAa,CAWrG"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkIAVPPCZU_cjs = require('./chunk-IAVPPCZU.cjs');
|
|
4
4
|
var chunkWWCN7QMN_cjs = require('./chunk-WWCN7QMN.cjs');
|
|
5
5
|
var chunkOBFBUWOR_cjs = require('./chunk-OBFBUWOR.cjs');
|
|
6
6
|
var agent = require('@mastra/core/agent');
|
|
@@ -493,8 +493,8 @@ function getDynamicWorkspace({ requestContext, mastra: mastra2 }) {
|
|
|
493
493
|
existing.setToolsConfig(isPlanMode ? { ...chunkOBFBUWOR_cjs.TOOL_NAME_OVERRIDES, ...planModeTools } : chunkOBFBUWOR_cjs.TOOL_NAME_OVERRIDES);
|
|
494
494
|
return existing;
|
|
495
495
|
}
|
|
496
|
-
const userLsp =
|
|
497
|
-
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-
|
|
496
|
+
const userLsp = chunkIAVPPCZU_cjs.loadSettings().lsp ?? {};
|
|
497
|
+
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-7MMP7U7Y.cjs', document.baseURI).href)))), "..");
|
|
498
498
|
const lspConfig = {
|
|
499
499
|
...userLsp,
|
|
500
500
|
packageRunner: userLsp.packageRunner || detectPackageRunner(projectPath),
|
|
@@ -1240,14 +1240,18 @@ function getAnthropicApiKey() {
|
|
|
1240
1240
|
if (storedCred?.type === "api_key" && storedCred.key.trim().length > 0) {
|
|
1241
1241
|
return storedCred.key.trim();
|
|
1242
1242
|
}
|
|
1243
|
-
|
|
1243
|
+
const dedicatedKey = authStorage.getStoredApiKey("anthropic")?.trim();
|
|
1244
|
+
if (dedicatedKey) return dedicatedKey;
|
|
1245
|
+
return process.env.ANTHROPIC_API_KEY?.trim() || void 0;
|
|
1244
1246
|
}
|
|
1245
1247
|
function getOpenAIApiKey() {
|
|
1246
1248
|
const storedCred = authStorage.get("openai-codex");
|
|
1247
1249
|
if (storedCred?.type === "api_key" && storedCred.key.trim().length > 0) {
|
|
1248
1250
|
return storedCred.key.trim();
|
|
1249
1251
|
}
|
|
1250
|
-
|
|
1252
|
+
const dedicatedKey = authStorage.getStoredApiKey("openai-codex")?.trim();
|
|
1253
|
+
if (dedicatedKey) return dedicatedKey;
|
|
1254
|
+
return process.env.OPENAI_API_KEY?.trim() || void 0;
|
|
1251
1255
|
}
|
|
1252
1256
|
function anthropicApiKeyProvider(modelId, apiKey, headers) {
|
|
1253
1257
|
const anthropic$1 = anthropic.createAnthropic({ apiKey, headers });
|
|
@@ -1269,9 +1273,9 @@ function resolveModel(modelId, options) {
|
|
|
1269
1273
|
const isMastraGatewayModel = modelId.startsWith(MASTRA_GATEWAY_PREFIX);
|
|
1270
1274
|
const normalizedModelId = stripMastraGatewayPrefix(modelId);
|
|
1271
1275
|
const [providerId, modelName] = normalizedModelId.split("/", 2);
|
|
1272
|
-
const settings =
|
|
1276
|
+
const settings = chunkIAVPPCZU_cjs.loadSettings();
|
|
1273
1277
|
const customProvider = !isMastraGatewayModel && providerId && modelName ? settings.customProviders.find((provider) => {
|
|
1274
|
-
return providerId ===
|
|
1278
|
+
return providerId === chunkIAVPPCZU_cjs.getCustomProviderId(provider.name);
|
|
1275
1279
|
}) : void 0;
|
|
1276
1280
|
if (customProvider) {
|
|
1277
1281
|
return new llm.ModelRouterLanguageModel({
|
|
@@ -1281,7 +1285,7 @@ function resolveModel(modelId, options) {
|
|
|
1281
1285
|
headers
|
|
1282
1286
|
});
|
|
1283
1287
|
}
|
|
1284
|
-
const mgApiKey = authStorage.getStoredApiKey(
|
|
1288
|
+
const mgApiKey = authStorage.getStoredApiKey(chunkIAVPPCZU_cjs.MEMORY_GATEWAY_PROVIDER) ?? process.env["MASTRA_GATEWAY_API_KEY"];
|
|
1285
1289
|
if (mgApiKey && isMastraGatewayModel) {
|
|
1286
1290
|
const rawBase = settings.memoryGateway?.baseUrl ?? process.env["MASTRA_GATEWAY_URL"] ?? "https://gateway-api.mastra.ai";
|
|
1287
1291
|
const gatewayBaseURL = rawBase.replace(/\/+$/, "").replace(/\/v1$/, "") + "/v1";
|
|
@@ -1452,6 +1456,7 @@ function getDynamicMemory(storage, vector) {
|
|
|
1452
1456
|
retrieval: vector ? { vector: true } : true,
|
|
1453
1457
|
scope: omScope,
|
|
1454
1458
|
activateAfterIdle: "5m",
|
|
1459
|
+
activateOnProviderChange: true,
|
|
1455
1460
|
observation: {
|
|
1456
1461
|
bufferTokens: isResourceScope ? false : 1 / 5,
|
|
1457
1462
|
bufferActivation: isResourceScope ? void 0 : 2e3,
|
|
@@ -2684,8 +2689,8 @@ async function createMastraCode(config) {
|
|
|
2684
2689
|
const cwd = config?.cwd ?? process.cwd();
|
|
2685
2690
|
const gatewayRegistry = llm.GatewayRegistry.getInstance({ useDynamicLoading: true });
|
|
2686
2691
|
const authStorage2 = createAuthStorage();
|
|
2687
|
-
const globalSettings =
|
|
2688
|
-
const storedGatewayKey = authStorage2.getStoredApiKey(
|
|
2692
|
+
const globalSettings = chunkIAVPPCZU_cjs.loadSettings(config?.settingsPath);
|
|
2693
|
+
const storedGatewayKey = authStorage2.getStoredApiKey(chunkIAVPPCZU_cjs.MEMORY_GATEWAY_PROVIDER);
|
|
2689
2694
|
const storedGatewayUrl = globalSettings.memoryGateway?.baseUrl;
|
|
2690
2695
|
if (storedGatewayKey) {
|
|
2691
2696
|
process.env["MASTRA_GATEWAY_API_KEY"] ??= storedGatewayKey;
|
|
@@ -2700,11 +2705,11 @@ async function createMastraCode(config) {
|
|
|
2700
2705
|
const envVars = cfg?.apiKeyEnvVar;
|
|
2701
2706
|
providerEnvVars[provider] = Array.isArray(envVars) ? envVars[0] : envVars;
|
|
2702
2707
|
}
|
|
2703
|
-
providerEnvVars[
|
|
2708
|
+
providerEnvVars[chunkIAVPPCZU_cjs.MEMORY_GATEWAY_PROVIDER] ??= "MASTRA_GATEWAY_API_KEY";
|
|
2704
2709
|
authStorage2.loadStoredApiKeysIntoEnv(providerEnvVars);
|
|
2705
2710
|
} catch {
|
|
2706
2711
|
authStorage2.loadStoredApiKeysIntoEnv({
|
|
2707
|
-
[
|
|
2712
|
+
[chunkIAVPPCZU_cjs.MEMORY_GATEWAY_PROVIDER]: "MASTRA_GATEWAY_API_KEY",
|
|
2708
2713
|
anthropic: "ANTHROPIC_API_KEY",
|
|
2709
2714
|
openai: "OPENAI_API_KEY",
|
|
2710
2715
|
google: "GOOGLE_GENERATIVE_AI_API_KEY",
|
|
@@ -2717,7 +2722,7 @@ async function createMastraCode(config) {
|
|
|
2717
2722
|
} catch (error) {
|
|
2718
2723
|
console.warn("Failed to sync gateways at startup", error);
|
|
2719
2724
|
}
|
|
2720
|
-
const mgApiKey = authStorage2.getStoredApiKey(
|
|
2725
|
+
const mgApiKey = authStorage2.getStoredApiKey(chunkIAVPPCZU_cjs.MEMORY_GATEWAY_PROVIDER) ?? process.env["MASTRA_GATEWAY_API_KEY"];
|
|
2721
2726
|
const project = chunkWWCN7QMN_cjs.detectProject(cwd);
|
|
2722
2727
|
const resourceIdOverride = chunkWWCN7QMN_cjs.getResourceIdOverride(project.rootPath);
|
|
2723
2728
|
if (resourceIdOverride) {
|
|
@@ -2761,21 +2766,21 @@ async function createMastraCode(config) {
|
|
|
2761
2766
|
name: "Build",
|
|
2762
2767
|
default: true,
|
|
2763
2768
|
defaultModelId: "anthropic/claude-opus-4-6",
|
|
2764
|
-
color:
|
|
2769
|
+
color: chunkIAVPPCZU_cjs.mastra.green,
|
|
2765
2770
|
agent: codeAgent
|
|
2766
2771
|
},
|
|
2767
2772
|
{
|
|
2768
2773
|
id: "plan",
|
|
2769
2774
|
name: "Plan",
|
|
2770
2775
|
defaultModelId: "openai/gpt-5.2-codex",
|
|
2771
|
-
color:
|
|
2776
|
+
color: chunkIAVPPCZU_cjs.mastra.purple,
|
|
2772
2777
|
agent: codeAgent
|
|
2773
2778
|
},
|
|
2774
2779
|
{
|
|
2775
2780
|
id: "fast",
|
|
2776
2781
|
name: "Fast",
|
|
2777
2782
|
defaultModelId: "cerebras/zai-glm-4.7",
|
|
2778
|
-
color:
|
|
2783
|
+
color: chunkIAVPPCZU_cjs.mastra.orange,
|
|
2779
2784
|
agent: codeAgent
|
|
2780
2785
|
}
|
|
2781
2786
|
];
|
|
@@ -2812,10 +2817,10 @@ async function createMastraCode(config) {
|
|
|
2812
2817
|
}
|
|
2813
2818
|
} catch {
|
|
2814
2819
|
}
|
|
2815
|
-
const builtinPacks =
|
|
2816
|
-
const builtinOmPacks =
|
|
2817
|
-
const effectiveDefaults =
|
|
2818
|
-
const effectiveOmModel =
|
|
2820
|
+
const builtinPacks = chunkIAVPPCZU_cjs.getAvailableModePacks(startupAccess);
|
|
2821
|
+
const builtinOmPacks = chunkIAVPPCZU_cjs.getAvailableOmPacks(startupAccess);
|
|
2822
|
+
const effectiveDefaults = chunkIAVPPCZU_cjs.resolveModelDefaults(globalSettings, builtinPacks);
|
|
2823
|
+
const effectiveOmModel = chunkIAVPPCZU_cjs.resolveOmModel(globalSettings, builtinOmPacks);
|
|
2819
2824
|
const effectiveObservationThreshold = globalSettings.models.omObservationThreshold ?? void 0;
|
|
2820
2825
|
const effectiveReflectionThreshold = globalSettings.models.omReflectionThreshold ?? void 0;
|
|
2821
2826
|
const modes = (config?.modes ?? defaultModes).map((mode) => {
|
|
@@ -2890,7 +2895,7 @@ async function createMastraCode(config) {
|
|
|
2890
2895
|
modes,
|
|
2891
2896
|
heartbeatHandlers: config?.heartbeatHandlers ?? defaultHeartbeatHandlers,
|
|
2892
2897
|
modelAuthChecker: (provider) => {
|
|
2893
|
-
const gatewayKey = authStorage2.getStoredApiKey(
|
|
2898
|
+
const gatewayKey = authStorage2.getStoredApiKey(chunkIAVPPCZU_cjs.MEMORY_GATEWAY_PROVIDER) ?? process.env["MASTRA_GATEWAY_API_KEY"];
|
|
2894
2899
|
if (gatewayKey) {
|
|
2895
2900
|
const providerConfig = gatewayRegistry.getProviders()[provider];
|
|
2896
2901
|
if (providerConfig?.gateway === "mastra") return true;
|
|
@@ -2914,32 +2919,32 @@ async function createMastraCode(config) {
|
|
|
2914
2919
|
return true;
|
|
2915
2920
|
}
|
|
2916
2921
|
}
|
|
2917
|
-
const customProvider =
|
|
2918
|
-
return provider ===
|
|
2922
|
+
const customProvider = chunkIAVPPCZU_cjs.loadSettings().customProviders.find((entry) => {
|
|
2923
|
+
return provider === chunkIAVPPCZU_cjs.getCustomProviderId(entry.name);
|
|
2919
2924
|
});
|
|
2920
2925
|
if (customProvider) {
|
|
2921
2926
|
return true;
|
|
2922
2927
|
}
|
|
2923
2928
|
return void 0;
|
|
2924
2929
|
},
|
|
2925
|
-
modelUseCountProvider: () =>
|
|
2930
|
+
modelUseCountProvider: () => chunkIAVPPCZU_cjs.loadSettings().modelUseCounts,
|
|
2926
2931
|
modelUseCountTracker: (modelId) => {
|
|
2927
2932
|
try {
|
|
2928
|
-
const settings =
|
|
2933
|
+
const settings = chunkIAVPPCZU_cjs.loadSettings();
|
|
2929
2934
|
settings.modelUseCounts[modelId] = (settings.modelUseCounts[modelId] ?? 0) + 1;
|
|
2930
|
-
|
|
2935
|
+
chunkIAVPPCZU_cjs.saveSettings(settings);
|
|
2931
2936
|
} catch (error) {
|
|
2932
2937
|
console.error("Failed to persist model usage count", error);
|
|
2933
2938
|
}
|
|
2934
2939
|
},
|
|
2935
2940
|
customModelCatalogProvider: () => {
|
|
2936
|
-
const settings =
|
|
2941
|
+
const settings = chunkIAVPPCZU_cjs.loadSettings();
|
|
2937
2942
|
const customModels = [];
|
|
2938
2943
|
for (const provider of settings.customProviders) {
|
|
2939
|
-
const providerId =
|
|
2944
|
+
const providerId = chunkIAVPPCZU_cjs.getCustomProviderId(provider.name);
|
|
2940
2945
|
for (const modelName of provider.models) {
|
|
2941
2946
|
customModels.push({
|
|
2942
|
-
id:
|
|
2947
|
+
id: chunkIAVPPCZU_cjs.toCustomProviderModelId(provider.name, modelName),
|
|
2943
2948
|
provider: providerId,
|
|
2944
2949
|
modelName,
|
|
2945
2950
|
hasApiKey: true,
|
|
@@ -2950,8 +2955,8 @@ async function createMastraCode(config) {
|
|
|
2950
2955
|
return customModels;
|
|
2951
2956
|
},
|
|
2952
2957
|
threadLock: {
|
|
2953
|
-
acquire:
|
|
2954
|
-
release:
|
|
2958
|
+
acquire: chunkIAVPPCZU_cjs.acquireThreadLock,
|
|
2959
|
+
release: chunkIAVPPCZU_cjs.releaseThreadLock
|
|
2955
2960
|
}
|
|
2956
2961
|
});
|
|
2957
2962
|
if (hookManager) {
|
|
@@ -2978,5 +2983,5 @@ async function createMastraCode(config) {
|
|
|
2978
2983
|
|
|
2979
2984
|
exports.createAuthStorage = createAuthStorage;
|
|
2980
2985
|
exports.createMastraCode = createMastraCode;
|
|
2981
|
-
//# sourceMappingURL=chunk-
|
|
2982
|
-
//# sourceMappingURL=chunk-
|
|
2986
|
+
//# sourceMappingURL=chunk-7MMP7U7Y.cjs.map
|
|
2987
|
+
//# sourceMappingURL=chunk-7MMP7U7Y.cjs.map
|