@noobdemon/noob-cli 1.10.19 → 1.10.20

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/agent.js +11 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noobdemon/noob-cli",
3
- "version": "1.10.19",
3
+ "version": "1.10.20",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/agent.js CHANGED
@@ -86,17 +86,21 @@ Follow this pattern exactly. Your very first response to a task that needs the f
86
86
  // LOW/MEDIUM = model skip thinking cho vấn đề đơn → nhanh hơn nhiều.
87
87
  const LOW_PATTERNS = [
88
88
  /^(list|ls|dir)\s/i,
89
- /^(xem|hiện|đọc|read)\s+(file|thư mục|folder)/i,
90
- /^(tìm|find|grep|search)\s+.{0,30}$/i,
91
- /^(có|is|are|was|were)\s+.+\?$/i,
89
+ /^@/, // @file reference — typically a quick read
90
+ /^(xem|hiện|show|display|liệt kê)\s/i,
91
+ /^(đọc|read)\s+\S+/i,
92
+ /^(tìm|find|grep|search)\s/i,
93
+ /^(có|is|are|was|were|what|where|how|why|who|which)\s+.+\?$/i,
94
+ /^(giải thích|explain)\s/i,
92
95
  /^(version|phiên bản)\s*\??$/i,
93
- /^(help|trợ giúp|help)\s*$/i,
96
+ /^(help|trợ giúp)\s*$/i,
94
97
  /^(cwd|thư mục hiện tại)\s*$/i,
95
98
  /^(status|trạng thái)\s*$/i,
96
99
  /^(tokens?|token)\s*$/i,
97
100
  /^(memory|noob\.md)\s*$/i,
98
101
  /^(logout|đăng xuất)\s*$/i,
99
- /^@/, // @file reference — typically a quick read
102
+ /^(hello|hi|chào|xin chào)\s*$/i,
103
+ /^(cảm ơn|cám ơn|thanks)\s*$/i,
100
104
  ];
101
105
  const MEDIUM_PATTERNS = [
102
106
  /^(edit|sửa|fix|thay đổi)\s/i,
@@ -122,20 +126,11 @@ const HIGH_PATTERNS = [
122
126
  /(test|kiểm chứng)\s+(toàn bộ|all|comprehensive|end.to.end)/i,
123
127
  /(tạo|create|write)\s+(noob\.md|SKILL|skill|workflow)/i,
124
128
  /(ghi|write)\s+.+\s+(vào|into|to)\s+.+/i, // write X into Y — multi-step
125
- /\b(ultra|goal|workflow)\b/i,
129
+ /\b(ultra|workflow)\b/i,
126
130
  ];
127
131
 
128
132
  export function classifyEffort(userMessage) {
129
- const msg = (userMessage || "").trim();
130
- if (!msg) return "medium";
131
- // Kiểm high TRƯỚC (nhiều pattern hơn, ưu tiên)
132
- for (const rx of HIGH_PATTERNS) if (rx.test(msg)) return "high";
133
- // Kiểm low TRƯỚC medium — các thao tác đọc/list đơn nên ưu tiên low
134
- for (const rx of LOW_PATTERNS) if (rx.test(msg)) return "low";
135
- // Kiểm medium
136
- for (const rx of MEDIUM_PATTERNS) if (rx.test(msg)) return "medium";
137
- // Mặc định: message dài (>200 chars) → medium, ngắn → low
138
- return msg.length > 200 ? "medium" : "low";
133
+ return "high";
139
134
  }
140
135
 
141
136
  // Số bước tool tối đa cho một lượt. Đặt rất cao theo yêu cầu người dùng: task