@iaforged/context-code 1.0.81 → 1.0.83

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.
Files changed (32) hide show
  1. package/dist/src/commands.js +0 -2
  2. package/dist/src/components/PromptInput/PromptInput.js +7 -2
  3. package/dist/src/components/PromptInput/useMaybeTruncateInput.js +1 -14
  4. package/dist/src/components/agents/AgentDetail.js +19 -210
  5. package/dist/src/components/agents/AgentEditor.js +60 -70
  6. package/dist/src/components/agents/AgentsList.js +3 -2
  7. package/dist/src/components/agents/AgentsMenu.js +10 -10
  8. package/dist/src/components/agents/ColorPicker.js +2 -2
  9. package/dist/src/components/agents/ToolSelector.js +13 -13
  10. package/dist/src/components/agents/agentFileUtils.js +12 -11
  11. package/dist/src/components/agents/new-agent-creation/CreateAgentWizard.js +1 -1
  12. package/dist/src/components/agents/new-agent-creation/wizard-steps/ColorStep.js +22 -68
  13. package/dist/src/components/agents/new-agent-creation/wizard-steps/ConfirmStep.js +30 -369
  14. package/dist/src/components/agents/new-agent-creation/wizard-steps/ConfirmStepWrapper.js +13 -15
  15. package/dist/src/components/agents/new-agent-creation/wizard-steps/DescriptionStep.js +4 -4
  16. package/dist/src/components/agents/new-agent-creation/wizard-steps/GenerateStep.js +15 -22
  17. package/dist/src/components/agents/new-agent-creation/wizard-steps/LocationStep.js +2 -2
  18. package/dist/src/components/agents/new-agent-creation/wizard-steps/MemoryStep.js +9 -9
  19. package/dist/src/components/agents/new-agent-creation/wizard-steps/MethodStep.js +3 -3
  20. package/dist/src/components/agents/new-agent-creation/wizard-steps/ModelStep.js +8 -38
  21. package/dist/src/components/agents/new-agent-creation/wizard-steps/PromptStep.js +4 -4
  22. package/dist/src/components/agents/new-agent-creation/wizard-steps/ToolsStep.js +1 -1
  23. package/dist/src/components/agents/new-agent-creation/wizard-steps/TypeStep.js +3 -3
  24. package/dist/src/components/agents/validateAgent.js +16 -16
  25. package/dist/src/hooks/usePasteHandler.js +68 -7
  26. package/dist/src/services/compact/compact.js +22 -20
  27. package/dist/src/tools/AgentTool/AgentTool.js +12 -8
  28. package/dist/src/tools/AgentTool/agentDisplay.js +5 -2
  29. package/dist/src/tools/AgentTool/loadAgentsDir.js +36 -0
  30. package/dist/src/tools/AgentTool/resumeAgent.js +7 -3
  31. package/dist/src/utils/model/providers.js +14 -0
  32. package/package.json +1 -1
@@ -1,11 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { c as _c } from "react/compiler-runtime";
3
2
  import { Box, Text } from '../../../../ink.js';
4
3
  import { useKeybinding } from '../../../../keybindings/useKeybinding.js';
5
4
  import { isAutoMemoryEnabled } from '../../../../memdir/paths.js';
6
5
  import { getMemoryScopeDisplay } from '../../../../tools/AgentTool/agentMemory.js';
7
6
  import { truncateToWidth } from '../../../../utils/format.js';
8
- import { getAgentModelDisplay } from '../../../../utils/model/agent.js';
7
+ import { getAgentModelDisplay, getAgentProviderDisplay, } from '../../../../utils/model/agent.js';
9
8
  import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js';
10
9
  import { Byline } from '../../../design-system/Byline.js';
11
10
  import { KeyboardShortcutHint } from '../../../design-system/KeyboardShortcutHint.js';
@@ -13,374 +12,36 @@ import { useWizard } from '../../../wizard/index.js';
13
12
  import { WizardDialogLayout } from '../../../wizard/WizardDialogLayout.js';
14
13
  import { getNewRelativeAgentFilePath } from '../../agentFileUtils.js';
15
14
  import { validateAgent } from '../../validateAgent.js';
16
- export function ConfirmStep(t0) {
17
- const $ = _c(88);
18
- const { tools, existingAgents, onSave, onSaveAndEdit, error } = t0;
15
+ function getToolsDisplay(toolNames) {
16
+ if (toolNames === undefined)
17
+ return 'Todas las herramientas';
18
+ if (toolNames.length === 0)
19
+ return 'Ninguna';
20
+ if (toolNames.length === 1)
21
+ return toolNames[0] || 'Ninguna';
22
+ if (toolNames.length === 2)
23
+ return toolNames.join(' y ');
24
+ return `${toolNames.slice(0, -1).join(', ')} y ${toolNames[toolNames.length - 1]}`;
25
+ }
26
+ export function ConfirmStep({ tools, existingAgents, onSave, onSaveAndEdit, error, }) {
19
27
  const { goBack, wizardData } = useWizard();
20
- let t1;
21
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
22
- t1 = {
23
- context: "Confirmation"
24
- };
25
- $[0] = t1;
26
- }
27
- else {
28
- t1 = $[0];
29
- }
30
- useKeybinding("confirm:no", goBack, t1);
31
- let t2;
32
- if ($[1] !== onSave || $[2] !== onSaveAndEdit) {
33
- t2 = e => {
34
- if (e.key === "s" || e.key === "return") {
35
- e.preventDefault();
36
- onSave();
37
- }
38
- else {
39
- if (e.key === "e") {
40
- e.preventDefault();
41
- onSaveAndEdit();
42
- }
43
- }
44
- };
45
- $[1] = onSave;
46
- $[2] = onSaveAndEdit;
47
- $[3] = t2;
48
- }
49
- else {
50
- t2 = $[3];
51
- }
52
- const handleKeyDown = t2;
53
- const agent = wizardData.finalAgent;
54
- let T0;
55
- let T1;
56
- let t10;
57
- let t11;
58
- let t12;
59
- let t13;
60
- let t14;
61
- let t15;
62
- let t16;
63
- let t17;
64
- let t18;
65
- let t19;
66
- let t3;
67
- let t4;
68
- let t5;
69
- let t6;
70
- let t7;
71
- let t8;
72
- let t9;
73
- if ($[4] !== agent || $[5] !== existingAgents || $[6] !== handleKeyDown || $[7] !== tools || $[8] !== wizardData.location) {
74
- const validation = validateAgent(agent, tools, existingAgents);
75
- let t20;
76
- if ($[28] !== agent) {
77
- t20 = truncateToWidth(agent.getSystemPrompt(), 240);
78
- $[28] = agent;
79
- $[29] = t20;
80
- }
81
- else {
82
- t20 = $[29];
83
- }
84
- const systemPromptPreview = t20;
85
- let t21;
86
- if ($[30] !== agent.whenToUse) {
87
- t21 = truncateToWidth(agent.whenToUse, 240);
88
- $[30] = agent.whenToUse;
89
- $[31] = t21;
90
- }
91
- else {
92
- t21 = $[31];
93
- }
94
- const whenToUsePreview = t21;
95
- const getToolsDisplay = _temp;
96
- let t22;
97
- if ($[32] !== agent.memory) {
98
- t22 = isAutoMemoryEnabled() ? _jsxs(Text, { children: [_jsx(Text, { bold: true, children: "Memory" }), ": ", getMemoryScopeDisplay(agent.memory)] }) : null;
99
- $[32] = agent.memory;
100
- $[33] = t22;
101
- }
102
- else {
103
- t22 = $[33];
104
- }
105
- const memoryDisplayElement = t22;
106
- T1 = WizardDialogLayout;
107
- t18 = "Confirm and save";
108
- if ($[34] === Symbol.for("react.memo_cache_sentinel")) {
109
- t19 = _jsxs(Byline, { children: [_jsx(KeyboardShortcutHint, { shortcut: "s/Enter", action: "guardar" }), _jsx(KeyboardShortcutHint, { shortcut: "e", action: "editar en tu editor" }), _jsx(ConfigurableShortcutHint, { action: "confirm:no", context: "Confirmation", fallback: "Esc", description: "cancelar" })] });
110
- $[34] = t19;
111
- }
112
- else {
113
- t19 = $[34];
114
- }
115
- T0 = Box;
116
- t3 = "column";
117
- t4 = 0;
118
- t5 = true;
119
- t6 = handleKeyDown;
120
- let t23;
121
- if ($[35] === Symbol.for("react.memo_cache_sentinel")) {
122
- t23 = _jsx(Text, { bold: true, children: "Name" });
123
- $[35] = t23;
124
- }
125
- else {
126
- t23 = $[35];
127
- }
128
- if ($[36] !== agent.agentType) {
129
- t7 = _jsxs(Text, { children: [t23, ": ", agent.agentType] });
130
- $[36] = agent.agentType;
131
- $[37] = t7;
132
- }
133
- else {
134
- t7 = $[37];
135
- }
136
- let t24;
137
- if ($[38] === Symbol.for("react.memo_cache_sentinel")) {
138
- t24 = _jsx(Text, { bold: true, children: "Location" });
139
- $[38] = t24;
140
- }
141
- else {
142
- t24 = $[38];
143
- }
144
- let t25;
145
- if ($[39] !== agent.agentType || $[40] !== wizardData.location) {
146
- t25 = getNewRelativeAgentFilePath({
147
- source: wizardData.location,
148
- agentType: agent.agentType
149
- });
150
- $[39] = agent.agentType;
151
- $[40] = wizardData.location;
152
- $[41] = t25;
153
- }
154
- else {
155
- t25 = $[41];
156
- }
157
- if ($[42] !== t25) {
158
- t8 = _jsxs(Text, { children: [t24, ":", " ", t25] });
159
- $[42] = t25;
160
- $[43] = t8;
161
- }
162
- else {
163
- t8 = $[43];
164
- }
165
- let t26;
166
- if ($[44] === Symbol.for("react.memo_cache_sentinel")) {
167
- t26 = _jsx(Text, { bold: true, children: "Tools" });
168
- $[44] = t26;
169
- }
170
- else {
171
- t26 = $[44];
28
+ useKeybinding('confirm:no', goBack, { context: 'Confirmation' });
29
+ const handleKeyDown = (e) => {
30
+ if (e.key === 's' || e.key === 'return') {
31
+ e.preventDefault();
32
+ onSave();
172
33
  }
173
- let t27;
174
- if ($[45] !== agent.tools) {
175
- t27 = getToolsDisplay(agent.tools);
176
- $[45] = agent.tools;
177
- $[46] = t27;
34
+ else if (e.key === 'e') {
35
+ e.preventDefault();
36
+ onSaveAndEdit();
178
37
  }
179
- else {
180
- t27 = $[46];
181
- }
182
- if ($[47] !== t27) {
183
- t9 = _jsxs(Text, { children: [t26, ": ", t27] });
184
- $[47] = t27;
185
- $[48] = t9;
186
- }
187
- else {
188
- t9 = $[48];
189
- }
190
- let t28;
191
- if ($[49] === Symbol.for("react.memo_cache_sentinel")) {
192
- t28 = _jsx(Text, { bold: true, children: "Model" });
193
- $[49] = t28;
194
- }
195
- else {
196
- t28 = $[49];
197
- }
198
- let t29;
199
- if ($[50] !== agent.model) {
200
- t29 = getAgentModelDisplay(agent.model);
201
- $[50] = agent.model;
202
- $[51] = t29;
203
- }
204
- else {
205
- t29 = $[51];
206
- }
207
- if ($[52] !== t29) {
208
- t10 = _jsxs(Text, { children: [t28, ": ", t29] });
209
- $[52] = t29;
210
- $[53] = t10;
211
- }
212
- else {
213
- t10 = $[53];
214
- }
215
- t11 = memoryDisplayElement;
216
- if ($[54] === Symbol.for("react.memo_cache_sentinel")) {
217
- t12 = _jsx(Box, { marginTop: 1, children: _jsxs(Text, { children: [_jsx(Text, { bold: true, children: "Description" }), " (tells Claude when to use this agent):"] }) });
218
- $[54] = t12;
219
- }
220
- else {
221
- t12 = $[54];
222
- }
223
- if ($[55] !== whenToUsePreview) {
224
- t13 = _jsx(Box, { marginLeft: 2, marginTop: 1, children: _jsx(Text, { children: whenToUsePreview }) });
225
- $[55] = whenToUsePreview;
226
- $[56] = t13;
227
- }
228
- else {
229
- t13 = $[56];
230
- }
231
- if ($[57] === Symbol.for("react.memo_cache_sentinel")) {
232
- t14 = _jsx(Box, { marginTop: 1, children: _jsxs(Text, { children: [_jsx(Text, { bold: true, children: "System prompt" }), ":"] }) });
233
- $[57] = t14;
234
- }
235
- else {
236
- t14 = $[57];
237
- }
238
- if ($[58] !== systemPromptPreview) {
239
- t15 = _jsx(Box, { marginLeft: 2, marginTop: 1, children: _jsx(Text, { children: systemPromptPreview }) });
240
- $[58] = systemPromptPreview;
241
- $[59] = t15;
242
- }
243
- else {
244
- t15 = $[59];
245
- }
246
- t16 = validation.warnings.length > 0 && _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Text, { color: "warning", children: "Warnings:" }), validation.warnings.map(_temp2)] });
247
- t17 = validation.errors.length > 0 && _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Text, { color: "error", children: "Errors:" }), validation.errors.map(_temp3)] });
248
- $[4] = agent;
249
- $[5] = existingAgents;
250
- $[6] = handleKeyDown;
251
- $[7] = tools;
252
- $[8] = wizardData.location;
253
- $[9] = T0;
254
- $[10] = T1;
255
- $[11] = t10;
256
- $[12] = t11;
257
- $[13] = t12;
258
- $[14] = t13;
259
- $[15] = t14;
260
- $[16] = t15;
261
- $[17] = t16;
262
- $[18] = t17;
263
- $[19] = t18;
264
- $[20] = t19;
265
- $[21] = t3;
266
- $[22] = t4;
267
- $[23] = t5;
268
- $[24] = t6;
269
- $[25] = t7;
270
- $[26] = t8;
271
- $[27] = t9;
272
- }
273
- else {
274
- T0 = $[9];
275
- T1 = $[10];
276
- t10 = $[11];
277
- t11 = $[12];
278
- t12 = $[13];
279
- t13 = $[14];
280
- t14 = $[15];
281
- t15 = $[16];
282
- t16 = $[17];
283
- t17 = $[18];
284
- t18 = $[19];
285
- t19 = $[20];
286
- t3 = $[21];
287
- t4 = $[22];
288
- t5 = $[23];
289
- t6 = $[24];
290
- t7 = $[25];
291
- t8 = $[26];
292
- t9 = $[27];
293
- }
294
- let t20;
295
- if ($[60] !== error) {
296
- t20 = error && _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "error", children: error }) });
297
- $[60] = error;
298
- $[61] = t20;
299
- }
300
- else {
301
- t20 = $[61];
302
- }
303
- let t21;
304
- if ($[62] === Symbol.for("react.memo_cache_sentinel")) {
305
- t21 = _jsx(Text, { bold: true, children: "s" });
306
- $[62] = t21;
307
- }
308
- else {
309
- t21 = $[62];
310
- }
311
- let t22;
312
- if ($[63] === Symbol.for("react.memo_cache_sentinel")) {
313
- t22 = _jsx(Text, { bold: true, children: "Enter" });
314
- $[63] = t22;
315
- }
316
- else {
317
- t22 = $[63];
318
- }
319
- let t23;
320
- if ($[64] === Symbol.for("react.memo_cache_sentinel")) {
321
- t23 = _jsx(Box, { marginTop: 2, children: _jsxs(Text, { color: "success", children: ["Presiona ", _jsx(Text, { bold: true, children: "s" }), " o ", _jsx(Text, { bold: true, children: "Enter" }), " para guardar,", " ", _jsx(Text, { bold: true, children: "e" }), " para guardar y editar"] }) });
322
- $[64] = t23;
323
- }
324
- else {
325
- t23 = $[64];
326
- }
327
- let t24;
328
- if ($[65] !== T0 || $[66] !== t10 || $[67] !== t11 || $[68] !== t12 || $[69] !== t13 || $[70] !== t14 || $[71] !== t15 || $[72] !== t16 || $[73] !== t17 || $[74] !== t20 || $[75] !== t3 || $[76] !== t4 || $[77] !== t5 || $[78] !== t6 || $[79] !== t7 || $[80] !== t8 || $[81] !== t9) {
329
- t24 = _jsxs(T0, { flexDirection: t3, tabIndex: t4, autoFocus: t5, onKeyDown: t6, children: [t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t20, t23] });
330
- $[65] = T0;
331
- $[66] = t10;
332
- $[67] = t11;
333
- $[68] = t12;
334
- $[69] = t13;
335
- $[70] = t14;
336
- $[71] = t15;
337
- $[72] = t16;
338
- $[73] = t17;
339
- $[74] = t20;
340
- $[75] = t3;
341
- $[76] = t4;
342
- $[77] = t5;
343
- $[78] = t6;
344
- $[79] = t7;
345
- $[80] = t8;
346
- $[81] = t9;
347
- $[82] = t24;
348
- }
349
- else {
350
- t24 = $[82];
351
- }
352
- let t25;
353
- if ($[83] !== T1 || $[84] !== t18 || $[85] !== t19 || $[86] !== t24) {
354
- t25 = _jsx(T1, { subtitle: t18, footerText: t19, children: t24 });
355
- $[83] = T1;
356
- $[84] = t18;
357
- $[85] = t19;
358
- $[86] = t24;
359
- $[87] = t25;
360
- }
361
- else {
362
- t25 = $[87];
363
- }
364
- return t25;
365
- }
366
- function _temp3(err, i_0) {
367
- return _jsxs(Text, { color: "error", children: [" ", "\u2022 ", err] }, i_0);
368
- }
369
- function _temp2(warning, i) {
370
- return _jsxs(Text, { dimColor: true, children: [" ", "\u2022 ", warning] }, i);
371
- }
372
- function _temp(toolNames) {
373
- if (toolNames === undefined) {
374
- return "All tools";
375
- }
376
- if (toolNames.length === 0) {
377
- return "None";
378
- }
379
- if (toolNames.length === 1) {
380
- return toolNames[0] || "None";
381
- }
382
- if (toolNames.length === 2) {
383
- return toolNames.join(" and ");
384
- }
385
- return `${toolNames.slice(0, -1).join(", ")}, and ${toolNames[toolNames.length - 1]}`;
38
+ };
39
+ const agent = wizardData.finalAgent;
40
+ const validation = validateAgent(agent, tools, existingAgents);
41
+ const systemPromptPreview = truncateToWidth(agent.getSystemPrompt(), 240);
42
+ const whenToUsePreview = truncateToWidth(agent.whenToUse, 240);
43
+ return (_jsx(WizardDialogLayout, { subtitle: "Confirmar y guardar", footerText: _jsxs(Byline, { children: [_jsx(KeyboardShortcutHint, { shortcut: "s/Enter", action: "guardar" }), _jsx(KeyboardShortcutHint, { shortcut: "e", action: "editar en tu editor" }), _jsx(ConfigurableShortcutHint, { action: "confirm:no", context: "Confirmation", fallback: "Esc", description: "cancelar" })] }), children: _jsxs(Box, { flexDirection: "column", tabIndex: 0, autoFocus: true, onKeyDown: handleKeyDown, children: [_jsxs(Text, { children: [_jsx(Text, { bold: true, children: "Nombre" }), ": ", agent.agentType] }), _jsxs(Text, { children: [_jsx(Text, { bold: true, children: "Ubicacion" }), ":", ' ', getNewRelativeAgentFilePath({
44
+ source: wizardData.location,
45
+ agentType: agent.agentType,
46
+ })] }), _jsxs(Text, { children: [_jsx(Text, { bold: true, children: "Herramientas" }), ": ", getToolsDisplay(agent.tools)] }), _jsxs(Text, { children: [_jsx(Text, { bold: true, children: "Proveedor" }), ": ", getAgentProviderDisplay(agent.provider)] }), _jsxs(Text, { children: [_jsx(Text, { bold: true, children: "Modelo" }), ":", ' ', getAgentModelDisplay(agent.model, agent.provider)] }), isAutoMemoryEnabled() ? (_jsxs(Text, { children: [_jsx(Text, { bold: true, children: "Memoria" }), ": ", getMemoryScopeDisplay(agent.memory)] })) : null, _jsx(Box, { marginTop: 1, children: _jsxs(Text, { children: [_jsx(Text, { bold: true, children: "Descripcion" }), " (indica cuando usar este agente):"] }) }), _jsx(Box, { marginLeft: 2, marginTop: 1, children: _jsx(Text, { children: whenToUsePreview }) }), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { children: [_jsx(Text, { bold: true, children: "System prompt" }), ":"] }) }), _jsx(Box, { marginLeft: 2, marginTop: 1, children: _jsx(Text, { children: systemPromptPreview }) }), validation.warnings.length > 0 ? (_jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Text, { color: "warning", children: "Advertencias:" }), validation.warnings.map((warning, index) => (_jsxs(Text, { dimColor: true, children: [' ', "- ", warning] }, index)))] })) : null, validation.errors.length > 0 ? (_jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Text, { color: "error", children: "Errores:" }), validation.errors.map((err, index) => (_jsxs(Text, { color: "error", children: [' ', "- ", err] }, index)))] })) : null, error ? (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "error", children: error }) })) : null, _jsx(Box, { marginTop: 2, children: _jsxs(Text, { color: "success", children: ["Presiona ", _jsx(Text, { bold: true, children: "s" }), " o ", _jsx(Text, { bold: true, children: "Enter" }), " para guardar,", ' ', _jsx(Text, { bold: true, children: "e" }), " para guardar y editar"] }) })] }) }));
386
47
  }
@@ -1,14 +1,14 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import chalk from 'chalk';
3
3
  import { useCallback, useState } from 'react';
4
- import { logEvent } from '../../../../services/analytics/index.js';
4
+ import { logEvent, } from '../../../../services/analytics/index.js';
5
5
  import { useSetAppState } from '../../../../state/AppState.js';
6
- import { getActiveAgentsFromList } from '../../../../tools/AgentTool/loadAgentsDir.js';
6
+ import { getActiveAgentsFromList, } from '../../../../tools/AgentTool/loadAgentsDir.js';
7
7
  import { editFileInEditor } from '../../../../utils/promptEditor.js';
8
8
  import { useWizard } from '../../../wizard/index.js';
9
9
  import { getNewAgentFilePath, saveAgentToFile } from '../../agentFileUtils.js';
10
10
  import { ConfirmStep } from './ConfirmStep.js';
11
- export function ConfirmStepWrapper({ tools, existingAgents, onComplete }) {
11
+ export function ConfirmStepWrapper({ tools, existingAgents, onComplete, }) {
12
12
  const { wizardData } = useWizard();
13
13
  const [saveError, setSaveError] = useState(null);
14
14
  const setAppState = useSetAppState();
@@ -16,7 +16,7 @@ export function ConfirmStepWrapper({ tools, existingAgents, onComplete }) {
16
16
  if (!wizardData?.finalAgent)
17
17
  return;
18
18
  try {
19
- await saveAgentToFile(wizardData.location, wizardData.finalAgent.agentType, wizardData.finalAgent.whenToUse, wizardData.finalAgent.tools, wizardData.finalAgent.getSystemPrompt(), true, wizardData.finalAgent.color, wizardData.finalAgent.model, wizardData.finalAgent.memory);
19
+ await saveAgentToFile(wizardData.location, wizardData.finalAgent.agentType, wizardData.finalAgent.whenToUse, wizardData.finalAgent.tools, wizardData.finalAgent.getSystemPrompt(), true, wizardData.finalAgent.color, wizardData.finalAgent.model, wizardData.finalAgent.provider, wizardData.finalAgent.memory);
20
20
  setAppState(state => {
21
21
  if (!wizardData.finalAgent)
22
22
  return state;
@@ -26,14 +26,14 @@ export function ConfirmStepWrapper({ tools, existingAgents, onComplete }) {
26
26
  agentDefinitions: {
27
27
  ...state.agentDefinitions,
28
28
  activeAgents: getActiveAgentsFromList(allAgents),
29
- allAgents
30
- }
29
+ allAgents,
30
+ },
31
31
  };
32
32
  });
33
33
  if (openInEditor) {
34
34
  const filePath = getNewAgentFilePath({
35
35
  source: wizardData.location,
36
- agentType: wizardData.finalAgent.agentType
36
+ agentType: wizardData.finalAgent.agentType,
37
37
  });
38
38
  await editFileInEditor(filePath);
39
39
  }
@@ -46,18 +46,16 @@ export function ConfirmStepWrapper({ tools, existingAgents, onComplete }) {
46
46
  has_custom_color: !!wizardData.finalAgent.color,
47
47
  has_memory: !!wizardData.finalAgent.memory,
48
48
  memory_scope: wizardData.finalAgent.memory ?? 'none',
49
- ...(openInEditor ? {
50
- opened_in_editor: true
51
- } : {})
49
+ ...(openInEditor ? { opened_in_editor: true } : {}),
52
50
  });
53
- const message = openInEditor ? `Created agent: ${chalk.bold(wizardData.finalAgent.agentType)} and opened in editor. ` + `If you made edits, restart to load the latest version.` : `Created agent: ${chalk.bold(wizardData.finalAgent.agentType)}`;
51
+ const message = openInEditor
52
+ ? `Agente creado: ${chalk.bold(wizardData.finalAgent.agentType)} y abierto en el editor. Si hiciste cambios, reinicia para cargar la version mas reciente.`
53
+ : `Agente creado: ${chalk.bold(wizardData.finalAgent.agentType)}`;
54
54
  onComplete(message);
55
55
  }
56
56
  catch (err) {
57
- setSaveError(err instanceof Error ? err.message : 'Failed to save agent');
57
+ setSaveError(err instanceof Error ? err.message : 'No se pudo guardar el agente');
58
58
  }
59
59
  }, [wizardData, onComplete, setAppState]);
60
- const handleSave = useCallback(() => saveAgent(false), [saveAgent]);
61
- const handleSaveAndEdit = useCallback(() => saveAgent(true), [saveAgent]);
62
- return _jsx(ConfirmStep, { tools: tools, existingAgents: existingAgents, onSave: handleSave, onSaveAndEdit: handleSaveAndEdit, error: saveError });
60
+ return (_jsx(ConfirmStep, { tools: tools, existingAgents: existingAgents, onSave: () => void saveAgent(false), onSaveAndEdit: () => void saveAgent(true), error: saveError }));
63
61
  }
@@ -59,7 +59,7 @@ export function DescriptionStep() {
59
59
  t3 = value => {
60
60
  const trimmedValue = value.trim();
61
61
  if (!trimmedValue) {
62
- setError("Description is required");
62
+ setError("La descripcion es obligatoria");
63
63
  return;
64
64
  }
65
65
  setError(null);
@@ -86,7 +86,7 @@ export function DescriptionStep() {
86
86
  }
87
87
  let t5;
88
88
  if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
89
- t5 = _jsx(Text, { children: "When should Claude use this agent?" });
89
+ t5 = _jsx(Text, { children: "Cuando debe usar Claude este agente?" });
90
90
  $[8] = t5;
91
91
  }
92
92
  else {
@@ -94,7 +94,7 @@ export function DescriptionStep() {
94
94
  }
95
95
  let t6;
96
96
  if ($[9] !== cursorOffset || $[10] !== handleSubmit || $[11] !== whenToUse) {
97
- t6 = _jsx(Box, { marginTop: 1, children: _jsx(TextInput, { value: whenToUse, onChange: setWhenToUse, onSubmit: handleSubmit, placeholder: "e.g., use this agent after you're done writing code...", columns: 80, cursorOffset: cursorOffset, onChangeCursorOffset: setCursorOffset, focus: true, showCursor: true }) });
97
+ t6 = _jsx(Box, { marginTop: 1, children: _jsx(TextInput, { value: whenToUse, onChange: setWhenToUse, onSubmit: handleSubmit, placeholder: "p. ej., usa este agente cuando termines de escribir codigo...", columns: 80, cursorOffset: cursorOffset, onChangeCursorOffset: setCursorOffset, focus: true, showCursor: true }) });
98
98
  $[9] = cursorOffset;
99
99
  $[10] = handleSubmit;
100
100
  $[11] = whenToUse;
@@ -114,7 +114,7 @@ export function DescriptionStep() {
114
114
  }
115
115
  let t8;
116
116
  if ($[15] !== t6 || $[16] !== t7) {
117
- t8 = _jsx(WizardDialogLayout, { subtitle: "Description (tell Claude when to use this agent)", footerText: t4, children: _jsxs(Box, { flexDirection: "column", children: [t5, t6, t7] }) });
117
+ t8 = _jsx(WizardDialogLayout, { subtitle: "Descripcion (indica cuando debe usarse este agente)", footerText: t4, children: _jsxs(Box, { flexDirection: "column", children: [t5, t6, t7] }) });
118
118
  $[15] = t6;
119
119
  $[16] = t7;
120
120
  $[17] = t8;
@@ -21,19 +21,17 @@ export function GenerateStep() {
21
21
  const [cursorOffset, setCursorOffset] = useState(prompt.length);
22
22
  const model = useMainLoopModel();
23
23
  const abortControllerRef = useRef(null);
24
- // Cancel generation when escape pressed during generation
25
24
  const handleCancelGeneration = useCallback(() => {
26
25
  if (abortControllerRef.current) {
27
26
  abortControllerRef.current.abort();
28
27
  abortControllerRef.current = null;
29
28
  setIsGenerating(false);
30
- setError('Generation cancelled');
29
+ setError('Generacion cancelada');
31
30
  }
32
31
  }, []);
33
- // Use Settings context so 'n' key doesn't cancel (allows typing 'n' in prompt input)
34
32
  useKeybinding('confirm:no', handleCancelGeneration, {
35
33
  context: 'Settings',
36
- isActive: isGenerating
34
+ isActive: isGenerating,
37
35
  });
38
36
  const handleExternalEditor = useCallback(async () => {
39
37
  const result = await editPromptInEditor(prompt);
@@ -44,9 +42,8 @@ export function GenerateStep() {
44
42
  }, [prompt]);
45
43
  useKeybinding('chat:externalEditor', handleExternalEditor, {
46
44
  context: 'Chat',
47
- isActive: !isGenerating
45
+ isActive: !isGenerating,
48
46
  });
49
- // Go back when escape pressed while not generating
50
47
  const handleGoBack = useCallback(() => {
51
48
  updateWizardData({
52
49
  generationPrompt: '',
@@ -54,30 +51,28 @@ export function GenerateStep() {
54
51
  systemPrompt: '',
55
52
  whenToUse: '',
56
53
  generatedAgent: undefined,
57
- wasGenerated: false
54
+ wasGenerated: false,
58
55
  });
59
56
  setPrompt('');
60
57
  setError(null);
61
58
  goBack();
62
59
  }, [updateWizardData, goBack]);
63
- // Use Settings context so 'n' key doesn't cancel (allows typing 'n' in prompt input)
64
60
  useKeybinding('confirm:no', handleGoBack, {
65
61
  context: 'Settings',
66
- isActive: !isGenerating
62
+ isActive: !isGenerating,
67
63
  });
68
64
  const handleGenerate = async () => {
69
65
  const trimmedPrompt = prompt.trim();
70
66
  if (!trimmedPrompt) {
71
- setError('Please describe what the agent should do');
67
+ setError('Describe que debe hacer el agente');
72
68
  return;
73
69
  }
74
70
  setError(null);
75
71
  setIsGenerating(true);
76
72
  updateWizardData({
77
73
  generationPrompt: trimmedPrompt,
78
- isGenerating: true
74
+ isGenerating: true,
79
75
  });
80
- // Create abort controller for this generation
81
76
  const controller = createAbortController();
82
77
  abortControllerRef.current = controller;
83
78
  try {
@@ -88,21 +83,19 @@ export function GenerateStep() {
88
83
  systemPrompt: generated.systemPrompt,
89
84
  generatedAgent: generated,
90
85
  isGenerating: false,
91
- wasGenerated: true
86
+ wasGenerated: true,
92
87
  });
93
- // Skip directly to ToolsStep (index 6) - matching original flow
94
88
  goToStep(6);
95
89
  }
96
90
  catch (err) {
97
- // Don't show error if it was cancelled (already set in escape handler)
98
91
  if (err instanceof APIUserAbortError) {
99
- // User cancelled - no error to show
100
92
  }
101
- else if (err instanceof Error && !err.message.includes('No assistant message found')) {
102
- setError(err.message || 'Failed to generate agent');
93
+ else if (err instanceof Error &&
94
+ !err.message.includes('No assistant message found')) {
95
+ setError(err.message || 'No se pudo generar el agente');
103
96
  }
104
97
  updateWizardData({
105
- isGenerating: false
98
+ isGenerating: false,
106
99
  });
107
100
  }
108
101
  finally {
@@ -110,9 +103,9 @@ export function GenerateStep() {
110
103
  abortControllerRef.current = null;
111
104
  }
112
105
  };
113
- const subtitle = 'Describe what this agent should do and when it should be used (be comprehensive for best results)';
106
+ const subtitle = 'Describe que debe hacer este agente y cuando debe usarse (se detallado para obtener mejores resultados)';
114
107
  if (isGenerating) {
115
- return _jsx(WizardDialogLayout, { subtitle: subtitle, footerText: _jsx(ConfigurableShortcutHint, { action: "confirm:no", context: "Settings", fallback: "Esc", description: "cancelar" }), children: _jsxs(Box, { flexDirection: "row", alignItems: "center", children: [_jsx(Spinner, {}), _jsx(Text, { color: "suggestion", children: " Generando agente desde la descripci\u00F3n..." })] }) });
108
+ return (_jsx(WizardDialogLayout, { subtitle: subtitle, footerText: _jsx(ConfigurableShortcutHint, { action: "confirm:no", context: "Settings", fallback: "Esc", description: "cancelar" }), children: _jsxs(Box, { flexDirection: "row", alignItems: "center", children: [_jsx(Spinner, {}), _jsx(Text, { color: "suggestion", children: " Generando agente desde la descripcion..." })] }) }));
116
109
  }
117
- return _jsx(WizardDialogLayout, { subtitle: subtitle, footerText: _jsxs(Byline, { children: [_jsx(ConfigurableShortcutHint, { action: "confirm:yes", context: "Confirmation", fallback: "Enter", description: "enviar" }), _jsx(ConfigurableShortcutHint, { action: "chat:externalEditor", context: "Chat", fallback: "ctrl+g", description: "abrir en editor" }), _jsx(ConfigurableShortcutHint, { action: "confirm:no", context: "Settings", fallback: "Esc", description: "volver" })] }), children: _jsxs(Box, { flexDirection: "column", children: [error && _jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "error", children: error }) }), _jsx(TextInput, { value: prompt, onChange: setPrompt, onSubmit: handleGenerate, placeholder: "e.g., Help me write unit tests for my code...", columns: 80, cursorOffset: cursorOffset, onChangeCursorOffset: setCursorOffset, focus: true, showCursor: true })] }) });
110
+ return (_jsx(WizardDialogLayout, { subtitle: subtitle, footerText: _jsxs(Byline, { children: [_jsx(ConfigurableShortcutHint, { action: "confirm:yes", context: "Confirmation", fallback: "Enter", description: "enviar" }), _jsx(ConfigurableShortcutHint, { action: "chat:externalEditor", context: "Chat", fallback: "ctrl+g", description: "abrir en editor" }), _jsx(ConfigurableShortcutHint, { action: "confirm:no", context: "Settings", fallback: "Esc", description: "volver" })] }), children: _jsxs(Box, { flexDirection: "column", children: [error ? (_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "error", children: error }) })) : null, _jsx(TextInput, { value: prompt, onChange: setPrompt, onSubmit: handleGenerate, placeholder: "p. ej., ayudame a escribir pruebas unitarias para mi codigo...", columns: 80, cursorOffset: cursorOffset, onChangeCursorOffset: setCursorOffset, focus: true, showCursor: true })] }) }));
118
111
  }
@@ -26,7 +26,7 @@ export function LocationStep() {
26
26
  let t0;
27
27
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
28
28
  t0 = {
29
- label: `Project (${getProjectAgentFolderLabel()}/agents/)`,
29
+ label: `Proyecto (${getProjectAgentFolderLabel()}/agents/)`,
30
30
  value: "projectSettings"
31
31
  };
32
32
  $[0] = t0;
@@ -80,7 +80,7 @@ export function LocationStep() {
80
80
  }
81
81
  let t5;
82
82
  if ($[8] !== t3 || $[9] !== t4) {
83
- t5 = _jsx(WizardDialogLayout, { subtitle: "Choose location", footerText: t2, children: _jsx(Box, { children: _jsx(Select, { options: locationOptions, onChange: t3, onCancel: t4 }, "location-select") }) });
83
+ t5 = _jsx(WizardDialogLayout, { subtitle: "Elegir ubicacion", footerText: t2, children: _jsx(Box, { children: _jsx(Select, { options: locationOptions, onChange: t3, onCancel: t4 }, "location-select") }) });
84
84
  $[8] = t3;
85
85
  $[9] = t4;
86
86
  $[10] = t5;