@jvittechs/j 1.0.54 → 1.0.55

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.54",
152
+ version: "1.0.55",
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: {
@@ -11425,7 +11425,7 @@ import { Command as Command71 } from "commander";
11425
11425
  import { Command as Command58 } from "commander";
11426
11426
  import chalk31 from "chalk";
11427
11427
  function createTaskAddCommand() {
11428
- return new Command58("add").description("Add a new task").argument("<title>", "Task title").option("-p, --priority <n>", "Priority: 0=critical, 1=high, 2=medium, 3=low", "2").option("-P, --parent <parent>", "Parent: feature/xxx, plan/xxx, bug/xxx").option("-t, --tags <tags>", "Comma-separated tags").option("-j, --json", "Output JSON").action(async (title, options) => {
11428
+ return new Command58("add").description("Add a new task").argument("<title>", "Task title").option("-p, --priority <n>", "Priority: 0=critical, 1=high, 2=medium, 3=low", "2").option("-P, --parent <parent>", "Parent: feature/xxx, bug/xxx, plan/xxx, task/xxx, prd/xxx").option("-t, --tags <tags>", "Comma-separated tags").option("-j, --json", "Output JSON").action(async (title, options) => {
11429
11429
  const service = new TaskService();
11430
11430
  const priority = Number(options.priority ?? 2);
11431
11431
  if (priority < 0 || priority > 3) {
@@ -14998,9 +14998,11 @@ function getInstallCommand(packageManager2) {
14998
14998
  // src/commands/clean.ts
14999
14999
  import { Command as Command90 } from "commander";
15000
15000
  import { confirm as confirm21, select as select6 } from "@inquirer/prompts";
15001
+ import { promises as fs28 } from "fs";
15001
15002
  import { join as join21 } from "path";
15003
+ import { existsSync as existsSync4 } from "fs";
15002
15004
  function createCleanCommand() {
15003
- return new Command90("clean").description("Clean up backups, cache, and temporary files").option("-y, --yes", "Skip confirmation").option("--backups", "Clean only backup files").option("--all", "Clean all (backups + cache)").action(async (options) => {
15005
+ return new Command90("clean").description("Clean up backups, cache, IDE configs, and .jai1 directory").option("-y, --yes", "Skip confirmation").option("--backups", "Clean only backup files").option("--jai1", "Clean only .jai1/ directory").option("--ide", "Clean only IDE directories (.cursor, .windsurf, .agent, .claude, .opencode)").option("--all", "Clean all (backups + .jai1 + IDE dirs)").action(async (options) => {
15004
15006
  await handleClean(options);
15005
15007
  });
15006
15008
  }
@@ -15019,15 +15021,41 @@ async function handleClean(options) {
15019
15021
  clean: async () => {
15020
15022
  await service.clearBackups(cwd);
15021
15023
  }
15024
+ },
15025
+ {
15026
+ name: "Jai1 Config",
15027
+ description: "Jai1 framework config (.jai1/)",
15028
+ path: join21(cwd, ".jai1"),
15029
+ check: async () => {
15030
+ const exists = existsSync4(join21(cwd, ".jai1"));
15031
+ return { exists };
15032
+ },
15033
+ clean: async () => {
15034
+ await fs28.rm(join21(cwd, ".jai1"), { recursive: true, force: true });
15035
+ }
15022
15036
  }
15023
- // Future targets can be added here:
15024
- // {
15025
- // name: 'Cache',
15026
- // description: 'Downloaded component cache',
15027
- // path: join(homedir(), '.jai1', 'cache'),
15028
- // ...
15029
- // }
15030
15037
  ];
15038
+ const ideDirectories = [
15039
+ { name: "Cursor", dir: ".cursor" },
15040
+ { name: "Windsurf", dir: ".windsurf" },
15041
+ { name: "Antigravity", dir: ".agent" },
15042
+ { name: "Claude Code", dir: ".claude" },
15043
+ { name: "OpenCode", dir: ".opencode" }
15044
+ ];
15045
+ for (const ide of ideDirectories) {
15046
+ const idePath = join21(cwd, ide.dir);
15047
+ if (existsSync4(idePath)) {
15048
+ targets.push({
15049
+ name: `IDE: ${ide.name}`,
15050
+ description: `${ide.name} IDE config (${ide.dir}/)`,
15051
+ path: idePath,
15052
+ check: async () => ({ exists: true }),
15053
+ clean: async () => {
15054
+ await fs28.rm(idePath, { recursive: true, force: true });
15055
+ }
15056
+ });
15057
+ }
15058
+ }
15031
15059
  console.log("\u{1F9F9} Clean up CLI client files\n");
15032
15060
  const availableTargets = [];
15033
15061
  for (const target of targets) {
@@ -15047,6 +15075,26 @@ async function handleClean(options) {
15047
15075
  }
15048
15076
  return;
15049
15077
  }
15078
+ if (options.jai1) {
15079
+ const jai1Target = availableTargets.find(({ target }) => target.name === "Jai1 Config");
15080
+ if (jai1Target) {
15081
+ await cleanTarget(jai1Target.target, options.yes);
15082
+ } else {
15083
+ console.log("\u2728 No .jai1/ directory found.");
15084
+ }
15085
+ return;
15086
+ }
15087
+ if (options.ide) {
15088
+ const ideTargets = availableTargets.filter(({ target }) => target.name.startsWith("IDE:"));
15089
+ if (ideTargets.length === 0) {
15090
+ console.log("\u2728 No IDE directories found.");
15091
+ return;
15092
+ }
15093
+ for (const { target } of ideTargets) {
15094
+ await cleanTarget(target, options.yes);
15095
+ }
15096
+ return;
15097
+ }
15050
15098
  if (options.all) {
15051
15099
  for (const { target } of availableTargets) {
15052
15100
  await cleanTarget(target, options.yes);
@@ -16003,7 +16051,7 @@ async function handleSyncProject(options) {
16003
16051
 
16004
16052
  // src/commands/framework/info.ts
16005
16053
  import { Command as Command94 } from "commander";
16006
- import { promises as fs28 } from "fs";
16054
+ import { promises as fs29 } from "fs";
16007
16055
  import { join as join22 } from "path";
16008
16056
  import { homedir as homedir5 } from "os";
16009
16057
  function createInfoCommand() {
@@ -16055,7 +16103,7 @@ function maskKey4(key) {
16055
16103
  async function getProjectStatus2() {
16056
16104
  const projectJai1 = join22(process.cwd(), ".jai1");
16057
16105
  try {
16058
- await fs28.access(projectJai1);
16106
+ await fs29.access(projectJai1);
16059
16107
  return { exists: true, version: "Synced" };
16060
16108
  } catch {
16061
16109
  return { exists: false };
@@ -16245,9 +16293,9 @@ function createClearBackupsCommand() {
16245
16293
  // src/commands/vscode/index.ts
16246
16294
  import { Command as Command97 } from "commander";
16247
16295
  import { checkbox as checkbox9, confirm as confirm24, select as select7 } from "@inquirer/prompts";
16248
- import fs29 from "fs/promises";
16296
+ import fs30 from "fs/promises";
16249
16297
  import path12 from "path";
16250
- import { existsSync as existsSync4 } from "fs";
16298
+ import { existsSync as existsSync5 } from "fs";
16251
16299
  var PERFORMANCE_GROUPS2 = {
16252
16300
  telemetry: {
16253
16301
  name: "Telemetry",
@@ -16477,14 +16525,14 @@ async function applyGroups2(groupKeys, action) {
16477
16525
  console.log(' \u{1F4A1} Ch\u1EA1y "jai1 vscode list" \u0111\u1EC3 xem danh s\xE1ch nh\xF3m c\xF3 s\u1EB5n.');
16478
16526
  return;
16479
16527
  }
16480
- if (!existsSync4(vscodeDir)) {
16481
- await fs29.mkdir(vscodeDir, { recursive: true });
16528
+ if (!existsSync5(vscodeDir)) {
16529
+ await fs30.mkdir(vscodeDir, { recursive: true });
16482
16530
  console.log("\u{1F4C1} \u0110\xE3 t\u1EA1o th\u01B0 m\u1EE5c .vscode/");
16483
16531
  }
16484
16532
  let currentSettings = {};
16485
- if (existsSync4(settingsPath)) {
16533
+ if (existsSync5(settingsPath)) {
16486
16534
  try {
16487
- const content = await fs29.readFile(settingsPath, "utf-8");
16535
+ const content = await fs30.readFile(settingsPath, "utf-8");
16488
16536
  currentSettings = JSON.parse(content);
16489
16537
  console.log("\u{1F4C4} \u0110\xE3 \u0111\u1ECDc c\xE0i \u0111\u1EB7t hi\u1EC7n t\u1EA1i t\u1EEB settings.json");
16490
16538
  } catch {
@@ -16524,7 +16572,7 @@ async function applyGroups2(groupKeys, action) {
16524
16572
  }
16525
16573
  }
16526
16574
  }
16527
- await fs29.writeFile(settingsPath, JSON.stringify(newSettings, null, 2));
16575
+ await fs30.writeFile(settingsPath, JSON.stringify(newSettings, null, 2));
16528
16576
  console.log(`
16529
16577
  \u2705 \u0110\xE3 c\u1EADp nh\u1EADt c\xE0i \u0111\u1EB7t VSCode t\u1EA1i: ${settingsPath}`);
16530
16578
  console.log("\u{1F4A1} M\u1EB9o: Kh\u1EDFi \u0111\u1ED9ng l\u1EA1i VSCode \u0111\u1EC3 \xE1p d\u1EE5ng c\xE1c thay \u0111\u1ED5i.");
@@ -16532,7 +16580,7 @@ async function applyGroups2(groupKeys, action) {
16532
16580
  async function resetSettings2(groupKeys) {
16533
16581
  const vscodeDir = path12.join(process.cwd(), ".vscode");
16534
16582
  const settingsPath = path12.join(vscodeDir, "settings.json");
16535
- if (!existsSync4(settingsPath)) {
16583
+ if (!existsSync5(settingsPath)) {
16536
16584
  console.log("\n\u26A0\uFE0F Kh\xF4ng t\xECm th\u1EA5y file settings.json");
16537
16585
  return;
16538
16586
  }
@@ -16545,7 +16593,7 @@ async function resetSettings2(groupKeys) {
16545
16593
  return;
16546
16594
  }
16547
16595
  if (groupKeys.length === 0) {
16548
- await fs29.unlink(settingsPath);
16596
+ await fs30.unlink(settingsPath);
16549
16597
  console.log("\n\u2705 \u0110\xE3 x\xF3a file settings.json");
16550
16598
  } else {
16551
16599
  await applyGroups2(groupKeys, "disable");