rulesync 3.0.0 → 3.1.0
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/README.md +1 -1
- package/dist/index.cjs +495 -367
- package/dist/index.js +493 -365
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -95,7 +95,7 @@ var logger = new Logger();
|
|
|
95
95
|
var import_es_toolkit2 = require("es-toolkit");
|
|
96
96
|
|
|
97
97
|
// src/commands/commands-processor.ts
|
|
98
|
-
var
|
|
98
|
+
var import_node_path12 = require("path");
|
|
99
99
|
var import_mini8 = require("zod/mini");
|
|
100
100
|
|
|
101
101
|
// src/utils/file.ts
|
|
@@ -210,9 +210,8 @@ var FeatureProcessor = class {
|
|
|
210
210
|
}
|
|
211
211
|
};
|
|
212
212
|
|
|
213
|
-
// src/commands/
|
|
213
|
+
// src/commands/agentsmd-command.ts
|
|
214
214
|
var import_node_path4 = require("path");
|
|
215
|
-
var import_mini4 = require("zod/mini");
|
|
216
215
|
|
|
217
216
|
// src/utils/frontmatter.ts
|
|
218
217
|
var import_gray_matter = __toESM(require("gray-matter"), 1);
|
|
@@ -263,9 +262,9 @@ function parseFrontmatter(content) {
|
|
|
263
262
|
return { frontmatter, body };
|
|
264
263
|
}
|
|
265
264
|
|
|
266
|
-
// src/commands/
|
|
265
|
+
// src/commands/simulated-command.ts
|
|
267
266
|
var import_node_path3 = require("path");
|
|
268
|
-
var
|
|
267
|
+
var import_mini2 = require("zod/mini");
|
|
269
268
|
|
|
270
269
|
// src/types/ai-file.ts
|
|
271
270
|
var import_node_path2 = __toESM(require("path"), 1);
|
|
@@ -345,6 +344,220 @@ var AiFile = class {
|
|
|
345
344
|
}
|
|
346
345
|
};
|
|
347
346
|
|
|
347
|
+
// src/commands/tool-command.ts
|
|
348
|
+
var ToolCommand = class extends AiFile {
|
|
349
|
+
static getSettablePaths() {
|
|
350
|
+
throw new Error("Please implement this method in the subclass.");
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Load a command from a tool-specific file path.
|
|
354
|
+
*
|
|
355
|
+
* This method should:
|
|
356
|
+
* 1. Read the file content
|
|
357
|
+
* 2. Parse tool-specific frontmatter format
|
|
358
|
+
* 3. Validate the parsed data
|
|
359
|
+
* 4. Return a concrete ToolCommand instance
|
|
360
|
+
*
|
|
361
|
+
* @param params - Parameters including the file path to load
|
|
362
|
+
* @returns Promise resolving to a concrete ToolCommand instance
|
|
363
|
+
*/
|
|
364
|
+
static async fromFile(_params) {
|
|
365
|
+
throw new Error("Please implement this method in the subclass.");
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Convert a RulesyncCommand to the tool-specific command format.
|
|
369
|
+
*
|
|
370
|
+
* This method should:
|
|
371
|
+
* 1. Extract relevant data from the RulesyncCommand
|
|
372
|
+
* 2. Transform frontmatter to tool-specific format
|
|
373
|
+
* 3. Transform body content if needed
|
|
374
|
+
* 4. Return a concrete ToolCommand instance
|
|
375
|
+
*
|
|
376
|
+
* @param params - Parameters including the RulesyncCommand to convert
|
|
377
|
+
* @returns A concrete ToolCommand instance
|
|
378
|
+
*/
|
|
379
|
+
static fromRulesyncCommand(_params) {
|
|
380
|
+
throw new Error("Please implement this method in the subclass.");
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Check if this tool is targeted by a RulesyncCommand based on its targets field.
|
|
384
|
+
* Subclasses should override this to provide specific targeting logic.
|
|
385
|
+
*
|
|
386
|
+
* @param rulesyncCommand - The RulesyncCommand to check
|
|
387
|
+
* @returns True if this tool is targeted by the command
|
|
388
|
+
*/
|
|
389
|
+
static isTargetedByRulesyncCommand(_rulesyncCommand) {
|
|
390
|
+
throw new Error("Please implement this method in the subclass.");
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Default implementation for checking if a tool is targeted by a RulesyncCommand.
|
|
394
|
+
* Checks if the command's targets include the tool target or a wildcard.
|
|
395
|
+
*
|
|
396
|
+
* @param params - Parameters including the RulesyncCommand and tool target
|
|
397
|
+
* @returns True if the tool target is included in the command's targets
|
|
398
|
+
*/
|
|
399
|
+
static isTargetedByRulesyncCommandDefault({
|
|
400
|
+
rulesyncCommand,
|
|
401
|
+
toolTarget
|
|
402
|
+
}) {
|
|
403
|
+
const targets = rulesyncCommand.getFrontmatter().targets;
|
|
404
|
+
if (!targets) {
|
|
405
|
+
return true;
|
|
406
|
+
}
|
|
407
|
+
if (targets.includes("*")) {
|
|
408
|
+
return true;
|
|
409
|
+
}
|
|
410
|
+
if (targets.includes(toolTarget)) {
|
|
411
|
+
return true;
|
|
412
|
+
}
|
|
413
|
+
return false;
|
|
414
|
+
}
|
|
415
|
+
};
|
|
416
|
+
|
|
417
|
+
// src/commands/simulated-command.ts
|
|
418
|
+
var SimulatedCommandFrontmatterSchema = import_mini2.z.object({
|
|
419
|
+
description: import_mini2.z.string()
|
|
420
|
+
});
|
|
421
|
+
var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
|
|
422
|
+
frontmatter;
|
|
423
|
+
body;
|
|
424
|
+
constructor({ frontmatter, body, ...rest }) {
|
|
425
|
+
if (rest.validate) {
|
|
426
|
+
const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
|
|
427
|
+
if (!result.success) {
|
|
428
|
+
throw result.error;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
super({
|
|
432
|
+
...rest,
|
|
433
|
+
fileContent: stringifyFrontmatter(body, frontmatter)
|
|
434
|
+
});
|
|
435
|
+
this.frontmatter = frontmatter;
|
|
436
|
+
this.body = body;
|
|
437
|
+
}
|
|
438
|
+
getBody() {
|
|
439
|
+
return this.body;
|
|
440
|
+
}
|
|
441
|
+
getFrontmatter() {
|
|
442
|
+
return this.frontmatter;
|
|
443
|
+
}
|
|
444
|
+
toRulesyncCommand() {
|
|
445
|
+
throw new Error("Not implemented because it is a SIMULATED file.");
|
|
446
|
+
}
|
|
447
|
+
static fromRulesyncCommandDefault({
|
|
448
|
+
baseDir = ".",
|
|
449
|
+
rulesyncCommand,
|
|
450
|
+
validate = true
|
|
451
|
+
}) {
|
|
452
|
+
const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
|
|
453
|
+
const claudecodeFrontmatter = {
|
|
454
|
+
description: rulesyncFrontmatter.description
|
|
455
|
+
};
|
|
456
|
+
const body = rulesyncCommand.getBody();
|
|
457
|
+
return {
|
|
458
|
+
baseDir,
|
|
459
|
+
frontmatter: claudecodeFrontmatter,
|
|
460
|
+
body,
|
|
461
|
+
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
462
|
+
relativeFilePath: rulesyncCommand.getRelativeFilePath(),
|
|
463
|
+
validate
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
validate() {
|
|
467
|
+
if (!this.frontmatter) {
|
|
468
|
+
return { success: true, error: null };
|
|
469
|
+
}
|
|
470
|
+
const result = SimulatedCommandFrontmatterSchema.safeParse(this.frontmatter);
|
|
471
|
+
if (result.success) {
|
|
472
|
+
return { success: true, error: null };
|
|
473
|
+
} else {
|
|
474
|
+
return { success: false, error: result.error };
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
static async fromFileDefault({
|
|
478
|
+
baseDir = ".",
|
|
479
|
+
relativeFilePath,
|
|
480
|
+
validate = true
|
|
481
|
+
}) {
|
|
482
|
+
const filePath = (0, import_node_path3.join)(
|
|
483
|
+
baseDir,
|
|
484
|
+
_SimulatedCommand.getSettablePaths().relativeDirPath,
|
|
485
|
+
relativeFilePath
|
|
486
|
+
);
|
|
487
|
+
const fileContent = await readFileContent(filePath);
|
|
488
|
+
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
489
|
+
const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
|
|
490
|
+
if (!result.success) {
|
|
491
|
+
throw new Error(`Invalid frontmatter in ${filePath}: ${result.error.message}`);
|
|
492
|
+
}
|
|
493
|
+
return {
|
|
494
|
+
baseDir,
|
|
495
|
+
relativeDirPath: _SimulatedCommand.getSettablePaths().relativeDirPath,
|
|
496
|
+
relativeFilePath: (0, import_node_path3.basename)(relativeFilePath),
|
|
497
|
+
frontmatter: result.data,
|
|
498
|
+
body: content.trim(),
|
|
499
|
+
validate
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
// src/commands/agentsmd-command.ts
|
|
505
|
+
var AgentsmdCommand = class _AgentsmdCommand extends SimulatedCommand {
|
|
506
|
+
static getSettablePaths() {
|
|
507
|
+
return {
|
|
508
|
+
relativeDirPath: ".agents/commands"
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
static fromRulesyncCommand({
|
|
512
|
+
baseDir = ".",
|
|
513
|
+
rulesyncCommand,
|
|
514
|
+
validate = true
|
|
515
|
+
}) {
|
|
516
|
+
return new _AgentsmdCommand(
|
|
517
|
+
this.fromRulesyncCommandDefault({ baseDir, rulesyncCommand, validate })
|
|
518
|
+
);
|
|
519
|
+
}
|
|
520
|
+
static async fromFile({
|
|
521
|
+
baseDir = ".",
|
|
522
|
+
relativeFilePath,
|
|
523
|
+
validate = true
|
|
524
|
+
}) {
|
|
525
|
+
const filePath = (0, import_node_path4.join)(
|
|
526
|
+
baseDir,
|
|
527
|
+
_AgentsmdCommand.getSettablePaths().relativeDirPath,
|
|
528
|
+
relativeFilePath
|
|
529
|
+
);
|
|
530
|
+
const fileContent = await readFileContent(filePath);
|
|
531
|
+
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
532
|
+
const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
|
|
533
|
+
if (!result.success) {
|
|
534
|
+
throw new Error(`Invalid frontmatter in ${filePath}: ${result.error.message}`);
|
|
535
|
+
}
|
|
536
|
+
return new _AgentsmdCommand({
|
|
537
|
+
baseDir,
|
|
538
|
+
relativeDirPath: _AgentsmdCommand.getSettablePaths().relativeDirPath,
|
|
539
|
+
relativeFilePath: (0, import_node_path4.basename)(relativeFilePath),
|
|
540
|
+
frontmatter: result.data,
|
|
541
|
+
body: content.trim(),
|
|
542
|
+
validate
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
static isTargetedByRulesyncCommand(rulesyncCommand) {
|
|
546
|
+
return this.isTargetedByRulesyncCommandDefault({
|
|
547
|
+
rulesyncCommand,
|
|
548
|
+
toolTarget: "agentsmd"
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
};
|
|
552
|
+
|
|
553
|
+
// src/commands/claudecode-command.ts
|
|
554
|
+
var import_node_path6 = require("path");
|
|
555
|
+
var import_mini5 = require("zod/mini");
|
|
556
|
+
|
|
557
|
+
// src/commands/rulesync-command.ts
|
|
558
|
+
var import_node_path5 = require("path");
|
|
559
|
+
var import_mini4 = require("zod/mini");
|
|
560
|
+
|
|
348
561
|
// src/types/rulesync-file.ts
|
|
349
562
|
var RulesyncFile = class extends AiFile {
|
|
350
563
|
static async fromFile(_params) {
|
|
@@ -356,7 +569,7 @@ var RulesyncFile = class extends AiFile {
|
|
|
356
569
|
};
|
|
357
570
|
|
|
358
571
|
// src/types/tool-targets.ts
|
|
359
|
-
var
|
|
572
|
+
var import_mini3 = require("zod/mini");
|
|
360
573
|
var ALL_TOOL_TARGETS = [
|
|
361
574
|
"agentsmd",
|
|
362
575
|
"amazonqcli",
|
|
@@ -377,14 +590,14 @@ var ALL_TOOL_TARGETS = [
|
|
|
377
590
|
"windsurf"
|
|
378
591
|
];
|
|
379
592
|
var ALL_TOOL_TARGETS_WITH_WILDCARD = [...ALL_TOOL_TARGETS, "*"];
|
|
380
|
-
var ToolTargetSchema =
|
|
381
|
-
var ToolTargetsSchema =
|
|
382
|
-
var RulesyncTargetsSchema =
|
|
593
|
+
var ToolTargetSchema = import_mini3.z.enum(ALL_TOOL_TARGETS);
|
|
594
|
+
var ToolTargetsSchema = import_mini3.z.array(ToolTargetSchema);
|
|
595
|
+
var RulesyncTargetsSchema = import_mini3.z.array(import_mini3.z.enum(ALL_TOOL_TARGETS_WITH_WILDCARD));
|
|
383
596
|
|
|
384
597
|
// src/commands/rulesync-command.ts
|
|
385
|
-
var RulesyncCommandFrontmatterSchema =
|
|
598
|
+
var RulesyncCommandFrontmatterSchema = import_mini4.z.object({
|
|
386
599
|
targets: RulesyncTargetsSchema,
|
|
387
|
-
description:
|
|
600
|
+
description: import_mini4.z.string()
|
|
388
601
|
});
|
|
389
602
|
var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
|
|
390
603
|
frontmatter;
|
|
@@ -429,14 +642,14 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
|
|
|
429
642
|
relativeFilePath
|
|
430
643
|
}) {
|
|
431
644
|
const fileContent = await readFileContent(
|
|
432
|
-
(0,
|
|
645
|
+
(0, import_node_path5.join)(_RulesyncCommand.getSettablePaths().relativeDirPath, relativeFilePath)
|
|
433
646
|
);
|
|
434
647
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
435
648
|
const result = RulesyncCommandFrontmatterSchema.safeParse(frontmatter);
|
|
436
649
|
if (!result.success) {
|
|
437
650
|
throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${result.error.message}`);
|
|
438
651
|
}
|
|
439
|
-
const filename = (0,
|
|
652
|
+
const filename = (0, import_node_path5.basename)(relativeFilePath);
|
|
440
653
|
return new _RulesyncCommand({
|
|
441
654
|
baseDir: ".",
|
|
442
655
|
relativeDirPath: _RulesyncCommand.getSettablePaths().relativeDirPath,
|
|
@@ -448,79 +661,9 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
|
|
|
448
661
|
}
|
|
449
662
|
};
|
|
450
663
|
|
|
451
|
-
// src/commands/tool-command.ts
|
|
452
|
-
var ToolCommand = class extends AiFile {
|
|
453
|
-
static getSettablePaths() {
|
|
454
|
-
throw new Error("Please implement this method in the subclass.");
|
|
455
|
-
}
|
|
456
|
-
/**
|
|
457
|
-
* Load a command from a tool-specific file path.
|
|
458
|
-
*
|
|
459
|
-
* This method should:
|
|
460
|
-
* 1. Read the file content
|
|
461
|
-
* 2. Parse tool-specific frontmatter format
|
|
462
|
-
* 3. Validate the parsed data
|
|
463
|
-
* 4. Return a concrete ToolCommand instance
|
|
464
|
-
*
|
|
465
|
-
* @param params - Parameters including the file path to load
|
|
466
|
-
* @returns Promise resolving to a concrete ToolCommand instance
|
|
467
|
-
*/
|
|
468
|
-
static async fromFile(_params) {
|
|
469
|
-
throw new Error("Please implement this method in the subclass.");
|
|
470
|
-
}
|
|
471
|
-
/**
|
|
472
|
-
* Convert a RulesyncCommand to the tool-specific command format.
|
|
473
|
-
*
|
|
474
|
-
* This method should:
|
|
475
|
-
* 1. Extract relevant data from the RulesyncCommand
|
|
476
|
-
* 2. Transform frontmatter to tool-specific format
|
|
477
|
-
* 3. Transform body content if needed
|
|
478
|
-
* 4. Return a concrete ToolCommand instance
|
|
479
|
-
*
|
|
480
|
-
* @param params - Parameters including the RulesyncCommand to convert
|
|
481
|
-
* @returns A concrete ToolCommand instance
|
|
482
|
-
*/
|
|
483
|
-
static fromRulesyncCommand(_params) {
|
|
484
|
-
throw new Error("Please implement this method in the subclass.");
|
|
485
|
-
}
|
|
486
|
-
/**
|
|
487
|
-
* Check if this tool is targeted by a RulesyncCommand based on its targets field.
|
|
488
|
-
* Subclasses should override this to provide specific targeting logic.
|
|
489
|
-
*
|
|
490
|
-
* @param rulesyncCommand - The RulesyncCommand to check
|
|
491
|
-
* @returns True if this tool is targeted by the command
|
|
492
|
-
*/
|
|
493
|
-
static isTargetedByRulesyncCommand(_rulesyncCommand) {
|
|
494
|
-
throw new Error("Please implement this method in the subclass.");
|
|
495
|
-
}
|
|
496
|
-
/**
|
|
497
|
-
* Default implementation for checking if a tool is targeted by a RulesyncCommand.
|
|
498
|
-
* Checks if the command's targets include the tool target or a wildcard.
|
|
499
|
-
*
|
|
500
|
-
* @param params - Parameters including the RulesyncCommand and tool target
|
|
501
|
-
* @returns True if the tool target is included in the command's targets
|
|
502
|
-
*/
|
|
503
|
-
static isTargetedByRulesyncCommandDefault({
|
|
504
|
-
rulesyncCommand,
|
|
505
|
-
toolTarget
|
|
506
|
-
}) {
|
|
507
|
-
const targets = rulesyncCommand.getFrontmatter().targets;
|
|
508
|
-
if (!targets) {
|
|
509
|
-
return true;
|
|
510
|
-
}
|
|
511
|
-
if (targets.includes("*")) {
|
|
512
|
-
return true;
|
|
513
|
-
}
|
|
514
|
-
if (targets.includes(toolTarget)) {
|
|
515
|
-
return true;
|
|
516
|
-
}
|
|
517
|
-
return false;
|
|
518
|
-
}
|
|
519
|
-
};
|
|
520
|
-
|
|
521
664
|
// src/commands/claudecode-command.ts
|
|
522
|
-
var ClaudecodeCommandFrontmatterSchema =
|
|
523
|
-
description:
|
|
665
|
+
var ClaudecodeCommandFrontmatterSchema = import_mini5.z.object({
|
|
666
|
+
description: import_mini5.z.string()
|
|
524
667
|
});
|
|
525
668
|
var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
526
669
|
frontmatter;
|
|
@@ -546,7 +689,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
546
689
|
}
|
|
547
690
|
static getSettablePathsGlobal() {
|
|
548
691
|
return {
|
|
549
|
-
relativeDirPath: (0,
|
|
692
|
+
relativeDirPath: (0, import_node_path6.join)(".claude", "commands")
|
|
550
693
|
};
|
|
551
694
|
}
|
|
552
695
|
getBody() {
|
|
@@ -617,7 +760,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
617
760
|
global = false
|
|
618
761
|
}) {
|
|
619
762
|
const paths = global ? this.getSettablePathsGlobal() : this.getSettablePaths();
|
|
620
|
-
const filePath = (0,
|
|
763
|
+
const filePath = (0, import_node_path6.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
621
764
|
const fileContent = await readFileContent(filePath);
|
|
622
765
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
623
766
|
const result = ClaudecodeCommandFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -627,7 +770,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
627
770
|
return new _ClaudecodeCommand({
|
|
628
771
|
baseDir,
|
|
629
772
|
relativeDirPath: paths.relativeDirPath,
|
|
630
|
-
relativeFilePath: (0,
|
|
773
|
+
relativeFilePath: (0, import_node_path6.basename)(relativeFilePath),
|
|
631
774
|
frontmatter: result.data,
|
|
632
775
|
body: content.trim(),
|
|
633
776
|
validate
|
|
@@ -636,14 +779,14 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
636
779
|
};
|
|
637
780
|
|
|
638
781
|
// src/commands/codexcli-command.ts
|
|
639
|
-
var
|
|
782
|
+
var import_node_path7 = require("path");
|
|
640
783
|
var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
|
|
641
784
|
static getSettablePaths() {
|
|
642
785
|
throw new Error("getSettablePaths is not supported for CodexcliCommand");
|
|
643
786
|
}
|
|
644
787
|
static getSettablePathsGlobal() {
|
|
645
788
|
return {
|
|
646
|
-
relativeDirPath: (0,
|
|
789
|
+
relativeDirPath: (0, import_node_path7.join)(".codex", "prompts")
|
|
647
790
|
};
|
|
648
791
|
}
|
|
649
792
|
toRulesyncCommand() {
|
|
@@ -663,145 +806,54 @@ var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
|
|
|
663
806
|
});
|
|
664
807
|
}
|
|
665
808
|
static fromRulesyncCommand({
|
|
666
|
-
baseDir = ".",
|
|
667
|
-
rulesyncCommand,
|
|
668
|
-
validate = true,
|
|
669
|
-
global = false
|
|
670
|
-
}) {
|
|
671
|
-
const paths = global ? this.getSettablePathsGlobal() : this.getSettablePaths();
|
|
672
|
-
return new _CodexcliCommand({
|
|
673
|
-
baseDir,
|
|
674
|
-
fileContent: rulesyncCommand.getBody(),
|
|
675
|
-
relativeDirPath: paths.relativeDirPath,
|
|
676
|
-
relativeFilePath: rulesyncCommand.getRelativeFilePath(),
|
|
677
|
-
validate
|
|
678
|
-
});
|
|
679
|
-
}
|
|
680
|
-
validate() {
|
|
681
|
-
return { success: true, error: null };
|
|
682
|
-
}
|
|
683
|
-
getBody() {
|
|
684
|
-
return this.getFileContent();
|
|
685
|
-
}
|
|
686
|
-
static isTargetedByRulesyncCommand(rulesyncCommand) {
|
|
687
|
-
return this.isTargetedByRulesyncCommandDefault({
|
|
688
|
-
rulesyncCommand,
|
|
689
|
-
toolTarget: "codexcli"
|
|
690
|
-
});
|
|
691
|
-
}
|
|
692
|
-
static async fromFile({
|
|
693
|
-
baseDir = ".",
|
|
694
|
-
relativeFilePath,
|
|
695
|
-
validate = true,
|
|
696
|
-
global = false
|
|
697
|
-
}) {
|
|
698
|
-
const paths = global ? this.getSettablePathsGlobal() : this.getSettablePaths();
|
|
699
|
-
const filePath = (0, import_node_path5.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
700
|
-
const fileContent = await readFileContent(filePath);
|
|
701
|
-
const { body: content } = parseFrontmatter(fileContent);
|
|
702
|
-
return new _CodexcliCommand({
|
|
703
|
-
baseDir,
|
|
704
|
-
relativeDirPath: paths.relativeDirPath,
|
|
705
|
-
relativeFilePath: (0, import_node_path5.basename)(relativeFilePath),
|
|
706
|
-
fileContent: content.trim(),
|
|
707
|
-
validate
|
|
708
|
-
});
|
|
709
|
-
}
|
|
710
|
-
};
|
|
711
|
-
|
|
712
|
-
// src/commands/copilot-command.ts
|
|
713
|
-
var import_node_path7 = require("path");
|
|
714
|
-
|
|
715
|
-
// src/commands/simulated-command.ts
|
|
716
|
-
var import_node_path6 = require("path");
|
|
717
|
-
var import_mini5 = require("zod/mini");
|
|
718
|
-
var SimulatedCommandFrontmatterSchema = import_mini5.z.object({
|
|
719
|
-
description: import_mini5.z.string()
|
|
720
|
-
});
|
|
721
|
-
var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
|
|
722
|
-
frontmatter;
|
|
723
|
-
body;
|
|
724
|
-
constructor({ frontmatter, body, ...rest }) {
|
|
725
|
-
if (rest.validate) {
|
|
726
|
-
const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
|
|
727
|
-
if (!result.success) {
|
|
728
|
-
throw result.error;
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
super({
|
|
732
|
-
...rest,
|
|
733
|
-
fileContent: stringifyFrontmatter(body, frontmatter)
|
|
734
|
-
});
|
|
735
|
-
this.frontmatter = frontmatter;
|
|
736
|
-
this.body = body;
|
|
737
|
-
}
|
|
738
|
-
getBody() {
|
|
739
|
-
return this.body;
|
|
740
|
-
}
|
|
741
|
-
getFrontmatter() {
|
|
742
|
-
return this.frontmatter;
|
|
743
|
-
}
|
|
744
|
-
toRulesyncCommand() {
|
|
745
|
-
throw new Error("Not implemented because it is a SIMULATED file.");
|
|
746
|
-
}
|
|
747
|
-
static fromRulesyncCommandDefault({
|
|
748
|
-
baseDir = ".",
|
|
749
|
-
rulesyncCommand,
|
|
750
|
-
validate = true
|
|
751
|
-
}) {
|
|
752
|
-
const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
|
|
753
|
-
const claudecodeFrontmatter = {
|
|
754
|
-
description: rulesyncFrontmatter.description
|
|
755
|
-
};
|
|
756
|
-
const body = rulesyncCommand.getBody();
|
|
757
|
-
return {
|
|
809
|
+
baseDir = ".",
|
|
810
|
+
rulesyncCommand,
|
|
811
|
+
validate = true,
|
|
812
|
+
global = false
|
|
813
|
+
}) {
|
|
814
|
+
const paths = global ? this.getSettablePathsGlobal() : this.getSettablePaths();
|
|
815
|
+
return new _CodexcliCommand({
|
|
758
816
|
baseDir,
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
817
|
+
fileContent: rulesyncCommand.getBody(),
|
|
818
|
+
relativeDirPath: paths.relativeDirPath,
|
|
762
819
|
relativeFilePath: rulesyncCommand.getRelativeFilePath(),
|
|
763
820
|
validate
|
|
764
|
-
};
|
|
821
|
+
});
|
|
765
822
|
}
|
|
766
823
|
validate() {
|
|
767
|
-
|
|
768
|
-
return { success: true, error: null };
|
|
769
|
-
}
|
|
770
|
-
const result = SimulatedCommandFrontmatterSchema.safeParse(this.frontmatter);
|
|
771
|
-
if (result.success) {
|
|
772
|
-
return { success: true, error: null };
|
|
773
|
-
} else {
|
|
774
|
-
return { success: false, error: result.error };
|
|
775
|
-
}
|
|
824
|
+
return { success: true, error: null };
|
|
776
825
|
}
|
|
777
|
-
|
|
826
|
+
getBody() {
|
|
827
|
+
return this.getFileContent();
|
|
828
|
+
}
|
|
829
|
+
static isTargetedByRulesyncCommand(rulesyncCommand) {
|
|
830
|
+
return this.isTargetedByRulesyncCommandDefault({
|
|
831
|
+
rulesyncCommand,
|
|
832
|
+
toolTarget: "codexcli"
|
|
833
|
+
});
|
|
834
|
+
}
|
|
835
|
+
static async fromFile({
|
|
778
836
|
baseDir = ".",
|
|
779
837
|
relativeFilePath,
|
|
780
|
-
validate = true
|
|
838
|
+
validate = true,
|
|
839
|
+
global = false
|
|
781
840
|
}) {
|
|
782
|
-
const
|
|
783
|
-
|
|
784
|
-
_SimulatedCommand.getSettablePaths().relativeDirPath,
|
|
785
|
-
relativeFilePath
|
|
786
|
-
);
|
|
841
|
+
const paths = global ? this.getSettablePathsGlobal() : this.getSettablePaths();
|
|
842
|
+
const filePath = (0, import_node_path7.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
787
843
|
const fileContent = await readFileContent(filePath);
|
|
788
|
-
const {
|
|
789
|
-
|
|
790
|
-
if (!result.success) {
|
|
791
|
-
throw new Error(`Invalid frontmatter in ${filePath}: ${result.error.message}`);
|
|
792
|
-
}
|
|
793
|
-
return {
|
|
844
|
+
const { body: content } = parseFrontmatter(fileContent);
|
|
845
|
+
return new _CodexcliCommand({
|
|
794
846
|
baseDir,
|
|
795
|
-
relativeDirPath:
|
|
796
|
-
relativeFilePath: (0,
|
|
797
|
-
|
|
798
|
-
body: content.trim(),
|
|
847
|
+
relativeDirPath: paths.relativeDirPath,
|
|
848
|
+
relativeFilePath: (0, import_node_path7.basename)(relativeFilePath),
|
|
849
|
+
fileContent: content.trim(),
|
|
799
850
|
validate
|
|
800
|
-
};
|
|
851
|
+
});
|
|
801
852
|
}
|
|
802
853
|
};
|
|
803
854
|
|
|
804
855
|
// src/commands/copilot-command.ts
|
|
856
|
+
var import_node_path8 = require("path");
|
|
805
857
|
var CopilotCommand = class _CopilotCommand extends SimulatedCommand {
|
|
806
858
|
static getSettablePaths() {
|
|
807
859
|
return {
|
|
@@ -822,7 +874,7 @@ var CopilotCommand = class _CopilotCommand extends SimulatedCommand {
|
|
|
822
874
|
relativeFilePath,
|
|
823
875
|
validate = true
|
|
824
876
|
}) {
|
|
825
|
-
const filePath = (0,
|
|
877
|
+
const filePath = (0, import_node_path8.join)(
|
|
826
878
|
baseDir,
|
|
827
879
|
_CopilotCommand.getSettablePaths().relativeDirPath,
|
|
828
880
|
relativeFilePath
|
|
@@ -836,7 +888,7 @@ var CopilotCommand = class _CopilotCommand extends SimulatedCommand {
|
|
|
836
888
|
return new _CopilotCommand({
|
|
837
889
|
baseDir,
|
|
838
890
|
relativeDirPath: _CopilotCommand.getSettablePaths().relativeDirPath,
|
|
839
|
-
relativeFilePath: (0,
|
|
891
|
+
relativeFilePath: (0, import_node_path8.basename)(relativeFilePath),
|
|
840
892
|
frontmatter: result.data,
|
|
841
893
|
body: content.trim(),
|
|
842
894
|
validate
|
|
@@ -851,16 +903,16 @@ var CopilotCommand = class _CopilotCommand extends SimulatedCommand {
|
|
|
851
903
|
};
|
|
852
904
|
|
|
853
905
|
// src/commands/cursor-command.ts
|
|
854
|
-
var
|
|
906
|
+
var import_node_path9 = require("path");
|
|
855
907
|
var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
856
908
|
static getSettablePaths() {
|
|
857
909
|
return {
|
|
858
|
-
relativeDirPath: (0,
|
|
910
|
+
relativeDirPath: (0, import_node_path9.join)(".cursor", "commands")
|
|
859
911
|
};
|
|
860
912
|
}
|
|
861
913
|
static getSettablePathsGlobal() {
|
|
862
914
|
return {
|
|
863
|
-
relativeDirPath: (0,
|
|
915
|
+
relativeDirPath: (0, import_node_path9.join)(".cursor", "commands")
|
|
864
916
|
};
|
|
865
917
|
}
|
|
866
918
|
toRulesyncCommand() {
|
|
@@ -913,13 +965,13 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
|
913
965
|
global = false
|
|
914
966
|
}) {
|
|
915
967
|
const paths = global ? this.getSettablePathsGlobal() : this.getSettablePaths();
|
|
916
|
-
const filePath = (0,
|
|
968
|
+
const filePath = (0, import_node_path9.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
917
969
|
const fileContent = await readFileContent(filePath);
|
|
918
970
|
const { body: content } = parseFrontmatter(fileContent);
|
|
919
971
|
return new _CursorCommand({
|
|
920
972
|
baseDir,
|
|
921
973
|
relativeDirPath: paths.relativeDirPath,
|
|
922
|
-
relativeFilePath: (0,
|
|
974
|
+
relativeFilePath: (0, import_node_path9.basename)(relativeFilePath),
|
|
923
975
|
fileContent: content.trim(),
|
|
924
976
|
validate
|
|
925
977
|
});
|
|
@@ -927,7 +979,7 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
|
927
979
|
};
|
|
928
980
|
|
|
929
981
|
// src/commands/geminicli-command.ts
|
|
930
|
-
var
|
|
982
|
+
var import_node_path10 = require("path");
|
|
931
983
|
var import_smol_toml = require("smol-toml");
|
|
932
984
|
var import_mini6 = require("zod/mini");
|
|
933
985
|
var GeminiCliCommandFrontmatterSchema = import_mini6.z.object({
|
|
@@ -950,7 +1002,7 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
|
|
|
950
1002
|
}
|
|
951
1003
|
static getSettablePathsGlobal() {
|
|
952
1004
|
return {
|
|
953
|
-
relativeDirPath: (0,
|
|
1005
|
+
relativeDirPath: (0, import_node_path10.join)(".gemini", "commands")
|
|
954
1006
|
};
|
|
955
1007
|
}
|
|
956
1008
|
parseTomlContent(content) {
|
|
@@ -1022,12 +1074,12 @@ ${geminiFrontmatter.prompt}
|
|
|
1022
1074
|
global = false
|
|
1023
1075
|
}) {
|
|
1024
1076
|
const paths = global ? this.getSettablePathsGlobal() : this.getSettablePaths();
|
|
1025
|
-
const filePath = (0,
|
|
1077
|
+
const filePath = (0, import_node_path10.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1026
1078
|
const fileContent = await readFileContent(filePath);
|
|
1027
1079
|
return new _GeminiCliCommand({
|
|
1028
1080
|
baseDir,
|
|
1029
1081
|
relativeDirPath: paths.relativeDirPath,
|
|
1030
|
-
relativeFilePath: (0,
|
|
1082
|
+
relativeFilePath: (0, import_node_path10.basename)(relativeFilePath),
|
|
1031
1083
|
fileContent,
|
|
1032
1084
|
validate
|
|
1033
1085
|
});
|
|
@@ -1049,7 +1101,7 @@ ${geminiFrontmatter.prompt}
|
|
|
1049
1101
|
};
|
|
1050
1102
|
|
|
1051
1103
|
// src/commands/roo-command.ts
|
|
1052
|
-
var
|
|
1104
|
+
var import_node_path11 = require("path");
|
|
1053
1105
|
var import_mini7 = require("zod/mini");
|
|
1054
1106
|
var RooCommandFrontmatterSchema = import_mini7.z.object({
|
|
1055
1107
|
description: import_mini7.z.string(),
|
|
@@ -1143,7 +1195,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1143
1195
|
relativeFilePath,
|
|
1144
1196
|
validate = true
|
|
1145
1197
|
}) {
|
|
1146
|
-
const filePath = (0,
|
|
1198
|
+
const filePath = (0, import_node_path11.join)(baseDir, _RooCommand.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
1147
1199
|
const fileContent = await readFileContent(filePath);
|
|
1148
1200
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
1149
1201
|
const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -1153,7 +1205,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1153
1205
|
return new _RooCommand({
|
|
1154
1206
|
baseDir,
|
|
1155
1207
|
relativeDirPath: _RooCommand.getSettablePaths().relativeDirPath,
|
|
1156
|
-
relativeFilePath: (0,
|
|
1208
|
+
relativeFilePath: (0, import_node_path11.basename)(relativeFilePath),
|
|
1157
1209
|
frontmatter: result.data,
|
|
1158
1210
|
body: content.trim(),
|
|
1159
1211
|
fileContent,
|
|
@@ -1164,6 +1216,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1164
1216
|
|
|
1165
1217
|
// src/commands/commands-processor.ts
|
|
1166
1218
|
var commandsProcessorToolTargets = [
|
|
1219
|
+
"agentsmd",
|
|
1167
1220
|
"claudecode",
|
|
1168
1221
|
"geminicli",
|
|
1169
1222
|
"roo",
|
|
@@ -1174,7 +1227,7 @@ var CommandsProcessorToolTargetSchema = import_mini8.z.enum(
|
|
|
1174
1227
|
// codexcli is not in the list of tool targets but we add it here because it is a valid tool target for global mode generation
|
|
1175
1228
|
commandsProcessorToolTargets.concat("codexcli")
|
|
1176
1229
|
);
|
|
1177
|
-
var commandsProcessorToolTargetsSimulated = ["copilot"];
|
|
1230
|
+
var commandsProcessorToolTargetsSimulated = ["agentsmd", "copilot"];
|
|
1178
1231
|
var commandsProcessorToolTargetsGlobal = [
|
|
1179
1232
|
"claudecode",
|
|
1180
1233
|
"cursor",
|
|
@@ -1199,6 +1252,14 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1199
1252
|
);
|
|
1200
1253
|
const toolCommands = rulesyncCommands.map((rulesyncCommand) => {
|
|
1201
1254
|
switch (this.toolTarget) {
|
|
1255
|
+
case "agentsmd":
|
|
1256
|
+
if (!AgentsmdCommand.isTargetedByRulesyncCommand(rulesyncCommand)) {
|
|
1257
|
+
return null;
|
|
1258
|
+
}
|
|
1259
|
+
return AgentsmdCommand.fromRulesyncCommand({
|
|
1260
|
+
baseDir: this.baseDir,
|
|
1261
|
+
rulesyncCommand
|
|
1262
|
+
});
|
|
1202
1263
|
case "claudecode":
|
|
1203
1264
|
if (!ClaudecodeCommand.isTargetedByRulesyncCommand(rulesyncCommand)) {
|
|
1204
1265
|
return null;
|
|
@@ -1274,11 +1335,11 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1274
1335
|
*/
|
|
1275
1336
|
async loadRulesyncFiles() {
|
|
1276
1337
|
const rulesyncCommandPaths = await findFilesByGlobs(
|
|
1277
|
-
(0,
|
|
1338
|
+
(0, import_node_path12.join)(RulesyncCommand.getSettablePaths().relativeDirPath, "*.md")
|
|
1278
1339
|
);
|
|
1279
1340
|
const rulesyncCommands = (await Promise.allSettled(
|
|
1280
1341
|
rulesyncCommandPaths.map(
|
|
1281
|
-
(path2) => RulesyncCommand.fromFile({ relativeFilePath: (0,
|
|
1342
|
+
(path2) => RulesyncCommand.fromFile({ relativeFilePath: (0, import_node_path12.basename)(path2) })
|
|
1282
1343
|
)
|
|
1283
1344
|
)).filter((result) => result.status === "fulfilled").map((result) => result.value);
|
|
1284
1345
|
logger.info(`Successfully loaded ${rulesyncCommands.length} rulesync commands`);
|
|
@@ -1290,6 +1351,8 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1290
1351
|
*/
|
|
1291
1352
|
async loadToolFiles() {
|
|
1292
1353
|
switch (this.toolTarget) {
|
|
1354
|
+
case "agentsmd":
|
|
1355
|
+
return await this.loadAgentsmdCommands();
|
|
1293
1356
|
case "claudecode":
|
|
1294
1357
|
return await this.loadClaudecodeCommands();
|
|
1295
1358
|
case "geminicli":
|
|
@@ -1315,43 +1378,48 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1315
1378
|
extension
|
|
1316
1379
|
}) {
|
|
1317
1380
|
const commandFilePaths = await findFilesByGlobs(
|
|
1318
|
-
(0,
|
|
1381
|
+
(0, import_node_path12.join)(this.baseDir, relativeDirPath, `*.${extension}`)
|
|
1319
1382
|
);
|
|
1320
1383
|
const toolCommands = (await Promise.allSettled(
|
|
1321
1384
|
commandFilePaths.map((path2) => {
|
|
1322
1385
|
switch (toolTarget) {
|
|
1386
|
+
case "agentsmd":
|
|
1387
|
+
return AgentsmdCommand.fromFile({
|
|
1388
|
+
baseDir: this.baseDir,
|
|
1389
|
+
relativeFilePath: (0, import_node_path12.basename)(path2)
|
|
1390
|
+
});
|
|
1323
1391
|
case "claudecode":
|
|
1324
1392
|
return ClaudecodeCommand.fromFile({
|
|
1325
1393
|
baseDir: this.baseDir,
|
|
1326
|
-
relativeFilePath: (0,
|
|
1394
|
+
relativeFilePath: (0, import_node_path12.basename)(path2),
|
|
1327
1395
|
global: this.global
|
|
1328
1396
|
});
|
|
1329
1397
|
case "geminicli":
|
|
1330
1398
|
return GeminiCliCommand.fromFile({
|
|
1331
1399
|
baseDir: this.baseDir,
|
|
1332
|
-
relativeFilePath: (0,
|
|
1400
|
+
relativeFilePath: (0, import_node_path12.basename)(path2),
|
|
1333
1401
|
global: this.global
|
|
1334
1402
|
});
|
|
1335
1403
|
case "roo":
|
|
1336
1404
|
return RooCommand.fromFile({
|
|
1337
1405
|
baseDir: this.baseDir,
|
|
1338
|
-
relativeFilePath: (0,
|
|
1406
|
+
relativeFilePath: (0, import_node_path12.basename)(path2)
|
|
1339
1407
|
});
|
|
1340
1408
|
case "copilot":
|
|
1341
1409
|
return CopilotCommand.fromFile({
|
|
1342
1410
|
baseDir: this.baseDir,
|
|
1343
|
-
relativeFilePath: (0,
|
|
1411
|
+
relativeFilePath: (0, import_node_path12.basename)(path2)
|
|
1344
1412
|
});
|
|
1345
1413
|
case "cursor":
|
|
1346
1414
|
return CursorCommand.fromFile({
|
|
1347
1415
|
baseDir: this.baseDir,
|
|
1348
|
-
relativeFilePath: (0,
|
|
1416
|
+
relativeFilePath: (0, import_node_path12.basename)(path2),
|
|
1349
1417
|
global: this.global
|
|
1350
1418
|
});
|
|
1351
1419
|
case "codexcli":
|
|
1352
1420
|
return CodexcliCommand.fromFile({
|
|
1353
1421
|
baseDir: this.baseDir,
|
|
1354
|
-
relativeFilePath: (0,
|
|
1422
|
+
relativeFilePath: (0, import_node_path12.basename)(path2),
|
|
1355
1423
|
global: this.global
|
|
1356
1424
|
});
|
|
1357
1425
|
default:
|
|
@@ -1363,7 +1431,17 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1363
1431
|
return toolCommands;
|
|
1364
1432
|
}
|
|
1365
1433
|
/**
|
|
1366
|
-
* Load
|
|
1434
|
+
* Load Agents.md command configurations from .agents/commands/ directory
|
|
1435
|
+
*/
|
|
1436
|
+
async loadAgentsmdCommands() {
|
|
1437
|
+
return await this.loadToolCommandDefault({
|
|
1438
|
+
toolTarget: "agentsmd",
|
|
1439
|
+
relativeDirPath: AgentsmdCommand.getSettablePaths().relativeDirPath,
|
|
1440
|
+
extension: "md"
|
|
1441
|
+
});
|
|
1442
|
+
}
|
|
1443
|
+
/**
|
|
1444
|
+
* Load Copilot command configurations from .github/commands/ directory
|
|
1367
1445
|
*/
|
|
1368
1446
|
async loadCopilotCommands() {
|
|
1369
1447
|
return await this.loadToolCommandDefault({
|
|
@@ -1449,7 +1527,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1449
1527
|
};
|
|
1450
1528
|
|
|
1451
1529
|
// src/config/config-resolver.ts
|
|
1452
|
-
var
|
|
1530
|
+
var import_node_path13 = require("path");
|
|
1453
1531
|
var import_c12 = require("c12");
|
|
1454
1532
|
|
|
1455
1533
|
// src/config/config.ts
|
|
@@ -1585,7 +1663,7 @@ function getBaseDirsInLightOfGlobal({
|
|
|
1585
1663
|
global
|
|
1586
1664
|
}) {
|
|
1587
1665
|
if (isEnvTest) {
|
|
1588
|
-
return baseDirs.map((baseDir) => (0,
|
|
1666
|
+
return baseDirs.map((baseDir) => (0, import_node_path13.join)(".", baseDir));
|
|
1589
1667
|
}
|
|
1590
1668
|
if (global) {
|
|
1591
1669
|
return [getHomeDirectory()];
|
|
@@ -1600,7 +1678,7 @@ function getBaseDirsInLightOfGlobal({
|
|
|
1600
1678
|
var import_mini9 = require("zod/mini");
|
|
1601
1679
|
|
|
1602
1680
|
// src/ignore/amazonqcli-ignore.ts
|
|
1603
|
-
var
|
|
1681
|
+
var import_node_path14 = require("path");
|
|
1604
1682
|
|
|
1605
1683
|
// src/types/tool-file.ts
|
|
1606
1684
|
var ToolFile = class extends AiFile {
|
|
@@ -1708,7 +1786,7 @@ var AmazonqcliIgnore = class _AmazonqcliIgnore extends ToolIgnore {
|
|
|
1708
1786
|
validate = true
|
|
1709
1787
|
}) {
|
|
1710
1788
|
const fileContent = await readFileContent(
|
|
1711
|
-
(0,
|
|
1789
|
+
(0, import_node_path14.join)(
|
|
1712
1790
|
baseDir,
|
|
1713
1791
|
this.getSettablePaths().relativeDirPath,
|
|
1714
1792
|
this.getSettablePaths().relativeFilePath
|
|
@@ -1725,7 +1803,7 @@ var AmazonqcliIgnore = class _AmazonqcliIgnore extends ToolIgnore {
|
|
|
1725
1803
|
};
|
|
1726
1804
|
|
|
1727
1805
|
// src/ignore/augmentcode-ignore.ts
|
|
1728
|
-
var
|
|
1806
|
+
var import_node_path15 = require("path");
|
|
1729
1807
|
var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
1730
1808
|
static getSettablePaths() {
|
|
1731
1809
|
return {
|
|
@@ -1763,7 +1841,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
1763
1841
|
validate = true
|
|
1764
1842
|
}) {
|
|
1765
1843
|
const fileContent = await readFileContent(
|
|
1766
|
-
(0,
|
|
1844
|
+
(0, import_node_path15.join)(
|
|
1767
1845
|
baseDir,
|
|
1768
1846
|
this.getSettablePaths().relativeDirPath,
|
|
1769
1847
|
this.getSettablePaths().relativeFilePath
|
|
@@ -1780,7 +1858,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
1780
1858
|
};
|
|
1781
1859
|
|
|
1782
1860
|
// src/ignore/claudecode-ignore.ts
|
|
1783
|
-
var
|
|
1861
|
+
var import_node_path16 = require("path");
|
|
1784
1862
|
var import_es_toolkit = require("es-toolkit");
|
|
1785
1863
|
var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
1786
1864
|
constructor(params) {
|
|
@@ -1816,7 +1894,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
1816
1894
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
1817
1895
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
1818
1896
|
const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
|
|
1819
|
-
const filePath = (0,
|
|
1897
|
+
const filePath = (0, import_node_path16.join)(
|
|
1820
1898
|
baseDir,
|
|
1821
1899
|
this.getSettablePaths().relativeDirPath,
|
|
1822
1900
|
this.getSettablePaths().relativeFilePath
|
|
@@ -1844,7 +1922,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
1844
1922
|
validate = true
|
|
1845
1923
|
}) {
|
|
1846
1924
|
const fileContent = await readFileContent(
|
|
1847
|
-
(0,
|
|
1925
|
+
(0, import_node_path16.join)(
|
|
1848
1926
|
baseDir,
|
|
1849
1927
|
this.getSettablePaths().relativeDirPath,
|
|
1850
1928
|
this.getSettablePaths().relativeFilePath
|
|
@@ -1861,7 +1939,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
1861
1939
|
};
|
|
1862
1940
|
|
|
1863
1941
|
// src/ignore/cline-ignore.ts
|
|
1864
|
-
var
|
|
1942
|
+
var import_node_path17 = require("path");
|
|
1865
1943
|
var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
1866
1944
|
static getSettablePaths() {
|
|
1867
1945
|
return {
|
|
@@ -1898,7 +1976,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
1898
1976
|
validate = true
|
|
1899
1977
|
}) {
|
|
1900
1978
|
const fileContent = await readFileContent(
|
|
1901
|
-
(0,
|
|
1979
|
+
(0, import_node_path17.join)(
|
|
1902
1980
|
baseDir,
|
|
1903
1981
|
this.getSettablePaths().relativeDirPath,
|
|
1904
1982
|
this.getSettablePaths().relativeFilePath
|
|
@@ -1915,7 +1993,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
1915
1993
|
};
|
|
1916
1994
|
|
|
1917
1995
|
// src/ignore/cursor-ignore.ts
|
|
1918
|
-
var
|
|
1996
|
+
var import_node_path18 = require("path");
|
|
1919
1997
|
var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
1920
1998
|
static getSettablePaths() {
|
|
1921
1999
|
return {
|
|
@@ -1948,7 +2026,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
1948
2026
|
validate = true
|
|
1949
2027
|
}) {
|
|
1950
2028
|
const fileContent = await readFileContent(
|
|
1951
|
-
(0,
|
|
2029
|
+
(0, import_node_path18.join)(
|
|
1952
2030
|
baseDir,
|
|
1953
2031
|
this.getSettablePaths().relativeDirPath,
|
|
1954
2032
|
this.getSettablePaths().relativeFilePath
|
|
@@ -1965,7 +2043,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
1965
2043
|
};
|
|
1966
2044
|
|
|
1967
2045
|
// src/ignore/geminicli-ignore.ts
|
|
1968
|
-
var
|
|
2046
|
+
var import_node_path19 = require("path");
|
|
1969
2047
|
var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
1970
2048
|
static getSettablePaths() {
|
|
1971
2049
|
return {
|
|
@@ -1992,7 +2070,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
1992
2070
|
validate = true
|
|
1993
2071
|
}) {
|
|
1994
2072
|
const fileContent = await readFileContent(
|
|
1995
|
-
(0,
|
|
2073
|
+
(0, import_node_path19.join)(
|
|
1996
2074
|
baseDir,
|
|
1997
2075
|
this.getSettablePaths().relativeDirPath,
|
|
1998
2076
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2009,7 +2087,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
2009
2087
|
};
|
|
2010
2088
|
|
|
2011
2089
|
// src/ignore/junie-ignore.ts
|
|
2012
|
-
var
|
|
2090
|
+
var import_node_path20 = require("path");
|
|
2013
2091
|
var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
2014
2092
|
static getSettablePaths() {
|
|
2015
2093
|
return {
|
|
@@ -2036,7 +2114,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
2036
2114
|
validate = true
|
|
2037
2115
|
}) {
|
|
2038
2116
|
const fileContent = await readFileContent(
|
|
2039
|
-
(0,
|
|
2117
|
+
(0, import_node_path20.join)(
|
|
2040
2118
|
baseDir,
|
|
2041
2119
|
this.getSettablePaths().relativeDirPath,
|
|
2042
2120
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2053,7 +2131,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
2053
2131
|
};
|
|
2054
2132
|
|
|
2055
2133
|
// src/ignore/kiro-ignore.ts
|
|
2056
|
-
var
|
|
2134
|
+
var import_node_path21 = require("path");
|
|
2057
2135
|
var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
2058
2136
|
static getSettablePaths() {
|
|
2059
2137
|
return {
|
|
@@ -2080,7 +2158,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
2080
2158
|
validate = true
|
|
2081
2159
|
}) {
|
|
2082
2160
|
const fileContent = await readFileContent(
|
|
2083
|
-
(0,
|
|
2161
|
+
(0, import_node_path21.join)(
|
|
2084
2162
|
baseDir,
|
|
2085
2163
|
this.getSettablePaths().relativeDirPath,
|
|
2086
2164
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2097,7 +2175,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
2097
2175
|
};
|
|
2098
2176
|
|
|
2099
2177
|
// src/ignore/qwencode-ignore.ts
|
|
2100
|
-
var
|
|
2178
|
+
var import_node_path22 = require("path");
|
|
2101
2179
|
var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
2102
2180
|
static getSettablePaths() {
|
|
2103
2181
|
return {
|
|
@@ -2124,7 +2202,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
2124
2202
|
validate = true
|
|
2125
2203
|
}) {
|
|
2126
2204
|
const fileContent = await readFileContent(
|
|
2127
|
-
(0,
|
|
2205
|
+
(0, import_node_path22.join)(
|
|
2128
2206
|
baseDir,
|
|
2129
2207
|
this.getSettablePaths().relativeDirPath,
|
|
2130
2208
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2141,7 +2219,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
2141
2219
|
};
|
|
2142
2220
|
|
|
2143
2221
|
// src/ignore/roo-ignore.ts
|
|
2144
|
-
var
|
|
2222
|
+
var import_node_path23 = require("path");
|
|
2145
2223
|
var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
2146
2224
|
static getSettablePaths() {
|
|
2147
2225
|
return {
|
|
@@ -2168,7 +2246,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
2168
2246
|
validate = true
|
|
2169
2247
|
}) {
|
|
2170
2248
|
const fileContent = await readFileContent(
|
|
2171
|
-
(0,
|
|
2249
|
+
(0, import_node_path23.join)(
|
|
2172
2250
|
baseDir,
|
|
2173
2251
|
this.getSettablePaths().relativeDirPath,
|
|
2174
2252
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2185,7 +2263,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
2185
2263
|
};
|
|
2186
2264
|
|
|
2187
2265
|
// src/ignore/windsurf-ignore.ts
|
|
2188
|
-
var
|
|
2266
|
+
var import_node_path24 = require("path");
|
|
2189
2267
|
var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
2190
2268
|
static getSettablePaths() {
|
|
2191
2269
|
return {
|
|
@@ -2212,7 +2290,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
2212
2290
|
validate = true
|
|
2213
2291
|
}) {
|
|
2214
2292
|
const fileContent = await readFileContent(
|
|
2215
|
-
(0,
|
|
2293
|
+
(0, import_node_path24.join)(
|
|
2216
2294
|
baseDir,
|
|
2217
2295
|
this.getSettablePaths().relativeDirPath,
|
|
2218
2296
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2414,10 +2492,10 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
2414
2492
|
var import_mini11 = require("zod/mini");
|
|
2415
2493
|
|
|
2416
2494
|
// src/mcp/amazonqcli-mcp.ts
|
|
2417
|
-
var
|
|
2495
|
+
var import_node_path26 = require("path");
|
|
2418
2496
|
|
|
2419
2497
|
// src/mcp/rulesync-mcp.ts
|
|
2420
|
-
var
|
|
2498
|
+
var import_node_path25 = require("path");
|
|
2421
2499
|
var import_mini10 = require("zod/mini");
|
|
2422
2500
|
var McpTransportTypeSchema = import_mini10.z.enum(["stdio", "sse", "http"]);
|
|
2423
2501
|
var McpServerBaseSchema = import_mini10.z.object({
|
|
@@ -2468,7 +2546,7 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
2468
2546
|
}
|
|
2469
2547
|
static async fromFile({ validate = true }) {
|
|
2470
2548
|
const fileContent = await readFileContent(
|
|
2471
|
-
(0,
|
|
2549
|
+
(0, import_node_path25.join)(this.getSettablePaths().relativeDirPath, this.getSettablePaths().relativeFilePath)
|
|
2472
2550
|
);
|
|
2473
2551
|
return new _RulesyncMcp({
|
|
2474
2552
|
baseDir: ".",
|
|
@@ -2535,7 +2613,7 @@ var AmazonqcliMcp = class _AmazonqcliMcp extends ToolMcp {
|
|
|
2535
2613
|
validate = true
|
|
2536
2614
|
}) {
|
|
2537
2615
|
const fileContent = await readFileContent(
|
|
2538
|
-
(0,
|
|
2616
|
+
(0, import_node_path26.join)(
|
|
2539
2617
|
baseDir,
|
|
2540
2618
|
this.getSettablePaths().relativeDirPath,
|
|
2541
2619
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2571,7 +2649,7 @@ var AmazonqcliMcp = class _AmazonqcliMcp extends ToolMcp {
|
|
|
2571
2649
|
};
|
|
2572
2650
|
|
|
2573
2651
|
// src/mcp/claudecode-mcp.ts
|
|
2574
|
-
var
|
|
2652
|
+
var import_node_path27 = require("path");
|
|
2575
2653
|
var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
2576
2654
|
static getSettablePaths() {
|
|
2577
2655
|
return {
|
|
@@ -2584,7 +2662,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
2584
2662
|
validate = true
|
|
2585
2663
|
}) {
|
|
2586
2664
|
const fileContent = await readFileContent(
|
|
2587
|
-
(0,
|
|
2665
|
+
(0, import_node_path27.join)(
|
|
2588
2666
|
baseDir,
|
|
2589
2667
|
this.getSettablePaths().relativeDirPath,
|
|
2590
2668
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2620,7 +2698,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
2620
2698
|
};
|
|
2621
2699
|
|
|
2622
2700
|
// src/mcp/cline-mcp.ts
|
|
2623
|
-
var
|
|
2701
|
+
var import_node_path28 = require("path");
|
|
2624
2702
|
var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
2625
2703
|
static getSettablePaths() {
|
|
2626
2704
|
return {
|
|
@@ -2633,7 +2711,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
2633
2711
|
validate = true
|
|
2634
2712
|
}) {
|
|
2635
2713
|
const fileContent = await readFileContent(
|
|
2636
|
-
(0,
|
|
2714
|
+
(0, import_node_path28.join)(
|
|
2637
2715
|
baseDir,
|
|
2638
2716
|
this.getSettablePaths().relativeDirPath,
|
|
2639
2717
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2669,7 +2747,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
2669
2747
|
};
|
|
2670
2748
|
|
|
2671
2749
|
// src/mcp/copilot-mcp.ts
|
|
2672
|
-
var
|
|
2750
|
+
var import_node_path29 = require("path");
|
|
2673
2751
|
var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
2674
2752
|
static getSettablePaths() {
|
|
2675
2753
|
return {
|
|
@@ -2682,7 +2760,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
2682
2760
|
validate = true
|
|
2683
2761
|
}) {
|
|
2684
2762
|
const fileContent = await readFileContent(
|
|
2685
|
-
(0,
|
|
2763
|
+
(0, import_node_path29.join)(
|
|
2686
2764
|
baseDir,
|
|
2687
2765
|
this.getSettablePaths().relativeDirPath,
|
|
2688
2766
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2718,7 +2796,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
2718
2796
|
};
|
|
2719
2797
|
|
|
2720
2798
|
// src/mcp/cursor-mcp.ts
|
|
2721
|
-
var
|
|
2799
|
+
var import_node_path30 = require("path");
|
|
2722
2800
|
var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
2723
2801
|
static getSettablePaths() {
|
|
2724
2802
|
return {
|
|
@@ -2731,7 +2809,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
2731
2809
|
validate = true
|
|
2732
2810
|
}) {
|
|
2733
2811
|
const fileContent = await readFileContent(
|
|
2734
|
-
(0,
|
|
2812
|
+
(0, import_node_path30.join)(
|
|
2735
2813
|
baseDir,
|
|
2736
2814
|
this.getSettablePaths().relativeDirPath,
|
|
2737
2815
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2778,7 +2856,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
2778
2856
|
};
|
|
2779
2857
|
|
|
2780
2858
|
// src/mcp/roo-mcp.ts
|
|
2781
|
-
var
|
|
2859
|
+
var import_node_path31 = require("path");
|
|
2782
2860
|
var RooMcp = class _RooMcp extends ToolMcp {
|
|
2783
2861
|
static getSettablePaths() {
|
|
2784
2862
|
return {
|
|
@@ -2791,7 +2869,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
2791
2869
|
validate = true
|
|
2792
2870
|
}) {
|
|
2793
2871
|
const fileContent = await readFileContent(
|
|
2794
|
-
(0,
|
|
2872
|
+
(0, import_node_path31.join)(
|
|
2795
2873
|
baseDir,
|
|
2796
2874
|
this.getSettablePaths().relativeDirPath,
|
|
2797
2875
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2998,12 +3076,12 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
2998
3076
|
};
|
|
2999
3077
|
|
|
3000
3078
|
// src/rules/rules-processor.ts
|
|
3001
|
-
var
|
|
3079
|
+
var import_node_path55 = require("path");
|
|
3002
3080
|
var import_fast_xml_parser = require("fast-xml-parser");
|
|
3003
3081
|
var import_mini20 = require("zod/mini");
|
|
3004
3082
|
|
|
3005
3083
|
// src/subagents/simulated-subagent.ts
|
|
3006
|
-
var
|
|
3084
|
+
var import_node_path32 = require("path");
|
|
3007
3085
|
var import_mini12 = require("zod/mini");
|
|
3008
3086
|
|
|
3009
3087
|
// src/subagents/tool-subagent.ts
|
|
@@ -3105,7 +3183,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
3105
3183
|
relativeFilePath,
|
|
3106
3184
|
validate = true
|
|
3107
3185
|
}) {
|
|
3108
|
-
const filePath = (0,
|
|
3186
|
+
const filePath = (0, import_node_path32.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
3109
3187
|
const fileContent = await readFileContent(filePath);
|
|
3110
3188
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
3111
3189
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -3115,7 +3193,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
3115
3193
|
return {
|
|
3116
3194
|
baseDir,
|
|
3117
3195
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
3118
|
-
relativeFilePath: (0,
|
|
3196
|
+
relativeFilePath: (0, import_node_path32.basename)(relativeFilePath),
|
|
3119
3197
|
frontmatter: result.data,
|
|
3120
3198
|
body: content.trim(),
|
|
3121
3199
|
validate
|
|
@@ -3123,6 +3201,29 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
3123
3201
|
}
|
|
3124
3202
|
};
|
|
3125
3203
|
|
|
3204
|
+
// src/subagents/agentsmd-subagent.ts
|
|
3205
|
+
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
3206
|
+
static getSettablePaths() {
|
|
3207
|
+
return {
|
|
3208
|
+
relativeDirPath: ".agents/subagents"
|
|
3209
|
+
};
|
|
3210
|
+
}
|
|
3211
|
+
static async fromFile(params) {
|
|
3212
|
+
const baseParams = await this.fromFileDefault(params);
|
|
3213
|
+
return new _AgentsmdSubagent(baseParams);
|
|
3214
|
+
}
|
|
3215
|
+
static fromRulesyncSubagent(params) {
|
|
3216
|
+
const baseParams = this.fromRulesyncSubagentDefault(params);
|
|
3217
|
+
return new _AgentsmdSubagent(baseParams);
|
|
3218
|
+
}
|
|
3219
|
+
static isTargetedByRulesyncSubagent(rulesyncSubagent) {
|
|
3220
|
+
return this.isTargetedByRulesyncSubagentDefault({
|
|
3221
|
+
rulesyncSubagent,
|
|
3222
|
+
toolTarget: "agentsmd"
|
|
3223
|
+
});
|
|
3224
|
+
}
|
|
3225
|
+
};
|
|
3226
|
+
|
|
3126
3227
|
// src/subagents/codexcli-subagent.ts
|
|
3127
3228
|
var CodexCliSubagent = class _CodexCliSubagent extends SimulatedSubagent {
|
|
3128
3229
|
static getSettablePaths() {
|
|
@@ -3239,15 +3340,15 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
3239
3340
|
};
|
|
3240
3341
|
|
|
3241
3342
|
// src/subagents/subagents-processor.ts
|
|
3242
|
-
var
|
|
3343
|
+
var import_node_path35 = require("path");
|
|
3243
3344
|
var import_mini15 = require("zod/mini");
|
|
3244
3345
|
|
|
3245
3346
|
// src/subagents/claudecode-subagent.ts
|
|
3246
|
-
var
|
|
3347
|
+
var import_node_path34 = require("path");
|
|
3247
3348
|
var import_mini14 = require("zod/mini");
|
|
3248
3349
|
|
|
3249
3350
|
// src/subagents/rulesync-subagent.ts
|
|
3250
|
-
var
|
|
3351
|
+
var import_node_path33 = require("path");
|
|
3251
3352
|
var import_mini13 = require("zod/mini");
|
|
3252
3353
|
var RulesyncSubagentModelSchema = import_mini13.z.enum(["opus", "sonnet", "haiku", "inherit"]);
|
|
3253
3354
|
var RulesyncSubagentFrontmatterSchema = import_mini13.z.object({
|
|
@@ -3301,13 +3402,13 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
3301
3402
|
static async fromFile({
|
|
3302
3403
|
relativeFilePath
|
|
3303
3404
|
}) {
|
|
3304
|
-
const fileContent = await readFileContent((0,
|
|
3405
|
+
const fileContent = await readFileContent((0, import_node_path33.join)(".rulesync/subagents", relativeFilePath));
|
|
3305
3406
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
3306
3407
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
3307
3408
|
if (!result.success) {
|
|
3308
3409
|
throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${result.error.message}`);
|
|
3309
3410
|
}
|
|
3310
|
-
const filename = (0,
|
|
3411
|
+
const filename = (0, import_node_path33.basename)(relativeFilePath);
|
|
3311
3412
|
return new _RulesyncSubagent({
|
|
3312
3413
|
baseDir: ".",
|
|
3313
3414
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
@@ -3419,7 +3520,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3419
3520
|
relativeFilePath,
|
|
3420
3521
|
validate = true
|
|
3421
3522
|
}) {
|
|
3422
|
-
const fileContent = await readFileContent((0,
|
|
3523
|
+
const fileContent = await readFileContent((0, import_node_path34.join)(baseDir, ".claude/agents", relativeFilePath));
|
|
3423
3524
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
3424
3525
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
3425
3526
|
if (!result.success) {
|
|
@@ -3439,6 +3540,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3439
3540
|
|
|
3440
3541
|
// src/subagents/subagents-processor.ts
|
|
3441
3542
|
var subagentsProcessorToolTargets = [
|
|
3543
|
+
"agentsmd",
|
|
3442
3544
|
"claudecode",
|
|
3443
3545
|
"copilot",
|
|
3444
3546
|
"cursor",
|
|
@@ -3447,6 +3549,7 @@ var subagentsProcessorToolTargets = [
|
|
|
3447
3549
|
"roo"
|
|
3448
3550
|
];
|
|
3449
3551
|
var subagentsProcessorToolTargetsSimulated = [
|
|
3552
|
+
"agentsmd",
|
|
3450
3553
|
"copilot",
|
|
3451
3554
|
"cursor",
|
|
3452
3555
|
"codexcli",
|
|
@@ -3469,6 +3572,15 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
3469
3572
|
);
|
|
3470
3573
|
const toolSubagents = rulesyncSubagents.map((rulesyncSubagent) => {
|
|
3471
3574
|
switch (this.toolTarget) {
|
|
3575
|
+
case "agentsmd":
|
|
3576
|
+
if (!AgentsmdSubagent.isTargetedByRulesyncSubagent(rulesyncSubagent)) {
|
|
3577
|
+
return null;
|
|
3578
|
+
}
|
|
3579
|
+
return AgentsmdSubagent.fromRulesyncSubagent({
|
|
3580
|
+
baseDir: this.baseDir,
|
|
3581
|
+
relativeDirPath: RulesyncSubagent.getSettablePaths().relativeDirPath,
|
|
3582
|
+
rulesyncSubagent
|
|
3583
|
+
});
|
|
3472
3584
|
case "claudecode":
|
|
3473
3585
|
if (!ClaudecodeSubagent.isTargetedByRulesyncSubagent(rulesyncSubagent)) {
|
|
3474
3586
|
return null;
|
|
@@ -3550,7 +3662,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
3550
3662
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
3551
3663
|
*/
|
|
3552
3664
|
async loadRulesyncFiles() {
|
|
3553
|
-
const subagentsDir = (0,
|
|
3665
|
+
const subagentsDir = (0, import_node_path35.join)(this.baseDir, RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
3554
3666
|
const dirExists = await directoryExists(subagentsDir);
|
|
3555
3667
|
if (!dirExists) {
|
|
3556
3668
|
logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -3565,7 +3677,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
3565
3677
|
logger.info(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
3566
3678
|
const rulesyncSubagents = [];
|
|
3567
3679
|
for (const mdFile of mdFiles) {
|
|
3568
|
-
const filepath = (0,
|
|
3680
|
+
const filepath = (0, import_node_path35.join)(subagentsDir, mdFile);
|
|
3569
3681
|
try {
|
|
3570
3682
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
3571
3683
|
relativeFilePath: mdFile,
|
|
@@ -3591,6 +3703,8 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
3591
3703
|
*/
|
|
3592
3704
|
async loadToolFiles() {
|
|
3593
3705
|
switch (this.toolTarget) {
|
|
3706
|
+
case "agentsmd":
|
|
3707
|
+
return await this.loadAgentsmdSubagents();
|
|
3594
3708
|
case "claudecode":
|
|
3595
3709
|
return await this.loadClaudecodeSubagents();
|
|
3596
3710
|
case "copilot":
|
|
@@ -3610,6 +3724,15 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
3610
3724
|
async loadToolFilesToDelete() {
|
|
3611
3725
|
return this.loadToolFiles();
|
|
3612
3726
|
}
|
|
3727
|
+
/**
|
|
3728
|
+
* Load Agents.md subagent configurations from .agents/subagents/ directory
|
|
3729
|
+
*/
|
|
3730
|
+
async loadAgentsmdSubagents() {
|
|
3731
|
+
return await this.loadToolSubagentsDefault({
|
|
3732
|
+
relativeDirPath: AgentsmdSubagent.getSettablePaths().relativeDirPath,
|
|
3733
|
+
fromFile: (relativeFilePath) => AgentsmdSubagent.fromFile({ relativeFilePath })
|
|
3734
|
+
});
|
|
3735
|
+
}
|
|
3613
3736
|
/**
|
|
3614
3737
|
* Load Claude Code subagent configurations from .claude/agents/ directory
|
|
3615
3738
|
*/
|
|
@@ -3668,8 +3791,8 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
3668
3791
|
relativeDirPath,
|
|
3669
3792
|
fromFile
|
|
3670
3793
|
}) {
|
|
3671
|
-
const paths = await findFilesByGlobs((0,
|
|
3672
|
-
const subagents = (await Promise.allSettled(paths.map((path2) => fromFile((0,
|
|
3794
|
+
const paths = await findFilesByGlobs((0, import_node_path35.join)(this.baseDir, relativeDirPath, "*.md"));
|
|
3795
|
+
const subagents = (await Promise.allSettled(paths.map((path2) => fromFile((0, import_node_path35.basename)(path2))))).filter((r) => r.status === "fulfilled").map((r) => r.value);
|
|
3673
3796
|
logger.info(`Successfully loaded ${subagents.length} ${relativeDirPath} subagents`);
|
|
3674
3797
|
return subagents;
|
|
3675
3798
|
}
|
|
@@ -3693,13 +3816,13 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
3693
3816
|
};
|
|
3694
3817
|
|
|
3695
3818
|
// src/rules/agentsmd-rule.ts
|
|
3696
|
-
var
|
|
3819
|
+
var import_node_path38 = require("path");
|
|
3697
3820
|
|
|
3698
3821
|
// src/rules/tool-rule.ts
|
|
3699
|
-
var
|
|
3822
|
+
var import_node_path37 = require("path");
|
|
3700
3823
|
|
|
3701
3824
|
// src/rules/rulesync-rule.ts
|
|
3702
|
-
var
|
|
3825
|
+
var import_node_path36 = require("path");
|
|
3703
3826
|
var import_mini16 = require("zod/mini");
|
|
3704
3827
|
var RulesyncRuleFrontmatterSchema = import_mini16.z.object({
|
|
3705
3828
|
root: import_mini16.z.optional(import_mini16.z.optional(import_mini16.z.boolean())),
|
|
@@ -3765,7 +3888,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
3765
3888
|
relativeFilePath,
|
|
3766
3889
|
validate = true
|
|
3767
3890
|
}) {
|
|
3768
|
-
const filePath = (0,
|
|
3891
|
+
const filePath = (0, import_node_path36.join)(this.getSettablePaths().legacy.relativeDirPath, relativeFilePath);
|
|
3769
3892
|
const fileContent = await readFileContent(filePath);
|
|
3770
3893
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
3771
3894
|
const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -3780,7 +3903,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
3780
3903
|
agentsmd: result.data.agentsmd,
|
|
3781
3904
|
cursor: result.data.cursor
|
|
3782
3905
|
};
|
|
3783
|
-
const filename = (0,
|
|
3906
|
+
const filename = (0, import_node_path36.basename)(filePath);
|
|
3784
3907
|
return new _RulesyncRule({
|
|
3785
3908
|
baseDir: ".",
|
|
3786
3909
|
relativeDirPath: this.getSettablePaths().recommended.relativeDirPath,
|
|
@@ -3794,7 +3917,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
3794
3917
|
relativeFilePath,
|
|
3795
3918
|
validate = true
|
|
3796
3919
|
}) {
|
|
3797
|
-
const filePath = (0,
|
|
3920
|
+
const filePath = (0, import_node_path36.join)(this.getSettablePaths().recommended.relativeDirPath, relativeFilePath);
|
|
3798
3921
|
const fileContent = await readFileContent(filePath);
|
|
3799
3922
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
3800
3923
|
const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -3809,7 +3932,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
3809
3932
|
agentsmd: result.data.agentsmd,
|
|
3810
3933
|
cursor: result.data.cursor
|
|
3811
3934
|
};
|
|
3812
|
-
const filename = (0,
|
|
3935
|
+
const filename = (0, import_node_path36.basename)(filePath);
|
|
3813
3936
|
return new _RulesyncRule({
|
|
3814
3937
|
baseDir: ".",
|
|
3815
3938
|
relativeDirPath: this.getSettablePaths().recommended.relativeDirPath,
|
|
@@ -3898,7 +4021,7 @@ var ToolRule = class extends ToolFile {
|
|
|
3898
4021
|
});
|
|
3899
4022
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
3900
4023
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
3901
|
-
params.relativeDirPath = (0,
|
|
4024
|
+
params.relativeDirPath = (0, import_node_path37.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
3902
4025
|
params.relativeFilePath = "AGENTS.md";
|
|
3903
4026
|
}
|
|
3904
4027
|
return params;
|
|
@@ -3974,8 +4097,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
3974
4097
|
validate = true
|
|
3975
4098
|
}) {
|
|
3976
4099
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
3977
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
3978
|
-
const fileContent = await readFileContent((0,
|
|
4100
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path38.join)(".agents/memories", relativeFilePath);
|
|
4101
|
+
const fileContent = await readFileContent((0, import_node_path38.join)(baseDir, relativePath));
|
|
3979
4102
|
return new _AgentsMdRule({
|
|
3980
4103
|
baseDir,
|
|
3981
4104
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4015,7 +4138,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
4015
4138
|
};
|
|
4016
4139
|
|
|
4017
4140
|
// src/rules/amazonqcli-rule.ts
|
|
4018
|
-
var
|
|
4141
|
+
var import_node_path39 = require("path");
|
|
4019
4142
|
var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
4020
4143
|
static getSettablePaths() {
|
|
4021
4144
|
return {
|
|
@@ -4030,7 +4153,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
|
4030
4153
|
validate = true
|
|
4031
4154
|
}) {
|
|
4032
4155
|
const fileContent = await readFileContent(
|
|
4033
|
-
(0,
|
|
4156
|
+
(0, import_node_path39.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4034
4157
|
);
|
|
4035
4158
|
return new _AmazonQCliRule({
|
|
4036
4159
|
baseDir,
|
|
@@ -4070,7 +4193,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
|
4070
4193
|
};
|
|
4071
4194
|
|
|
4072
4195
|
// src/rules/augmentcode-legacy-rule.ts
|
|
4073
|
-
var
|
|
4196
|
+
var import_node_path40 = require("path");
|
|
4074
4197
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
4075
4198
|
toRulesyncRule() {
|
|
4076
4199
|
const rulesyncFrontmatter = {
|
|
@@ -4131,8 +4254,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
4131
4254
|
}) {
|
|
4132
4255
|
const settablePaths = this.getSettablePaths();
|
|
4133
4256
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
4134
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0,
|
|
4135
|
-
const fileContent = await readFileContent((0,
|
|
4257
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path40.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
4258
|
+
const fileContent = await readFileContent((0, import_node_path40.join)(baseDir, relativePath));
|
|
4136
4259
|
return new _AugmentcodeLegacyRule({
|
|
4137
4260
|
baseDir,
|
|
4138
4261
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -4145,7 +4268,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
4145
4268
|
};
|
|
4146
4269
|
|
|
4147
4270
|
// src/rules/augmentcode-rule.ts
|
|
4148
|
-
var
|
|
4271
|
+
var import_node_path41 = require("path");
|
|
4149
4272
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
4150
4273
|
toRulesyncRule() {
|
|
4151
4274
|
return this.toRulesyncRuleDefault();
|
|
@@ -4177,7 +4300,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
4177
4300
|
validate = true
|
|
4178
4301
|
}) {
|
|
4179
4302
|
const fileContent = await readFileContent(
|
|
4180
|
-
(0,
|
|
4303
|
+
(0, import_node_path41.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4181
4304
|
);
|
|
4182
4305
|
const { body: content } = parseFrontmatter(fileContent);
|
|
4183
4306
|
return new _AugmentcodeRule({
|
|
@@ -4200,7 +4323,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
4200
4323
|
};
|
|
4201
4324
|
|
|
4202
4325
|
// src/rules/claudecode-rule.ts
|
|
4203
|
-
var
|
|
4326
|
+
var import_node_path42 = require("path");
|
|
4204
4327
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
4205
4328
|
static getSettablePaths() {
|
|
4206
4329
|
return {
|
|
@@ -4209,7 +4332,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4209
4332
|
relativeFilePath: "CLAUDE.md"
|
|
4210
4333
|
},
|
|
4211
4334
|
nonRoot: {
|
|
4212
|
-
relativeDirPath: (0,
|
|
4335
|
+
relativeDirPath: (0, import_node_path42.join)(".claude", "memories")
|
|
4213
4336
|
}
|
|
4214
4337
|
};
|
|
4215
4338
|
}
|
|
@@ -4232,7 +4355,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4232
4355
|
if (isRoot) {
|
|
4233
4356
|
const relativePath2 = paths.root.relativeFilePath;
|
|
4234
4357
|
const fileContent2 = await readFileContent(
|
|
4235
|
-
(0,
|
|
4358
|
+
(0, import_node_path42.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
4236
4359
|
);
|
|
4237
4360
|
return new _ClaudecodeRule({
|
|
4238
4361
|
baseDir,
|
|
@@ -4246,8 +4369,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4246
4369
|
if (!paths.nonRoot) {
|
|
4247
4370
|
throw new Error("nonRoot path is not set");
|
|
4248
4371
|
}
|
|
4249
|
-
const relativePath = (0,
|
|
4250
|
-
const fileContent = await readFileContent((0,
|
|
4372
|
+
const relativePath = (0, import_node_path42.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
4373
|
+
const fileContent = await readFileContent((0, import_node_path42.join)(baseDir, relativePath));
|
|
4251
4374
|
return new _ClaudecodeRule({
|
|
4252
4375
|
baseDir,
|
|
4253
4376
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -4289,7 +4412,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4289
4412
|
};
|
|
4290
4413
|
|
|
4291
4414
|
// src/rules/cline-rule.ts
|
|
4292
|
-
var
|
|
4415
|
+
var import_node_path43 = require("path");
|
|
4293
4416
|
var import_mini17 = require("zod/mini");
|
|
4294
4417
|
var ClineRuleFrontmatterSchema = import_mini17.z.object({
|
|
4295
4418
|
description: import_mini17.z.string()
|
|
@@ -4334,7 +4457,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
4334
4457
|
validate = true
|
|
4335
4458
|
}) {
|
|
4336
4459
|
const fileContent = await readFileContent(
|
|
4337
|
-
(0,
|
|
4460
|
+
(0, import_node_path43.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4338
4461
|
);
|
|
4339
4462
|
return new _ClineRule({
|
|
4340
4463
|
baseDir,
|
|
@@ -4347,7 +4470,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
4347
4470
|
};
|
|
4348
4471
|
|
|
4349
4472
|
// src/rules/codexcli-rule.ts
|
|
4350
|
-
var
|
|
4473
|
+
var import_node_path44 = require("path");
|
|
4351
4474
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
4352
4475
|
static getSettablePaths() {
|
|
4353
4476
|
return {
|
|
@@ -4379,7 +4502,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4379
4502
|
if (isRoot) {
|
|
4380
4503
|
const relativePath2 = paths.root.relativeFilePath;
|
|
4381
4504
|
const fileContent2 = await readFileContent(
|
|
4382
|
-
(0,
|
|
4505
|
+
(0, import_node_path44.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
4383
4506
|
);
|
|
4384
4507
|
return new _CodexcliRule({
|
|
4385
4508
|
baseDir,
|
|
@@ -4393,8 +4516,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4393
4516
|
if (!paths.nonRoot) {
|
|
4394
4517
|
throw new Error("nonRoot path is not set");
|
|
4395
4518
|
}
|
|
4396
|
-
const relativePath = (0,
|
|
4397
|
-
const fileContent = await readFileContent((0,
|
|
4519
|
+
const relativePath = (0, import_node_path44.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
4520
|
+
const fileContent = await readFileContent((0, import_node_path44.join)(baseDir, relativePath));
|
|
4398
4521
|
return new _CodexcliRule({
|
|
4399
4522
|
baseDir,
|
|
4400
4523
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -4436,7 +4559,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4436
4559
|
};
|
|
4437
4560
|
|
|
4438
4561
|
// src/rules/copilot-rule.ts
|
|
4439
|
-
var
|
|
4562
|
+
var import_node_path45 = require("path");
|
|
4440
4563
|
var import_mini18 = require("zod/mini");
|
|
4441
4564
|
var CopilotRuleFrontmatterSchema = import_mini18.z.object({
|
|
4442
4565
|
description: import_mini18.z.optional(import_mini18.z.string()),
|
|
@@ -4529,11 +4652,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4529
4652
|
validate = true
|
|
4530
4653
|
}) {
|
|
4531
4654
|
const isRoot = relativeFilePath === "copilot-instructions.md";
|
|
4532
|
-
const relativePath = isRoot ? (0,
|
|
4655
|
+
const relativePath = isRoot ? (0, import_node_path45.join)(
|
|
4533
4656
|
this.getSettablePaths().root.relativeDirPath,
|
|
4534
4657
|
this.getSettablePaths().root.relativeFilePath
|
|
4535
|
-
) : (0,
|
|
4536
|
-
const fileContent = await readFileContent((0,
|
|
4658
|
+
) : (0, import_node_path45.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
4659
|
+
const fileContent = await readFileContent((0, import_node_path45.join)(baseDir, relativePath));
|
|
4537
4660
|
if (isRoot) {
|
|
4538
4661
|
return new _CopilotRule({
|
|
4539
4662
|
baseDir,
|
|
@@ -4552,7 +4675,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4552
4675
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
4553
4676
|
if (!result.success) {
|
|
4554
4677
|
throw new Error(
|
|
4555
|
-
`Invalid frontmatter in ${(0,
|
|
4678
|
+
`Invalid frontmatter in ${(0, import_node_path45.join)(baseDir, relativeFilePath)}: ${result.error.message}`
|
|
4556
4679
|
);
|
|
4557
4680
|
}
|
|
4558
4681
|
return new _CopilotRule({
|
|
@@ -4591,7 +4714,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4591
4714
|
};
|
|
4592
4715
|
|
|
4593
4716
|
// src/rules/cursor-rule.ts
|
|
4594
|
-
var
|
|
4717
|
+
var import_node_path46 = require("path");
|
|
4595
4718
|
var import_mini19 = require("zod/mini");
|
|
4596
4719
|
var CursorRuleFrontmatterSchema = import_mini19.z.object({
|
|
4597
4720
|
description: import_mini19.z.optional(import_mini19.z.string()),
|
|
@@ -4718,19 +4841,19 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
4718
4841
|
validate = true
|
|
4719
4842
|
}) {
|
|
4720
4843
|
const fileContent = await readFileContent(
|
|
4721
|
-
(0,
|
|
4844
|
+
(0, import_node_path46.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4722
4845
|
);
|
|
4723
4846
|
const { frontmatter, body: content } = _CursorRule.parseCursorFrontmatter(fileContent);
|
|
4724
4847
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
4725
4848
|
if (!result.success) {
|
|
4726
4849
|
throw new Error(
|
|
4727
|
-
`Invalid frontmatter in ${(0,
|
|
4850
|
+
`Invalid frontmatter in ${(0, import_node_path46.join)(baseDir, relativeFilePath)}: ${result.error.message}`
|
|
4728
4851
|
);
|
|
4729
4852
|
}
|
|
4730
4853
|
return new _CursorRule({
|
|
4731
4854
|
baseDir,
|
|
4732
4855
|
relativeDirPath: this.getSettablePaths().nonRoot.relativeDirPath,
|
|
4733
|
-
relativeFilePath: (0,
|
|
4856
|
+
relativeFilePath: (0, import_node_path46.basename)(relativeFilePath),
|
|
4734
4857
|
frontmatter: result.data,
|
|
4735
4858
|
body: content.trim(),
|
|
4736
4859
|
validate
|
|
@@ -4762,7 +4885,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
4762
4885
|
};
|
|
4763
4886
|
|
|
4764
4887
|
// src/rules/geminicli-rule.ts
|
|
4765
|
-
var
|
|
4888
|
+
var import_node_path47 = require("path");
|
|
4766
4889
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
4767
4890
|
static getSettablePaths() {
|
|
4768
4891
|
return {
|
|
@@ -4794,7 +4917,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
4794
4917
|
if (isRoot) {
|
|
4795
4918
|
const relativePath2 = paths.root.relativeFilePath;
|
|
4796
4919
|
const fileContent2 = await readFileContent(
|
|
4797
|
-
(0,
|
|
4920
|
+
(0, import_node_path47.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
4798
4921
|
);
|
|
4799
4922
|
return new _GeminiCliRule({
|
|
4800
4923
|
baseDir,
|
|
@@ -4808,8 +4931,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
4808
4931
|
if (!paths.nonRoot) {
|
|
4809
4932
|
throw new Error("nonRoot path is not set");
|
|
4810
4933
|
}
|
|
4811
|
-
const relativePath = (0,
|
|
4812
|
-
const fileContent = await readFileContent((0,
|
|
4934
|
+
const relativePath = (0, import_node_path47.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
4935
|
+
const fileContent = await readFileContent((0, import_node_path47.join)(baseDir, relativePath));
|
|
4813
4936
|
return new _GeminiCliRule({
|
|
4814
4937
|
baseDir,
|
|
4815
4938
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -4851,7 +4974,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
4851
4974
|
};
|
|
4852
4975
|
|
|
4853
4976
|
// src/rules/junie-rule.ts
|
|
4854
|
-
var
|
|
4977
|
+
var import_node_path48 = require("path");
|
|
4855
4978
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
4856
4979
|
static getSettablePaths() {
|
|
4857
4980
|
return {
|
|
@@ -4870,8 +4993,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
4870
4993
|
validate = true
|
|
4871
4994
|
}) {
|
|
4872
4995
|
const isRoot = relativeFilePath === "guidelines.md";
|
|
4873
|
-
const relativePath = isRoot ? "guidelines.md" : (0,
|
|
4874
|
-
const fileContent = await readFileContent((0,
|
|
4996
|
+
const relativePath = isRoot ? "guidelines.md" : (0, import_node_path48.join)(".junie/memories", relativeFilePath);
|
|
4997
|
+
const fileContent = await readFileContent((0, import_node_path48.join)(baseDir, relativePath));
|
|
4875
4998
|
return new _JunieRule({
|
|
4876
4999
|
baseDir,
|
|
4877
5000
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4911,7 +5034,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
4911
5034
|
};
|
|
4912
5035
|
|
|
4913
5036
|
// src/rules/kiro-rule.ts
|
|
4914
|
-
var
|
|
5037
|
+
var import_node_path49 = require("path");
|
|
4915
5038
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
4916
5039
|
static getSettablePaths() {
|
|
4917
5040
|
return {
|
|
@@ -4926,7 +5049,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
4926
5049
|
validate = true
|
|
4927
5050
|
}) {
|
|
4928
5051
|
const fileContent = await readFileContent(
|
|
4929
|
-
(0,
|
|
5052
|
+
(0, import_node_path49.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4930
5053
|
);
|
|
4931
5054
|
return new _KiroRule({
|
|
4932
5055
|
baseDir,
|
|
@@ -4966,7 +5089,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
4966
5089
|
};
|
|
4967
5090
|
|
|
4968
5091
|
// src/rules/opencode-rule.ts
|
|
4969
|
-
var
|
|
5092
|
+
var import_node_path50 = require("path");
|
|
4970
5093
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
4971
5094
|
static getSettablePaths() {
|
|
4972
5095
|
return {
|
|
@@ -4985,8 +5108,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
4985
5108
|
validate = true
|
|
4986
5109
|
}) {
|
|
4987
5110
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
4988
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
4989
|
-
const fileContent = await readFileContent((0,
|
|
5111
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path50.join)(".opencode/memories", relativeFilePath);
|
|
5112
|
+
const fileContent = await readFileContent((0, import_node_path50.join)(baseDir, relativePath));
|
|
4990
5113
|
return new _OpenCodeRule({
|
|
4991
5114
|
baseDir,
|
|
4992
5115
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -5026,7 +5149,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
5026
5149
|
};
|
|
5027
5150
|
|
|
5028
5151
|
// src/rules/qwencode-rule.ts
|
|
5029
|
-
var
|
|
5152
|
+
var import_node_path51 = require("path");
|
|
5030
5153
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
5031
5154
|
static getSettablePaths() {
|
|
5032
5155
|
return {
|
|
@@ -5045,8 +5168,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
5045
5168
|
validate = true
|
|
5046
5169
|
}) {
|
|
5047
5170
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
5048
|
-
const relativePath = isRoot ? "QWEN.md" : (0,
|
|
5049
|
-
const fileContent = await readFileContent((0,
|
|
5171
|
+
const relativePath = isRoot ? "QWEN.md" : (0, import_node_path51.join)(".qwen/memories", relativeFilePath);
|
|
5172
|
+
const fileContent = await readFileContent((0, import_node_path51.join)(baseDir, relativePath));
|
|
5050
5173
|
return new _QwencodeRule({
|
|
5051
5174
|
baseDir,
|
|
5052
5175
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -5083,7 +5206,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
5083
5206
|
};
|
|
5084
5207
|
|
|
5085
5208
|
// src/rules/roo-rule.ts
|
|
5086
|
-
var
|
|
5209
|
+
var import_node_path52 = require("path");
|
|
5087
5210
|
var RooRule = class _RooRule extends ToolRule {
|
|
5088
5211
|
static getSettablePaths() {
|
|
5089
5212
|
return {
|
|
@@ -5098,7 +5221,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
5098
5221
|
validate = true
|
|
5099
5222
|
}) {
|
|
5100
5223
|
const fileContent = await readFileContent(
|
|
5101
|
-
(0,
|
|
5224
|
+
(0, import_node_path52.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
5102
5225
|
);
|
|
5103
5226
|
return new _RooRule({
|
|
5104
5227
|
baseDir,
|
|
@@ -5153,7 +5276,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
5153
5276
|
};
|
|
5154
5277
|
|
|
5155
5278
|
// src/rules/warp-rule.ts
|
|
5156
|
-
var
|
|
5279
|
+
var import_node_path53 = require("path");
|
|
5157
5280
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
5158
5281
|
constructor({ fileContent, root, ...rest }) {
|
|
5159
5282
|
super({
|
|
@@ -5179,8 +5302,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
5179
5302
|
validate = true
|
|
5180
5303
|
}) {
|
|
5181
5304
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
5182
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0,
|
|
5183
|
-
const fileContent = await readFileContent((0,
|
|
5305
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path53.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
5306
|
+
const fileContent = await readFileContent((0, import_node_path53.join)(baseDir, relativePath));
|
|
5184
5307
|
return new _WarpRule({
|
|
5185
5308
|
baseDir,
|
|
5186
5309
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -5220,7 +5343,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
5220
5343
|
};
|
|
5221
5344
|
|
|
5222
5345
|
// src/rules/windsurf-rule.ts
|
|
5223
|
-
var
|
|
5346
|
+
var import_node_path54 = require("path");
|
|
5224
5347
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
5225
5348
|
static getSettablePaths() {
|
|
5226
5349
|
return {
|
|
@@ -5235,7 +5358,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
5235
5358
|
validate = true
|
|
5236
5359
|
}) {
|
|
5237
5360
|
const fileContent = await readFileContent(
|
|
5238
|
-
(0,
|
|
5361
|
+
(0, import_node_path54.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
5239
5362
|
);
|
|
5240
5363
|
return new _WindsurfRule({
|
|
5241
5364
|
baseDir,
|
|
@@ -5527,7 +5650,12 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
5527
5650
|
case "agentsmd": {
|
|
5528
5651
|
const rootRule = toolRules[rootRuleIndex];
|
|
5529
5652
|
rootRule?.setFileContent(
|
|
5530
|
-
this.generateXmlReferencesSection(toolRules) +
|
|
5653
|
+
this.generateXmlReferencesSection(toolRules) + this.generateAdditionalConventionsSection({
|
|
5654
|
+
commands: { relativeDirPath: AgentsmdCommand.getSettablePaths().relativeDirPath },
|
|
5655
|
+
subagents: {
|
|
5656
|
+
relativeDirPath: AgentsmdSubagent.getSettablePaths().relativeDirPath
|
|
5657
|
+
}
|
|
5658
|
+
}) + rootRule.getFileContent()
|
|
5531
5659
|
);
|
|
5532
5660
|
return toolRules;
|
|
5533
5661
|
}
|
|
@@ -5624,10 +5752,10 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
5624
5752
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
5625
5753
|
*/
|
|
5626
5754
|
async loadRulesyncFiles() {
|
|
5627
|
-
const files = await findFilesByGlobs((0,
|
|
5755
|
+
const files = await findFilesByGlobs((0, import_node_path55.join)(".rulesync/rules", "*.md"));
|
|
5628
5756
|
logger.debug(`Found ${files.length} rulesync files`);
|
|
5629
5757
|
const rulesyncRules = await Promise.all(
|
|
5630
|
-
files.map((file) => RulesyncRule.fromFile({ relativeFilePath: (0,
|
|
5758
|
+
files.map((file) => RulesyncRule.fromFile({ relativeFilePath: (0, import_node_path55.basename)(file) }))
|
|
5631
5759
|
);
|
|
5632
5760
|
const rootRules = rulesyncRules.filter((rule) => rule.getFrontmatter().root);
|
|
5633
5761
|
if (rootRules.length > 1) {
|
|
@@ -5645,10 +5773,10 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
5645
5773
|
return rulesyncRules;
|
|
5646
5774
|
}
|
|
5647
5775
|
async loadRulesyncFilesLegacy() {
|
|
5648
|
-
const legacyFiles = await findFilesByGlobs((0,
|
|
5776
|
+
const legacyFiles = await findFilesByGlobs((0, import_node_path55.join)(".rulesync", "*.md"));
|
|
5649
5777
|
logger.debug(`Found ${legacyFiles.length} legacy rulesync files`);
|
|
5650
5778
|
return Promise.all(
|
|
5651
|
-
legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: (0,
|
|
5779
|
+
legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: (0, import_node_path55.basename)(file) }))
|
|
5652
5780
|
);
|
|
5653
5781
|
}
|
|
5654
5782
|
/**
|
|
@@ -5712,13 +5840,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
5712
5840
|
return [];
|
|
5713
5841
|
}
|
|
5714
5842
|
const rootFilePaths = await findFilesByGlobs(
|
|
5715
|
-
(0,
|
|
5843
|
+
(0, import_node_path55.join)(this.baseDir, root.relativeDirPath ?? ".", root.relativeFilePath)
|
|
5716
5844
|
);
|
|
5717
5845
|
return await Promise.all(
|
|
5718
5846
|
rootFilePaths.map(
|
|
5719
5847
|
(filePath) => root.fromFile({
|
|
5720
5848
|
baseDir: this.baseDir,
|
|
5721
|
-
relativeFilePath: (0,
|
|
5849
|
+
relativeFilePath: (0, import_node_path55.basename)(filePath),
|
|
5722
5850
|
global: this.global
|
|
5723
5851
|
})
|
|
5724
5852
|
)
|
|
@@ -5730,13 +5858,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
5730
5858
|
return [];
|
|
5731
5859
|
}
|
|
5732
5860
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
5733
|
-
(0,
|
|
5861
|
+
(0, import_node_path55.join)(this.baseDir, nonRoot.relativeDirPath, `*.${nonRoot.extension}`)
|
|
5734
5862
|
);
|
|
5735
5863
|
return await Promise.all(
|
|
5736
5864
|
nonRootFilePaths.map(
|
|
5737
5865
|
(filePath) => nonRoot.fromFile({
|
|
5738
5866
|
baseDir: this.baseDir,
|
|
5739
|
-
relativeFilePath: (0,
|
|
5867
|
+
relativeFilePath: (0, import_node_path55.basename)(filePath),
|
|
5740
5868
|
global: this.global
|
|
5741
5869
|
})
|
|
5742
5870
|
)
|
|
@@ -6106,14 +6234,14 @@ s/<command> [arguments]
|
|
|
6106
6234
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
6107
6235
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
6108
6236
|
|
|
6109
|
-
When users call a custom slash command, you have to look for the markdown file, \`${(0,
|
|
6237
|
+
When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path55.join)(commands.relativeDirPath, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
6110
6238
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
6111
6239
|
|
|
6112
6240
|
Simulated subagents are specialized AI assistants that can be invoked to handle specific types of tasks. In this case, it can be appear something like custom slash commands simply. Simulated subagents can be called by custom slash commands.
|
|
6113
6241
|
|
|
6114
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0,
|
|
6242
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path55.join)(subagents.relativeDirPath, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
6115
6243
|
|
|
6116
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0,
|
|
6244
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path55.join)(subagents.relativeDirPath, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
6117
6245
|
const result = [
|
|
6118
6246
|
overview,
|
|
6119
6247
|
...this.simulateCommands && CommandsProcessor.getToolTargetsSimulated().includes(this.toolTarget) ? [commandsSection] : [],
|
|
@@ -6338,9 +6466,9 @@ async function generateSubagents(config) {
|
|
|
6338
6466
|
}
|
|
6339
6467
|
|
|
6340
6468
|
// src/cli/commands/gitignore.ts
|
|
6341
|
-
var
|
|
6469
|
+
var import_node_path56 = require("path");
|
|
6342
6470
|
var gitignoreCommand = async () => {
|
|
6343
|
-
const gitignorePath = (0,
|
|
6471
|
+
const gitignorePath = (0, import_node_path56.join)(process.cwd(), ".gitignore");
|
|
6344
6472
|
const rulesFilesToIgnore = [
|
|
6345
6473
|
"# Generated by rulesync - AI tool configuration files",
|
|
6346
6474
|
"**/.amazonq/",
|
|
@@ -6577,7 +6705,7 @@ async function importSubagents(config, tool) {
|
|
|
6577
6705
|
}
|
|
6578
6706
|
|
|
6579
6707
|
// src/cli/commands/init.ts
|
|
6580
|
-
var
|
|
6708
|
+
var import_node_path57 = require("path");
|
|
6581
6709
|
async function initCommand() {
|
|
6582
6710
|
logger.info("Initializing rulesync...");
|
|
6583
6711
|
await ensureDir(".rulesync");
|
|
@@ -6648,7 +6776,7 @@ globs: ["**/*"]
|
|
|
6648
6776
|
- Follow single responsibility principle
|
|
6649
6777
|
`
|
|
6650
6778
|
};
|
|
6651
|
-
const filepath = (0,
|
|
6779
|
+
const filepath = (0, import_node_path57.join)(".rulesync/rules", sampleFile.filename);
|
|
6652
6780
|
await ensureDir(".rulesync/rules");
|
|
6653
6781
|
await ensureDir(RulesyncCommand.getSettablePaths().relativeDirPath);
|
|
6654
6782
|
await ensureDir(".rulesync/subagents");
|
|
@@ -6661,7 +6789,7 @@ globs: ["**/*"]
|
|
|
6661
6789
|
}
|
|
6662
6790
|
|
|
6663
6791
|
// src/cli/index.ts
|
|
6664
|
-
var getVersion = () => "3.
|
|
6792
|
+
var getVersion = () => "3.1.0";
|
|
6665
6793
|
var main = async () => {
|
|
6666
6794
|
const program = new import_commander.Command();
|
|
6667
6795
|
const version = getVersion();
|