@jvittechs/jai1-cli 1.0.2 → 1.0.3
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 +66 -19
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -33,7 +33,7 @@ var NetworkError = class extends Jai1Error {
|
|
|
33
33
|
// package.json
|
|
34
34
|
var package_default = {
|
|
35
35
|
name: "@jvittechs/jai1-cli",
|
|
36
|
-
version: "1.0.
|
|
36
|
+
version: "1.0.3",
|
|
37
37
|
description: "A unified CLI tool for JV-IT TECHS developers to manage Jai1 Framework. Please contact TeamAI for usage instructions.",
|
|
38
38
|
type: "module",
|
|
39
39
|
bin: {
|
|
@@ -969,24 +969,24 @@ trigger: ${trigger}
|
|
|
969
969
|
name: "OpenCode",
|
|
970
970
|
icon: "\u{1F4BB}",
|
|
971
971
|
basePath: ".opencode",
|
|
972
|
-
rulesPath:
|
|
973
|
-
|
|
974
|
-
|
|
972
|
+
rulesPath: null,
|
|
973
|
+
// OpenCode uses AGENTS.md for rules
|
|
974
|
+
workflowsPath: null,
|
|
975
|
+
commandsPath: "command",
|
|
976
|
+
// Note: singular "command" not "commands"
|
|
975
977
|
fileExtension: ".md",
|
|
976
978
|
generateFrontmatter: (opts) => {
|
|
977
|
-
|
|
978
|
-
if (opts.
|
|
979
|
-
|
|
980
|
-
} else if (opts.alwaysApply) {
|
|
981
|
-
trigger = "always_on";
|
|
982
|
-
} else if (opts.globs && opts.globs.length > 0) {
|
|
983
|
-
trigger = opts.globs[0];
|
|
984
|
-
} else {
|
|
985
|
-
trigger = "always_on";
|
|
979
|
+
const lines = ["---"];
|
|
980
|
+
if (opts.description) {
|
|
981
|
+
lines.push(`description: ${opts.description}`);
|
|
986
982
|
}
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
983
|
+
const agent = opts.agent ?? "code";
|
|
984
|
+
lines.push(`agent: ${agent}`);
|
|
985
|
+
if (opts.model) {
|
|
986
|
+
lines.push(`model: ${opts.model}`);
|
|
987
|
+
}
|
|
988
|
+
lines.push("---");
|
|
989
|
+
return lines.join("\n");
|
|
990
990
|
}
|
|
991
991
|
}
|
|
992
992
|
};
|
|
@@ -1031,7 +1031,8 @@ var MigrateIdeService = class {
|
|
|
1031
1031
|
}
|
|
1032
1032
|
const files = await fs4.readdir(presetDir);
|
|
1033
1033
|
for (const file of files) {
|
|
1034
|
-
if (!file.endsWith(".mdc")) continue;
|
|
1034
|
+
if (!file.endsWith(".md") && !file.endsWith(".mdc")) continue;
|
|
1035
|
+
if (file === "preset.json") continue;
|
|
1035
1036
|
const filepath = path.join(presetDir, file);
|
|
1036
1037
|
const stat = await fs4.stat(filepath);
|
|
1037
1038
|
if (!stat.isFile()) continue;
|
|
@@ -1042,7 +1043,7 @@ var MigrateIdeService = class {
|
|
|
1042
1043
|
frontmatter = data;
|
|
1043
1044
|
} catch {
|
|
1044
1045
|
}
|
|
1045
|
-
const name = path.basename(file, ".mdc");
|
|
1046
|
+
const name = file.endsWith(".mdc") ? path.basename(file, ".mdc") : path.basename(file, ".md");
|
|
1046
1047
|
const trigger = this.extractTrigger(frontmatter);
|
|
1047
1048
|
const alwaysApply = this.isAlwaysTrigger(trigger);
|
|
1048
1049
|
items.push({
|
|
@@ -3355,6 +3356,19 @@ var IDE_FORMATS = {
|
|
|
3355
3356
|
supportsReference: false,
|
|
3356
3357
|
dependencies: ["agentsmd"]
|
|
3357
3358
|
// Gemini requires AGENTS.md
|
|
3359
|
+
},
|
|
3360
|
+
opencode: {
|
|
3361
|
+
id: "opencode",
|
|
3362
|
+
name: "OpenCode",
|
|
3363
|
+
description: "OpenCode (AGENTS.md + .opencode/command/)",
|
|
3364
|
+
rulesPath: ".",
|
|
3365
|
+
// Uses AGENTS.md
|
|
3366
|
+
workflowsPath: ".opencode/command",
|
|
3367
|
+
fileExtension: ".md",
|
|
3368
|
+
metadataFormat: "yaml-frontmatter",
|
|
3369
|
+
supportsReference: true,
|
|
3370
|
+
dependencies: ["agentsmd"]
|
|
3371
|
+
// OpenCode requires AGENTS.md for rules
|
|
3358
3372
|
}
|
|
3359
3373
|
};
|
|
3360
3374
|
|
|
@@ -3405,6 +3419,20 @@ var IdeDetectionService = class {
|
|
|
3405
3419
|
detection.confidence = exists ? "high" : "low";
|
|
3406
3420
|
return detection;
|
|
3407
3421
|
}
|
|
3422
|
+
if (ideId === "opencode") {
|
|
3423
|
+
const hasAgents = await this.pathExists("AGENTS.md");
|
|
3424
|
+
const commandPath = join4(this.projectPath, ".opencode/command");
|
|
3425
|
+
const hasCommands = await this.pathExists(commandPath);
|
|
3426
|
+
detection.hasRules = hasAgents;
|
|
3427
|
+
detection.ruleCount = hasAgents ? 1 : 0;
|
|
3428
|
+
if (hasCommands) {
|
|
3429
|
+
detection.hasWorkflows = true;
|
|
3430
|
+
detection.workflowCount = await this.countFiles(commandPath, ".md");
|
|
3431
|
+
}
|
|
3432
|
+
detection.detected = hasAgents || hasCommands && detection.workflowCount > 0;
|
|
3433
|
+
detection.confidence = detection.detected ? hasAgents && hasCommands ? "high" : "medium" : "low";
|
|
3434
|
+
return detection;
|
|
3435
|
+
}
|
|
3408
3436
|
const rulesPath = join4(this.projectPath, format.rulesPath);
|
|
3409
3437
|
const rulesExist = await this.pathExists(rulesPath);
|
|
3410
3438
|
if (rulesExist) {
|
|
@@ -3480,6 +3508,13 @@ var IdeDetectionService = class {
|
|
|
3480
3508
|
if (await this.pathExists("GEMINI.md")) {
|
|
3481
3509
|
detected.push(ideId);
|
|
3482
3510
|
}
|
|
3511
|
+
} else if (ideId === "opencode") {
|
|
3512
|
+
const hasAgents = await this.pathExists("AGENTS.md");
|
|
3513
|
+
const commandPath = join4(this.projectPath, ".opencode/command");
|
|
3514
|
+
const hasCommands = await this.pathExists(commandPath);
|
|
3515
|
+
if (hasAgents || hasCommands) {
|
|
3516
|
+
detected.push(ideId);
|
|
3517
|
+
}
|
|
3483
3518
|
} else {
|
|
3484
3519
|
const rulesPath = join4(this.projectPath, format.rulesPath);
|
|
3485
3520
|
if (await this.pathExists(rulesPath)) {
|
|
@@ -3573,6 +3608,15 @@ var IdeDetectionService = class {
|
|
|
3573
3608
|
priority: "high"
|
|
3574
3609
|
});
|
|
3575
3610
|
}
|
|
3611
|
+
const hasOpenCodeConfig = await this.pathExists(join4(this.projectPath, ".opencode"));
|
|
3612
|
+
if (hasOpenCodeConfig) {
|
|
3613
|
+
suggestions.push({
|
|
3614
|
+
ideId: "opencode",
|
|
3615
|
+
name: "OpenCode",
|
|
3616
|
+
reason: ".opencode directory detected",
|
|
3617
|
+
priority: "high"
|
|
3618
|
+
});
|
|
3619
|
+
}
|
|
3576
3620
|
return suggestions;
|
|
3577
3621
|
}
|
|
3578
3622
|
};
|
|
@@ -3624,6 +3668,8 @@ async function runStatus(options) {
|
|
|
3624
3668
|
console.log(` Location: AGENTS.md`);
|
|
3625
3669
|
} else if (ide.id === "gemini") {
|
|
3626
3670
|
console.log(` Location: GEMINI.md`);
|
|
3671
|
+
} else if (ide.id === "opencode") {
|
|
3672
|
+
console.log(` Location: AGENTS.md + .opencode/command/`);
|
|
3627
3673
|
} else {
|
|
3628
3674
|
console.log(` Location: ${format.rulesPath}/`);
|
|
3629
3675
|
}
|
|
@@ -11645,7 +11691,8 @@ function createKitCreateCommand() {
|
|
|
11645
11691
|
{ name: "Cursor", value: "cursor" },
|
|
11646
11692
|
{ name: "Windsurf", value: "windsurf" },
|
|
11647
11693
|
{ name: "Claude Code", value: "claude-code" },
|
|
11648
|
-
{ name: "Antigravity", value: "antigravity" }
|
|
11694
|
+
{ name: "Antigravity", value: "antigravity" },
|
|
11695
|
+
{ name: "OpenCode", value: "opencode" }
|
|
11649
11696
|
];
|
|
11650
11697
|
let selectedIdes = [];
|
|
11651
11698
|
if (isAutoMode) {
|