rulesync 6.7.0 → 6.8.1
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 +52 -49
- package/dist/index.cjs +564 -396
- package/dist/index.js +564 -396
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -43,7 +43,10 @@ var ALL_FEATURES = [
|
|
|
43
43
|
var ALL_FEATURES_WITH_WILDCARD = [...ALL_FEATURES, "*"];
|
|
44
44
|
var FeatureSchema = import_mini.z.enum(ALL_FEATURES);
|
|
45
45
|
var FeaturesSchema = import_mini.z.array(FeatureSchema);
|
|
46
|
-
var RulesyncFeaturesSchema = import_mini.z.
|
|
46
|
+
var RulesyncFeaturesSchema = import_mini.z.union([
|
|
47
|
+
import_mini.z.array(import_mini.z.enum(ALL_FEATURES_WITH_WILDCARD)),
|
|
48
|
+
import_mini.z.record(import_mini.z.string(), import_mini.z.array(import_mini.z.enum(ALL_FEATURES_WITH_WILDCARD)))
|
|
49
|
+
]);
|
|
47
50
|
|
|
48
51
|
// src/utils/error.ts
|
|
49
52
|
var import_zod = require("zod");
|
|
@@ -5452,7 +5455,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
5452
5455
|
static getSettablePaths({ global } = {}) {
|
|
5453
5456
|
if (global) {
|
|
5454
5457
|
return {
|
|
5455
|
-
relativeDirPath: ".",
|
|
5458
|
+
relativeDirPath: (0, import_node_path48.join)(".config", "opencode"),
|
|
5456
5459
|
relativeFilePath: "opencode.json"
|
|
5457
5460
|
};
|
|
5458
5461
|
}
|
|
@@ -5912,7 +5915,7 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
5912
5915
|
// src/features/rules/rules-processor.ts
|
|
5913
5916
|
var import_toon = require("@toon-format/toon");
|
|
5914
5917
|
var import_node_path106 = require("path");
|
|
5915
|
-
var
|
|
5918
|
+
var import_mini49 = require("zod/mini");
|
|
5916
5919
|
|
|
5917
5920
|
// src/constants/general.ts
|
|
5918
5921
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
@@ -6373,46 +6376,12 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
|
6373
6376
|
}
|
|
6374
6377
|
};
|
|
6375
6378
|
|
|
6376
|
-
// src/features/skills/geminicli-skill.ts
|
|
6377
|
-
var import_node_path55 = require("path");
|
|
6378
|
-
var GeminiCliSkill = class _GeminiCliSkill extends SimulatedSkill {
|
|
6379
|
-
static getSettablePaths(options) {
|
|
6380
|
-
if (options?.global) {
|
|
6381
|
-
throw new Error("GeminiCliSkill does not support global mode.");
|
|
6382
|
-
}
|
|
6383
|
-
return {
|
|
6384
|
-
relativeDirPath: (0, import_node_path55.join)(".gemini", "skills")
|
|
6385
|
-
};
|
|
6386
|
-
}
|
|
6387
|
-
static async fromDir(params) {
|
|
6388
|
-
const baseParams = await this.fromDirDefault(params);
|
|
6389
|
-
return new _GeminiCliSkill(baseParams);
|
|
6390
|
-
}
|
|
6391
|
-
static fromRulesyncSkill(params) {
|
|
6392
|
-
const baseParams = {
|
|
6393
|
-
...this.fromRulesyncSkillDefault(params),
|
|
6394
|
-
relativeDirPath: this.getSettablePaths().relativeDirPath
|
|
6395
|
-
};
|
|
6396
|
-
return new _GeminiCliSkill(baseParams);
|
|
6397
|
-
}
|
|
6398
|
-
static isTargetedByRulesyncSkill(rulesyncSkill) {
|
|
6399
|
-
return this.isTargetedByRulesyncSkillDefault({
|
|
6400
|
-
rulesyncSkill,
|
|
6401
|
-
toolTarget: "geminicli"
|
|
6402
|
-
});
|
|
6403
|
-
}
|
|
6404
|
-
static forDeletion(params) {
|
|
6405
|
-
const baseParams = this.forDeletionDefault(params);
|
|
6406
|
-
return new _GeminiCliSkill(baseParams);
|
|
6407
|
-
}
|
|
6408
|
-
};
|
|
6409
|
-
|
|
6410
6379
|
// src/features/skills/skills-processor.ts
|
|
6411
6380
|
var import_node_path69 = require("path");
|
|
6412
|
-
var
|
|
6381
|
+
var import_mini34 = require("zod/mini");
|
|
6413
6382
|
|
|
6414
6383
|
// src/types/dir-feature-processor.ts
|
|
6415
|
-
var
|
|
6384
|
+
var import_node_path55 = require("path");
|
|
6416
6385
|
var DirFeatureProcessor = class {
|
|
6417
6386
|
baseDir;
|
|
6418
6387
|
dryRun;
|
|
@@ -6429,6 +6398,10 @@ var DirFeatureProcessor = class {
|
|
|
6429
6398
|
/**
|
|
6430
6399
|
* Once converted to rulesync/tool dirs, write them to the filesystem.
|
|
6431
6400
|
* Returns the number of directories written.
|
|
6401
|
+
*
|
|
6402
|
+
* Note: This method uses directory-level change detection. If any file within
|
|
6403
|
+
* a directory has changed, ALL files in that directory are rewritten. This is
|
|
6404
|
+
* an intentional design decision to ensure consistency within directory units.
|
|
6432
6405
|
*/
|
|
6433
6406
|
async writeAiDirs(aiDirs) {
|
|
6434
6407
|
let changedCount = 0;
|
|
@@ -6438,7 +6411,7 @@ var DirFeatureProcessor = class {
|
|
|
6438
6411
|
const mainFile = aiDir.getMainFile();
|
|
6439
6412
|
let mainFileContent;
|
|
6440
6413
|
if (mainFile) {
|
|
6441
|
-
const mainFilePath = (0,
|
|
6414
|
+
const mainFilePath = (0, import_node_path55.join)(dirPath, mainFile.name);
|
|
6442
6415
|
const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter);
|
|
6443
6416
|
mainFileContent = addTrailingNewline(content);
|
|
6444
6417
|
const existingContent = await readFileContentOrNull(mainFilePath);
|
|
@@ -6452,7 +6425,7 @@ var DirFeatureProcessor = class {
|
|
|
6452
6425
|
const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
|
|
6453
6426
|
otherFileContents.push(contentWithNewline);
|
|
6454
6427
|
if (!dirHasChanges) {
|
|
6455
|
-
const filePath = (0,
|
|
6428
|
+
const filePath = (0, import_node_path55.join)(dirPath, file.relativeFilePathToDirPath);
|
|
6456
6429
|
const existingContent = await readFileContentOrNull(filePath);
|
|
6457
6430
|
if (existingContent !== contentWithNewline) {
|
|
6458
6431
|
dirHasChanges = true;
|
|
@@ -6465,20 +6438,25 @@ var DirFeatureProcessor = class {
|
|
|
6465
6438
|
if (this.dryRun) {
|
|
6466
6439
|
logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
|
|
6467
6440
|
if (mainFile) {
|
|
6468
|
-
logger.info(`[DRY RUN] Would write: ${(0,
|
|
6441
|
+
logger.info(`[DRY RUN] Would write: ${(0, import_node_path55.join)(dirPath, mainFile.name)}`);
|
|
6469
6442
|
}
|
|
6470
6443
|
for (const file of otherFiles) {
|
|
6471
|
-
logger.info(`[DRY RUN] Would write: ${(0,
|
|
6444
|
+
logger.info(`[DRY RUN] Would write: ${(0, import_node_path55.join)(dirPath, file.relativeFilePathToDirPath)}`);
|
|
6472
6445
|
}
|
|
6473
6446
|
} else {
|
|
6474
6447
|
await ensureDir(dirPath);
|
|
6475
6448
|
if (mainFile && mainFileContent) {
|
|
6476
|
-
const mainFilePath = (0,
|
|
6449
|
+
const mainFilePath = (0, import_node_path55.join)(dirPath, mainFile.name);
|
|
6477
6450
|
await writeFileContent(mainFilePath, mainFileContent);
|
|
6478
6451
|
}
|
|
6479
6452
|
for (const [i, file] of otherFiles.entries()) {
|
|
6480
|
-
const filePath = (0,
|
|
6481
|
-
const content = otherFileContents[i]
|
|
6453
|
+
const filePath = (0, import_node_path55.join)(dirPath, file.relativeFilePathToDirPath);
|
|
6454
|
+
const content = otherFileContents[i];
|
|
6455
|
+
if (content === void 0) {
|
|
6456
|
+
throw new Error(
|
|
6457
|
+
`Internal error: content for file ${file.relativeFilePathToDirPath} is undefined. This indicates a synchronization issue between otherFiles and otherFileContents arrays.`
|
|
6458
|
+
);
|
|
6459
|
+
}
|
|
6482
6460
|
await writeFileContent(filePath, content);
|
|
6483
6461
|
}
|
|
6484
6462
|
}
|
|
@@ -6511,11 +6489,11 @@ var DirFeatureProcessor = class {
|
|
|
6511
6489
|
};
|
|
6512
6490
|
|
|
6513
6491
|
// src/features/skills/agentsskills-skill.ts
|
|
6514
|
-
var
|
|
6492
|
+
var import_node_path57 = require("path");
|
|
6515
6493
|
var import_mini22 = require("zod/mini");
|
|
6516
6494
|
|
|
6517
6495
|
// src/features/skills/rulesync-skill.ts
|
|
6518
|
-
var
|
|
6496
|
+
var import_node_path56 = require("path");
|
|
6519
6497
|
var import_mini21 = require("zod/mini");
|
|
6520
6498
|
var RulesyncSkillFrontmatterSchemaInternal = import_mini21.z.looseObject({
|
|
6521
6499
|
name: import_mini21.z.string(),
|
|
@@ -6607,8 +6585,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
6607
6585
|
dirName,
|
|
6608
6586
|
global = false
|
|
6609
6587
|
}) {
|
|
6610
|
-
const skillDirPath = (0,
|
|
6611
|
-
const skillFilePath = (0,
|
|
6588
|
+
const skillDirPath = (0, import_node_path56.join)(baseDir, relativeDirPath, dirName);
|
|
6589
|
+
const skillFilePath = (0, import_node_path56.join)(skillDirPath, SKILL_FILE_NAME);
|
|
6612
6590
|
if (!await fileExists(skillFilePath)) {
|
|
6613
6591
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
6614
6592
|
}
|
|
@@ -6645,7 +6623,7 @@ var AgentsSkillsSkillFrontmatterSchema = import_mini22.z.looseObject({
|
|
|
6645
6623
|
var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
6646
6624
|
constructor({
|
|
6647
6625
|
baseDir = process.cwd(),
|
|
6648
|
-
relativeDirPath = (0,
|
|
6626
|
+
relativeDirPath = (0, import_node_path57.join)(".agents", "skills"),
|
|
6649
6627
|
dirName,
|
|
6650
6628
|
frontmatter,
|
|
6651
6629
|
body,
|
|
@@ -6677,7 +6655,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
6677
6655
|
throw new Error("AgentsSkillsSkill does not support global mode.");
|
|
6678
6656
|
}
|
|
6679
6657
|
return {
|
|
6680
|
-
relativeDirPath: (0,
|
|
6658
|
+
relativeDirPath: (0, import_node_path57.join)(".agents", "skills")
|
|
6681
6659
|
};
|
|
6682
6660
|
}
|
|
6683
6661
|
getFrontmatter() {
|
|
@@ -6759,9 +6737,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
6759
6737
|
});
|
|
6760
6738
|
const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
6761
6739
|
if (!result.success) {
|
|
6762
|
-
const skillDirPath = (0,
|
|
6740
|
+
const skillDirPath = (0, import_node_path57.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
6763
6741
|
throw new Error(
|
|
6764
|
-
`Invalid frontmatter in ${(0,
|
|
6742
|
+
`Invalid frontmatter in ${(0, import_node_path57.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
6765
6743
|
);
|
|
6766
6744
|
}
|
|
6767
6745
|
return new _AgentsSkillsSkill({
|
|
@@ -6796,7 +6774,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
6796
6774
|
};
|
|
6797
6775
|
|
|
6798
6776
|
// src/features/skills/antigravity-skill.ts
|
|
6799
|
-
var
|
|
6777
|
+
var import_node_path58 = require("path");
|
|
6800
6778
|
var import_mini23 = require("zod/mini");
|
|
6801
6779
|
var AntigravitySkillFrontmatterSchema = import_mini23.z.looseObject({
|
|
6802
6780
|
name: import_mini23.z.string(),
|
|
@@ -6805,7 +6783,7 @@ var AntigravitySkillFrontmatterSchema = import_mini23.z.looseObject({
|
|
|
6805
6783
|
var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
6806
6784
|
constructor({
|
|
6807
6785
|
baseDir = process.cwd(),
|
|
6808
|
-
relativeDirPath = (0,
|
|
6786
|
+
relativeDirPath = (0, import_node_path58.join)(".agent", "skills"),
|
|
6809
6787
|
dirName,
|
|
6810
6788
|
frontmatter,
|
|
6811
6789
|
body,
|
|
@@ -6837,11 +6815,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
6837
6815
|
} = {}) {
|
|
6838
6816
|
if (global) {
|
|
6839
6817
|
return {
|
|
6840
|
-
relativeDirPath: (0,
|
|
6818
|
+
relativeDirPath: (0, import_node_path58.join)(".gemini", "antigravity", "skills")
|
|
6841
6819
|
};
|
|
6842
6820
|
}
|
|
6843
6821
|
return {
|
|
6844
|
-
relativeDirPath: (0,
|
|
6822
|
+
relativeDirPath: (0, import_node_path58.join)(".agent", "skills")
|
|
6845
6823
|
};
|
|
6846
6824
|
}
|
|
6847
6825
|
getFrontmatter() {
|
|
@@ -6923,9 +6901,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
6923
6901
|
});
|
|
6924
6902
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
6925
6903
|
if (!result.success) {
|
|
6926
|
-
const skillDirPath = (0,
|
|
6904
|
+
const skillDirPath = (0, import_node_path58.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
6927
6905
|
throw new Error(
|
|
6928
|
-
`Invalid frontmatter in ${(0,
|
|
6906
|
+
`Invalid frontmatter in ${(0, import_node_path58.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
6929
6907
|
);
|
|
6930
6908
|
}
|
|
6931
6909
|
return new _AntigravitySkill({
|
|
@@ -6959,7 +6937,7 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
6959
6937
|
};
|
|
6960
6938
|
|
|
6961
6939
|
// src/features/skills/claudecode-skill.ts
|
|
6962
|
-
var
|
|
6940
|
+
var import_node_path59 = require("path");
|
|
6963
6941
|
var import_mini24 = require("zod/mini");
|
|
6964
6942
|
var ClaudecodeSkillFrontmatterSchema = import_mini24.z.looseObject({
|
|
6965
6943
|
name: import_mini24.z.string(),
|
|
@@ -6969,7 +6947,7 @@ var ClaudecodeSkillFrontmatterSchema = import_mini24.z.looseObject({
|
|
|
6969
6947
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
6970
6948
|
constructor({
|
|
6971
6949
|
baseDir = process.cwd(),
|
|
6972
|
-
relativeDirPath = (0,
|
|
6950
|
+
relativeDirPath = (0, import_node_path59.join)(".claude", "skills"),
|
|
6973
6951
|
dirName,
|
|
6974
6952
|
frontmatter,
|
|
6975
6953
|
body,
|
|
@@ -7000,7 +6978,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
7000
6978
|
global: _global = false
|
|
7001
6979
|
} = {}) {
|
|
7002
6980
|
return {
|
|
7003
|
-
relativeDirPath: (0,
|
|
6981
|
+
relativeDirPath: (0, import_node_path59.join)(".claude", "skills")
|
|
7004
6982
|
};
|
|
7005
6983
|
}
|
|
7006
6984
|
getFrontmatter() {
|
|
@@ -7088,9 +7066,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
7088
7066
|
});
|
|
7089
7067
|
const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
7090
7068
|
if (!result.success) {
|
|
7091
|
-
const skillDirPath = (0,
|
|
7069
|
+
const skillDirPath = (0, import_node_path59.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
7092
7070
|
throw new Error(
|
|
7093
|
-
`Invalid frontmatter in ${(0,
|
|
7071
|
+
`Invalid frontmatter in ${(0, import_node_path59.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
7094
7072
|
);
|
|
7095
7073
|
}
|
|
7096
7074
|
return new _ClaudecodeSkill({
|
|
@@ -7124,7 +7102,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
7124
7102
|
};
|
|
7125
7103
|
|
|
7126
7104
|
// src/features/skills/codexcli-skill.ts
|
|
7127
|
-
var
|
|
7105
|
+
var import_node_path60 = require("path");
|
|
7128
7106
|
var import_mini25 = require("zod/mini");
|
|
7129
7107
|
var CodexCliSkillFrontmatterSchema = import_mini25.z.looseObject({
|
|
7130
7108
|
name: import_mini25.z.string(),
|
|
@@ -7138,7 +7116,7 @@ var CodexCliSkillFrontmatterSchema = import_mini25.z.looseObject({
|
|
|
7138
7116
|
var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
7139
7117
|
constructor({
|
|
7140
7118
|
baseDir = process.cwd(),
|
|
7141
|
-
relativeDirPath = (0,
|
|
7119
|
+
relativeDirPath = (0, import_node_path60.join)(".codex", "skills"),
|
|
7142
7120
|
dirName,
|
|
7143
7121
|
frontmatter,
|
|
7144
7122
|
body,
|
|
@@ -7169,7 +7147,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
7169
7147
|
global: _global = false
|
|
7170
7148
|
} = {}) {
|
|
7171
7149
|
return {
|
|
7172
|
-
relativeDirPath: (0,
|
|
7150
|
+
relativeDirPath: (0, import_node_path60.join)(".codex", "skills")
|
|
7173
7151
|
};
|
|
7174
7152
|
}
|
|
7175
7153
|
getFrontmatter() {
|
|
@@ -7261,9 +7239,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
7261
7239
|
});
|
|
7262
7240
|
const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
7263
7241
|
if (!result.success) {
|
|
7264
|
-
const skillDirPath = (0,
|
|
7242
|
+
const skillDirPath = (0, import_node_path60.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
7265
7243
|
throw new Error(
|
|
7266
|
-
`Invalid frontmatter in ${(0,
|
|
7244
|
+
`Invalid frontmatter in ${(0, import_node_path60.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
7267
7245
|
);
|
|
7268
7246
|
}
|
|
7269
7247
|
return new _CodexCliSkill({
|
|
@@ -7297,7 +7275,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
7297
7275
|
};
|
|
7298
7276
|
|
|
7299
7277
|
// src/features/skills/copilot-skill.ts
|
|
7300
|
-
var
|
|
7278
|
+
var import_node_path61 = require("path");
|
|
7301
7279
|
var import_mini26 = require("zod/mini");
|
|
7302
7280
|
var CopilotSkillFrontmatterSchema = import_mini26.z.looseObject({
|
|
7303
7281
|
name: import_mini26.z.string(),
|
|
@@ -7307,7 +7285,7 @@ var CopilotSkillFrontmatterSchema = import_mini26.z.looseObject({
|
|
|
7307
7285
|
var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
7308
7286
|
constructor({
|
|
7309
7287
|
baseDir = process.cwd(),
|
|
7310
|
-
relativeDirPath = (0,
|
|
7288
|
+
relativeDirPath = (0, import_node_path61.join)(".github", "skills"),
|
|
7311
7289
|
dirName,
|
|
7312
7290
|
frontmatter,
|
|
7313
7291
|
body,
|
|
@@ -7339,7 +7317,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
7339
7317
|
throw new Error("CopilotSkill does not support global mode.");
|
|
7340
7318
|
}
|
|
7341
7319
|
return {
|
|
7342
|
-
relativeDirPath: (0,
|
|
7320
|
+
relativeDirPath: (0, import_node_path61.join)(".github", "skills")
|
|
7343
7321
|
};
|
|
7344
7322
|
}
|
|
7345
7323
|
getFrontmatter() {
|
|
@@ -7427,9 +7405,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
7427
7405
|
});
|
|
7428
7406
|
const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
7429
7407
|
if (!result.success) {
|
|
7430
|
-
const skillDirPath = (0,
|
|
7408
|
+
const skillDirPath = (0, import_node_path61.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
7431
7409
|
throw new Error(
|
|
7432
|
-
`Invalid frontmatter in ${(0,
|
|
7410
|
+
`Invalid frontmatter in ${(0, import_node_path61.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
7433
7411
|
);
|
|
7434
7412
|
}
|
|
7435
7413
|
return new _CopilotSkill({
|
|
@@ -7464,7 +7442,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
7464
7442
|
};
|
|
7465
7443
|
|
|
7466
7444
|
// src/features/skills/cursor-skill.ts
|
|
7467
|
-
var
|
|
7445
|
+
var import_node_path62 = require("path");
|
|
7468
7446
|
var import_mini27 = require("zod/mini");
|
|
7469
7447
|
var CursorSkillFrontmatterSchema = import_mini27.z.looseObject({
|
|
7470
7448
|
name: import_mini27.z.string(),
|
|
@@ -7473,7 +7451,7 @@ var CursorSkillFrontmatterSchema = import_mini27.z.looseObject({
|
|
|
7473
7451
|
var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
7474
7452
|
constructor({
|
|
7475
7453
|
baseDir = process.cwd(),
|
|
7476
|
-
relativeDirPath = (0,
|
|
7454
|
+
relativeDirPath = (0, import_node_path62.join)(".cursor", "skills"),
|
|
7477
7455
|
dirName,
|
|
7478
7456
|
frontmatter,
|
|
7479
7457
|
body,
|
|
@@ -7502,7 +7480,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
7502
7480
|
}
|
|
7503
7481
|
static getSettablePaths(_options) {
|
|
7504
7482
|
return {
|
|
7505
|
-
relativeDirPath: (0,
|
|
7483
|
+
relativeDirPath: (0, import_node_path62.join)(".cursor", "skills")
|
|
7506
7484
|
};
|
|
7507
7485
|
}
|
|
7508
7486
|
getFrontmatter() {
|
|
@@ -7584,9 +7562,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
7584
7562
|
});
|
|
7585
7563
|
const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
7586
7564
|
if (!result.success) {
|
|
7587
|
-
const skillDirPath = (0,
|
|
7565
|
+
const skillDirPath = (0, import_node_path62.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
7588
7566
|
throw new Error(
|
|
7589
|
-
`Invalid frontmatter in ${(0,
|
|
7567
|
+
`Invalid frontmatter in ${(0, import_node_path62.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
7590
7568
|
);
|
|
7591
7569
|
}
|
|
7592
7570
|
return new _CursorSkill({
|
|
@@ -7620,13 +7598,172 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
7620
7598
|
}
|
|
7621
7599
|
};
|
|
7622
7600
|
|
|
7623
|
-
// src/features/skills/
|
|
7624
|
-
var
|
|
7601
|
+
// src/features/skills/geminicli-skill.ts
|
|
7602
|
+
var import_node_path63 = require("path");
|
|
7625
7603
|
var import_mini28 = require("zod/mini");
|
|
7626
|
-
var
|
|
7604
|
+
var GeminiCliSkillFrontmatterSchema = import_mini28.z.looseObject({
|
|
7627
7605
|
name: import_mini28.z.string(),
|
|
7628
7606
|
description: import_mini28.z.string()
|
|
7629
7607
|
});
|
|
7608
|
+
var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
7609
|
+
constructor({
|
|
7610
|
+
baseDir = process.cwd(),
|
|
7611
|
+
relativeDirPath = _GeminiCliSkill.getSettablePaths().relativeDirPath,
|
|
7612
|
+
dirName,
|
|
7613
|
+
frontmatter,
|
|
7614
|
+
body,
|
|
7615
|
+
otherFiles = [],
|
|
7616
|
+
validate = true,
|
|
7617
|
+
global = false
|
|
7618
|
+
}) {
|
|
7619
|
+
super({
|
|
7620
|
+
baseDir,
|
|
7621
|
+
relativeDirPath,
|
|
7622
|
+
dirName,
|
|
7623
|
+
mainFile: {
|
|
7624
|
+
name: SKILL_FILE_NAME,
|
|
7625
|
+
body,
|
|
7626
|
+
frontmatter: { ...frontmatter }
|
|
7627
|
+
},
|
|
7628
|
+
otherFiles,
|
|
7629
|
+
global
|
|
7630
|
+
});
|
|
7631
|
+
if (validate) {
|
|
7632
|
+
const result = this.validate();
|
|
7633
|
+
if (!result.success) {
|
|
7634
|
+
throw result.error;
|
|
7635
|
+
}
|
|
7636
|
+
}
|
|
7637
|
+
}
|
|
7638
|
+
static getSettablePaths({
|
|
7639
|
+
global: _global = false
|
|
7640
|
+
} = {}) {
|
|
7641
|
+
return {
|
|
7642
|
+
relativeDirPath: (0, import_node_path63.join)(".gemini", "skills")
|
|
7643
|
+
};
|
|
7644
|
+
}
|
|
7645
|
+
getFrontmatter() {
|
|
7646
|
+
if (!this.mainFile?.frontmatter) {
|
|
7647
|
+
throw new Error("Frontmatter is not defined");
|
|
7648
|
+
}
|
|
7649
|
+
const result = GeminiCliSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
|
|
7650
|
+
return result;
|
|
7651
|
+
}
|
|
7652
|
+
getBody() {
|
|
7653
|
+
return this.mainFile?.body ?? "";
|
|
7654
|
+
}
|
|
7655
|
+
validate() {
|
|
7656
|
+
if (this.mainFile === void 0) {
|
|
7657
|
+
return {
|
|
7658
|
+
success: false,
|
|
7659
|
+
error: new Error(`${this.getDirPath()}: ${SKILL_FILE_NAME} file does not exist`)
|
|
7660
|
+
};
|
|
7661
|
+
}
|
|
7662
|
+
const result = GeminiCliSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
|
|
7663
|
+
if (!result.success) {
|
|
7664
|
+
return {
|
|
7665
|
+
success: false,
|
|
7666
|
+
error: new Error(
|
|
7667
|
+
`Invalid frontmatter in ${this.getDirPath()}: ${formatError(result.error)}`
|
|
7668
|
+
)
|
|
7669
|
+
};
|
|
7670
|
+
}
|
|
7671
|
+
return { success: true, error: null };
|
|
7672
|
+
}
|
|
7673
|
+
toRulesyncSkill() {
|
|
7674
|
+
const frontmatter = this.getFrontmatter();
|
|
7675
|
+
const rulesyncFrontmatter = {
|
|
7676
|
+
name: frontmatter.name,
|
|
7677
|
+
description: frontmatter.description,
|
|
7678
|
+
targets: ["*"]
|
|
7679
|
+
};
|
|
7680
|
+
return new RulesyncSkill({
|
|
7681
|
+
baseDir: this.baseDir,
|
|
7682
|
+
relativeDirPath: RULESYNC_SKILLS_RELATIVE_DIR_PATH,
|
|
7683
|
+
dirName: this.getDirName(),
|
|
7684
|
+
frontmatter: rulesyncFrontmatter,
|
|
7685
|
+
body: this.getBody(),
|
|
7686
|
+
otherFiles: this.getOtherFiles(),
|
|
7687
|
+
validate: true,
|
|
7688
|
+
global: this.global
|
|
7689
|
+
});
|
|
7690
|
+
}
|
|
7691
|
+
static fromRulesyncSkill({
|
|
7692
|
+
rulesyncSkill,
|
|
7693
|
+
validate = true,
|
|
7694
|
+
global = false
|
|
7695
|
+
}) {
|
|
7696
|
+
const settablePaths = _GeminiCliSkill.getSettablePaths({ global });
|
|
7697
|
+
const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
|
|
7698
|
+
const geminiCliFrontmatter = {
|
|
7699
|
+
name: rulesyncFrontmatter.name,
|
|
7700
|
+
description: rulesyncFrontmatter.description
|
|
7701
|
+
};
|
|
7702
|
+
return new _GeminiCliSkill({
|
|
7703
|
+
baseDir: rulesyncSkill.getBaseDir(),
|
|
7704
|
+
relativeDirPath: settablePaths.relativeDirPath,
|
|
7705
|
+
dirName: rulesyncSkill.getDirName(),
|
|
7706
|
+
frontmatter: geminiCliFrontmatter,
|
|
7707
|
+
body: rulesyncSkill.getBody(),
|
|
7708
|
+
otherFiles: rulesyncSkill.getOtherFiles(),
|
|
7709
|
+
validate,
|
|
7710
|
+
global
|
|
7711
|
+
});
|
|
7712
|
+
}
|
|
7713
|
+
static isTargetedByRulesyncSkill(rulesyncSkill) {
|
|
7714
|
+
const targets = rulesyncSkill.getFrontmatter().targets;
|
|
7715
|
+
return targets.includes("*") || targets.includes("geminicli");
|
|
7716
|
+
}
|
|
7717
|
+
static async fromDir(params) {
|
|
7718
|
+
const loaded = await this.loadSkillDirContent({
|
|
7719
|
+
...params,
|
|
7720
|
+
getSettablePaths: _GeminiCliSkill.getSettablePaths
|
|
7721
|
+
});
|
|
7722
|
+
const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
7723
|
+
if (!result.success) {
|
|
7724
|
+
const skillDirPath = (0, import_node_path63.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
7725
|
+
throw new Error(
|
|
7726
|
+
`Invalid frontmatter in ${(0, import_node_path63.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
7727
|
+
);
|
|
7728
|
+
}
|
|
7729
|
+
return new _GeminiCliSkill({
|
|
7730
|
+
baseDir: loaded.baseDir,
|
|
7731
|
+
relativeDirPath: loaded.relativeDirPath,
|
|
7732
|
+
dirName: loaded.dirName,
|
|
7733
|
+
frontmatter: result.data,
|
|
7734
|
+
body: loaded.body,
|
|
7735
|
+
otherFiles: loaded.otherFiles,
|
|
7736
|
+
validate: true,
|
|
7737
|
+
global: loaded.global
|
|
7738
|
+
});
|
|
7739
|
+
}
|
|
7740
|
+
static forDeletion({
|
|
7741
|
+
baseDir = process.cwd(),
|
|
7742
|
+
relativeDirPath,
|
|
7743
|
+
dirName,
|
|
7744
|
+
global = false
|
|
7745
|
+
}) {
|
|
7746
|
+
const settablePaths = _GeminiCliSkill.getSettablePaths({ global });
|
|
7747
|
+
return new _GeminiCliSkill({
|
|
7748
|
+
baseDir,
|
|
7749
|
+
relativeDirPath: relativeDirPath ?? settablePaths.relativeDirPath,
|
|
7750
|
+
dirName,
|
|
7751
|
+
frontmatter: { name: "", description: "" },
|
|
7752
|
+
body: "",
|
|
7753
|
+
otherFiles: [],
|
|
7754
|
+
validate: false,
|
|
7755
|
+
global
|
|
7756
|
+
});
|
|
7757
|
+
}
|
|
7758
|
+
};
|
|
7759
|
+
|
|
7760
|
+
// src/features/skills/kilo-skill.ts
|
|
7761
|
+
var import_node_path64 = require("path");
|
|
7762
|
+
var import_mini29 = require("zod/mini");
|
|
7763
|
+
var KiloSkillFrontmatterSchema = import_mini29.z.looseObject({
|
|
7764
|
+
name: import_mini29.z.string(),
|
|
7765
|
+
description: import_mini29.z.string()
|
|
7766
|
+
});
|
|
7630
7767
|
var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
7631
7768
|
constructor({
|
|
7632
7769
|
baseDir = process.cwd(),
|
|
@@ -7799,10 +7936,10 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
7799
7936
|
|
|
7800
7937
|
// src/features/skills/kiro-skill.ts
|
|
7801
7938
|
var import_node_path65 = require("path");
|
|
7802
|
-
var
|
|
7803
|
-
var KiroSkillFrontmatterSchema =
|
|
7804
|
-
name:
|
|
7805
|
-
description:
|
|
7939
|
+
var import_mini30 = require("zod/mini");
|
|
7940
|
+
var KiroSkillFrontmatterSchema = import_mini30.z.looseObject({
|
|
7941
|
+
name: import_mini30.z.string(),
|
|
7942
|
+
description: import_mini30.z.string()
|
|
7806
7943
|
});
|
|
7807
7944
|
var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
7808
7945
|
constructor({
|
|
@@ -7978,11 +8115,11 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
7978
8115
|
|
|
7979
8116
|
// src/features/skills/opencode-skill.ts
|
|
7980
8117
|
var import_node_path66 = require("path");
|
|
7981
|
-
var
|
|
7982
|
-
var OpenCodeSkillFrontmatterSchema =
|
|
7983
|
-
name:
|
|
7984
|
-
description:
|
|
7985
|
-
"allowed-tools":
|
|
8118
|
+
var import_mini31 = require("zod/mini");
|
|
8119
|
+
var OpenCodeSkillFrontmatterSchema = import_mini31.z.looseObject({
|
|
8120
|
+
name: import_mini31.z.string(),
|
|
8121
|
+
description: import_mini31.z.string(),
|
|
8122
|
+
"allowed-tools": import_mini31.z.optional(import_mini31.z.array(import_mini31.z.string()))
|
|
7986
8123
|
});
|
|
7987
8124
|
var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
7988
8125
|
constructor({
|
|
@@ -8141,10 +8278,10 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
8141
8278
|
|
|
8142
8279
|
// src/features/skills/replit-skill.ts
|
|
8143
8280
|
var import_node_path67 = require("path");
|
|
8144
|
-
var
|
|
8145
|
-
var ReplitSkillFrontmatterSchema =
|
|
8146
|
-
name:
|
|
8147
|
-
description:
|
|
8281
|
+
var import_mini32 = require("zod/mini");
|
|
8282
|
+
var ReplitSkillFrontmatterSchema = import_mini32.z.looseObject({
|
|
8283
|
+
name: import_mini32.z.string(),
|
|
8284
|
+
description: import_mini32.z.string()
|
|
8148
8285
|
});
|
|
8149
8286
|
var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
8150
8287
|
constructor({
|
|
@@ -8301,10 +8438,10 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
8301
8438
|
|
|
8302
8439
|
// src/features/skills/roo-skill.ts
|
|
8303
8440
|
var import_node_path68 = require("path");
|
|
8304
|
-
var
|
|
8305
|
-
var RooSkillFrontmatterSchema =
|
|
8306
|
-
name:
|
|
8307
|
-
description:
|
|
8441
|
+
var import_mini33 = require("zod/mini");
|
|
8442
|
+
var RooSkillFrontmatterSchema = import_mini33.z.looseObject({
|
|
8443
|
+
name: import_mini33.z.string(),
|
|
8444
|
+
description: import_mini33.z.string()
|
|
8308
8445
|
});
|
|
8309
8446
|
var RooSkill = class _RooSkill extends ToolSkill {
|
|
8310
8447
|
constructor({
|
|
@@ -8494,7 +8631,7 @@ var skillsProcessorToolTargetTuple = [
|
|
|
8494
8631
|
"replit",
|
|
8495
8632
|
"roo"
|
|
8496
8633
|
];
|
|
8497
|
-
var SkillsProcessorToolTargetSchema =
|
|
8634
|
+
var SkillsProcessorToolTargetSchema = import_mini34.z.enum(skillsProcessorToolTargetTuple);
|
|
8498
8635
|
var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
8499
8636
|
[
|
|
8500
8637
|
"agentsmd",
|
|
@@ -8563,7 +8700,7 @@ var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
|
8563
8700
|
"geminicli",
|
|
8564
8701
|
{
|
|
8565
8702
|
class: GeminiCliSkill,
|
|
8566
|
-
meta: { supportsProject: true, supportsSimulated:
|
|
8703
|
+
meta: { supportsProject: true, supportsSimulated: false, supportsGlobal: true }
|
|
8567
8704
|
}
|
|
8568
8705
|
],
|
|
8569
8706
|
[
|
|
@@ -8783,7 +8920,7 @@ var import_node_path71 = require("path");
|
|
|
8783
8920
|
|
|
8784
8921
|
// src/features/subagents/simulated-subagent.ts
|
|
8785
8922
|
var import_node_path70 = require("path");
|
|
8786
|
-
var
|
|
8923
|
+
var import_mini35 = require("zod/mini");
|
|
8787
8924
|
|
|
8788
8925
|
// src/features/subagents/tool-subagent.ts
|
|
8789
8926
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -8826,9 +8963,9 @@ var ToolSubagent = class extends ToolFile {
|
|
|
8826
8963
|
};
|
|
8827
8964
|
|
|
8828
8965
|
// src/features/subagents/simulated-subagent.ts
|
|
8829
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
8830
|
-
name:
|
|
8831
|
-
description:
|
|
8966
|
+
var SimulatedSubagentFrontmatterSchema = import_mini35.z.object({
|
|
8967
|
+
name: import_mini35.z.string(),
|
|
8968
|
+
description: import_mini35.z.string()
|
|
8832
8969
|
});
|
|
8833
8970
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
8834
8971
|
frontmatter;
|
|
@@ -9067,19 +9204,19 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
9067
9204
|
|
|
9068
9205
|
// src/features/subagents/subagents-processor.ts
|
|
9069
9206
|
var import_node_path82 = require("path");
|
|
9070
|
-
var
|
|
9207
|
+
var import_mini42 = require("zod/mini");
|
|
9071
9208
|
|
|
9072
9209
|
// src/features/subagents/claudecode-subagent.ts
|
|
9073
9210
|
var import_node_path77 = require("path");
|
|
9074
|
-
var
|
|
9211
|
+
var import_mini37 = require("zod/mini");
|
|
9075
9212
|
|
|
9076
9213
|
// src/features/subagents/rulesync-subagent.ts
|
|
9077
9214
|
var import_node_path76 = require("path");
|
|
9078
|
-
var
|
|
9079
|
-
var RulesyncSubagentFrontmatterSchema =
|
|
9080
|
-
targets:
|
|
9081
|
-
name:
|
|
9082
|
-
description:
|
|
9215
|
+
var import_mini36 = require("zod/mini");
|
|
9216
|
+
var RulesyncSubagentFrontmatterSchema = import_mini36.z.looseObject({
|
|
9217
|
+
targets: import_mini36.z._default(RulesyncTargetsSchema, ["*"]),
|
|
9218
|
+
name: import_mini36.z.string(),
|
|
9219
|
+
description: import_mini36.z.string()
|
|
9083
9220
|
});
|
|
9084
9221
|
var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
9085
9222
|
frontmatter;
|
|
@@ -9149,13 +9286,13 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
9149
9286
|
};
|
|
9150
9287
|
|
|
9151
9288
|
// src/features/subagents/claudecode-subagent.ts
|
|
9152
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
9153
|
-
name:
|
|
9154
|
-
description:
|
|
9155
|
-
model:
|
|
9156
|
-
tools:
|
|
9157
|
-
permissionMode:
|
|
9158
|
-
skills:
|
|
9289
|
+
var ClaudecodeSubagentFrontmatterSchema = import_mini37.z.looseObject({
|
|
9290
|
+
name: import_mini37.z.string(),
|
|
9291
|
+
description: import_mini37.z.string(),
|
|
9292
|
+
model: import_mini37.z.optional(import_mini37.z.string()),
|
|
9293
|
+
tools: import_mini37.z.optional(import_mini37.z.union([import_mini37.z.string(), import_mini37.z.array(import_mini37.z.string())])),
|
|
9294
|
+
permissionMode: import_mini37.z.optional(import_mini37.z.string()),
|
|
9295
|
+
skills: import_mini37.z.optional(import_mini37.z.union([import_mini37.z.string(), import_mini37.z.array(import_mini37.z.string())]))
|
|
9159
9296
|
});
|
|
9160
9297
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
9161
9298
|
frontmatter;
|
|
@@ -9305,12 +9442,12 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
9305
9442
|
|
|
9306
9443
|
// src/features/subagents/copilot-subagent.ts
|
|
9307
9444
|
var import_node_path78 = require("path");
|
|
9308
|
-
var
|
|
9445
|
+
var import_mini38 = require("zod/mini");
|
|
9309
9446
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
9310
|
-
var CopilotSubagentFrontmatterSchema =
|
|
9311
|
-
name:
|
|
9312
|
-
description:
|
|
9313
|
-
tools:
|
|
9447
|
+
var CopilotSubagentFrontmatterSchema = import_mini38.z.looseObject({
|
|
9448
|
+
name: import_mini38.z.string(),
|
|
9449
|
+
description: import_mini38.z.string(),
|
|
9450
|
+
tools: import_mini38.z.optional(import_mini38.z.union([import_mini38.z.string(), import_mini38.z.array(import_mini38.z.string())]))
|
|
9314
9451
|
});
|
|
9315
9452
|
var normalizeTools = (tools) => {
|
|
9316
9453
|
if (!tools) {
|
|
@@ -9471,10 +9608,10 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
9471
9608
|
|
|
9472
9609
|
// src/features/subagents/cursor-subagent.ts
|
|
9473
9610
|
var import_node_path79 = require("path");
|
|
9474
|
-
var
|
|
9475
|
-
var CursorSubagentFrontmatterSchema =
|
|
9476
|
-
name:
|
|
9477
|
-
description:
|
|
9611
|
+
var import_mini39 = require("zod/mini");
|
|
9612
|
+
var CursorSubagentFrontmatterSchema = import_mini39.z.looseObject({
|
|
9613
|
+
name: import_mini39.z.string(),
|
|
9614
|
+
description: import_mini39.z.string()
|
|
9478
9615
|
});
|
|
9479
9616
|
var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
9480
9617
|
frontmatter;
|
|
@@ -9618,22 +9755,22 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
9618
9755
|
|
|
9619
9756
|
// src/features/subagents/kiro-subagent.ts
|
|
9620
9757
|
var import_node_path80 = require("path");
|
|
9621
|
-
var
|
|
9622
|
-
var KiroCliSubagentJsonSchema =
|
|
9623
|
-
name:
|
|
9624
|
-
description:
|
|
9625
|
-
prompt:
|
|
9626
|
-
tools:
|
|
9627
|
-
toolAliases:
|
|
9628
|
-
toolSettings:
|
|
9629
|
-
toolSchema:
|
|
9630
|
-
hooks:
|
|
9631
|
-
model:
|
|
9632
|
-
mcpServers:
|
|
9633
|
-
useLegacyMcpJson:
|
|
9634
|
-
resources:
|
|
9635
|
-
allowedTools:
|
|
9636
|
-
includeMcpJson:
|
|
9758
|
+
var import_mini40 = require("zod/mini");
|
|
9759
|
+
var KiroCliSubagentJsonSchema = import_mini40.z.looseObject({
|
|
9760
|
+
name: import_mini40.z.string(),
|
|
9761
|
+
description: import_mini40.z.optional(import_mini40.z.nullable(import_mini40.z.string())),
|
|
9762
|
+
prompt: import_mini40.z.optional(import_mini40.z.nullable(import_mini40.z.string())),
|
|
9763
|
+
tools: import_mini40.z.optional(import_mini40.z.nullable(import_mini40.z.array(import_mini40.z.string()))),
|
|
9764
|
+
toolAliases: import_mini40.z.optional(import_mini40.z.nullable(import_mini40.z.record(import_mini40.z.string(), import_mini40.z.string()))),
|
|
9765
|
+
toolSettings: import_mini40.z.optional(import_mini40.z.nullable(import_mini40.z.unknown())),
|
|
9766
|
+
toolSchema: import_mini40.z.optional(import_mini40.z.nullable(import_mini40.z.unknown())),
|
|
9767
|
+
hooks: import_mini40.z.optional(import_mini40.z.nullable(import_mini40.z.record(import_mini40.z.string(), import_mini40.z.array(import_mini40.z.unknown())))),
|
|
9768
|
+
model: import_mini40.z.optional(import_mini40.z.nullable(import_mini40.z.string())),
|
|
9769
|
+
mcpServers: import_mini40.z.optional(import_mini40.z.nullable(import_mini40.z.record(import_mini40.z.string(), import_mini40.z.unknown()))),
|
|
9770
|
+
useLegacyMcpJson: import_mini40.z.optional(import_mini40.z.nullable(import_mini40.z.boolean())),
|
|
9771
|
+
resources: import_mini40.z.optional(import_mini40.z.nullable(import_mini40.z.array(import_mini40.z.string()))),
|
|
9772
|
+
allowedTools: import_mini40.z.optional(import_mini40.z.nullable(import_mini40.z.array(import_mini40.z.string()))),
|
|
9773
|
+
includeMcpJson: import_mini40.z.optional(import_mini40.z.nullable(import_mini40.z.boolean()))
|
|
9637
9774
|
});
|
|
9638
9775
|
var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
9639
9776
|
body;
|
|
@@ -9755,11 +9892,11 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
9755
9892
|
|
|
9756
9893
|
// src/features/subagents/opencode-subagent.ts
|
|
9757
9894
|
var import_node_path81 = require("path");
|
|
9758
|
-
var
|
|
9759
|
-
var OpenCodeSubagentFrontmatterSchema =
|
|
9760
|
-
description:
|
|
9761
|
-
mode:
|
|
9762
|
-
name:
|
|
9895
|
+
var import_mini41 = require("zod/mini");
|
|
9896
|
+
var OpenCodeSubagentFrontmatterSchema = import_mini41.z.looseObject({
|
|
9897
|
+
description: import_mini41.z.string(),
|
|
9898
|
+
mode: import_mini41.z.literal("subagent"),
|
|
9899
|
+
name: import_mini41.z.optional(import_mini41.z.string())
|
|
9763
9900
|
});
|
|
9764
9901
|
var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
9765
9902
|
frontmatter;
|
|
@@ -9915,7 +10052,7 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
9915
10052
|
"opencode",
|
|
9916
10053
|
"roo"
|
|
9917
10054
|
];
|
|
9918
|
-
var SubagentsProcessorToolTargetSchema =
|
|
10055
|
+
var SubagentsProcessorToolTargetSchema = import_mini42.z.enum(subagentsProcessorToolTargetTuple);
|
|
9919
10056
|
var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
9920
10057
|
[
|
|
9921
10058
|
"agentsmd",
|
|
@@ -10192,42 +10329,42 @@ var import_node_path84 = require("path");
|
|
|
10192
10329
|
|
|
10193
10330
|
// src/features/rules/rulesync-rule.ts
|
|
10194
10331
|
var import_node_path83 = require("path");
|
|
10195
|
-
var
|
|
10196
|
-
var RulesyncRuleFrontmatterSchema =
|
|
10197
|
-
root:
|
|
10198
|
-
localRoot:
|
|
10199
|
-
targets:
|
|
10200
|
-
description:
|
|
10201
|
-
globs:
|
|
10202
|
-
agentsmd:
|
|
10203
|
-
|
|
10332
|
+
var import_mini43 = require("zod/mini");
|
|
10333
|
+
var RulesyncRuleFrontmatterSchema = import_mini43.z.object({
|
|
10334
|
+
root: import_mini43.z.optional(import_mini43.z.boolean()),
|
|
10335
|
+
localRoot: import_mini43.z.optional(import_mini43.z.boolean()),
|
|
10336
|
+
targets: import_mini43.z._default(RulesyncTargetsSchema, ["*"]),
|
|
10337
|
+
description: import_mini43.z.optional(import_mini43.z.string()),
|
|
10338
|
+
globs: import_mini43.z.optional(import_mini43.z.array(import_mini43.z.string())),
|
|
10339
|
+
agentsmd: import_mini43.z.optional(
|
|
10340
|
+
import_mini43.z.object({
|
|
10204
10341
|
// @example "path/to/subproject"
|
|
10205
|
-
subprojectPath:
|
|
10342
|
+
subprojectPath: import_mini43.z.optional(import_mini43.z.string())
|
|
10206
10343
|
})
|
|
10207
10344
|
),
|
|
10208
|
-
claudecode:
|
|
10209
|
-
|
|
10345
|
+
claudecode: import_mini43.z.optional(
|
|
10346
|
+
import_mini43.z.object({
|
|
10210
10347
|
// Glob patterns for conditional rules (takes precedence over globs)
|
|
10211
10348
|
// @example ["src/**/*.ts", "tests/**/*.test.ts"]
|
|
10212
|
-
paths:
|
|
10349
|
+
paths: import_mini43.z.optional(import_mini43.z.array(import_mini43.z.string()))
|
|
10213
10350
|
})
|
|
10214
10351
|
),
|
|
10215
|
-
cursor:
|
|
10216
|
-
|
|
10217
|
-
alwaysApply:
|
|
10218
|
-
description:
|
|
10219
|
-
globs:
|
|
10352
|
+
cursor: import_mini43.z.optional(
|
|
10353
|
+
import_mini43.z.object({
|
|
10354
|
+
alwaysApply: import_mini43.z.optional(import_mini43.z.boolean()),
|
|
10355
|
+
description: import_mini43.z.optional(import_mini43.z.string()),
|
|
10356
|
+
globs: import_mini43.z.optional(import_mini43.z.array(import_mini43.z.string()))
|
|
10220
10357
|
})
|
|
10221
10358
|
),
|
|
10222
|
-
copilot:
|
|
10223
|
-
|
|
10224
|
-
excludeAgent:
|
|
10359
|
+
copilot: import_mini43.z.optional(
|
|
10360
|
+
import_mini43.z.object({
|
|
10361
|
+
excludeAgent: import_mini43.z.optional(import_mini43.z.union([import_mini43.z.literal("code-review"), import_mini43.z.literal("coding-agent")]))
|
|
10225
10362
|
})
|
|
10226
10363
|
),
|
|
10227
|
-
antigravity:
|
|
10228
|
-
|
|
10229
|
-
trigger:
|
|
10230
|
-
globs:
|
|
10364
|
+
antigravity: import_mini43.z.optional(
|
|
10365
|
+
import_mini43.z.looseObject({
|
|
10366
|
+
trigger: import_mini43.z.optional(import_mini43.z.string()),
|
|
10367
|
+
globs: import_mini43.z.optional(import_mini43.z.array(import_mini43.z.string()))
|
|
10231
10368
|
})
|
|
10232
10369
|
)
|
|
10233
10370
|
});
|
|
@@ -10530,20 +10667,20 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
10530
10667
|
|
|
10531
10668
|
// src/features/rules/antigravity-rule.ts
|
|
10532
10669
|
var import_node_path86 = require("path");
|
|
10533
|
-
var
|
|
10534
|
-
var AntigravityRuleFrontmatterSchema =
|
|
10535
|
-
trigger:
|
|
10536
|
-
|
|
10537
|
-
|
|
10538
|
-
|
|
10539
|
-
|
|
10540
|
-
|
|
10541
|
-
|
|
10670
|
+
var import_mini44 = require("zod/mini");
|
|
10671
|
+
var AntigravityRuleFrontmatterSchema = import_mini44.z.looseObject({
|
|
10672
|
+
trigger: import_mini44.z.optional(
|
|
10673
|
+
import_mini44.z.union([
|
|
10674
|
+
import_mini44.z.literal("always_on"),
|
|
10675
|
+
import_mini44.z.literal("glob"),
|
|
10676
|
+
import_mini44.z.literal("manual"),
|
|
10677
|
+
import_mini44.z.literal("model_decision"),
|
|
10678
|
+
import_mini44.z.string()
|
|
10542
10679
|
// accepts any string for forward compatibility
|
|
10543
10680
|
])
|
|
10544
10681
|
),
|
|
10545
|
-
globs:
|
|
10546
|
-
description:
|
|
10682
|
+
globs: import_mini44.z.optional(import_mini44.z.string()),
|
|
10683
|
+
description: import_mini44.z.optional(import_mini44.z.string())
|
|
10547
10684
|
});
|
|
10548
10685
|
function parseGlobsString(globs) {
|
|
10549
10686
|
if (!globs) {
|
|
@@ -11122,9 +11259,9 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
11122
11259
|
|
|
11123
11260
|
// src/features/rules/claudecode-rule.ts
|
|
11124
11261
|
var import_node_path90 = require("path");
|
|
11125
|
-
var
|
|
11126
|
-
var ClaudecodeRuleFrontmatterSchema =
|
|
11127
|
-
paths:
|
|
11262
|
+
var import_mini45 = require("zod/mini");
|
|
11263
|
+
var ClaudecodeRuleFrontmatterSchema = import_mini45.z.object({
|
|
11264
|
+
paths: import_mini45.z.optional(import_mini45.z.array(import_mini45.z.string()))
|
|
11128
11265
|
});
|
|
11129
11266
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
11130
11267
|
frontmatter;
|
|
@@ -11333,9 +11470,9 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
11333
11470
|
|
|
11334
11471
|
// src/features/rules/cline-rule.ts
|
|
11335
11472
|
var import_node_path91 = require("path");
|
|
11336
|
-
var
|
|
11337
|
-
var ClineRuleFrontmatterSchema =
|
|
11338
|
-
description:
|
|
11473
|
+
var import_mini46 = require("zod/mini");
|
|
11474
|
+
var ClineRuleFrontmatterSchema = import_mini46.z.object({
|
|
11475
|
+
description: import_mini46.z.string()
|
|
11339
11476
|
});
|
|
11340
11477
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
11341
11478
|
static getSettablePaths(_options = {}) {
|
|
@@ -11514,11 +11651,11 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
11514
11651
|
|
|
11515
11652
|
// src/features/rules/copilot-rule.ts
|
|
11516
11653
|
var import_node_path93 = require("path");
|
|
11517
|
-
var
|
|
11518
|
-
var CopilotRuleFrontmatterSchema =
|
|
11519
|
-
description:
|
|
11520
|
-
applyTo:
|
|
11521
|
-
excludeAgent:
|
|
11654
|
+
var import_mini47 = require("zod/mini");
|
|
11655
|
+
var CopilotRuleFrontmatterSchema = import_mini47.z.object({
|
|
11656
|
+
description: import_mini47.z.optional(import_mini47.z.string()),
|
|
11657
|
+
applyTo: import_mini47.z.optional(import_mini47.z.string()),
|
|
11658
|
+
excludeAgent: import_mini47.z.optional(import_mini47.z.union([import_mini47.z.literal("code-review"), import_mini47.z.literal("coding-agent")]))
|
|
11522
11659
|
});
|
|
11523
11660
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
11524
11661
|
frontmatter;
|
|
@@ -11702,11 +11839,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
11702
11839
|
|
|
11703
11840
|
// src/features/rules/cursor-rule.ts
|
|
11704
11841
|
var import_node_path94 = require("path");
|
|
11705
|
-
var
|
|
11706
|
-
var CursorRuleFrontmatterSchema =
|
|
11707
|
-
description:
|
|
11708
|
-
globs:
|
|
11709
|
-
alwaysApply:
|
|
11842
|
+
var import_mini48 = require("zod/mini");
|
|
11843
|
+
var CursorRuleFrontmatterSchema = import_mini48.z.object({
|
|
11844
|
+
description: import_mini48.z.optional(import_mini48.z.string()),
|
|
11845
|
+
globs: import_mini48.z.optional(import_mini48.z.string()),
|
|
11846
|
+
alwaysApply: import_mini48.z.optional(import_mini48.z.boolean())
|
|
11710
11847
|
});
|
|
11711
11848
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
11712
11849
|
frontmatter;
|
|
@@ -12813,7 +12950,7 @@ var rulesProcessorToolTargets = [
|
|
|
12813
12950
|
"warp",
|
|
12814
12951
|
"windsurf"
|
|
12815
12952
|
];
|
|
12816
|
-
var RulesProcessorToolTargetSchema =
|
|
12953
|
+
var RulesProcessorToolTargetSchema = import_mini49.z.enum(rulesProcessorToolTargets);
|
|
12817
12954
|
var toolRuleFactories = /* @__PURE__ */ new Map([
|
|
12818
12955
|
[
|
|
12819
12956
|
"agentsmd",
|
|
@@ -12934,8 +13071,7 @@ var toolRuleFactories = /* @__PURE__ */ new Map([
|
|
|
12934
13071
|
supportsGlobal: true,
|
|
12935
13072
|
ruleDiscoveryMode: "toon",
|
|
12936
13073
|
additionalConventions: {
|
|
12937
|
-
subagents: { subagentClass: GeminiCliSubagent }
|
|
12938
|
-
skills: { skillClass: GeminiCliSkill }
|
|
13074
|
+
subagents: { subagentClass: GeminiCliSubagent }
|
|
12939
13075
|
}
|
|
12940
13076
|
}
|
|
12941
13077
|
}
|
|
@@ -13515,60 +13651,60 @@ ${toonContent}`;
|
|
|
13515
13651
|
};
|
|
13516
13652
|
|
|
13517
13653
|
// src/types/git-provider.ts
|
|
13518
|
-
var
|
|
13654
|
+
var import_mini50 = require("zod/mini");
|
|
13519
13655
|
var ALL_GIT_PROVIDERS = ["github", "gitlab"];
|
|
13520
|
-
var GitProviderSchema =
|
|
13656
|
+
var GitProviderSchema = import_mini50.z.enum(ALL_GIT_PROVIDERS);
|
|
13521
13657
|
|
|
13522
13658
|
// src/lib/github-client.ts
|
|
13523
13659
|
var import_request_error = require("@octokit/request-error");
|
|
13524
13660
|
var import_rest = require("@octokit/rest");
|
|
13525
13661
|
|
|
13526
13662
|
// src/types/fetch.ts
|
|
13527
|
-
var
|
|
13663
|
+
var import_mini52 = require("zod/mini");
|
|
13528
13664
|
|
|
13529
13665
|
// src/types/fetch-targets.ts
|
|
13530
|
-
var
|
|
13666
|
+
var import_mini51 = require("zod/mini");
|
|
13531
13667
|
var ALL_FETCH_TARGETS = ["rulesync", ...ALL_TOOL_TARGETS];
|
|
13532
|
-
var FetchTargetSchema =
|
|
13668
|
+
var FetchTargetSchema = import_mini51.z.enum(ALL_FETCH_TARGETS);
|
|
13533
13669
|
|
|
13534
13670
|
// src/types/fetch.ts
|
|
13535
|
-
var ConflictStrategySchema =
|
|
13536
|
-
var GitHubFileTypeSchema =
|
|
13537
|
-
var GitHubFileEntrySchema =
|
|
13538
|
-
name:
|
|
13539
|
-
path:
|
|
13540
|
-
sha:
|
|
13541
|
-
size:
|
|
13671
|
+
var ConflictStrategySchema = import_mini52.z.enum(["skip", "overwrite"]);
|
|
13672
|
+
var GitHubFileTypeSchema = import_mini52.z.enum(["file", "dir", "symlink", "submodule"]);
|
|
13673
|
+
var GitHubFileEntrySchema = import_mini52.z.looseObject({
|
|
13674
|
+
name: import_mini52.z.string(),
|
|
13675
|
+
path: import_mini52.z.string(),
|
|
13676
|
+
sha: import_mini52.z.string(),
|
|
13677
|
+
size: import_mini52.z.number(),
|
|
13542
13678
|
type: GitHubFileTypeSchema,
|
|
13543
|
-
download_url:
|
|
13679
|
+
download_url: import_mini52.z.nullable(import_mini52.z.string())
|
|
13544
13680
|
});
|
|
13545
|
-
var FetchOptionsSchema =
|
|
13546
|
-
target:
|
|
13547
|
-
features:
|
|
13548
|
-
ref:
|
|
13549
|
-
path:
|
|
13550
|
-
output:
|
|
13551
|
-
conflict:
|
|
13552
|
-
token:
|
|
13553
|
-
verbose:
|
|
13554
|
-
silent:
|
|
13681
|
+
var FetchOptionsSchema = import_mini52.z.looseObject({
|
|
13682
|
+
target: import_mini52.z.optional(FetchTargetSchema),
|
|
13683
|
+
features: import_mini52.z.optional(import_mini52.z.array(import_mini52.z.enum(ALL_FEATURES_WITH_WILDCARD))),
|
|
13684
|
+
ref: import_mini52.z.optional(import_mini52.z.string()),
|
|
13685
|
+
path: import_mini52.z.optional(import_mini52.z.string()),
|
|
13686
|
+
output: import_mini52.z.optional(import_mini52.z.string()),
|
|
13687
|
+
conflict: import_mini52.z.optional(ConflictStrategySchema),
|
|
13688
|
+
token: import_mini52.z.optional(import_mini52.z.string()),
|
|
13689
|
+
verbose: import_mini52.z.optional(import_mini52.z.boolean()),
|
|
13690
|
+
silent: import_mini52.z.optional(import_mini52.z.boolean())
|
|
13555
13691
|
});
|
|
13556
|
-
var FetchFileStatusSchema =
|
|
13557
|
-
var GitHubRepoInfoSchema =
|
|
13558
|
-
default_branch:
|
|
13559
|
-
private:
|
|
13692
|
+
var FetchFileStatusSchema = import_mini52.z.enum(["created", "overwritten", "skipped"]);
|
|
13693
|
+
var GitHubRepoInfoSchema = import_mini52.z.looseObject({
|
|
13694
|
+
default_branch: import_mini52.z.string(),
|
|
13695
|
+
private: import_mini52.z.boolean()
|
|
13560
13696
|
});
|
|
13561
|
-
var GitHubReleaseAssetSchema =
|
|
13562
|
-
name:
|
|
13563
|
-
browser_download_url:
|
|
13564
|
-
size:
|
|
13697
|
+
var GitHubReleaseAssetSchema = import_mini52.z.looseObject({
|
|
13698
|
+
name: import_mini52.z.string(),
|
|
13699
|
+
browser_download_url: import_mini52.z.string(),
|
|
13700
|
+
size: import_mini52.z.number()
|
|
13565
13701
|
});
|
|
13566
|
-
var GitHubReleaseSchema =
|
|
13567
|
-
tag_name:
|
|
13568
|
-
name:
|
|
13569
|
-
prerelease:
|
|
13570
|
-
draft:
|
|
13571
|
-
assets:
|
|
13702
|
+
var GitHubReleaseSchema = import_mini52.z.looseObject({
|
|
13703
|
+
tag_name: import_mini52.z.string(),
|
|
13704
|
+
name: import_mini52.z.nullable(import_mini52.z.string()),
|
|
13705
|
+
prerelease: import_mini52.z.boolean(),
|
|
13706
|
+
draft: import_mini52.z.boolean(),
|
|
13707
|
+
assets: import_mini52.z.array(GitHubReleaseAssetSchema)
|
|
13572
13708
|
});
|
|
13573
13709
|
|
|
13574
13710
|
// src/lib/github-client.ts
|
|
@@ -13819,6 +13955,13 @@ var FEATURE_PATHS = {
|
|
|
13819
13955
|
function isToolTarget(target) {
|
|
13820
13956
|
return target !== "rulesync";
|
|
13821
13957
|
}
|
|
13958
|
+
function validateFileSize(relativePath, size) {
|
|
13959
|
+
if (size > MAX_FILE_SIZE) {
|
|
13960
|
+
throw new GitHubClientError(
|
|
13961
|
+
`File "${relativePath}" exceeds maximum size limit (${(size / 1024 / 1024).toFixed(2)}MB > ${MAX_FILE_SIZE / 1024 / 1024}MB)`
|
|
13962
|
+
);
|
|
13963
|
+
}
|
|
13964
|
+
}
|
|
13822
13965
|
async function processFeatureConversion(params) {
|
|
13823
13966
|
const { processor, outputDir } = params;
|
|
13824
13967
|
const paths = [];
|
|
@@ -14083,11 +14226,7 @@ async function fetchFiles(params) {
|
|
|
14083
14226
|
relativePath,
|
|
14084
14227
|
intendedRootDir: outputBasePath
|
|
14085
14228
|
});
|
|
14086
|
-
|
|
14087
|
-
throw new GitHubClientError(
|
|
14088
|
-
`File "${relativePath}" exceeds maximum size limit (${(size / 1024 / 1024).toFixed(2)}MB > ${MAX_FILE_SIZE / 1024 / 1024}MB)`
|
|
14089
|
-
);
|
|
14090
|
-
}
|
|
14229
|
+
validateFileSize(relativePath, size);
|
|
14091
14230
|
}
|
|
14092
14231
|
const results = await Promise.all(
|
|
14093
14232
|
filesToFetch.map(async ({ remotePath, relativePath }) => {
|
|
@@ -14119,6 +14258,15 @@ async function fetchFiles(params) {
|
|
|
14119
14258
|
}
|
|
14120
14259
|
async function collectFeatureFiles(params) {
|
|
14121
14260
|
const { client, owner, repo, basePath, ref, enabledFeatures, semaphore } = params;
|
|
14261
|
+
const dirCache = /* @__PURE__ */ new Map();
|
|
14262
|
+
async function getCachedDirectory(path4) {
|
|
14263
|
+
let promise = dirCache.get(path4);
|
|
14264
|
+
if (promise === void 0) {
|
|
14265
|
+
promise = withSemaphore(semaphore, () => client.listDirectory(owner, repo, path4, ref));
|
|
14266
|
+
dirCache.set(path4, promise);
|
|
14267
|
+
}
|
|
14268
|
+
return promise;
|
|
14269
|
+
}
|
|
14122
14270
|
const tasks = enabledFeatures.flatMap(
|
|
14123
14271
|
(feature) => FEATURE_PATHS[feature].map((featurePath) => ({ feature, featurePath }))
|
|
14124
14272
|
);
|
|
@@ -14129,14 +14277,8 @@ async function collectFeatureFiles(params) {
|
|
|
14129
14277
|
try {
|
|
14130
14278
|
if (featurePath.includes(".")) {
|
|
14131
14279
|
try {
|
|
14132
|
-
const entries = await
|
|
14133
|
-
|
|
14134
|
-
() => client.listDirectory(
|
|
14135
|
-
owner,
|
|
14136
|
-
repo,
|
|
14137
|
-
basePath === "." || basePath === "" ? "." : basePath,
|
|
14138
|
-
ref
|
|
14139
|
-
)
|
|
14280
|
+
const entries = await getCachedDirectory(
|
|
14281
|
+
basePath === "." || basePath === "" ? "." : basePath
|
|
14140
14282
|
);
|
|
14141
14283
|
const fileEntry = entries.find((e) => e.name === featurePath && e.type === "file");
|
|
14142
14284
|
if (fileEntry) {
|
|
@@ -14255,11 +14397,7 @@ async function fetchAndConvertToolFiles(params) {
|
|
|
14255
14397
|
};
|
|
14256
14398
|
}
|
|
14257
14399
|
for (const { relativePath, size } of filesToFetch) {
|
|
14258
|
-
|
|
14259
|
-
throw new GitHubClientError(
|
|
14260
|
-
`File "${relativePath}" exceeds maximum size limit (${(size / 1024 / 1024).toFixed(2)}MB > ${MAX_FILE_SIZE / 1024 / 1024}MB)`
|
|
14261
|
-
);
|
|
14262
|
-
}
|
|
14400
|
+
validateFileSize(relativePath, size);
|
|
14263
14401
|
}
|
|
14264
14402
|
const toolPaths = getToolPathMapping(target);
|
|
14265
14403
|
await Promise.all(
|
|
@@ -14276,7 +14414,6 @@ async function fetchAndConvertToolFiles(params) {
|
|
|
14276
14414
|
);
|
|
14277
14415
|
await writeFileContent(localPath, content);
|
|
14278
14416
|
logger.debug(`Fetched to temp: ${toolRelativePath}`);
|
|
14279
|
-
return toolRelativePath;
|
|
14280
14417
|
})
|
|
14281
14418
|
);
|
|
14282
14419
|
const outputBasePath = (0, import_node_path107.join)(baseDir, outputDir);
|
|
@@ -14429,29 +14566,29 @@ var import_jsonc_parser = require("jsonc-parser");
|
|
|
14429
14566
|
var import_node_path108 = require("path");
|
|
14430
14567
|
|
|
14431
14568
|
// src/config/config.ts
|
|
14432
|
-
var
|
|
14433
|
-
var ConfigParamsSchema =
|
|
14434
|
-
baseDirs:
|
|
14569
|
+
var import_mini53 = require("zod/mini");
|
|
14570
|
+
var ConfigParamsSchema = import_mini53.z.object({
|
|
14571
|
+
baseDirs: import_mini53.z.array(import_mini53.z.string()),
|
|
14435
14572
|
targets: RulesyncTargetsSchema,
|
|
14436
14573
|
features: RulesyncFeaturesSchema,
|
|
14437
|
-
verbose:
|
|
14438
|
-
delete:
|
|
14574
|
+
verbose: import_mini53.z.boolean(),
|
|
14575
|
+
delete: import_mini53.z.boolean(),
|
|
14439
14576
|
// New non-experimental options
|
|
14440
|
-
global: (0,
|
|
14441
|
-
silent: (0,
|
|
14442
|
-
simulateCommands: (0,
|
|
14443
|
-
simulateSubagents: (0,
|
|
14444
|
-
simulateSkills: (0,
|
|
14445
|
-
modularMcp: (0,
|
|
14446
|
-
dryRun: (0,
|
|
14447
|
-
check: (0,
|
|
14577
|
+
global: (0, import_mini53.optional)(import_mini53.z.boolean()),
|
|
14578
|
+
silent: (0, import_mini53.optional)(import_mini53.z.boolean()),
|
|
14579
|
+
simulateCommands: (0, import_mini53.optional)(import_mini53.z.boolean()),
|
|
14580
|
+
simulateSubagents: (0, import_mini53.optional)(import_mini53.z.boolean()),
|
|
14581
|
+
simulateSkills: (0, import_mini53.optional)(import_mini53.z.boolean()),
|
|
14582
|
+
modularMcp: (0, import_mini53.optional)(import_mini53.z.boolean()),
|
|
14583
|
+
dryRun: (0, import_mini53.optional)(import_mini53.z.boolean()),
|
|
14584
|
+
check: (0, import_mini53.optional)(import_mini53.z.boolean())
|
|
14448
14585
|
});
|
|
14449
|
-
var PartialConfigParamsSchema =
|
|
14450
|
-
var ConfigFileSchema =
|
|
14451
|
-
$schema: (0,
|
|
14452
|
-
...
|
|
14586
|
+
var PartialConfigParamsSchema = import_mini53.z.partial(ConfigParamsSchema);
|
|
14587
|
+
var ConfigFileSchema = import_mini53.z.object({
|
|
14588
|
+
$schema: (0, import_mini53.optional)(import_mini53.z.string()),
|
|
14589
|
+
...import_mini53.z.partial(ConfigParamsSchema).shape
|
|
14453
14590
|
});
|
|
14454
|
-
var RequiredConfigParamsSchema =
|
|
14591
|
+
var RequiredConfigParamsSchema = import_mini53.z.required(ConfigParamsSchema);
|
|
14455
14592
|
var CONFLICTING_TARGET_PAIRS = [
|
|
14456
14593
|
["augmentcode", "augmentcode-legacy"],
|
|
14457
14594
|
["claudecode", "claudecode-legacy"]
|
|
@@ -14524,12 +14661,45 @@ var Config = class {
|
|
|
14524
14661
|
}
|
|
14525
14662
|
return this.targets.filter((target) => target !== "*");
|
|
14526
14663
|
}
|
|
14527
|
-
getFeatures() {
|
|
14664
|
+
getFeatures(target) {
|
|
14665
|
+
if (!Array.isArray(this.features)) {
|
|
14666
|
+
const perTargetFeatures = this.features;
|
|
14667
|
+
if (target) {
|
|
14668
|
+
const targetFeatures = perTargetFeatures[target];
|
|
14669
|
+
if (!targetFeatures || targetFeatures.length === 0) {
|
|
14670
|
+
return [];
|
|
14671
|
+
}
|
|
14672
|
+
if (targetFeatures.includes("*")) {
|
|
14673
|
+
return [...ALL_FEATURES];
|
|
14674
|
+
}
|
|
14675
|
+
return targetFeatures.filter((feature) => feature !== "*");
|
|
14676
|
+
}
|
|
14677
|
+
const allFeatures = [];
|
|
14678
|
+
for (const features of Object.values(perTargetFeatures)) {
|
|
14679
|
+
if (features && features.length > 0) {
|
|
14680
|
+
if (features.includes("*")) {
|
|
14681
|
+
return [...ALL_FEATURES];
|
|
14682
|
+
}
|
|
14683
|
+
for (const feature of features) {
|
|
14684
|
+
if (feature !== "*" && !allFeatures.includes(feature)) {
|
|
14685
|
+
allFeatures.push(feature);
|
|
14686
|
+
}
|
|
14687
|
+
}
|
|
14688
|
+
}
|
|
14689
|
+
}
|
|
14690
|
+
return allFeatures;
|
|
14691
|
+
}
|
|
14528
14692
|
if (this.features.includes("*")) {
|
|
14529
14693
|
return [...ALL_FEATURES];
|
|
14530
14694
|
}
|
|
14531
14695
|
return this.features.filter((feature) => feature !== "*");
|
|
14532
14696
|
}
|
|
14697
|
+
/**
|
|
14698
|
+
* Check if per-target features configuration is being used.
|
|
14699
|
+
*/
|
|
14700
|
+
hasPerTargetFeatures() {
|
|
14701
|
+
return !Array.isArray(this.features);
|
|
14702
|
+
}
|
|
14533
14703
|
getVerbose() {
|
|
14534
14704
|
return this.verbose;
|
|
14535
14705
|
}
|
|
@@ -14710,9 +14880,6 @@ async function generate(params) {
|
|
|
14710
14880
|
}
|
|
14711
14881
|
async function generateRulesCore(params) {
|
|
14712
14882
|
const { config, skills } = params;
|
|
14713
|
-
if (!config.getFeatures().includes("rules")) {
|
|
14714
|
-
return { count: 0, hasDiff: false };
|
|
14715
|
-
}
|
|
14716
14883
|
let totalCount = 0;
|
|
14717
14884
|
let hasDiff = false;
|
|
14718
14885
|
const isPreviewMode = config.isPreviewMode();
|
|
@@ -14722,6 +14889,9 @@ async function generateRulesCore(params) {
|
|
|
14722
14889
|
);
|
|
14723
14890
|
for (const baseDir of config.getBaseDirs()) {
|
|
14724
14891
|
for (const toolTarget of toolTargets) {
|
|
14892
|
+
if (!config.getFeatures(toolTarget).includes("rules")) {
|
|
14893
|
+
continue;
|
|
14894
|
+
}
|
|
14725
14895
|
const processor = new RulesProcessor({
|
|
14726
14896
|
baseDir,
|
|
14727
14897
|
toolTarget,
|
|
@@ -14748,9 +14918,6 @@ async function generateRulesCore(params) {
|
|
|
14748
14918
|
}
|
|
14749
14919
|
async function generateIgnoreCore(params) {
|
|
14750
14920
|
const { config } = params;
|
|
14751
|
-
if (!config.getFeatures().includes("ignore")) {
|
|
14752
|
-
return { count: 0, hasDiff: false };
|
|
14753
|
-
}
|
|
14754
14921
|
if (config.getGlobal()) {
|
|
14755
14922
|
return { count: 0, hasDiff: false };
|
|
14756
14923
|
}
|
|
@@ -14758,6 +14925,9 @@ async function generateIgnoreCore(params) {
|
|
|
14758
14925
|
let hasDiff = false;
|
|
14759
14926
|
const isPreviewMode = config.isPreviewMode();
|
|
14760
14927
|
for (const toolTarget of (0, import_es_toolkit4.intersection)(config.getTargets(), IgnoreProcessor.getToolTargets())) {
|
|
14928
|
+
if (!config.getFeatures(toolTarget).includes("ignore")) {
|
|
14929
|
+
continue;
|
|
14930
|
+
}
|
|
14761
14931
|
for (const baseDir of config.getBaseDirs()) {
|
|
14762
14932
|
try {
|
|
14763
14933
|
const processor = new IgnoreProcessor({
|
|
@@ -14793,9 +14963,6 @@ async function generateIgnoreCore(params) {
|
|
|
14793
14963
|
}
|
|
14794
14964
|
async function generateMcpCore(params) {
|
|
14795
14965
|
const { config } = params;
|
|
14796
|
-
if (!config.getFeatures().includes("mcp")) {
|
|
14797
|
-
return { count: 0, hasDiff: false };
|
|
14798
|
-
}
|
|
14799
14966
|
let totalCount = 0;
|
|
14800
14967
|
let hasDiff = false;
|
|
14801
14968
|
const isPreviewMode = config.isPreviewMode();
|
|
@@ -14805,6 +14972,9 @@ async function generateMcpCore(params) {
|
|
|
14805
14972
|
);
|
|
14806
14973
|
for (const baseDir of config.getBaseDirs()) {
|
|
14807
14974
|
for (const toolTarget of toolTargets) {
|
|
14975
|
+
if (!config.getFeatures(toolTarget).includes("mcp")) {
|
|
14976
|
+
continue;
|
|
14977
|
+
}
|
|
14808
14978
|
const processor = new McpProcessor({
|
|
14809
14979
|
baseDir,
|
|
14810
14980
|
toolTarget,
|
|
@@ -14828,9 +14998,6 @@ async function generateMcpCore(params) {
|
|
|
14828
14998
|
}
|
|
14829
14999
|
async function generateCommandsCore(params) {
|
|
14830
15000
|
const { config } = params;
|
|
14831
|
-
if (!config.getFeatures().includes("commands")) {
|
|
14832
|
-
return { count: 0, hasDiff: false };
|
|
14833
|
-
}
|
|
14834
15001
|
let totalCount = 0;
|
|
14835
15002
|
let hasDiff = false;
|
|
14836
15003
|
const isPreviewMode = config.isPreviewMode();
|
|
@@ -14843,6 +15010,9 @@ async function generateCommandsCore(params) {
|
|
|
14843
15010
|
);
|
|
14844
15011
|
for (const baseDir of config.getBaseDirs()) {
|
|
14845
15012
|
for (const toolTarget of toolTargets) {
|
|
15013
|
+
if (!config.getFeatures(toolTarget).includes("commands")) {
|
|
15014
|
+
continue;
|
|
15015
|
+
}
|
|
14846
15016
|
const processor = new CommandsProcessor({
|
|
14847
15017
|
baseDir,
|
|
14848
15018
|
toolTarget,
|
|
@@ -14865,9 +15035,6 @@ async function generateCommandsCore(params) {
|
|
|
14865
15035
|
}
|
|
14866
15036
|
async function generateSubagentsCore(params) {
|
|
14867
15037
|
const { config } = params;
|
|
14868
|
-
if (!config.getFeatures().includes("subagents")) {
|
|
14869
|
-
return { count: 0, hasDiff: false };
|
|
14870
|
-
}
|
|
14871
15038
|
let totalCount = 0;
|
|
14872
15039
|
let hasDiff = false;
|
|
14873
15040
|
const isPreviewMode = config.isPreviewMode();
|
|
@@ -14880,6 +15047,9 @@ async function generateSubagentsCore(params) {
|
|
|
14880
15047
|
);
|
|
14881
15048
|
for (const baseDir of config.getBaseDirs()) {
|
|
14882
15049
|
for (const toolTarget of toolTargets) {
|
|
15050
|
+
if (!config.getFeatures(toolTarget).includes("subagents")) {
|
|
15051
|
+
continue;
|
|
15052
|
+
}
|
|
14883
15053
|
const processor = new SubagentsProcessor({
|
|
14884
15054
|
baseDir,
|
|
14885
15055
|
toolTarget,
|
|
@@ -14902,9 +15072,6 @@ async function generateSubagentsCore(params) {
|
|
|
14902
15072
|
}
|
|
14903
15073
|
async function generateSkillsCore(params) {
|
|
14904
15074
|
const { config } = params;
|
|
14905
|
-
if (!config.getFeatures().includes("skills")) {
|
|
14906
|
-
return { count: 0, skills: [], hasDiff: false };
|
|
14907
|
-
}
|
|
14908
15075
|
let totalCount = 0;
|
|
14909
15076
|
let hasDiff = false;
|
|
14910
15077
|
const allSkills = [];
|
|
@@ -14918,6 +15085,9 @@ async function generateSkillsCore(params) {
|
|
|
14918
15085
|
);
|
|
14919
15086
|
for (const baseDir of config.getBaseDirs()) {
|
|
14920
15087
|
for (const toolTarget of toolTargets) {
|
|
15088
|
+
if (!config.getFeatures(toolTarget).includes("skills")) {
|
|
15089
|
+
continue;
|
|
15090
|
+
}
|
|
14921
15091
|
const processor = new SkillsProcessor({
|
|
14922
15092
|
baseDir,
|
|
14923
15093
|
toolTarget,
|
|
@@ -14945,9 +15115,6 @@ async function generateSkillsCore(params) {
|
|
|
14945
15115
|
}
|
|
14946
15116
|
async function generateHooksCore(params) {
|
|
14947
15117
|
const { config } = params;
|
|
14948
|
-
if (!config.getFeatures().includes("hooks")) {
|
|
14949
|
-
return { count: 0, hasDiff: false };
|
|
14950
|
-
}
|
|
14951
15118
|
let totalCount = 0;
|
|
14952
15119
|
let hasDiff = false;
|
|
14953
15120
|
const isPreviewMode = config.isPreviewMode();
|
|
@@ -14957,6 +15124,9 @@ async function generateHooksCore(params) {
|
|
|
14957
15124
|
);
|
|
14958
15125
|
for (const baseDir of config.getBaseDirs()) {
|
|
14959
15126
|
for (const toolTarget of toolTargets) {
|
|
15127
|
+
if (!config.getFeatures(toolTarget).includes("hooks")) {
|
|
15128
|
+
continue;
|
|
15129
|
+
}
|
|
14960
15130
|
const processor = new HooksProcessor({
|
|
14961
15131
|
baseDir,
|
|
14962
15132
|
toolTarget,
|
|
@@ -14996,9 +15166,9 @@ function logFeatureResult(params) {
|
|
|
14996
15166
|
const { count, featureName, isPreview, modePrefix } = params;
|
|
14997
15167
|
if (count > 0) {
|
|
14998
15168
|
if (isPreview) {
|
|
14999
|
-
logger.info(`${modePrefix} Would
|
|
15169
|
+
logger.info(`${modePrefix} Would write ${count} ${featureName}`);
|
|
15000
15170
|
} else {
|
|
15001
|
-
logger.success(`
|
|
15171
|
+
logger.success(`Written ${count} ${featureName}`);
|
|
15002
15172
|
}
|
|
15003
15173
|
}
|
|
15004
15174
|
}
|
|
@@ -15093,7 +15263,7 @@ async function generateCommand(options) {
|
|
|
15093
15263
|
const totalGenerated = calculateTotalCount(result);
|
|
15094
15264
|
if (totalGenerated === 0) {
|
|
15095
15265
|
const enabledFeatures = features.join(", ");
|
|
15096
|
-
logger.
|
|
15266
|
+
logger.info(`\u2713 All files are up to date (${enabledFeatures})`);
|
|
15097
15267
|
return;
|
|
15098
15268
|
}
|
|
15099
15269
|
const parts = [];
|
|
@@ -15105,11 +15275,9 @@ async function generateCommand(options) {
|
|
|
15105
15275
|
if (result.skillsCount > 0) parts.push(`${result.skillsCount} skills`);
|
|
15106
15276
|
if (result.hooksCount > 0) parts.push(`${result.hooksCount} hooks`);
|
|
15107
15277
|
if (isPreview) {
|
|
15108
|
-
logger.info(
|
|
15109
|
-
`${modePrefix} Would generate ${totalGenerated} file(s) total (${parts.join(" + ")})`
|
|
15110
|
-
);
|
|
15278
|
+
logger.info(`${modePrefix} Would write ${totalGenerated} file(s) total (${parts.join(" + ")})`);
|
|
15111
15279
|
} else {
|
|
15112
|
-
logger.success(`\u{1F389} All done!
|
|
15280
|
+
logger.success(`\u{1F389} All done! Written ${totalGenerated} file(s) total (${parts.join(" + ")})`);
|
|
15113
15281
|
}
|
|
15114
15282
|
if (check) {
|
|
15115
15283
|
if (result.hasDiff) {
|
|
@@ -15319,7 +15487,7 @@ async function importFromTool(params) {
|
|
|
15319
15487
|
}
|
|
15320
15488
|
async function importRulesCore(params) {
|
|
15321
15489
|
const { config, tool } = params;
|
|
15322
|
-
if (!config.getFeatures().includes("rules")) {
|
|
15490
|
+
if (!config.getFeatures(tool).includes("rules")) {
|
|
15323
15491
|
return 0;
|
|
15324
15492
|
}
|
|
15325
15493
|
const global = config.getGlobal();
|
|
@@ -15345,7 +15513,7 @@ async function importRulesCore(params) {
|
|
|
15345
15513
|
}
|
|
15346
15514
|
async function importIgnoreCore(params) {
|
|
15347
15515
|
const { config, tool } = params;
|
|
15348
|
-
if (!config.getFeatures().includes("ignore")) {
|
|
15516
|
+
if (!config.getFeatures(tool).includes("ignore")) {
|
|
15349
15517
|
return 0;
|
|
15350
15518
|
}
|
|
15351
15519
|
if (config.getGlobal()) {
|
|
@@ -15375,7 +15543,7 @@ async function importIgnoreCore(params) {
|
|
|
15375
15543
|
}
|
|
15376
15544
|
async function importMcpCore(params) {
|
|
15377
15545
|
const { config, tool } = params;
|
|
15378
|
-
if (!config.getFeatures().includes("mcp")) {
|
|
15546
|
+
if (!config.getFeatures(tool).includes("mcp")) {
|
|
15379
15547
|
return 0;
|
|
15380
15548
|
}
|
|
15381
15549
|
const global = config.getGlobal();
|
|
@@ -15401,7 +15569,7 @@ async function importMcpCore(params) {
|
|
|
15401
15569
|
}
|
|
15402
15570
|
async function importCommandsCore(params) {
|
|
15403
15571
|
const { config, tool } = params;
|
|
15404
|
-
if (!config.getFeatures().includes("commands")) {
|
|
15572
|
+
if (!config.getFeatures(tool).includes("commands")) {
|
|
15405
15573
|
return 0;
|
|
15406
15574
|
}
|
|
15407
15575
|
const global = config.getGlobal();
|
|
@@ -15427,7 +15595,7 @@ async function importCommandsCore(params) {
|
|
|
15427
15595
|
}
|
|
15428
15596
|
async function importSubagentsCore(params) {
|
|
15429
15597
|
const { config, tool } = params;
|
|
15430
|
-
if (!config.getFeatures().includes("subagents")) {
|
|
15598
|
+
if (!config.getFeatures(tool).includes("subagents")) {
|
|
15431
15599
|
return 0;
|
|
15432
15600
|
}
|
|
15433
15601
|
const global = config.getGlobal();
|
|
@@ -15453,7 +15621,7 @@ async function importSubagentsCore(params) {
|
|
|
15453
15621
|
}
|
|
15454
15622
|
async function importSkillsCore(params) {
|
|
15455
15623
|
const { config, tool } = params;
|
|
15456
|
-
if (!config.getFeatures().includes("skills")) {
|
|
15624
|
+
if (!config.getFeatures(tool).includes("skills")) {
|
|
15457
15625
|
return 0;
|
|
15458
15626
|
}
|
|
15459
15627
|
const global = config.getGlobal();
|
|
@@ -15479,7 +15647,7 @@ async function importSkillsCore(params) {
|
|
|
15479
15647
|
}
|
|
15480
15648
|
async function importHooksCore(params) {
|
|
15481
15649
|
const { config, tool } = params;
|
|
15482
|
-
if (!config.getFeatures().includes("hooks")) {
|
|
15650
|
+
if (!config.getFeatures(tool).includes("hooks")) {
|
|
15483
15651
|
return 0;
|
|
15484
15652
|
}
|
|
15485
15653
|
const global = config.getGlobal();
|
|
@@ -15792,11 +15960,11 @@ async function initCommand() {
|
|
|
15792
15960
|
var import_fastmcp = require("fastmcp");
|
|
15793
15961
|
|
|
15794
15962
|
// src/mcp/tools.ts
|
|
15795
|
-
var
|
|
15963
|
+
var import_mini62 = require("zod/mini");
|
|
15796
15964
|
|
|
15797
15965
|
// src/mcp/commands.ts
|
|
15798
15966
|
var import_node_path112 = require("path");
|
|
15799
|
-
var
|
|
15967
|
+
var import_mini54 = require("zod/mini");
|
|
15800
15968
|
var maxCommandSizeBytes = 1024 * 1024;
|
|
15801
15969
|
var maxCommandsCount = 1e3;
|
|
15802
15970
|
async function listCommands() {
|
|
@@ -15915,17 +16083,17 @@ async function deleteCommand({ relativePathFromCwd }) {
|
|
|
15915
16083
|
}
|
|
15916
16084
|
}
|
|
15917
16085
|
var commandToolSchemas = {
|
|
15918
|
-
listCommands:
|
|
15919
|
-
getCommand:
|
|
15920
|
-
relativePathFromCwd:
|
|
16086
|
+
listCommands: import_mini54.z.object({}),
|
|
16087
|
+
getCommand: import_mini54.z.object({
|
|
16088
|
+
relativePathFromCwd: import_mini54.z.string()
|
|
15921
16089
|
}),
|
|
15922
|
-
putCommand:
|
|
15923
|
-
relativePathFromCwd:
|
|
16090
|
+
putCommand: import_mini54.z.object({
|
|
16091
|
+
relativePathFromCwd: import_mini54.z.string(),
|
|
15924
16092
|
frontmatter: RulesyncCommandFrontmatterSchema,
|
|
15925
|
-
body:
|
|
16093
|
+
body: import_mini54.z.string()
|
|
15926
16094
|
}),
|
|
15927
|
-
deleteCommand:
|
|
15928
|
-
relativePathFromCwd:
|
|
16095
|
+
deleteCommand: import_mini54.z.object({
|
|
16096
|
+
relativePathFromCwd: import_mini54.z.string()
|
|
15929
16097
|
})
|
|
15930
16098
|
};
|
|
15931
16099
|
var commandTools = {
|
|
@@ -15973,16 +16141,16 @@ var commandTools = {
|
|
|
15973
16141
|
};
|
|
15974
16142
|
|
|
15975
16143
|
// src/mcp/generate.ts
|
|
15976
|
-
var
|
|
15977
|
-
var generateOptionsSchema =
|
|
15978
|
-
targets:
|
|
15979
|
-
features:
|
|
15980
|
-
delete:
|
|
15981
|
-
global:
|
|
15982
|
-
simulateCommands:
|
|
15983
|
-
simulateSubagents:
|
|
15984
|
-
simulateSkills:
|
|
15985
|
-
modularMcp:
|
|
16144
|
+
var import_mini55 = require("zod/mini");
|
|
16145
|
+
var generateOptionsSchema = import_mini55.z.object({
|
|
16146
|
+
targets: import_mini55.z.optional(import_mini55.z.array(import_mini55.z.string())),
|
|
16147
|
+
features: import_mini55.z.optional(import_mini55.z.array(import_mini55.z.string())),
|
|
16148
|
+
delete: import_mini55.z.optional(import_mini55.z.boolean()),
|
|
16149
|
+
global: import_mini55.z.optional(import_mini55.z.boolean()),
|
|
16150
|
+
simulateCommands: import_mini55.z.optional(import_mini55.z.boolean()),
|
|
16151
|
+
simulateSubagents: import_mini55.z.optional(import_mini55.z.boolean()),
|
|
16152
|
+
simulateSkills: import_mini55.z.optional(import_mini55.z.boolean()),
|
|
16153
|
+
modularMcp: import_mini55.z.optional(import_mini55.z.boolean())
|
|
15986
16154
|
});
|
|
15987
16155
|
async function executeGenerate(options = {}) {
|
|
15988
16156
|
try {
|
|
@@ -16062,7 +16230,7 @@ var generateTools = {
|
|
|
16062
16230
|
|
|
16063
16231
|
// src/mcp/ignore.ts
|
|
16064
16232
|
var import_node_path113 = require("path");
|
|
16065
|
-
var
|
|
16233
|
+
var import_mini56 = require("zod/mini");
|
|
16066
16234
|
var maxIgnoreFileSizeBytes = 100 * 1024;
|
|
16067
16235
|
async function getIgnoreFile() {
|
|
16068
16236
|
const ignoreFilePath = (0, import_node_path113.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
|
|
@@ -16119,11 +16287,11 @@ async function deleteIgnoreFile() {
|
|
|
16119
16287
|
}
|
|
16120
16288
|
}
|
|
16121
16289
|
var ignoreToolSchemas = {
|
|
16122
|
-
getIgnoreFile:
|
|
16123
|
-
putIgnoreFile:
|
|
16124
|
-
content:
|
|
16290
|
+
getIgnoreFile: import_mini56.z.object({}),
|
|
16291
|
+
putIgnoreFile: import_mini56.z.object({
|
|
16292
|
+
content: import_mini56.z.string()
|
|
16125
16293
|
}),
|
|
16126
|
-
deleteIgnoreFile:
|
|
16294
|
+
deleteIgnoreFile: import_mini56.z.object({})
|
|
16127
16295
|
};
|
|
16128
16296
|
var ignoreTools = {
|
|
16129
16297
|
getIgnoreFile: {
|
|
@@ -16156,11 +16324,11 @@ var ignoreTools = {
|
|
|
16156
16324
|
};
|
|
16157
16325
|
|
|
16158
16326
|
// src/mcp/import.ts
|
|
16159
|
-
var
|
|
16160
|
-
var importOptionsSchema =
|
|
16161
|
-
target:
|
|
16162
|
-
features:
|
|
16163
|
-
global:
|
|
16327
|
+
var import_mini57 = require("zod/mini");
|
|
16328
|
+
var importOptionsSchema = import_mini57.z.object({
|
|
16329
|
+
target: import_mini57.z.string(),
|
|
16330
|
+
features: import_mini57.z.optional(import_mini57.z.array(import_mini57.z.string())),
|
|
16331
|
+
global: import_mini57.z.optional(import_mini57.z.boolean())
|
|
16164
16332
|
});
|
|
16165
16333
|
async function executeImport(options) {
|
|
16166
16334
|
try {
|
|
@@ -16230,7 +16398,7 @@ var importTools = {
|
|
|
16230
16398
|
|
|
16231
16399
|
// src/mcp/mcp.ts
|
|
16232
16400
|
var import_node_path114 = require("path");
|
|
16233
|
-
var
|
|
16401
|
+
var import_mini58 = require("zod/mini");
|
|
16234
16402
|
var maxMcpSizeBytes = 1024 * 1024;
|
|
16235
16403
|
async function getMcpFile() {
|
|
16236
16404
|
const config = await ConfigResolver.resolve({});
|
|
@@ -16320,11 +16488,11 @@ async function deleteMcpFile() {
|
|
|
16320
16488
|
}
|
|
16321
16489
|
}
|
|
16322
16490
|
var mcpToolSchemas = {
|
|
16323
|
-
getMcpFile:
|
|
16324
|
-
putMcpFile:
|
|
16325
|
-
content:
|
|
16491
|
+
getMcpFile: import_mini58.z.object({}),
|
|
16492
|
+
putMcpFile: import_mini58.z.object({
|
|
16493
|
+
content: import_mini58.z.string()
|
|
16326
16494
|
}),
|
|
16327
|
-
deleteMcpFile:
|
|
16495
|
+
deleteMcpFile: import_mini58.z.object({})
|
|
16328
16496
|
};
|
|
16329
16497
|
var mcpTools = {
|
|
16330
16498
|
getMcpFile: {
|
|
@@ -16358,7 +16526,7 @@ var mcpTools = {
|
|
|
16358
16526
|
|
|
16359
16527
|
// src/mcp/rules.ts
|
|
16360
16528
|
var import_node_path115 = require("path");
|
|
16361
|
-
var
|
|
16529
|
+
var import_mini59 = require("zod/mini");
|
|
16362
16530
|
var maxRuleSizeBytes = 1024 * 1024;
|
|
16363
16531
|
var maxRulesCount = 1e3;
|
|
16364
16532
|
async function listRules() {
|
|
@@ -16477,17 +16645,17 @@ async function deleteRule({ relativePathFromCwd }) {
|
|
|
16477
16645
|
}
|
|
16478
16646
|
}
|
|
16479
16647
|
var ruleToolSchemas = {
|
|
16480
|
-
listRules:
|
|
16481
|
-
getRule:
|
|
16482
|
-
relativePathFromCwd:
|
|
16648
|
+
listRules: import_mini59.z.object({}),
|
|
16649
|
+
getRule: import_mini59.z.object({
|
|
16650
|
+
relativePathFromCwd: import_mini59.z.string()
|
|
16483
16651
|
}),
|
|
16484
|
-
putRule:
|
|
16485
|
-
relativePathFromCwd:
|
|
16652
|
+
putRule: import_mini59.z.object({
|
|
16653
|
+
relativePathFromCwd: import_mini59.z.string(),
|
|
16486
16654
|
frontmatter: RulesyncRuleFrontmatterSchema,
|
|
16487
|
-
body:
|
|
16655
|
+
body: import_mini59.z.string()
|
|
16488
16656
|
}),
|
|
16489
|
-
deleteRule:
|
|
16490
|
-
relativePathFromCwd:
|
|
16657
|
+
deleteRule: import_mini59.z.object({
|
|
16658
|
+
relativePathFromCwd: import_mini59.z.string()
|
|
16491
16659
|
})
|
|
16492
16660
|
};
|
|
16493
16661
|
var ruleTools = {
|
|
@@ -16536,7 +16704,7 @@ var ruleTools = {
|
|
|
16536
16704
|
|
|
16537
16705
|
// src/mcp/skills.ts
|
|
16538
16706
|
var import_node_path116 = require("path");
|
|
16539
|
-
var
|
|
16707
|
+
var import_mini60 = require("zod/mini");
|
|
16540
16708
|
var maxSkillSizeBytes = 1024 * 1024;
|
|
16541
16709
|
var maxSkillsCount = 1e3;
|
|
16542
16710
|
function aiDirFileToMcpSkillFile(file) {
|
|
@@ -16704,23 +16872,23 @@ async function deleteSkill({
|
|
|
16704
16872
|
);
|
|
16705
16873
|
}
|
|
16706
16874
|
}
|
|
16707
|
-
var McpSkillFileSchema =
|
|
16708
|
-
name:
|
|
16709
|
-
body:
|
|
16875
|
+
var McpSkillFileSchema = import_mini60.z.object({
|
|
16876
|
+
name: import_mini60.z.string(),
|
|
16877
|
+
body: import_mini60.z.string()
|
|
16710
16878
|
});
|
|
16711
16879
|
var skillToolSchemas = {
|
|
16712
|
-
listSkills:
|
|
16713
|
-
getSkill:
|
|
16714
|
-
relativeDirPathFromCwd:
|
|
16880
|
+
listSkills: import_mini60.z.object({}),
|
|
16881
|
+
getSkill: import_mini60.z.object({
|
|
16882
|
+
relativeDirPathFromCwd: import_mini60.z.string()
|
|
16715
16883
|
}),
|
|
16716
|
-
putSkill:
|
|
16717
|
-
relativeDirPathFromCwd:
|
|
16884
|
+
putSkill: import_mini60.z.object({
|
|
16885
|
+
relativeDirPathFromCwd: import_mini60.z.string(),
|
|
16718
16886
|
frontmatter: RulesyncSkillFrontmatterSchema,
|
|
16719
|
-
body:
|
|
16720
|
-
otherFiles:
|
|
16887
|
+
body: import_mini60.z.string(),
|
|
16888
|
+
otherFiles: import_mini60.z.optional(import_mini60.z.array(McpSkillFileSchema))
|
|
16721
16889
|
}),
|
|
16722
|
-
deleteSkill:
|
|
16723
|
-
relativeDirPathFromCwd:
|
|
16890
|
+
deleteSkill: import_mini60.z.object({
|
|
16891
|
+
relativeDirPathFromCwd: import_mini60.z.string()
|
|
16724
16892
|
})
|
|
16725
16893
|
};
|
|
16726
16894
|
var skillTools = {
|
|
@@ -16770,7 +16938,7 @@ var skillTools = {
|
|
|
16770
16938
|
|
|
16771
16939
|
// src/mcp/subagents.ts
|
|
16772
16940
|
var import_node_path117 = require("path");
|
|
16773
|
-
var
|
|
16941
|
+
var import_mini61 = require("zod/mini");
|
|
16774
16942
|
var maxSubagentSizeBytes = 1024 * 1024;
|
|
16775
16943
|
var maxSubagentsCount = 1e3;
|
|
16776
16944
|
async function listSubagents() {
|
|
@@ -16894,17 +17062,17 @@ async function deleteSubagent({ relativePathFromCwd }) {
|
|
|
16894
17062
|
}
|
|
16895
17063
|
}
|
|
16896
17064
|
var subagentToolSchemas = {
|
|
16897
|
-
listSubagents:
|
|
16898
|
-
getSubagent:
|
|
16899
|
-
relativePathFromCwd:
|
|
17065
|
+
listSubagents: import_mini61.z.object({}),
|
|
17066
|
+
getSubagent: import_mini61.z.object({
|
|
17067
|
+
relativePathFromCwd: import_mini61.z.string()
|
|
16900
17068
|
}),
|
|
16901
|
-
putSubagent:
|
|
16902
|
-
relativePathFromCwd:
|
|
17069
|
+
putSubagent: import_mini61.z.object({
|
|
17070
|
+
relativePathFromCwd: import_mini61.z.string(),
|
|
16903
17071
|
frontmatter: RulesyncSubagentFrontmatterSchema,
|
|
16904
|
-
body:
|
|
17072
|
+
body: import_mini61.z.string()
|
|
16905
17073
|
}),
|
|
16906
|
-
deleteSubagent:
|
|
16907
|
-
relativePathFromCwd:
|
|
17074
|
+
deleteSubagent: import_mini61.z.object({
|
|
17075
|
+
relativePathFromCwd: import_mini61.z.string()
|
|
16908
17076
|
})
|
|
16909
17077
|
};
|
|
16910
17078
|
var subagentTools = {
|
|
@@ -16952,7 +17120,7 @@ var subagentTools = {
|
|
|
16952
17120
|
};
|
|
16953
17121
|
|
|
16954
17122
|
// src/mcp/tools.ts
|
|
16955
|
-
var rulesyncFeatureSchema =
|
|
17123
|
+
var rulesyncFeatureSchema = import_mini62.z.enum([
|
|
16956
17124
|
"rule",
|
|
16957
17125
|
"command",
|
|
16958
17126
|
"subagent",
|
|
@@ -16962,21 +17130,21 @@ var rulesyncFeatureSchema = import_mini61.z.enum([
|
|
|
16962
17130
|
"generate",
|
|
16963
17131
|
"import"
|
|
16964
17132
|
]);
|
|
16965
|
-
var rulesyncOperationSchema =
|
|
16966
|
-
var skillFileSchema =
|
|
16967
|
-
name:
|
|
16968
|
-
body:
|
|
17133
|
+
var rulesyncOperationSchema = import_mini62.z.enum(["list", "get", "put", "delete", "run"]);
|
|
17134
|
+
var skillFileSchema = import_mini62.z.object({
|
|
17135
|
+
name: import_mini62.z.string(),
|
|
17136
|
+
body: import_mini62.z.string()
|
|
16969
17137
|
});
|
|
16970
|
-
var rulesyncToolSchema =
|
|
17138
|
+
var rulesyncToolSchema = import_mini62.z.object({
|
|
16971
17139
|
feature: rulesyncFeatureSchema,
|
|
16972
17140
|
operation: rulesyncOperationSchema,
|
|
16973
|
-
targetPathFromCwd:
|
|
16974
|
-
frontmatter:
|
|
16975
|
-
body:
|
|
16976
|
-
otherFiles:
|
|
16977
|
-
content:
|
|
16978
|
-
generateOptions:
|
|
16979
|
-
importOptions:
|
|
17141
|
+
targetPathFromCwd: import_mini62.z.optional(import_mini62.z.string()),
|
|
17142
|
+
frontmatter: import_mini62.z.optional(import_mini62.z.unknown()),
|
|
17143
|
+
body: import_mini62.z.optional(import_mini62.z.string()),
|
|
17144
|
+
otherFiles: import_mini62.z.optional(import_mini62.z.array(skillFileSchema)),
|
|
17145
|
+
content: import_mini62.z.optional(import_mini62.z.string()),
|
|
17146
|
+
generateOptions: import_mini62.z.optional(generateOptionsSchema),
|
|
17147
|
+
importOptions: import_mini62.z.optional(importOptionsSchema)
|
|
16980
17148
|
});
|
|
16981
17149
|
var supportedOperationsByFeature = {
|
|
16982
17150
|
rule: ["list", "get", "put", "delete"],
|
|
@@ -17535,7 +17703,7 @@ async function updateCommand(currentVersion, options) {
|
|
|
17535
17703
|
}
|
|
17536
17704
|
|
|
17537
17705
|
// src/cli/index.ts
|
|
17538
|
-
var getVersion = () => "6.
|
|
17706
|
+
var getVersion = () => "6.8.1";
|
|
17539
17707
|
var main = async () => {
|
|
17540
17708
|
const program = new import_commander.Command();
|
|
17541
17709
|
const version = getVersion();
|