mastracode 0.50.3-alpha.6 → 0.50.3-alpha.7
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 +14 -0
- package/dist/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/{run-tui-CkoB_9nz.cjs → run-tui-CXd1xOg-.cjs} +2 -2
- package/dist/{run-tui-Yv8A6Twx.js → run-tui-DmE2VxN-.js} +2 -2
- package/dist/run-tui.cjs +1 -1
- package/dist/run-tui.js +1 -1
- package/dist/tui/codex-fast-entries.d.ts +14 -0
- package/dist/tui/commands/models-pack.d.ts +1 -0
- package/dist/tui/components/model-selector.d.ts +5 -0
- package/dist/{tui-CdGKf5N1.js → tui-D4xVz0S2.js} +53 -7
- package/dist/{tui-CtUW5ijr.cjs → tui-DvbAOJ3z.cjs} +53 -7
- package/dist/tui.cjs +1 -1
- package/dist/tui.js +1 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# mastracode
|
|
2
2
|
|
|
3
|
+
## 0.50.3-alpha.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- **Model picker** — `/model` now lists a Fast entry (for example `openai/gpt-6.2-sol:fast`) next to each OpenAI model that has a Fast tier when you sign in to OpenAI with your ChatGPT account. When the session is on Fast, `/model` keeps the Fast entry selected, so pressing Enter no longer switches back to standard speed. ([#30882](https://github.com/mastra-ai/mastra/pull/30882))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`6bc0c6c`](https://github.com/mastra-ai/mastra/commit/6bc0c6cdc68342e32bb48076f9e9ba17e6669256), [`432e9be`](https://github.com/mastra-ai/mastra/commit/432e9bee6a30750e092c972a28e2f40027c6d7c5), [`f030844`](https://github.com/mastra-ai/mastra/commit/f03084426faf5d65c78ab391b74c3773ac173b0c), [`c28f67d`](https://github.com/mastra-ai/mastra/commit/c28f67d81eede65d220ff742f2f56804603c6674), [`0d8280d`](https://github.com/mastra-ai/mastra/commit/0d8280ddd778487b89bd2504ced24e3586e7711f), [`bc2dcc7`](https://github.com/mastra-ai/mastra/commit/bc2dcc78b75b4467d95afaf2b7369c54880d207a), [`0d8280d`](https://github.com/mastra-ai/mastra/commit/0d8280ddd778487b89bd2504ced24e3586e7711f)]:
|
|
10
|
+
- @mastra/code-sdk@1.21.0-alpha.8
|
|
11
|
+
- @mastra/core@1.86.0-alpha.7
|
|
12
|
+
- @mastra/memory@1.41.3-alpha.3
|
|
13
|
+
- @mastra/libsql@1.32.0-alpha.1
|
|
14
|
+
- @mastra/pg@1.37.1-alpha.2
|
|
15
|
+
- @mastra/mcp@2.11.0-alpha.1
|
|
16
|
+
|
|
3
17
|
## 0.50.3-alpha.6
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/cli.cjs
CHANGED
package/dist/cli.js
CHANGED
package/dist/docs/SKILL.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_tui = require("./tui-
|
|
1
|
+
const require_tui = require("./tui-DvbAOJ3z.cjs");
|
|
2
2
|
let _mastra_code_sdk = require("@mastra/code-sdk");
|
|
3
3
|
let child_process = require("child_process");
|
|
4
4
|
let fs = require("fs");
|
|
@@ -264,7 +264,7 @@ async function runUpdateCommand({ args = [], output = process.stdout, errorOutpu
|
|
|
264
264
|
}
|
|
265
265
|
// src/version.ts
|
|
266
266
|
function getCurrentVersion() {
|
|
267
|
-
return "0.50.3-alpha.
|
|
267
|
+
return "0.50.3-alpha.7";
|
|
268
268
|
}
|
|
269
269
|
/** Whether the invocation is `mastracode --version` or `mastracode -v`. */
|
|
270
270
|
function isVersionCommand(argv) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as closeActiveBrowser, E as activeBrowserGeneration, O as discardBrowser, T as TUI_CO_AUTHOR, _ as normalizeThemePreference, a as formatUpdateHeader, g as applyThemePreference, i as formatUpToDate, k as replaceActiveBrowser, n as formatInstallingLabel, o as formatUpdateOutcome, r as formatRegistryError, t as MastraTUI } from "./tui-
|
|
1
|
+
import { D as closeActiveBrowser, E as activeBrowserGeneration, O as discardBrowser, T as TUI_CO_AUTHOR, _ as normalizeThemePreference, a as formatUpdateHeader, g as applyThemePreference, i as formatUpToDate, k as replaceActiveBrowser, n as formatInstallingLabel, o as formatUpdateOutcome, r as formatRegistryError, t as MastraTUI } from "./tui-D4xVz0S2.js";
|
|
2
2
|
import { createMastraCode, resolveSubagentsSetting } from "@mastra/code-sdk";
|
|
3
3
|
import { spawn } from "child_process";
|
|
4
4
|
import fs from "fs";
|
|
@@ -263,7 +263,7 @@ async function runUpdateCommand({ args = [], output = process.stdout, errorOutpu
|
|
|
263
263
|
}
|
|
264
264
|
// src/version.ts
|
|
265
265
|
function getCurrentVersion() {
|
|
266
|
-
return "0.50.3-alpha.
|
|
266
|
+
return "0.50.3-alpha.7";
|
|
267
267
|
}
|
|
268
268
|
/** Whether the invocation is `mastracode --version` or `mastracode -v`. */
|
|
269
269
|
function isVersionCommand(argv) {
|
package/dist/run-tui.cjs
CHANGED
package/dist/run-tui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as runTui } from "./run-tui-
|
|
1
|
+
export { t as runTui } from "./run-tui-DmE2VxN-.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AuthStorage } from '@mastra/code-sdk/auth/storage';
|
|
2
|
+
/**
|
|
3
|
+
* Adds each connected OpenAI model's Fast entry to a model picker's list when OpenAI is signed in with ChatGPT.
|
|
4
|
+
* A Factory's own list already says which Fast entries exist, so it is left as the Factory sent it.
|
|
5
|
+
*/
|
|
6
|
+
export declare function withFastEntries<T extends {
|
|
7
|
+
id: string;
|
|
8
|
+
modelName: string;
|
|
9
|
+
hasApiKey: boolean;
|
|
10
|
+
}>(models: T[], { authStorage, factory }: {
|
|
11
|
+
authStorage?: AuthStorage;
|
|
12
|
+
factory?: unknown;
|
|
13
|
+
}): T[];
|
|
14
|
+
//# sourceMappingURL=codex-fast-entries.d.ts.map
|
|
@@ -5,6 +5,7 @@ import type { SlashCommandContext } from './types.js';
|
|
|
5
5
|
export { removeCustomPackFromSettings };
|
|
6
6
|
export declare function serializePack(pack: ModePack): string;
|
|
7
7
|
export declare function deserializePack(input: string): ModePack | null;
|
|
8
|
+
export declare function selectModel(ctx: SlashCommandContext, title: string, modeColor?: string, currentModelId?: string): Promise<string | undefined>;
|
|
8
9
|
type AccountLabelLookup = (providerId: string) => Array<{
|
|
9
10
|
id: string;
|
|
10
11
|
label: string;
|
|
@@ -73,6 +73,11 @@ export declare class ModelSelectorComponent extends Box implements Focusable {
|
|
|
73
73
|
constructor(options: ModelSelectorOptions);
|
|
74
74
|
private buildUI;
|
|
75
75
|
private sortModels;
|
|
76
|
+
/**
|
|
77
|
+
* Puts each Codex Fast entry directly under its standard model. A Fast entry that is the current model stays first,
|
|
78
|
+
* with its standard model right below it. `:fast` on any other provider is part of the model name and stays put.
|
|
79
|
+
*/
|
|
80
|
+
private keepFastEntriesNextToStandard;
|
|
76
81
|
/** Whether the custom "Use: ..." item is showing at the top */
|
|
77
82
|
private hasCustomItem;
|
|
78
83
|
private filterModels;
|
|
@@ -20,6 +20,7 @@ import { ONBOARDING_VERSION, getAvailableModePacks, loadSettings as loadSettings
|
|
|
20
20
|
import { detectPackageManager, fetchChangelog, fetchLatestVersion, isNewerVersion, performUpdate, planUpdate } from "@mastra/code-sdk/utils/update-check";
|
|
21
21
|
import { assignTaskIds, mastraDBMessageToSignal } from "@mastra/core/signals";
|
|
22
22
|
import { z } from "zod";
|
|
23
|
+
import { getCredentialProviderId, parseCodexModelSelection, remapOpenAIModelForCodexOAuth, withCodexFastModels } from "@mastra/code-sdk/providers/model-ids";
|
|
23
24
|
import { processSlashCommand } from "@mastra/code-sdk/utils/slash-command-processor";
|
|
24
25
|
import { createGoalReminderSignal } from "@mastra/code-sdk/goal-signal";
|
|
25
26
|
import { defaultOMProgressState, isSessionStartupCancelledError, parseSubagentMeta } from "@mastra/core/agent-controller";
|
|
@@ -54,7 +55,6 @@ import { removeCustomPackFromSettings } from "@mastra/code-sdk/onboarding/custom
|
|
|
54
55
|
import { canUseProvider, getActiveRouteMemoryModelId } from "@mastra/code-sdk/agents/model";
|
|
55
56
|
import { removeCustomProviderFromSettings, upsertCustomProviderInSettings } from "@mastra/code-sdk/onboarding/custom-providers";
|
|
56
57
|
import { applyOmRoleAuto, applyOmRoleOverride, persistOmObserveAttachments } from "@mastra/code-sdk/onboarding/om-settings";
|
|
57
|
-
import { getCredentialProviderId, remapOpenAIModelForCodexOAuth } from "@mastra/code-sdk/providers/model-ids";
|
|
58
58
|
import { getOAuthProviders as getOAuthProviders$1 } from "@mastra/code-sdk/auth/index";
|
|
59
59
|
import { createFactoryUserSession, listFactoryProjects } from "@mastra/code-sdk/factory/client";
|
|
60
60
|
import { GatewayRegistry } from "@mastra/core/llm";
|
|
@@ -2818,6 +2818,16 @@ function getCompactRunLabelColor(participants) {
|
|
|
2818
2818
|
if (participants.some((participant) => participant.getOwnCompactToolLabelColor?.() === "error")) return "error";
|
|
2819
2819
|
return "toolTitle";
|
|
2820
2820
|
}
|
|
2821
|
+
// src/tui/codex-fast-entries.ts
|
|
2822
|
+
/**
|
|
2823
|
+
* Adds each connected OpenAI model's Fast entry to a model picker's list when OpenAI is signed in with ChatGPT.
|
|
2824
|
+
* A Factory's own list already says which Fast entries exist, so it is left as the Factory sent it.
|
|
2825
|
+
*/
|
|
2826
|
+
function withFastEntries(models, { authStorage, factory }) {
|
|
2827
|
+
if (factory) return models;
|
|
2828
|
+
const codexOAuth = authStorage?.get(getCredentialProviderId("openai"))?.type === "oauth";
|
|
2829
|
+
return withCodexFastModels(models, { codexOAuth });
|
|
2830
|
+
}
|
|
2821
2831
|
// src/tui/components/goal-cycles-dialog.ts
|
|
2822
2832
|
/**
|
|
2823
2833
|
* Goal max-cycles input dialog.
|
|
@@ -2946,6 +2956,7 @@ function makeCustomModelItem(id, models) {
|
|
|
2946
2956
|
};
|
|
2947
2957
|
}
|
|
2948
2958
|
const MASTRACODE_GATEWAY_PREFIX = "mastracode/";
|
|
2959
|
+
const FAST_SUFFIX = ":fast";
|
|
2949
2960
|
/**
|
|
2950
2961
|
* The shared catalog namespaces the MastraCode gateway's providers (the user's
|
|
2951
2962
|
* custom providers) as `mastracode/<provider>/<model>`, but Mastra Code
|
|
@@ -2992,8 +3003,9 @@ var ModelSelectorComponent = class extends Box {
|
|
|
2992
3003
|
this.tui = options.tui;
|
|
2993
3004
|
this.title = options.title ?? "Select Model";
|
|
2994
3005
|
this.titleColor = options.titleColor;
|
|
2995
|
-
|
|
2996
|
-
this.currentModelId = options.currentModelId;
|
|
3006
|
+
const models = toCanonicalModelItems(options.models);
|
|
3007
|
+
this.currentModelId = options.currentModelId && !models.some((model) => model.id === options.currentModelId) ? parseCodexModelSelection(options.currentModelId).modelId : options.currentModelId;
|
|
3008
|
+
this.allModels = this.sortModels(models, this.currentModelId);
|
|
2997
3009
|
this.onSelectCallback = options.onSelect;
|
|
2998
3010
|
this.onCancelCallback = options.onCancel;
|
|
2999
3011
|
this.filteredModels = this.allModels;
|
|
@@ -3043,7 +3055,32 @@ var ModelSelectorComponent = class extends Box {
|
|
|
3043
3055
|
if (providerCompare !== 0) return providerCompare;
|
|
3044
3056
|
return a.modelName.localeCompare(b.modelName);
|
|
3045
3057
|
});
|
|
3046
|
-
return sorted;
|
|
3058
|
+
return this.keepFastEntriesNextToStandard(sorted, currentModelId);
|
|
3059
|
+
}
|
|
3060
|
+
/**
|
|
3061
|
+
* Puts each Codex Fast entry directly under its standard model. A Fast entry that is the current model stays first,
|
|
3062
|
+
* with its standard model right below it. `:fast` on any other provider is part of the model name and stays put.
|
|
3063
|
+
*/
|
|
3064
|
+
keepFastEntriesNextToStandard(sorted, currentModelId) {
|
|
3065
|
+
const byId = new Map(sorted.map((model) => [model.id, model]));
|
|
3066
|
+
const isFastEntry = (model) => model !== void 0 && parseCodexModelSelection(model.id).codexServiceTier === "fast";
|
|
3067
|
+
const standardOf = (model) => isFastEntry(model) ? byId.get(parseCodexModelSelection(model.id).modelId) : void 0;
|
|
3068
|
+
const placed = /* @__PURE__ */ new Set();
|
|
3069
|
+
const result = [];
|
|
3070
|
+
for (const model of sorted) {
|
|
3071
|
+
if (placed.has(model.id)) continue;
|
|
3072
|
+
const standard = standardOf(model);
|
|
3073
|
+
if (standard && model.id !== currentModelId) continue;
|
|
3074
|
+
result.push(model);
|
|
3075
|
+
placed.add(model.id);
|
|
3076
|
+
const fastEntry = byId.get(`${model.id}${FAST_SUFFIX}`);
|
|
3077
|
+
const partner = standard ?? (isFastEntry(fastEntry) ? fastEntry : void 0);
|
|
3078
|
+
if (partner && !placed.has(partner.id)) {
|
|
3079
|
+
result.push(partner);
|
|
3080
|
+
placed.add(partner.id);
|
|
3081
|
+
}
|
|
3082
|
+
}
|
|
3083
|
+
return result;
|
|
3047
3084
|
}
|
|
3048
3085
|
/** Whether the custom "Use: ..." item is showing at the top */
|
|
3049
3086
|
hasCustomItem = false;
|
|
@@ -16628,7 +16665,10 @@ async function handleModelCommand(ctx) {
|
|
|
16628
16665
|
}
|
|
16629
16666
|
const models = await ctx.state.controller.listAvailableModels();
|
|
16630
16667
|
const currentModelId = ctx.state.session.model.get();
|
|
16631
|
-
const
|
|
16668
|
+
const { modelId: currentCatalogId } = parseCodexModelSelection(currentModelId);
|
|
16669
|
+
const codexOAuth = ctx.authStorage?.get(getCredentialProviderId("openai"))?.type === "oauth";
|
|
16670
|
+
const available = models.filter((model) => model.hasApiKey || model.id === currentCatalogId);
|
|
16671
|
+
const connected = ctx.state.factory ? available : withCodexFastModels(available, { codexOAuth });
|
|
16632
16672
|
if (connected.length === 0) {
|
|
16633
16673
|
ctx.showInfo("No connected models. Use /connect to add a provider account or API key.");
|
|
16634
16674
|
return;
|
|
@@ -17407,7 +17447,10 @@ function deserializePack(input) {
|
|
|
17407
17447
|
}
|
|
17408
17448
|
}
|
|
17409
17449
|
async function selectModel(ctx, title, modeColor, currentModelId) {
|
|
17410
|
-
const availableModels = await ctx.state.controller.listAvailableModels()
|
|
17450
|
+
const availableModels = withFastEntries(await ctx.state.controller.listAvailableModels(), {
|
|
17451
|
+
authStorage: ctx.authStorage,
|
|
17452
|
+
factory: ctx.state.factory
|
|
17453
|
+
});
|
|
17411
17454
|
if (availableModels.length === 0) return void 0;
|
|
17412
17455
|
return new Promise((resolve) => {
|
|
17413
17456
|
const selector = new ModelSelectorComponent({
|
|
@@ -29879,7 +29922,10 @@ var MastraTUI = class MastraTUI {
|
|
|
29879
29922
|
});
|
|
29880
29923
|
},
|
|
29881
29924
|
onSelectModel: async (title, modeColor) => {
|
|
29882
|
-
const availableModels = await this.state.controller.listAvailableModels()
|
|
29925
|
+
const availableModels = withFastEntries(await this.state.controller.listAvailableModels(), {
|
|
29926
|
+
authStorage: this.state.authStorage,
|
|
29927
|
+
factory: this.state.factory
|
|
29928
|
+
});
|
|
29883
29929
|
if (this.stopped || availableModels.length === 0) return void 0;
|
|
29884
29930
|
return new Promise((resolveModel) => {
|
|
29885
29931
|
const selector = new ModelSelectorComponent({
|
|
@@ -41,6 +41,7 @@ let _mastra_code_sdk_onboarding_index = require("@mastra/code-sdk/onboarding/ind
|
|
|
41
41
|
let _mastra_code_sdk_utils_update_check = require("@mastra/code-sdk/utils/update-check");
|
|
42
42
|
let _mastra_core_signals = require("@mastra/core/signals");
|
|
43
43
|
let zod = require("zod");
|
|
44
|
+
let _mastra_code_sdk_providers_model_ids = require("@mastra/code-sdk/providers/model-ids");
|
|
44
45
|
let _mastra_code_sdk_utils_slash_command_processor = require("@mastra/code-sdk/utils/slash-command-processor");
|
|
45
46
|
let _mastra_code_sdk_goal_signal = require("@mastra/code-sdk/goal-signal");
|
|
46
47
|
let _mastra_core_agent_controller = require("@mastra/core/agent-controller");
|
|
@@ -78,7 +79,6 @@ let _mastra_code_sdk_onboarding_custom_packs = require("@mastra/code-sdk/onboard
|
|
|
78
79
|
let _mastra_code_sdk_agents_model = require("@mastra/code-sdk/agents/model");
|
|
79
80
|
let _mastra_code_sdk_onboarding_custom_providers = require("@mastra/code-sdk/onboarding/custom-providers");
|
|
80
81
|
let _mastra_code_sdk_onboarding_om_settings = require("@mastra/code-sdk/onboarding/om-settings");
|
|
81
|
-
let _mastra_code_sdk_providers_model_ids = require("@mastra/code-sdk/providers/model-ids");
|
|
82
82
|
let _mastra_code_sdk_auth_index = require("@mastra/code-sdk/auth/index");
|
|
83
83
|
let _mastra_code_sdk_factory_client = require("@mastra/code-sdk/factory/client");
|
|
84
84
|
let _mastra_core_llm = require("@mastra/core/llm");
|
|
@@ -2842,6 +2842,16 @@ function getCompactRunLabelColor(participants) {
|
|
|
2842
2842
|
if (participants.some((participant) => participant.getOwnCompactToolLabelColor?.() === "error")) return "error";
|
|
2843
2843
|
return "toolTitle";
|
|
2844
2844
|
}
|
|
2845
|
+
// src/tui/codex-fast-entries.ts
|
|
2846
|
+
/**
|
|
2847
|
+
* Adds each connected OpenAI model's Fast entry to a model picker's list when OpenAI is signed in with ChatGPT.
|
|
2848
|
+
* A Factory's own list already says which Fast entries exist, so it is left as the Factory sent it.
|
|
2849
|
+
*/
|
|
2850
|
+
function withFastEntries(models, { authStorage, factory }) {
|
|
2851
|
+
if (factory) return models;
|
|
2852
|
+
const codexOAuth = authStorage?.get((0, _mastra_code_sdk_providers_model_ids.getCredentialProviderId)("openai"))?.type === "oauth";
|
|
2853
|
+
return (0, _mastra_code_sdk_providers_model_ids.withCodexFastModels)(models, { codexOAuth });
|
|
2854
|
+
}
|
|
2845
2855
|
// src/tui/components/goal-cycles-dialog.ts
|
|
2846
2856
|
/**
|
|
2847
2857
|
* Goal max-cycles input dialog.
|
|
@@ -2970,6 +2980,7 @@ function makeCustomModelItem(id, models) {
|
|
|
2970
2980
|
};
|
|
2971
2981
|
}
|
|
2972
2982
|
const MASTRACODE_GATEWAY_PREFIX = "mastracode/";
|
|
2983
|
+
const FAST_SUFFIX = ":fast";
|
|
2973
2984
|
/**
|
|
2974
2985
|
* The shared catalog namespaces the MastraCode gateway's providers (the user's
|
|
2975
2986
|
* custom providers) as `mastracode/<provider>/<model>`, but Mastra Code
|
|
@@ -3016,8 +3027,9 @@ var ModelSelectorComponent = class extends _earendil_works_pi_tui.Box {
|
|
|
3016
3027
|
this.tui = options.tui;
|
|
3017
3028
|
this.title = options.title ?? "Select Model";
|
|
3018
3029
|
this.titleColor = options.titleColor;
|
|
3019
|
-
|
|
3020
|
-
this.currentModelId = options.currentModelId;
|
|
3030
|
+
const models = toCanonicalModelItems(options.models);
|
|
3031
|
+
this.currentModelId = options.currentModelId && !models.some((model) => model.id === options.currentModelId) ? (0, _mastra_code_sdk_providers_model_ids.parseCodexModelSelection)(options.currentModelId).modelId : options.currentModelId;
|
|
3032
|
+
this.allModels = this.sortModels(models, this.currentModelId);
|
|
3021
3033
|
this.onSelectCallback = options.onSelect;
|
|
3022
3034
|
this.onCancelCallback = options.onCancel;
|
|
3023
3035
|
this.filteredModels = this.allModels;
|
|
@@ -3067,7 +3079,32 @@ var ModelSelectorComponent = class extends _earendil_works_pi_tui.Box {
|
|
|
3067
3079
|
if (providerCompare !== 0) return providerCompare;
|
|
3068
3080
|
return a.modelName.localeCompare(b.modelName);
|
|
3069
3081
|
});
|
|
3070
|
-
return sorted;
|
|
3082
|
+
return this.keepFastEntriesNextToStandard(sorted, currentModelId);
|
|
3083
|
+
}
|
|
3084
|
+
/**
|
|
3085
|
+
* Puts each Codex Fast entry directly under its standard model. A Fast entry that is the current model stays first,
|
|
3086
|
+
* with its standard model right below it. `:fast` on any other provider is part of the model name and stays put.
|
|
3087
|
+
*/
|
|
3088
|
+
keepFastEntriesNextToStandard(sorted, currentModelId) {
|
|
3089
|
+
const byId = new Map(sorted.map((model) => [model.id, model]));
|
|
3090
|
+
const isFastEntry = (model) => model !== void 0 && (0, _mastra_code_sdk_providers_model_ids.parseCodexModelSelection)(model.id).codexServiceTier === "fast";
|
|
3091
|
+
const standardOf = (model) => isFastEntry(model) ? byId.get((0, _mastra_code_sdk_providers_model_ids.parseCodexModelSelection)(model.id).modelId) : void 0;
|
|
3092
|
+
const placed = /* @__PURE__ */ new Set();
|
|
3093
|
+
const result = [];
|
|
3094
|
+
for (const model of sorted) {
|
|
3095
|
+
if (placed.has(model.id)) continue;
|
|
3096
|
+
const standard = standardOf(model);
|
|
3097
|
+
if (standard && model.id !== currentModelId) continue;
|
|
3098
|
+
result.push(model);
|
|
3099
|
+
placed.add(model.id);
|
|
3100
|
+
const fastEntry = byId.get(`${model.id}${FAST_SUFFIX}`);
|
|
3101
|
+
const partner = standard ?? (isFastEntry(fastEntry) ? fastEntry : void 0);
|
|
3102
|
+
if (partner && !placed.has(partner.id)) {
|
|
3103
|
+
result.push(partner);
|
|
3104
|
+
placed.add(partner.id);
|
|
3105
|
+
}
|
|
3106
|
+
}
|
|
3107
|
+
return result;
|
|
3071
3108
|
}
|
|
3072
3109
|
/** Whether the custom "Use: ..." item is showing at the top */
|
|
3073
3110
|
hasCustomItem = false;
|
|
@@ -16658,7 +16695,10 @@ async function handleModelCommand(ctx) {
|
|
|
16658
16695
|
}
|
|
16659
16696
|
const models = await ctx.state.controller.listAvailableModels();
|
|
16660
16697
|
const currentModelId = ctx.state.session.model.get();
|
|
16661
|
-
const
|
|
16698
|
+
const { modelId: currentCatalogId } = (0, _mastra_code_sdk_providers_model_ids.parseCodexModelSelection)(currentModelId);
|
|
16699
|
+
const codexOAuth = ctx.authStorage?.get((0, _mastra_code_sdk_providers_model_ids.getCredentialProviderId)("openai"))?.type === "oauth";
|
|
16700
|
+
const available = models.filter((model) => model.hasApiKey || model.id === currentCatalogId);
|
|
16701
|
+
const connected = ctx.state.factory ? available : (0, _mastra_code_sdk_providers_model_ids.withCodexFastModels)(available, { codexOAuth });
|
|
16662
16702
|
if (connected.length === 0) {
|
|
16663
16703
|
ctx.showInfo("No connected models. Use /connect to add a provider account or API key.");
|
|
16664
16704
|
return;
|
|
@@ -17437,7 +17477,10 @@ function deserializePack(input) {
|
|
|
17437
17477
|
}
|
|
17438
17478
|
}
|
|
17439
17479
|
async function selectModel(ctx, title, modeColor, currentModelId) {
|
|
17440
|
-
const availableModels = await ctx.state.controller.listAvailableModels()
|
|
17480
|
+
const availableModels = withFastEntries(await ctx.state.controller.listAvailableModels(), {
|
|
17481
|
+
authStorage: ctx.authStorage,
|
|
17482
|
+
factory: ctx.state.factory
|
|
17483
|
+
});
|
|
17441
17484
|
if (availableModels.length === 0) return void 0;
|
|
17442
17485
|
return new Promise((resolve) => {
|
|
17443
17486
|
const selector = new ModelSelectorComponent({
|
|
@@ -29909,7 +29952,10 @@ var MastraTUI = class MastraTUI {
|
|
|
29909
29952
|
});
|
|
29910
29953
|
},
|
|
29911
29954
|
onSelectModel: async (title, modeColor) => {
|
|
29912
|
-
const availableModels = await this.state.controller.listAvailableModels()
|
|
29955
|
+
const availableModels = withFastEntries(await this.state.controller.listAvailableModels(), {
|
|
29956
|
+
authStorage: this.state.authStorage,
|
|
29957
|
+
factory: this.state.factory
|
|
29958
|
+
});
|
|
29913
29959
|
if (this.stopped || availableModels.length === 0) return void 0;
|
|
29914
29960
|
return new Promise((resolveModel) => {
|
|
29915
29961
|
const selector = new ModelSelectorComponent({
|
package/dist/tui.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_tui = require("./tui-
|
|
2
|
+
const require_tui = require("./tui-DvbAOJ3z.cjs");
|
|
3
3
|
let _mastra_code_sdk_theme_palette = require("@mastra/code-sdk/theme-palette");
|
|
4
4
|
exports.AssistantMessageComponent = require_tui.AssistantMessageComponent;
|
|
5
5
|
exports.LoginDialogComponent = require_tui.LoginDialogComponent;
|
package/dist/tui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { h as AssistantMessageComponent, c as LoginDialogComponent, s as LoginSelectorComponent, t as MastraTUI, m as ModelSelectorComponent, l as OMProgressComponent, p as ToolExecutionComponentEnhanced, f as UserMessageComponent, v as applyThemeMode, d as createTUIState, u as formatOMStatus, y as getEditorTheme, b as getMarkdownTheme, x as getThemeMode, S as mastra, C as mastraBrand, w as theme } from "./tui-
|
|
1
|
+
export { h as AssistantMessageComponent, c as LoginDialogComponent, s as LoginSelectorComponent, t as MastraTUI, m as ModelSelectorComponent, l as OMProgressComponent, p as ToolExecutionComponentEnhanced, f as UserMessageComponent, v as applyThemeMode, d as createTUIState, u as formatOMStatus, y as getEditorTheme, b as getMarkdownTheme, x as getThemeMode, S as mastra, C as mastraBrand, w as theme } from "./tui-D4xVz0S2.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mastracode",
|
|
3
|
-
"version": "0.50.3-alpha.
|
|
3
|
+
"version": "0.50.3-alpha.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -107,19 +107,19 @@
|
|
|
107
107
|
"yaml": "^2.9.1",
|
|
108
108
|
"zod": "^4.6.7",
|
|
109
109
|
"@mastra/agent-browser": "0.7.0-alpha.1",
|
|
110
|
-
"@mastra/code-sdk": "^1.21.0-alpha.
|
|
111
|
-
"@mastra/core": "1.86.0-alpha.
|
|
110
|
+
"@mastra/code-sdk": "^1.21.0-alpha.8",
|
|
111
|
+
"@mastra/core": "1.86.0-alpha.7",
|
|
112
112
|
"@mastra/duckdb": "1.19.2-alpha.0",
|
|
113
113
|
"@mastra/fastembed": "1.4.0-alpha.1",
|
|
114
|
-
"@mastra/
|
|
115
|
-
"@mastra/libsql": "1.32.0-alpha.0",
|
|
114
|
+
"@mastra/libsql": "1.32.0-alpha.1",
|
|
116
115
|
"@mastra/mcp": "2.11.0-alpha.1",
|
|
116
|
+
"@mastra/memory": "1.41.3-alpha.3",
|
|
117
117
|
"@mastra/observability": "1.24.3-alpha.1",
|
|
118
|
-
"@mastra/
|
|
119
|
-
"@mastra/pg": "1.37.1-alpha.1",
|
|
118
|
+
"@mastra/pg": "1.37.1-alpha.2",
|
|
120
119
|
"@mastra/schema-compat": "1.4.1-alpha.0",
|
|
120
|
+
"@mastra/tavily": "1.1.4-alpha.0",
|
|
121
121
|
"@mastra/stagehand": "0.4.1-alpha.0",
|
|
122
|
-
"@mastra/
|
|
122
|
+
"@mastra/github-signals": "0.5.4-alpha.0"
|
|
123
123
|
},
|
|
124
124
|
"devDependencies": {
|
|
125
125
|
"@copilotkit/aimock": "^1.46.0",
|