@nextxai/cli 0.1.1 → 0.3.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/CHANGELOG.md +19 -1
- package/dist/ai/client.js +32 -10
- package/dist/ai/local.js +286 -0
- package/dist/ai/models.js +87 -0
- package/dist/auth/ci.js +1 -1
- package/dist/auth/mcp-oauth.js +10 -23
- package/dist/auth/session.js +7 -1
- package/dist/commands/ai.js +122 -19
- package/dist/commands/api.js +3 -2
- package/dist/commands/auth.js +7 -3
- package/dist/commands/ci-policy.js +98 -0
- package/dist/commands/ci.js +96 -0
- package/dist/commands/help.js +2 -2
- package/dist/commands/keys.js +2 -1
- package/dist/commands/mcp.js +5 -3
- package/dist/commands/model.js +106 -0
- package/dist/commands/tools.js +5 -1
- package/dist/commands/util.js +1 -1
- package/dist/commands/webhooks.js +65 -14
- package/dist/core/brand.js +6 -3
- package/dist/core/errors.js +4 -0
- package/dist/core/http.js +15 -4
- package/dist/mcp/client.js +5 -2
- package/dist/program.js +5 -0
- package/dist/repl/App.js +53 -18
- package/dist/repl/index.js +1 -1
- package/dist/repl/slash.js +11 -7
- package/package.json +2 -1
package/dist/repl/slash.js
CHANGED
|
@@ -9,22 +9,22 @@ export const SLASH = [
|
|
|
9
9
|
{ name: "rename", args: "<tên>", description: () => tr("Đặt tên hội thoại này", "Rename this conversation") },
|
|
10
10
|
{ name: "pin", description: () => tr("Ghim / bỏ ghim hội thoại", "Pin / unpin this conversation") },
|
|
11
11
|
{ name: "workspace", args: "[mã]", description: () => tr("Đổi workspace đang làm việc", "Switch workspace") },
|
|
12
|
-
{ name: "agent", args: "[mã]", description: () => tr("Chọn Agent: Trợ lý chung, Bán hàng, CSKH…", "Choose an Agent: general, sales, support…") },
|
|
12
|
+
{ name: "agent", args: "[mã]", description: () => tr("Chọn Agent: Trợ lý chung, Bán hàng, CSKH…", "Choose an Agent: general, sales, support…"), platforms: ["nextx"] },
|
|
13
13
|
{ name: "mode", args: "read|propose|auto", description: () => tr("Chế độ quyền: chỉ đọc · đề xuất · tự ghi việc thường", "Permission mode: read · propose · auto") },
|
|
14
14
|
{ name: "model", args: "[tên]", description: () => tr(`Đổi model: ${brand().aiName} hoặc model của bạn`, `Switch model: ${brand().aiName} or your own`) },
|
|
15
15
|
{ name: "attach", args: "<tệp>", description: () => tr("Đính kèm tệp Excel / CSV / ảnh / tệp chữ", "Attach an Excel / CSV / image / text file") },
|
|
16
|
-
{ name: "pending", description: () => tr("Đề xuất ghi đang chờ xác nhận", "Writes waiting for confirmation") },
|
|
16
|
+
{ name: "pending", description: () => tr("Đề xuất ghi đang chờ xác nhận", "Writes waiting for confirmation"), platforms: ["nextx"] },
|
|
17
17
|
{ name: "undo", args: "[id]", description: () => tr("Hoàn tác lần ghi gần nhất", "Undo the last write") },
|
|
18
|
-
{ name: "journal", description: () => tr("Nhật ký những gì AI đã ghi", "Journal of what the AI wrote") },
|
|
18
|
+
{ name: "journal", description: () => tr("Nhật ký những gì AI đã ghi", "Journal of what the AI wrote"), platforms: ["nextx"] },
|
|
19
19
|
{ name: "why", args: "[runId]", description: () => tr("Vì sao AI trả lời vậy (các bước, công cụ đã gọi)", "Why the AI answered that way (steps, tools)") },
|
|
20
20
|
{ name: "memory", description: () => tr("AI đang nhớ gì về công ty — sửa, khoá, quên", "What the AI remembers — edit, lock, forget") },
|
|
21
21
|
{ name: "schedule", args: '"câu" daily 08:00', description: () => tr("Lên lịch một câu hỏi chạy hằng ngày / tuần / tháng", "Schedule a question daily / weekly / monthly") },
|
|
22
|
-
{ name: "library", description: () => tr("Ảnh, tài liệu, tệp AI đã tạo", "Images, documents and files the AI produced") },
|
|
22
|
+
{ name: "library", description: () => tr("Ảnh, tài liệu, tệp AI đã tạo", "Images, documents and files the AI produced"), platforms: ["nextx"] },
|
|
23
23
|
{ name: "export", args: "md|json [tệp]", description: () => tr("Xuất hội thoại ra Markdown / JSON", "Export the conversation to Markdown / JSON") },
|
|
24
24
|
{ name: "tools", description: () => tr("Công cụ AI bạn đang được dùng (theo quyền thật)", "AI tools you can use (by your real permissions)") },
|
|
25
|
-
{ name: "usage", description: () => tr("Lượt AI tháng này", "AI turns this month") },
|
|
25
|
+
{ name: "usage", description: () => brand().platform === "nextx" ? tr("Lượt AI tháng này", "AI turns this month") : tr("Câu hỏi AI còn lại tuần này", "AI questions left this week") },
|
|
26
26
|
{ name: "feedback", args: "up|down", description: () => tr("Báo câu trả lời vừa rồi tốt / chưa tốt", "Rate the last answer") },
|
|
27
|
-
{ name: "support", args: "<vấn đề>", description: () => tr("Chuyển cho nhân viên hỗ trợ (mở ticket)", "Hand over to a support agent (ticket)") },
|
|
27
|
+
{ name: "support", args: "<vấn đề>", description: () => tr("Chuyển cho nhân viên hỗ trợ (mở ticket)", "Hand over to a support agent (ticket)"), platforms: ["nextx"] },
|
|
28
28
|
{ name: "status", description: () => tr("Tài khoản, workspace, môi trường, phiên bản", "Account, workspace, environment, version") },
|
|
29
29
|
{ name: "doctor", description: () => tr("Kiểm kết nối, đồng hồ, token, gói", "Check connectivity, clock, token, plan") },
|
|
30
30
|
{ name: "config", args: "[khoá giá_trị]", description: () => tr("Cài đặt: ngôn ngữ, màu, thông báo cập nhật", "Settings: language, color, update notices") },
|
|
@@ -47,7 +47,11 @@ export const SHORTCUTS = [
|
|
|
47
47
|
{ keys: "Ctrl+L", description: () => tr("Xoá màn", "Clear screen") },
|
|
48
48
|
{ keys: "Ctrl+C · Ctrl+D", description: () => tr("Huỷ dòng đang gõ (2 lần để thoát) · thoát", "Clear input (twice to exit) · exit") },
|
|
49
49
|
];
|
|
50
|
+
/** Commands of the current brand's backend — menu, `/help` and `help --json` all read this. */
|
|
51
|
+
export function slashCommands() {
|
|
52
|
+
return SLASH.filter((s) => !s.platforms || s.platforms.includes(brand().platform));
|
|
53
|
+
}
|
|
50
54
|
export function matchSlash(prefix) {
|
|
51
55
|
const p = prefix.replace(/^\//, "").toLowerCase();
|
|
52
|
-
return
|
|
56
|
+
return slashCommands().filter((s) => s.name.startsWith(p));
|
|
53
57
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextxai/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "NextX in your terminal: chat with NextX AI on your workspace data, call the API, manage keys and webhooks",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nextx",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"test": "tsx --test test/*.test.ts"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
+
"@anthropic-ai/sdk": "0.134.0",
|
|
44
45
|
"commander": "14.0.3",
|
|
45
46
|
"ink": "6.3.1",
|
|
46
47
|
"ink-spinner": "5.0.0",
|