|
|
|
|
@ -13,6 +13,7 @@ import { Metrics } from './metrics';
|
|
|
|
|
import { ResponseQueue } from './response-queue';
|
|
|
|
|
import { randomTokenBase64Url, sha256Hex } from '../utils/crypto';
|
|
|
|
|
import { route as routeCommand } from './commands';
|
|
|
|
|
import { ACTION_ALIASES, SCOPE_ALIASES } from './commands/shared';
|
|
|
|
|
import { parseNueva } from './commands/parsers/nueva';
|
|
|
|
|
|
|
|
|
|
type CommandContext = {
|
|
|
|
|
@ -53,39 +54,6 @@ export class CommandService {
|
|
|
|
|
const trimmed = (context.message || '').trim();
|
|
|
|
|
const tokens = trimmed.split(/\s+/);
|
|
|
|
|
const rawAction = (tokens[1] || '').toLowerCase();
|
|
|
|
|
const ACTION_ALIASES: Record<string, string> = {
|
|
|
|
|
'n': 'nueva',
|
|
|
|
|
'nueva': 'nueva',
|
|
|
|
|
'crear': 'nueva',
|
|
|
|
|
'+': 'nueva',
|
|
|
|
|
'ver': 'ver',
|
|
|
|
|
'mostrar': 'ver',
|
|
|
|
|
'listar': 'ver',
|
|
|
|
|
'ls': 'ver',
|
|
|
|
|
'mias': 'ver',
|
|
|
|
|
'mías': 'ver',
|
|
|
|
|
'todas': 'ver',
|
|
|
|
|
'todos': 'ver',
|
|
|
|
|
'x': 'completar',
|
|
|
|
|
'hecho': 'completar',
|
|
|
|
|
'completar': 'completar',
|
|
|
|
|
'done': 'completar',
|
|
|
|
|
'tomar': 'tomar',
|
|
|
|
|
'claim': 'tomar',
|
|
|
|
|
'asumir': 'tomar',
|
|
|
|
|
'asumo': 'tomar',
|
|
|
|
|
'soltar': 'soltar',
|
|
|
|
|
'unassign': 'soltar',
|
|
|
|
|
'dejar': 'soltar',
|
|
|
|
|
'liberar': 'soltar',
|
|
|
|
|
'renunciar': 'soltar',
|
|
|
|
|
'ayuda': 'ayuda',
|
|
|
|
|
'help': 'ayuda',
|
|
|
|
|
'info': 'ayuda',
|
|
|
|
|
'?': 'ayuda',
|
|
|
|
|
'config': 'configurar',
|
|
|
|
|
'configurar': 'configurar'
|
|
|
|
|
};
|
|
|
|
|
const action = ACTION_ALIASES[rawAction] || rawAction;
|
|
|
|
|
// Métrica: uso de alias (info/mias/todas)
|
|
|
|
|
try {
|
|
|
|
|
@ -181,15 +149,6 @@ export class CommandService {
|
|
|
|
|
// Listar pendientes
|
|
|
|
|
if (action === 'ver') {
|
|
|
|
|
const scopeRaw = (tokens[2] || '').toLowerCase();
|
|
|
|
|
const SCOPE_ALIASES: Record<string, 'mis' | 'todos'> = {
|
|
|
|
|
'todo': 'todos',
|
|
|
|
|
'todos': 'todos',
|
|
|
|
|
'todas': 'todos',
|
|
|
|
|
'mis': 'mis',
|
|
|
|
|
'mias': 'mis',
|
|
|
|
|
'mías': 'mis',
|
|
|
|
|
'yo': 'mis',
|
|
|
|
|
};
|
|
|
|
|
const scope = scopeRaw
|
|
|
|
|
? (SCOPE_ALIASES[scopeRaw] || scopeRaw)
|
|
|
|
|
: ((rawAction === 'mias' || rawAction === 'mías') ? 'mis' : ((rawAction === 'todas' || rawAction === 'todos') ? 'todos' : 'todos'));
|
|
|
|
|
@ -1322,40 +1281,6 @@ Puedes interactuar escribiéndome por privado:
|
|
|
|
|
// Clasificación explícita del outcome (evita lógica en server)
|
|
|
|
|
const tokens = msg.split(/\s+/);
|
|
|
|
|
const rawAction = (tokens[1] || '').toLowerCase();
|
|
|
|
|
const ACTION_ALIASES: Record<string, string> = {
|
|
|
|
|
'n': 'nueva',
|
|
|
|
|
'nueva': 'nueva',
|
|
|
|
|
'crear': 'nueva',
|
|
|
|
|
'+': 'nueva',
|
|
|
|
|
'ver': 'ver',
|
|
|
|
|
'mostrar': 'ver',
|
|
|
|
|
'listar': 'ver',
|
|
|
|
|
'ls': 'ver',
|
|
|
|
|
'mias': 'ver',
|
|
|
|
|
'mías': 'ver',
|
|
|
|
|
'todas': 'ver',
|
|
|
|
|
'todos': 'ver',
|
|
|
|
|
'x': 'completar',
|
|
|
|
|
'hecho': 'completar',
|
|
|
|
|
'completar': 'completar',
|
|
|
|
|
'done': 'completar',
|
|
|
|
|
'tomar': 'tomar',
|
|
|
|
|
'claim': 'tomar',
|
|
|
|
|
'asumir': 'tomar',
|
|
|
|
|
'asumo': 'tomar',
|
|
|
|
|
'soltar': 'soltar',
|
|
|
|
|
'unassign': 'soltar',
|
|
|
|
|
'dejar': 'soltar',
|
|
|
|
|
'liberar': 'soltar',
|
|
|
|
|
'renunciar': 'soltar',
|
|
|
|
|
'ayuda': 'ayuda',
|
|
|
|
|
'help': 'ayuda',
|
|
|
|
|
'info': 'ayuda',
|
|
|
|
|
'?': 'ayuda',
|
|
|
|
|
'config': 'configurar',
|
|
|
|
|
'configurar': 'configurar',
|
|
|
|
|
'web': 'web'
|
|
|
|
|
};
|
|
|
|
|
const action = ACTION_ALIASES[rawAction] || rawAction;
|
|
|
|
|
|
|
|
|
|
// Casos explícitos considerados éxito
|
|
|
|
|
|