@iaforged/context-code 1.1.9 → 1.2.1

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 (78) hide show
  1. package/README.md +24 -0
  2. package/dist/src/commands/model/model.js +9 -5
  3. package/dist/src/commands/timeline/index.js +8 -0
  4. package/dist/src/commands/timeline/timeline.js +194 -0
  5. package/dist/src/commands.js +2 -0
  6. package/dist/src/components/AgentActivitySidebar.js +50 -0
  7. package/dist/src/components/AgentProgressLine.js +5 -5
  8. package/dist/src/components/ModelPicker.js +252 -441
  9. package/dist/src/components/PromptInput/PromptInputFooter.js +10 -29
  10. package/dist/src/components/Spinner/TeammateSpinnerLine.js +20 -62
  11. package/dist/src/components/Spinner/TeammateSpinnerTree.js +16 -258
  12. package/dist/src/components/Spinner/teammateSelectHint.js +1 -1
  13. package/dist/src/components/Spinner/utils.js +3 -6
  14. package/dist/src/components/ThemeBrowser.js +120 -0
  15. package/dist/src/components/ThemePicker.js +113 -321
  16. package/dist/src/components/design-system/ThemeProvider.js +3 -0
  17. package/dist/src/components/mcp/MCPListPanel.js +138 -444
  18. package/dist/src/components/permissions/SandboxPermissionRequest.js +5 -5
  19. package/dist/src/components/teams/TeamStatus.js +7 -71
  20. package/dist/src/constants/spinnerVerbs.js +80 -180
  21. package/dist/src/context/modalStackContext.js +12 -0
  22. package/dist/src/hooks/useTextInput.js +28 -18
  23. package/dist/src/main.js +12 -0
  24. package/dist/src/screens/REPL.js +386 -320
  25. package/dist/src/skills/loadSkillsDir.js +1 -0
  26. package/dist/src/tools/AgentTool/UI.js +8 -8
  27. package/dist/src/tools/BashTool/bashSecurity.js +1 -1
  28. package/dist/src/utils/handlePromptSubmit.js +12 -2
  29. package/dist/src/utils/processUserInput/processSlashCommand.js +9 -5
  30. package/dist/src/utils/sembleMcp/common.js +5 -0
  31. package/dist/src/utils/sembleMcp/setup.js +119 -0
  32. package/dist/src/utils/theme.js +24 -3
  33. package/dist/src/utils/themes/bootstrap.js +109 -0
  34. package/dist/src/utils/themes/builtin/opencode/_index.json +41 -0
  35. package/dist/src/utils/themes/builtin/opencode/amoled.json +49 -0
  36. package/dist/src/utils/themes/builtin/opencode/aura.json +51 -0
  37. package/dist/src/utils/themes/builtin/opencode/ayu.json +51 -0
  38. package/dist/src/utils/themes/builtin/opencode/carbonfox.json +53 -0
  39. package/dist/src/utils/themes/builtin/opencode/catppuccin-frappe.json +85 -0
  40. package/dist/src/utils/themes/builtin/opencode/catppuccin-macchiato.json +85 -0
  41. package/dist/src/utils/themes/builtin/opencode/catppuccin.json +45 -0
  42. package/dist/src/utils/themes/builtin/opencode/cobalt2.json +87 -0
  43. package/dist/src/utils/themes/builtin/opencode/cursor.json +91 -0
  44. package/dist/src/utils/themes/builtin/opencode/dracula.json +49 -0
  45. package/dist/src/utils/themes/builtin/opencode/everforest.json +89 -0
  46. package/dist/src/utils/themes/builtin/opencode/flexoki.json +86 -0
  47. package/dist/src/utils/themes/builtin/opencode/github.json +85 -0
  48. package/dist/src/utils/themes/builtin/opencode/gruvbox.json +45 -0
  49. package/dist/src/utils/themes/builtin/opencode/kanagawa.json +89 -0
  50. package/dist/src/utils/themes/builtin/opencode/lucent-orng.json +87 -0
  51. package/dist/src/utils/themes/builtin/opencode/material.json +87 -0
  52. package/dist/src/utils/themes/builtin/opencode/matrix.json +91 -0
  53. package/dist/src/utils/themes/builtin/opencode/mercury.json +86 -0
  54. package/dist/src/utils/themes/builtin/opencode/monokai.json +49 -0
  55. package/dist/src/utils/themes/builtin/opencode/nightowl.json +46 -0
  56. package/dist/src/utils/themes/builtin/opencode/nord.json +46 -0
  57. package/dist/src/utils/themes/builtin/opencode/oc-2.json +88 -0
  58. package/dist/src/utils/themes/builtin/opencode/one-dark.json +89 -0
  59. package/dist/src/utils/themes/builtin/opencode/onedarkpro.json +45 -0
  60. package/dist/src/utils/themes/builtin/opencode/opencode.json +89 -0
  61. package/dist/src/utils/themes/builtin/opencode/orng.json +87 -0
  62. package/dist/src/utils/themes/builtin/opencode/osaka-jade.json +88 -0
  63. package/dist/src/utils/themes/builtin/opencode/palenight.json +85 -0
  64. package/dist/src/utils/themes/builtin/opencode/rosepine.json +85 -0
  65. package/dist/src/utils/themes/builtin/opencode/shadesofpurple.json +51 -0
  66. package/dist/src/utils/themes/builtin/opencode/solarized.json +49 -0
  67. package/dist/src/utils/themes/builtin/opencode/synthwave84.json +87 -0
  68. package/dist/src/utils/themes/builtin/opencode/tokyonight.json +47 -0
  69. package/dist/src/utils/themes/builtin/opencode/vercel.json +90 -0
  70. package/dist/src/utils/themes/builtin/opencode/vesper.json +51 -0
  71. package/dist/src/utils/themes/builtin/opencode/zenburn.json +87 -0
  72. package/dist/src/utils/themes/index.js +4 -0
  73. package/dist/src/utils/themes/loader.js +147 -0
  74. package/dist/src/utils/themes/opencodeMapper.js +124 -0
  75. package/dist/src/utils/themes/resolver.js +66 -0
  76. package/dist/src/utils/themes/types.js +1 -0
  77. package/docs/MCP_SERVERS.md +27 -1
  78. package/package.json +1 -1
@@ -1,52 +1,90 @@
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 figures from 'figures';
4
- import { useState } from 'react';
3
+ import { useCallback, useMemo, useState } from 'react';
5
4
  import { Box, color, Link, Text, useTheme } from '../../ink.js';
6
5
  import { useKeybindings } from '../../keybindings/useKeybinding.js';
7
6
  import { describeMcpConfigFilePath } from '../../services/mcp/utils.js';
8
7
  import { isDebugMode } from '../../utils/debug.js';
9
- import { plural } from '../../utils/stringUtils.js';
10
8
  import { ConfigurableShortcutHint } from '../ConfigurableShortcutHint.js';
11
9
  import { Byline } from '../design-system/Byline.js';
12
10
  import { Dialog } from '../design-system/Dialog.js';
13
11
  import { KeyboardShortcutHint } from '../design-system/KeyboardShortcutHint.js';
14
12
  import { McpParsingWarnings } from './McpParsingWarnings.js';
15
- // Define scope order for display (constant, outside component)
16
- // 'dynamic' (built-in) is rendered separately at the end
17
13
  const SCOPE_ORDER = ['project', 'local', 'user', 'enterprise'];
18
- // Get scope heading parts (label is bold, path is grey)
14
+ const MCP_DESCRIPTIONS = {
15
+ database: 'Consultas y administracion de bases de datos',
16
+ semble: 'Busqueda semantica de codigo y repositorios',
17
+ Gmail: 'Correo de Google',
18
+ 'Google Calendar': 'Calendario y eventos',
19
+ 'Google Drive': 'Archivos, Docs y Sheets',
20
+ 'claude-in-chrome': 'Automatizacion de Claude en el navegador',
21
+ 'computer-use': 'Control de escritorio y automatizacion visual',
22
+ };
19
23
  function getScopeHeading(scope) {
20
24
  switch (scope) {
21
25
  case 'project':
22
26
  return {
23
- label: 'Project MCPs',
24
- path: describeMcpConfigFilePath(scope)
27
+ label: 'MCP del proyecto',
28
+ path: describeMcpConfigFilePath(scope),
25
29
  };
26
30
  case 'user':
27
31
  return {
28
- label: 'User MCPs',
29
- path: describeMcpConfigFilePath(scope)
32
+ label: 'MCP del usuario',
33
+ path: describeMcpConfigFilePath(scope),
30
34
  };
31
35
  case 'local':
32
36
  return {
33
- label: 'Local MCPs',
34
- path: describeMcpConfigFilePath(scope)
37
+ label: 'MCP locales',
38
+ path: describeMcpConfigFilePath(scope),
35
39
  };
36
40
  case 'enterprise':
37
41
  return {
38
- label: 'Enterprise MCPs'
42
+ label: 'MCP empresariales',
39
43
  };
40
44
  case 'dynamic':
41
45
  return {
42
- label: 'Built-in MCPs',
43
- path: 'always available'
46
+ label: 'MCP integrados',
47
+ path: 'siempre disponibles',
44
48
  };
45
49
  default:
46
- return {
47
- label: scope
48
- };
50
+ return { label: scope };
51
+ }
52
+ }
53
+ function getServerDescription(name) {
54
+ return MCP_DESCRIPTIONS[name];
55
+ }
56
+ function getServerStatus(server, theme) {
57
+ if (server.client.type === 'disabled') {
58
+ return {
59
+ icon: color('inactive', theme)(figures.radioOff),
60
+ text: 'deshabilitado',
61
+ };
62
+ }
63
+ if (server.client.type === 'connected') {
64
+ return {
65
+ icon: color('success', theme)(figures.tick),
66
+ text: 'conectado',
67
+ };
68
+ }
69
+ if (server.client.type === 'pending') {
70
+ const { reconnectAttempt, maxReconnectAttempts } = server.client;
71
+ return {
72
+ icon: color('inactive', theme)(figures.radioOff),
73
+ text: reconnectAttempt && maxReconnectAttempts
74
+ ? `reconectando (${reconnectAttempt}/${maxReconnectAttempts})…`
75
+ : 'conectando…',
76
+ };
77
+ }
78
+ if (server.client.type === 'needs-auth') {
79
+ return {
80
+ icon: color('warning', theme)(figures.triangleUpOutline),
81
+ text: 'necesita autenticacion',
82
+ };
49
83
  }
84
+ return {
85
+ icon: color('error', theme)(figures.cross),
86
+ text: 'fallo',
87
+ };
50
88
  }
51
89
  function groupServersByScope(serverList) {
52
90
  const groups = new Map();
@@ -57,448 +95,104 @@ function groupServersByScope(serverList) {
57
95
  }
58
96
  groups.get(scope).push(server);
59
97
  }
60
- // Sort servers within each group alphabetically
61
98
  for (const [, groupServers] of groups) {
62
99
  groupServers.sort((a, b) => a.name.localeCompare(b.name));
63
100
  }
64
101
  return groups;
65
102
  }
66
- export function MCPListPanel(t0) {
67
- const $ = _c(78);
68
- const { servers, agentServers: t1, onSelectServer, onSelectAgentServer, onComplete } = t0;
69
- let t2;
70
- if ($[0] !== t1) {
71
- t2 = t1 === undefined ? [] : t1;
72
- $[0] = t1;
73
- $[1] = t2;
74
- }
75
- else {
76
- t2 = $[1];
77
- }
78
- const agentServers = t2;
103
+ export function MCPListPanel({ servers, agentServers = [], onSelectServer, onSelectAgentServer, onComplete, }) {
79
104
  const [theme] = useTheme();
80
105
  const [selectedIndex, setSelectedIndex] = useState(0);
81
- let t3;
82
- if ($[2] !== servers) {
83
- const regularServers = servers.filter(_temp);
84
- t3 = groupServersByScope(regularServers);
85
- $[2] = servers;
86
- $[3] = t3;
87
- }
88
- else {
89
- t3 = $[3];
90
- }
91
- const serversByScope = t3;
92
- let t4;
93
- if ($[4] !== servers) {
94
- t4 = servers.filter(_temp2).sort(_temp3);
95
- $[4] = servers;
96
- $[5] = t4;
97
- }
98
- else {
99
- t4 = $[5];
100
- }
101
- const claudeAiServers = t4;
102
- let t5;
103
- if ($[6] !== serversByScope) {
104
- t5 = (serversByScope.get("dynamic") ?? []).sort(_temp4);
105
- $[6] = serversByScope;
106
- $[7] = t5;
107
- }
108
- else {
109
- t5 = $[7];
110
- }
111
- const dynamicServers = t5;
112
- let t6;
113
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
114
- t6 = getScopeHeading("dynamic");
115
- $[8] = t6;
116
- }
117
- else {
118
- t6 = $[8];
119
- }
120
- const dynamicHeading = t6;
121
- let items;
122
- if ($[9] !== agentServers || $[10] !== claudeAiServers || $[11] !== dynamicServers || $[12] !== serversByScope) {
123
- items = [];
106
+ const serversByScope = useMemo(() => {
107
+ const regularServers = servers.filter(s => s.client.config.type !== 'claudeai-proxy');
108
+ return groupServersByScope(regularServers);
109
+ }, [servers]);
110
+ const claudeAiServers = useMemo(() => servers
111
+ .filter(s => s.client.config.type === 'claudeai-proxy')
112
+ .sort((a, b) => a.name.localeCompare(b.name)), [servers]);
113
+ const dynamicServers = useMemo(() => (serversByScope.get('dynamic') ?? []).sort((a, b) => a.name.localeCompare(b.name)), [serversByScope]);
114
+ const dynamicHeading = getScopeHeading('dynamic');
115
+ const selectableItems = useMemo(() => {
116
+ const items = [];
124
117
  for (const scope of SCOPE_ORDER) {
125
- const scopeServers = serversByScope.get(scope) ?? [];
126
- for (const server of scopeServers) {
127
- items.push({
128
- type: "server",
129
- server
130
- });
118
+ for (const server of serversByScope.get(scope) ?? []) {
119
+ items.push({ type: 'server', server });
131
120
  }
132
121
  }
133
- for (const server_0 of claudeAiServers) {
134
- items.push({
135
- type: "server",
136
- server: server_0
137
- });
122
+ for (const server of claudeAiServers) {
123
+ items.push({ type: 'server', server });
138
124
  }
139
125
  for (const agentServer of agentServers) {
140
- items.push({
141
- type: "agent-server",
142
- agentServer
143
- });
126
+ items.push({ type: 'agent-server', agentServer });
144
127
  }
145
- for (const server_1 of dynamicServers) {
146
- items.push({
147
- type: "server",
148
- server: server_1
149
- });
128
+ for (const server of dynamicServers) {
129
+ items.push({ type: 'server', server });
150
130
  }
151
- $[9] = agentServers;
152
- $[10] = claudeAiServers;
153
- $[11] = dynamicServers;
154
- $[12] = serversByScope;
155
- $[13] = items;
156
- }
157
- else {
158
- items = $[13];
159
- }
160
- const selectableItems = items;
161
- let t7;
162
- if ($[14] !== onComplete) {
163
- t7 = () => {
164
- onComplete("MCP dialog dismissed", {
165
- display: "system"
166
- });
167
- };
168
- $[14] = onComplete;
169
- $[15] = t7;
170
- }
171
- else {
172
- t7 = $[15];
173
- }
174
- const handleCancel = t7;
175
- let t8;
176
- if ($[16] !== onSelectAgentServer || $[17] !== onSelectServer || $[18] !== selectableItems || $[19] !== selectedIndex) {
177
- t8 = () => {
178
- const item = selectableItems[selectedIndex];
179
- if (!item) {
180
- return;
181
- }
182
- if (item.type === "server") {
183
- onSelectServer(item.server);
184
- }
185
- else {
186
- if (item.type === "agent-server" && onSelectAgentServer) {
187
- onSelectAgentServer(item.agentServer);
188
- }
189
- }
190
- };
191
- $[16] = onSelectAgentServer;
192
- $[17] = onSelectServer;
193
- $[18] = selectableItems;
194
- $[19] = selectedIndex;
195
- $[20] = t8;
196
- }
197
- else {
198
- t8 = $[20];
199
- }
200
- const handleSelect = t8;
201
- let t10;
202
- let t9;
203
- if ($[21] !== selectableItems) {
204
- t9 = () => setSelectedIndex(prev => prev === 0 ? selectableItems.length - 1 : prev - 1);
205
- t10 = () => setSelectedIndex(prev_0 => prev_0 === selectableItems.length - 1 ? 0 : prev_0 + 1);
206
- $[21] = selectableItems;
207
- $[22] = t10;
208
- $[23] = t9;
209
- }
210
- else {
211
- t10 = $[22];
212
- t9 = $[23];
213
- }
214
- let t11;
215
- if ($[24] !== handleCancel || $[25] !== handleSelect || $[26] !== t10 || $[27] !== t9) {
216
- t11 = {
217
- "confirm:previous": t9,
218
- "confirm:next": t10,
219
- "confirm:yes": handleSelect,
220
- "confirm:no": handleCancel
221
- };
222
- $[24] = handleCancel;
223
- $[25] = handleSelect;
224
- $[26] = t10;
225
- $[27] = t9;
226
- $[28] = t11;
227
- }
228
- else {
229
- t11 = $[28];
230
- }
231
- let t12;
232
- if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
233
- t12 = {
234
- context: "Confirmation"
235
- };
236
- $[29] = t12;
237
- }
238
- else {
239
- t12 = $[29];
240
- }
241
- useKeybindings(t11, t12);
242
- let t13;
243
- if ($[30] !== selectableItems) {
244
- t13 = server_2 => selectableItems.findIndex(item_0 => item_0.type === "server" && item_0.server === server_2);
245
- $[30] = selectableItems;
246
- $[31] = t13;
247
- }
248
- else {
249
- t13 = $[31];
250
- }
251
- const getServerIndex = t13;
252
- let t14;
253
- if ($[32] !== selectableItems) {
254
- t14 = agentServer_0 => selectableItems.findIndex(item_1 => item_1.type === "agent-server" && item_1.agentServer === agentServer_0);
255
- $[32] = selectableItems;
256
- $[33] = t14;
257
- }
258
- else {
259
- t14 = $[33];
260
- }
261
- const getAgentServerIndex = t14;
262
- let t15;
263
- if ($[34] === Symbol.for("react.memo_cache_sentinel")) {
264
- t15 = isDebugMode();
265
- $[34] = t15;
266
- }
267
- else {
268
- t15 = $[34];
269
- }
270
- const debugMode = t15;
271
- let t16;
272
- if ($[35] !== servers) {
273
- t16 = servers.some(_temp5);
274
- $[35] = servers;
275
- $[36] = t16;
276
- }
277
- else {
278
- t16 = $[36];
279
- }
280
- const hasFailedClients = t16;
131
+ return items;
132
+ }, [agentServers, claudeAiServers, dynamicServers, serversByScope]);
133
+ const handleCancel = useCallback(() => {
134
+ onComplete('Dialogo MCP cerrado', { display: 'system' });
135
+ }, [onComplete]);
136
+ const handleSelect = useCallback(() => {
137
+ const item = selectableItems[selectedIndex];
138
+ if (!item)
139
+ return;
140
+ if (item.type === 'server') {
141
+ onSelectServer(item.server);
142
+ return;
143
+ }
144
+ if (onSelectAgentServer) {
145
+ onSelectAgentServer(item.agentServer);
146
+ }
147
+ }, [
148
+ onSelectAgentServer,
149
+ onSelectServer,
150
+ selectableItems,
151
+ selectedIndex,
152
+ ]);
153
+ useKeybindings({
154
+ 'confirm:previous': () => setSelectedIndex(prev => prev === 0 ? selectableItems.length - 1 : prev - 1),
155
+ 'confirm:next': () => setSelectedIndex(prev => prev === selectableItems.length - 1 ? 0 : prev + 1),
156
+ 'confirm:yes': handleSelect,
157
+ 'confirm:no': handleCancel,
158
+ }, { context: 'Confirmation' });
159
+ const getServerIndex = (server) => selectableItems.findIndex(item => item.type === 'server' && item.server === server);
160
+ const getAgentServerIndex = (agentServer) => selectableItems.findIndex(item => item.type === 'agent-server' && item.agentServer === agentServer);
161
+ const debugMode = isDebugMode();
162
+ const hasFailedClients = servers.some(s => s.client.type === 'failed');
281
163
  if (servers.length === 0 && agentServers.length === 0) {
282
164
  return null;
283
165
  }
284
- let t17;
285
- if ($[37] !== getServerIndex || $[38] !== selectedIndex || $[39] !== theme) {
286
- t17 = server_3 => {
287
- const index = getServerIndex(server_3);
288
- const isSelected = selectedIndex === index;
289
- let statusIcon;
290
- let statusText;
291
- if (server_3.client.type === "disabled") {
292
- statusIcon = color("inactive", theme)(figures.radioOff);
293
- statusText = "disabled";
294
- }
295
- else {
296
- if (server_3.client.type === "connected") {
297
- statusIcon = color("success", theme)(figures.tick);
298
- statusText = "connected";
299
- }
300
- else {
301
- if (server_3.client.type === "pending") {
302
- statusIcon = color("inactive", theme)(figures.radioOff);
303
- const { reconnectAttempt, maxReconnectAttempts } = server_3.client;
304
- if (reconnectAttempt && maxReconnectAttempts) {
305
- statusText = `reconnecting (${reconnectAttempt}/${maxReconnectAttempts})…`;
306
- }
307
- else {
308
- statusText = "connecting\u2026";
309
- }
310
- }
311
- else {
312
- if (server_3.client.type === "needs-auth") {
313
- statusIcon = color("warning", theme)(figures.triangleUpOutline);
314
- statusText = "needs authentication";
315
- }
316
- else {
317
- statusIcon = color("error", theme)(figures.cross);
318
- statusText = "failed";
319
- }
320
- }
321
- }
322
- }
323
- return _jsxs(Box, { children: [_jsx(Text, { color: isSelected ? "suggestion" : undefined, children: isSelected ? `${figures.pointer} ` : " " }), _jsx(Text, { color: isSelected ? "suggestion" : undefined, children: server_3.name }), _jsxs(Text, { dimColor: !isSelected, children: [" \u00B7 ", statusIcon, " "] }), _jsx(Text, { dimColor: !isSelected, children: statusText })] }, `${server_3.name}-${index}`);
324
- };
325
- $[37] = getServerIndex;
326
- $[38] = selectedIndex;
327
- $[39] = theme;
328
- $[40] = t17;
329
- }
330
- else {
331
- t17 = $[40];
332
- }
333
- const renderServerItem = t17;
334
- let t18;
335
- if ($[41] !== getAgentServerIndex || $[42] !== selectedIndex || $[43] !== theme) {
336
- t18 = agentServer_1 => {
337
- const index_0 = getAgentServerIndex(agentServer_1);
338
- const isSelected_0 = selectedIndex === index_0;
339
- const statusIcon_0 = agentServer_1.needsAuth ? color("warning", theme)(figures.triangleUpOutline) : color("inactive", theme)(figures.radioOff);
340
- const statusText_0 = agentServer_1.needsAuth ? "may need auth" : "agent-only";
341
- return _jsxs(Box, { children: [_jsx(Text, { color: isSelected_0 ? "suggestion" : undefined, children: isSelected_0 ? `${figures.pointer} ` : " " }), _jsx(Text, { color: isSelected_0 ? "suggestion" : undefined, children: agentServer_1.name }), _jsxs(Text, { dimColor: !isSelected_0, children: [" \u00B7 ", statusIcon_0, " "] }), _jsx(Text, { dimColor: !isSelected_0, children: statusText_0 })] }, `agent-${agentServer_1.name}-${index_0}`);
342
- };
343
- $[41] = getAgentServerIndex;
344
- $[42] = selectedIndex;
345
- $[43] = theme;
346
- $[44] = t18;
347
- }
348
- else {
349
- t18 = $[44];
350
- }
351
- const renderAgentServerItem = t18;
166
+ const renderServerItem = (server) => {
167
+ const index = getServerIndex(server);
168
+ const isSelected = selectedIndex === index;
169
+ const description = getServerDescription(server.name);
170
+ const status = getServerStatus(server, theme);
171
+ return (_jsxs(Box, { children: [_jsx(Text, { color: isSelected ? 'suggestion' : undefined, children: isSelected ? `${figures.pointer} ` : ' ' }), _jsx(Text, { color: isSelected ? 'suggestion' : undefined, children: server.name }), description && _jsxs(Text, { dimColor: !isSelected, children: [" - ", description] }), _jsxs(Text, { dimColor: !isSelected, children: [" \u00B7 ", status.icon, " "] }), _jsx(Text, { dimColor: !isSelected, children: status.text })] }, `${server.name}-${index}`));
172
+ };
173
+ const renderAgentServerItem = (agentServer) => {
174
+ const index = getAgentServerIndex(agentServer);
175
+ const isSelected = selectedIndex === index;
176
+ const statusIcon = agentServer.needsAuth
177
+ ? color('warning', theme)(figures.triangleUpOutline)
178
+ : color('inactive', theme)(figures.radioOff);
179
+ const statusText = agentServer.needsAuth
180
+ ? 'puede requerir autenticacion'
181
+ : 'solo agente';
182
+ return (_jsxs(Box, { children: [_jsx(Text, { color: isSelected ? 'suggestion' : undefined, children: isSelected ? `${figures.pointer} ` : ' ' }), _jsx(Text, { color: isSelected ? 'suggestion' : undefined, children: agentServer.name }), _jsxs(Text, { dimColor: !isSelected, children: [" \u00B7 ", statusIcon, " "] }), _jsx(Text, { dimColor: !isSelected, children: statusText })] }, `agent-${agentServer.name}-${index}`));
183
+ };
352
184
  const totalServers = servers.length + agentServers.length;
353
- let t19;
354
- if ($[45] === Symbol.for("react.memo_cache_sentinel")) {
355
- t19 = _jsx(McpParsingWarnings, {});
356
- $[45] = t19;
357
- }
358
- else {
359
- t19 = $[45];
360
- }
361
- let t20;
362
- if ($[46] !== totalServers) {
363
- t20 = plural(totalServers, "server");
364
- $[46] = totalServers;
365
- $[47] = t20;
366
- }
367
- else {
368
- t20 = $[47];
369
- }
370
- const t21 = `${totalServers} ${t20}`;
371
- let t22;
372
- if ($[48] !== renderServerItem || $[49] !== serversByScope) {
373
- t22 = SCOPE_ORDER.map(scope_0 => {
374
- const scopeServers_0 = serversByScope.get(scope_0);
375
- if (!scopeServers_0 || scopeServers_0.length === 0) {
376
- return null;
377
- }
378
- const heading = getScopeHeading(scope_0);
379
- return _jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { paddingLeft: 2, children: [_jsx(Text, { bold: true, children: heading.label }), heading.path && _jsxs(Text, { dimColor: true, children: [" (", heading.path, ")"] })] }), scopeServers_0.map(server_4 => renderServerItem(server_4))] }, scope_0);
380
- });
381
- $[48] = renderServerItem;
382
- $[49] = serversByScope;
383
- $[50] = t22;
384
- }
385
- else {
386
- t22 = $[50];
387
- }
388
- let t23;
389
- if ($[51] !== claudeAiServers || $[52] !== renderServerItem) {
390
- t23 = claudeAiServers.length > 0 && _jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Box, { paddingLeft: 2, children: _jsx(Text, { bold: true, children: "claude.ai" }) }), claudeAiServers.map(server_5 => renderServerItem(server_5))] });
391
- $[51] = claudeAiServers;
392
- $[52] = renderServerItem;
393
- $[53] = t23;
394
- }
395
- else {
396
- t23 = $[53];
397
- }
398
- let t24;
399
- if ($[54] !== agentServers || $[55] !== renderAgentServerItem) {
400
- t24 = agentServers.length > 0 && _jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Box, { paddingLeft: 2, children: _jsx(Text, { bold: true, children: "Agent MCPs" }) }), [...new Set(agentServers.flatMap(_temp6))].map(agentName => _jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Box, { paddingLeft: 2, children: _jsxs(Text, { dimColor: true, children: ["@", agentName] }) }), agentServers.filter(s_3 => s_3.sourceAgents.includes(agentName)).map(agentServer_2 => renderAgentServerItem(agentServer_2))] }, agentName))] });
401
- $[54] = agentServers;
402
- $[55] = renderAgentServerItem;
403
- $[56] = t24;
404
- }
405
- else {
406
- t24 = $[56];
407
- }
408
- let t25;
409
- if ($[57] !== dynamicServers || $[58] !== renderServerItem) {
410
- t25 = dynamicServers.length > 0 && _jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { paddingLeft: 2, children: [_jsx(Text, { bold: true, children: dynamicHeading.label }), dynamicHeading.path && _jsxs(Text, { dimColor: true, children: [" (", dynamicHeading.path, ")"] })] }), dynamicServers.map(server_6 => renderServerItem(server_6))] });
411
- $[57] = dynamicServers;
412
- $[58] = renderServerItem;
413
- $[59] = t25;
414
- }
415
- else {
416
- t25 = $[59];
417
- }
418
- let t26;
419
- if ($[60] !== hasFailedClients) {
420
- t26 = hasFailedClients && _jsx(Text, { dimColor: true, children: debugMode ? "\u203B Error logs shown inline with --debug" : "\u203B Run context --debug to see error logs" });
421
- $[60] = hasFailedClients;
422
- $[61] = t26;
423
- }
424
- else {
425
- t26 = $[61];
426
- }
427
- let t27;
428
- if ($[62] === Symbol.for("react.memo_cache_sentinel")) {
429
- t27 = _jsxs(Text, { dimColor: true, children: [_jsx(Link, { url: "https://code.claude.com/docs/en/mcp", children: "https://code.claude.com/docs/en/mcp" }), " ", "for help"] });
430
- $[62] = t27;
431
- }
432
- else {
433
- t27 = $[62];
434
- }
435
- let t28;
436
- if ($[63] !== t26) {
437
- t28 = _jsxs(Box, { flexDirection: "column", children: [t26, t27] });
438
- $[63] = t26;
439
- $[64] = t28;
440
- }
441
- else {
442
- t28 = $[64];
443
- }
444
- let t29;
445
- if ($[65] !== t22 || $[66] !== t23 || $[67] !== t24 || $[68] !== t25 || $[69] !== t28) {
446
- t29 = _jsxs(Box, { flexDirection: "column", children: [t22, t23, t24, t25, t28] });
447
- $[65] = t22;
448
- $[66] = t23;
449
- $[67] = t24;
450
- $[68] = t25;
451
- $[69] = t28;
452
- $[70] = t29;
453
- }
454
- else {
455
- t29 = $[70];
456
- }
457
- let t30;
458
- if ($[71] !== handleCancel || $[72] !== t21 || $[73] !== t29) {
459
- t30 = _jsx(Dialog, { title: "Manage MCP servers", subtitle: t21, onCancel: handleCancel, hideInputGuide: true, children: t29 });
460
- $[71] = handleCancel;
461
- $[72] = t21;
462
- $[73] = t29;
463
- $[74] = t30;
464
- }
465
- else {
466
- t30 = $[74];
467
- }
468
- let t31;
469
- if ($[75] === Symbol.for("react.memo_cache_sentinel")) {
470
- t31 = _jsx(Box, { paddingX: 1, children: _jsx(Text, { dimColor: true, italic: true, children: _jsxs(Byline, { children: [_jsx(KeyboardShortcutHint, { shortcut: "\u2191\u2193", action: "navigate" }), _jsx(KeyboardShortcutHint, { shortcut: "Enter", action: "confirmar" }), _jsx(ConfigurableShortcutHint, { action: "confirm:no", context: "Confirmation", fallback: "Esc", description: "cancelar" })] }) }) });
471
- $[75] = t31;
472
- }
473
- else {
474
- t31 = $[75];
475
- }
476
- let t32;
477
- if ($[76] !== t30) {
478
- t32 = _jsxs(Box, { flexDirection: "column", children: [t19, t30, t31] });
479
- $[76] = t30;
480
- $[77] = t32;
481
- }
482
- else {
483
- t32 = $[77];
484
- }
485
- return t32;
486
- }
487
- function _temp6(s_2) {
488
- return s_2.sourceAgents;
489
- }
490
- function _temp5(s_1) {
491
- return s_1.client.type === "failed";
492
- }
493
- function _temp4(a_0, b_0) {
494
- return a_0.name.localeCompare(b_0.name);
495
- }
496
- function _temp3(a, b) {
497
- return a.name.localeCompare(b.name);
498
- }
499
- function _temp2(s_0) {
500
- return s_0.client.config.type === "claudeai-proxy";
501
- }
502
- function _temp(s) {
503
- return s.client.config.type !== "claudeai-proxy";
185
+ const subtitle = totalServers === 1 ? '1 servidor' : `${totalServers} servidores`;
186
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsx(McpParsingWarnings, {}), _jsx(Dialog, { title: "Gestionar servidores MCP", subtitle: subtitle, onCancel: handleCancel, hideInputGuide: true, children: _jsxs(Box, { flexDirection: "column", children: [SCOPE_ORDER.map(scope => {
187
+ const scopeServers = serversByScope.get(scope);
188
+ if (!scopeServers || scopeServers.length === 0) {
189
+ return null;
190
+ }
191
+ const heading = getScopeHeading(scope);
192
+ return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { paddingLeft: 2, children: [_jsx(Text, { bold: true, children: heading.label }), heading.path && _jsxs(Text, { dimColor: true, children: [" (", heading.path, ")"] })] }), scopeServers.map(server => renderServerItem(server))] }, scope));
193
+ }), claudeAiServers.length > 0 && (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Box, { paddingLeft: 2, children: _jsx(Text, { bold: true, children: "claude.ai" }) }), claudeAiServers.map(server => renderServerItem(server))] })), agentServers.length > 0 && (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Box, { paddingLeft: 2, children: _jsx(Text, { bold: true, children: "MCP de agentes" }) }), [...new Set(agentServers.flatMap(s => s.sourceAgents))].map(agentName => (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Box, { paddingLeft: 2, children: _jsxs(Text, { dimColor: true, children: ["@", agentName] }) }), agentServers
194
+ .filter(s => s.sourceAgents.includes(agentName))
195
+ .map(agentServer => renderAgentServerItem(agentServer))] }, agentName)))] })), dynamicServers.length > 0 && (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { paddingLeft: 2, children: [_jsx(Text, { bold: true, children: dynamicHeading.label }), dynamicHeading.path && (_jsxs(Text, { dimColor: true, children: [" (", dynamicHeading.path, ")"] }))] }), dynamicServers.map(server => renderServerItem(server))] })), hasFailedClients && (_jsx(Text, { dimColor: true, children: debugMode
196
+ ? '※ Los errores se muestran en linea con --debug'
197
+ : '※ Ejecuta context --debug para ver los errores' })), _jsxs(Text, { dimColor: true, children: [_jsx(Link, { url: "https://code.claude.com/docs/en/mcp", children: "https://code.claude.com/docs/en/mcp" }), ' ', "para ayuda"] })] }) }), _jsx(Box, { paddingX: 1, children: _jsx(Text, { dimColor: true, italic: true, children: _jsxs(Byline, { children: [_jsx(KeyboardShortcutHint, { shortcut: "\u2191\u2193", action: "navegar" }), _jsx(KeyboardShortcutHint, { shortcut: "Enter", action: "confirmar" }), _jsx(ConfigurableShortcutHint, { action: "confirm:no", context: "Confirmation", fallback: "Esc", description: "cancelar" })] }) }) })] }));
504
198
  }