@jvittechs/j 1.0.21 → 1.0.22

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
@@ -169,7 +169,7 @@ import { basename as basename4 } from "path";
169
169
  // package.json
170
170
  var package_default = {
171
171
  name: "@jvittechs/j",
172
- version: "1.0.21",
172
+ version: "1.0.22",
173
173
  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.",
174
174
  type: "module",
175
175
  bin: {
@@ -3749,27 +3749,43 @@ var IdeDetectionService = class {
3749
3749
  confidence: "low"
3750
3750
  };
3751
3751
  if (ideId === "agentsmd") {
3752
- const exists = await this.pathExists("AGENTS.md");
3752
+ const agentsPath = join5(this.projectPath, "AGENTS.md");
3753
+ const exists = await this.pathExists(agentsPath);
3753
3754
  detection.detected = exists;
3754
- detection.hasRules = exists;
3755
- detection.ruleCount = exists ? 1 : 0;
3756
- detection.confidence = exists ? "high" : "low";
3755
+ if (exists) {
3756
+ const customCount = await this.countAgentsMdCustomSections(agentsPath);
3757
+ detection.hasRules = customCount > 0;
3758
+ detection.ruleCount = customCount;
3759
+ }
3760
+ detection.confidence = exists ? detection.hasRules ? "high" : "medium" : "low";
3757
3761
  return detection;
3758
3762
  }
3759
3763
  if (ideId === "gemini") {
3760
- const exists = await this.pathExists("GEMINI.md");
3764
+ const geminiPath = join5(this.projectPath, "GEMINI.md");
3765
+ const exists = await this.pathExists(geminiPath);
3761
3766
  detection.detected = exists;
3762
- detection.hasRules = exists;
3763
- detection.ruleCount = exists ? 1 : 0;
3764
- detection.confidence = exists ? "high" : "low";
3767
+ if (exists) {
3768
+ const agentsPath = join5(this.projectPath, "AGENTS.md");
3769
+ const agentsExists = await this.pathExists(agentsPath);
3770
+ if (agentsExists) {
3771
+ const customCount = await this.countAgentsMdCustomSections(agentsPath);
3772
+ detection.hasRules = customCount > 0;
3773
+ detection.ruleCount = customCount;
3774
+ }
3775
+ }
3776
+ detection.confidence = exists ? detection.hasRules ? "high" : "medium" : "low";
3765
3777
  return detection;
3766
3778
  }
3767
3779
  if (ideId === "opencode") {
3768
- const hasAgents = await this.pathExists("AGENTS.md");
3780
+ const agentsPath = join5(this.projectPath, "AGENTS.md");
3781
+ const hasAgents = await this.pathExists(agentsPath);
3769
3782
  const commandPath = join5(this.projectPath, ".opencode/command");
3770
3783
  const hasCommands = await this.pathExists(commandPath);
3771
- detection.hasRules = hasAgents;
3772
- detection.ruleCount = hasAgents ? 1 : 0;
3784
+ if (hasAgents) {
3785
+ const customCount = await this.countAgentsMdCustomSections(agentsPath);
3786
+ detection.hasRules = customCount > 0;
3787
+ detection.ruleCount = customCount;
3788
+ }
3773
3789
  if (hasCommands) {
3774
3790
  detection.hasWorkflows = true;
3775
3791
  detection.workflowCount = await this.countFiles(commandPath, ".md");
@@ -3920,6 +3936,21 @@ var IdeDetectionService = class {
3920
3936
  return 0;
3921
3937
  }
3922
3938
  }
3939
+ /**
3940
+ * Count custom (non-jai1) sections in AGENTS.md
3941
+ * Counts H2 headings (## ) that do not contain the keyword 'jai1'
3942
+ */
3943
+ async countAgentsMdCustomSections(filePath) {
3944
+ try {
3945
+ const content = await fs8.readFile(filePath, "utf-8");
3946
+ const h2Headings = content.match(/^## .+$/gm) || [];
3947
+ return h2Headings.filter(
3948
+ (h) => !h.toLowerCase().includes(DEFAULT_RULE_KEYWORD)
3949
+ ).length;
3950
+ } catch {
3951
+ return 0;
3952
+ }
3953
+ }
3923
3954
  /**
3924
3955
  * Get IDE format by ID
3925
3956
  */