glooit 0.5.1 → 0.5.2

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/bin/glooit-linux CHANGED
Binary file
package/bin/glooit-macos CHANGED
Binary file
Binary file
@@ -3,6 +3,8 @@ export declare class AgentDistributor {
3
3
  private config;
4
4
  constructor(config: Config);
5
5
  distributeRule(rule: Rule): Promise<void>;
6
+ private getAgentName;
7
+ private getCustomPath;
6
8
  private distributeToAgent;
7
9
  private loadRuleContent;
8
10
  private extractRuleName;
@@ -1,5 +1,5 @@
1
- import type { Agent, AgentMapping } from '../types';
2
- export declare const AGENT_MAPPINGS: Record<Agent, AgentMapping>;
3
- export declare function getAgentPath(agent: Agent, name?: string): string;
4
- export declare function getAgentDirectory(agent: Agent): string | undefined;
5
- export declare function getAgentMcpPath(agent: Agent): string;
1
+ import type { AgentName, AgentMapping } from '../types';
2
+ export declare const AGENT_MAPPINGS: Record<AgentName, AgentMapping>;
3
+ export declare function getAgentPath(agent: AgentName, name?: string): string;
4
+ export declare function getAgentDirectory(agent: AgentName): string | undefined;
5
+ export declare function getAgentMcpPath(agent: AgentName): string;
@@ -1,8 +1,8 @@
1
- import type { Agent, Rule, ResolvedMcp } from '../../types';
1
+ import type { AgentName, Rule, ResolvedMcp } from '../../types';
2
2
  export interface AgentWriter {
3
3
  formatContent(content: string, rule: Rule): string;
4
4
  formatMcp?(mcp: ResolvedMcp, merge: boolean): string;
5
5
  }
6
6
  export declare class AgentWriterFactory {
7
- static createWriter(agent: Agent): AgentWriter;
7
+ static createWriter(agent: AgentName): AgentWriter;
8
8
  }
package/dist/cli/index.js CHANGED
@@ -2141,7 +2141,7 @@ var AGENT_MAPPINGS = {
2141
2141
  mcpPath: ".mcp.json"
2142
2142
  },
2143
2143
  cursor: {
2144
- path: ".cursor/rules/{name}.md",
2144
+ path: ".cursor/rules/{name}.mdc",
2145
2145
  format: "frontmatter",
2146
2146
  directory: ".cursor/rules",
2147
2147
  mcpPath: "~/.cursor/mcp.json"
@@ -2156,6 +2156,11 @@ var AGENT_MAPPINGS = {
2156
2156
  format: "markdown",
2157
2157
  directory: ".roo/rules",
2158
2158
  mcpPath: ".roo/mcp.json"
2159
+ },
2160
+ generic: {
2161
+ path: "{name}.md",
2162
+ format: "markdown",
2163
+ mcpPath: "mcp.json"
2159
2164
  }
2160
2165
  };
2161
2166
  function getAgentPath(agent, name = "global") {
@@ -2251,6 +2256,7 @@ class AgentWriterFactory {
2251
2256
  case "claude":
2252
2257
  case "codex":
2253
2258
  case "roocode":
2259
+ case "generic":
2254
2260
  return new MarkdownWriter;
2255
2261
  default:
2256
2262
  return new MarkdownWriter;
@@ -2334,25 +2340,32 @@ class AgentDistributor {
2334
2340
  await this.distributeToAgent(agent, rule, content);
2335
2341
  }
2336
2342
  }
2343
+ getAgentName(agent) {
2344
+ return typeof agent === "string" ? agent : agent.name;
2345
+ }
2346
+ getCustomPath(agent) {
2347
+ return typeof agent === "object" ? agent.to : undefined;
2348
+ }
2337
2349
  async distributeToAgent(agent, rule, content) {
2338
- const ruleName = this.extractRuleName(rule.file);
2339
- const agentPath = getAgentPath(agent, ruleName);
2340
- const targetPath = join2(rule.to, agentPath);
2341
- const agentDir = getAgentDirectory(agent);
2342
- if (agentDir) {
2343
- const fullDir = join2(rule.to, agentDir);
2344
- mkdirSync(fullDir, { recursive: true });
2350
+ const agentName = this.getAgentName(agent);
2351
+ const customPath = this.getCustomPath(agent);
2352
+ let targetPath;
2353
+ if (customPath) {
2354
+ targetPath = customPath;
2345
2355
  } else {
2346
- mkdirSync(dirname(targetPath), { recursive: true });
2356
+ const ruleName = this.extractRuleName(rule.file);
2357
+ const agentPath = getAgentPath(agentName, ruleName);
2358
+ targetPath = join2(rule.to, agentPath);
2347
2359
  }
2348
- const writer = AgentWriterFactory.createWriter(agent);
2360
+ mkdirSync(dirname(targetPath), { recursive: true });
2361
+ const writer = AgentWriterFactory.createWriter(agentName);
2349
2362
  const formattedContent = writer.formatContent(content, rule);
2350
2363
  const context = {
2351
2364
  config: this.config,
2352
2365
  rule,
2353
2366
  content: formattedContent,
2354
2367
  targetPath,
2355
- agent
2368
+ agent: agentName
2356
2369
  };
2357
2370
  const finalContent = await this.applyHooks(context);
2358
2371
  writeFileSync(targetPath, finalContent, "utf-8");
@@ -2509,6 +2522,12 @@ class GitIgnoreManager {
2509
2522
  constructor(config) {
2510
2523
  this.config = config;
2511
2524
  }
2525
+ getAgentName(agent) {
2526
+ return typeof agent === "string" ? agent : agent.name;
2527
+ }
2528
+ getCustomPath(agent) {
2529
+ return typeof agent === "object" ? agent.to : undefined;
2530
+ }
2512
2531
  async updateGitIgnore() {
2513
2532
  const paths = this.collectGeneratedPaths();
2514
2533
  if (paths.length === 0) {
@@ -2539,22 +2558,34 @@ class GitIgnoreManager {
2539
2558
  const paths = new Set;
2540
2559
  for (const rule of this.config.rules) {
2541
2560
  for (const agent of rule.targets) {
2542
- const ruleName = this.extractRuleName(rule.file);
2543
- const agentPath = getAgentPath(agent, ruleName);
2544
- const fullPath = `${rule.to}/${agentPath}`.replace(/\/+/g, "/");
2545
- paths.add(fullPath);
2546
- const agentDir = getAgentDirectory(agent);
2547
- if (agentDir) {
2548
- const fullDir = `${rule.to}/${agentDir}`.replace(/\/+/g, "/");
2549
- paths.add(`${fullDir}/`);
2561
+ const agentName = this.getAgentName(agent);
2562
+ const customPath = this.getCustomPath(agent);
2563
+ if (customPath) {
2564
+ paths.add(customPath);
2565
+ } else {
2566
+ const ruleName = this.extractRuleName(rule.file);
2567
+ const agentPath = getAgentPath(agentName, ruleName);
2568
+ const fullPath = `${rule.to}/${agentPath}`.replace(/\/+/g, "/");
2569
+ paths.add(fullPath);
2570
+ const agentDir = getAgentDirectory(agentName);
2571
+ if (agentDir) {
2572
+ const fullDir = `${rule.to}/${agentDir}`.replace(/\/+/g, "/");
2573
+ paths.add(`${fullDir}/`);
2574
+ }
2550
2575
  }
2551
2576
  }
2552
2577
  }
2553
2578
  if (this.config.commands) {
2554
2579
  for (const command of this.config.commands) {
2555
2580
  for (const agent of command.targets) {
2556
- const agentPath = getAgentPath(agent, command.command);
2557
- paths.add(agentPath);
2581
+ const agentName = this.getAgentName(agent);
2582
+ const customPath = this.getCustomPath(agent);
2583
+ if (customPath) {
2584
+ paths.add(customPath);
2585
+ } else {
2586
+ const agentPath = getAgentPath(agentName, command.command);
2587
+ paths.add(agentPath);
2588
+ }
2558
2589
  }
2559
2590
  }
2560
2591
  }
@@ -2754,24 +2785,42 @@ class AIRulesCore {
2754
2785
  throw new Error(`Duplicate MCP names found: ${duplicates.join(", ")}`);
2755
2786
  }
2756
2787
  }
2788
+ getAgentName(agent) {
2789
+ return typeof agent === "string" ? agent : agent.name;
2790
+ }
2791
+ getCustomPath(agent) {
2792
+ return typeof agent === "object" ? agent.to : undefined;
2793
+ }
2757
2794
  collectAllGeneratedPaths() {
2758
2795
  const paths = [];
2759
2796
  for (const rule of this.config.rules) {
2760
2797
  for (const agent of rule.targets) {
2761
- const ruleName = rule.file.split("/").pop()?.replace(".md", "") || "rule";
2762
- const agentPath = getAgentPath(agent, ruleName);
2763
- let fullPath = `${rule.to}/${agentPath}`.replace(/\/+/g, "/");
2764
- if (fullPath.startsWith("./")) {
2765
- fullPath = fullPath.substring(2);
2798
+ const agentName = this.getAgentName(agent);
2799
+ const customPath = this.getCustomPath(agent);
2800
+ if (customPath) {
2801
+ paths.push(customPath);
2802
+ } else {
2803
+ const ruleName = rule.file.split("/").pop()?.replace(".md", "") || "rule";
2804
+ const agentPath = getAgentPath(agentName, ruleName);
2805
+ let fullPath = `${rule.to}/${agentPath}`.replace(/\/+/g, "/");
2806
+ if (fullPath.startsWith("./")) {
2807
+ fullPath = fullPath.substring(2);
2808
+ }
2809
+ paths.push(fullPath);
2766
2810
  }
2767
- paths.push(fullPath);
2768
2811
  }
2769
2812
  }
2770
2813
  if (this.config.commands) {
2771
2814
  for (const command of this.config.commands) {
2772
2815
  for (const agent of command.targets) {
2773
- const agentPath = getAgentPath(agent, command.command);
2774
- paths.push(agentPath);
2816
+ const agentName = this.getAgentName(agent);
2817
+ const customPath = this.getCustomPath(agent);
2818
+ if (customPath) {
2819
+ paths.push(customPath);
2820
+ } else {
2821
+ const agentPath = getAgentPath(agentName, command.command);
2822
+ paths.push(agentPath);
2823
+ }
2775
2824
  }
2776
2825
  }
2777
2826
  }
@@ -2876,9 +2925,18 @@ class ConfigLoader {
2876
2925
  if (!Array.isArray(r.targets) || r.targets.length === 0) {
2877
2926
  throw new Error(`Rule at index ${index}: Rule.targets must be a non-empty array`);
2878
2927
  }
2879
- const validAgents = ["claude", "cursor", "codex", "roocode"];
2880
- if (!r.targets.every((agent) => validAgents.includes(agent))) {
2881
- throw new Error(`Rule at index ${index}: Rule.targets must contain valid agents: ${validAgents.join(", ")}`);
2928
+ const validAgentNames = ["claude", "cursor", "codex", "roocode", "generic"];
2929
+ if (!r.targets.every((agent) => {
2930
+ if (typeof agent === "string") {
2931
+ return validAgentNames.includes(agent);
2932
+ }
2933
+ if (typeof agent === "object" && agent !== null) {
2934
+ const a = agent;
2935
+ return validAgentNames.includes(a.name) && (a.to === undefined || typeof a.to === "string");
2936
+ }
2937
+ return false;
2938
+ })) {
2939
+ throw new Error(`Rule at index ${index}: Rule.targets must contain valid agents: ${validAgentNames.join(", ")}, or objects with {name, to?}`);
2882
2940
  }
2883
2941
  }
2884
2942
  static createInitialConfig() {
@@ -2908,7 +2966,11 @@ export default defineRules({
2908
2966
  // name: 'coding-standards',
2909
2967
  // file: '.glooit/coding-rules.md',
2910
2968
  // to: './',
2911
- // targets: ['claude'],
2969
+ // targets: [
2970
+ // 'claude',
2971
+ // { name: 'cursor', to: './custom/cursor-rules.mdc' }, // Custom path override
2972
+ // { name: 'generic', to: './docs/coding-standards.md' } // Generic agent with custom path
2973
+ // ],
2912
2974
  // globs: '**/*.{ts,js,tsx,jsx}' // Optional: only apply to certain file patterns
2913
2975
  // }
2914
2976
  ],
@@ -2970,7 +3032,11 @@ export default defineRules({
2970
3032
  // name: 'coding-standards',
2971
3033
  // file: '.glooit/coding-rules.md',
2972
3034
  // to: './',
2973
- // targets: ['claude'],
3035
+ // targets: [
3036
+ // 'claude',
3037
+ // { name: 'cursor', to: './custom/cursor-rules.mdc' }, // Custom path override
3038
+ // { name: 'generic', to: './docs/coding-standards.md' } // Generic agent with custom path
3039
+ // ],
2974
3040
  // globs: '**/*.{ts,js,tsx,jsx}' // Optional: only apply to certain file patterns
2975
3041
  // }
2976
3042
  ],
@@ -3373,7 +3439,7 @@ function constructCommand(value, args) {
3373
3439
  import { execSync } from "child_process";
3374
3440
  import { createInterface } from "readline";
3375
3441
  // package.json
3376
- var version = "0.5.1";
3442
+ var version = "0.5.2";
3377
3443
 
3378
3444
  // src/cli/index.ts
3379
3445
  var args = process.argv.slice(2);
@@ -4,6 +4,8 @@ export declare class GitIgnoreManager {
4
4
  private gitignorePath;
5
5
  private marker;
6
6
  constructor(config: Config);
7
+ private getAgentName;
8
+ private getCustomPath;
7
9
  updateGitIgnore(): Promise<void>;
8
10
  cleanupGitIgnore(): Promise<void>;
9
11
  private collectGeneratedPaths;
@@ -16,5 +16,7 @@ export declare class AIRulesCore {
16
16
  validate(): Promise<boolean>;
17
17
  private distributeMcps;
18
18
  private validateMcpNames;
19
+ private getAgentName;
20
+ private getCustomPath;
19
21
  collectAllGeneratedPaths(): string[];
20
22
  }
package/dist/index.js CHANGED
@@ -10,8 +10,18 @@ var __export = (target, all) => {
10
10
  };
11
11
 
12
12
  // src/types/index.ts
13
+ function isValidAgentName(agentName) {
14
+ return ["claude", "cursor", "codex", "roocode", "generic"].includes(agentName);
15
+ }
13
16
  function isValidAgent(agent) {
14
- return ["claude", "cursor", "codex", "roocode"].includes(agent);
17
+ if (typeof agent === "string") {
18
+ return isValidAgentName(agent);
19
+ }
20
+ if (typeof agent === "object" && agent !== null) {
21
+ const a = agent;
22
+ return isValidAgentName(a.name) && (a.to === undefined || typeof a.to === "string");
23
+ }
24
+ return false;
15
25
  }
16
26
  function validateRule(rule) {
17
27
  if (!rule || typeof rule !== "object") {
@@ -28,7 +38,7 @@ function validateRule(rule) {
28
38
  throw new Error("Rule.targets must be a non-empty array");
29
39
  }
30
40
  if (!r.targets.every(isValidAgent)) {
31
- throw new Error("Rule.targets must contain valid agents: claude, cursor, codex, roocode");
41
+ throw new Error("Rule.targets must contain valid agents: claude, cursor, codex, roocode, generic, or objects with {name, to?}");
32
42
  }
33
43
  }
34
44
  function validateConfig(config) {
@@ -79,7 +89,7 @@ var AGENT_MAPPINGS = {
79
89
  mcpPath: ".mcp.json"
80
90
  },
81
91
  cursor: {
82
- path: ".cursor/rules/{name}.md",
92
+ path: ".cursor/rules/{name}.mdc",
83
93
  format: "frontmatter",
84
94
  directory: ".cursor/rules",
85
95
  mcpPath: "~/.cursor/mcp.json"
@@ -94,6 +104,11 @@ var AGENT_MAPPINGS = {
94
104
  format: "markdown",
95
105
  directory: ".roo/rules",
96
106
  mcpPath: ".roo/mcp.json"
107
+ },
108
+ generic: {
109
+ path: "{name}.md",
110
+ format: "markdown",
111
+ mcpPath: "mcp.json"
97
112
  }
98
113
  };
99
114
  function getAgentPath(agent, name = "global") {
@@ -189,6 +204,7 @@ class AgentWriterFactory {
189
204
  case "claude":
190
205
  case "codex":
191
206
  case "roocode":
207
+ case "generic":
192
208
  return new MarkdownWriter;
193
209
  default:
194
210
  return new MarkdownWriter;
@@ -272,25 +288,32 @@ class AgentDistributor {
272
288
  await this.distributeToAgent(agent, rule, content);
273
289
  }
274
290
  }
291
+ getAgentName(agent) {
292
+ return typeof agent === "string" ? agent : agent.name;
293
+ }
294
+ getCustomPath(agent) {
295
+ return typeof agent === "object" ? agent.to : undefined;
296
+ }
275
297
  async distributeToAgent(agent, rule, content) {
276
- const ruleName = this.extractRuleName(rule.file);
277
- const agentPath = getAgentPath(agent, ruleName);
278
- const targetPath = join2(rule.to, agentPath);
279
- const agentDir = getAgentDirectory(agent);
280
- if (agentDir) {
281
- const fullDir = join2(rule.to, agentDir);
282
- mkdirSync(fullDir, { recursive: true });
298
+ const agentName = this.getAgentName(agent);
299
+ const customPath = this.getCustomPath(agent);
300
+ let targetPath;
301
+ if (customPath) {
302
+ targetPath = customPath;
283
303
  } else {
284
- mkdirSync(dirname(targetPath), { recursive: true });
304
+ const ruleName = this.extractRuleName(rule.file);
305
+ const agentPath = getAgentPath(agentName, ruleName);
306
+ targetPath = join2(rule.to, agentPath);
285
307
  }
286
- const writer = AgentWriterFactory.createWriter(agent);
308
+ mkdirSync(dirname(targetPath), { recursive: true });
309
+ const writer = AgentWriterFactory.createWriter(agentName);
287
310
  const formattedContent = writer.formatContent(content, rule);
288
311
  const context = {
289
312
  config: this.config,
290
313
  rule,
291
314
  content: formattedContent,
292
315
  targetPath,
293
- agent
316
+ agent: agentName
294
317
  };
295
318
  const finalContent = await this.applyHooks(context);
296
319
  writeFileSync(targetPath, finalContent, "utf-8");
@@ -447,6 +470,12 @@ class GitIgnoreManager {
447
470
  constructor(config) {
448
471
  this.config = config;
449
472
  }
473
+ getAgentName(agent) {
474
+ return typeof agent === "string" ? agent : agent.name;
475
+ }
476
+ getCustomPath(agent) {
477
+ return typeof agent === "object" ? agent.to : undefined;
478
+ }
450
479
  async updateGitIgnore() {
451
480
  const paths = this.collectGeneratedPaths();
452
481
  if (paths.length === 0) {
@@ -477,22 +506,34 @@ class GitIgnoreManager {
477
506
  const paths = new Set;
478
507
  for (const rule of this.config.rules) {
479
508
  for (const agent of rule.targets) {
480
- const ruleName = this.extractRuleName(rule.file);
481
- const agentPath = getAgentPath(agent, ruleName);
482
- const fullPath = `${rule.to}/${agentPath}`.replace(/\/+/g, "/");
483
- paths.add(fullPath);
484
- const agentDir = getAgentDirectory(agent);
485
- if (agentDir) {
486
- const fullDir = `${rule.to}/${agentDir}`.replace(/\/+/g, "/");
487
- paths.add(`${fullDir}/`);
509
+ const agentName = this.getAgentName(agent);
510
+ const customPath = this.getCustomPath(agent);
511
+ if (customPath) {
512
+ paths.add(customPath);
513
+ } else {
514
+ const ruleName = this.extractRuleName(rule.file);
515
+ const agentPath = getAgentPath(agentName, ruleName);
516
+ const fullPath = `${rule.to}/${agentPath}`.replace(/\/+/g, "/");
517
+ paths.add(fullPath);
518
+ const agentDir = getAgentDirectory(agentName);
519
+ if (agentDir) {
520
+ const fullDir = `${rule.to}/${agentDir}`.replace(/\/+/g, "/");
521
+ paths.add(`${fullDir}/`);
522
+ }
488
523
  }
489
524
  }
490
525
  }
491
526
  if (this.config.commands) {
492
527
  for (const command of this.config.commands) {
493
528
  for (const agent of command.targets) {
494
- const agentPath = getAgentPath(agent, command.command);
495
- paths.add(agentPath);
529
+ const agentName = this.getAgentName(agent);
530
+ const customPath = this.getCustomPath(agent);
531
+ if (customPath) {
532
+ paths.add(customPath);
533
+ } else {
534
+ const agentPath = getAgentPath(agentName, command.command);
535
+ paths.add(agentPath);
536
+ }
496
537
  }
497
538
  }
498
539
  }
@@ -692,24 +733,42 @@ class AIRulesCore {
692
733
  throw new Error(`Duplicate MCP names found: ${duplicates.join(", ")}`);
693
734
  }
694
735
  }
736
+ getAgentName(agent) {
737
+ return typeof agent === "string" ? agent : agent.name;
738
+ }
739
+ getCustomPath(agent) {
740
+ return typeof agent === "object" ? agent.to : undefined;
741
+ }
695
742
  collectAllGeneratedPaths() {
696
743
  const paths = [];
697
744
  for (const rule of this.config.rules) {
698
745
  for (const agent of rule.targets) {
699
- const ruleName = rule.file.split("/").pop()?.replace(".md", "") || "rule";
700
- const agentPath = getAgentPath(agent, ruleName);
701
- let fullPath = `${rule.to}/${agentPath}`.replace(/\/+/g, "/");
702
- if (fullPath.startsWith("./")) {
703
- fullPath = fullPath.substring(2);
746
+ const agentName = this.getAgentName(agent);
747
+ const customPath = this.getCustomPath(agent);
748
+ if (customPath) {
749
+ paths.push(customPath);
750
+ } else {
751
+ const ruleName = rule.file.split("/").pop()?.replace(".md", "") || "rule";
752
+ const agentPath = getAgentPath(agentName, ruleName);
753
+ let fullPath = `${rule.to}/${agentPath}`.replace(/\/+/g, "/");
754
+ if (fullPath.startsWith("./")) {
755
+ fullPath = fullPath.substring(2);
756
+ }
757
+ paths.push(fullPath);
704
758
  }
705
- paths.push(fullPath);
706
759
  }
707
760
  }
708
761
  if (this.config.commands) {
709
762
  for (const command of this.config.commands) {
710
763
  for (const agent of command.targets) {
711
- const agentPath = getAgentPath(agent, command.command);
712
- paths.push(agentPath);
764
+ const agentName = this.getAgentName(agent);
765
+ const customPath = this.getCustomPath(agent);
766
+ if (customPath) {
767
+ paths.push(customPath);
768
+ } else {
769
+ const agentPath = getAgentPath(agentName, command.command);
770
+ paths.push(agentPath);
771
+ }
713
772
  }
714
773
  }
715
774
  }
@@ -813,9 +872,18 @@ class ConfigLoader {
813
872
  if (!Array.isArray(r.targets) || r.targets.length === 0) {
814
873
  throw new Error(`Rule at index ${index}: Rule.targets must be a non-empty array`);
815
874
  }
816
- const validAgents = ["claude", "cursor", "codex", "roocode"];
817
- if (!r.targets.every((agent) => validAgents.includes(agent))) {
818
- throw new Error(`Rule at index ${index}: Rule.targets must contain valid agents: ${validAgents.join(", ")}`);
875
+ const validAgentNames = ["claude", "cursor", "codex", "roocode", "generic"];
876
+ if (!r.targets.every((agent) => {
877
+ if (typeof agent === "string") {
878
+ return validAgentNames.includes(agent);
879
+ }
880
+ if (typeof agent === "object" && agent !== null) {
881
+ const a = agent;
882
+ return validAgentNames.includes(a.name) && (a.to === undefined || typeof a.to === "string");
883
+ }
884
+ return false;
885
+ })) {
886
+ throw new Error(`Rule at index ${index}: Rule.targets must contain valid agents: ${validAgentNames.join(", ")}, or objects with {name, to?}`);
819
887
  }
820
888
  }
821
889
  static createInitialConfig() {
@@ -845,7 +913,11 @@ export default defineRules({
845
913
  // name: 'coding-standards',
846
914
  // file: '.glooit/coding-rules.md',
847
915
  // to: './',
848
- // targets: ['claude'],
916
+ // targets: [
917
+ // 'claude',
918
+ // { name: 'cursor', to: './custom/cursor-rules.mdc' }, // Custom path override
919
+ // { name: 'generic', to: './docs/coding-standards.md' } // Generic agent with custom path
920
+ // ],
849
921
  // globs: '**/*.{ts,js,tsx,jsx}' // Optional: only apply to certain file patterns
850
922
  // }
851
923
  ],
@@ -907,7 +979,11 @@ export default defineRules({
907
979
  // name: 'coding-standards',
908
980
  // file: '.glooit/coding-rules.md',
909
981
  // to: './',
910
- // targets: ['claude'],
982
+ // targets: [
983
+ // 'claude',
984
+ // { name: 'cursor', to: './custom/cursor-rules.mdc' }, // Custom path override
985
+ // { name: 'generic', to: './docs/coding-standards.md' } // Generic agent with custom path
986
+ // ],
911
987
  // globs: '**/*.{ts,js,tsx,jsx}' // Optional: only apply to certain file patterns
912
988
  // }
913
989
  ],
@@ -1,4 +1,9 @@
1
- export type Agent = 'claude' | 'cursor' | 'codex' | 'roocode';
1
+ export type AgentName = 'claude' | 'cursor' | 'codex' | 'roocode' | 'generic';
2
+ export interface AgentTarget {
3
+ name: AgentName;
4
+ to?: string;
5
+ }
6
+ export type Agent = AgentName | AgentTarget;
2
7
  export interface Rule {
3
8
  name?: string;
4
9
  file: string;
@@ -25,7 +30,7 @@ export interface McpConfig {
25
30
  export interface Mcp {
26
31
  name: string;
27
32
  config: McpConfig;
28
- targets?: Agent[];
33
+ targets?: AgentName[];
29
34
  outputPath?: string;
30
35
  }
31
36
  export interface ResolvedMcp extends Omit<Mcp, 'outputPath'> {
@@ -63,7 +68,7 @@ export interface SyncContext {
63
68
  rule: Rule;
64
69
  content: string;
65
70
  targetPath: string;
66
- agent: Agent;
71
+ agent: AgentName;
67
72
  }
68
73
  export interface BackupEntry {
69
74
  timestamp: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glooit",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "🧴 Sync your AI agent configurations and rules across platforms with ease",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",