@iaforged/context-code 1.0.80 → 1.0.81
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/dist/src/components/LogoV2/FeedColumn.js +3 -4
- package/dist/src/components/LogoV2/LogoV2.js +10 -10
- package/dist/src/components/LogoV2/WelcomeV2.js +1 -1
- package/dist/src/components/agents/ModelSelector.js +204 -52
- package/dist/src/components/agents/new-agent-creation/types.js +1 -0
- package/dist/src/utils/model/agent.js +12 -3
- package/dist/src/utils/model/providerOverrideContext.js +11 -0
- package/package.json +1 -1
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c as _c } from "react/compiler-runtime";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { Box } from '../../ink.js';
|
|
5
|
-
import { Divider } from '../design-system/Divider.js';
|
|
6
5
|
import { calculateFeedWidth, Feed } from './Feed.js';
|
|
7
6
|
export function FeedColumn(t0) {
|
|
8
7
|
const $ = _c(10);
|
|
@@ -23,7 +22,7 @@ export function FeedColumn(t0) {
|
|
|
23
22
|
if ($[2] !== actualWidth || $[3] !== feeds) {
|
|
24
23
|
let t3;
|
|
25
24
|
if ($[5] !== actualWidth || $[6] !== feeds.length) {
|
|
26
|
-
t3 = (feed_0, index) =>
|
|
25
|
+
t3 = (feed_0, index) => _jsx(React.Fragment, { children: _jsx(Feed, { config: feed_0, actualWidth: actualWidth }) }, index);
|
|
27
26
|
$[5] = actualWidth;
|
|
28
27
|
$[6] = feeds.length;
|
|
29
28
|
$[7] = t3;
|
|
@@ -41,7 +40,7 @@ export function FeedColumn(t0) {
|
|
|
41
40
|
}
|
|
42
41
|
let t3;
|
|
43
42
|
if ($[8] !== t2) {
|
|
44
|
-
t3 = _jsx(Box, { flexDirection: "column", children: t2 });
|
|
43
|
+
t3 = _jsx(Box, { flexDirection: "column", gap: 1, children: t2 });
|
|
45
44
|
$[8] = t2;
|
|
46
45
|
$[9] = t3;
|
|
47
46
|
}
|
|
@@ -251,8 +251,8 @@ export function LogoV2() {
|
|
|
251
251
|
}
|
|
252
252
|
const layoutMode = getLayoutMode(columns);
|
|
253
253
|
const userTheme = resolveThemeSetting(getGlobalConfig().theme);
|
|
254
|
-
const borderTitle = ` ${color("claude", userTheme)("
|
|
255
|
-
const compactBorderTitle = color("claude", userTheme)("
|
|
254
|
+
const borderTitle = ` ${color("claude", userTheme)("CTX")} ${color("inactive", userTheme)(`v${version}`)} `;
|
|
255
|
+
const compactBorderTitle = color("claude", userTheme)(" CTX ");
|
|
256
256
|
if (layoutMode === "compact") {
|
|
257
257
|
let welcomeMessage = formatWelcomeMessage(username);
|
|
258
258
|
if (stringWidth(welcomeMessage) > columns - 4) {
|
|
@@ -335,7 +335,7 @@ export function LogoV2() {
|
|
|
335
335
|
t18 = $[42];
|
|
336
336
|
t19 = $[43];
|
|
337
337
|
}
|
|
338
|
-
return _jsxs(_Fragment, { children: [_jsx(OffscreenFreeze, { children: _jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "claude", borderText: t11, paddingX:
|
|
338
|
+
return _jsxs(_Fragment, { children: [_jsx(OffscreenFreeze, { children: _jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "claude", borderText: t11, paddingX: 2, paddingY: 1, alignItems: "center", width: columns, children: [_jsx(Text, { color: "claude", children: "CTX" }), _jsx(Text, { bold: true, children: welcomeMessage }), t12, _jsx(Text, { dimColor: true, children: modelDisplayName }), _jsx(Text, { dimColor: true, children: billingType }), agentName ? _jsxs(Text, { dimColor: true, children: ["@", agentName] }) : null, _jsx(Text, { dimColor: true, children: truncatedCwd })] }) }), t14, t15, t16, t17, t18, t19] });
|
|
339
339
|
}
|
|
340
340
|
const welcomeMessage_0 = formatWelcomeMessage(username);
|
|
341
341
|
const modelLine = !process.env.IS_DEMO && config.oauthAccount?.organizationName ? `${modelDisplayName} · ${billingType} · ${config.oauthAccount.organizationName}` : `${modelDisplayName} · ${billingType}`;
|
|
@@ -364,9 +364,9 @@ export function LogoV2() {
|
|
|
364
364
|
t14 = $[45];
|
|
365
365
|
}
|
|
366
366
|
const T2 = Box;
|
|
367
|
-
const t15 =
|
|
368
|
-
const t16 =
|
|
369
|
-
const t17 =
|
|
367
|
+
const t15 = "column";
|
|
368
|
+
const t16 = 2;
|
|
369
|
+
const t17 = 2;
|
|
370
370
|
let t18;
|
|
371
371
|
if ($[46] !== welcomeMessage_0) {
|
|
372
372
|
t18 = _jsx(Box, { marginTop: 1, children: _jsx(Text, { bold: true, children: welcomeMessage_0 }) });
|
|
@@ -404,7 +404,7 @@ export function LogoV2() {
|
|
|
404
404
|
}
|
|
405
405
|
let t22;
|
|
406
406
|
if ($[53] !== t20 || $[54] !== t21) {
|
|
407
|
-
t22 = _jsxs(Box, { flexDirection: "column", alignItems: "center", children: [t20, t21] });
|
|
407
|
+
t22 = _jsxs(Box, { flexDirection: "column", alignItems: "center", children: [_jsx(Text, { color: "claude", children: "CTX" }), t20, t21] });
|
|
408
408
|
$[53] = t20;
|
|
409
409
|
$[54] = t21;
|
|
410
410
|
$[55] = t22;
|
|
@@ -414,7 +414,7 @@ export function LogoV2() {
|
|
|
414
414
|
}
|
|
415
415
|
let t23;
|
|
416
416
|
if ($[56] !== leftWidth || $[57] !== t18 || $[58] !== t22) {
|
|
417
|
-
t23 = _jsxs(Box, { flexDirection: "column", width: leftWidth, justifyContent: "space-between", alignItems: "center", minHeight:
|
|
417
|
+
t23 = _jsxs(Box, { flexDirection: "column", width: leftWidth, justifyContent: "space-between", alignItems: "center", minHeight: 11, children: [t18, t19, t22] });
|
|
418
418
|
$[56] = leftWidth;
|
|
419
419
|
$[57] = t18;
|
|
420
420
|
$[58] = t22;
|
|
@@ -425,14 +425,14 @@ export function LogoV2() {
|
|
|
425
425
|
}
|
|
426
426
|
let t24;
|
|
427
427
|
if ($[60] !== layoutMode) {
|
|
428
|
-
t24 =
|
|
428
|
+
t24 = null;
|
|
429
429
|
$[60] = layoutMode;
|
|
430
430
|
$[61] = t24;
|
|
431
431
|
}
|
|
432
432
|
else {
|
|
433
433
|
t24 = $[61];
|
|
434
434
|
}
|
|
435
|
-
const t25 =
|
|
435
|
+
const t25 = _jsx(FeedColumn, { feeds: showOnboarding ? [createProjectOnboardingFeed(getSteps()), createRecentActivityFeed(activities)] : showGuestPassesUpsell ? [createRecentActivityFeed(activities), createGuestPassesFeed()] : showOverageCreditUpsell ? [createRecentActivityFeed(activities), createOverageCreditFeed()] : [createRecentActivityFeed(activities), createWhatsNewFeed(changelog)], maxWidth: Math.max(leftWidth, rightWidth) });
|
|
436
436
|
let t26;
|
|
437
437
|
if ($[62] !== T2 || $[63] !== t15 || $[64] !== t23 || $[65] !== t24 || $[66] !== t25) {
|
|
438
438
|
t26 = _jsxs(T2, { flexDirection: t15, paddingX: t16, gap: t17, children: [t23, t24, t25] });
|
|
@@ -4,5 +4,5 @@ import { Box, Text } from '../../ink.js';
|
|
|
4
4
|
import { Clawd } from './Clawd.js';
|
|
5
5
|
const WELCOME_WIDTH = 54;
|
|
6
6
|
export function WelcomeV2() {
|
|
7
|
-
return (_jsx(Box, { flexDirection: "column", width: WELCOME_WIDTH, children: _jsxs(Box, { borderStyle: "round", borderColor: "claude", paddingX:
|
|
7
|
+
return (_jsx(Box, { flexDirection: "column", width: WELCOME_WIDTH, children: _jsxs(Box, { borderStyle: "round", borderColor: "claude", paddingX: 3, paddingY: 1, flexDirection: "column", alignItems: "center", children: [_jsx(Text, { color: "claude", children: "CTX" }), _jsx(Text, { bold: true, children: "Context Code" }), _jsxs(Text, { dimColor: true, children: ["v", MACRO.VERSION] }), _jsx(Box, { marginTop: 1, marginBottom: 1, children: _jsx(Clawd, {}) }), _jsx(Text, { children: "Lee, edita y ejecuta sin perder contexto." }), _jsx(Text, { dimColor: true, children: "Configuracion inicial" })] }) }));
|
|
8
8
|
}
|
|
@@ -1,62 +1,214 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
import { Box, Text } from '../../ink.js';
|
|
4
|
-
import { getAgentModelOptions } from '../../utils/model/agent.js';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}, ...base];
|
|
19
|
-
break bb0;
|
|
20
|
-
}
|
|
21
|
-
t1 = base;
|
|
22
|
-
}
|
|
23
|
-
$[0] = initialModel;
|
|
24
|
-
$[1] = t1;
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
t1 = $[1];
|
|
4
|
+
import { getAgentModelDisplay, getAgentModelOptions, } from '../../utils/model/agent.js';
|
|
5
|
+
import { fetchProviderModels, } from '../../utils/model/providerModels.js';
|
|
6
|
+
import { getVisibleProvider, VISIBLE_PROVIDERS, } from '../../utils/model/providerCatalog.js';
|
|
7
|
+
import { toProviderPreference } from '../../utils/model/providerSwitch.js';
|
|
8
|
+
import { getAPIProvider } from '../../utils/model/providers.js';
|
|
9
|
+
import { Select, } from '../CustomSelect/select.js';
|
|
10
|
+
const INHERIT_OPTION = '__inherit_parent__';
|
|
11
|
+
const MANUAL_MODEL_OPTION = '__manual_model__';
|
|
12
|
+
function isClaudeProvider(provider) {
|
|
13
|
+
return provider === 'claude';
|
|
14
|
+
}
|
|
15
|
+
function inferInitialProvider(initialModel, initialProvider) {
|
|
16
|
+
if (initialProvider) {
|
|
17
|
+
return initialProvider;
|
|
28
18
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
let t2;
|
|
32
|
-
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
33
|
-
t2 = _jsx(Box, { marginBottom: 1, children: _jsx(Text, { dimColor: true, children: "Model determines the agent's reasoning capabilities and speed." }) });
|
|
34
|
-
$[2] = t2;
|
|
19
|
+
if (!initialModel || initialModel === 'inherit') {
|
|
20
|
+
return undefined;
|
|
35
21
|
}
|
|
36
|
-
|
|
37
|
-
|
|
22
|
+
const claudeValues = new Set(getAgentModelOptions().map(option => option.value));
|
|
23
|
+
if (claudeValues.has(initialModel)) {
|
|
24
|
+
return 'claude';
|
|
38
25
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
26
|
+
return toProviderPreference(getAPIProvider());
|
|
27
|
+
}
|
|
28
|
+
function getProviderOptions() {
|
|
29
|
+
return [
|
|
30
|
+
{
|
|
31
|
+
value: INHERIT_OPTION,
|
|
32
|
+
label: 'Heredar del padre',
|
|
33
|
+
description: 'Usa el mismo proveedor y modelo de la conversacion principal.',
|
|
34
|
+
},
|
|
35
|
+
...VISIBLE_PROVIDERS.map(provider => ({
|
|
36
|
+
value: provider.id,
|
|
37
|
+
label: provider.label,
|
|
38
|
+
description: provider.description,
|
|
39
|
+
})),
|
|
40
|
+
];
|
|
41
|
+
}
|
|
42
|
+
function mapClaudeModelOptions() {
|
|
43
|
+
return getAgentModelOptions()
|
|
44
|
+
.filter(option => option.value !== 'inherit')
|
|
45
|
+
.map(option => ({
|
|
46
|
+
value: option.value,
|
|
47
|
+
label: option.label,
|
|
48
|
+
description: option.description,
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
function mapDynamicModelOptions(models) {
|
|
52
|
+
return models.map(model => ({
|
|
53
|
+
value: model.value,
|
|
54
|
+
label: model.label,
|
|
55
|
+
description: model.description,
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
function ensureCurrentModelOption(options, provider, initialModel) {
|
|
59
|
+
if (!initialModel || initialModel === 'inherit') {
|
|
60
|
+
return options;
|
|
45
61
|
}
|
|
46
|
-
|
|
47
|
-
|
|
62
|
+
if (options.some(option => option.value === initialModel)) {
|
|
63
|
+
return options;
|
|
48
64
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
65
|
+
return [
|
|
66
|
+
{
|
|
67
|
+
value: initialModel,
|
|
68
|
+
label: getAgentModelDisplay(initialModel, provider),
|
|
69
|
+
description: 'Modelo actual guardado manualmente.',
|
|
70
|
+
},
|
|
71
|
+
...options,
|
|
72
|
+
];
|
|
73
|
+
}
|
|
74
|
+
function toApiProvider(provider) {
|
|
75
|
+
switch (provider) {
|
|
76
|
+
case 'claude':
|
|
77
|
+
return 'firstParty';
|
|
78
|
+
case 'openai':
|
|
79
|
+
return 'openai';
|
|
80
|
+
case 'openrouter':
|
|
81
|
+
return 'openrouter';
|
|
82
|
+
case 'ollama':
|
|
83
|
+
return 'ollama';
|
|
84
|
+
case 'ollama-cloud':
|
|
85
|
+
return 'ollama-cloud';
|
|
86
|
+
case 'gemini-api':
|
|
87
|
+
return 'gemini-api';
|
|
88
|
+
case 'gemini-google':
|
|
89
|
+
return 'gemini-google';
|
|
90
|
+
case 'zai':
|
|
91
|
+
return 'zai';
|
|
92
|
+
case 'minimax':
|
|
93
|
+
return 'minimax';
|
|
57
94
|
}
|
|
58
|
-
|
|
59
|
-
|
|
95
|
+
}
|
|
96
|
+
export function ModelSelector({ initialModel, initialProvider, onComplete, onCancel, }) {
|
|
97
|
+
const inferredProvider = React.useMemo(() => inferInitialProvider(initialModel, initialProvider), [initialModel, initialProvider]);
|
|
98
|
+
const [step, setStep] = React.useState(inferredProvider ? 'model' : 'provider');
|
|
99
|
+
const [selectedProvider, setSelectedProvider] = React.useState(inferredProvider);
|
|
100
|
+
const [manualModel, setManualModel] = React.useState(initialModel && initialModel !== 'inherit' ? initialModel : '');
|
|
101
|
+
const [providerModels, setProviderModels] = React.useState([]);
|
|
102
|
+
const [isLoadingModels, setIsLoadingModels] = React.useState(false);
|
|
103
|
+
const [loadError, setLoadError] = React.useState(null);
|
|
104
|
+
React.useEffect(() => {
|
|
105
|
+
if (!selectedProvider || isClaudeProvider(selectedProvider)) {
|
|
106
|
+
setProviderModels([]);
|
|
107
|
+
setIsLoadingModels(false);
|
|
108
|
+
setLoadError(null);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
let cancelled = false;
|
|
112
|
+
const loadModels = async () => {
|
|
113
|
+
setIsLoadingModels(true);
|
|
114
|
+
setLoadError(null);
|
|
115
|
+
try {
|
|
116
|
+
const models = await fetchProviderModels(toApiProvider(selectedProvider));
|
|
117
|
+
if (cancelled) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
setProviderModels(models);
|
|
121
|
+
if (models.length === 0) {
|
|
122
|
+
const providerLabel = getVisibleProvider(selectedProvider).label;
|
|
123
|
+
setLoadError(`No se pudieron cargar modelos de ${providerLabel}. Puedes escribir el ID manualmente.`);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
if (cancelled) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
setProviderModels([]);
|
|
131
|
+
setLoadError(error instanceof Error
|
|
132
|
+
? error.message
|
|
133
|
+
: 'No se pudieron cargar los modelos del proveedor.');
|
|
134
|
+
}
|
|
135
|
+
finally {
|
|
136
|
+
if (!cancelled) {
|
|
137
|
+
setIsLoadingModels(false);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
void loadModels();
|
|
142
|
+
return () => {
|
|
143
|
+
cancelled = true;
|
|
144
|
+
};
|
|
145
|
+
}, [selectedProvider]);
|
|
146
|
+
const providerOptions = React.useMemo(() => getProviderOptions(), []);
|
|
147
|
+
const modelOptions = React.useMemo(() => {
|
|
148
|
+
if (!selectedProvider) {
|
|
149
|
+
return [];
|
|
150
|
+
}
|
|
151
|
+
const baseOptions = isClaudeProvider(selectedProvider)
|
|
152
|
+
? mapClaudeModelOptions()
|
|
153
|
+
: mapDynamicModelOptions(providerModels);
|
|
154
|
+
const optionsWithCurrent = ensureCurrentModelOption(baseOptions, selectedProvider, initialModel);
|
|
155
|
+
const withManualOption = [
|
|
156
|
+
...optionsWithCurrent,
|
|
157
|
+
{
|
|
158
|
+
type: 'input',
|
|
159
|
+
value: MANUAL_MODEL_OPTION,
|
|
160
|
+
label: 'Modelo manual',
|
|
161
|
+
description: 'Escribe el ID exacto si no aparece en la lista.',
|
|
162
|
+
placeholder: 'ID del modelo',
|
|
163
|
+
initialValue: manualModel,
|
|
164
|
+
onChange: value => setManualModel(value),
|
|
165
|
+
},
|
|
166
|
+
];
|
|
167
|
+
return withManualOption;
|
|
168
|
+
}, [initialModel, manualModel, providerModels, selectedProvider]);
|
|
169
|
+
const providerDescription = selectedProvider
|
|
170
|
+
? getVisibleProvider(selectedProvider).label
|
|
171
|
+
: undefined;
|
|
172
|
+
const defaultModelValue = React.useMemo(() => {
|
|
173
|
+
if (!selectedProvider) {
|
|
174
|
+
return undefined;
|
|
175
|
+
}
|
|
176
|
+
if (!initialModel || initialModel === 'inherit') {
|
|
177
|
+
return modelOptions[0]?.value;
|
|
178
|
+
}
|
|
179
|
+
return modelOptions.some(option => option.value === initialModel)
|
|
180
|
+
? initialModel
|
|
181
|
+
: MANUAL_MODEL_OPTION;
|
|
182
|
+
}, [initialModel, modelOptions, selectedProvider]);
|
|
183
|
+
if (step === 'provider') {
|
|
184
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { dimColor: true, children: "Elige si este agente debe heredar el proveedor del hilo o quedar fijo a un proveedor concreto." }) }), _jsx(Select, { options: providerOptions, defaultValue: selectedProvider ? selectedProvider : INHERIT_OPTION, layout: "compact-vertical", onChange: value => {
|
|
185
|
+
if (value === INHERIT_OPTION) {
|
|
186
|
+
onComplete({ model: 'inherit' });
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
setSelectedProvider(value);
|
|
190
|
+
setStep('model');
|
|
191
|
+
}, onCancel: onCancel })] }));
|
|
60
192
|
}
|
|
61
|
-
return
|
|
193
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { marginBottom: 1, flexDirection: "column", children: [_jsx(Text, { dimColor: true, children: providerDescription
|
|
194
|
+
? `Proveedor seleccionado: ${providerDescription}`
|
|
195
|
+
: 'Proveedor seleccionado' }), _jsx(Text, { dimColor: true, children: "Para volver a elegir proveedor, presiona `Esc`." })] }), isLoadingModels ? (_jsx(Text, { dimColor: true, children: "Cargando modelos..." })) : (_jsx(Select, { options: modelOptions, defaultValue: defaultModelValue, layout: "compact-vertical", onChange: value => {
|
|
196
|
+
if (value === MANUAL_MODEL_OPTION) {
|
|
197
|
+
const trimmed = manualModel.trim();
|
|
198
|
+
if (!trimmed) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
onComplete({
|
|
202
|
+
provider: selectedProvider,
|
|
203
|
+
model: trimmed,
|
|
204
|
+
});
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
onComplete({
|
|
208
|
+
provider: selectedProvider,
|
|
209
|
+
model: value,
|
|
210
|
+
});
|
|
211
|
+
}, onCancel: () => {
|
|
212
|
+
setStep('provider');
|
|
213
|
+
} })), loadError ? (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "warning", children: loadError }) })) : null] }));
|
|
62
214
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,6 +2,7 @@ import { capitalize } from '../stringUtils.js';
|
|
|
2
2
|
import { MODEL_ALIASES } from './aliases.js';
|
|
3
3
|
import { applyBedrockRegionPrefix, getBedrockRegionPrefix } from './bedrock.js';
|
|
4
4
|
import { getCanonicalName, getRuntimeMainLoopModel, parseUserSpecifiedModel, } from './model.js';
|
|
5
|
+
import { getVisibleProvider } from './providerCatalog.js';
|
|
5
6
|
import { getAPIProvider } from './providers.js';
|
|
6
7
|
export const AGENT_MODEL_OPTIONS = [...MODEL_ALIASES, 'inherit'];
|
|
7
8
|
/**
|
|
@@ -91,14 +92,22 @@ function aliasMatchesParentTier(alias, parentModel) {
|
|
|
91
92
|
return false;
|
|
92
93
|
}
|
|
93
94
|
}
|
|
94
|
-
export function getAgentModelDisplay(model) {
|
|
95
|
+
export function getAgentModelDisplay(model, provider) {
|
|
95
96
|
// When model is omitted, getDefaultSubagentModel() returns 'inherit' at runtime
|
|
96
97
|
if (!model)
|
|
97
|
-
return '
|
|
98
|
+
return 'Heredar del padre (predeterminado)';
|
|
98
99
|
if (model === 'inherit')
|
|
99
|
-
return '
|
|
100
|
+
return 'Heredar del padre';
|
|
101
|
+
if (provider && provider !== 'claude')
|
|
102
|
+
return model;
|
|
100
103
|
return capitalize(model);
|
|
101
104
|
}
|
|
105
|
+
export function getAgentProviderDisplay(provider) {
|
|
106
|
+
if (!provider) {
|
|
107
|
+
return 'Heredar del padre';
|
|
108
|
+
}
|
|
109
|
+
return getVisibleProvider(provider).label;
|
|
110
|
+
}
|
|
102
111
|
/**
|
|
103
112
|
* Get available model options for agents
|
|
104
113
|
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from 'async_hooks';
|
|
2
|
+
const providerOverrideStorage = new AsyncLocalStorage();
|
|
3
|
+
export function getProviderOverride() {
|
|
4
|
+
return providerOverrideStorage.getStore();
|
|
5
|
+
}
|
|
6
|
+
export function runWithProviderOverride(provider, fn) {
|
|
7
|
+
if (!provider) {
|
|
8
|
+
return fn();
|
|
9
|
+
}
|
|
10
|
+
return providerOverrideStorage.run(provider, fn);
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iaforged/context-code",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.81",
|
|
4
4
|
"description": "Context Code es un asistente de desarrollo para la terminal. Puede revisar tu proyecto, editar archivos, ejecutar comandos y apoyarte en tareas reales de programacion.",
|
|
5
5
|
"author": "Context AI",
|
|
6
6
|
"license": "MIT",
|