@jvittechs/j 1.0.33 → 1.0.34
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 +80 -17
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
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.
|
|
152
|
+
version: "1.0.34",
|
|
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: ".
|
|
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: ".
|
|
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: ".
|
|
13145
|
+
{ id: "opencode", name: "OpenCode", icon: "\u{1F4BB}", skillsPath: ".agents/skills" }
|
|
13137
13146
|
];
|
|
13138
13147
|
var SkillsService = class {
|
|
13139
13148
|
componentsService;
|
|
@@ -13227,30 +13236,76 @@ var SkillsService = class {
|
|
|
13227
13236
|
}
|
|
13228
13237
|
/**
|
|
13229
13238
|
* Install skill via npm `skills` package (wrapper)
|
|
13230
|
-
*
|
|
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
|
|
13234
|
-
|
|
13245
|
+
const { repo, skill } = this.parseSkillshSource(source);
|
|
13246
|
+
const args = ["-y", "skills", "add", repo, "--copy", "--yes"];
|
|
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
|
-
`
|
|
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 agent dirs 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 agentDirs = [".agents/skills", ".agent/skills", ".claude/skills", ".windsurf/skills", ".cursor/skills"];
|
|
13283
|
+
for (const agentDir of agentDirs) {
|
|
13284
|
+
const fullDir = join18(projectRoot, agentDir);
|
|
13285
|
+
try {
|
|
13286
|
+
const entries = await fs27.readdir(fullDir, { withFileTypes: true });
|
|
13287
|
+
for (const entry of entries) {
|
|
13288
|
+
if (!entry.isDirectory()) continue;
|
|
13289
|
+
if (specificSkill && entry.name !== specificSkill) continue;
|
|
13290
|
+
const srcSkill = join18(fullDir, entry.name);
|
|
13291
|
+
const skillMd = join18(srcSkill, "SKILL.md");
|
|
13292
|
+
try {
|
|
13293
|
+
await fs27.access(skillMd);
|
|
13294
|
+
} catch {
|
|
13295
|
+
continue;
|
|
13296
|
+
}
|
|
13297
|
+
const targetSkill = join18(jai1SkillsDir, entry.name);
|
|
13298
|
+
try {
|
|
13299
|
+
await fs27.access(targetSkill);
|
|
13300
|
+
} catch {
|
|
13301
|
+
await fs27.mkdir(targetSkill, { recursive: true });
|
|
13302
|
+
await this.copyDir(srcSkill, targetSkill);
|
|
13303
|
+
}
|
|
13304
|
+
}
|
|
13305
|
+
} catch {
|
|
13306
|
+
}
|
|
13307
|
+
}
|
|
13308
|
+
}
|
|
13254
13309
|
/**
|
|
13255
13310
|
* Get available IDE skill targets
|
|
13256
13311
|
*/
|
|
@@ -13424,7 +13479,15 @@ function createSkillsFindCommand() {
|
|
|
13424
13479
|
));
|
|
13425
13480
|
}
|
|
13426
13481
|
}
|
|
13427
|
-
|
|
13482
|
+
if (searchServer && !searchNpm) {
|
|
13483
|
+
console.log(chalk34.dim('\u{1F4A1} D\xF9ng "j skills add <t\xEAn>" \u0111\u1EC3 c\xE0i \u0111\u1EB7t t\u1EEB server'));
|
|
13484
|
+
} else if (searchNpm && !searchServer) {
|
|
13485
|
+
console.log(chalk34.dim('\u{1F4A1} D\xF9ng "j skills add <owner/repo@skill> --skillsh" \u0111\u1EC3 c\xE0i \u0111\u1EB7t'));
|
|
13486
|
+
} else {
|
|
13487
|
+
console.log(chalk34.dim("\u{1F4A1} C\xE0i \u0111\u1EB7t:"));
|
|
13488
|
+
console.log(chalk34.dim(" Server: j skills add <t\xEAn>"));
|
|
13489
|
+
console.log(chalk34.dim(" Skills.sh: j skills add <owner/repo@skill> --skillsh"));
|
|
13490
|
+
}
|
|
13428
13491
|
});
|
|
13429
13492
|
}
|
|
13430
13493
|
|