mastracode 0.15.2 → 0.15.3-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 +22 -0
- package/dist/{chunk-LSDPE3G3.cjs → chunk-4JXUPAOX.cjs} +39 -36
- package/dist/chunk-4JXUPAOX.cjs.map +1 -0
- package/dist/{chunk-D6MEBQTC.js → chunk-DGV7E3NQ.js} +9 -5
- package/dist/chunk-DGV7E3NQ.js.map +1 -0
- package/dist/{chunk-7Z47LGHL.js → chunk-DZWKQK2G.js} +13 -10
- package/dist/chunk-DZWKQK2G.js.map +1 -0
- package/dist/{chunk-IAVPPCZU.cjs → chunk-EUBI4VAT.cjs} +9 -5
- package/dist/chunk-EUBI4VAT.cjs.map +1 -0
- package/dist/{chunk-Y6BZKCG3.cjs → chunk-KESI6MLB.cjs} +861 -954
- package/dist/chunk-KESI6MLB.cjs.map +1 -0
- package/dist/{chunk-YEHNNDZZ.js → chunk-N4RNJU3D.js} +82 -175
- package/dist/chunk-N4RNJU3D.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.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/onboarding/index.d.ts +1 -1
- package/dist/onboarding/index.d.ts.map +1 -1
- package/dist/onboarding/settings.d.ts +31 -4
- package/dist/onboarding/settings.d.ts.map +1 -1
- package/dist/tui/commands/clone.d.ts.map +1 -1
- package/dist/tui/commands/new.d.ts +1 -1
- package/dist/tui/commands/new.d.ts.map +1 -1
- package/dist/tui/commands/om.d.ts +13 -0
- package/dist/tui/commands/om.d.ts.map +1 -1
- package/dist/tui/components/model-selector.d.ts +10 -0
- package/dist/tui/components/model-selector.d.ts.map +1 -1
- package/dist/tui/components/om-settings.d.ts +5 -23
- package/dist/tui/components/om-settings.d.ts.map +1 -1
- package/dist/tui/event-dispatch.d.ts.map +1 -1
- package/dist/tui/mastra-tui.d.ts.map +1 -1
- package/dist/tui/setup.d.ts.map +1 -1
- package/dist/tui.cjs +19 -19
- package/dist/tui.js +2 -2
- package/package.json +7 -7
- package/dist/chunk-7Z47LGHL.js.map +0 -1
- package/dist/chunk-D6MEBQTC.js.map +0 -1
- package/dist/chunk-IAVPPCZU.cjs.map +0 -1
- package/dist/chunk-LSDPE3G3.cjs.map +0 -1
- package/dist/chunk-Y6BZKCG3.cjs.map +0 -1
- package/dist/chunk-YEHNNDZZ.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# mastracode
|
|
2
2
|
|
|
3
|
+
## 0.15.3-alpha.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Enable ProviderHistoryCompat error processor by default in mastracode ([#15730](https://github.com/mastra-ai/mastra/pull/15730))
|
|
8
|
+
|
|
9
|
+
- Fixed task lists, active plans, and sandbox paths leaking across threads. These per-thread state values are now properly cleared when switching threads, creating new threads, cloning threads, or using the /new command. ([#15749](https://github.com/mastra-ai/mastra/pull/15749))
|
|
10
|
+
|
|
11
|
+
- Allow typing a custom model string in `/om` (Observational Memory settings). The observer and reflector model pickers now use the same picker as `/models` — type a model id like `deepseek/deepseek-v4-flash` to use it directly if it's not in the list. ([#15703](https://github.com/mastra-ai/mastra/pull/15703))
|
|
12
|
+
|
|
13
|
+
Observer and reflector model overrides are now persisted independently — changing one in `/om` no longer overwrites the other. Legacy `omModelOverride` is preserved as a shared fallback for settings files written before this change.
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [[`7a7b313`](https://github.com/mastra-ai/mastra/commit/7a7b3138fb3bcf0b0c740eaea07971e43d330ef3), [`a6dac0a`](https://github.com/mastra-ai/mastra/commit/a6dac0a40c7181161b1add4e8534f962bcbc9aa7), [`9cef83b`](https://github.com/mastra-ai/mastra/commit/9cef83b8a642b8098747772921e3523b492bafbc), [`d30e215`](https://github.com/mastra-ai/mastra/commit/d30e2156c746bc9fd791745cec1cc24377b66789), [`73b45fa`](https://github.com/mastra-ai/mastra/commit/73b45facdef4fbcb8af710c50f0646f18619dbaa), [`7a7b313`](https://github.com/mastra-ai/mastra/commit/7a7b3138fb3bcf0b0c740eaea07971e43d330ef3)]:
|
|
16
|
+
- @mastra/core@1.29.0-alpha.1
|
|
17
|
+
|
|
18
|
+
## 0.15.3-alpha.0
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [[`b510d36`](https://github.com/mastra-ai/mastra/commit/b510d368f73dab6be2e2c2bc99035aaef1fb7d7a)]:
|
|
23
|
+
- @mastra/core@1.29.0-alpha.0
|
|
24
|
+
|
|
3
25
|
## 0.15.2
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkEUBI4VAT_cjs = require('./chunk-EUBI4VAT.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');
|
|
@@ -454,8 +454,8 @@ function getDynamicWorkspace({ requestContext, mastra: mastra2 }) {
|
|
|
454
454
|
existing.setToolsConfig(isPlanMode ? { ...chunkOBFBUWOR_cjs.TOOL_NAME_OVERRIDES, ...planModeTools } : chunkOBFBUWOR_cjs.TOOL_NAME_OVERRIDES);
|
|
455
455
|
return existing;
|
|
456
456
|
}
|
|
457
|
-
const userLsp =
|
|
458
|
-
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-
|
|
457
|
+
const userLsp = chunkEUBI4VAT_cjs.loadSettings().lsp ?? {};
|
|
458
|
+
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-4JXUPAOX.cjs', document.baseURI).href)))), "..");
|
|
459
459
|
const lspConfig = {
|
|
460
460
|
...userLsp,
|
|
461
461
|
packageRunner: userLsp.packageRunner || detectPackageRunner(projectPath),
|
|
@@ -1234,9 +1234,9 @@ function resolveModel(modelId, options) {
|
|
|
1234
1234
|
const isMastraGatewayModel = modelId.startsWith(MASTRA_GATEWAY_PREFIX);
|
|
1235
1235
|
const normalizedModelId = stripMastraGatewayPrefix(modelId);
|
|
1236
1236
|
const [providerId, modelName] = normalizedModelId.split("/", 2);
|
|
1237
|
-
const settings =
|
|
1237
|
+
const settings = chunkEUBI4VAT_cjs.loadSettings();
|
|
1238
1238
|
const customProvider = !isMastraGatewayModel && providerId && modelName ? settings.customProviders.find((provider) => {
|
|
1239
|
-
return providerId ===
|
|
1239
|
+
return providerId === chunkEUBI4VAT_cjs.getCustomProviderId(provider.name);
|
|
1240
1240
|
}) : void 0;
|
|
1241
1241
|
if (customProvider) {
|
|
1242
1242
|
return new llm.ModelRouterLanguageModel({
|
|
@@ -1246,7 +1246,7 @@ function resolveModel(modelId, options) {
|
|
|
1246
1246
|
headers
|
|
1247
1247
|
});
|
|
1248
1248
|
}
|
|
1249
|
-
const mgApiKey = authStorage.getStoredApiKey(
|
|
1249
|
+
const mgApiKey = authStorage.getStoredApiKey(chunkEUBI4VAT_cjs.MEMORY_GATEWAY_PROVIDER) ?? process.env["MASTRA_GATEWAY_API_KEY"];
|
|
1250
1250
|
if (mgApiKey && isMastraGatewayModel) {
|
|
1251
1251
|
const rawBase = settings.memoryGateway?.baseUrl ?? process.env["MASTRA_GATEWAY_URL"] ?? "https://gateway-api.mastra.ai";
|
|
1252
1252
|
const gatewayBaseURL = rawBase.replace(/\/+$/, "").replace(/\/v1$/, "") + "/v1";
|
|
@@ -2395,7 +2395,7 @@ var stateSchema = zod.z.object({
|
|
|
2395
2395
|
smartEditing: zod.z.boolean().default(true),
|
|
2396
2396
|
// Notification mode — alert when TUI needs user attention
|
|
2397
2397
|
notifications: zod.z.enum(["bell", "system", "both", "off"]).default("off"),
|
|
2398
|
-
// Task list (
|
|
2398
|
+
// Task list (ephemeral per-thread, cleared on thread switch/creation)
|
|
2399
2399
|
tasks: zod.z.array(
|
|
2400
2400
|
zod.z.object({
|
|
2401
2401
|
content: zod.z.string(),
|
|
@@ -2651,8 +2651,8 @@ async function createMastraCode(config) {
|
|
|
2651
2651
|
const cwd = config?.cwd ?? process.cwd();
|
|
2652
2652
|
const gatewayRegistry = llm.GatewayRegistry.getInstance({ useDynamicLoading: true });
|
|
2653
2653
|
const authStorage2 = createAuthStorage();
|
|
2654
|
-
const globalSettings =
|
|
2655
|
-
const storedGatewayKey = authStorage2.getStoredApiKey(
|
|
2654
|
+
const globalSettings = chunkEUBI4VAT_cjs.loadSettings(config?.settingsPath);
|
|
2655
|
+
const storedGatewayKey = authStorage2.getStoredApiKey(chunkEUBI4VAT_cjs.MEMORY_GATEWAY_PROVIDER);
|
|
2656
2656
|
const storedGatewayUrl = globalSettings.memoryGateway?.baseUrl;
|
|
2657
2657
|
if (storedGatewayKey) {
|
|
2658
2658
|
process.env["MASTRA_GATEWAY_API_KEY"] ??= storedGatewayKey;
|
|
@@ -2667,11 +2667,11 @@ async function createMastraCode(config) {
|
|
|
2667
2667
|
const envVars = cfg?.apiKeyEnvVar;
|
|
2668
2668
|
providerEnvVars[provider] = Array.isArray(envVars) ? envVars[0] : envVars;
|
|
2669
2669
|
}
|
|
2670
|
-
providerEnvVars[
|
|
2670
|
+
providerEnvVars[chunkEUBI4VAT_cjs.MEMORY_GATEWAY_PROVIDER] ??= "MASTRA_GATEWAY_API_KEY";
|
|
2671
2671
|
authStorage2.loadStoredApiKeysIntoEnv(providerEnvVars);
|
|
2672
2672
|
} catch {
|
|
2673
2673
|
authStorage2.loadStoredApiKeysIntoEnv({
|
|
2674
|
-
[
|
|
2674
|
+
[chunkEUBI4VAT_cjs.MEMORY_GATEWAY_PROVIDER]: "MASTRA_GATEWAY_API_KEY",
|
|
2675
2675
|
anthropic: "ANTHROPIC_API_KEY",
|
|
2676
2676
|
openai: "OPENAI_API_KEY",
|
|
2677
2677
|
google: "GOOGLE_GENERATIVE_AI_API_KEY",
|
|
@@ -2684,7 +2684,7 @@ async function createMastraCode(config) {
|
|
|
2684
2684
|
} catch (error) {
|
|
2685
2685
|
console.warn("Failed to sync gateways at startup", error);
|
|
2686
2686
|
}
|
|
2687
|
-
const mgApiKey = authStorage2.getStoredApiKey(
|
|
2687
|
+
const mgApiKey = authStorage2.getStoredApiKey(chunkEUBI4VAT_cjs.MEMORY_GATEWAY_PROVIDER) ?? process.env["MASTRA_GATEWAY_API_KEY"];
|
|
2688
2688
|
const project = chunkWWCN7QMN_cjs.detectProject(cwd);
|
|
2689
2689
|
const resourceIdOverride = chunkWWCN7QMN_cjs.getResourceIdOverride(project.rootPath);
|
|
2690
2690
|
if (resourceIdOverride) {
|
|
@@ -2719,7 +2719,7 @@ async function createMastraCode(config) {
|
|
|
2719
2719
|
}
|
|
2720
2720
|
})
|
|
2721
2721
|
],
|
|
2722
|
-
errorProcessors: [new processors.PrefillErrorHandler()]
|
|
2722
|
+
errorProcessors: [new processors.PrefillErrorHandler(), new processors.ProviderHistoryCompat()]
|
|
2723
2723
|
});
|
|
2724
2724
|
const defaultSubagents = [exploreSubagent, planSubagent, executeSubagent];
|
|
2725
2725
|
const defaultModes = [
|
|
@@ -2728,21 +2728,21 @@ async function createMastraCode(config) {
|
|
|
2728
2728
|
name: "Build",
|
|
2729
2729
|
default: true,
|
|
2730
2730
|
defaultModelId: "anthropic/claude-opus-4-6",
|
|
2731
|
-
color:
|
|
2731
|
+
color: chunkEUBI4VAT_cjs.mastra.green,
|
|
2732
2732
|
agent: codeAgent
|
|
2733
2733
|
},
|
|
2734
2734
|
{
|
|
2735
2735
|
id: "plan",
|
|
2736
2736
|
name: "Plan",
|
|
2737
2737
|
defaultModelId: "openai/gpt-5.2-codex",
|
|
2738
|
-
color:
|
|
2738
|
+
color: chunkEUBI4VAT_cjs.mastra.purple,
|
|
2739
2739
|
agent: codeAgent
|
|
2740
2740
|
},
|
|
2741
2741
|
{
|
|
2742
2742
|
id: "fast",
|
|
2743
2743
|
name: "Fast",
|
|
2744
2744
|
defaultModelId: "cerebras/zai-glm-4.7",
|
|
2745
|
-
color:
|
|
2745
|
+
color: chunkEUBI4VAT_cjs.mastra.orange,
|
|
2746
2746
|
agent: codeAgent
|
|
2747
2747
|
}
|
|
2748
2748
|
];
|
|
@@ -2779,10 +2779,11 @@ async function createMastraCode(config) {
|
|
|
2779
2779
|
}
|
|
2780
2780
|
} catch {
|
|
2781
2781
|
}
|
|
2782
|
-
const builtinPacks =
|
|
2783
|
-
const builtinOmPacks =
|
|
2784
|
-
const effectiveDefaults =
|
|
2785
|
-
const
|
|
2782
|
+
const builtinPacks = chunkEUBI4VAT_cjs.getAvailableModePacks(startupAccess);
|
|
2783
|
+
const builtinOmPacks = chunkEUBI4VAT_cjs.getAvailableOmPacks(startupAccess);
|
|
2784
|
+
const effectiveDefaults = chunkEUBI4VAT_cjs.resolveModelDefaults(globalSettings, builtinPacks);
|
|
2785
|
+
const effectiveObserverModel = chunkEUBI4VAT_cjs.resolveOmRoleModel(globalSettings, "observer", builtinOmPacks);
|
|
2786
|
+
const effectiveReflectorModel = chunkEUBI4VAT_cjs.resolveOmRoleModel(globalSettings, "reflector", builtinOmPacks);
|
|
2786
2787
|
const effectiveObservationThreshold = globalSettings.models.omObservationThreshold ?? void 0;
|
|
2787
2788
|
const effectiveReflectionThreshold = globalSettings.models.omReflectionThreshold ?? void 0;
|
|
2788
2789
|
const modes = (config?.modes ?? defaultModes).map((mode) => {
|
|
@@ -2811,9 +2812,11 @@ async function createMastraCode(config) {
|
|
|
2811
2812
|
return model ? { ...filtered, defaultModelId: model } : filtered;
|
|
2812
2813
|
});
|
|
2813
2814
|
const globalInitialState = {};
|
|
2814
|
-
if (
|
|
2815
|
-
globalInitialState.observerModelId =
|
|
2816
|
-
|
|
2815
|
+
if (effectiveObserverModel) {
|
|
2816
|
+
globalInitialState.observerModelId = effectiveObserverModel;
|
|
2817
|
+
}
|
|
2818
|
+
if (effectiveReflectorModel) {
|
|
2819
|
+
globalInitialState.reflectorModelId = effectiveReflectorModel;
|
|
2817
2820
|
}
|
|
2818
2821
|
if (effectiveObservationThreshold !== void 0) {
|
|
2819
2822
|
globalInitialState.observationThreshold = effectiveObservationThreshold;
|
|
@@ -2857,7 +2860,7 @@ async function createMastraCode(config) {
|
|
|
2857
2860
|
modes,
|
|
2858
2861
|
heartbeatHandlers: config?.heartbeatHandlers ?? defaultHeartbeatHandlers,
|
|
2859
2862
|
modelAuthChecker: (provider) => {
|
|
2860
|
-
const gatewayKey = authStorage2.getStoredApiKey(
|
|
2863
|
+
const gatewayKey = authStorage2.getStoredApiKey(chunkEUBI4VAT_cjs.MEMORY_GATEWAY_PROVIDER) ?? process.env["MASTRA_GATEWAY_API_KEY"];
|
|
2861
2864
|
if (gatewayKey) {
|
|
2862
2865
|
const providerConfig = gatewayRegistry.getProviders()[provider];
|
|
2863
2866
|
if (providerConfig?.gateway === "mastra") return true;
|
|
@@ -2881,32 +2884,32 @@ async function createMastraCode(config) {
|
|
|
2881
2884
|
return true;
|
|
2882
2885
|
}
|
|
2883
2886
|
}
|
|
2884
|
-
const customProvider =
|
|
2885
|
-
return provider ===
|
|
2887
|
+
const customProvider = chunkEUBI4VAT_cjs.loadSettings().customProviders.find((entry) => {
|
|
2888
|
+
return provider === chunkEUBI4VAT_cjs.getCustomProviderId(entry.name);
|
|
2886
2889
|
});
|
|
2887
2890
|
if (customProvider) {
|
|
2888
2891
|
return true;
|
|
2889
2892
|
}
|
|
2890
2893
|
return void 0;
|
|
2891
2894
|
},
|
|
2892
|
-
modelUseCountProvider: () =>
|
|
2895
|
+
modelUseCountProvider: () => chunkEUBI4VAT_cjs.loadSettings().modelUseCounts,
|
|
2893
2896
|
modelUseCountTracker: (modelId) => {
|
|
2894
2897
|
try {
|
|
2895
|
-
const settings =
|
|
2898
|
+
const settings = chunkEUBI4VAT_cjs.loadSettings();
|
|
2896
2899
|
settings.modelUseCounts[modelId] = (settings.modelUseCounts[modelId] ?? 0) + 1;
|
|
2897
|
-
|
|
2900
|
+
chunkEUBI4VAT_cjs.saveSettings(settings);
|
|
2898
2901
|
} catch (error) {
|
|
2899
2902
|
console.error("Failed to persist model usage count", error);
|
|
2900
2903
|
}
|
|
2901
2904
|
},
|
|
2902
2905
|
customModelCatalogProvider: () => {
|
|
2903
|
-
const settings =
|
|
2906
|
+
const settings = chunkEUBI4VAT_cjs.loadSettings();
|
|
2904
2907
|
const customModels = [];
|
|
2905
2908
|
for (const provider of settings.customProviders) {
|
|
2906
|
-
const providerId =
|
|
2909
|
+
const providerId = chunkEUBI4VAT_cjs.getCustomProviderId(provider.name);
|
|
2907
2910
|
for (const modelName of provider.models) {
|
|
2908
2911
|
customModels.push({
|
|
2909
|
-
id:
|
|
2912
|
+
id: chunkEUBI4VAT_cjs.toCustomProviderModelId(provider.name, modelName),
|
|
2910
2913
|
provider: providerId,
|
|
2911
2914
|
modelName,
|
|
2912
2915
|
hasApiKey: true,
|
|
@@ -2917,8 +2920,8 @@ async function createMastraCode(config) {
|
|
|
2917
2920
|
return customModels;
|
|
2918
2921
|
},
|
|
2919
2922
|
threadLock: {
|
|
2920
|
-
acquire:
|
|
2921
|
-
release:
|
|
2923
|
+
acquire: chunkEUBI4VAT_cjs.acquireThreadLock,
|
|
2924
|
+
release: chunkEUBI4VAT_cjs.releaseThreadLock
|
|
2922
2925
|
}
|
|
2923
2926
|
});
|
|
2924
2927
|
if (hookManager) {
|
|
@@ -2945,5 +2948,5 @@ async function createMastraCode(config) {
|
|
|
2945
2948
|
|
|
2946
2949
|
exports.createAuthStorage = createAuthStorage;
|
|
2947
2950
|
exports.createMastraCode = createMastraCode;
|
|
2948
|
-
//# sourceMappingURL=chunk-
|
|
2949
|
-
//# sourceMappingURL=chunk-
|
|
2951
|
+
//# sourceMappingURL=chunk-4JXUPAOX.cjs.map
|
|
2952
|
+
//# sourceMappingURL=chunk-4JXUPAOX.cjs.map
|