@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
@@ -30,25 +30,25 @@ import { Divider } from '../design-system/Divider.js';
30
30
  function getToolBuckets() {
31
31
  return {
32
32
  READ_ONLY: {
33
- name: 'Read-only tools',
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: 'Edit tools',
37
+ name: 'Herramientas de edicion',
38
38
  toolNames: new Set([FileEditTool.name, FileWriteTool.name, NotebookEditTool.name])
39
39
  },
40
40
  EXECUTION: {
41
- name: 'Execution tools',
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 tools',
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: 'Other tools',
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: "Continue",
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} All tools`,
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 ? "Hide advanced options" : "Show advanced options",
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 Servers:",
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, "tool")})`,
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: "Individual Tools:",
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, "[ Continue ]"] });
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 ? "All tools selected" : `${selectedSet.size} of ${customAgentTools.length} tools selected`;
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 'Built-in';
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 'Built-in';
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 'Built-in';
109
+ return 'Integrado';
109
110
  }
110
111
  if (isPluginAgent(agent)) {
111
- return `Plugin: ${agent.plugin || 'Unknown'}`;
112
+ return `Plugin: ${agent.plugin || 'Desconocido'}`;
112
113
  }
113
114
  if (agent.source === 'flagSettings') {
114
- return 'CLI argument';
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: "Create new agent", showStepCounter: false });
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;
@@ -1,5 +1,4 @@
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 } from '../../../../ink.js';
4
3
  import { useKeybinding } from '../../../../keybindings/useKeybinding.js';
5
4
  import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js';
@@ -9,72 +8,27 @@ import { useWizard } from '../../../wizard/index.js';
9
8
  import { WizardDialogLayout } from '../../../wizard/WizardDialogLayout.js';
10
9
  import { ColorPicker } from '../../ColorPicker.js';
11
10
  export function ColorStep() {
12
- const $ = _c(14);
13
11
  const { goNext, goBack, updateWizardData, wizardData } = useWizard();
14
- let t0;
15
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
16
- t0 = {
17
- context: "Confirmation"
18
- };
19
- $[0] = t0;
20
- }
21
- else {
22
- t0 = $[0];
23
- }
24
- useKeybinding("confirm:no", goBack, t0);
25
- let t1;
26
- if ($[1] !== goNext || $[2] !== updateWizardData || $[3] !== wizardData.agentType || $[4] !== wizardData.location || $[5] !== wizardData.selectedModel || $[6] !== wizardData.selectedTools || $[7] !== wizardData.systemPrompt || $[8] !== wizardData.whenToUse) {
27
- t1 = color => {
28
- updateWizardData({
29
- selectedColor: color,
30
- finalAgent: {
31
- agentType: wizardData.agentType,
32
- whenToUse: wizardData.whenToUse,
33
- getSystemPrompt: () => wizardData.systemPrompt,
34
- tools: wizardData.selectedTools,
35
- ...(wizardData.selectedModel ? {
36
- model: wizardData.selectedModel
37
- } : {}),
38
- ...(color ? {
39
- color: color
40
- } : {}),
41
- source: wizardData.location
42
- }
43
- });
44
- goNext();
45
- };
46
- $[1] = goNext;
47
- $[2] = updateWizardData;
48
- $[3] = wizardData.agentType;
49
- $[4] = wizardData.location;
50
- $[5] = wizardData.selectedModel;
51
- $[6] = wizardData.selectedTools;
52
- $[7] = wizardData.systemPrompt;
53
- $[8] = wizardData.whenToUse;
54
- $[9] = t1;
55
- }
56
- else {
57
- t1 = $[9];
58
- }
59
- const handleConfirm = t1;
60
- let t2;
61
- if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
62
- t2 = _jsxs(Byline, { children: [_jsx(KeyboardShortcutHint, { shortcut: "\u2191\u2193", action: "navegar" }), _jsx(KeyboardShortcutHint, { shortcut: "Enter", action: "seleccionar" }), _jsx(ConfigurableShortcutHint, { action: "confirm:no", context: "Confirmation", fallback: "Esc", description: "volver" })] });
63
- $[10] = t2;
64
- }
65
- else {
66
- t2 = $[10];
67
- }
68
- const t3 = wizardData.agentType || "agent";
69
- let t4;
70
- if ($[11] !== handleConfirm || $[12] !== t3) {
71
- t4 = _jsx(WizardDialogLayout, { subtitle: "Choose background color", footerText: t2, children: _jsx(Box, { children: _jsx(ColorPicker, { agentName: t3, currentColor: "automatic", onConfirm: handleConfirm }) }) });
72
- $[11] = handleConfirm;
73
- $[12] = t3;
74
- $[13] = t4;
75
- }
76
- else {
77
- t4 = $[13];
78
- }
79
- return t4;
12
+ useKeybinding('confirm:no', goBack, { context: 'Confirmation' });
13
+ const handleConfirm = (color) => {
14
+ updateWizardData({
15
+ selectedColor: color,
16
+ finalAgent: {
17
+ agentType: wizardData.agentType,
18
+ whenToUse: wizardData.whenToUse,
19
+ getSystemPrompt: () => wizardData.systemPrompt,
20
+ tools: wizardData.selectedTools,
21
+ ...(wizardData.selectedModel
22
+ ? { model: wizardData.selectedModel }
23
+ : {}),
24
+ ...(wizardData.selectedProvider
25
+ ? { provider: wizardData.selectedProvider }
26
+ : {}),
27
+ ...(color ? { color: color } : {}),
28
+ source: wizardData.location,
29
+ },
30
+ });
31
+ goNext();
32
+ };
33
+ return (_jsx(WizardDialogLayout, { subtitle: "Color de fondo", footerText: _jsxs(Byline, { children: [_jsx(KeyboardShortcutHint, { shortcut: "\u2191\u2193", action: "navegar" }), _jsx(KeyboardShortcutHint, { shortcut: "Enter", action: "seleccionar" }), _jsx(ConfigurableShortcutHint, { action: "confirm:no", context: "Confirmation", fallback: "Esc", description: "volver" })] }), children: _jsx(Box, { children: _jsx(ColorPicker, { agentName: wizardData.agentType || 'agent', currentColor: "automatic", onConfirm: handleConfirm }) }) }));
80
34
  }