@nextxai/cli 0.3.9 → 0.3.10

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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.10
4
+
5
+ - AI usage now shows questions per week instead of turns per month.
6
+
3
7
  ## 0.3.9
4
8
 
5
9
  - The assistant now answers with the commands of the CLI you are using.
@@ -575,7 +575,7 @@ export function registerAi(program) {
575
575
  const list = await get("/ai/agents");
576
576
  emit(list, () => info(table(["Code", tr("Tên", "Name"), tr("Trạng thái", "Status"), tr("Mô tả", "Description")], list.map((a) => [a.code, a.name, a.status === "available" ? c.green(a.status) : c.dim(`${a.status}${a.requiredPlanName ? ` (${a.requiredPlanName})` : ""}`), a.description.slice(0, 60)]))));
577
577
  });
578
- ai.command("usage").description(tr("lượt AI tháng này", "AI turns this month"))
578
+ ai.command("usage").description(tr("câu AI tuần này", "AI questions this week"))
579
579
  .action(async () => {
580
580
  const u = await (await import("../ai/client.js")).usage();
581
581
  emit(u, () => info(`${tr("Gói", "Plan")} ${c.bold(u.planName ?? "-")} · ${tr("đã dùng", "used")} ${u.used ?? 0}${u.limit ? `/${u.limit}` : ""} · ${tr("mở lại", "resets")} ${u.resetsAt?.slice(0, 10) ?? ""}`));
@@ -63,7 +63,7 @@ export function registerAuth(program) {
63
63
  emit({ user: { name: r.userName, email: r.userEmail }, workspace: r.workspaceName, env: context().env, via: r.session.via, ai: u ?? null }, () => {
64
64
  printLogin(r);
65
65
  if (u)
66
- info(` ${tr("Gói AI", "AI plan")} ${c.bold(u.planName ?? "-")}${u.limit ? ` · ${tr("còn", "left")} ${u.remaining}/${u.limit}` : ""}`);
66
+ info(` ${tr("Gói AI", "AI plan")} ${c.bold(u.planName ?? "-")}${u.limit ? ` · ${tr("đã dùng", "used")} ${u.used}/${u.limit}` : ""}`);
67
67
  });
68
68
  });
69
69
  program
package/dist/repl/App.js CHANGED
@@ -114,7 +114,7 @@ export function App(props) {
114
114
  const profile = () => getProfile(context().profile);
115
115
  const refreshUsage = useCallback(() => {
116
116
  fetchUsage()
117
- .then((u) => setUsageText(u.limit ? `${u.planName ?? ""} · ${u.remaining}/${u.limit} ${tr("lượt", "turns")}` : (u.planName ?? "")))
117
+ .then((u) => setUsageText(u.limit ? `${u.planName ?? ""} · ${Math.max(0, u.limit - (u.used ?? 0))}/${u.limit} ${tr("câu tuần này", "questions this week")}` : (u.planName ?? "")))
118
118
  .catch(() => undefined);
119
119
  }, []);
120
120
  // ── header, once ──────────────────────────────────────────────────────────────────────────────
@@ -22,7 +22,7 @@ export const SLASH = [
22
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 [file]", 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: () => 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") },
25
+ { name: "usage", description: () => brand().platform === "nextx" ? tr("Câu AI tuần này", "AI questions this week") : 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
27
  { name: "support", args: "<problem>", 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") },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextxai/cli",
3
- "version": "0.3.9",
3
+ "version": "0.3.10",
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",