mastracode 0.20.0-alpha.5 → 0.20.0-alpha.6
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 +23 -0
- package/dist/agents/memory.d.ts.map +1 -1
- package/dist/{chunk-HA5AIGC6.cjs → chunk-EOBCOAWI.cjs} +60 -42
- package/dist/chunk-EOBCOAWI.cjs.map +1 -0
- package/dist/{chunk-YJMT2SB2.js → chunk-KZHLKVWQ.js} +3 -2
- package/dist/chunk-KZHLKVWQ.js.map +1 -0
- package/dist/{chunk-MRBSZXEB.js → chunk-NHOZTX3H.js} +25 -7
- package/dist/chunk-NHOZTX3H.js.map +1 -0
- package/dist/{chunk-DRUKVGKO.js → chunk-P4IRGY3S.js} +243 -34
- package/dist/chunk-P4IRGY3S.js.map +1 -0
- package/dist/{chunk-RFXWSWD7.cjs → chunk-PAOLP5EY.cjs} +1104 -895
- package/dist/chunk-PAOLP5EY.cjs.map +1 -0
- package/dist/{chunk-6BXLJNXS.cjs → chunk-Z7PZS23L.cjs} +3 -2
- package/dist/chunk-Z7PZS23L.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 +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/onboarding/settings.d.ts +6 -0
- package/dist/onboarding/settings.d.ts.map +1 -1
- package/dist/schema.d.ts +1 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/tui/commands/goal.d.ts.map +1 -1
- package/dist/tui/commands/om.d.ts +1 -0
- package/dist/tui/commands/om.d.ts.map +1 -1
- package/dist/tui/components/idle-counter.d.ts +14 -0
- package/dist/tui/components/idle-counter.d.ts.map +1 -0
- package/dist/tui/components/om-marker.d.ts +1 -0
- package/dist/tui/components/om-marker.d.ts.map +1 -1
- package/dist/tui/components/om-settings.d.ts +2 -0
- package/dist/tui/components/om-settings.d.ts.map +1 -1
- package/dist/tui/handlers/agent-lifecycle.d.ts.map +1 -1
- package/dist/tui/handlers/om.d.ts.map +1 -1
- package/dist/tui/handlers/prompts.d.ts.map +1 -1
- package/dist/tui/mastra-tui.d.ts +4 -0
- package/dist/tui/mastra-tui.d.ts.map +1 -1
- package/dist/tui/render-messages.d.ts.map +1 -1
- package/dist/tui/setup.d.ts.map +1 -1
- package/dist/tui/state.d.ts +8 -1
- package/dist/tui/state.d.ts.map +1 -1
- package/dist/tui.cjs +19 -19
- package/dist/tui.js +2 -2
- package/package.json +10 -10
- package/dist/chunk-6BXLJNXS.cjs.map +0 -1
- package/dist/chunk-DRUKVGKO.js.map +0 -1
- package/dist/chunk-HA5AIGC6.cjs.map +0 -1
- package/dist/chunk-MRBSZXEB.js.map +0 -1
- package/dist/chunk-RFXWSWD7.cjs.map +0 -1
- package/dist/chunk-YJMT2SB2.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# mastracode
|
|
2
2
|
|
|
3
|
+
## 0.20.0-alpha.6
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Added automatic return to Plan mode when a goal started from an approved plan finishes. ([#16676](https://github.com/mastra-ai/mastra/pull/16676))
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Add an "Observe attachments" toggle in `/om` settings that controls whether ([#16682](https://github.com/mastra-ai/mastra/pull/16682))
|
|
12
|
+
file and image attachments are forwarded to the Observer LLM. Turn it off when
|
|
13
|
+
running with a text-only observer model. Stored as `omObserveAttachments` in
|
|
14
|
+
global settings and seeded into the harness state at startup.
|
|
15
|
+
|
|
16
|
+
- Updated MastraCode to use provider-aware Observational Memory idle activation. ([#16663](https://github.com/mastra-ai/mastra/pull/16663))
|
|
17
|
+
|
|
18
|
+
MastraCode now sets `activateAfterIdle: "auto"`, shows an idle-time counter above the input after one minute of inactivity, and combines back-to-back OM activation markers into a single line.
|
|
19
|
+
|
|
20
|
+
- Updated dependencies [[`c272d50`](https://github.com/mastra-ai/mastra/commit/c272d50610a54496b6b6d92ccd4d37b333a2613a), [`d8692af`](https://github.com/mastra-ai/mastra/commit/d8692afa253028e39cdce2aafa0ac414071a762e), [`14b69c6`](https://github.com/mastra-ai/mastra/commit/14b69c6b05ce1e50c140b030a48cafb41d0746e3), [`4bd4e8e`](https://github.com/mastra-ai/mastra/commit/4bd4e8e042f6687559f49a560a7914cee9b85447), [`841a222`](https://github.com/mastra-ai/mastra/commit/841a222560d8c19238f8213713f30535cdd82284), [`96d225b`](https://github.com/mastra-ai/mastra/commit/96d225b05ed52ff250e0a342a7e6398e291945f0)]:
|
|
21
|
+
- @mastra/core@1.36.0-alpha.4
|
|
22
|
+
- @mastra/memory@1.19.0-alpha.1
|
|
23
|
+
- @mastra/mcp@1.8.0-alpha.1
|
|
24
|
+
- @mastra/fastembed@1.1.0-alpha.0
|
|
25
|
+
|
|
3
26
|
## 0.20.0-alpha.5
|
|
4
27
|
|
|
5
28
|
### Patch 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;AAuExC;;;;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;AAuExC;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,oBAAoB,EAAE,MAAM,CAAC,EAAE,YAAY,IAC3E,oBAAoB;IAAE,cAAc,EAAE,cAAc,CAAA;CAAE,YA4D/D"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkZ7PZS23L_cjs = require('./chunk-Z7PZS23L.cjs');
|
|
4
4
|
var chunkLS7LUEZX_cjs = require('./chunk-LS7LUEZX.cjs');
|
|
5
5
|
var chunkAWYGW5ZV_cjs = require('./chunk-AWYGW5ZV.cjs');
|
|
6
6
|
var path = require('path');
|
|
@@ -540,8 +540,8 @@ function getDynamicWorkspace({ requestContext, mastra: mastra2 }) {
|
|
|
540
540
|
existing.setToolsConfig(isPlanMode ? { ...chunkAWYGW5ZV_cjs.TOOL_NAME_OVERRIDES, ...planModeTools } : chunkAWYGW5ZV_cjs.TOOL_NAME_OVERRIDES);
|
|
541
541
|
return existing;
|
|
542
542
|
}
|
|
543
|
-
const userLsp =
|
|
544
|
-
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-
|
|
543
|
+
const userLsp = chunkZ7PZS23L_cjs.loadSettings().lsp ?? {};
|
|
544
|
+
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-EOBCOAWI.cjs', document.baseURI).href)))), "..");
|
|
545
545
|
const lspConfig = {
|
|
546
546
|
...userLsp,
|
|
547
547
|
packageRunner: userLsp.packageRunner || detectPackageRunner(projectPath),
|
|
@@ -1007,14 +1007,14 @@ function getHarnessState(requestContext) {
|
|
|
1007
1007
|
}
|
|
1008
1008
|
function getObserverModel({ requestContext }) {
|
|
1009
1009
|
const state = getHarnessState(requestContext);
|
|
1010
|
-
return
|
|
1010
|
+
return chunkZ7PZS23L_cjs.resolveModel(state?.observerModelId ?? DEFAULT_OM_MODEL_ID, {
|
|
1011
1011
|
remapForCodexOAuth: true,
|
|
1012
1012
|
requestContext
|
|
1013
1013
|
});
|
|
1014
1014
|
}
|
|
1015
1015
|
function getReflectorModel({ requestContext }) {
|
|
1016
1016
|
const state = getHarnessState(requestContext);
|
|
1017
|
-
return
|
|
1017
|
+
return chunkZ7PZS23L_cjs.resolveModel(state?.reflectorModelId ?? DEFAULT_OM_MODEL_ID, {
|
|
1018
1018
|
remapForCodexOAuth: true,
|
|
1019
1019
|
requestContext
|
|
1020
1020
|
});
|
|
@@ -1050,7 +1050,8 @@ function getDynamicMemory(storage, vector) {
|
|
|
1050
1050
|
const refThreshold = state?.reflectionThreshold ?? DEFAULT_REF_THRESHOLD;
|
|
1051
1051
|
const caveman = state?.cavemanObservations ?? false;
|
|
1052
1052
|
const observerPreviousObservationTokens = 1e3;
|
|
1053
|
-
const
|
|
1053
|
+
const observeAttachments = state?.observeAttachments ?? true;
|
|
1054
|
+
const cacheKey = `${obsThreshold}:${refThreshold}:${omScope}:${observerPreviousObservationTokens}:${caveman ? 1 : 0}:${observeAttachments ? 1 : 0}`;
|
|
1054
1055
|
if (cachedMemory && cachedMemoryKey === cacheKey) {
|
|
1055
1056
|
return cachedMemory;
|
|
1056
1057
|
}
|
|
@@ -1069,7 +1070,7 @@ ${CAVEMAN_OM_INSTRUCTION}` : DYNAMIC_AGENTS_MD_INSTRUCTION;
|
|
|
1069
1070
|
temporalMarkers: true,
|
|
1070
1071
|
retrieval: vector ? { vector: true } : true,
|
|
1071
1072
|
scope: omScope,
|
|
1072
|
-
activateAfterIdle: "
|
|
1073
|
+
activateAfterIdle: "auto",
|
|
1073
1074
|
activateOnProviderChange: true,
|
|
1074
1075
|
observation: {
|
|
1075
1076
|
bufferTokens: isResourceScope ? false : 1 / 5,
|
|
@@ -1079,7 +1080,8 @@ ${CAVEMAN_OM_INSTRUCTION}` : DYNAMIC_AGENTS_MD_INSTRUCTION;
|
|
|
1079
1080
|
blockAfter: 2,
|
|
1080
1081
|
previousObserverTokens: observerPreviousObservationTokens,
|
|
1081
1082
|
threadTitle: true,
|
|
1082
|
-
instruction: observerInstruction
|
|
1083
|
+
instruction: observerInstruction,
|
|
1084
|
+
observeAttachments
|
|
1083
1085
|
},
|
|
1084
1086
|
reflection: {
|
|
1085
1087
|
bufferActivation: isResourceScope ? void 0 : 1 / 2,
|
|
@@ -2694,6 +2696,11 @@ var stateSchema = zod.z.object({
|
|
|
2694
2696
|
// Off by default — caveman style is opt-in via `/om` settings; observers and
|
|
2695
2697
|
// reflectors fall back to their built-in (prose) behavior unless enabled.
|
|
2696
2698
|
cavemanObservations: zod.z.boolean().default(false),
|
|
2699
|
+
// Whether OM forwards image/file attachment parts to the Observer LLM.
|
|
2700
|
+
// On by default; turn off when using a text-only observer model that
|
|
2701
|
+
// would error on multimodal input. Placeholder text lines for filtered
|
|
2702
|
+
// attachments are kept either way.
|
|
2703
|
+
observeAttachments: zod.z.boolean().default(true),
|
|
2697
2704
|
// Observational Memory scope — 'thread' (per-conversation) or 'resource' (shared across threads)
|
|
2698
2705
|
omScope: zod.z.enum(["thread", "resource"]).optional(),
|
|
2699
2706
|
// Thinking level for model reasoning effort
|
|
@@ -2856,15 +2863,15 @@ var PROVIDER_TO_OAUTH_ID = {
|
|
|
2856
2863
|
};
|
|
2857
2864
|
function createAuthStorage() {
|
|
2858
2865
|
const authStorage = new chunkLS7LUEZX_cjs.AuthStorage();
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2866
|
+
chunkZ7PZS23L_cjs.setAuthStorage(authStorage);
|
|
2867
|
+
chunkZ7PZS23L_cjs.setAuthStorage3(authStorage);
|
|
2868
|
+
chunkZ7PZS23L_cjs.setAuthStorage2(authStorage);
|
|
2862
2869
|
return authStorage;
|
|
2863
2870
|
}
|
|
2864
2871
|
function resolveCloudObservabilityConfig(settings, authStorage, resourceId) {
|
|
2865
2872
|
const resourceConfig = settings.observability.resources[resourceId];
|
|
2866
2873
|
if (resourceConfig) {
|
|
2867
|
-
const token = authStorage.getStoredApiKey(`${
|
|
2874
|
+
const token = authStorage.getStoredApiKey(`${chunkZ7PZS23L_cjs.OBSERVABILITY_AUTH_PREFIX}${resourceId}`);
|
|
2868
2875
|
if (token) {
|
|
2869
2876
|
return { accessToken: token, projectId: resourceConfig.projectId };
|
|
2870
2877
|
}
|
|
@@ -2882,8 +2889,8 @@ async function createMastraCode(config) {
|
|
|
2882
2889
|
}
|
|
2883
2890
|
const gatewayRegistry = llm.GatewayRegistry.getInstance({ useDynamicLoading: true });
|
|
2884
2891
|
const authStorage = createAuthStorage();
|
|
2885
|
-
const globalSettings =
|
|
2886
|
-
const storedGatewayKey = authStorage.getStoredApiKey(
|
|
2892
|
+
const globalSettings = chunkZ7PZS23L_cjs.loadSettings(config?.settingsPath);
|
|
2893
|
+
const storedGatewayKey = authStorage.getStoredApiKey(chunkZ7PZS23L_cjs.MEMORY_GATEWAY_PROVIDER);
|
|
2887
2894
|
const storedGatewayUrl = globalSettings.memoryGateway?.baseUrl;
|
|
2888
2895
|
if (storedGatewayKey) {
|
|
2889
2896
|
process.env["MASTRA_GATEWAY_API_KEY"] ??= storedGatewayKey;
|
|
@@ -2898,11 +2905,11 @@ async function createMastraCode(config) {
|
|
|
2898
2905
|
const envVars = cfg?.apiKeyEnvVar;
|
|
2899
2906
|
providerEnvVars[provider] = Array.isArray(envVars) ? envVars[0] : envVars;
|
|
2900
2907
|
}
|
|
2901
|
-
providerEnvVars[
|
|
2908
|
+
providerEnvVars[chunkZ7PZS23L_cjs.MEMORY_GATEWAY_PROVIDER] ??= "MASTRA_GATEWAY_API_KEY";
|
|
2902
2909
|
authStorage.loadStoredApiKeysIntoEnv(providerEnvVars);
|
|
2903
2910
|
} catch {
|
|
2904
2911
|
authStorage.loadStoredApiKeysIntoEnv({
|
|
2905
|
-
[
|
|
2912
|
+
[chunkZ7PZS23L_cjs.MEMORY_GATEWAY_PROVIDER]: "MASTRA_GATEWAY_API_KEY",
|
|
2906
2913
|
anthropic: "ANTHROPIC_API_KEY",
|
|
2907
2914
|
openai: "OPENAI_API_KEY",
|
|
2908
2915
|
google: "GOOGLE_GENERATIVE_AI_API_KEY",
|
|
@@ -2919,6 +2926,11 @@ async function createMastraCode(config) {
|
|
|
2919
2926
|
project.resourceId = resourceIdOverride;
|
|
2920
2927
|
project.resourceIdOverride = true;
|
|
2921
2928
|
}
|
|
2929
|
+
const signalsPubSub = config?.pubsub;
|
|
2930
|
+
const crossProcessPubSub = config?.crossProcessPubSub ?? false;
|
|
2931
|
+
if (crossProcessPubSub && !signalsPubSub) {
|
|
2932
|
+
throw new Error("crossProcessPubSub requires a pubsub instance");
|
|
2933
|
+
}
|
|
2922
2934
|
const storageConfig = config?.storage ?? chunkLS7LUEZX_cjs.getStorageConfig(project.rootPath, globalSettings.storage);
|
|
2923
2935
|
const storageResult = await createStorage(storageConfig);
|
|
2924
2936
|
const storageWarning = storageResult.warning;
|
|
@@ -3009,7 +3021,7 @@ async function createMastraCode(config) {
|
|
|
3009
3021
|
id: "code-agent",
|
|
3010
3022
|
name: "Code Agent",
|
|
3011
3023
|
instructions: getDynamicInstructions,
|
|
3012
|
-
model:
|
|
3024
|
+
model: chunkZ7PZS23L_cjs.getDynamicModel,
|
|
3013
3025
|
tools: createDynamicTools(mcpManager, config?.extraTools, hookManager, config?.disabledTools),
|
|
3014
3026
|
scorers: {
|
|
3015
3027
|
outcome: {
|
|
@@ -3040,21 +3052,21 @@ async function createMastraCode(config) {
|
|
|
3040
3052
|
name: "Build",
|
|
3041
3053
|
default: true,
|
|
3042
3054
|
defaultModelId: "anthropic/claude-opus-4-6",
|
|
3043
|
-
color:
|
|
3055
|
+
color: chunkZ7PZS23L_cjs.mastra.green,
|
|
3044
3056
|
agent: codeAgent
|
|
3045
3057
|
},
|
|
3046
3058
|
{
|
|
3047
3059
|
id: "plan",
|
|
3048
3060
|
name: "Plan",
|
|
3049
3061
|
defaultModelId: "openai/gpt-5.2-codex",
|
|
3050
|
-
color:
|
|
3062
|
+
color: chunkZ7PZS23L_cjs.mastra.purple,
|
|
3051
3063
|
agent: codeAgent
|
|
3052
3064
|
},
|
|
3053
3065
|
{
|
|
3054
3066
|
id: "fast",
|
|
3055
3067
|
name: "Fast",
|
|
3056
3068
|
defaultModelId: "cerebras/zai-glm-4.7",
|
|
3057
|
-
color:
|
|
3069
|
+
color: chunkZ7PZS23L_cjs.mastra.orange,
|
|
3058
3070
|
agent: codeAgent
|
|
3059
3071
|
}
|
|
3060
3072
|
];
|
|
@@ -3093,14 +3105,15 @@ async function createMastraCode(config) {
|
|
|
3093
3105
|
}
|
|
3094
3106
|
} catch {
|
|
3095
3107
|
}
|
|
3096
|
-
const builtinPacks =
|
|
3097
|
-
const builtinOmPacks =
|
|
3098
|
-
const effectiveDefaults =
|
|
3099
|
-
const effectiveObserverModel =
|
|
3100
|
-
const effectiveReflectorModel =
|
|
3108
|
+
const builtinPacks = chunkZ7PZS23L_cjs.getAvailableModePacks(startupAccess);
|
|
3109
|
+
const builtinOmPacks = chunkZ7PZS23L_cjs.getAvailableOmPacks(startupAccess);
|
|
3110
|
+
const effectiveDefaults = chunkZ7PZS23L_cjs.resolveModelDefaults(globalSettings, builtinPacks);
|
|
3111
|
+
const effectiveObserverModel = chunkZ7PZS23L_cjs.resolveOmRoleModel(globalSettings, "observer", builtinOmPacks);
|
|
3112
|
+
const effectiveReflectorModel = chunkZ7PZS23L_cjs.resolveOmRoleModel(globalSettings, "reflector", builtinOmPacks);
|
|
3101
3113
|
const effectiveObservationThreshold = globalSettings.models.omObservationThreshold ?? void 0;
|
|
3102
3114
|
const effectiveReflectionThreshold = globalSettings.models.omReflectionThreshold ?? void 0;
|
|
3103
3115
|
const effectiveCavemanObservations = globalSettings.models.omCavemanObservations ?? void 0;
|
|
3116
|
+
const effectiveObserveAttachments = globalSettings.models.omObserveAttachments ?? void 0;
|
|
3104
3117
|
const modes = (config?.modes ?? defaultModes).map((mode) => {
|
|
3105
3118
|
const savedModel = effectiveDefaults[mode.id];
|
|
3106
3119
|
return savedModel ? { ...mode, defaultModelId: savedModel } : mode;
|
|
@@ -3142,6 +3155,9 @@ async function createMastraCode(config) {
|
|
|
3142
3155
|
if (effectiveCavemanObservations !== void 0) {
|
|
3143
3156
|
globalInitialState.cavemanObservations = effectiveCavemanObservations;
|
|
3144
3157
|
}
|
|
3158
|
+
if (effectiveObserveAttachments !== void 0) {
|
|
3159
|
+
globalInitialState.observeAttachments = effectiveObserveAttachments;
|
|
3160
|
+
}
|
|
3145
3161
|
if (globalSettings.preferences.yolo !== null) {
|
|
3146
3162
|
globalInitialState.yolo = globalSettings.preferences.yolo;
|
|
3147
3163
|
}
|
|
@@ -3162,9 +3178,10 @@ async function createMastraCode(config) {
|
|
|
3162
3178
|
storage: storage$1,
|
|
3163
3179
|
observability: observability$1,
|
|
3164
3180
|
memory,
|
|
3181
|
+
pubsub: signalsPubSub,
|
|
3165
3182
|
stateSchema,
|
|
3166
3183
|
subagents,
|
|
3167
|
-
resolveModel: (modelId) =>
|
|
3184
|
+
resolveModel: (modelId) => chunkZ7PZS23L_cjs.resolveModel(modelId),
|
|
3168
3185
|
toolCategoryResolver: chunkAWYGW5ZV_cjs.getToolCategory,
|
|
3169
3186
|
initialState: {
|
|
3170
3187
|
projectPath: project.rootPath,
|
|
@@ -3179,7 +3196,7 @@ async function createMastraCode(config) {
|
|
|
3179
3196
|
modes,
|
|
3180
3197
|
heartbeatHandlers: config?.heartbeatHandlers ?? defaultHeartbeatHandlers,
|
|
3181
3198
|
modelAuthChecker: (provider) => {
|
|
3182
|
-
const gatewayKey = authStorage.getStoredApiKey(
|
|
3199
|
+
const gatewayKey = authStorage.getStoredApiKey(chunkZ7PZS23L_cjs.MEMORY_GATEWAY_PROVIDER) ?? process.env["MASTRA_GATEWAY_API_KEY"];
|
|
3183
3200
|
if (gatewayKey) {
|
|
3184
3201
|
const providerConfig = gatewayRegistry.getProviders()[provider];
|
|
3185
3202
|
if (providerConfig?.gateway === "mastra") return true;
|
|
@@ -3203,32 +3220,32 @@ async function createMastraCode(config) {
|
|
|
3203
3220
|
return true;
|
|
3204
3221
|
}
|
|
3205
3222
|
}
|
|
3206
|
-
const customProvider =
|
|
3207
|
-
return provider ===
|
|
3223
|
+
const customProvider = chunkZ7PZS23L_cjs.loadSettings().customProviders.find((entry) => {
|
|
3224
|
+
return provider === chunkZ7PZS23L_cjs.getCustomProviderId(entry.name);
|
|
3208
3225
|
});
|
|
3209
3226
|
if (customProvider) {
|
|
3210
3227
|
return true;
|
|
3211
3228
|
}
|
|
3212
3229
|
return void 0;
|
|
3213
3230
|
},
|
|
3214
|
-
modelUseCountProvider: () =>
|
|
3231
|
+
modelUseCountProvider: () => chunkZ7PZS23L_cjs.loadSettings().modelUseCounts,
|
|
3215
3232
|
modelUseCountTracker: (modelId) => {
|
|
3216
3233
|
try {
|
|
3217
|
-
const settings =
|
|
3234
|
+
const settings = chunkZ7PZS23L_cjs.loadSettings();
|
|
3218
3235
|
settings.modelUseCounts[modelId] = (settings.modelUseCounts[modelId] ?? 0) + 1;
|
|
3219
|
-
|
|
3236
|
+
chunkZ7PZS23L_cjs.saveSettings(settings);
|
|
3220
3237
|
} catch (error) {
|
|
3221
3238
|
console.error("Failed to persist model usage count", error);
|
|
3222
3239
|
}
|
|
3223
3240
|
},
|
|
3224
3241
|
customModelCatalogProvider: async () => {
|
|
3225
|
-
const settings =
|
|
3242
|
+
const settings = chunkZ7PZS23L_cjs.loadSettings();
|
|
3226
3243
|
const customModels = [];
|
|
3227
3244
|
for (const provider of settings.customProviders) {
|
|
3228
|
-
const providerId =
|
|
3245
|
+
const providerId = chunkZ7PZS23L_cjs.getCustomProviderId(provider.name);
|
|
3229
3246
|
for (const modelName of provider.models) {
|
|
3230
3247
|
customModels.push({
|
|
3231
|
-
id:
|
|
3248
|
+
id: chunkZ7PZS23L_cjs.toCustomProviderModelId(provider.name, modelName),
|
|
3232
3249
|
provider: providerId,
|
|
3233
3250
|
modelName,
|
|
3234
3251
|
hasApiKey: true,
|
|
@@ -3237,7 +3254,7 @@ async function createMastraCode(config) {
|
|
|
3237
3254
|
}
|
|
3238
3255
|
}
|
|
3239
3256
|
try {
|
|
3240
|
-
const copilotModels = await
|
|
3257
|
+
const copilotModels = await chunkZ7PZS23L_cjs.getCopilotModelCatalog({ authStorage });
|
|
3241
3258
|
for (const m of copilotModels) {
|
|
3242
3259
|
customModels.push({
|
|
3243
3260
|
id: `github-copilot/${m.id}`,
|
|
@@ -3252,9 +3269,9 @@ async function createMastraCode(config) {
|
|
|
3252
3269
|
}
|
|
3253
3270
|
return customModels;
|
|
3254
3271
|
},
|
|
3255
|
-
threadLock: {
|
|
3256
|
-
acquire:
|
|
3257
|
-
release:
|
|
3272
|
+
threadLock: crossProcessPubSub ? void 0 : {
|
|
3273
|
+
acquire: chunkZ7PZS23L_cjs.acquireThreadLock,
|
|
3274
|
+
release: chunkZ7PZS23L_cjs.releaseThreadLock
|
|
3258
3275
|
}
|
|
3259
3276
|
});
|
|
3260
3277
|
if (hookManager) {
|
|
@@ -3275,9 +3292,10 @@ async function createMastraCode(config) {
|
|
|
3275
3292
|
mcpManager,
|
|
3276
3293
|
hookManager,
|
|
3277
3294
|
authStorage,
|
|
3278
|
-
resolveModel:
|
|
3295
|
+
resolveModel: chunkZ7PZS23L_cjs.resolveModel,
|
|
3279
3296
|
storageWarning,
|
|
3280
3297
|
observabilityWarning,
|
|
3298
|
+
signalsPubSub,
|
|
3281
3299
|
builtinPacks,
|
|
3282
3300
|
builtinOmPacks,
|
|
3283
3301
|
effectiveDefaults
|
|
@@ -3286,5 +3304,5 @@ async function createMastraCode(config) {
|
|
|
3286
3304
|
|
|
3287
3305
|
exports.createAuthStorage = createAuthStorage;
|
|
3288
3306
|
exports.createMastraCode = createMastraCode;
|
|
3289
|
-
//# sourceMappingURL=chunk-
|
|
3290
|
-
//# sourceMappingURL=chunk-
|
|
3307
|
+
//# sourceMappingURL=chunk-EOBCOAWI.cjs.map
|
|
3308
|
+
//# sourceMappingURL=chunk-EOBCOAWI.cjs.map
|