mastracode 0.17.3-alpha.2 → 0.18.0-alpha.4
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 +30 -0
- package/dist/{chunk-BHK3OFI3.cjs → chunk-7D6OWKI5.cjs} +36 -35
- package/dist/chunk-7D6OWKI5.cjs.map +1 -0
- package/dist/{chunk-RYAKKVIH.cjs → chunk-AKCX3YGZ.cjs} +1401 -1787
- package/dist/chunk-AKCX3YGZ.cjs.map +1 -0
- package/dist/{chunk-ZYG7WE7V.js → chunk-DLPHNLNC.js} +6 -5
- package/dist/chunk-DLPHNLNC.js.map +1 -0
- package/dist/{chunk-FXESWZUH.js → chunk-E56ARDWV.js} +6 -10
- package/dist/chunk-E56ARDWV.js.map +1 -0
- package/dist/{chunk-6FHOMZRJ.js → chunk-R32CWN25.js} +620 -1006
- package/dist/chunk-R32CWN25.js.map +1 -0
- package/dist/{chunk-P6EKFEJB.cjs → chunk-RLAPZNQF.cjs} +6 -10
- package/dist/chunk-RLAPZNQF.cjs.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 +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/onboarding/onboarding-inline.d.ts +5 -5
- package/dist/onboarding/onboarding-inline.d.ts.map +1 -1
- package/dist/tui/commands/api-keys.d.ts.map +1 -1
- package/dist/tui/commands/browser.d.ts.map +1 -1
- package/dist/tui/commands/clone.d.ts.map +1 -1
- package/dist/tui/commands/custom-providers.d.ts.map +1 -1
- package/dist/tui/commands/login.d.ts.map +1 -1
- package/dist/tui/commands/mcp.d.ts.map +1 -1
- package/dist/tui/commands/memory-gateway.d.ts.map +1 -1
- package/dist/tui/commands/models-pack.d.ts.map +1 -1
- package/dist/tui/commands/observability.d.ts.map +1 -1
- package/dist/tui/commands/om.d.ts.map +1 -1
- package/dist/tui/commands/sandbox.d.ts.map +1 -1
- package/dist/tui/commands/settings.d.ts.map +1 -1
- package/dist/tui/commands/subagents.d.ts.map +1 -1
- package/dist/tui/commands/think.d.ts.map +1 -1
- package/dist/tui/commands/thread-tag-dir.d.ts.map +1 -1
- package/dist/tui/commands/threads.d.ts.map +1 -1
- package/dist/tui/commands/update.d.ts.map +1 -1
- package/dist/tui/components/ask-question-dialog.d.ts +4 -0
- package/dist/tui/components/ask-question-dialog.d.ts.map +1 -1
- package/dist/tui/handlers/prompts.d.ts.map +1 -1
- package/dist/tui/handlers/tool.d.ts.map +1 -1
- package/dist/tui/mastra-tui.d.ts +1 -1
- package/dist/tui/mastra-tui.d.ts.map +1 -1
- package/dist/tui/modal-question.d.ts +18 -0
- package/dist/tui/modal-question.d.ts.map +1 -0
- package/dist/tui/overlay.d.ts +12 -0
- package/dist/tui/overlay.d.ts.map +1 -0
- package/dist/tui/prompt-api-key.d.ts.map +1 -1
- package/dist/tui.cjs +19 -19
- package/dist/tui.js +2 -2
- package/package.json +3 -3
- package/dist/chunk-6FHOMZRJ.js.map +0 -1
- package/dist/chunk-BHK3OFI3.cjs.map +0 -1
- package/dist/chunk-FXESWZUH.js.map +0 -1
- package/dist/chunk-P6EKFEJB.cjs.map +0 -1
- package/dist/chunk-RYAKKVIH.cjs.map +0 -1
- package/dist/chunk-ZYG7WE7V.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# mastracode
|
|
2
2
|
|
|
3
|
+
## 0.18.0-alpha.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`087e413`](https://github.com/mastra-ai/mastra/commit/087e4133e5d6efa36619e9556c16750e4179c047), [`087e413`](https://github.com/mastra-ai/mastra/commit/087e4133e5d6efa36619e9556c16750e4179c047), [`087e413`](https://github.com/mastra-ai/mastra/commit/087e4133e5d6efa36619e9556c16750e4179c047)]:
|
|
8
|
+
- @mastra/core@1.33.0-alpha.3
|
|
9
|
+
|
|
10
|
+
## 0.18.0-alpha.3
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- You can now pass a `memory` option to `createMastraCode()` to override the default memory instance or factory. This gives you a supported way to plug in custom memory behavior without depending on Mastra Code's default setup. ([#13891](https://github.com/mastra-ai/mastra/pull/13891))
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { createMastraCode } from 'mastracode';
|
|
18
|
+
|
|
19
|
+
const mastraCode = await createMastraCode({
|
|
20
|
+
memory: myCustomMemory,
|
|
21
|
+
});
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Fixed setup, settings, selectors, and non-chat configuration prompts so they open as neutral overlays with stable modal sizing, while keeping active chat interactions inline. ([#16274](https://github.com/mastra-ai/mastra/pull/16274))
|
|
27
|
+
|
|
28
|
+
- Enabled `ProviderHistoryCompat` by default for MastraCode agents. MastraCode now applies provider-boundary prompt compatibility fixes before model requests and keeps the existing API-error recovery path for provider validation errors. ([#16176](https://github.com/mastra-ai/mastra/pull/16176))
|
|
29
|
+
|
|
30
|
+
- Updated dependencies [[`d1fdbd0`](https://github.com/mastra-ai/mastra/commit/d1fdbd012add5623cb7e6b7f882b605ab358bbb4), [`d91ebe2`](https://github.com/mastra-ai/mastra/commit/d91ebe28ee065d8f2ed6df741c3c07f58d359529)]:
|
|
31
|
+
- @mastra/core@1.33.0-alpha.2
|
|
32
|
+
|
|
3
33
|
## 0.17.3-alpha.2
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkRLAPZNQF_cjs = require('./chunk-RLAPZNQF.cjs');
|
|
4
4
|
var chunkA3S5I2HC_cjs = require('./chunk-A3S5I2HC.cjs');
|
|
5
5
|
var chunkOBFBUWOR_cjs = require('./chunk-OBFBUWOR.cjs');
|
|
6
6
|
var path = require('path');
|
|
@@ -584,8 +584,8 @@ function getDynamicWorkspace({ requestContext, mastra: mastra2 }) {
|
|
|
584
584
|
existing.setToolsConfig(isPlanMode ? { ...chunkOBFBUWOR_cjs.TOOL_NAME_OVERRIDES, ...planModeTools } : chunkOBFBUWOR_cjs.TOOL_NAME_OVERRIDES);
|
|
585
585
|
return existing;
|
|
586
586
|
}
|
|
587
|
-
const userLsp =
|
|
588
|
-
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-
|
|
587
|
+
const userLsp = chunkRLAPZNQF_cjs.loadSettings().lsp ?? {};
|
|
588
|
+
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-7D6OWKI5.cjs', document.baseURI).href)))), "..");
|
|
589
589
|
const lspConfig = {
|
|
590
590
|
...userLsp,
|
|
591
591
|
packageRunner: userLsp.packageRunner || detectPackageRunner(projectPath),
|
|
@@ -1375,9 +1375,9 @@ function resolveModel(modelId, options) {
|
|
|
1375
1375
|
const isMastraGatewayModel = modelId.startsWith(MASTRA_GATEWAY_PREFIX);
|
|
1376
1376
|
const normalizedModelId = stripMastraGatewayPrefix(modelId);
|
|
1377
1377
|
const [providerId, modelName] = normalizedModelId.split("/", 2);
|
|
1378
|
-
const settings =
|
|
1378
|
+
const settings = chunkRLAPZNQF_cjs.loadSettings();
|
|
1379
1379
|
const customProvider = !isMastraGatewayModel && providerId && modelName ? settings.customProviders.find((provider) => {
|
|
1380
|
-
return providerId ===
|
|
1380
|
+
return providerId === chunkRLAPZNQF_cjs.getCustomProviderId(provider.name);
|
|
1381
1381
|
}) : void 0;
|
|
1382
1382
|
if (customProvider) {
|
|
1383
1383
|
return new llm.ModelRouterLanguageModel({
|
|
@@ -1387,7 +1387,7 @@ function resolveModel(modelId, options) {
|
|
|
1387
1387
|
headers
|
|
1388
1388
|
});
|
|
1389
1389
|
}
|
|
1390
|
-
const mgApiKey = authStorage.getStoredApiKey(
|
|
1390
|
+
const mgApiKey = authStorage.getStoredApiKey(chunkRLAPZNQF_cjs.MEMORY_GATEWAY_PROVIDER) ?? process.env["MASTRA_GATEWAY_API_KEY"];
|
|
1391
1391
|
if (mgApiKey && isMastraGatewayModel) {
|
|
1392
1392
|
const rawBase = settings.memoryGateway?.baseUrl ?? process.env["MASTRA_GATEWAY_URL"] ?? "https://gateway-api.mastra.ai";
|
|
1393
1393
|
const gatewayBaseURL = rawBase.replace(/\/+$/, "").replace(/\/v1$/, "") + "/v1";
|
|
@@ -3301,7 +3301,7 @@ function createAuthStorage() {
|
|
|
3301
3301
|
function resolveCloudObservabilityConfig(settings, authStorage2, resourceId) {
|
|
3302
3302
|
const resourceConfig = settings.observability.resources[resourceId];
|
|
3303
3303
|
if (resourceConfig) {
|
|
3304
|
-
const token = authStorage2.getStoredApiKey(`${
|
|
3304
|
+
const token = authStorage2.getStoredApiKey(`${chunkRLAPZNQF_cjs.OBSERVABILITY_AUTH_PREFIX}${resourceId}`);
|
|
3305
3305
|
if (token) {
|
|
3306
3306
|
return { accessToken: token, projectId: resourceConfig.projectId };
|
|
3307
3307
|
}
|
|
@@ -3319,8 +3319,8 @@ async function createMastraCode(config) {
|
|
|
3319
3319
|
}
|
|
3320
3320
|
const gatewayRegistry = llm.GatewayRegistry.getInstance({ useDynamicLoading: true });
|
|
3321
3321
|
const authStorage2 = createAuthStorage();
|
|
3322
|
-
const globalSettings =
|
|
3323
|
-
const storedGatewayKey = authStorage2.getStoredApiKey(
|
|
3322
|
+
const globalSettings = chunkRLAPZNQF_cjs.loadSettings(config?.settingsPath);
|
|
3323
|
+
const storedGatewayKey = authStorage2.getStoredApiKey(chunkRLAPZNQF_cjs.MEMORY_GATEWAY_PROVIDER);
|
|
3324
3324
|
const storedGatewayUrl = globalSettings.memoryGateway?.baseUrl;
|
|
3325
3325
|
if (storedGatewayKey) {
|
|
3326
3326
|
process.env["MASTRA_GATEWAY_API_KEY"] ??= storedGatewayKey;
|
|
@@ -3335,11 +3335,11 @@ async function createMastraCode(config) {
|
|
|
3335
3335
|
const envVars = cfg?.apiKeyEnvVar;
|
|
3336
3336
|
providerEnvVars[provider] = Array.isArray(envVars) ? envVars[0] : envVars;
|
|
3337
3337
|
}
|
|
3338
|
-
providerEnvVars[
|
|
3338
|
+
providerEnvVars[chunkRLAPZNQF_cjs.MEMORY_GATEWAY_PROVIDER] ??= "MASTRA_GATEWAY_API_KEY";
|
|
3339
3339
|
authStorage2.loadStoredApiKeysIntoEnv(providerEnvVars);
|
|
3340
3340
|
} catch {
|
|
3341
3341
|
authStorage2.loadStoredApiKeysIntoEnv({
|
|
3342
|
-
[
|
|
3342
|
+
[chunkRLAPZNQF_cjs.MEMORY_GATEWAY_PROVIDER]: "MASTRA_GATEWAY_API_KEY",
|
|
3343
3343
|
anthropic: "ANTHROPIC_API_KEY",
|
|
3344
3344
|
openai: "OPENAI_API_KEY",
|
|
3345
3345
|
google: "GOOGLE_GENERATIVE_AI_API_KEY",
|
|
@@ -3352,7 +3352,7 @@ async function createMastraCode(config) {
|
|
|
3352
3352
|
} catch (error) {
|
|
3353
3353
|
console.warn("Failed to sync gateways at startup", error);
|
|
3354
3354
|
}
|
|
3355
|
-
const mgApiKey = authStorage2.getStoredApiKey(
|
|
3355
|
+
const mgApiKey = authStorage2.getStoredApiKey(chunkRLAPZNQF_cjs.MEMORY_GATEWAY_PROVIDER) ?? process.env["MASTRA_GATEWAY_API_KEY"];
|
|
3356
3356
|
const project = chunkA3S5I2HC_cjs.detectProject(cwd);
|
|
3357
3357
|
const resourceIdOverride = chunkA3S5I2HC_cjs.getResourceIdOverride(project.rootPath);
|
|
3358
3358
|
if (resourceIdOverride) {
|
|
@@ -3440,7 +3440,7 @@ async function createMastraCode(config) {
|
|
|
3440
3440
|
}
|
|
3441
3441
|
});
|
|
3442
3442
|
const vectorStore = await createVectorStore(storageConfig, storageResult.backend);
|
|
3443
|
-
const memory = getDynamicMemory(storage$1, vectorStore);
|
|
3443
|
+
const memory = config?.memory ?? getDynamicMemory(storage$1, vectorStore);
|
|
3444
3444
|
const mcpManager = config?.disableMcp ? void 0 : createMcpManager(project.rootPath, config?.mcpServers);
|
|
3445
3445
|
const hookManager = config?.disableHooks ? void 0 : new HookManager(project.rootPath, "session-init");
|
|
3446
3446
|
if (hookManager?.hasHooks()) {
|
|
@@ -3473,7 +3473,8 @@ async function createMastraCode(config) {
|
|
|
3473
3473
|
const projectPath = harnessContext?.getState?.()?.projectPath ?? harnessContext?.state?.projectPath ?? project.rootPath;
|
|
3474
3474
|
return getStaticallyLoadedInstructionPaths(projectPath);
|
|
3475
3475
|
}
|
|
3476
|
-
})
|
|
3476
|
+
}),
|
|
3477
|
+
new processors.ProviderHistoryCompat()
|
|
3477
3478
|
],
|
|
3478
3479
|
errorProcessors: [new processors.StreamErrorRetryProcessor(), new processors.PrefillErrorHandler(), new processors.ProviderHistoryCompat()]
|
|
3479
3480
|
});
|
|
@@ -3484,21 +3485,21 @@ async function createMastraCode(config) {
|
|
|
3484
3485
|
name: "Build",
|
|
3485
3486
|
default: true,
|
|
3486
3487
|
defaultModelId: "anthropic/claude-opus-4-6",
|
|
3487
|
-
color:
|
|
3488
|
+
color: chunkRLAPZNQF_cjs.mastra.green,
|
|
3488
3489
|
agent: codeAgent
|
|
3489
3490
|
},
|
|
3490
3491
|
{
|
|
3491
3492
|
id: "plan",
|
|
3492
3493
|
name: "Plan",
|
|
3493
3494
|
defaultModelId: "openai/gpt-5.2-codex",
|
|
3494
|
-
color:
|
|
3495
|
+
color: chunkRLAPZNQF_cjs.mastra.purple,
|
|
3495
3496
|
agent: codeAgent
|
|
3496
3497
|
},
|
|
3497
3498
|
{
|
|
3498
3499
|
id: "fast",
|
|
3499
3500
|
name: "Fast",
|
|
3500
3501
|
defaultModelId: "cerebras/zai-glm-4.7",
|
|
3501
|
-
color:
|
|
3502
|
+
color: chunkRLAPZNQF_cjs.mastra.orange,
|
|
3502
3503
|
agent: codeAgent
|
|
3503
3504
|
}
|
|
3504
3505
|
];
|
|
@@ -3535,11 +3536,11 @@ async function createMastraCode(config) {
|
|
|
3535
3536
|
}
|
|
3536
3537
|
} catch {
|
|
3537
3538
|
}
|
|
3538
|
-
const builtinPacks =
|
|
3539
|
-
const builtinOmPacks =
|
|
3540
|
-
const effectiveDefaults =
|
|
3541
|
-
const effectiveObserverModel =
|
|
3542
|
-
const effectiveReflectorModel =
|
|
3539
|
+
const builtinPacks = chunkRLAPZNQF_cjs.getAvailableModePacks(startupAccess);
|
|
3540
|
+
const builtinOmPacks = chunkRLAPZNQF_cjs.getAvailableOmPacks(startupAccess);
|
|
3541
|
+
const effectiveDefaults = chunkRLAPZNQF_cjs.resolveModelDefaults(globalSettings, builtinPacks);
|
|
3542
|
+
const effectiveObserverModel = chunkRLAPZNQF_cjs.resolveOmRoleModel(globalSettings, "observer", builtinOmPacks);
|
|
3543
|
+
const effectiveReflectorModel = chunkRLAPZNQF_cjs.resolveOmRoleModel(globalSettings, "reflector", builtinOmPacks);
|
|
3543
3544
|
const effectiveObservationThreshold = globalSettings.models.omObservationThreshold ?? void 0;
|
|
3544
3545
|
const effectiveReflectionThreshold = globalSettings.models.omReflectionThreshold ?? void 0;
|
|
3545
3546
|
const modes = (config?.modes ?? defaultModes).map((mode) => {
|
|
@@ -3617,7 +3618,7 @@ async function createMastraCode(config) {
|
|
|
3617
3618
|
modes,
|
|
3618
3619
|
heartbeatHandlers: config?.heartbeatHandlers ?? defaultHeartbeatHandlers,
|
|
3619
3620
|
modelAuthChecker: (provider) => {
|
|
3620
|
-
const gatewayKey = authStorage2.getStoredApiKey(
|
|
3621
|
+
const gatewayKey = authStorage2.getStoredApiKey(chunkRLAPZNQF_cjs.MEMORY_GATEWAY_PROVIDER) ?? process.env["MASTRA_GATEWAY_API_KEY"];
|
|
3621
3622
|
if (gatewayKey) {
|
|
3622
3623
|
const providerConfig = gatewayRegistry.getProviders()[provider];
|
|
3623
3624
|
if (providerConfig?.gateway === "mastra") return true;
|
|
@@ -3641,32 +3642,32 @@ async function createMastraCode(config) {
|
|
|
3641
3642
|
return true;
|
|
3642
3643
|
}
|
|
3643
3644
|
}
|
|
3644
|
-
const customProvider =
|
|
3645
|
-
return provider ===
|
|
3645
|
+
const customProvider = chunkRLAPZNQF_cjs.loadSettings().customProviders.find((entry) => {
|
|
3646
|
+
return provider === chunkRLAPZNQF_cjs.getCustomProviderId(entry.name);
|
|
3646
3647
|
});
|
|
3647
3648
|
if (customProvider) {
|
|
3648
3649
|
return true;
|
|
3649
3650
|
}
|
|
3650
3651
|
return void 0;
|
|
3651
3652
|
},
|
|
3652
|
-
modelUseCountProvider: () =>
|
|
3653
|
+
modelUseCountProvider: () => chunkRLAPZNQF_cjs.loadSettings().modelUseCounts,
|
|
3653
3654
|
modelUseCountTracker: (modelId) => {
|
|
3654
3655
|
try {
|
|
3655
|
-
const settings =
|
|
3656
|
+
const settings = chunkRLAPZNQF_cjs.loadSettings();
|
|
3656
3657
|
settings.modelUseCounts[modelId] = (settings.modelUseCounts[modelId] ?? 0) + 1;
|
|
3657
|
-
|
|
3658
|
+
chunkRLAPZNQF_cjs.saveSettings(settings);
|
|
3658
3659
|
} catch (error) {
|
|
3659
3660
|
console.error("Failed to persist model usage count", error);
|
|
3660
3661
|
}
|
|
3661
3662
|
},
|
|
3662
3663
|
customModelCatalogProvider: () => {
|
|
3663
|
-
const settings =
|
|
3664
|
+
const settings = chunkRLAPZNQF_cjs.loadSettings();
|
|
3664
3665
|
const customModels = [];
|
|
3665
3666
|
for (const provider of settings.customProviders) {
|
|
3666
|
-
const providerId =
|
|
3667
|
+
const providerId = chunkRLAPZNQF_cjs.getCustomProviderId(provider.name);
|
|
3667
3668
|
for (const modelName of provider.models) {
|
|
3668
3669
|
customModels.push({
|
|
3669
|
-
id:
|
|
3670
|
+
id: chunkRLAPZNQF_cjs.toCustomProviderModelId(provider.name, modelName),
|
|
3670
3671
|
provider: providerId,
|
|
3671
3672
|
modelName,
|
|
3672
3673
|
hasApiKey: true,
|
|
@@ -3677,8 +3678,8 @@ async function createMastraCode(config) {
|
|
|
3677
3678
|
return customModels;
|
|
3678
3679
|
},
|
|
3679
3680
|
threadLock: {
|
|
3680
|
-
acquire:
|
|
3681
|
-
release:
|
|
3681
|
+
acquire: chunkRLAPZNQF_cjs.acquireThreadLock,
|
|
3682
|
+
release: chunkRLAPZNQF_cjs.releaseThreadLock
|
|
3682
3683
|
}
|
|
3683
3684
|
});
|
|
3684
3685
|
if (hookManager) {
|
|
@@ -3706,5 +3707,5 @@ async function createMastraCode(config) {
|
|
|
3706
3707
|
|
|
3707
3708
|
exports.createAuthStorage = createAuthStorage;
|
|
3708
3709
|
exports.createMastraCode = createMastraCode;
|
|
3709
|
-
//# sourceMappingURL=chunk-
|
|
3710
|
-
//# sourceMappingURL=chunk-
|
|
3710
|
+
//# sourceMappingURL=chunk-7D6OWKI5.cjs.map
|
|
3711
|
+
//# sourceMappingURL=chunk-7D6OWKI5.cjs.map
|