@corbat-tech/coco 2.5.0 → 2.5.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.
- package/dist/cli/index.js +18 -27
- package/dist/cli/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -43267,18 +43267,21 @@ var INTENT_PATTERNS = {
|
|
|
43267
43267
|
/run\s+(the\s+)?(complete|build)\s+phase/i
|
|
43268
43268
|
],
|
|
43269
43269
|
// Task
|
|
43270
|
+
// NOTE: patterns must require an explicit task ID (number or code like "AUTH-001")
|
|
43271
|
+
// to avoid false-positive matches on natural language like "implementa la tarea de X".
|
|
43272
|
+
// Generic phrases like "do the task" or "haz la tarea" intentionally omitted.
|
|
43270
43273
|
task: [
|
|
43271
|
-
// Spanish
|
|
43272
|
-
/^(haz|
|
|
43273
|
-
/^(trabaja\s+en
|
|
43274
|
-
/^(ejecuta|execute)\s+(la\s+)?tarea/i,
|
|
43275
|
-
/completa\s+(la\s+)?tarea/i,
|
|
43274
|
+
// Spanish — ID required
|
|
43275
|
+
/^(haz|ejecuta|completa)\s+(la\s+)?tarea\s+#?[a-zA-Z0-9][a-zA-Z0-9_-]*/i,
|
|
43276
|
+
/^(trabaja\s+en)\s+(la\s+)?tarea\s+#?[a-zA-Z0-9][a-zA-Z0-9_-]*/i,
|
|
43276
43277
|
/marcar\s+tarea\s+como\s+(hecha|completada)/i,
|
|
43277
|
-
// English
|
|
43278
|
-
/^(do|complete|finish)\s+(the\s+)?task
|
|
43279
|
-
|
|
43278
|
+
// English — ID required
|
|
43279
|
+
/^(do|complete|finish|run)\s+(the\s+)?task\s+#?[a-zA-Z0-9][a-zA-Z0-9_-]*/i,
|
|
43280
|
+
/^work\s+on\s+(the\s+)?task\s+#?[a-zA-Z0-9][a-zA-Z0-9_-]*/i,
|
|
43280
43281
|
/mark\s+task\s+as\s+(done|complete)/i,
|
|
43281
|
-
|
|
43282
|
+
// Explicit task reference with ID (e.g. "task 3", "task AUTH-001")
|
|
43283
|
+
/^task\s+#?[a-zA-Z0-9][a-zA-Z0-9_-]*/i,
|
|
43284
|
+
/^tarea\s+#?[a-zA-Z0-9][a-zA-Z0-9_-]*/i
|
|
43282
43285
|
],
|
|
43283
43286
|
// Init
|
|
43284
43287
|
init: [
|
|
@@ -43393,8 +43396,8 @@ var INTENT_PATTERNS = {
|
|
|
43393
43396
|
var ENTITY_PATTERNS = {
|
|
43394
43397
|
/** Extract sprint number */
|
|
43395
43398
|
sprint: /(?:sprint|s)\s*(?:number|num|n)?\s*[:#]?\s*(\d+)/i,
|
|
43396
|
-
/** Extract task ID */
|
|
43397
|
-
taskId: /(?:task|tarea)\s*(?:id)?\s
|
|
43399
|
+
/** Extract task ID — requires at least 2 chars to avoid grabbing prepositions like "de" */
|
|
43400
|
+
taskId: /(?:task|tarea)\s*(?:id|#)?\s*:?\s*(\d+|[a-zA-Z][a-zA-Z0-9_-]{1,})/i,
|
|
43398
43401
|
/** Extract project name */
|
|
43399
43402
|
projectName: /(?:project|proyecto)\s*(?:name|nombre)?\s*[:\s]+([a-zA-Z0-9_-]+)/i,
|
|
43400
43403
|
/** Extract flags like --dry-run, --yes */
|
|
@@ -43404,9 +43407,7 @@ function calculateConfidenceBoost(input) {
|
|
|
43404
43407
|
if (input.length < 20) {
|
|
43405
43408
|
boost += 0.1;
|
|
43406
43409
|
}
|
|
43407
|
-
if (/^(haz|
|
|
43408
|
-
input
|
|
43409
|
-
)) {
|
|
43410
|
+
if (/^(haz|genera|construye|ejecuta|inicializa|build|run|start|open|exec)\b/i.test(input)) {
|
|
43410
43411
|
boost += 0.15;
|
|
43411
43412
|
}
|
|
43412
43413
|
if (/(converge|orchestrate|complete|output|plan|build|init|ship|release|publish|open|exec)/i.test(
|
|
@@ -43430,7 +43431,8 @@ var DEFAULT_INTENT_CONFIG = {
|
|
|
43430
43431
|
autoExecute: false,
|
|
43431
43432
|
autoExecuteThreshold: CONFIDENCE["HIGH"],
|
|
43432
43433
|
alwaysConfirm: ["init", "build", "output", "status"],
|
|
43433
|
-
|
|
43434
|
+
// exit always runs immediately — no confirmation dialog
|
|
43435
|
+
autoExecutePreferences: { exit: true }
|
|
43434
43436
|
};
|
|
43435
43437
|
function createIntentRecognizer(config = {}) {
|
|
43436
43438
|
const fullConfig = { ...DEFAULT_INTENT_CONFIG, ...config };
|
|
@@ -43507,18 +43509,7 @@ function createIntentRecognizer(config = {}) {
|
|
|
43507
43509
|
raw: input
|
|
43508
43510
|
};
|
|
43509
43511
|
}
|
|
43510
|
-
const intentTypes = [
|
|
43511
|
-
"plan",
|
|
43512
|
-
"build",
|
|
43513
|
-
"task",
|
|
43514
|
-
"init",
|
|
43515
|
-
"output",
|
|
43516
|
-
"status",
|
|
43517
|
-
"trust",
|
|
43518
|
-
"ship",
|
|
43519
|
-
"help",
|
|
43520
|
-
"exit"
|
|
43521
|
-
];
|
|
43512
|
+
const intentTypes = ["status", "trust", "help", "exit"];
|
|
43522
43513
|
let bestMatch = null;
|
|
43523
43514
|
for (const type of intentTypes) {
|
|
43524
43515
|
const match = matchIntent(trimmedInput, type);
|