@iaforged/context-code 1.0.73 → 1.0.74
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/commands.js
CHANGED
|
@@ -136,7 +136,7 @@ import chrome from './commands/chrome/index.js';
|
|
|
136
136
|
import stickers from './commands/stickers/index.js';
|
|
137
137
|
import advisor from './commands/advisor.js';
|
|
138
138
|
import { logError } from './utils/log.js';
|
|
139
|
-
import { toError } from './utils/errors.js';
|
|
139
|
+
import { MalformedCommandError, toError } from './utils/errors.js';
|
|
140
140
|
import { logForDebugging } from './utils/debug.js';
|
|
141
141
|
import { getSkillDirCommands, clearSkillCaches, getDynamicSkills, } from './skills/loadSkillsDir.js';
|
|
142
142
|
import { getBundledSkills } from './skills/bundledSkills.js';
|
|
@@ -172,7 +172,7 @@ import stats from './commands/stats/index.js';
|
|
|
172
172
|
import oauthRefresh from './commands/oauth-refresh/index.js';
|
|
173
173
|
import debugToolCall from './commands/debug-tool-call/index.js';
|
|
174
174
|
import { getSettingSourceName } from './utils/settings/constants.js';
|
|
175
|
-
import {
|
|
175
|
+
import { isCommandEnabled, } from './types/command.js';
|
|
176
176
|
export { getCommandName, isCommandEnabled } from './types/command.js';
|
|
177
177
|
// Commands that get eliminated from the external build
|
|
178
178
|
export const INTERNAL_ONLY_COMMANDS = [
|
|
@@ -600,13 +600,7 @@ export function getCommand(commandName, commands) {
|
|
|
600
600
|
throw new Error('El nombre del comando no puede estar vacío');
|
|
601
601
|
const command = findCommand(commandName, commands);
|
|
602
602
|
if (!command) {
|
|
603
|
-
throw
|
|
604
|
-
.map(_ => {
|
|
605
|
-
const name = getCommandName(_);
|
|
606
|
-
return _.aliases ? `${name} (alias: ${_.aliases.join(', ')})` : name;
|
|
607
|
-
})
|
|
608
|
-
.sort((a, b) => a.localeCompare(b))
|
|
609
|
-
.join(', ')}`);
|
|
603
|
+
throw new MalformedCommandError(`Comando /${commandName} no encontrado. Usa /help para ver los comandos disponibles.`);
|
|
610
604
|
}
|
|
611
605
|
return command;
|
|
612
606
|
}
|
|
@@ -486,8 +486,20 @@ async function getMessagesForSlashCommand(commandName, args, setToolJSX, context
|
|
|
486
486
|
{
|
|
487
487
|
return new Promise(resolve => {
|
|
488
488
|
let doneWasCalled = false;
|
|
489
|
+
// Safety net: if the JSX component never calls onDone (e.g. a React
|
|
490
|
+
// render error), the queryGuard would stay in 'dispatching' forever,
|
|
491
|
+
// deadlocking all future commands. Resolve after 30 s so the guard
|
|
492
|
+
// is always released.
|
|
493
|
+
const safetyTimer = setTimeout(() => {
|
|
494
|
+
if (doneWasCalled)
|
|
495
|
+
return;
|
|
496
|
+
doneWasCalled = true;
|
|
497
|
+
setToolJSX({ jsx: null, shouldHidePromptInput: false, clearLocalJSX: true });
|
|
498
|
+
void resolve({ messages: [], shouldQuery: false, command });
|
|
499
|
+
}, 30_000);
|
|
489
500
|
const onDone = (result, options) => {
|
|
490
501
|
doneWasCalled = true;
|
|
502
|
+
clearTimeout(safetyTimer);
|
|
491
503
|
// If display is 'skip', don't add any messages to the conversation
|
|
492
504
|
if (options?.display === 'skip') {
|
|
493
505
|
void resolve({
|
|
@@ -570,6 +582,7 @@ async function getMessagesForSlashCommand(commandName, args, setToolJSX, context
|
|
|
570
582
|
if (doneWasCalled)
|
|
571
583
|
return;
|
|
572
584
|
doneWasCalled = true;
|
|
585
|
+
clearTimeout(safetyTimer);
|
|
573
586
|
setToolJSX({
|
|
574
587
|
jsx: null,
|
|
575
588
|
shouldHidePromptInput: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iaforged/context-code",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.74",
|
|
4
4
|
"description": "Context Code es un asistente de desarrollo para la terminal. Puede revisar tu proyecto, editar archivos, ejecutar comandos y apoyarte en tareas reales de programacion.",
|
|
5
5
|
"author": "Context AI",
|
|
6
6
|
"license": "MIT",
|