@mrtrinhvn/ag-kit 1.4.0 → 1.4.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/README.md +4 -0
- package/bin/cli.js +47 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,6 +21,9 @@ npx @mrtrinhvn/ag-kit@latest brain
|
|
|
21
21
|
|
|
22
22
|
# 3. Tra cứu Vector Memory (Xem các node đã lưu)
|
|
23
23
|
npx @mrtrinhvn/ag-kit@latest memory
|
|
24
|
+
|
|
25
|
+
# 4. Kiểm tra cửa ngõ IDE, Telegram Bot (Dành cho project dùng bot)
|
|
26
|
+
npx @mrtrinhvn/ag-kit@latest gateway
|
|
24
27
|
```
|
|
25
28
|
|
|
26
29
|
---
|
|
@@ -33,6 +36,7 @@ npx @mrtrinhvn/ag-kit@latest memory
|
|
|
33
36
|
| `ag-kit init` | **Khởi tạo** | Cấy ghép toàn bộ tủy não `.agent` vào dự án trắng. |
|
|
34
37
|
| `ag-kit brain` | **Bộ Não** | Tự động gọi `brain_builder.py` để quét Codebase, trích xuất Vector Memory và viết Báo cáo Nhận thức `summary.md`. |
|
|
35
38
|
| `ag-kit memory` | **Ký ức** | Hiển thị các Mảnh ký ức (Hot/Cold Nodes) đang được lưu trong Không gian Vector `graph.db`. |
|
|
39
|
+
| `ag-kit gateway` | **Bot Test** | (Tùy chọn) Quét cổng CDP (IDE), Ollama và Telegram Bot Token cho các dự án dùng Agentic bot. |
|
|
36
40
|
| `ag-kit update` | **Cập nhật** | Nâng cấp Agents/Skills/Workflows mới nhất từ NPM mà không làm mất dữ liệu Ký ức hoặc Knowledge của dự án. |
|
|
37
41
|
| `ag-kit status` | **Trạng thái** | Hiển thị phiên bản Tool và kiểm tra xem Bộ Não (`summary.md`) đã được hình thành chưa. |
|
|
38
42
|
|
package/bin/cli.js
CHANGED
|
@@ -120,6 +120,52 @@ program.command('memory')
|
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
|
|
123
|
+
program.command('gateway')
|
|
124
|
+
.description('Kiểm tra trạng thái Agentic Gateway (IDE, Ollama, Telegram)')
|
|
125
|
+
.action(() => {
|
|
126
|
+
console.log('\x1b[36m🤖 Đang kiểm tra hệ sinh thái Agentic Gateway...\x1b[0m');
|
|
127
|
+
if (!fs.existsSync(TARGET_AGENT_DIR)) {
|
|
128
|
+
console.log('\x1b[31m❌ Chưa cấy ghép .agent.\x1b[0m');
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
const envPath = path.join(process.cwd(), '.env');
|
|
132
|
+
let ports = [9555, 9222];
|
|
133
|
+
if (fs.existsSync(envPath)) {
|
|
134
|
+
const match = fs.readFileSync(envPath, 'utf-8').match(/CDP_PORT=(\d+)/);
|
|
135
|
+
if (match) ports.unshift(parseInt(match[1]));
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
let cdpOk = false;
|
|
139
|
+
for (const port of ports) {
|
|
140
|
+
try {
|
|
141
|
+
execSync(`curl -s --max-time 2 http://127.0.0.1:${port}/json/version`, { stdio: 'ignore' });
|
|
142
|
+
cdpOk = true;
|
|
143
|
+
console.log(`\x1b[32m✅ IDE CDP: Phát hiện tại cổng ${port}\x1b[0m`);
|
|
144
|
+
break;
|
|
145
|
+
} catch (e) {}
|
|
146
|
+
}
|
|
147
|
+
if (!cdpOk) console.log(`\x1b[31m❌ IDE CDP: Không tìm thấy IDE đang chạy ở các cổng: ${ports.join(', ')}\x1b[0m`);
|
|
148
|
+
|
|
149
|
+
try {
|
|
150
|
+
execSync('ollama --version', { stdio: 'ignore' });
|
|
151
|
+
console.log('\x1b[32m✅ Ollama: Đã cài đặt\x1b[0m');
|
|
152
|
+
try {
|
|
153
|
+
execSync('curl -s --max-time 2 http://127.0.0.1:11434/api/tags', { stdio: 'ignore' });
|
|
154
|
+
console.log('\x1b[32m✅ Ollama Service: Online\x1b[0m');
|
|
155
|
+
} catch (e) {
|
|
156
|
+
console.log('\x1b[31m❌ Ollama Service: Offline\x1b[0m');
|
|
157
|
+
}
|
|
158
|
+
} catch(e) {
|
|
159
|
+
console.log('\x1b[33m⚠️ Ollama: Chưa cài đặt.\x1b[0m');
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (fs.existsSync(envPath) && fs.readFileSync(envPath, 'utf-8').includes('TELEGRAM_BOT_TOKEN=')) {
|
|
163
|
+
console.log('\x1b[32m✅ Telegram Token: Có trong .env\x1b[0m');
|
|
164
|
+
} else {
|
|
165
|
+
console.log('\x1b[33m⚠️ Telegram Token: Chưa cấu hình\x1b[0m');
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
|
|
123
169
|
program.command('status')
|
|
124
170
|
.description('Xem trạng thái cài đặt')
|
|
125
171
|
.action(() => {
|
|
@@ -166,6 +212,7 @@ async function runInteractiveMenu() {
|
|
|
166
212
|
const choices = hasAgent ? [
|
|
167
213
|
{ name: `🧠 Xây dựng / Cập nhật Bộ Não (build brain) - Thu thập Context`, value: 'brain' },
|
|
168
214
|
{ name: `🕸️ Khám phá Ký ức (memory) - Xem dữ liệu Vector`, value: 'memory' },
|
|
215
|
+
{ name: `🤖 Kiểm tra Agentic Gateway (gateway) - Test IDE/Bot`, value: 'gateway' },
|
|
169
216
|
{ name: `🔄 Nâng cấp Kiến thức (update) ${updateTag}`, value: 'update' },
|
|
170
217
|
{ name: '📊 Trạng thái (status) - Xem version & độ nhận thức', value: 'status' },
|
|
171
218
|
new inquirer.Separator(),
|