@jvittechs/j 1.0.52 → 1.0.54

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.js CHANGED
@@ -149,7 +149,7 @@ import { basename as basename5 } from "path";
149
149
  // package.json
150
150
  var package_default = {
151
151
  name: "@jvittechs/j",
152
- version: "1.0.52",
152
+ version: "1.0.54",
153
153
  description: "A unified CLI tool for JV-IT TECHS developers to manage Jai1 Framework. Supports both `j` and `jai1` commands. Please contact TeamAI for usage instructions.",
154
154
  type: "module",
155
155
  bin: {
@@ -10972,7 +10972,12 @@ async function handleWatch(address, options) {
10972
10972
  process.exit(1);
10973
10973
  }
10974
10974
  const intervalSec = Math.max(5, parseInt(options.interval, 10) || 15);
10975
- const timeoutSec = options.timeout ? parseInt(options.timeout, 10) : void 0;
10975
+ const DEFAULT_TIMEOUT = 300;
10976
+ const MAX_TIMEOUT = 1800;
10977
+ const timeoutSec = Math.min(
10978
+ options.timeout ? parseInt(options.timeout, 10) || DEFAULT_TIMEOUT : DEFAULT_TIMEOUT,
10979
+ MAX_TIMEOUT
10980
+ );
10976
10981
  const api = new TempMailApiService(config);
10977
10982
  const seenIds = /* @__PURE__ */ new Set();
10978
10983
  let pollCount = 0;
@@ -10980,7 +10985,7 @@ async function handleWatch(address, options) {
10980
10985
  if (!options.json) {
10981
10986
  console.log(chalk25.bold.cyan(`\u{1F440} Watching inbox: ${address}`));
10982
10987
  console.log(chalk25.dim(
10983
- ` Polling every ${intervalSec}s` + (timeoutSec ? ` \xB7 timeout ${timeoutSec}s` : "") + (options.keep ? " \xB7 keep watching" : " \xB7 stops after first email") + ` \xB7 Ctrl+C to stop
10988
+ ` Polling every ${intervalSec}s \xB7 timeout ${timeoutSec}s` + (options.keep ? " \xB7 keep watching" : " \xB7 stops after first email") + ` \xB7 Ctrl+C to stop
10984
10989
  `
10985
10990
  ));
10986
10991
  }
@@ -11048,12 +11053,12 @@ async function handleWatch(address, options) {
11048
11053
  });
11049
11054
  }
11050
11055
  function createMailWatchCommand() {
11051
- return new Command52("watch").description("L\u1EAFng nghe email m\u1EDBi (polling)").argument("<address>", "\u0110\u1ECBa ch\u1EC9 email c\u1EA7n theo d\xF5i").option("-i, --interval <seconds>", "Kho\u1EA3ng th\u1EDDi gian poll (gi\xE2y, m\u1EB7c \u0111\u1ECBnh: 15)", "15").option("-t, --timeout <seconds>", "D\u1EEBng sau N gi\xE2y (m\u1EB7c \u0111\u1ECBnh: ch\u1EA1y m\xE3i)").option("-k, --keep", "Ti\u1EBFp t\u1EE5c watch sau khi nh\u1EADn \u0111\u01B0\u1EE3c email (m\u1EB7c \u0111\u1ECBnh: d\u1EEBng sau email \u0111\u1EA7u ti\xEAn)").option("-j, --json", "Output s\u1EF1 ki\u1EC7n email m\u1EDBi d\u1EA1ng JSON (m\u1ED7i d\xF2ng 1 event)").addHelpText("after", `
11056
+ return new Command52("watch").description("L\u1EAFng nghe email m\u1EDBi (polling)").argument("<address>", "\u0110\u1ECBa ch\u1EC9 email c\u1EA7n theo d\xF5i").option("-i, --interval <seconds>", "Kho\u1EA3ng th\u1EDDi gian poll (gi\xE2y, m\u1EB7c \u0111\u1ECBnh: 15)", "15").option("-t, --timeout <seconds>", "D\u1EEBng sau N gi\xE2y (m\u1EB7c \u0111\u1ECBnh: 300s / 5 ph\xFAt, t\u1ED1i \u0111a: 1800s / 30 ph\xFAt)").option("-k, --keep", "Ti\u1EBFp t\u1EE5c watch sau khi nh\u1EADn \u0111\u01B0\u1EE3c email (m\u1EB7c \u0111\u1ECBnh: d\u1EEBng sau email \u0111\u1EA7u ti\xEAn)").option("-j, --json", "Output s\u1EF1 ki\u1EC7n email m\u1EDBi d\u1EA1ng JSON (m\u1ED7i d\xF2ng 1 event)").addHelpText("after", `
11052
11057
  Examples:
11053
- $ j dev mail watch user@dollicons.com # D\u1EEBng khi nh\u1EADn \u0111\u01B0\u1EE3c email \u0111\u1EA7u ti\xEAn
11058
+ $ j dev mail watch user@dollicons.com # D\u1EEBng khi nh\u1EADn \u0111\u01B0\u1EE3c email \u0111\u1EA7u ti\xEAn (timeout 5 ph\xFAt)
11054
11059
  $ j dev mail watch user@dollicons.com -k # Ti\u1EBFp t\u1EE5c watch
11055
11060
  $ j dev mail watch user@dollicons.com -i 30 -k
11056
- $ j dev mail watch user@dollicons.com -t 300
11061
+ $ j dev mail watch user@dollicons.com -t 600 # Timeout 10 ph\xFAt (t\u1ED1i \u0111a 30 ph\xFAt)
11057
11062
  $ j dev mail watch user@dollicons.com -j | jq .
11058
11063
  `).action(async (address, options) => {
11059
11064
  await handleWatch(address, options);
@@ -11757,36 +11762,8 @@ function createTaskDepCommand() {
11757
11762
  import { Command as Command66 } from "commander";
11758
11763
  import chalk39 from "chalk";
11759
11764
  function createTaskSyncCommand() {
11760
- return new Command66("sync").description("Sync tasks via git (default: pull \u2192 push)").option("--pull", "Pull only: merge tasks from origin/jai1").option("--push", "Push only: commit and push tasks to origin/jai1").action(async (options) => {
11761
- const service = new TaskService();
11762
- const branch = service.getSyncBranch();
11763
- const doPull = options.pull || !options.pull && !options.push;
11764
- const doPush = options.push || !options.pull && !options.push;
11765
- if (doPull) {
11766
- console.log(chalk39.dim(`\u23F3 Pulling tasks from origin/${branch}...`));
11767
- try {
11768
- const result = await service.syncPull();
11769
- if (result.merged > 0) {
11770
- console.log(chalk39.green(` \u2193 ${result.merged} tasks merged`));
11771
- } else {
11772
- console.log(chalk39.dim(` \u2193 Already up to date`));
11773
- }
11774
- } catch (error) {
11775
- console.error(chalk39.red(`\u274C Pull failed: ${error instanceof Error ? error.message : String(error)}`));
11776
- process.exit(1);
11777
- }
11778
- }
11779
- if (doPush) {
11780
- console.log(chalk39.dim(`\u23F3 Pushing tasks to origin/${branch}...`));
11781
- try {
11782
- await service.syncPush();
11783
- console.log(chalk39.green(` \u2191 Tasks pushed to origin/${branch}`));
11784
- } catch (error) {
11785
- console.error(chalk39.red(`\u274C Push failed: ${error instanceof Error ? error.message : String(error)}`));
11786
- process.exit(1);
11787
- }
11788
- }
11789
- console.log(chalk39.green("\u2705 Sync complete"));
11765
+ return new Command66("sync").description("Sync tasks via git (t\u1EA1m th\u1EDDi b\u1ECB disable)").option("--pull", "Pull only: merge tasks from origin/jai1").option("--push", "Push only: commit and push tasks to origin/jai1").action(async () => {
11766
+ console.log(chalk39.yellow("\u26A0\uFE0F Ch\u1EE9c n\u0103ng `j t sync` t\u1EA1m th\u1EDDi b\u1ECB disable."));
11790
11767
  });
11791
11768
  }
11792
11769
 
@@ -14157,7 +14134,6 @@ import chalk53 from "chalk";
14157
14134
  // src/commands/skills/find.ts
14158
14135
  import { Command as Command83 } from "commander";
14159
14136
  import chalk48 from "chalk";
14160
- import Table8 from "cli-table3";
14161
14137
 
14162
14138
  // src/services/skills.service.ts
14163
14139
  import { promises as fs27 } from "fs";
@@ -14466,28 +14442,21 @@ function createSkillsFindCommand() {
14466
14442
  if (results.length === 0) {
14467
14443
  console.log(chalk48.yellow("Kh\xF4ng t\xECm th\u1EA5y skills n\xE0o tr\xEAn server."));
14468
14444
  } else {
14469
- const table = new Table8({
14470
- head: [
14471
- chalk48.cyan("T\xEAn"),
14472
- chalk48.cyan("M\xF4 t\u1EA3"),
14473
- chalk48.cyan("Version"),
14474
- chalk48.cyan("Downloads")
14475
- ],
14476
- style: { head: [], border: ["gray"] },
14477
- colWidths: [25, 40, 10, 12]
14478
- });
14445
+ console.log(chalk48.bold(`\u{1F4E6} Jai1 Server (${results.length} k\u1EBFt qu\u1EA3)
14446
+ `));
14479
14447
  for (const skill of results) {
14480
14448
  const name = skill.filepath.replace("skills/", "");
14481
- table.push([
14482
- chalk48.white(name),
14483
- chalk48.dim((skill.description || "").slice(0, 38)),
14484
- chalk48.green(skill.version || "-"),
14485
- chalk48.dim(String(skill.downloads || 0))
14486
- ]);
14449
+ const version = skill.version ? chalk48.green(`v${skill.version}`) : chalk48.dim("-");
14450
+ const downloads = chalk48.dim(`${skill.downloads || 0} downloads`);
14451
+ const desc = skill.description || "";
14452
+ const maxDesc = 120;
14453
+ const truncatedDesc = desc.length > maxDesc ? desc.slice(0, maxDesc) + "\u2026" : desc;
14454
+ console.log(` ${chalk48.bold.white(name)} ${version} \xB7 ${downloads}`);
14455
+ if (truncatedDesc) {
14456
+ console.log(` ${chalk48.dim(truncatedDesc)}`);
14457
+ }
14458
+ console.log();
14487
14459
  }
14488
- console.log(chalk48.bold(`\u{1F4E6} Jai1 Server (${results.length} k\u1EBFt qu\u1EA3)`));
14489
- console.log(table.toString());
14490
- console.log();
14491
14460
  }
14492
14461
  }
14493
14462
  if (searchNpm) {
@@ -14595,7 +14564,7 @@ function createSkillsAddCommand() {
14595
14564
  // src/commands/skills/list.ts
14596
14565
  import { Command as Command85 } from "commander";
14597
14566
  import chalk50 from "chalk";
14598
- import Table9 from "cli-table3";
14567
+ import Table8 from "cli-table3";
14599
14568
  function createSkillsListCommand() {
14600
14569
  return new Command85("list").description("List installed skills or available skills on server").option("--available", "List all skills available on Jai1 server").option("-s, --search <term>", "Search skills by name or description").action(async (options) => {
14601
14570
  const skillsService = new SkillsService();
@@ -14612,7 +14581,7 @@ function createSkillsListCommand() {
14612
14581
  console.log(chalk50.yellow("Kh\xF4ng t\xECm th\u1EA5y skills n\xE0o."));
14613
14582
  return;
14614
14583
  }
14615
- const table = new Table9({
14584
+ const table = new Table8({
14616
14585
  head: [
14617
14586
  chalk50.cyan("T\xEAn"),
14618
14587
  chalk50.cyan("M\xF4 t\u1EA3"),
@@ -14647,7 +14616,7 @@ function createSkillsListCommand() {
14647
14616
  }
14648
14617
  console.log(chalk50.bold.cyan("\u{1F6E0} Skills \u0111\xE3 c\xE0i \u0111\u1EB7t"));
14649
14618
  console.log();
14650
- const table = new Table9({
14619
+ const table = new Table8({
14651
14620
  head: [
14652
14621
  chalk50.cyan("T\xEAn"),
14653
14622
  chalk50.cyan("M\xF4 t\u1EA3"),