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 +15 -0
- package/dist/{chunk-KEEC6KZP.js → chunk-7ARENXCP.js} +10 -29
- package/dist/chunk-7ARENXCP.js.map +1 -0
- package/dist/{chunk-G76EJQC6.js → chunk-AB4G5527.js} +3 -3
- package/dist/{chunk-G76EJQC6.js.map → chunk-AB4G5527.js.map} +1 -1
- package/dist/{chunk-DS5OW7P2.cjs → chunk-BOZ3JCCI.cjs} +931 -950
- package/dist/chunk-BOZ3JCCI.cjs.map +1 -0
- package/dist/{chunk-G2TNUR63.cjs → chunk-DPPFZEZI.cjs} +39 -39
- package/dist/{chunk-G2TNUR63.cjs.map → chunk-DPPFZEZI.cjs.map} +1 -1
- package/dist/{chunk-7ZTY5SBK.js → chunk-EXBGEHMR.js} +10 -4
- package/dist/chunk-EXBGEHMR.js.map +1 -0
- package/dist/{chunk-EAUXUMEB.cjs → chunk-NFF7IH5X.cjs} +10 -4
- package/dist/chunk-NFF7IH5X.cjs.map +1 -0
- package/dist/cli.cjs +18 -18
- package/dist/cli.js +3 -3
- package/dist/github-signals/index.d.ts.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.js +1 -1
- package/dist/tui/commands/github.d.ts +0 -14
- package/dist/tui/commands/github.d.ts.map +1 -1
- package/dist/tui/commands/new.d.ts.map +1 -1
- package/dist/tui/handlers/agent-lifecycle.d.ts.map +1 -1
- package/dist/tui.cjs +19 -19
- package/dist/tui.js +2 -2
- package/package.json +6 -6
- package/dist/chunk-7ZTY5SBK.js.map +0 -1
- package/dist/chunk-DS5OW7P2.cjs.map +0 -1
- package/dist/chunk-EAUXUMEB.cjs.map +0 -1
- package/dist/chunk-KEEC6KZP.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkNFF7IH5X_cjs = require('./chunk-NFF7IH5X.cjs');
|
|
4
4
|
var chunkJ3ISOP5J_cjs = require('./chunk-J3ISOP5J.cjs');
|
|
5
5
|
var chunkJHYTJMKT_cjs = require('./chunk-JHYTJMKT.cjs');
|
|
6
6
|
var crypto = require('crypto');
|
|
@@ -602,8 +602,8 @@ function getDynamicWorkspace({ requestContext, mastra: mastra2 }) {
|
|
|
602
602
|
existing.setToolsConfig(isPlanMode ? { ...chunkJHYTJMKT_cjs.TOOL_NAME_OVERRIDES, ...planModeTools } : chunkJHYTJMKT_cjs.TOOL_NAME_OVERRIDES);
|
|
603
603
|
return existing;
|
|
604
604
|
}
|
|
605
|
-
const userLsp =
|
|
606
|
-
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-
|
|
605
|
+
const userLsp = chunkNFF7IH5X_cjs.loadSettings().lsp ?? {};
|
|
606
|
+
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-DPPFZEZI.cjs', document.baseURI).href)))), "..");
|
|
607
607
|
const lspConfig = {
|
|
608
608
|
...userLsp,
|
|
609
609
|
packageRunner: userLsp.packageRunner || detectPackageRunner(projectPath),
|
|
@@ -1079,14 +1079,14 @@ function getHarnessState(requestContext) {
|
|
|
1079
1079
|
}
|
|
1080
1080
|
function getObserverModel({ requestContext }) {
|
|
1081
1081
|
const state = getHarnessState(requestContext);
|
|
1082
|
-
return
|
|
1082
|
+
return chunkNFF7IH5X_cjs.resolveModel(state?.observerModelId ?? chunkJ3ISOP5J_cjs.DEFAULT_OM_MODEL_ID, {
|
|
1083
1083
|
remapForCodexOAuth: true,
|
|
1084
1084
|
requestContext
|
|
1085
1085
|
});
|
|
1086
1086
|
}
|
|
1087
1087
|
function getReflectorModel({ requestContext }) {
|
|
1088
1088
|
const state = getHarnessState(requestContext);
|
|
1089
|
-
return
|
|
1089
|
+
return chunkNFF7IH5X_cjs.resolveModel(state?.reflectorModelId ?? chunkJ3ISOP5J_cjs.DEFAULT_OM_MODEL_ID, {
|
|
1090
1090
|
remapForCodexOAuth: true,
|
|
1091
1091
|
requestContext
|
|
1092
1092
|
});
|
|
@@ -3236,15 +3236,15 @@ function applyEffectiveDefaultsToV1Modes(modes, effectiveDefaults) {
|
|
|
3236
3236
|
}
|
|
3237
3237
|
function createAuthStorage() {
|
|
3238
3238
|
const authStorage = new chunkJ3ISOP5J_cjs.AuthStorage();
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3239
|
+
chunkNFF7IH5X_cjs.setAuthStorage(authStorage);
|
|
3240
|
+
chunkNFF7IH5X_cjs.setAuthStorage3(authStorage);
|
|
3241
|
+
chunkNFF7IH5X_cjs.setAuthStorage2(authStorage);
|
|
3242
3242
|
return authStorage;
|
|
3243
3243
|
}
|
|
3244
3244
|
function resolveCloudObservabilityConfig(settings, authStorage, resourceId) {
|
|
3245
3245
|
const resourceConfig = settings.observability.resources[resourceId];
|
|
3246
3246
|
if (resourceConfig) {
|
|
3247
|
-
const token = authStorage.getStoredApiKey(`${
|
|
3247
|
+
const token = authStorage.getStoredApiKey(`${chunkNFF7IH5X_cjs.OBSERVABILITY_AUTH_PREFIX}${resourceId}`);
|
|
3248
3248
|
if (token) {
|
|
3249
3249
|
return { accessToken: token, projectId: resourceConfig.projectId };
|
|
3250
3250
|
}
|
|
@@ -3266,8 +3266,8 @@ async function createMastraCode(config) {
|
|
|
3266
3266
|
}
|
|
3267
3267
|
const gatewayRegistry = llm.GatewayRegistry.getInstance({ useDynamicLoading: true });
|
|
3268
3268
|
const authStorage = createAuthStorage();
|
|
3269
|
-
const globalSettings =
|
|
3270
|
-
const storedGatewayKey = authStorage.getStoredApiKey(
|
|
3269
|
+
const globalSettings = chunkNFF7IH5X_cjs.loadSettings(config?.settingsPath);
|
|
3270
|
+
const storedGatewayKey = authStorage.getStoredApiKey(chunkNFF7IH5X_cjs.MEMORY_GATEWAY_PROVIDER);
|
|
3271
3271
|
const storedGatewayUrl = globalSettings.memoryGateway?.baseUrl;
|
|
3272
3272
|
if (storedGatewayKey) {
|
|
3273
3273
|
process.env["MASTRA_GATEWAY_API_KEY"] ??= storedGatewayKey;
|
|
@@ -3282,11 +3282,11 @@ async function createMastraCode(config) {
|
|
|
3282
3282
|
const envVars = cfg?.apiKeyEnvVar;
|
|
3283
3283
|
providerEnvVars[provider] = Array.isArray(envVars) ? envVars[0] : envVars;
|
|
3284
3284
|
}
|
|
3285
|
-
providerEnvVars[
|
|
3285
|
+
providerEnvVars[chunkNFF7IH5X_cjs.MEMORY_GATEWAY_PROVIDER] ??= "MASTRA_GATEWAY_API_KEY";
|
|
3286
3286
|
authStorage.loadStoredApiKeysIntoEnv(providerEnvVars);
|
|
3287
3287
|
} catch {
|
|
3288
3288
|
authStorage.loadStoredApiKeysIntoEnv({
|
|
3289
|
-
[
|
|
3289
|
+
[chunkNFF7IH5X_cjs.MEMORY_GATEWAY_PROVIDER]: "MASTRA_GATEWAY_API_KEY",
|
|
3290
3290
|
anthropic: "ANTHROPIC_API_KEY",
|
|
3291
3291
|
openai: "OPENAI_API_KEY",
|
|
3292
3292
|
google: "GOOGLE_GENERATIVE_AI_API_KEY",
|
|
@@ -3398,12 +3398,12 @@ async function createMastraCode(config) {
|
|
|
3398
3398
|
const hookManager = config?.disableHooks ? void 0 : new HookManager(project.rootPath, "session-init", configDir);
|
|
3399
3399
|
const outcomeScorer = createOutcomeScorer();
|
|
3400
3400
|
const efficiencyScorer = createEfficiencyScorer();
|
|
3401
|
-
const githubSignalsProcessor = globalSettings.signals?.experimentalGithubSignals ? new
|
|
3401
|
+
const githubSignalsProcessor = globalSettings.signals?.experimentalGithubSignals ? new chunkNFF7IH5X_cjs.GithubSignals({ cwd: project.rootPath }) : void 0;
|
|
3402
3402
|
const codeAgent = new agent.Agent({
|
|
3403
3403
|
id: CODE_AGENT_ID,
|
|
3404
3404
|
name: "Code Agent",
|
|
3405
3405
|
instructions: getDynamicInstructions,
|
|
3406
|
-
model:
|
|
3406
|
+
model: chunkNFF7IH5X_cjs.getDynamicModel,
|
|
3407
3407
|
tools: createDynamicTools(mcpManager, config?.extraTools, hookManager, config?.disabledTools, storage$1),
|
|
3408
3408
|
scorers: {
|
|
3409
3409
|
outcome: {
|
|
@@ -3463,7 +3463,7 @@ async function createMastraCode(config) {
|
|
|
3463
3463
|
description: "Build",
|
|
3464
3464
|
defaultModelId: "anthropic/claude-opus-4-7",
|
|
3465
3465
|
metadata: {
|
|
3466
|
-
color:
|
|
3466
|
+
color: chunkNFF7IH5X_cjs.mastra.green,
|
|
3467
3467
|
default: true
|
|
3468
3468
|
}
|
|
3469
3469
|
},
|
|
@@ -3474,7 +3474,7 @@ async function createMastraCode(config) {
|
|
|
3474
3474
|
transitionsTo: "build",
|
|
3475
3475
|
defaultModelId: "openai/gpt-5.5",
|
|
3476
3476
|
metadata: {
|
|
3477
|
-
color:
|
|
3477
|
+
color: chunkNFF7IH5X_cjs.mastra.purple
|
|
3478
3478
|
}
|
|
3479
3479
|
},
|
|
3480
3480
|
{
|
|
@@ -3483,7 +3483,7 @@ async function createMastraCode(config) {
|
|
|
3483
3483
|
description: "Fast",
|
|
3484
3484
|
defaultModelId: "cerebras/zai-glm-4.7",
|
|
3485
3485
|
metadata: {
|
|
3486
|
-
color:
|
|
3486
|
+
color: chunkNFF7IH5X_cjs.mastra.orange
|
|
3487
3487
|
}
|
|
3488
3488
|
}
|
|
3489
3489
|
];
|
|
@@ -3523,11 +3523,11 @@ async function createMastraCode(config) {
|
|
|
3523
3523
|
}
|
|
3524
3524
|
} catch {
|
|
3525
3525
|
}
|
|
3526
|
-
const builtinPacks =
|
|
3527
|
-
const builtinOmPacks =
|
|
3528
|
-
const effectiveDefaults =
|
|
3529
|
-
const effectiveObserverModel =
|
|
3530
|
-
const effectiveReflectorModel =
|
|
3526
|
+
const builtinPacks = chunkNFF7IH5X_cjs.getAvailableModePacks(startupAccess);
|
|
3527
|
+
const builtinOmPacks = chunkNFF7IH5X_cjs.getAvailableOmPacks(startupAccess);
|
|
3528
|
+
const effectiveDefaults = chunkNFF7IH5X_cjs.resolveModelDefaults(globalSettings, builtinPacks);
|
|
3529
|
+
const effectiveObserverModel = chunkNFF7IH5X_cjs.resolveOmRoleModel(globalSettings, "observer", builtinOmPacks);
|
|
3530
|
+
const effectiveReflectorModel = chunkNFF7IH5X_cjs.resolveOmRoleModel(globalSettings, "reflector", builtinOmPacks);
|
|
3531
3531
|
const effectiveObservationThreshold = globalSettings.models.omObservationThreshold ?? void 0;
|
|
3532
3532
|
const effectiveReflectionThreshold = globalSettings.models.omReflectionThreshold ?? void 0;
|
|
3533
3533
|
const effectiveCavemanObservations = globalSettings.models.omCavemanObservations ?? void 0;
|
|
@@ -3641,7 +3641,7 @@ async function createMastraCode(config) {
|
|
|
3641
3641
|
pubsub: signalsPubSub,
|
|
3642
3642
|
stateSchema: typedStateSchema,
|
|
3643
3643
|
subagents,
|
|
3644
|
-
resolveModel: (modelId) =>
|
|
3644
|
+
resolveModel: (modelId) => chunkNFF7IH5X_cjs.resolveModel(modelId),
|
|
3645
3645
|
toolCategoryResolver: chunkJHYTJMKT_cjs.getToolCategory,
|
|
3646
3646
|
initialState: {
|
|
3647
3647
|
projectPath: project.rootPath,
|
|
@@ -3659,7 +3659,7 @@ async function createMastraCode(config) {
|
|
|
3659
3659
|
modes,
|
|
3660
3660
|
heartbeatHandlers,
|
|
3661
3661
|
modelAuthChecker: (provider) => {
|
|
3662
|
-
const gatewayKey = authStorage.getStoredApiKey(
|
|
3662
|
+
const gatewayKey = authStorage.getStoredApiKey(chunkNFF7IH5X_cjs.MEMORY_GATEWAY_PROVIDER) ?? process.env["MASTRA_GATEWAY_API_KEY"];
|
|
3663
3663
|
if (gatewayKey) {
|
|
3664
3664
|
const providerConfig = gatewayRegistry.getProviders()[provider];
|
|
3665
3665
|
if (providerConfig?.gateway === "mastra") return true;
|
|
@@ -3683,32 +3683,32 @@ async function createMastraCode(config) {
|
|
|
3683
3683
|
return true;
|
|
3684
3684
|
}
|
|
3685
3685
|
}
|
|
3686
|
-
const customProvider =
|
|
3687
|
-
return provider ===
|
|
3686
|
+
const customProvider = chunkNFF7IH5X_cjs.loadSettings().customProviders.find((entry) => {
|
|
3687
|
+
return provider === chunkNFF7IH5X_cjs.getCustomProviderId(entry.name);
|
|
3688
3688
|
});
|
|
3689
3689
|
if (customProvider) {
|
|
3690
3690
|
return true;
|
|
3691
3691
|
}
|
|
3692
3692
|
return void 0;
|
|
3693
3693
|
},
|
|
3694
|
-
modelUseCountProvider: () =>
|
|
3694
|
+
modelUseCountProvider: () => chunkNFF7IH5X_cjs.loadSettings().modelUseCounts,
|
|
3695
3695
|
modelUseCountTracker: (modelId) => {
|
|
3696
3696
|
try {
|
|
3697
|
-
const settings =
|
|
3697
|
+
const settings = chunkNFF7IH5X_cjs.loadSettings();
|
|
3698
3698
|
settings.modelUseCounts[modelId] = (settings.modelUseCounts[modelId] ?? 0) + 1;
|
|
3699
|
-
|
|
3699
|
+
chunkNFF7IH5X_cjs.saveSettings(settings);
|
|
3700
3700
|
} catch (error) {
|
|
3701
3701
|
console.error("Failed to persist model usage count", error);
|
|
3702
3702
|
}
|
|
3703
3703
|
},
|
|
3704
3704
|
customModelCatalogProvider: async () => {
|
|
3705
|
-
const settings =
|
|
3705
|
+
const settings = chunkNFF7IH5X_cjs.loadSettings();
|
|
3706
3706
|
const customModels = [];
|
|
3707
3707
|
for (const provider of settings.customProviders) {
|
|
3708
|
-
const providerId =
|
|
3708
|
+
const providerId = chunkNFF7IH5X_cjs.getCustomProviderId(provider.name);
|
|
3709
3709
|
for (const modelName of provider.models) {
|
|
3710
3710
|
customModels.push({
|
|
3711
|
-
id:
|
|
3711
|
+
id: chunkNFF7IH5X_cjs.toCustomProviderModelId(provider.name, modelName),
|
|
3712
3712
|
provider: providerId,
|
|
3713
3713
|
modelName,
|
|
3714
3714
|
hasApiKey: true,
|
|
@@ -3717,7 +3717,7 @@ async function createMastraCode(config) {
|
|
|
3717
3717
|
}
|
|
3718
3718
|
}
|
|
3719
3719
|
try {
|
|
3720
|
-
const copilotModels = await
|
|
3720
|
+
const copilotModels = await chunkNFF7IH5X_cjs.getCopilotModelCatalog({ authStorage });
|
|
3721
3721
|
for (const m of copilotModels) {
|
|
3722
3722
|
customModels.push({
|
|
3723
3723
|
id: `github-copilot/${m.id}`,
|
|
@@ -3733,8 +3733,8 @@ async function createMastraCode(config) {
|
|
|
3733
3733
|
return customModels;
|
|
3734
3734
|
},
|
|
3735
3735
|
threadLock: crossProcessPubSub ? void 0 : {
|
|
3736
|
-
acquire:
|
|
3737
|
-
release:
|
|
3736
|
+
acquire: chunkNFF7IH5X_cjs.acquireThreadLock,
|
|
3737
|
+
release: chunkNFF7IH5X_cjs.releaseThreadLock
|
|
3738
3738
|
}
|
|
3739
3739
|
},
|
|
3740
3740
|
harnessV1
|
|
@@ -3782,7 +3782,7 @@ async function createMastraCode(config) {
|
|
|
3782
3782
|
hookManager,
|
|
3783
3783
|
signalsPubSub,
|
|
3784
3784
|
authStorage,
|
|
3785
|
-
resolveModel:
|
|
3785
|
+
resolveModel: chunkNFF7IH5X_cjs.resolveModel,
|
|
3786
3786
|
storageWarning,
|
|
3787
3787
|
observabilityWarning,
|
|
3788
3788
|
builtinPacks,
|
|
@@ -3794,5 +3794,5 @@ async function createMastraCode(config) {
|
|
|
3794
3794
|
|
|
3795
3795
|
exports.createAuthStorage = createAuthStorage;
|
|
3796
3796
|
exports.createMastraCode = createMastraCode;
|
|
3797
|
-
//# sourceMappingURL=chunk-
|
|
3798
|
-
//# sourceMappingURL=chunk-
|
|
3797
|
+
//# sourceMappingURL=chunk-DPPFZEZI.cjs.map
|
|
3798
|
+
//# sourceMappingURL=chunk-DPPFZEZI.cjs.map
|