@jvittechs/j 1.0.33 → 1.0.35

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.33",
152
+ version: "1.0.35",
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: {
@@ -3867,6 +3867,15 @@ function showGuide(name) {
3867
3867
  console.log(` ${chalk8.cyan(`${name} ide sync`)} \u0110\u1ED3ng b\u1ED9 .jai1 content \u0111\u1EBFn IDE`);
3868
3868
  console.log(` ${chalk8.cyan(`${name} rules apply`)} C\u1EA5u h\xECnh rules cho IDE`);
3869
3869
  console.log();
3870
+ console.log(chalk8.bold("\u2501\u2501\u2501 SKILLS \u2501\u2501\u2501"));
3871
+ console.log(` ${chalk8.cyan(`${name} s find`)} ${chalk8.dim("<query>")} T\xECm skills tr\xEAn server`);
3872
+ console.log(` ${chalk8.cyan(`${name} s find`)} ${chalk8.dim("<query> --skillsh")} T\xECm tr\xEAn npm skills`);
3873
+ console.log(` ${chalk8.cyan(`${name} s add`)} ${chalk8.dim("<name>")} C\xE0i skill v\xE0o .jai1/skills/`);
3874
+ console.log(` ${chalk8.cyan(`${name} s list`)} Skills \u0111\xE3 c\xE0i`);
3875
+ console.log(` ${chalk8.cyan(`${name} s list`)} ${chalk8.dim("--available")} Skills tr\xEAn server`);
3876
+ console.log(` ${chalk8.cyan(`${name} s info`)} ${chalk8.dim("<name>")} Chi ti\u1EBFt skill`);
3877
+ console.log(` ${chalk8.cyan(`${name} s sync`)} ${chalk8.dim("--all -y")} Sync sang t\u1EA5t c\u1EA3 IDEs`);
3878
+ console.log();
3870
3879
  console.log(chalk8.bold("\u2501\u2501\u2501 TASK MANAGEMENT \u2501\u2501\u2501"));
3871
3880
  console.log(` ${chalk8.cyan(`${name} t add`)} ${chalk8.dim('"title"')} ${chalk8.dim("[-p 0-3] [-P parent]")} T\u1EA1o task`);
3872
3881
  console.log(` ${chalk8.cyan(`${name} t list`)} ${chalk8.dim("[-s status] [-P parent]")} Li\u1EC7t k\xEA tasks`);
@@ -13129,11 +13138,11 @@ import { execFile } from "child_process";
13129
13138
  import { promisify } from "util";
13130
13139
  var execFileAsync = promisify(execFile);
13131
13140
  var IDE_SKILL_TARGETS = [
13132
- { id: "cursor", name: "Cursor", icon: "\u{1F52E}", skillsPath: ".cursor/skills" },
13141
+ { id: "cursor", name: "Cursor", icon: "\u{1F52E}", skillsPath: ".agents/skills" },
13133
13142
  { id: "windsurf", name: "Windsurf", icon: "\u{1F3C4}", skillsPath: ".windsurf/skills" },
13134
- { id: "antigravity", name: "Antigravity", icon: "\u{1F680}", skillsPath: ".agents/skills" },
13143
+ { id: "antigravity", name: "Antigravity", icon: "\u{1F680}", skillsPath: ".agent/skills" },
13135
13144
  { id: "claudecode", name: "Claude Code", icon: "\u{1F916}", skillsPath: ".claude/skills" },
13136
- { id: "opencode", name: "OpenCode", icon: "\u{1F4BB}", skillsPath: ".opencode/skills" }
13145
+ { id: "opencode", name: "OpenCode", icon: "\u{1F4BB}", skillsPath: ".agents/skills" }
13137
13146
  ];
13138
13147
  var SkillsService = class {
13139
13148
  componentsService;
@@ -13227,30 +13236,73 @@ var SkillsService = class {
13227
13236
  }
13228
13237
  /**
13229
13238
  * Install skill via npm `skills` package (wrapper)
13230
- * Installs to .jai1/skills/ directory
13239
+ *
13240
+ * Source format: "owner/repo" or "owner/repo@skill"
13241
+ * Runs: npx skills add owner/repo [--skill name] --copy --yes
13242
+ * Then copies installed skills into .jai1/skills/
13231
13243
  */
13232
13244
  async npmSkillsAdd(source, projectRoot) {
13233
- const targetDir = join18(projectRoot, ".jai1", "skills");
13234
- await fs27.mkdir(targetDir, { recursive: true });
13245
+ const { repo, skill } = this.parseSkillshSource(source);
13246
+ const args = ["-y", "skills", "add", repo, "--copy", "-a", "universal", "-y"];
13247
+ if (skill) {
13248
+ args.push("--skill", skill);
13249
+ }
13235
13250
  try {
13236
- const { stdout } = await execFileAsync("npx", [
13237
- "-y",
13238
- "skills",
13239
- "add",
13240
- source,
13241
- "--path",
13242
- targetDir
13243
- ], {
13251
+ const { stdout } = await execFileAsync("npx", args, {
13244
13252
  timeout: 6e4,
13245
13253
  cwd: projectRoot
13246
13254
  });
13255
+ await this.copySkillshResultsToJai1(projectRoot, skill);
13247
13256
  return stdout;
13248
13257
  } catch (error) {
13249
13258
  throw new Error(
13250
- `npm skills add failed: ${error instanceof Error ? error.message : String(error)}`
13259
+ `skills.sh add failed: ${error instanceof Error ? error.message : String(error)}`
13251
13260
  );
13252
13261
  }
13253
13262
  }
13263
+ /**
13264
+ * Parse skills.sh source format: "owner/repo@skill" → { repo, skill }
13265
+ */
13266
+ parseSkillshSource(source) {
13267
+ const atIndex = source.lastIndexOf("@");
13268
+ if (atIndex > 0 && !source.substring(atIndex + 1).includes("/")) {
13269
+ return {
13270
+ repo: source.substring(0, atIndex),
13271
+ skill: source.substring(atIndex + 1)
13272
+ };
13273
+ }
13274
+ return { repo: source };
13275
+ }
13276
+ /**
13277
+ * After npx skills add, copy newly installed skills from .agents/skills/ into .jai1/skills/
13278
+ */
13279
+ async copySkillshResultsToJai1(projectRoot, specificSkill) {
13280
+ const jai1SkillsDir = join18(projectRoot, ".jai1", "skills");
13281
+ await fs27.mkdir(jai1SkillsDir, { recursive: true });
13282
+ const universalDir = join18(projectRoot, ".agents", "skills");
13283
+ try {
13284
+ const entries = await fs27.readdir(universalDir, { withFileTypes: true });
13285
+ for (const entry of entries) {
13286
+ if (!entry.isDirectory()) continue;
13287
+ if (specificSkill && entry.name !== specificSkill) continue;
13288
+ const srcSkill = join18(universalDir, entry.name);
13289
+ const skillMd = join18(srcSkill, "SKILL.md");
13290
+ try {
13291
+ await fs27.access(skillMd);
13292
+ } catch {
13293
+ continue;
13294
+ }
13295
+ const targetSkill = join18(jai1SkillsDir, entry.name);
13296
+ try {
13297
+ await fs27.access(targetSkill);
13298
+ } catch {
13299
+ await fs27.mkdir(targetSkill, { recursive: true });
13300
+ await this.copyDir(srcSkill, targetSkill);
13301
+ }
13302
+ }
13303
+ } catch {
13304
+ }
13305
+ }
13254
13306
  /**
13255
13307
  * Get available IDE skill targets
13256
13308
  */
@@ -13424,7 +13476,15 @@ function createSkillsFindCommand() {
13424
13476
  ));
13425
13477
  }
13426
13478
  }
13427
- console.log(chalk34.dim('\u{1F4A1} D\xF9ng "j skills add <t\xEAn>" \u0111\u1EC3 c\xE0i \u0111\u1EB7t'));
13479
+ if (searchServer && !searchNpm) {
13480
+ console.log(chalk34.dim('\u{1F4A1} D\xF9ng "j skills add <t\xEAn>" \u0111\u1EC3 c\xE0i \u0111\u1EB7t t\u1EEB server'));
13481
+ } else if (searchNpm && !searchServer) {
13482
+ console.log(chalk34.dim('\u{1F4A1} D\xF9ng "j skills add <owner/repo@skill> --skillsh" \u0111\u1EC3 c\xE0i \u0111\u1EB7t'));
13483
+ } else {
13484
+ console.log(chalk34.dim("\u{1F4A1} C\xE0i \u0111\u1EB7t:"));
13485
+ console.log(chalk34.dim(" Server: j skills add <t\xEAn>"));
13486
+ console.log(chalk34.dim(" Skills.sh: j skills add <owner/repo@skill> --skillsh"));
13487
+ }
13428
13488
  });
13429
13489
  }
13430
13490