mastracode 0.20.0-alpha.4 → 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 +36 -0
- package/dist/agents/memory.d.ts.map +1 -1
- package/dist/agents/workspace.d.ts.map +1 -1
- package/dist/{chunk-7DWQNHKH.cjs → chunk-EOBCOAWI.cjs} +70 -108
- 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-MVSBRHDQ.js → chunk-NHOZTX3H.js} +35 -73
- package/dist/chunk-NHOZTX3H.js.map +1 -0
- package/dist/{chunk-KYBJFVCW.js → chunk-P4IRGY3S.js} +289 -41
- package/dist/chunk-P4IRGY3S.js.map +1 -0
- package/dist/{chunk-YPW6CXIC.cjs → chunk-PAOLP5EY.cjs} +1150 -902
- 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/goal-manager.d.ts +4 -0
- package/dist/tui/goal-manager.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 +9 -9
- package/dist/chunk-6BXLJNXS.cjs.map +0 -1
- package/dist/chunk-7DWQNHKH.cjs.map +0 -1
- package/dist/chunk-KYBJFVCW.js.map +0 -1
- package/dist/chunk-MVSBRHDQ.js.map +0 -1
- package/dist/chunk-YJMT2SB2.js.map +0 -1
- package/dist/chunk-YPW6CXIC.cjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
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
|
+
|
|
26
|
+
## 0.20.0-alpha.5
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- Restore MastraCode local command execution to inherit parent environment variables while redacting env-shaped and secret-looking workspace trace data. ([#16691](https://github.com/mastra-ai/mastra/pull/16691))
|
|
31
|
+
|
|
32
|
+
- Fixed goal pursuit timers so they only count active work and stay paused while waiting for user input. ([#16690](https://github.com/mastra-ai/mastra/pull/16690))
|
|
33
|
+
|
|
34
|
+
- Updated dependencies [[`5556cc1`](https://github.com/mastra-ai/mastra/commit/5556cc1befec71518d84f826b3bfe3a079a9daf7), [`5499303`](https://github.com/mastra-ai/mastra/commit/54993032c1ebc09642625b78d2014e0cf84a3cae), [`e47bca7`](https://github.com/mastra-ai/mastra/commit/e47bca7b72866d3abd173b9f530ac4318113a8ff), [`0031d0f`](https://github.com/mastra-ai/mastra/commit/0031d0f13831d7843ac5d498734a7d92862e2ce3), [`3498b49`](https://github.com/mastra-ai/mastra/commit/3498b4946be94f4313cd817733589680dcda5278), [`359439b`](https://github.com/mastra-ai/mastra/commit/359439bb8c635e048176306828195f8297f50021), [`3552b1c`](https://github.com/mastra-ai/mastra/commit/3552b1c872988885f1c33d97122323567e2aff8e)]:
|
|
35
|
+
- @mastra/core@1.36.0-alpha.3
|
|
36
|
+
- @mastra/duckdb@1.4.0-alpha.0
|
|
37
|
+
- @mastra/observability@1.13.0-alpha.1
|
|
38
|
+
|
|
3
39
|
## 0.20.0-alpha.4
|
|
4
40
|
|
|
5
41
|
### 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/agents/workspace.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/agents/workspace.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAgDlF,eAAO,MAAM,UAAU,UAOtB,CAAC;AAEF,eAAO,MAAM,iBAAiB,UAAa,CAAC;AA6B5C,wBAAgB,mBAAmB,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE;IAAE,cAAc,EAAE,cAAc,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,uDAgElH"}
|
|
@@ -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');
|
|
@@ -468,73 +468,17 @@ Error: ${r.error}`);
|
|
|
468
468
|
}
|
|
469
469
|
});
|
|
470
470
|
}
|
|
471
|
-
var SANDBOX_ENV_ALLOWLIST = [
|
|
472
|
-
// System essentials
|
|
473
|
-
"PATH",
|
|
474
|
-
"HOME",
|
|
475
|
-
"SHELL",
|
|
476
|
-
"USER",
|
|
477
|
-
"LOGNAME",
|
|
478
|
-
"TMPDIR",
|
|
479
|
-
"TEMP",
|
|
480
|
-
"TMP",
|
|
481
|
-
// Locale
|
|
482
|
-
"LANG",
|
|
483
|
-
"LC_ALL",
|
|
484
|
-
"LC_CTYPE",
|
|
485
|
-
// Terminal
|
|
486
|
-
"TERM",
|
|
487
|
-
"COLORTERM",
|
|
488
|
-
"TERM_PROGRAM",
|
|
489
|
-
// Node.js
|
|
490
|
-
"NODE_PATH",
|
|
491
|
-
"NODE_OPTIONS",
|
|
492
|
-
"NODE_ENV",
|
|
493
|
-
// Package managers
|
|
494
|
-
"NPM_CONFIG_PREFIX",
|
|
495
|
-
"NPM_CONFIG_CACHE",
|
|
496
|
-
"PNPM_HOME",
|
|
497
|
-
"YARN_GLOBAL_FOLDER",
|
|
498
|
-
"BUN_INSTALL",
|
|
499
|
-
// Version managers
|
|
500
|
-
"NVM_DIR",
|
|
501
|
-
"FNM_DIR",
|
|
502
|
-
"VOLTA_HOME",
|
|
503
|
-
"N_PREFIX",
|
|
504
|
-
// Build tools
|
|
505
|
-
"CARGO_HOME",
|
|
506
|
-
"GOPATH",
|
|
507
|
-
"GOROOT",
|
|
508
|
-
"RUSTUP_HOME",
|
|
509
|
-
"JAVA_HOME",
|
|
510
|
-
"ANDROID_HOME",
|
|
511
|
-
// Editor
|
|
512
|
-
"EDITOR",
|
|
513
|
-
"VISUAL",
|
|
514
|
-
// Git
|
|
515
|
-
"GIT_AUTHOR_NAME",
|
|
516
|
-
"GIT_AUTHOR_EMAIL",
|
|
517
|
-
"GIT_COMMITTER_NAME",
|
|
518
|
-
"GIT_COMMITTER_EMAIL",
|
|
519
|
-
// Platform specifics (macOS)
|
|
520
|
-
"XPC_FLAGS",
|
|
521
|
-
"XPC_SERVICE_NAME",
|
|
522
|
-
"__CF_USER_TEXT_ENCODING"
|
|
523
|
-
];
|
|
524
471
|
function buildSandboxEnv() {
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
env.NONINTERACTIVE = "1";
|
|
536
|
-
env.DEBIAN_FRONTEND = "noninteractive";
|
|
537
|
-
return env;
|
|
472
|
+
return {
|
|
473
|
+
...process.env,
|
|
474
|
+
// Explicit overrides for non-interactive subprocess execution
|
|
475
|
+
FORCE_COLOR: "1",
|
|
476
|
+
CLICOLOR_FORCE: "1",
|
|
477
|
+
TERM: process.env.TERM || "xterm-256color",
|
|
478
|
+
CI: "true",
|
|
479
|
+
NONINTERACTIVE: "1",
|
|
480
|
+
DEBIAN_FRONTEND: "noninteractive"
|
|
481
|
+
};
|
|
538
482
|
}
|
|
539
483
|
var mastraCodeLocalSkillsPath = path__namespace.default.join(process.cwd(), ".mastracode", "skills");
|
|
540
484
|
var claudeLocalSkillsPath = path__namespace.default.join(process.cwd(), ".claude", "skills");
|
|
@@ -596,8 +540,8 @@ function getDynamicWorkspace({ requestContext, mastra: mastra2 }) {
|
|
|
596
540
|
existing.setToolsConfig(isPlanMode ? { ...chunkAWYGW5ZV_cjs.TOOL_NAME_OVERRIDES, ...planModeTools } : chunkAWYGW5ZV_cjs.TOOL_NAME_OVERRIDES);
|
|
597
541
|
return existing;
|
|
598
542
|
}
|
|
599
|
-
const userLsp =
|
|
600
|
-
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)))), "..");
|
|
601
545
|
const lspConfig = {
|
|
602
546
|
...userLsp,
|
|
603
547
|
packageRunner: userLsp.packageRunner || detectPackageRunner(projectPath),
|
|
@@ -1063,14 +1007,14 @@ function getHarnessState(requestContext) {
|
|
|
1063
1007
|
}
|
|
1064
1008
|
function getObserverModel({ requestContext }) {
|
|
1065
1009
|
const state = getHarnessState(requestContext);
|
|
1066
|
-
return
|
|
1010
|
+
return chunkZ7PZS23L_cjs.resolveModel(state?.observerModelId ?? DEFAULT_OM_MODEL_ID, {
|
|
1067
1011
|
remapForCodexOAuth: true,
|
|
1068
1012
|
requestContext
|
|
1069
1013
|
});
|
|
1070
1014
|
}
|
|
1071
1015
|
function getReflectorModel({ requestContext }) {
|
|
1072
1016
|
const state = getHarnessState(requestContext);
|
|
1073
|
-
return
|
|
1017
|
+
return chunkZ7PZS23L_cjs.resolveModel(state?.reflectorModelId ?? DEFAULT_OM_MODEL_ID, {
|
|
1074
1018
|
remapForCodexOAuth: true,
|
|
1075
1019
|
requestContext
|
|
1076
1020
|
});
|
|
@@ -1106,7 +1050,8 @@ function getDynamicMemory(storage, vector) {
|
|
|
1106
1050
|
const refThreshold = state?.reflectionThreshold ?? DEFAULT_REF_THRESHOLD;
|
|
1107
1051
|
const caveman = state?.cavemanObservations ?? false;
|
|
1108
1052
|
const observerPreviousObservationTokens = 1e3;
|
|
1109
|
-
const
|
|
1053
|
+
const observeAttachments = state?.observeAttachments ?? true;
|
|
1054
|
+
const cacheKey = `${obsThreshold}:${refThreshold}:${omScope}:${observerPreviousObservationTokens}:${caveman ? 1 : 0}:${observeAttachments ? 1 : 0}`;
|
|
1110
1055
|
if (cachedMemory && cachedMemoryKey === cacheKey) {
|
|
1111
1056
|
return cachedMemory;
|
|
1112
1057
|
}
|
|
@@ -1125,7 +1070,7 @@ ${CAVEMAN_OM_INSTRUCTION}` : DYNAMIC_AGENTS_MD_INSTRUCTION;
|
|
|
1125
1070
|
temporalMarkers: true,
|
|
1126
1071
|
retrieval: vector ? { vector: true } : true,
|
|
1127
1072
|
scope: omScope,
|
|
1128
|
-
activateAfterIdle: "
|
|
1073
|
+
activateAfterIdle: "auto",
|
|
1129
1074
|
activateOnProviderChange: true,
|
|
1130
1075
|
observation: {
|
|
1131
1076
|
bufferTokens: isResourceScope ? false : 1 / 5,
|
|
@@ -1135,7 +1080,8 @@ ${CAVEMAN_OM_INSTRUCTION}` : DYNAMIC_AGENTS_MD_INSTRUCTION;
|
|
|
1135
1080
|
blockAfter: 2,
|
|
1136
1081
|
previousObserverTokens: observerPreviousObservationTokens,
|
|
1137
1082
|
threadTitle: true,
|
|
1138
|
-
instruction: observerInstruction
|
|
1083
|
+
instruction: observerInstruction,
|
|
1084
|
+
observeAttachments
|
|
1139
1085
|
},
|
|
1140
1086
|
reflection: {
|
|
1141
1087
|
bufferActivation: isResourceScope ? void 0 : 1 / 2,
|
|
@@ -2750,6 +2696,11 @@ var stateSchema = zod.z.object({
|
|
|
2750
2696
|
// Off by default — caveman style is opt-in via `/om` settings; observers and
|
|
2751
2697
|
// reflectors fall back to their built-in (prose) behavior unless enabled.
|
|
2752
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),
|
|
2753
2704
|
// Observational Memory scope — 'thread' (per-conversation) or 'resource' (shared across threads)
|
|
2754
2705
|
omScope: zod.z.enum(["thread", "resource"]).optional(),
|
|
2755
2706
|
// Thinking level for model reasoning effort
|
|
@@ -2912,15 +2863,15 @@ var PROVIDER_TO_OAUTH_ID = {
|
|
|
2912
2863
|
};
|
|
2913
2864
|
function createAuthStorage() {
|
|
2914
2865
|
const authStorage = new chunkLS7LUEZX_cjs.AuthStorage();
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2866
|
+
chunkZ7PZS23L_cjs.setAuthStorage(authStorage);
|
|
2867
|
+
chunkZ7PZS23L_cjs.setAuthStorage3(authStorage);
|
|
2868
|
+
chunkZ7PZS23L_cjs.setAuthStorage2(authStorage);
|
|
2918
2869
|
return authStorage;
|
|
2919
2870
|
}
|
|
2920
2871
|
function resolveCloudObservabilityConfig(settings, authStorage, resourceId) {
|
|
2921
2872
|
const resourceConfig = settings.observability.resources[resourceId];
|
|
2922
2873
|
if (resourceConfig) {
|
|
2923
|
-
const token = authStorage.getStoredApiKey(`${
|
|
2874
|
+
const token = authStorage.getStoredApiKey(`${chunkZ7PZS23L_cjs.OBSERVABILITY_AUTH_PREFIX}${resourceId}`);
|
|
2924
2875
|
if (token) {
|
|
2925
2876
|
return { accessToken: token, projectId: resourceConfig.projectId };
|
|
2926
2877
|
}
|
|
@@ -2938,8 +2889,8 @@ async function createMastraCode(config) {
|
|
|
2938
2889
|
}
|
|
2939
2890
|
const gatewayRegistry = llm.GatewayRegistry.getInstance({ useDynamicLoading: true });
|
|
2940
2891
|
const authStorage = createAuthStorage();
|
|
2941
|
-
const globalSettings =
|
|
2942
|
-
const storedGatewayKey = authStorage.getStoredApiKey(
|
|
2892
|
+
const globalSettings = chunkZ7PZS23L_cjs.loadSettings(config?.settingsPath);
|
|
2893
|
+
const storedGatewayKey = authStorage.getStoredApiKey(chunkZ7PZS23L_cjs.MEMORY_GATEWAY_PROVIDER);
|
|
2943
2894
|
const storedGatewayUrl = globalSettings.memoryGateway?.baseUrl;
|
|
2944
2895
|
if (storedGatewayKey) {
|
|
2945
2896
|
process.env["MASTRA_GATEWAY_API_KEY"] ??= storedGatewayKey;
|
|
@@ -2954,11 +2905,11 @@ async function createMastraCode(config) {
|
|
|
2954
2905
|
const envVars = cfg?.apiKeyEnvVar;
|
|
2955
2906
|
providerEnvVars[provider] = Array.isArray(envVars) ? envVars[0] : envVars;
|
|
2956
2907
|
}
|
|
2957
|
-
providerEnvVars[
|
|
2908
|
+
providerEnvVars[chunkZ7PZS23L_cjs.MEMORY_GATEWAY_PROVIDER] ??= "MASTRA_GATEWAY_API_KEY";
|
|
2958
2909
|
authStorage.loadStoredApiKeysIntoEnv(providerEnvVars);
|
|
2959
2910
|
} catch {
|
|
2960
2911
|
authStorage.loadStoredApiKeysIntoEnv({
|
|
2961
|
-
[
|
|
2912
|
+
[chunkZ7PZS23L_cjs.MEMORY_GATEWAY_PROVIDER]: "MASTRA_GATEWAY_API_KEY",
|
|
2962
2913
|
anthropic: "ANTHROPIC_API_KEY",
|
|
2963
2914
|
openai: "OPENAI_API_KEY",
|
|
2964
2915
|
google: "GOOGLE_GENERATIVE_AI_API_KEY",
|
|
@@ -2975,6 +2926,11 @@ async function createMastraCode(config) {
|
|
|
2975
2926
|
project.resourceId = resourceIdOverride;
|
|
2976
2927
|
project.resourceIdOverride = true;
|
|
2977
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
|
+
}
|
|
2978
2934
|
const storageConfig = config?.storage ?? chunkLS7LUEZX_cjs.getStorageConfig(project.rootPath, globalSettings.storage);
|
|
2979
2935
|
const storageResult = await createStorage(storageConfig);
|
|
2980
2936
|
const storageWarning = storageResult.warning;
|
|
@@ -3065,7 +3021,7 @@ async function createMastraCode(config) {
|
|
|
3065
3021
|
id: "code-agent",
|
|
3066
3022
|
name: "Code Agent",
|
|
3067
3023
|
instructions: getDynamicInstructions,
|
|
3068
|
-
model:
|
|
3024
|
+
model: chunkZ7PZS23L_cjs.getDynamicModel,
|
|
3069
3025
|
tools: createDynamicTools(mcpManager, config?.extraTools, hookManager, config?.disabledTools),
|
|
3070
3026
|
scorers: {
|
|
3071
3027
|
outcome: {
|
|
@@ -3096,21 +3052,21 @@ async function createMastraCode(config) {
|
|
|
3096
3052
|
name: "Build",
|
|
3097
3053
|
default: true,
|
|
3098
3054
|
defaultModelId: "anthropic/claude-opus-4-6",
|
|
3099
|
-
color:
|
|
3055
|
+
color: chunkZ7PZS23L_cjs.mastra.green,
|
|
3100
3056
|
agent: codeAgent
|
|
3101
3057
|
},
|
|
3102
3058
|
{
|
|
3103
3059
|
id: "plan",
|
|
3104
3060
|
name: "Plan",
|
|
3105
3061
|
defaultModelId: "openai/gpt-5.2-codex",
|
|
3106
|
-
color:
|
|
3062
|
+
color: chunkZ7PZS23L_cjs.mastra.purple,
|
|
3107
3063
|
agent: codeAgent
|
|
3108
3064
|
},
|
|
3109
3065
|
{
|
|
3110
3066
|
id: "fast",
|
|
3111
3067
|
name: "Fast",
|
|
3112
3068
|
defaultModelId: "cerebras/zai-glm-4.7",
|
|
3113
|
-
color:
|
|
3069
|
+
color: chunkZ7PZS23L_cjs.mastra.orange,
|
|
3114
3070
|
agent: codeAgent
|
|
3115
3071
|
}
|
|
3116
3072
|
];
|
|
@@ -3149,14 +3105,15 @@ async function createMastraCode(config) {
|
|
|
3149
3105
|
}
|
|
3150
3106
|
} catch {
|
|
3151
3107
|
}
|
|
3152
|
-
const builtinPacks =
|
|
3153
|
-
const builtinOmPacks =
|
|
3154
|
-
const effectiveDefaults =
|
|
3155
|
-
const effectiveObserverModel =
|
|
3156
|
-
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);
|
|
3157
3113
|
const effectiveObservationThreshold = globalSettings.models.omObservationThreshold ?? void 0;
|
|
3158
3114
|
const effectiveReflectionThreshold = globalSettings.models.omReflectionThreshold ?? void 0;
|
|
3159
3115
|
const effectiveCavemanObservations = globalSettings.models.omCavemanObservations ?? void 0;
|
|
3116
|
+
const effectiveObserveAttachments = globalSettings.models.omObserveAttachments ?? void 0;
|
|
3160
3117
|
const modes = (config?.modes ?? defaultModes).map((mode) => {
|
|
3161
3118
|
const savedModel = effectiveDefaults[mode.id];
|
|
3162
3119
|
return savedModel ? { ...mode, defaultModelId: savedModel } : mode;
|
|
@@ -3198,6 +3155,9 @@ async function createMastraCode(config) {
|
|
|
3198
3155
|
if (effectiveCavemanObservations !== void 0) {
|
|
3199
3156
|
globalInitialState.cavemanObservations = effectiveCavemanObservations;
|
|
3200
3157
|
}
|
|
3158
|
+
if (effectiveObserveAttachments !== void 0) {
|
|
3159
|
+
globalInitialState.observeAttachments = effectiveObserveAttachments;
|
|
3160
|
+
}
|
|
3201
3161
|
if (globalSettings.preferences.yolo !== null) {
|
|
3202
3162
|
globalInitialState.yolo = globalSettings.preferences.yolo;
|
|
3203
3163
|
}
|
|
@@ -3218,9 +3178,10 @@ async function createMastraCode(config) {
|
|
|
3218
3178
|
storage: storage$1,
|
|
3219
3179
|
observability: observability$1,
|
|
3220
3180
|
memory,
|
|
3181
|
+
pubsub: signalsPubSub,
|
|
3221
3182
|
stateSchema,
|
|
3222
3183
|
subagents,
|
|
3223
|
-
resolveModel: (modelId) =>
|
|
3184
|
+
resolveModel: (modelId) => chunkZ7PZS23L_cjs.resolveModel(modelId),
|
|
3224
3185
|
toolCategoryResolver: chunkAWYGW5ZV_cjs.getToolCategory,
|
|
3225
3186
|
initialState: {
|
|
3226
3187
|
projectPath: project.rootPath,
|
|
@@ -3235,7 +3196,7 @@ async function createMastraCode(config) {
|
|
|
3235
3196
|
modes,
|
|
3236
3197
|
heartbeatHandlers: config?.heartbeatHandlers ?? defaultHeartbeatHandlers,
|
|
3237
3198
|
modelAuthChecker: (provider) => {
|
|
3238
|
-
const gatewayKey = authStorage.getStoredApiKey(
|
|
3199
|
+
const gatewayKey = authStorage.getStoredApiKey(chunkZ7PZS23L_cjs.MEMORY_GATEWAY_PROVIDER) ?? process.env["MASTRA_GATEWAY_API_KEY"];
|
|
3239
3200
|
if (gatewayKey) {
|
|
3240
3201
|
const providerConfig = gatewayRegistry.getProviders()[provider];
|
|
3241
3202
|
if (providerConfig?.gateway === "mastra") return true;
|
|
@@ -3259,32 +3220,32 @@ async function createMastraCode(config) {
|
|
|
3259
3220
|
return true;
|
|
3260
3221
|
}
|
|
3261
3222
|
}
|
|
3262
|
-
const customProvider =
|
|
3263
|
-
return provider ===
|
|
3223
|
+
const customProvider = chunkZ7PZS23L_cjs.loadSettings().customProviders.find((entry) => {
|
|
3224
|
+
return provider === chunkZ7PZS23L_cjs.getCustomProviderId(entry.name);
|
|
3264
3225
|
});
|
|
3265
3226
|
if (customProvider) {
|
|
3266
3227
|
return true;
|
|
3267
3228
|
}
|
|
3268
3229
|
return void 0;
|
|
3269
3230
|
},
|
|
3270
|
-
modelUseCountProvider: () =>
|
|
3231
|
+
modelUseCountProvider: () => chunkZ7PZS23L_cjs.loadSettings().modelUseCounts,
|
|
3271
3232
|
modelUseCountTracker: (modelId) => {
|
|
3272
3233
|
try {
|
|
3273
|
-
const settings =
|
|
3234
|
+
const settings = chunkZ7PZS23L_cjs.loadSettings();
|
|
3274
3235
|
settings.modelUseCounts[modelId] = (settings.modelUseCounts[modelId] ?? 0) + 1;
|
|
3275
|
-
|
|
3236
|
+
chunkZ7PZS23L_cjs.saveSettings(settings);
|
|
3276
3237
|
} catch (error) {
|
|
3277
3238
|
console.error("Failed to persist model usage count", error);
|
|
3278
3239
|
}
|
|
3279
3240
|
},
|
|
3280
3241
|
customModelCatalogProvider: async () => {
|
|
3281
|
-
const settings =
|
|
3242
|
+
const settings = chunkZ7PZS23L_cjs.loadSettings();
|
|
3282
3243
|
const customModels = [];
|
|
3283
3244
|
for (const provider of settings.customProviders) {
|
|
3284
|
-
const providerId =
|
|
3245
|
+
const providerId = chunkZ7PZS23L_cjs.getCustomProviderId(provider.name);
|
|
3285
3246
|
for (const modelName of provider.models) {
|
|
3286
3247
|
customModels.push({
|
|
3287
|
-
id:
|
|
3248
|
+
id: chunkZ7PZS23L_cjs.toCustomProviderModelId(provider.name, modelName),
|
|
3288
3249
|
provider: providerId,
|
|
3289
3250
|
modelName,
|
|
3290
3251
|
hasApiKey: true,
|
|
@@ -3293,7 +3254,7 @@ async function createMastraCode(config) {
|
|
|
3293
3254
|
}
|
|
3294
3255
|
}
|
|
3295
3256
|
try {
|
|
3296
|
-
const copilotModels = await
|
|
3257
|
+
const copilotModels = await chunkZ7PZS23L_cjs.getCopilotModelCatalog({ authStorage });
|
|
3297
3258
|
for (const m of copilotModels) {
|
|
3298
3259
|
customModels.push({
|
|
3299
3260
|
id: `github-copilot/${m.id}`,
|
|
@@ -3308,9 +3269,9 @@ async function createMastraCode(config) {
|
|
|
3308
3269
|
}
|
|
3309
3270
|
return customModels;
|
|
3310
3271
|
},
|
|
3311
|
-
threadLock: {
|
|
3312
|
-
acquire:
|
|
3313
|
-
release:
|
|
3272
|
+
threadLock: crossProcessPubSub ? void 0 : {
|
|
3273
|
+
acquire: chunkZ7PZS23L_cjs.acquireThreadLock,
|
|
3274
|
+
release: chunkZ7PZS23L_cjs.releaseThreadLock
|
|
3314
3275
|
}
|
|
3315
3276
|
});
|
|
3316
3277
|
if (hookManager) {
|
|
@@ -3331,9 +3292,10 @@ async function createMastraCode(config) {
|
|
|
3331
3292
|
mcpManager,
|
|
3332
3293
|
hookManager,
|
|
3333
3294
|
authStorage,
|
|
3334
|
-
resolveModel:
|
|
3295
|
+
resolveModel: chunkZ7PZS23L_cjs.resolveModel,
|
|
3335
3296
|
storageWarning,
|
|
3336
3297
|
observabilityWarning,
|
|
3298
|
+
signalsPubSub,
|
|
3337
3299
|
builtinPacks,
|
|
3338
3300
|
builtinOmPacks,
|
|
3339
3301
|
effectiveDefaults
|
|
@@ -3342,5 +3304,5 @@ async function createMastraCode(config) {
|
|
|
3342
3304
|
|
|
3343
3305
|
exports.createAuthStorage = createAuthStorage;
|
|
3344
3306
|
exports.createMastraCode = createMastraCode;
|
|
3345
|
-
//# sourceMappingURL=chunk-
|
|
3346
|
-
//# sourceMappingURL=chunk-
|
|
3307
|
+
//# sourceMappingURL=chunk-EOBCOAWI.cjs.map
|
|
3308
|
+
//# sourceMappingURL=chunk-EOBCOAWI.cjs.map
|