@iaforged/context-code 1.0.80 → 1.0.82
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/AgentDetail.js +19 -210
- package/dist/src/components/agents/AgentEditor.js +60 -70
- package/dist/src/components/agents/AgentsList.js +3 -2
- package/dist/src/components/agents/AgentsMenu.js +10 -10
- package/dist/src/components/agents/ColorPicker.js +2 -2
- package/dist/src/components/agents/ModelSelector.js +204 -52
- package/dist/src/components/agents/ToolSelector.js +13 -13
- package/dist/src/components/agents/agentFileUtils.js +12 -11
- package/dist/src/components/agents/new-agent-creation/CreateAgentWizard.js +1 -1
- package/dist/src/components/agents/new-agent-creation/types.js +1 -0
- package/dist/src/components/agents/new-agent-creation/wizard-steps/ColorStep.js +22 -68
- package/dist/src/components/agents/new-agent-creation/wizard-steps/ConfirmStep.js +30 -369
- package/dist/src/components/agents/new-agent-creation/wizard-steps/ConfirmStepWrapper.js +13 -15
- package/dist/src/components/agents/new-agent-creation/wizard-steps/DescriptionStep.js +4 -4
- package/dist/src/components/agents/new-agent-creation/wizard-steps/GenerateStep.js +15 -22
- package/dist/src/components/agents/new-agent-creation/wizard-steps/LocationStep.js +2 -2
- package/dist/src/components/agents/new-agent-creation/wizard-steps/MemoryStep.js +9 -9
- package/dist/src/components/agents/new-agent-creation/wizard-steps/MethodStep.js +3 -3
- package/dist/src/components/agents/new-agent-creation/wizard-steps/ModelStep.js +8 -38
- package/dist/src/components/agents/new-agent-creation/wizard-steps/PromptStep.js +4 -4
- package/dist/src/components/agents/new-agent-creation/wizard-steps/ToolsStep.js +1 -1
- package/dist/src/components/agents/new-agent-creation/wizard-steps/TypeStep.js +3 -3
- package/dist/src/components/agents/validateAgent.js +16 -16
- package/dist/src/services/compact/compact.js +22 -20
- package/dist/src/tools/AgentTool/AgentTool.js +12 -8
- package/dist/src/tools/AgentTool/agentDisplay.js +5 -2
- package/dist/src/tools/AgentTool/loadAgentsDir.js +36 -0
- package/dist/src/tools/AgentTool/resumeAgent.js +7 -3
- package/dist/src/utils/model/agent.js +12 -3
- package/dist/src/utils/model/providerOverrideContext.js +11 -0
- package/dist/src/utils/model/providers.js +14 -0
- package/package.json +1 -1
|
@@ -338,7 +338,7 @@ export function AgentsMenu(t0) {
|
|
|
338
338
|
let t14;
|
|
339
339
|
if ($[60] === Symbol.for("react.memo_cache_sentinel")) {
|
|
340
340
|
t14 = {
|
|
341
|
-
label: "
|
|
341
|
+
label: "Ver agente",
|
|
342
342
|
value: "view"
|
|
343
343
|
};
|
|
344
344
|
$[60] = t14;
|
|
@@ -349,10 +349,10 @@ export function AgentsMenu(t0) {
|
|
|
349
349
|
let t15;
|
|
350
350
|
if ($[61] !== isEditable) {
|
|
351
351
|
t15 = isEditable ? [{
|
|
352
|
-
label: "
|
|
352
|
+
label: "Editar agente",
|
|
353
353
|
value: "edit"
|
|
354
354
|
}, {
|
|
355
|
-
label: "
|
|
355
|
+
label: "Eliminar agente",
|
|
356
356
|
value: "delete"
|
|
357
357
|
}] : [];
|
|
358
358
|
$[61] = isEditable;
|
|
@@ -364,7 +364,7 @@ export function AgentsMenu(t0) {
|
|
|
364
364
|
let t16;
|
|
365
365
|
if ($[63] === Symbol.for("react.memo_cache_sentinel")) {
|
|
366
366
|
t16 = {
|
|
367
|
-
label: "
|
|
367
|
+
label: "Volver",
|
|
368
368
|
value: "back"
|
|
369
369
|
};
|
|
370
370
|
$[63] = t16;
|
|
@@ -603,10 +603,10 @@ export function AgentsMenu(t0) {
|
|
|
603
603
|
let t13;
|
|
604
604
|
if ($[112] === Symbol.for("react.memo_cache_sentinel")) {
|
|
605
605
|
t13 = [{
|
|
606
|
-
label: "
|
|
606
|
+
label: "Si, eliminar",
|
|
607
607
|
value: "yes"
|
|
608
608
|
}, {
|
|
609
|
-
label: "No,
|
|
609
|
+
label: "No, cancelar",
|
|
610
610
|
value: "no"
|
|
611
611
|
}];
|
|
612
612
|
$[112] = t13;
|
|
@@ -630,7 +630,7 @@ export function AgentsMenu(t0) {
|
|
|
630
630
|
}
|
|
631
631
|
let t15;
|
|
632
632
|
if ($[115] !== modeState.agent.agentType) {
|
|
633
|
-
t15 = _jsxs(Text, { children: ["
|
|
633
|
+
t15 = _jsxs(Text, { children: ["Seguro que quieres eliminar el agente", " ", _jsx(Text, { bold: true, children: modeState.agent.agentType }), "?"] });
|
|
634
634
|
$[115] = modeState.agent.agentType;
|
|
635
635
|
$[116] = t15;
|
|
636
636
|
}
|
|
@@ -639,7 +639,7 @@ export function AgentsMenu(t0) {
|
|
|
639
639
|
}
|
|
640
640
|
let t16;
|
|
641
641
|
if ($[117] !== modeState.agent.source) {
|
|
642
|
-
t16 = _jsx(Box, { marginTop: 1, children: _jsxs(Text, { dimColor: true, children: ["
|
|
642
|
+
t16 = _jsx(Box, { marginTop: 1, children: _jsxs(Text, { dimColor: true, children: ["Origen: ", modeState.agent.source] }) });
|
|
643
643
|
$[117] = modeState.agent.source;
|
|
644
644
|
$[118] = t16;
|
|
645
645
|
}
|
|
@@ -690,7 +690,7 @@ export function AgentsMenu(t0) {
|
|
|
690
690
|
}
|
|
691
691
|
let t20;
|
|
692
692
|
if ($[127] !== t14 || $[128] !== t15 || $[129] !== t16 || $[130] !== t19) {
|
|
693
|
-
t20 = _jsxs(Dialog, { title: "
|
|
693
|
+
t20 = _jsxs(Dialog, { title: "Eliminar agente", onCancel: t14, color: "error", children: [t15, t16, t19] });
|
|
694
694
|
$[127] = t14;
|
|
695
695
|
$[128] = t15;
|
|
696
696
|
$[129] = t16;
|
|
@@ -742,7 +742,7 @@ export function AgentsMenu(t0) {
|
|
|
742
742
|
}
|
|
743
743
|
const freshAgent = t13;
|
|
744
744
|
const agentToEdit = freshAgent || modeState.agent;
|
|
745
|
-
const t14 = `
|
|
745
|
+
const t14 = `Editar agente: ${agentToEdit.agentType}`;
|
|
746
746
|
let t15;
|
|
747
747
|
if ($[140] !== modeState.previousMode) {
|
|
748
748
|
t15 = () => setModeState(modeState.previousMode);
|
|
@@ -54,7 +54,7 @@ export function ColorPicker(t0) {
|
|
|
54
54
|
if ($[5] !== selectedIndex) {
|
|
55
55
|
t4 = COLOR_OPTIONS.map((option, index) => {
|
|
56
56
|
const isSelected = index === selectedIndex;
|
|
57
|
-
return _jsxs(Box, { flexDirection: "row", gap: 1, children: [_jsx(Text, { color: isSelected ? "suggestion" : undefined, children: isSelected ? figures.pointer : " " }), option === "automatic" ? _jsx(Text, { bold: isSelected, children: "
|
|
57
|
+
return _jsxs(Box, { flexDirection: "row", gap: 1, children: [_jsx(Text, { color: isSelected ? "suggestion" : undefined, children: isSelected ? figures.pointer : " " }), option === "automatic" ? _jsx(Text, { bold: isSelected, children: "Color automatico" }) : _jsxs(Box, { gap: 1, children: [_jsx(Text, { backgroundColor: AGENT_COLOR_TO_THEME_COLOR[option], color: "inverseText", children: " " }), _jsx(Text, { bold: isSelected, children: capitalize(option) })] })] }, option);
|
|
58
58
|
});
|
|
59
59
|
$[5] = selectedIndex;
|
|
60
60
|
$[6] = t4;
|
|
@@ -73,7 +73,7 @@ export function ColorPicker(t0) {
|
|
|
73
73
|
}
|
|
74
74
|
let t6;
|
|
75
75
|
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
76
|
-
t6 = _jsx(Text, { children: "
|
|
76
|
+
t6 = _jsx(Text, { children: "Vista previa: " });
|
|
77
77
|
$[9] = t6;
|
|
78
78
|
}
|
|
79
79
|
else {
|
|
@@ -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
|
}
|
|
@@ -30,25 +30,25 @@ import { Divider } from '../design-system/Divider.js';
|
|
|
30
30
|
function getToolBuckets() {
|
|
31
31
|
return {
|
|
32
32
|
READ_ONLY: {
|
|
33
|
-
name: '
|
|
33
|
+
name: 'Herramientas de solo lectura',
|
|
34
34
|
toolNames: new Set([GlobTool.name, GrepTool.name, ExitPlanModeV2Tool.name, FileReadTool.name, WebFetchTool.name, TodoWriteTool.name, WebSearchTool.name, TaskStopTool.name, TaskOutputTool.name, ListMcpResourcesTool.name, ReadMcpResourceTool.name])
|
|
35
35
|
},
|
|
36
36
|
EDIT: {
|
|
37
|
-
name: '
|
|
37
|
+
name: 'Herramientas de edicion',
|
|
38
38
|
toolNames: new Set([FileEditTool.name, FileWriteTool.name, NotebookEditTool.name])
|
|
39
39
|
},
|
|
40
40
|
EXECUTION: {
|
|
41
|
-
name: '
|
|
41
|
+
name: 'Herramientas de ejecucion',
|
|
42
42
|
toolNames: new Set([BashTool.name, "external" === 'ant' ? TungstenTool.name : undefined].filter(n => n !== undefined))
|
|
43
43
|
},
|
|
44
44
|
MCP: {
|
|
45
|
-
name: 'MCP
|
|
45
|
+
name: 'Herramientas MCP',
|
|
46
46
|
toolNames: new Set(),
|
|
47
47
|
// Dynamic - no static list
|
|
48
48
|
isMcp: true
|
|
49
49
|
},
|
|
50
50
|
OTHER: {
|
|
51
|
-
name: '
|
|
51
|
+
name: 'Otras herramientas',
|
|
52
52
|
toolNames: new Set() // Dynamic - catch-all for uncategorized tools
|
|
53
53
|
}
|
|
54
54
|
};
|
|
@@ -257,7 +257,7 @@ export function ToolSelector(t0) {
|
|
|
257
257
|
navigableItems = [];
|
|
258
258
|
navigableItems.push({
|
|
259
259
|
id: "continue",
|
|
260
|
-
label: "
|
|
260
|
+
label: "Continuar",
|
|
261
261
|
action: handleConfirm,
|
|
262
262
|
isContinue: true
|
|
263
263
|
});
|
|
@@ -276,7 +276,7 @@ export function ToolSelector(t0) {
|
|
|
276
276
|
}
|
|
277
277
|
navigableItems.push({
|
|
278
278
|
id: "bucket-all",
|
|
279
|
-
label: `${isAllSelected ? figures.checkboxOn : figures.checkboxOff}
|
|
279
|
+
label: `${isAllSelected ? figures.checkboxOn : figures.checkboxOff} Todas las herramientas`,
|
|
280
280
|
action: t10
|
|
281
281
|
});
|
|
282
282
|
const toolBuckets_0 = getToolBuckets();
|
|
@@ -333,7 +333,7 @@ export function ToolSelector(t0) {
|
|
|
333
333
|
}
|
|
334
334
|
navigableItems.push({
|
|
335
335
|
id: "toggle-individual",
|
|
336
|
-
label: showIndividualTools ? "
|
|
336
|
+
label: showIndividualTools ? "Ocultar opciones avanzadas" : "Mostrar opciones avanzadas",
|
|
337
337
|
action: t12,
|
|
338
338
|
isToggle: true
|
|
339
339
|
});
|
|
@@ -342,7 +342,7 @@ export function ToolSelector(t0) {
|
|
|
342
342
|
if (mcpServerBuckets.length > 0) {
|
|
343
343
|
navigableItems.push({
|
|
344
344
|
id: "mcp-servers-header",
|
|
345
|
-
label: "MCP
|
|
345
|
+
label: "Servidores MCP:",
|
|
346
346
|
action: _temp6,
|
|
347
347
|
isHeader: true
|
|
348
348
|
});
|
|
@@ -352,7 +352,7 @@ export function ToolSelector(t0) {
|
|
|
352
352
|
const isFullySelected_0 = selected_1 === serverTools.length;
|
|
353
353
|
navigableItems.push({
|
|
354
354
|
id: `mcp-server-${serverName}`,
|
|
355
|
-
label: `${isFullySelected_0 ? figures.checkboxOn : figures.checkboxOff} ${serverName} (${serverTools.length} ${plural(serverTools.length, "
|
|
355
|
+
label: `${isFullySelected_0 ? figures.checkboxOn : figures.checkboxOff} ${serverName} (${serverTools.length} ${plural(serverTools.length, "herramienta")})`,
|
|
356
356
|
action: () => {
|
|
357
357
|
const toolNames_2 = serverTools.map(_temp7);
|
|
358
358
|
handleToggleTools(toolNames_2, !isFullySelected_0);
|
|
@@ -361,7 +361,7 @@ export function ToolSelector(t0) {
|
|
|
361
361
|
});
|
|
362
362
|
navigableItems.push({
|
|
363
363
|
id: "tools-header",
|
|
364
|
-
label: "
|
|
364
|
+
label: "Herramientas individuales:",
|
|
365
365
|
action: _temp8,
|
|
366
366
|
isHeader: true
|
|
367
367
|
});
|
|
@@ -470,7 +470,7 @@ export function ToolSelector(t0) {
|
|
|
470
470
|
const t15 = focusIndex === 0 ? `${figures.pointer} ` : " ";
|
|
471
471
|
let t16;
|
|
472
472
|
if ($[52] !== t13 || $[53] !== t14 || $[54] !== t15) {
|
|
473
|
-
t16 = _jsxs(Text, { color: t13, bold: t14, children: [t15, "[
|
|
473
|
+
t16 = _jsxs(Text, { color: t13, bold: t14, children: [t15, "[ Continuar ]"] });
|
|
474
474
|
$[52] = t13;
|
|
475
475
|
$[53] = t14;
|
|
476
476
|
$[54] = t15;
|
|
@@ -511,7 +511,7 @@ export function ToolSelector(t0) {
|
|
|
511
511
|
else {
|
|
512
512
|
t19 = $[61];
|
|
513
513
|
}
|
|
514
|
-
const t20 = isAllSelected ? "
|
|
514
|
+
const t20 = isAllSelected ? "Todas las herramientas seleccionadas" : `${selectedSet.size} de ${customAgentTools.length} herramientas seleccionadas`;
|
|
515
515
|
let t21;
|
|
516
516
|
if ($[62] !== t20) {
|
|
517
517
|
t21 = _jsx(Box, { marginTop: 1, flexDirection: "column", children: _jsx(Text, { dimColor: true, children: t20 }) });
|
|
@@ -15,7 +15,7 @@ function getProjectAgentFolderName() {
|
|
|
15
15
|
/**
|
|
16
16
|
* Formats agent data as markdown file content
|
|
17
17
|
*/
|
|
18
|
-
export function formatAgentAsMarkdown(agentType, whenToUse, tools, systemPrompt, color, model, memory, effort) {
|
|
18
|
+
export function formatAgentAsMarkdown(agentType, whenToUse, tools, systemPrompt, color, model, provider, memory, effort) {
|
|
19
19
|
// For YAML double-quoted strings, we need to escape:
|
|
20
20
|
// - Backslashes: \ -> \\
|
|
21
21
|
// - Double quotes: " -> \"
|
|
@@ -28,12 +28,13 @@ export function formatAgentAsMarkdown(agentType, whenToUse, tools, systemPrompt,
|
|
|
28
28
|
const isAllTools = tools === undefined || (tools.length === 1 && tools[0] === '*');
|
|
29
29
|
const toolsLine = isAllTools ? '' : `\ntools: ${tools.join(', ')}`;
|
|
30
30
|
const modelLine = model ? `\nmodel: ${model}` : '';
|
|
31
|
+
const providerLine = provider ? `\nprovider: ${provider}` : '';
|
|
31
32
|
const effortLine = effort !== undefined ? `\neffort: ${effort}` : '';
|
|
32
33
|
const colorLine = color ? `\ncolor: ${color}` : '';
|
|
33
34
|
const memoryLine = memory ? `\nmemory: ${memory}` : '';
|
|
34
35
|
return `---
|
|
35
36
|
name: ${agentType}
|
|
36
|
-
description: "${escapedWhenToUse}"${toolsLine}${modelLine}${effortLine}${colorLine}${memoryLine}
|
|
37
|
+
description: "${escapedWhenToUse}"${toolsLine}${modelLine}${providerLine}${effortLine}${colorLine}${memoryLine}
|
|
37
38
|
---
|
|
38
39
|
|
|
39
40
|
${systemPrompt}
|
|
@@ -80,7 +81,7 @@ export function getNewAgentFilePath(agent) {
|
|
|
80
81
|
*/
|
|
81
82
|
export function getActualAgentFilePath(agent) {
|
|
82
83
|
if (agent.source === 'built-in') {
|
|
83
|
-
return '
|
|
84
|
+
return 'Integrado';
|
|
84
85
|
}
|
|
85
86
|
if (agent.source === 'plugin') {
|
|
86
87
|
throw new Error('Cannot get file path for plugin agents');
|
|
@@ -95,7 +96,7 @@ export function getActualAgentFilePath(agent) {
|
|
|
95
96
|
*/
|
|
96
97
|
export function getNewRelativeAgentFilePath(agent) {
|
|
97
98
|
if (agent.source === 'built-in') {
|
|
98
|
-
return '
|
|
99
|
+
return 'Integrado';
|
|
99
100
|
}
|
|
100
101
|
const dirPath = getRelativeAgentDirectoryPath(agent.source);
|
|
101
102
|
return join(dirPath, `${agent.agentType}.md`);
|
|
@@ -105,13 +106,13 @@ export function getNewRelativeAgentFilePath(agent) {
|
|
|
105
106
|
*/
|
|
106
107
|
export function getActualRelativeAgentFilePath(agent) {
|
|
107
108
|
if (isBuiltInAgent(agent)) {
|
|
108
|
-
return '
|
|
109
|
+
return 'Integrado';
|
|
109
110
|
}
|
|
110
111
|
if (isPluginAgent(agent)) {
|
|
111
|
-
return `Plugin: ${agent.plugin || '
|
|
112
|
+
return `Plugin: ${agent.plugin || 'Desconocido'}`;
|
|
112
113
|
}
|
|
113
114
|
if (agent.source === 'flagSettings') {
|
|
114
|
-
return 'CLI
|
|
115
|
+
return 'Argumento de CLI';
|
|
115
116
|
}
|
|
116
117
|
const dirPath = getRelativeAgentDirectoryPath(agent.source);
|
|
117
118
|
const filename = agent.filename || agent.agentType;
|
|
@@ -129,13 +130,13 @@ async function ensureAgentDirectoryExists(source) {
|
|
|
129
130
|
* Saves an agent to the filesystem
|
|
130
131
|
* @param checkExists - If true, throws error if file already exists
|
|
131
132
|
*/
|
|
132
|
-
export async function saveAgentToFile(source, agentType, whenToUse, tools, systemPrompt, checkExists = true, color, model, memory, effort) {
|
|
133
|
+
export async function saveAgentToFile(source, agentType, whenToUse, tools, systemPrompt, checkExists = true, color, model, provider, memory, effort) {
|
|
133
134
|
if (source === 'built-in') {
|
|
134
135
|
throw new Error('Cannot save built-in agents');
|
|
135
136
|
}
|
|
136
137
|
await ensureAgentDirectoryExists(source);
|
|
137
138
|
const filePath = getNewAgentFilePath({ source, agentType });
|
|
138
|
-
const content = formatAgentAsMarkdown(agentType, whenToUse, tools, systemPrompt, color, model, memory, effort);
|
|
139
|
+
const content = formatAgentAsMarkdown(agentType, whenToUse, tools, systemPrompt, color, model, provider, memory, effort);
|
|
139
140
|
try {
|
|
140
141
|
await writeFileAndFlush(filePath, content, checkExists ? 'wx' : 'w');
|
|
141
142
|
}
|
|
@@ -149,12 +150,12 @@ export async function saveAgentToFile(source, agentType, whenToUse, tools, syste
|
|
|
149
150
|
/**
|
|
150
151
|
* Updates an existing agent file
|
|
151
152
|
*/
|
|
152
|
-
export async function updateAgentFile(agent, newWhenToUse, newTools, newSystemPrompt, newColor, newModel, newMemory, newEffort) {
|
|
153
|
+
export async function updateAgentFile(agent, newWhenToUse, newTools, newSystemPrompt, newColor, newModel, newProvider, newMemory, newEffort) {
|
|
153
154
|
if (agent.source === 'built-in') {
|
|
154
155
|
throw new Error('Cannot update built-in agents');
|
|
155
156
|
}
|
|
156
157
|
const filePath = getActualAgentFilePath(agent);
|
|
157
|
-
const content = formatAgentAsMarkdown(agent.agentType, newWhenToUse, newTools, newSystemPrompt, newColor, newModel, newMemory, newEffort);
|
|
158
|
+
const content = formatAgentAsMarkdown(agent.agentType, newWhenToUse, newTools, newSystemPrompt, newColor, newModel, newProvider, newMemory, newEffort);
|
|
158
159
|
await writeFileAndFlush(filePath, content);
|
|
159
160
|
}
|
|
160
161
|
/**
|
|
@@ -75,7 +75,7 @@ export function CreateAgentWizard(t0) {
|
|
|
75
75
|
}
|
|
76
76
|
let t7;
|
|
77
77
|
if ($[14] !== onCancel || $[15] !== steps) {
|
|
78
|
-
t7 = _jsx(WizardProvider, { steps: steps, initialData: t6, onComplete: _temp, onCancel: onCancel, title: "
|
|
78
|
+
t7 = _jsx(WizardProvider, { steps: steps, initialData: t6, onComplete: _temp, onCancel: onCancel, title: "Crear nuevo agente", showStepCounter: false });
|
|
79
79
|
$[14] = onCancel;
|
|
80
80
|
$[15] = steps;
|
|
81
81
|
$[16] = t7;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|