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.js
CHANGED
|
@@ -20,7 +20,10 @@ var ALL_FEATURES = [
|
|
|
20
20
|
var ALL_FEATURES_WITH_WILDCARD = [...ALL_FEATURES, "*"];
|
|
21
21
|
var FeatureSchema = z.enum(ALL_FEATURES);
|
|
22
22
|
var FeaturesSchema = z.array(FeatureSchema);
|
|
23
|
-
var RulesyncFeaturesSchema = z.
|
|
23
|
+
var RulesyncFeaturesSchema = z.union([
|
|
24
|
+
z.array(z.enum(ALL_FEATURES_WITH_WILDCARD)),
|
|
25
|
+
z.record(z.string(), z.array(z.enum(ALL_FEATURES_WITH_WILDCARD)))
|
|
26
|
+
]);
|
|
24
27
|
|
|
25
28
|
// src/utils/error.ts
|
|
26
29
|
import { ZodError } from "zod";
|
|
@@ -5429,7 +5432,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
5429
5432
|
static getSettablePaths({ global } = {}) {
|
|
5430
5433
|
if (global) {
|
|
5431
5434
|
return {
|
|
5432
|
-
relativeDirPath: ".",
|
|
5435
|
+
relativeDirPath: join47(".config", "opencode"),
|
|
5433
5436
|
relativeFilePath: "opencode.json"
|
|
5434
5437
|
};
|
|
5435
5438
|
}
|
|
@@ -5889,7 +5892,7 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
5889
5892
|
// src/features/rules/rules-processor.ts
|
|
5890
5893
|
import { encode } from "@toon-format/toon";
|
|
5891
5894
|
import { basename as basename23, join as join105, relative as relative4 } from "path";
|
|
5892
|
-
import { z as
|
|
5895
|
+
import { z as z49 } from "zod/mini";
|
|
5893
5896
|
|
|
5894
5897
|
// src/constants/general.ts
|
|
5895
5898
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
@@ -6350,46 +6353,12 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
|
6350
6353
|
}
|
|
6351
6354
|
};
|
|
6352
6355
|
|
|
6353
|
-
// src/features/skills/geminicli-skill.ts
|
|
6354
|
-
import { join as join54 } from "path";
|
|
6355
|
-
var GeminiCliSkill = class _GeminiCliSkill extends SimulatedSkill {
|
|
6356
|
-
static getSettablePaths(options) {
|
|
6357
|
-
if (options?.global) {
|
|
6358
|
-
throw new Error("GeminiCliSkill does not support global mode.");
|
|
6359
|
-
}
|
|
6360
|
-
return {
|
|
6361
|
-
relativeDirPath: join54(".gemini", "skills")
|
|
6362
|
-
};
|
|
6363
|
-
}
|
|
6364
|
-
static async fromDir(params) {
|
|
6365
|
-
const baseParams = await this.fromDirDefault(params);
|
|
6366
|
-
return new _GeminiCliSkill(baseParams);
|
|
6367
|
-
}
|
|
6368
|
-
static fromRulesyncSkill(params) {
|
|
6369
|
-
const baseParams = {
|
|
6370
|
-
...this.fromRulesyncSkillDefault(params),
|
|
6371
|
-
relativeDirPath: this.getSettablePaths().relativeDirPath
|
|
6372
|
-
};
|
|
6373
|
-
return new _GeminiCliSkill(baseParams);
|
|
6374
|
-
}
|
|
6375
|
-
static isTargetedByRulesyncSkill(rulesyncSkill) {
|
|
6376
|
-
return this.isTargetedByRulesyncSkillDefault({
|
|
6377
|
-
rulesyncSkill,
|
|
6378
|
-
toolTarget: "geminicli"
|
|
6379
|
-
});
|
|
6380
|
-
}
|
|
6381
|
-
static forDeletion(params) {
|
|
6382
|
-
const baseParams = this.forDeletionDefault(params);
|
|
6383
|
-
return new _GeminiCliSkill(baseParams);
|
|
6384
|
-
}
|
|
6385
|
-
};
|
|
6386
|
-
|
|
6387
6356
|
// src/features/skills/skills-processor.ts
|
|
6388
6357
|
import { basename as basename18, join as join68 } from "path";
|
|
6389
|
-
import { z as
|
|
6358
|
+
import { z as z34 } from "zod/mini";
|
|
6390
6359
|
|
|
6391
6360
|
// src/types/dir-feature-processor.ts
|
|
6392
|
-
import { join as
|
|
6361
|
+
import { join as join54 } from "path";
|
|
6393
6362
|
var DirFeatureProcessor = class {
|
|
6394
6363
|
baseDir;
|
|
6395
6364
|
dryRun;
|
|
@@ -6406,6 +6375,10 @@ var DirFeatureProcessor = class {
|
|
|
6406
6375
|
/**
|
|
6407
6376
|
* Once converted to rulesync/tool dirs, write them to the filesystem.
|
|
6408
6377
|
* Returns the number of directories written.
|
|
6378
|
+
*
|
|
6379
|
+
* Note: This method uses directory-level change detection. If any file within
|
|
6380
|
+
* a directory has changed, ALL files in that directory are rewritten. This is
|
|
6381
|
+
* an intentional design decision to ensure consistency within directory units.
|
|
6409
6382
|
*/
|
|
6410
6383
|
async writeAiDirs(aiDirs) {
|
|
6411
6384
|
let changedCount = 0;
|
|
@@ -6415,7 +6388,7 @@ var DirFeatureProcessor = class {
|
|
|
6415
6388
|
const mainFile = aiDir.getMainFile();
|
|
6416
6389
|
let mainFileContent;
|
|
6417
6390
|
if (mainFile) {
|
|
6418
|
-
const mainFilePath =
|
|
6391
|
+
const mainFilePath = join54(dirPath, mainFile.name);
|
|
6419
6392
|
const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter);
|
|
6420
6393
|
mainFileContent = addTrailingNewline(content);
|
|
6421
6394
|
const existingContent = await readFileContentOrNull(mainFilePath);
|
|
@@ -6429,7 +6402,7 @@ var DirFeatureProcessor = class {
|
|
|
6429
6402
|
const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
|
|
6430
6403
|
otherFileContents.push(contentWithNewline);
|
|
6431
6404
|
if (!dirHasChanges) {
|
|
6432
|
-
const filePath =
|
|
6405
|
+
const filePath = join54(dirPath, file.relativeFilePathToDirPath);
|
|
6433
6406
|
const existingContent = await readFileContentOrNull(filePath);
|
|
6434
6407
|
if (existingContent !== contentWithNewline) {
|
|
6435
6408
|
dirHasChanges = true;
|
|
@@ -6442,20 +6415,25 @@ var DirFeatureProcessor = class {
|
|
|
6442
6415
|
if (this.dryRun) {
|
|
6443
6416
|
logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
|
|
6444
6417
|
if (mainFile) {
|
|
6445
|
-
logger.info(`[DRY RUN] Would write: ${
|
|
6418
|
+
logger.info(`[DRY RUN] Would write: ${join54(dirPath, mainFile.name)}`);
|
|
6446
6419
|
}
|
|
6447
6420
|
for (const file of otherFiles) {
|
|
6448
|
-
logger.info(`[DRY RUN] Would write: ${
|
|
6421
|
+
logger.info(`[DRY RUN] Would write: ${join54(dirPath, file.relativeFilePathToDirPath)}`);
|
|
6449
6422
|
}
|
|
6450
6423
|
} else {
|
|
6451
6424
|
await ensureDir(dirPath);
|
|
6452
6425
|
if (mainFile && mainFileContent) {
|
|
6453
|
-
const mainFilePath =
|
|
6426
|
+
const mainFilePath = join54(dirPath, mainFile.name);
|
|
6454
6427
|
await writeFileContent(mainFilePath, mainFileContent);
|
|
6455
6428
|
}
|
|
6456
6429
|
for (const [i, file] of otherFiles.entries()) {
|
|
6457
|
-
const filePath =
|
|
6458
|
-
const content = otherFileContents[i]
|
|
6430
|
+
const filePath = join54(dirPath, file.relativeFilePathToDirPath);
|
|
6431
|
+
const content = otherFileContents[i];
|
|
6432
|
+
if (content === void 0) {
|
|
6433
|
+
throw new Error(
|
|
6434
|
+
`Internal error: content for file ${file.relativeFilePathToDirPath} is undefined. This indicates a synchronization issue between otherFiles and otherFileContents arrays.`
|
|
6435
|
+
);
|
|
6436
|
+
}
|
|
6459
6437
|
await writeFileContent(filePath, content);
|
|
6460
6438
|
}
|
|
6461
6439
|
}
|
|
@@ -6488,11 +6466,11 @@ var DirFeatureProcessor = class {
|
|
|
6488
6466
|
};
|
|
6489
6467
|
|
|
6490
6468
|
// src/features/skills/agentsskills-skill.ts
|
|
6491
|
-
import { join as
|
|
6469
|
+
import { join as join56 } from "path";
|
|
6492
6470
|
import { z as z22 } from "zod/mini";
|
|
6493
6471
|
|
|
6494
6472
|
// src/features/skills/rulesync-skill.ts
|
|
6495
|
-
import { join as
|
|
6473
|
+
import { join as join55 } from "path";
|
|
6496
6474
|
import { z as z21 } from "zod/mini";
|
|
6497
6475
|
var RulesyncSkillFrontmatterSchemaInternal = z21.looseObject({
|
|
6498
6476
|
name: z21.string(),
|
|
@@ -6584,8 +6562,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
6584
6562
|
dirName,
|
|
6585
6563
|
global = false
|
|
6586
6564
|
}) {
|
|
6587
|
-
const skillDirPath =
|
|
6588
|
-
const skillFilePath =
|
|
6565
|
+
const skillDirPath = join55(baseDir, relativeDirPath, dirName);
|
|
6566
|
+
const skillFilePath = join55(skillDirPath, SKILL_FILE_NAME);
|
|
6589
6567
|
if (!await fileExists(skillFilePath)) {
|
|
6590
6568
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
6591
6569
|
}
|
|
@@ -6622,7 +6600,7 @@ var AgentsSkillsSkillFrontmatterSchema = z22.looseObject({
|
|
|
6622
6600
|
var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
6623
6601
|
constructor({
|
|
6624
6602
|
baseDir = process.cwd(),
|
|
6625
|
-
relativeDirPath =
|
|
6603
|
+
relativeDirPath = join56(".agents", "skills"),
|
|
6626
6604
|
dirName,
|
|
6627
6605
|
frontmatter,
|
|
6628
6606
|
body,
|
|
@@ -6654,7 +6632,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
6654
6632
|
throw new Error("AgentsSkillsSkill does not support global mode.");
|
|
6655
6633
|
}
|
|
6656
6634
|
return {
|
|
6657
|
-
relativeDirPath:
|
|
6635
|
+
relativeDirPath: join56(".agents", "skills")
|
|
6658
6636
|
};
|
|
6659
6637
|
}
|
|
6660
6638
|
getFrontmatter() {
|
|
@@ -6736,9 +6714,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
6736
6714
|
});
|
|
6737
6715
|
const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
6738
6716
|
if (!result.success) {
|
|
6739
|
-
const skillDirPath =
|
|
6717
|
+
const skillDirPath = join56(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
6740
6718
|
throw new Error(
|
|
6741
|
-
`Invalid frontmatter in ${
|
|
6719
|
+
`Invalid frontmatter in ${join56(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
6742
6720
|
);
|
|
6743
6721
|
}
|
|
6744
6722
|
return new _AgentsSkillsSkill({
|
|
@@ -6773,7 +6751,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
6773
6751
|
};
|
|
6774
6752
|
|
|
6775
6753
|
// src/features/skills/antigravity-skill.ts
|
|
6776
|
-
import { join as
|
|
6754
|
+
import { join as join57 } from "path";
|
|
6777
6755
|
import { z as z23 } from "zod/mini";
|
|
6778
6756
|
var AntigravitySkillFrontmatterSchema = z23.looseObject({
|
|
6779
6757
|
name: z23.string(),
|
|
@@ -6782,7 +6760,7 @@ var AntigravitySkillFrontmatterSchema = z23.looseObject({
|
|
|
6782
6760
|
var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
6783
6761
|
constructor({
|
|
6784
6762
|
baseDir = process.cwd(),
|
|
6785
|
-
relativeDirPath =
|
|
6763
|
+
relativeDirPath = join57(".agent", "skills"),
|
|
6786
6764
|
dirName,
|
|
6787
6765
|
frontmatter,
|
|
6788
6766
|
body,
|
|
@@ -6814,11 +6792,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
6814
6792
|
} = {}) {
|
|
6815
6793
|
if (global) {
|
|
6816
6794
|
return {
|
|
6817
|
-
relativeDirPath:
|
|
6795
|
+
relativeDirPath: join57(".gemini", "antigravity", "skills")
|
|
6818
6796
|
};
|
|
6819
6797
|
}
|
|
6820
6798
|
return {
|
|
6821
|
-
relativeDirPath:
|
|
6799
|
+
relativeDirPath: join57(".agent", "skills")
|
|
6822
6800
|
};
|
|
6823
6801
|
}
|
|
6824
6802
|
getFrontmatter() {
|
|
@@ -6900,9 +6878,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
6900
6878
|
});
|
|
6901
6879
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
6902
6880
|
if (!result.success) {
|
|
6903
|
-
const skillDirPath =
|
|
6881
|
+
const skillDirPath = join57(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
6904
6882
|
throw new Error(
|
|
6905
|
-
`Invalid frontmatter in ${
|
|
6883
|
+
`Invalid frontmatter in ${join57(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
6906
6884
|
);
|
|
6907
6885
|
}
|
|
6908
6886
|
return new _AntigravitySkill({
|
|
@@ -6936,7 +6914,7 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
6936
6914
|
};
|
|
6937
6915
|
|
|
6938
6916
|
// src/features/skills/claudecode-skill.ts
|
|
6939
|
-
import { join as
|
|
6917
|
+
import { join as join58 } from "path";
|
|
6940
6918
|
import { z as z24 } from "zod/mini";
|
|
6941
6919
|
var ClaudecodeSkillFrontmatterSchema = z24.looseObject({
|
|
6942
6920
|
name: z24.string(),
|
|
@@ -6946,7 +6924,7 @@ var ClaudecodeSkillFrontmatterSchema = z24.looseObject({
|
|
|
6946
6924
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
6947
6925
|
constructor({
|
|
6948
6926
|
baseDir = process.cwd(),
|
|
6949
|
-
relativeDirPath =
|
|
6927
|
+
relativeDirPath = join58(".claude", "skills"),
|
|
6950
6928
|
dirName,
|
|
6951
6929
|
frontmatter,
|
|
6952
6930
|
body,
|
|
@@ -6977,7 +6955,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
6977
6955
|
global: _global = false
|
|
6978
6956
|
} = {}) {
|
|
6979
6957
|
return {
|
|
6980
|
-
relativeDirPath:
|
|
6958
|
+
relativeDirPath: join58(".claude", "skills")
|
|
6981
6959
|
};
|
|
6982
6960
|
}
|
|
6983
6961
|
getFrontmatter() {
|
|
@@ -7065,9 +7043,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
7065
7043
|
});
|
|
7066
7044
|
const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
7067
7045
|
if (!result.success) {
|
|
7068
|
-
const skillDirPath =
|
|
7046
|
+
const skillDirPath = join58(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
7069
7047
|
throw new Error(
|
|
7070
|
-
`Invalid frontmatter in ${
|
|
7048
|
+
`Invalid frontmatter in ${join58(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
7071
7049
|
);
|
|
7072
7050
|
}
|
|
7073
7051
|
return new _ClaudecodeSkill({
|
|
@@ -7101,7 +7079,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
7101
7079
|
};
|
|
7102
7080
|
|
|
7103
7081
|
// src/features/skills/codexcli-skill.ts
|
|
7104
|
-
import { join as
|
|
7082
|
+
import { join as join59 } from "path";
|
|
7105
7083
|
import { z as z25 } from "zod/mini";
|
|
7106
7084
|
var CodexCliSkillFrontmatterSchema = z25.looseObject({
|
|
7107
7085
|
name: z25.string(),
|
|
@@ -7115,7 +7093,7 @@ var CodexCliSkillFrontmatterSchema = z25.looseObject({
|
|
|
7115
7093
|
var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
7116
7094
|
constructor({
|
|
7117
7095
|
baseDir = process.cwd(),
|
|
7118
|
-
relativeDirPath =
|
|
7096
|
+
relativeDirPath = join59(".codex", "skills"),
|
|
7119
7097
|
dirName,
|
|
7120
7098
|
frontmatter,
|
|
7121
7099
|
body,
|
|
@@ -7146,7 +7124,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
7146
7124
|
global: _global = false
|
|
7147
7125
|
} = {}) {
|
|
7148
7126
|
return {
|
|
7149
|
-
relativeDirPath:
|
|
7127
|
+
relativeDirPath: join59(".codex", "skills")
|
|
7150
7128
|
};
|
|
7151
7129
|
}
|
|
7152
7130
|
getFrontmatter() {
|
|
@@ -7238,9 +7216,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
7238
7216
|
});
|
|
7239
7217
|
const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
7240
7218
|
if (!result.success) {
|
|
7241
|
-
const skillDirPath =
|
|
7219
|
+
const skillDirPath = join59(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
7242
7220
|
throw new Error(
|
|
7243
|
-
`Invalid frontmatter in ${
|
|
7221
|
+
`Invalid frontmatter in ${join59(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
7244
7222
|
);
|
|
7245
7223
|
}
|
|
7246
7224
|
return new _CodexCliSkill({
|
|
@@ -7274,7 +7252,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
7274
7252
|
};
|
|
7275
7253
|
|
|
7276
7254
|
// src/features/skills/copilot-skill.ts
|
|
7277
|
-
import { join as
|
|
7255
|
+
import { join as join60 } from "path";
|
|
7278
7256
|
import { z as z26 } from "zod/mini";
|
|
7279
7257
|
var CopilotSkillFrontmatterSchema = z26.looseObject({
|
|
7280
7258
|
name: z26.string(),
|
|
@@ -7284,7 +7262,7 @@ var CopilotSkillFrontmatterSchema = z26.looseObject({
|
|
|
7284
7262
|
var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
7285
7263
|
constructor({
|
|
7286
7264
|
baseDir = process.cwd(),
|
|
7287
|
-
relativeDirPath =
|
|
7265
|
+
relativeDirPath = join60(".github", "skills"),
|
|
7288
7266
|
dirName,
|
|
7289
7267
|
frontmatter,
|
|
7290
7268
|
body,
|
|
@@ -7316,7 +7294,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
7316
7294
|
throw new Error("CopilotSkill does not support global mode.");
|
|
7317
7295
|
}
|
|
7318
7296
|
return {
|
|
7319
|
-
relativeDirPath:
|
|
7297
|
+
relativeDirPath: join60(".github", "skills")
|
|
7320
7298
|
};
|
|
7321
7299
|
}
|
|
7322
7300
|
getFrontmatter() {
|
|
@@ -7404,9 +7382,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
7404
7382
|
});
|
|
7405
7383
|
const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
7406
7384
|
if (!result.success) {
|
|
7407
|
-
const skillDirPath =
|
|
7385
|
+
const skillDirPath = join60(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
7408
7386
|
throw new Error(
|
|
7409
|
-
`Invalid frontmatter in ${
|
|
7387
|
+
`Invalid frontmatter in ${join60(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
7410
7388
|
);
|
|
7411
7389
|
}
|
|
7412
7390
|
return new _CopilotSkill({
|
|
@@ -7441,7 +7419,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
7441
7419
|
};
|
|
7442
7420
|
|
|
7443
7421
|
// src/features/skills/cursor-skill.ts
|
|
7444
|
-
import { join as
|
|
7422
|
+
import { join as join61 } from "path";
|
|
7445
7423
|
import { z as z27 } from "zod/mini";
|
|
7446
7424
|
var CursorSkillFrontmatterSchema = z27.looseObject({
|
|
7447
7425
|
name: z27.string(),
|
|
@@ -7450,7 +7428,7 @@ var CursorSkillFrontmatterSchema = z27.looseObject({
|
|
|
7450
7428
|
var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
7451
7429
|
constructor({
|
|
7452
7430
|
baseDir = process.cwd(),
|
|
7453
|
-
relativeDirPath =
|
|
7431
|
+
relativeDirPath = join61(".cursor", "skills"),
|
|
7454
7432
|
dirName,
|
|
7455
7433
|
frontmatter,
|
|
7456
7434
|
body,
|
|
@@ -7479,7 +7457,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
7479
7457
|
}
|
|
7480
7458
|
static getSettablePaths(_options) {
|
|
7481
7459
|
return {
|
|
7482
|
-
relativeDirPath:
|
|
7460
|
+
relativeDirPath: join61(".cursor", "skills")
|
|
7483
7461
|
};
|
|
7484
7462
|
}
|
|
7485
7463
|
getFrontmatter() {
|
|
@@ -7561,9 +7539,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
7561
7539
|
});
|
|
7562
7540
|
const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
7563
7541
|
if (!result.success) {
|
|
7564
|
-
const skillDirPath =
|
|
7542
|
+
const skillDirPath = join61(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
7565
7543
|
throw new Error(
|
|
7566
|
-
`Invalid frontmatter in ${
|
|
7544
|
+
`Invalid frontmatter in ${join61(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
7567
7545
|
);
|
|
7568
7546
|
}
|
|
7569
7547
|
return new _CursorSkill({
|
|
@@ -7597,13 +7575,172 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
7597
7575
|
}
|
|
7598
7576
|
};
|
|
7599
7577
|
|
|
7600
|
-
// src/features/skills/
|
|
7601
|
-
import { join as
|
|
7578
|
+
// src/features/skills/geminicli-skill.ts
|
|
7579
|
+
import { join as join62 } from "path";
|
|
7602
7580
|
import { z as z28 } from "zod/mini";
|
|
7603
|
-
var
|
|
7581
|
+
var GeminiCliSkillFrontmatterSchema = z28.looseObject({
|
|
7604
7582
|
name: z28.string(),
|
|
7605
7583
|
description: z28.string()
|
|
7606
7584
|
});
|
|
7585
|
+
var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
7586
|
+
constructor({
|
|
7587
|
+
baseDir = process.cwd(),
|
|
7588
|
+
relativeDirPath = _GeminiCliSkill.getSettablePaths().relativeDirPath,
|
|
7589
|
+
dirName,
|
|
7590
|
+
frontmatter,
|
|
7591
|
+
body,
|
|
7592
|
+
otherFiles = [],
|
|
7593
|
+
validate = true,
|
|
7594
|
+
global = false
|
|
7595
|
+
}) {
|
|
7596
|
+
super({
|
|
7597
|
+
baseDir,
|
|
7598
|
+
relativeDirPath,
|
|
7599
|
+
dirName,
|
|
7600
|
+
mainFile: {
|
|
7601
|
+
name: SKILL_FILE_NAME,
|
|
7602
|
+
body,
|
|
7603
|
+
frontmatter: { ...frontmatter }
|
|
7604
|
+
},
|
|
7605
|
+
otherFiles,
|
|
7606
|
+
global
|
|
7607
|
+
});
|
|
7608
|
+
if (validate) {
|
|
7609
|
+
const result = this.validate();
|
|
7610
|
+
if (!result.success) {
|
|
7611
|
+
throw result.error;
|
|
7612
|
+
}
|
|
7613
|
+
}
|
|
7614
|
+
}
|
|
7615
|
+
static getSettablePaths({
|
|
7616
|
+
global: _global = false
|
|
7617
|
+
} = {}) {
|
|
7618
|
+
return {
|
|
7619
|
+
relativeDirPath: join62(".gemini", "skills")
|
|
7620
|
+
};
|
|
7621
|
+
}
|
|
7622
|
+
getFrontmatter() {
|
|
7623
|
+
if (!this.mainFile?.frontmatter) {
|
|
7624
|
+
throw new Error("Frontmatter is not defined");
|
|
7625
|
+
}
|
|
7626
|
+
const result = GeminiCliSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
|
|
7627
|
+
return result;
|
|
7628
|
+
}
|
|
7629
|
+
getBody() {
|
|
7630
|
+
return this.mainFile?.body ?? "";
|
|
7631
|
+
}
|
|
7632
|
+
validate() {
|
|
7633
|
+
if (this.mainFile === void 0) {
|
|
7634
|
+
return {
|
|
7635
|
+
success: false,
|
|
7636
|
+
error: new Error(`${this.getDirPath()}: ${SKILL_FILE_NAME} file does not exist`)
|
|
7637
|
+
};
|
|
7638
|
+
}
|
|
7639
|
+
const result = GeminiCliSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
|
|
7640
|
+
if (!result.success) {
|
|
7641
|
+
return {
|
|
7642
|
+
success: false,
|
|
7643
|
+
error: new Error(
|
|
7644
|
+
`Invalid frontmatter in ${this.getDirPath()}: ${formatError(result.error)}`
|
|
7645
|
+
)
|
|
7646
|
+
};
|
|
7647
|
+
}
|
|
7648
|
+
return { success: true, error: null };
|
|
7649
|
+
}
|
|
7650
|
+
toRulesyncSkill() {
|
|
7651
|
+
const frontmatter = this.getFrontmatter();
|
|
7652
|
+
const rulesyncFrontmatter = {
|
|
7653
|
+
name: frontmatter.name,
|
|
7654
|
+
description: frontmatter.description,
|
|
7655
|
+
targets: ["*"]
|
|
7656
|
+
};
|
|
7657
|
+
return new RulesyncSkill({
|
|
7658
|
+
baseDir: this.baseDir,
|
|
7659
|
+
relativeDirPath: RULESYNC_SKILLS_RELATIVE_DIR_PATH,
|
|
7660
|
+
dirName: this.getDirName(),
|
|
7661
|
+
frontmatter: rulesyncFrontmatter,
|
|
7662
|
+
body: this.getBody(),
|
|
7663
|
+
otherFiles: this.getOtherFiles(),
|
|
7664
|
+
validate: true,
|
|
7665
|
+
global: this.global
|
|
7666
|
+
});
|
|
7667
|
+
}
|
|
7668
|
+
static fromRulesyncSkill({
|
|
7669
|
+
rulesyncSkill,
|
|
7670
|
+
validate = true,
|
|
7671
|
+
global = false
|
|
7672
|
+
}) {
|
|
7673
|
+
const settablePaths = _GeminiCliSkill.getSettablePaths({ global });
|
|
7674
|
+
const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
|
|
7675
|
+
const geminiCliFrontmatter = {
|
|
7676
|
+
name: rulesyncFrontmatter.name,
|
|
7677
|
+
description: rulesyncFrontmatter.description
|
|
7678
|
+
};
|
|
7679
|
+
return new _GeminiCliSkill({
|
|
7680
|
+
baseDir: rulesyncSkill.getBaseDir(),
|
|
7681
|
+
relativeDirPath: settablePaths.relativeDirPath,
|
|
7682
|
+
dirName: rulesyncSkill.getDirName(),
|
|
7683
|
+
frontmatter: geminiCliFrontmatter,
|
|
7684
|
+
body: rulesyncSkill.getBody(),
|
|
7685
|
+
otherFiles: rulesyncSkill.getOtherFiles(),
|
|
7686
|
+
validate,
|
|
7687
|
+
global
|
|
7688
|
+
});
|
|
7689
|
+
}
|
|
7690
|
+
static isTargetedByRulesyncSkill(rulesyncSkill) {
|
|
7691
|
+
const targets = rulesyncSkill.getFrontmatter().targets;
|
|
7692
|
+
return targets.includes("*") || targets.includes("geminicli");
|
|
7693
|
+
}
|
|
7694
|
+
static async fromDir(params) {
|
|
7695
|
+
const loaded = await this.loadSkillDirContent({
|
|
7696
|
+
...params,
|
|
7697
|
+
getSettablePaths: _GeminiCliSkill.getSettablePaths
|
|
7698
|
+
});
|
|
7699
|
+
const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
7700
|
+
if (!result.success) {
|
|
7701
|
+
const skillDirPath = join62(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
7702
|
+
throw new Error(
|
|
7703
|
+
`Invalid frontmatter in ${join62(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
7704
|
+
);
|
|
7705
|
+
}
|
|
7706
|
+
return new _GeminiCliSkill({
|
|
7707
|
+
baseDir: loaded.baseDir,
|
|
7708
|
+
relativeDirPath: loaded.relativeDirPath,
|
|
7709
|
+
dirName: loaded.dirName,
|
|
7710
|
+
frontmatter: result.data,
|
|
7711
|
+
body: loaded.body,
|
|
7712
|
+
otherFiles: loaded.otherFiles,
|
|
7713
|
+
validate: true,
|
|
7714
|
+
global: loaded.global
|
|
7715
|
+
});
|
|
7716
|
+
}
|
|
7717
|
+
static forDeletion({
|
|
7718
|
+
baseDir = process.cwd(),
|
|
7719
|
+
relativeDirPath,
|
|
7720
|
+
dirName,
|
|
7721
|
+
global = false
|
|
7722
|
+
}) {
|
|
7723
|
+
const settablePaths = _GeminiCliSkill.getSettablePaths({ global });
|
|
7724
|
+
return new _GeminiCliSkill({
|
|
7725
|
+
baseDir,
|
|
7726
|
+
relativeDirPath: relativeDirPath ?? settablePaths.relativeDirPath,
|
|
7727
|
+
dirName,
|
|
7728
|
+
frontmatter: { name: "", description: "" },
|
|
7729
|
+
body: "",
|
|
7730
|
+
otherFiles: [],
|
|
7731
|
+
validate: false,
|
|
7732
|
+
global
|
|
7733
|
+
});
|
|
7734
|
+
}
|
|
7735
|
+
};
|
|
7736
|
+
|
|
7737
|
+
// src/features/skills/kilo-skill.ts
|
|
7738
|
+
import { join as join63 } from "path";
|
|
7739
|
+
import { z as z29 } from "zod/mini";
|
|
7740
|
+
var KiloSkillFrontmatterSchema = z29.looseObject({
|
|
7741
|
+
name: z29.string(),
|
|
7742
|
+
description: z29.string()
|
|
7743
|
+
});
|
|
7607
7744
|
var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
7608
7745
|
constructor({
|
|
7609
7746
|
baseDir = process.cwd(),
|
|
@@ -7776,10 +7913,10 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
7776
7913
|
|
|
7777
7914
|
// src/features/skills/kiro-skill.ts
|
|
7778
7915
|
import { join as join64 } from "path";
|
|
7779
|
-
import { z as
|
|
7780
|
-
var KiroSkillFrontmatterSchema =
|
|
7781
|
-
name:
|
|
7782
|
-
description:
|
|
7916
|
+
import { z as z30 } from "zod/mini";
|
|
7917
|
+
var KiroSkillFrontmatterSchema = z30.looseObject({
|
|
7918
|
+
name: z30.string(),
|
|
7919
|
+
description: z30.string()
|
|
7783
7920
|
});
|
|
7784
7921
|
var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
7785
7922
|
constructor({
|
|
@@ -7955,11 +8092,11 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
7955
8092
|
|
|
7956
8093
|
// src/features/skills/opencode-skill.ts
|
|
7957
8094
|
import { join as join65 } from "path";
|
|
7958
|
-
import { z as
|
|
7959
|
-
var OpenCodeSkillFrontmatterSchema =
|
|
7960
|
-
name:
|
|
7961
|
-
description:
|
|
7962
|
-
"allowed-tools":
|
|
8095
|
+
import { z as z31 } from "zod/mini";
|
|
8096
|
+
var OpenCodeSkillFrontmatterSchema = z31.looseObject({
|
|
8097
|
+
name: z31.string(),
|
|
8098
|
+
description: z31.string(),
|
|
8099
|
+
"allowed-tools": z31.optional(z31.array(z31.string()))
|
|
7963
8100
|
});
|
|
7964
8101
|
var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
7965
8102
|
constructor({
|
|
@@ -8118,10 +8255,10 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
8118
8255
|
|
|
8119
8256
|
// src/features/skills/replit-skill.ts
|
|
8120
8257
|
import { join as join66 } from "path";
|
|
8121
|
-
import { z as
|
|
8122
|
-
var ReplitSkillFrontmatterSchema =
|
|
8123
|
-
name:
|
|
8124
|
-
description:
|
|
8258
|
+
import { z as z32 } from "zod/mini";
|
|
8259
|
+
var ReplitSkillFrontmatterSchema = z32.looseObject({
|
|
8260
|
+
name: z32.string(),
|
|
8261
|
+
description: z32.string()
|
|
8125
8262
|
});
|
|
8126
8263
|
var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
8127
8264
|
constructor({
|
|
@@ -8278,10 +8415,10 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
8278
8415
|
|
|
8279
8416
|
// src/features/skills/roo-skill.ts
|
|
8280
8417
|
import { join as join67 } from "path";
|
|
8281
|
-
import { z as
|
|
8282
|
-
var RooSkillFrontmatterSchema =
|
|
8283
|
-
name:
|
|
8284
|
-
description:
|
|
8418
|
+
import { z as z33 } from "zod/mini";
|
|
8419
|
+
var RooSkillFrontmatterSchema = z33.looseObject({
|
|
8420
|
+
name: z33.string(),
|
|
8421
|
+
description: z33.string()
|
|
8285
8422
|
});
|
|
8286
8423
|
var RooSkill = class _RooSkill extends ToolSkill {
|
|
8287
8424
|
constructor({
|
|
@@ -8471,7 +8608,7 @@ var skillsProcessorToolTargetTuple = [
|
|
|
8471
8608
|
"replit",
|
|
8472
8609
|
"roo"
|
|
8473
8610
|
];
|
|
8474
|
-
var SkillsProcessorToolTargetSchema =
|
|
8611
|
+
var SkillsProcessorToolTargetSchema = z34.enum(skillsProcessorToolTargetTuple);
|
|
8475
8612
|
var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
8476
8613
|
[
|
|
8477
8614
|
"agentsmd",
|
|
@@ -8540,7 +8677,7 @@ var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
|
8540
8677
|
"geminicli",
|
|
8541
8678
|
{
|
|
8542
8679
|
class: GeminiCliSkill,
|
|
8543
|
-
meta: { supportsProject: true, supportsSimulated:
|
|
8680
|
+
meta: { supportsProject: true, supportsSimulated: false, supportsGlobal: true }
|
|
8544
8681
|
}
|
|
8545
8682
|
],
|
|
8546
8683
|
[
|
|
@@ -8760,7 +8897,7 @@ import { join as join70 } from "path";
|
|
|
8760
8897
|
|
|
8761
8898
|
// src/features/subagents/simulated-subagent.ts
|
|
8762
8899
|
import { basename as basename19, join as join69 } from "path";
|
|
8763
|
-
import { z as
|
|
8900
|
+
import { z as z35 } from "zod/mini";
|
|
8764
8901
|
|
|
8765
8902
|
// src/features/subagents/tool-subagent.ts
|
|
8766
8903
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -8803,9 +8940,9 @@ var ToolSubagent = class extends ToolFile {
|
|
|
8803
8940
|
};
|
|
8804
8941
|
|
|
8805
8942
|
// src/features/subagents/simulated-subagent.ts
|
|
8806
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
8807
|
-
name:
|
|
8808
|
-
description:
|
|
8943
|
+
var SimulatedSubagentFrontmatterSchema = z35.object({
|
|
8944
|
+
name: z35.string(),
|
|
8945
|
+
description: z35.string()
|
|
8809
8946
|
});
|
|
8810
8947
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
8811
8948
|
frontmatter;
|
|
@@ -9044,19 +9181,19 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
9044
9181
|
|
|
9045
9182
|
// src/features/subagents/subagents-processor.ts
|
|
9046
9183
|
import { basename as basename22, join as join81 } from "path";
|
|
9047
|
-
import { z as
|
|
9184
|
+
import { z as z42 } from "zod/mini";
|
|
9048
9185
|
|
|
9049
9186
|
// src/features/subagents/claudecode-subagent.ts
|
|
9050
9187
|
import { join as join76 } from "path";
|
|
9051
|
-
import { z as
|
|
9188
|
+
import { z as z37 } from "zod/mini";
|
|
9052
9189
|
|
|
9053
9190
|
// src/features/subagents/rulesync-subagent.ts
|
|
9054
9191
|
import { basename as basename20, join as join75 } from "path";
|
|
9055
|
-
import { z as
|
|
9056
|
-
var RulesyncSubagentFrontmatterSchema =
|
|
9057
|
-
targets:
|
|
9058
|
-
name:
|
|
9059
|
-
description:
|
|
9192
|
+
import { z as z36 } from "zod/mini";
|
|
9193
|
+
var RulesyncSubagentFrontmatterSchema = z36.looseObject({
|
|
9194
|
+
targets: z36._default(RulesyncTargetsSchema, ["*"]),
|
|
9195
|
+
name: z36.string(),
|
|
9196
|
+
description: z36.string()
|
|
9060
9197
|
});
|
|
9061
9198
|
var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
9062
9199
|
frontmatter;
|
|
@@ -9126,13 +9263,13 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
9126
9263
|
};
|
|
9127
9264
|
|
|
9128
9265
|
// src/features/subagents/claudecode-subagent.ts
|
|
9129
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
9130
|
-
name:
|
|
9131
|
-
description:
|
|
9132
|
-
model:
|
|
9133
|
-
tools:
|
|
9134
|
-
permissionMode:
|
|
9135
|
-
skills:
|
|
9266
|
+
var ClaudecodeSubagentFrontmatterSchema = z37.looseObject({
|
|
9267
|
+
name: z37.string(),
|
|
9268
|
+
description: z37.string(),
|
|
9269
|
+
model: z37.optional(z37.string()),
|
|
9270
|
+
tools: z37.optional(z37.union([z37.string(), z37.array(z37.string())])),
|
|
9271
|
+
permissionMode: z37.optional(z37.string()),
|
|
9272
|
+
skills: z37.optional(z37.union([z37.string(), z37.array(z37.string())]))
|
|
9136
9273
|
});
|
|
9137
9274
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
9138
9275
|
frontmatter;
|
|
@@ -9282,12 +9419,12 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
9282
9419
|
|
|
9283
9420
|
// src/features/subagents/copilot-subagent.ts
|
|
9284
9421
|
import { join as join77 } from "path";
|
|
9285
|
-
import { z as
|
|
9422
|
+
import { z as z38 } from "zod/mini";
|
|
9286
9423
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
9287
|
-
var CopilotSubagentFrontmatterSchema =
|
|
9288
|
-
name:
|
|
9289
|
-
description:
|
|
9290
|
-
tools:
|
|
9424
|
+
var CopilotSubagentFrontmatterSchema = z38.looseObject({
|
|
9425
|
+
name: z38.string(),
|
|
9426
|
+
description: z38.string(),
|
|
9427
|
+
tools: z38.optional(z38.union([z38.string(), z38.array(z38.string())]))
|
|
9291
9428
|
});
|
|
9292
9429
|
var normalizeTools = (tools) => {
|
|
9293
9430
|
if (!tools) {
|
|
@@ -9448,10 +9585,10 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
9448
9585
|
|
|
9449
9586
|
// src/features/subagents/cursor-subagent.ts
|
|
9450
9587
|
import { join as join78 } from "path";
|
|
9451
|
-
import { z as
|
|
9452
|
-
var CursorSubagentFrontmatterSchema =
|
|
9453
|
-
name:
|
|
9454
|
-
description:
|
|
9588
|
+
import { z as z39 } from "zod/mini";
|
|
9589
|
+
var CursorSubagentFrontmatterSchema = z39.looseObject({
|
|
9590
|
+
name: z39.string(),
|
|
9591
|
+
description: z39.string()
|
|
9455
9592
|
});
|
|
9456
9593
|
var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
9457
9594
|
frontmatter;
|
|
@@ -9595,22 +9732,22 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
9595
9732
|
|
|
9596
9733
|
// src/features/subagents/kiro-subagent.ts
|
|
9597
9734
|
import { join as join79 } from "path";
|
|
9598
|
-
import { z as
|
|
9599
|
-
var KiroCliSubagentJsonSchema =
|
|
9600
|
-
name:
|
|
9601
|
-
description:
|
|
9602
|
-
prompt:
|
|
9603
|
-
tools:
|
|
9604
|
-
toolAliases:
|
|
9605
|
-
toolSettings:
|
|
9606
|
-
toolSchema:
|
|
9607
|
-
hooks:
|
|
9608
|
-
model:
|
|
9609
|
-
mcpServers:
|
|
9610
|
-
useLegacyMcpJson:
|
|
9611
|
-
resources:
|
|
9612
|
-
allowedTools:
|
|
9613
|
-
includeMcpJson:
|
|
9735
|
+
import { z as z40 } from "zod/mini";
|
|
9736
|
+
var KiroCliSubagentJsonSchema = z40.looseObject({
|
|
9737
|
+
name: z40.string(),
|
|
9738
|
+
description: z40.optional(z40.nullable(z40.string())),
|
|
9739
|
+
prompt: z40.optional(z40.nullable(z40.string())),
|
|
9740
|
+
tools: z40.optional(z40.nullable(z40.array(z40.string()))),
|
|
9741
|
+
toolAliases: z40.optional(z40.nullable(z40.record(z40.string(), z40.string()))),
|
|
9742
|
+
toolSettings: z40.optional(z40.nullable(z40.unknown())),
|
|
9743
|
+
toolSchema: z40.optional(z40.nullable(z40.unknown())),
|
|
9744
|
+
hooks: z40.optional(z40.nullable(z40.record(z40.string(), z40.array(z40.unknown())))),
|
|
9745
|
+
model: z40.optional(z40.nullable(z40.string())),
|
|
9746
|
+
mcpServers: z40.optional(z40.nullable(z40.record(z40.string(), z40.unknown()))),
|
|
9747
|
+
useLegacyMcpJson: z40.optional(z40.nullable(z40.boolean())),
|
|
9748
|
+
resources: z40.optional(z40.nullable(z40.array(z40.string()))),
|
|
9749
|
+
allowedTools: z40.optional(z40.nullable(z40.array(z40.string()))),
|
|
9750
|
+
includeMcpJson: z40.optional(z40.nullable(z40.boolean()))
|
|
9614
9751
|
});
|
|
9615
9752
|
var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
9616
9753
|
body;
|
|
@@ -9732,11 +9869,11 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
9732
9869
|
|
|
9733
9870
|
// src/features/subagents/opencode-subagent.ts
|
|
9734
9871
|
import { basename as basename21, join as join80 } from "path";
|
|
9735
|
-
import { z as
|
|
9736
|
-
var OpenCodeSubagentFrontmatterSchema =
|
|
9737
|
-
description:
|
|
9738
|
-
mode:
|
|
9739
|
-
name:
|
|
9872
|
+
import { z as z41 } from "zod/mini";
|
|
9873
|
+
var OpenCodeSubagentFrontmatterSchema = z41.looseObject({
|
|
9874
|
+
description: z41.string(),
|
|
9875
|
+
mode: z41.literal("subagent"),
|
|
9876
|
+
name: z41.optional(z41.string())
|
|
9740
9877
|
});
|
|
9741
9878
|
var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
9742
9879
|
frontmatter;
|
|
@@ -9892,7 +10029,7 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
9892
10029
|
"opencode",
|
|
9893
10030
|
"roo"
|
|
9894
10031
|
];
|
|
9895
|
-
var SubagentsProcessorToolTargetSchema =
|
|
10032
|
+
var SubagentsProcessorToolTargetSchema = z42.enum(subagentsProcessorToolTargetTuple);
|
|
9896
10033
|
var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
9897
10034
|
[
|
|
9898
10035
|
"agentsmd",
|
|
@@ -10169,42 +10306,42 @@ import { join as join83 } from "path";
|
|
|
10169
10306
|
|
|
10170
10307
|
// src/features/rules/rulesync-rule.ts
|
|
10171
10308
|
import { join as join82 } from "path";
|
|
10172
|
-
import { z as
|
|
10173
|
-
var RulesyncRuleFrontmatterSchema =
|
|
10174
|
-
root:
|
|
10175
|
-
localRoot:
|
|
10176
|
-
targets:
|
|
10177
|
-
description:
|
|
10178
|
-
globs:
|
|
10179
|
-
agentsmd:
|
|
10180
|
-
|
|
10309
|
+
import { z as z43 } from "zod/mini";
|
|
10310
|
+
var RulesyncRuleFrontmatterSchema = z43.object({
|
|
10311
|
+
root: z43.optional(z43.boolean()),
|
|
10312
|
+
localRoot: z43.optional(z43.boolean()),
|
|
10313
|
+
targets: z43._default(RulesyncTargetsSchema, ["*"]),
|
|
10314
|
+
description: z43.optional(z43.string()),
|
|
10315
|
+
globs: z43.optional(z43.array(z43.string())),
|
|
10316
|
+
agentsmd: z43.optional(
|
|
10317
|
+
z43.object({
|
|
10181
10318
|
// @example "path/to/subproject"
|
|
10182
|
-
subprojectPath:
|
|
10319
|
+
subprojectPath: z43.optional(z43.string())
|
|
10183
10320
|
})
|
|
10184
10321
|
),
|
|
10185
|
-
claudecode:
|
|
10186
|
-
|
|
10322
|
+
claudecode: z43.optional(
|
|
10323
|
+
z43.object({
|
|
10187
10324
|
// Glob patterns for conditional rules (takes precedence over globs)
|
|
10188
10325
|
// @example ["src/**/*.ts", "tests/**/*.test.ts"]
|
|
10189
|
-
paths:
|
|
10326
|
+
paths: z43.optional(z43.array(z43.string()))
|
|
10190
10327
|
})
|
|
10191
10328
|
),
|
|
10192
|
-
cursor:
|
|
10193
|
-
|
|
10194
|
-
alwaysApply:
|
|
10195
|
-
description:
|
|
10196
|
-
globs:
|
|
10329
|
+
cursor: z43.optional(
|
|
10330
|
+
z43.object({
|
|
10331
|
+
alwaysApply: z43.optional(z43.boolean()),
|
|
10332
|
+
description: z43.optional(z43.string()),
|
|
10333
|
+
globs: z43.optional(z43.array(z43.string()))
|
|
10197
10334
|
})
|
|
10198
10335
|
),
|
|
10199
|
-
copilot:
|
|
10200
|
-
|
|
10201
|
-
excludeAgent:
|
|
10336
|
+
copilot: z43.optional(
|
|
10337
|
+
z43.object({
|
|
10338
|
+
excludeAgent: z43.optional(z43.union([z43.literal("code-review"), z43.literal("coding-agent")]))
|
|
10202
10339
|
})
|
|
10203
10340
|
),
|
|
10204
|
-
antigravity:
|
|
10205
|
-
|
|
10206
|
-
trigger:
|
|
10207
|
-
globs:
|
|
10341
|
+
antigravity: z43.optional(
|
|
10342
|
+
z43.looseObject({
|
|
10343
|
+
trigger: z43.optional(z43.string()),
|
|
10344
|
+
globs: z43.optional(z43.array(z43.string()))
|
|
10208
10345
|
})
|
|
10209
10346
|
)
|
|
10210
10347
|
});
|
|
@@ -10507,20 +10644,20 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
10507
10644
|
|
|
10508
10645
|
// src/features/rules/antigravity-rule.ts
|
|
10509
10646
|
import { join as join85 } from "path";
|
|
10510
|
-
import { z as
|
|
10511
|
-
var AntigravityRuleFrontmatterSchema =
|
|
10512
|
-
trigger:
|
|
10513
|
-
|
|
10514
|
-
|
|
10515
|
-
|
|
10516
|
-
|
|
10517
|
-
|
|
10518
|
-
|
|
10647
|
+
import { z as z44 } from "zod/mini";
|
|
10648
|
+
var AntigravityRuleFrontmatterSchema = z44.looseObject({
|
|
10649
|
+
trigger: z44.optional(
|
|
10650
|
+
z44.union([
|
|
10651
|
+
z44.literal("always_on"),
|
|
10652
|
+
z44.literal("glob"),
|
|
10653
|
+
z44.literal("manual"),
|
|
10654
|
+
z44.literal("model_decision"),
|
|
10655
|
+
z44.string()
|
|
10519
10656
|
// accepts any string for forward compatibility
|
|
10520
10657
|
])
|
|
10521
10658
|
),
|
|
10522
|
-
globs:
|
|
10523
|
-
description:
|
|
10659
|
+
globs: z44.optional(z44.string()),
|
|
10660
|
+
description: z44.optional(z44.string())
|
|
10524
10661
|
});
|
|
10525
10662
|
function parseGlobsString(globs) {
|
|
10526
10663
|
if (!globs) {
|
|
@@ -11099,9 +11236,9 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
11099
11236
|
|
|
11100
11237
|
// src/features/rules/claudecode-rule.ts
|
|
11101
11238
|
import { join as join89 } from "path";
|
|
11102
|
-
import { z as
|
|
11103
|
-
var ClaudecodeRuleFrontmatterSchema =
|
|
11104
|
-
paths:
|
|
11239
|
+
import { z as z45 } from "zod/mini";
|
|
11240
|
+
var ClaudecodeRuleFrontmatterSchema = z45.object({
|
|
11241
|
+
paths: z45.optional(z45.array(z45.string()))
|
|
11105
11242
|
});
|
|
11106
11243
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
11107
11244
|
frontmatter;
|
|
@@ -11310,9 +11447,9 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
11310
11447
|
|
|
11311
11448
|
// src/features/rules/cline-rule.ts
|
|
11312
11449
|
import { join as join90 } from "path";
|
|
11313
|
-
import { z as
|
|
11314
|
-
var ClineRuleFrontmatterSchema =
|
|
11315
|
-
description:
|
|
11450
|
+
import { z as z46 } from "zod/mini";
|
|
11451
|
+
var ClineRuleFrontmatterSchema = z46.object({
|
|
11452
|
+
description: z46.string()
|
|
11316
11453
|
});
|
|
11317
11454
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
11318
11455
|
static getSettablePaths(_options = {}) {
|
|
@@ -11491,11 +11628,11 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
11491
11628
|
|
|
11492
11629
|
// src/features/rules/copilot-rule.ts
|
|
11493
11630
|
import { join as join92 } from "path";
|
|
11494
|
-
import { z as
|
|
11495
|
-
var CopilotRuleFrontmatterSchema =
|
|
11496
|
-
description:
|
|
11497
|
-
applyTo:
|
|
11498
|
-
excludeAgent:
|
|
11631
|
+
import { z as z47 } from "zod/mini";
|
|
11632
|
+
var CopilotRuleFrontmatterSchema = z47.object({
|
|
11633
|
+
description: z47.optional(z47.string()),
|
|
11634
|
+
applyTo: z47.optional(z47.string()),
|
|
11635
|
+
excludeAgent: z47.optional(z47.union([z47.literal("code-review"), z47.literal("coding-agent")]))
|
|
11499
11636
|
});
|
|
11500
11637
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
11501
11638
|
frontmatter;
|
|
@@ -11679,11 +11816,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
11679
11816
|
|
|
11680
11817
|
// src/features/rules/cursor-rule.ts
|
|
11681
11818
|
import { join as join93 } from "path";
|
|
11682
|
-
import { z as
|
|
11683
|
-
var CursorRuleFrontmatterSchema =
|
|
11684
|
-
description:
|
|
11685
|
-
globs:
|
|
11686
|
-
alwaysApply:
|
|
11819
|
+
import { z as z48 } from "zod/mini";
|
|
11820
|
+
var CursorRuleFrontmatterSchema = z48.object({
|
|
11821
|
+
description: z48.optional(z48.string()),
|
|
11822
|
+
globs: z48.optional(z48.string()),
|
|
11823
|
+
alwaysApply: z48.optional(z48.boolean())
|
|
11687
11824
|
});
|
|
11688
11825
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
11689
11826
|
frontmatter;
|
|
@@ -12790,7 +12927,7 @@ var rulesProcessorToolTargets = [
|
|
|
12790
12927
|
"warp",
|
|
12791
12928
|
"windsurf"
|
|
12792
12929
|
];
|
|
12793
|
-
var RulesProcessorToolTargetSchema =
|
|
12930
|
+
var RulesProcessorToolTargetSchema = z49.enum(rulesProcessorToolTargets);
|
|
12794
12931
|
var toolRuleFactories = /* @__PURE__ */ new Map([
|
|
12795
12932
|
[
|
|
12796
12933
|
"agentsmd",
|
|
@@ -12911,8 +13048,7 @@ var toolRuleFactories = /* @__PURE__ */ new Map([
|
|
|
12911
13048
|
supportsGlobal: true,
|
|
12912
13049
|
ruleDiscoveryMode: "toon",
|
|
12913
13050
|
additionalConventions: {
|
|
12914
|
-
subagents: { subagentClass: GeminiCliSubagent }
|
|
12915
|
-
skills: { skillClass: GeminiCliSkill }
|
|
13051
|
+
subagents: { subagentClass: GeminiCliSubagent }
|
|
12916
13052
|
}
|
|
12917
13053
|
}
|
|
12918
13054
|
}
|
|
@@ -13492,60 +13628,60 @@ ${toonContent}`;
|
|
|
13492
13628
|
};
|
|
13493
13629
|
|
|
13494
13630
|
// src/types/git-provider.ts
|
|
13495
|
-
import { z as
|
|
13631
|
+
import { z as z50 } from "zod/mini";
|
|
13496
13632
|
var ALL_GIT_PROVIDERS = ["github", "gitlab"];
|
|
13497
|
-
var GitProviderSchema =
|
|
13633
|
+
var GitProviderSchema = z50.enum(ALL_GIT_PROVIDERS);
|
|
13498
13634
|
|
|
13499
13635
|
// src/lib/github-client.ts
|
|
13500
13636
|
import { RequestError } from "@octokit/request-error";
|
|
13501
13637
|
import { Octokit } from "@octokit/rest";
|
|
13502
13638
|
|
|
13503
13639
|
// src/types/fetch.ts
|
|
13504
|
-
import { z as
|
|
13640
|
+
import { z as z52 } from "zod/mini";
|
|
13505
13641
|
|
|
13506
13642
|
// src/types/fetch-targets.ts
|
|
13507
|
-
import { z as
|
|
13643
|
+
import { z as z51 } from "zod/mini";
|
|
13508
13644
|
var ALL_FETCH_TARGETS = ["rulesync", ...ALL_TOOL_TARGETS];
|
|
13509
|
-
var FetchTargetSchema =
|
|
13645
|
+
var FetchTargetSchema = z51.enum(ALL_FETCH_TARGETS);
|
|
13510
13646
|
|
|
13511
13647
|
// src/types/fetch.ts
|
|
13512
|
-
var ConflictStrategySchema =
|
|
13513
|
-
var GitHubFileTypeSchema =
|
|
13514
|
-
var GitHubFileEntrySchema =
|
|
13515
|
-
name:
|
|
13516
|
-
path:
|
|
13517
|
-
sha:
|
|
13518
|
-
size:
|
|
13648
|
+
var ConflictStrategySchema = z52.enum(["skip", "overwrite"]);
|
|
13649
|
+
var GitHubFileTypeSchema = z52.enum(["file", "dir", "symlink", "submodule"]);
|
|
13650
|
+
var GitHubFileEntrySchema = z52.looseObject({
|
|
13651
|
+
name: z52.string(),
|
|
13652
|
+
path: z52.string(),
|
|
13653
|
+
sha: z52.string(),
|
|
13654
|
+
size: z52.number(),
|
|
13519
13655
|
type: GitHubFileTypeSchema,
|
|
13520
|
-
download_url:
|
|
13656
|
+
download_url: z52.nullable(z52.string())
|
|
13521
13657
|
});
|
|
13522
|
-
var FetchOptionsSchema =
|
|
13523
|
-
target:
|
|
13524
|
-
features:
|
|
13525
|
-
ref:
|
|
13526
|
-
path:
|
|
13527
|
-
output:
|
|
13528
|
-
conflict:
|
|
13529
|
-
token:
|
|
13530
|
-
verbose:
|
|
13531
|
-
silent:
|
|
13658
|
+
var FetchOptionsSchema = z52.looseObject({
|
|
13659
|
+
target: z52.optional(FetchTargetSchema),
|
|
13660
|
+
features: z52.optional(z52.array(z52.enum(ALL_FEATURES_WITH_WILDCARD))),
|
|
13661
|
+
ref: z52.optional(z52.string()),
|
|
13662
|
+
path: z52.optional(z52.string()),
|
|
13663
|
+
output: z52.optional(z52.string()),
|
|
13664
|
+
conflict: z52.optional(ConflictStrategySchema),
|
|
13665
|
+
token: z52.optional(z52.string()),
|
|
13666
|
+
verbose: z52.optional(z52.boolean()),
|
|
13667
|
+
silent: z52.optional(z52.boolean())
|
|
13532
13668
|
});
|
|
13533
|
-
var FetchFileStatusSchema =
|
|
13534
|
-
var GitHubRepoInfoSchema =
|
|
13535
|
-
default_branch:
|
|
13536
|
-
private:
|
|
13669
|
+
var FetchFileStatusSchema = z52.enum(["created", "overwritten", "skipped"]);
|
|
13670
|
+
var GitHubRepoInfoSchema = z52.looseObject({
|
|
13671
|
+
default_branch: z52.string(),
|
|
13672
|
+
private: z52.boolean()
|
|
13537
13673
|
});
|
|
13538
|
-
var GitHubReleaseAssetSchema =
|
|
13539
|
-
name:
|
|
13540
|
-
browser_download_url:
|
|
13541
|
-
size:
|
|
13674
|
+
var GitHubReleaseAssetSchema = z52.looseObject({
|
|
13675
|
+
name: z52.string(),
|
|
13676
|
+
browser_download_url: z52.string(),
|
|
13677
|
+
size: z52.number()
|
|
13542
13678
|
});
|
|
13543
|
-
var GitHubReleaseSchema =
|
|
13544
|
-
tag_name:
|
|
13545
|
-
name:
|
|
13546
|
-
prerelease:
|
|
13547
|
-
draft:
|
|
13548
|
-
assets:
|
|
13679
|
+
var GitHubReleaseSchema = z52.looseObject({
|
|
13680
|
+
tag_name: z52.string(),
|
|
13681
|
+
name: z52.nullable(z52.string()),
|
|
13682
|
+
prerelease: z52.boolean(),
|
|
13683
|
+
draft: z52.boolean(),
|
|
13684
|
+
assets: z52.array(GitHubReleaseAssetSchema)
|
|
13549
13685
|
});
|
|
13550
13686
|
|
|
13551
13687
|
// src/lib/github-client.ts
|
|
@@ -13796,6 +13932,13 @@ var FEATURE_PATHS = {
|
|
|
13796
13932
|
function isToolTarget(target) {
|
|
13797
13933
|
return target !== "rulesync";
|
|
13798
13934
|
}
|
|
13935
|
+
function validateFileSize(relativePath, size) {
|
|
13936
|
+
if (size > MAX_FILE_SIZE) {
|
|
13937
|
+
throw new GitHubClientError(
|
|
13938
|
+
`File "${relativePath}" exceeds maximum size limit (${(size / 1024 / 1024).toFixed(2)}MB > ${MAX_FILE_SIZE / 1024 / 1024}MB)`
|
|
13939
|
+
);
|
|
13940
|
+
}
|
|
13941
|
+
}
|
|
13799
13942
|
async function processFeatureConversion(params) {
|
|
13800
13943
|
const { processor, outputDir } = params;
|
|
13801
13944
|
const paths = [];
|
|
@@ -14060,11 +14203,7 @@ async function fetchFiles(params) {
|
|
|
14060
14203
|
relativePath,
|
|
14061
14204
|
intendedRootDir: outputBasePath
|
|
14062
14205
|
});
|
|
14063
|
-
|
|
14064
|
-
throw new GitHubClientError(
|
|
14065
|
-
`File "${relativePath}" exceeds maximum size limit (${(size / 1024 / 1024).toFixed(2)}MB > ${MAX_FILE_SIZE / 1024 / 1024}MB)`
|
|
14066
|
-
);
|
|
14067
|
-
}
|
|
14206
|
+
validateFileSize(relativePath, size);
|
|
14068
14207
|
}
|
|
14069
14208
|
const results = await Promise.all(
|
|
14070
14209
|
filesToFetch.map(async ({ remotePath, relativePath }) => {
|
|
@@ -14096,6 +14235,15 @@ async function fetchFiles(params) {
|
|
|
14096
14235
|
}
|
|
14097
14236
|
async function collectFeatureFiles(params) {
|
|
14098
14237
|
const { client, owner, repo, basePath, ref, enabledFeatures, semaphore } = params;
|
|
14238
|
+
const dirCache = /* @__PURE__ */ new Map();
|
|
14239
|
+
async function getCachedDirectory(path4) {
|
|
14240
|
+
let promise = dirCache.get(path4);
|
|
14241
|
+
if (promise === void 0) {
|
|
14242
|
+
promise = withSemaphore(semaphore, () => client.listDirectory(owner, repo, path4, ref));
|
|
14243
|
+
dirCache.set(path4, promise);
|
|
14244
|
+
}
|
|
14245
|
+
return promise;
|
|
14246
|
+
}
|
|
14099
14247
|
const tasks = enabledFeatures.flatMap(
|
|
14100
14248
|
(feature) => FEATURE_PATHS[feature].map((featurePath) => ({ feature, featurePath }))
|
|
14101
14249
|
);
|
|
@@ -14106,14 +14254,8 @@ async function collectFeatureFiles(params) {
|
|
|
14106
14254
|
try {
|
|
14107
14255
|
if (featurePath.includes(".")) {
|
|
14108
14256
|
try {
|
|
14109
|
-
const entries = await
|
|
14110
|
-
|
|
14111
|
-
() => client.listDirectory(
|
|
14112
|
-
owner,
|
|
14113
|
-
repo,
|
|
14114
|
-
basePath === "." || basePath === "" ? "." : basePath,
|
|
14115
|
-
ref
|
|
14116
|
-
)
|
|
14257
|
+
const entries = await getCachedDirectory(
|
|
14258
|
+
basePath === "." || basePath === "" ? "." : basePath
|
|
14117
14259
|
);
|
|
14118
14260
|
const fileEntry = entries.find((e) => e.name === featurePath && e.type === "file");
|
|
14119
14261
|
if (fileEntry) {
|
|
@@ -14232,11 +14374,7 @@ async function fetchAndConvertToolFiles(params) {
|
|
|
14232
14374
|
};
|
|
14233
14375
|
}
|
|
14234
14376
|
for (const { relativePath, size } of filesToFetch) {
|
|
14235
|
-
|
|
14236
|
-
throw new GitHubClientError(
|
|
14237
|
-
`File "${relativePath}" exceeds maximum size limit (${(size / 1024 / 1024).toFixed(2)}MB > ${MAX_FILE_SIZE / 1024 / 1024}MB)`
|
|
14238
|
-
);
|
|
14239
|
-
}
|
|
14377
|
+
validateFileSize(relativePath, size);
|
|
14240
14378
|
}
|
|
14241
14379
|
const toolPaths = getToolPathMapping(target);
|
|
14242
14380
|
await Promise.all(
|
|
@@ -14253,7 +14391,6 @@ async function fetchAndConvertToolFiles(params) {
|
|
|
14253
14391
|
);
|
|
14254
14392
|
await writeFileContent(localPath, content);
|
|
14255
14393
|
logger.debug(`Fetched to temp: ${toolRelativePath}`);
|
|
14256
|
-
return toolRelativePath;
|
|
14257
14394
|
})
|
|
14258
14395
|
);
|
|
14259
14396
|
const outputBasePath = join106(baseDir, outputDir);
|
|
@@ -14406,29 +14543,29 @@ import { parse as parseJsonc } from "jsonc-parser";
|
|
|
14406
14543
|
import { dirname as dirname2, join as join107, resolve as resolve4 } from "path";
|
|
14407
14544
|
|
|
14408
14545
|
// src/config/config.ts
|
|
14409
|
-
import { optional as optional3, z as
|
|
14410
|
-
var ConfigParamsSchema =
|
|
14411
|
-
baseDirs:
|
|
14546
|
+
import { optional as optional3, z as z53 } from "zod/mini";
|
|
14547
|
+
var ConfigParamsSchema = z53.object({
|
|
14548
|
+
baseDirs: z53.array(z53.string()),
|
|
14412
14549
|
targets: RulesyncTargetsSchema,
|
|
14413
14550
|
features: RulesyncFeaturesSchema,
|
|
14414
|
-
verbose:
|
|
14415
|
-
delete:
|
|
14551
|
+
verbose: z53.boolean(),
|
|
14552
|
+
delete: z53.boolean(),
|
|
14416
14553
|
// New non-experimental options
|
|
14417
|
-
global: optional3(
|
|
14418
|
-
silent: optional3(
|
|
14419
|
-
simulateCommands: optional3(
|
|
14420
|
-
simulateSubagents: optional3(
|
|
14421
|
-
simulateSkills: optional3(
|
|
14422
|
-
modularMcp: optional3(
|
|
14423
|
-
dryRun: optional3(
|
|
14424
|
-
check: optional3(
|
|
14554
|
+
global: optional3(z53.boolean()),
|
|
14555
|
+
silent: optional3(z53.boolean()),
|
|
14556
|
+
simulateCommands: optional3(z53.boolean()),
|
|
14557
|
+
simulateSubagents: optional3(z53.boolean()),
|
|
14558
|
+
simulateSkills: optional3(z53.boolean()),
|
|
14559
|
+
modularMcp: optional3(z53.boolean()),
|
|
14560
|
+
dryRun: optional3(z53.boolean()),
|
|
14561
|
+
check: optional3(z53.boolean())
|
|
14425
14562
|
});
|
|
14426
|
-
var PartialConfigParamsSchema =
|
|
14427
|
-
var ConfigFileSchema =
|
|
14428
|
-
$schema: optional3(
|
|
14429
|
-
...
|
|
14563
|
+
var PartialConfigParamsSchema = z53.partial(ConfigParamsSchema);
|
|
14564
|
+
var ConfigFileSchema = z53.object({
|
|
14565
|
+
$schema: optional3(z53.string()),
|
|
14566
|
+
...z53.partial(ConfigParamsSchema).shape
|
|
14430
14567
|
});
|
|
14431
|
-
var RequiredConfigParamsSchema =
|
|
14568
|
+
var RequiredConfigParamsSchema = z53.required(ConfigParamsSchema);
|
|
14432
14569
|
var CONFLICTING_TARGET_PAIRS = [
|
|
14433
14570
|
["augmentcode", "augmentcode-legacy"],
|
|
14434
14571
|
["claudecode", "claudecode-legacy"]
|
|
@@ -14501,12 +14638,45 @@ var Config = class {
|
|
|
14501
14638
|
}
|
|
14502
14639
|
return this.targets.filter((target) => target !== "*");
|
|
14503
14640
|
}
|
|
14504
|
-
getFeatures() {
|
|
14641
|
+
getFeatures(target) {
|
|
14642
|
+
if (!Array.isArray(this.features)) {
|
|
14643
|
+
const perTargetFeatures = this.features;
|
|
14644
|
+
if (target) {
|
|
14645
|
+
const targetFeatures = perTargetFeatures[target];
|
|
14646
|
+
if (!targetFeatures || targetFeatures.length === 0) {
|
|
14647
|
+
return [];
|
|
14648
|
+
}
|
|
14649
|
+
if (targetFeatures.includes("*")) {
|
|
14650
|
+
return [...ALL_FEATURES];
|
|
14651
|
+
}
|
|
14652
|
+
return targetFeatures.filter((feature) => feature !== "*");
|
|
14653
|
+
}
|
|
14654
|
+
const allFeatures = [];
|
|
14655
|
+
for (const features of Object.values(perTargetFeatures)) {
|
|
14656
|
+
if (features && features.length > 0) {
|
|
14657
|
+
if (features.includes("*")) {
|
|
14658
|
+
return [...ALL_FEATURES];
|
|
14659
|
+
}
|
|
14660
|
+
for (const feature of features) {
|
|
14661
|
+
if (feature !== "*" && !allFeatures.includes(feature)) {
|
|
14662
|
+
allFeatures.push(feature);
|
|
14663
|
+
}
|
|
14664
|
+
}
|
|
14665
|
+
}
|
|
14666
|
+
}
|
|
14667
|
+
return allFeatures;
|
|
14668
|
+
}
|
|
14505
14669
|
if (this.features.includes("*")) {
|
|
14506
14670
|
return [...ALL_FEATURES];
|
|
14507
14671
|
}
|
|
14508
14672
|
return this.features.filter((feature) => feature !== "*");
|
|
14509
14673
|
}
|
|
14674
|
+
/**
|
|
14675
|
+
* Check if per-target features configuration is being used.
|
|
14676
|
+
*/
|
|
14677
|
+
hasPerTargetFeatures() {
|
|
14678
|
+
return !Array.isArray(this.features);
|
|
14679
|
+
}
|
|
14510
14680
|
getVerbose() {
|
|
14511
14681
|
return this.verbose;
|
|
14512
14682
|
}
|
|
@@ -14687,9 +14857,6 @@ async function generate(params) {
|
|
|
14687
14857
|
}
|
|
14688
14858
|
async function generateRulesCore(params) {
|
|
14689
14859
|
const { config, skills } = params;
|
|
14690
|
-
if (!config.getFeatures().includes("rules")) {
|
|
14691
|
-
return { count: 0, hasDiff: false };
|
|
14692
|
-
}
|
|
14693
14860
|
let totalCount = 0;
|
|
14694
14861
|
let hasDiff = false;
|
|
14695
14862
|
const isPreviewMode = config.isPreviewMode();
|
|
@@ -14699,6 +14866,9 @@ async function generateRulesCore(params) {
|
|
|
14699
14866
|
);
|
|
14700
14867
|
for (const baseDir of config.getBaseDirs()) {
|
|
14701
14868
|
for (const toolTarget of toolTargets) {
|
|
14869
|
+
if (!config.getFeatures(toolTarget).includes("rules")) {
|
|
14870
|
+
continue;
|
|
14871
|
+
}
|
|
14702
14872
|
const processor = new RulesProcessor({
|
|
14703
14873
|
baseDir,
|
|
14704
14874
|
toolTarget,
|
|
@@ -14725,9 +14895,6 @@ async function generateRulesCore(params) {
|
|
|
14725
14895
|
}
|
|
14726
14896
|
async function generateIgnoreCore(params) {
|
|
14727
14897
|
const { config } = params;
|
|
14728
|
-
if (!config.getFeatures().includes("ignore")) {
|
|
14729
|
-
return { count: 0, hasDiff: false };
|
|
14730
|
-
}
|
|
14731
14898
|
if (config.getGlobal()) {
|
|
14732
14899
|
return { count: 0, hasDiff: false };
|
|
14733
14900
|
}
|
|
@@ -14735,6 +14902,9 @@ async function generateIgnoreCore(params) {
|
|
|
14735
14902
|
let hasDiff = false;
|
|
14736
14903
|
const isPreviewMode = config.isPreviewMode();
|
|
14737
14904
|
for (const toolTarget of intersection(config.getTargets(), IgnoreProcessor.getToolTargets())) {
|
|
14905
|
+
if (!config.getFeatures(toolTarget).includes("ignore")) {
|
|
14906
|
+
continue;
|
|
14907
|
+
}
|
|
14738
14908
|
for (const baseDir of config.getBaseDirs()) {
|
|
14739
14909
|
try {
|
|
14740
14910
|
const processor = new IgnoreProcessor({
|
|
@@ -14770,9 +14940,6 @@ async function generateIgnoreCore(params) {
|
|
|
14770
14940
|
}
|
|
14771
14941
|
async function generateMcpCore(params) {
|
|
14772
14942
|
const { config } = params;
|
|
14773
|
-
if (!config.getFeatures().includes("mcp")) {
|
|
14774
|
-
return { count: 0, hasDiff: false };
|
|
14775
|
-
}
|
|
14776
14943
|
let totalCount = 0;
|
|
14777
14944
|
let hasDiff = false;
|
|
14778
14945
|
const isPreviewMode = config.isPreviewMode();
|
|
@@ -14782,6 +14949,9 @@ async function generateMcpCore(params) {
|
|
|
14782
14949
|
);
|
|
14783
14950
|
for (const baseDir of config.getBaseDirs()) {
|
|
14784
14951
|
for (const toolTarget of toolTargets) {
|
|
14952
|
+
if (!config.getFeatures(toolTarget).includes("mcp")) {
|
|
14953
|
+
continue;
|
|
14954
|
+
}
|
|
14785
14955
|
const processor = new McpProcessor({
|
|
14786
14956
|
baseDir,
|
|
14787
14957
|
toolTarget,
|
|
@@ -14805,9 +14975,6 @@ async function generateMcpCore(params) {
|
|
|
14805
14975
|
}
|
|
14806
14976
|
async function generateCommandsCore(params) {
|
|
14807
14977
|
const { config } = params;
|
|
14808
|
-
if (!config.getFeatures().includes("commands")) {
|
|
14809
|
-
return { count: 0, hasDiff: false };
|
|
14810
|
-
}
|
|
14811
14978
|
let totalCount = 0;
|
|
14812
14979
|
let hasDiff = false;
|
|
14813
14980
|
const isPreviewMode = config.isPreviewMode();
|
|
@@ -14820,6 +14987,9 @@ async function generateCommandsCore(params) {
|
|
|
14820
14987
|
);
|
|
14821
14988
|
for (const baseDir of config.getBaseDirs()) {
|
|
14822
14989
|
for (const toolTarget of toolTargets) {
|
|
14990
|
+
if (!config.getFeatures(toolTarget).includes("commands")) {
|
|
14991
|
+
continue;
|
|
14992
|
+
}
|
|
14823
14993
|
const processor = new CommandsProcessor({
|
|
14824
14994
|
baseDir,
|
|
14825
14995
|
toolTarget,
|
|
@@ -14842,9 +15012,6 @@ async function generateCommandsCore(params) {
|
|
|
14842
15012
|
}
|
|
14843
15013
|
async function generateSubagentsCore(params) {
|
|
14844
15014
|
const { config } = params;
|
|
14845
|
-
if (!config.getFeatures().includes("subagents")) {
|
|
14846
|
-
return { count: 0, hasDiff: false };
|
|
14847
|
-
}
|
|
14848
15015
|
let totalCount = 0;
|
|
14849
15016
|
let hasDiff = false;
|
|
14850
15017
|
const isPreviewMode = config.isPreviewMode();
|
|
@@ -14857,6 +15024,9 @@ async function generateSubagentsCore(params) {
|
|
|
14857
15024
|
);
|
|
14858
15025
|
for (const baseDir of config.getBaseDirs()) {
|
|
14859
15026
|
for (const toolTarget of toolTargets) {
|
|
15027
|
+
if (!config.getFeatures(toolTarget).includes("subagents")) {
|
|
15028
|
+
continue;
|
|
15029
|
+
}
|
|
14860
15030
|
const processor = new SubagentsProcessor({
|
|
14861
15031
|
baseDir,
|
|
14862
15032
|
toolTarget,
|
|
@@ -14879,9 +15049,6 @@ async function generateSubagentsCore(params) {
|
|
|
14879
15049
|
}
|
|
14880
15050
|
async function generateSkillsCore(params) {
|
|
14881
15051
|
const { config } = params;
|
|
14882
|
-
if (!config.getFeatures().includes("skills")) {
|
|
14883
|
-
return { count: 0, skills: [], hasDiff: false };
|
|
14884
|
-
}
|
|
14885
15052
|
let totalCount = 0;
|
|
14886
15053
|
let hasDiff = false;
|
|
14887
15054
|
const allSkills = [];
|
|
@@ -14895,6 +15062,9 @@ async function generateSkillsCore(params) {
|
|
|
14895
15062
|
);
|
|
14896
15063
|
for (const baseDir of config.getBaseDirs()) {
|
|
14897
15064
|
for (const toolTarget of toolTargets) {
|
|
15065
|
+
if (!config.getFeatures(toolTarget).includes("skills")) {
|
|
15066
|
+
continue;
|
|
15067
|
+
}
|
|
14898
15068
|
const processor = new SkillsProcessor({
|
|
14899
15069
|
baseDir,
|
|
14900
15070
|
toolTarget,
|
|
@@ -14922,9 +15092,6 @@ async function generateSkillsCore(params) {
|
|
|
14922
15092
|
}
|
|
14923
15093
|
async function generateHooksCore(params) {
|
|
14924
15094
|
const { config } = params;
|
|
14925
|
-
if (!config.getFeatures().includes("hooks")) {
|
|
14926
|
-
return { count: 0, hasDiff: false };
|
|
14927
|
-
}
|
|
14928
15095
|
let totalCount = 0;
|
|
14929
15096
|
let hasDiff = false;
|
|
14930
15097
|
const isPreviewMode = config.isPreviewMode();
|
|
@@ -14934,6 +15101,9 @@ async function generateHooksCore(params) {
|
|
|
14934
15101
|
);
|
|
14935
15102
|
for (const baseDir of config.getBaseDirs()) {
|
|
14936
15103
|
for (const toolTarget of toolTargets) {
|
|
15104
|
+
if (!config.getFeatures(toolTarget).includes("hooks")) {
|
|
15105
|
+
continue;
|
|
15106
|
+
}
|
|
14937
15107
|
const processor = new HooksProcessor({
|
|
14938
15108
|
baseDir,
|
|
14939
15109
|
toolTarget,
|
|
@@ -14973,9 +15143,9 @@ function logFeatureResult(params) {
|
|
|
14973
15143
|
const { count, featureName, isPreview, modePrefix } = params;
|
|
14974
15144
|
if (count > 0) {
|
|
14975
15145
|
if (isPreview) {
|
|
14976
|
-
logger.info(`${modePrefix} Would
|
|
15146
|
+
logger.info(`${modePrefix} Would write ${count} ${featureName}`);
|
|
14977
15147
|
} else {
|
|
14978
|
-
logger.success(`
|
|
15148
|
+
logger.success(`Written ${count} ${featureName}`);
|
|
14979
15149
|
}
|
|
14980
15150
|
}
|
|
14981
15151
|
}
|
|
@@ -15070,7 +15240,7 @@ async function generateCommand(options) {
|
|
|
15070
15240
|
const totalGenerated = calculateTotalCount(result);
|
|
15071
15241
|
if (totalGenerated === 0) {
|
|
15072
15242
|
const enabledFeatures = features.join(", ");
|
|
15073
|
-
logger.
|
|
15243
|
+
logger.info(`\u2713 All files are up to date (${enabledFeatures})`);
|
|
15074
15244
|
return;
|
|
15075
15245
|
}
|
|
15076
15246
|
const parts = [];
|
|
@@ -15082,11 +15252,9 @@ async function generateCommand(options) {
|
|
|
15082
15252
|
if (result.skillsCount > 0) parts.push(`${result.skillsCount} skills`);
|
|
15083
15253
|
if (result.hooksCount > 0) parts.push(`${result.hooksCount} hooks`);
|
|
15084
15254
|
if (isPreview) {
|
|
15085
|
-
logger.info(
|
|
15086
|
-
`${modePrefix} Would generate ${totalGenerated} file(s) total (${parts.join(" + ")})`
|
|
15087
|
-
);
|
|
15255
|
+
logger.info(`${modePrefix} Would write ${totalGenerated} file(s) total (${parts.join(" + ")})`);
|
|
15088
15256
|
} else {
|
|
15089
|
-
logger.success(`\u{1F389} All done!
|
|
15257
|
+
logger.success(`\u{1F389} All done! Written ${totalGenerated} file(s) total (${parts.join(" + ")})`);
|
|
15090
15258
|
}
|
|
15091
15259
|
if (check) {
|
|
15092
15260
|
if (result.hasDiff) {
|
|
@@ -15296,7 +15464,7 @@ async function importFromTool(params) {
|
|
|
15296
15464
|
}
|
|
15297
15465
|
async function importRulesCore(params) {
|
|
15298
15466
|
const { config, tool } = params;
|
|
15299
|
-
if (!config.getFeatures().includes("rules")) {
|
|
15467
|
+
if (!config.getFeatures(tool).includes("rules")) {
|
|
15300
15468
|
return 0;
|
|
15301
15469
|
}
|
|
15302
15470
|
const global = config.getGlobal();
|
|
@@ -15322,7 +15490,7 @@ async function importRulesCore(params) {
|
|
|
15322
15490
|
}
|
|
15323
15491
|
async function importIgnoreCore(params) {
|
|
15324
15492
|
const { config, tool } = params;
|
|
15325
|
-
if (!config.getFeatures().includes("ignore")) {
|
|
15493
|
+
if (!config.getFeatures(tool).includes("ignore")) {
|
|
15326
15494
|
return 0;
|
|
15327
15495
|
}
|
|
15328
15496
|
if (config.getGlobal()) {
|
|
@@ -15352,7 +15520,7 @@ async function importIgnoreCore(params) {
|
|
|
15352
15520
|
}
|
|
15353
15521
|
async function importMcpCore(params) {
|
|
15354
15522
|
const { config, tool } = params;
|
|
15355
|
-
if (!config.getFeatures().includes("mcp")) {
|
|
15523
|
+
if (!config.getFeatures(tool).includes("mcp")) {
|
|
15356
15524
|
return 0;
|
|
15357
15525
|
}
|
|
15358
15526
|
const global = config.getGlobal();
|
|
@@ -15378,7 +15546,7 @@ async function importMcpCore(params) {
|
|
|
15378
15546
|
}
|
|
15379
15547
|
async function importCommandsCore(params) {
|
|
15380
15548
|
const { config, tool } = params;
|
|
15381
|
-
if (!config.getFeatures().includes("commands")) {
|
|
15549
|
+
if (!config.getFeatures(tool).includes("commands")) {
|
|
15382
15550
|
return 0;
|
|
15383
15551
|
}
|
|
15384
15552
|
const global = config.getGlobal();
|
|
@@ -15404,7 +15572,7 @@ async function importCommandsCore(params) {
|
|
|
15404
15572
|
}
|
|
15405
15573
|
async function importSubagentsCore(params) {
|
|
15406
15574
|
const { config, tool } = params;
|
|
15407
|
-
if (!config.getFeatures().includes("subagents")) {
|
|
15575
|
+
if (!config.getFeatures(tool).includes("subagents")) {
|
|
15408
15576
|
return 0;
|
|
15409
15577
|
}
|
|
15410
15578
|
const global = config.getGlobal();
|
|
@@ -15430,7 +15598,7 @@ async function importSubagentsCore(params) {
|
|
|
15430
15598
|
}
|
|
15431
15599
|
async function importSkillsCore(params) {
|
|
15432
15600
|
const { config, tool } = params;
|
|
15433
|
-
if (!config.getFeatures().includes("skills")) {
|
|
15601
|
+
if (!config.getFeatures(tool).includes("skills")) {
|
|
15434
15602
|
return 0;
|
|
15435
15603
|
}
|
|
15436
15604
|
const global = config.getGlobal();
|
|
@@ -15456,7 +15624,7 @@ async function importSkillsCore(params) {
|
|
|
15456
15624
|
}
|
|
15457
15625
|
async function importHooksCore(params) {
|
|
15458
15626
|
const { config, tool } = params;
|
|
15459
|
-
if (!config.getFeatures().includes("hooks")) {
|
|
15627
|
+
if (!config.getFeatures(tool).includes("hooks")) {
|
|
15460
15628
|
return 0;
|
|
15461
15629
|
}
|
|
15462
15630
|
const global = config.getGlobal();
|
|
@@ -15769,11 +15937,11 @@ async function initCommand() {
|
|
|
15769
15937
|
import { FastMCP } from "fastmcp";
|
|
15770
15938
|
|
|
15771
15939
|
// src/mcp/tools.ts
|
|
15772
|
-
import { z as
|
|
15940
|
+
import { z as z62 } from "zod/mini";
|
|
15773
15941
|
|
|
15774
15942
|
// src/mcp/commands.ts
|
|
15775
15943
|
import { basename as basename24, join as join111 } from "path";
|
|
15776
|
-
import { z as
|
|
15944
|
+
import { z as z54 } from "zod/mini";
|
|
15777
15945
|
var maxCommandSizeBytes = 1024 * 1024;
|
|
15778
15946
|
var maxCommandsCount = 1e3;
|
|
15779
15947
|
async function listCommands() {
|
|
@@ -15892,17 +16060,17 @@ async function deleteCommand({ relativePathFromCwd }) {
|
|
|
15892
16060
|
}
|
|
15893
16061
|
}
|
|
15894
16062
|
var commandToolSchemas = {
|
|
15895
|
-
listCommands:
|
|
15896
|
-
getCommand:
|
|
15897
|
-
relativePathFromCwd:
|
|
16063
|
+
listCommands: z54.object({}),
|
|
16064
|
+
getCommand: z54.object({
|
|
16065
|
+
relativePathFromCwd: z54.string()
|
|
15898
16066
|
}),
|
|
15899
|
-
putCommand:
|
|
15900
|
-
relativePathFromCwd:
|
|
16067
|
+
putCommand: z54.object({
|
|
16068
|
+
relativePathFromCwd: z54.string(),
|
|
15901
16069
|
frontmatter: RulesyncCommandFrontmatterSchema,
|
|
15902
|
-
body:
|
|
16070
|
+
body: z54.string()
|
|
15903
16071
|
}),
|
|
15904
|
-
deleteCommand:
|
|
15905
|
-
relativePathFromCwd:
|
|
16072
|
+
deleteCommand: z54.object({
|
|
16073
|
+
relativePathFromCwd: z54.string()
|
|
15906
16074
|
})
|
|
15907
16075
|
};
|
|
15908
16076
|
var commandTools = {
|
|
@@ -15950,16 +16118,16 @@ var commandTools = {
|
|
|
15950
16118
|
};
|
|
15951
16119
|
|
|
15952
16120
|
// src/mcp/generate.ts
|
|
15953
|
-
import { z as
|
|
15954
|
-
var generateOptionsSchema =
|
|
15955
|
-
targets:
|
|
15956
|
-
features:
|
|
15957
|
-
delete:
|
|
15958
|
-
global:
|
|
15959
|
-
simulateCommands:
|
|
15960
|
-
simulateSubagents:
|
|
15961
|
-
simulateSkills:
|
|
15962
|
-
modularMcp:
|
|
16121
|
+
import { z as z55 } from "zod/mini";
|
|
16122
|
+
var generateOptionsSchema = z55.object({
|
|
16123
|
+
targets: z55.optional(z55.array(z55.string())),
|
|
16124
|
+
features: z55.optional(z55.array(z55.string())),
|
|
16125
|
+
delete: z55.optional(z55.boolean()),
|
|
16126
|
+
global: z55.optional(z55.boolean()),
|
|
16127
|
+
simulateCommands: z55.optional(z55.boolean()),
|
|
16128
|
+
simulateSubagents: z55.optional(z55.boolean()),
|
|
16129
|
+
simulateSkills: z55.optional(z55.boolean()),
|
|
16130
|
+
modularMcp: z55.optional(z55.boolean())
|
|
15963
16131
|
});
|
|
15964
16132
|
async function executeGenerate(options = {}) {
|
|
15965
16133
|
try {
|
|
@@ -16039,7 +16207,7 @@ var generateTools = {
|
|
|
16039
16207
|
|
|
16040
16208
|
// src/mcp/ignore.ts
|
|
16041
16209
|
import { join as join112 } from "path";
|
|
16042
|
-
import { z as
|
|
16210
|
+
import { z as z56 } from "zod/mini";
|
|
16043
16211
|
var maxIgnoreFileSizeBytes = 100 * 1024;
|
|
16044
16212
|
async function getIgnoreFile() {
|
|
16045
16213
|
const ignoreFilePath = join112(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
|
|
@@ -16096,11 +16264,11 @@ async function deleteIgnoreFile() {
|
|
|
16096
16264
|
}
|
|
16097
16265
|
}
|
|
16098
16266
|
var ignoreToolSchemas = {
|
|
16099
|
-
getIgnoreFile:
|
|
16100
|
-
putIgnoreFile:
|
|
16101
|
-
content:
|
|
16267
|
+
getIgnoreFile: z56.object({}),
|
|
16268
|
+
putIgnoreFile: z56.object({
|
|
16269
|
+
content: z56.string()
|
|
16102
16270
|
}),
|
|
16103
|
-
deleteIgnoreFile:
|
|
16271
|
+
deleteIgnoreFile: z56.object({})
|
|
16104
16272
|
};
|
|
16105
16273
|
var ignoreTools = {
|
|
16106
16274
|
getIgnoreFile: {
|
|
@@ -16133,11 +16301,11 @@ var ignoreTools = {
|
|
|
16133
16301
|
};
|
|
16134
16302
|
|
|
16135
16303
|
// src/mcp/import.ts
|
|
16136
|
-
import { z as
|
|
16137
|
-
var importOptionsSchema =
|
|
16138
|
-
target:
|
|
16139
|
-
features:
|
|
16140
|
-
global:
|
|
16304
|
+
import { z as z57 } from "zod/mini";
|
|
16305
|
+
var importOptionsSchema = z57.object({
|
|
16306
|
+
target: z57.string(),
|
|
16307
|
+
features: z57.optional(z57.array(z57.string())),
|
|
16308
|
+
global: z57.optional(z57.boolean())
|
|
16141
16309
|
});
|
|
16142
16310
|
async function executeImport(options) {
|
|
16143
16311
|
try {
|
|
@@ -16207,7 +16375,7 @@ var importTools = {
|
|
|
16207
16375
|
|
|
16208
16376
|
// src/mcp/mcp.ts
|
|
16209
16377
|
import { join as join113 } from "path";
|
|
16210
|
-
import { z as
|
|
16378
|
+
import { z as z58 } from "zod/mini";
|
|
16211
16379
|
var maxMcpSizeBytes = 1024 * 1024;
|
|
16212
16380
|
async function getMcpFile() {
|
|
16213
16381
|
const config = await ConfigResolver.resolve({});
|
|
@@ -16297,11 +16465,11 @@ async function deleteMcpFile() {
|
|
|
16297
16465
|
}
|
|
16298
16466
|
}
|
|
16299
16467
|
var mcpToolSchemas = {
|
|
16300
|
-
getMcpFile:
|
|
16301
|
-
putMcpFile:
|
|
16302
|
-
content:
|
|
16468
|
+
getMcpFile: z58.object({}),
|
|
16469
|
+
putMcpFile: z58.object({
|
|
16470
|
+
content: z58.string()
|
|
16303
16471
|
}),
|
|
16304
|
-
deleteMcpFile:
|
|
16472
|
+
deleteMcpFile: z58.object({})
|
|
16305
16473
|
};
|
|
16306
16474
|
var mcpTools = {
|
|
16307
16475
|
getMcpFile: {
|
|
@@ -16335,7 +16503,7 @@ var mcpTools = {
|
|
|
16335
16503
|
|
|
16336
16504
|
// src/mcp/rules.ts
|
|
16337
16505
|
import { basename as basename25, join as join114 } from "path";
|
|
16338
|
-
import { z as
|
|
16506
|
+
import { z as z59 } from "zod/mini";
|
|
16339
16507
|
var maxRuleSizeBytes = 1024 * 1024;
|
|
16340
16508
|
var maxRulesCount = 1e3;
|
|
16341
16509
|
async function listRules() {
|
|
@@ -16454,17 +16622,17 @@ async function deleteRule({ relativePathFromCwd }) {
|
|
|
16454
16622
|
}
|
|
16455
16623
|
}
|
|
16456
16624
|
var ruleToolSchemas = {
|
|
16457
|
-
listRules:
|
|
16458
|
-
getRule:
|
|
16459
|
-
relativePathFromCwd:
|
|
16625
|
+
listRules: z59.object({}),
|
|
16626
|
+
getRule: z59.object({
|
|
16627
|
+
relativePathFromCwd: z59.string()
|
|
16460
16628
|
}),
|
|
16461
|
-
putRule:
|
|
16462
|
-
relativePathFromCwd:
|
|
16629
|
+
putRule: z59.object({
|
|
16630
|
+
relativePathFromCwd: z59.string(),
|
|
16463
16631
|
frontmatter: RulesyncRuleFrontmatterSchema,
|
|
16464
|
-
body:
|
|
16632
|
+
body: z59.string()
|
|
16465
16633
|
}),
|
|
16466
|
-
deleteRule:
|
|
16467
|
-
relativePathFromCwd:
|
|
16634
|
+
deleteRule: z59.object({
|
|
16635
|
+
relativePathFromCwd: z59.string()
|
|
16468
16636
|
})
|
|
16469
16637
|
};
|
|
16470
16638
|
var ruleTools = {
|
|
@@ -16513,7 +16681,7 @@ var ruleTools = {
|
|
|
16513
16681
|
|
|
16514
16682
|
// src/mcp/skills.ts
|
|
16515
16683
|
import { basename as basename26, dirname as dirname3, join as join115 } from "path";
|
|
16516
|
-
import { z as
|
|
16684
|
+
import { z as z60 } from "zod/mini";
|
|
16517
16685
|
var maxSkillSizeBytes = 1024 * 1024;
|
|
16518
16686
|
var maxSkillsCount = 1e3;
|
|
16519
16687
|
function aiDirFileToMcpSkillFile(file) {
|
|
@@ -16681,23 +16849,23 @@ async function deleteSkill({
|
|
|
16681
16849
|
);
|
|
16682
16850
|
}
|
|
16683
16851
|
}
|
|
16684
|
-
var McpSkillFileSchema =
|
|
16685
|
-
name:
|
|
16686
|
-
body:
|
|
16852
|
+
var McpSkillFileSchema = z60.object({
|
|
16853
|
+
name: z60.string(),
|
|
16854
|
+
body: z60.string()
|
|
16687
16855
|
});
|
|
16688
16856
|
var skillToolSchemas = {
|
|
16689
|
-
listSkills:
|
|
16690
|
-
getSkill:
|
|
16691
|
-
relativeDirPathFromCwd:
|
|
16857
|
+
listSkills: z60.object({}),
|
|
16858
|
+
getSkill: z60.object({
|
|
16859
|
+
relativeDirPathFromCwd: z60.string()
|
|
16692
16860
|
}),
|
|
16693
|
-
putSkill:
|
|
16694
|
-
relativeDirPathFromCwd:
|
|
16861
|
+
putSkill: z60.object({
|
|
16862
|
+
relativeDirPathFromCwd: z60.string(),
|
|
16695
16863
|
frontmatter: RulesyncSkillFrontmatterSchema,
|
|
16696
|
-
body:
|
|
16697
|
-
otherFiles:
|
|
16864
|
+
body: z60.string(),
|
|
16865
|
+
otherFiles: z60.optional(z60.array(McpSkillFileSchema))
|
|
16698
16866
|
}),
|
|
16699
|
-
deleteSkill:
|
|
16700
|
-
relativeDirPathFromCwd:
|
|
16867
|
+
deleteSkill: z60.object({
|
|
16868
|
+
relativeDirPathFromCwd: z60.string()
|
|
16701
16869
|
})
|
|
16702
16870
|
};
|
|
16703
16871
|
var skillTools = {
|
|
@@ -16747,7 +16915,7 @@ var skillTools = {
|
|
|
16747
16915
|
|
|
16748
16916
|
// src/mcp/subagents.ts
|
|
16749
16917
|
import { basename as basename27, join as join116 } from "path";
|
|
16750
|
-
import { z as
|
|
16918
|
+
import { z as z61 } from "zod/mini";
|
|
16751
16919
|
var maxSubagentSizeBytes = 1024 * 1024;
|
|
16752
16920
|
var maxSubagentsCount = 1e3;
|
|
16753
16921
|
async function listSubagents() {
|
|
@@ -16871,17 +17039,17 @@ async function deleteSubagent({ relativePathFromCwd }) {
|
|
|
16871
17039
|
}
|
|
16872
17040
|
}
|
|
16873
17041
|
var subagentToolSchemas = {
|
|
16874
|
-
listSubagents:
|
|
16875
|
-
getSubagent:
|
|
16876
|
-
relativePathFromCwd:
|
|
17042
|
+
listSubagents: z61.object({}),
|
|
17043
|
+
getSubagent: z61.object({
|
|
17044
|
+
relativePathFromCwd: z61.string()
|
|
16877
17045
|
}),
|
|
16878
|
-
putSubagent:
|
|
16879
|
-
relativePathFromCwd:
|
|
17046
|
+
putSubagent: z61.object({
|
|
17047
|
+
relativePathFromCwd: z61.string(),
|
|
16880
17048
|
frontmatter: RulesyncSubagentFrontmatterSchema,
|
|
16881
|
-
body:
|
|
17049
|
+
body: z61.string()
|
|
16882
17050
|
}),
|
|
16883
|
-
deleteSubagent:
|
|
16884
|
-
relativePathFromCwd:
|
|
17051
|
+
deleteSubagent: z61.object({
|
|
17052
|
+
relativePathFromCwd: z61.string()
|
|
16885
17053
|
})
|
|
16886
17054
|
};
|
|
16887
17055
|
var subagentTools = {
|
|
@@ -16929,7 +17097,7 @@ var subagentTools = {
|
|
|
16929
17097
|
};
|
|
16930
17098
|
|
|
16931
17099
|
// src/mcp/tools.ts
|
|
16932
|
-
var rulesyncFeatureSchema =
|
|
17100
|
+
var rulesyncFeatureSchema = z62.enum([
|
|
16933
17101
|
"rule",
|
|
16934
17102
|
"command",
|
|
16935
17103
|
"subagent",
|
|
@@ -16939,21 +17107,21 @@ var rulesyncFeatureSchema = z61.enum([
|
|
|
16939
17107
|
"generate",
|
|
16940
17108
|
"import"
|
|
16941
17109
|
]);
|
|
16942
|
-
var rulesyncOperationSchema =
|
|
16943
|
-
var skillFileSchema =
|
|
16944
|
-
name:
|
|
16945
|
-
body:
|
|
17110
|
+
var rulesyncOperationSchema = z62.enum(["list", "get", "put", "delete", "run"]);
|
|
17111
|
+
var skillFileSchema = z62.object({
|
|
17112
|
+
name: z62.string(),
|
|
17113
|
+
body: z62.string()
|
|
16946
17114
|
});
|
|
16947
|
-
var rulesyncToolSchema =
|
|
17115
|
+
var rulesyncToolSchema = z62.object({
|
|
16948
17116
|
feature: rulesyncFeatureSchema,
|
|
16949
17117
|
operation: rulesyncOperationSchema,
|
|
16950
|
-
targetPathFromCwd:
|
|
16951
|
-
frontmatter:
|
|
16952
|
-
body:
|
|
16953
|
-
otherFiles:
|
|
16954
|
-
content:
|
|
16955
|
-
generateOptions:
|
|
16956
|
-
importOptions:
|
|
17118
|
+
targetPathFromCwd: z62.optional(z62.string()),
|
|
17119
|
+
frontmatter: z62.optional(z62.unknown()),
|
|
17120
|
+
body: z62.optional(z62.string()),
|
|
17121
|
+
otherFiles: z62.optional(z62.array(skillFileSchema)),
|
|
17122
|
+
content: z62.optional(z62.string()),
|
|
17123
|
+
generateOptions: z62.optional(generateOptionsSchema),
|
|
17124
|
+
importOptions: z62.optional(importOptionsSchema)
|
|
16957
17125
|
});
|
|
16958
17126
|
var supportedOperationsByFeature = {
|
|
16959
17127
|
rule: ["list", "get", "put", "delete"],
|
|
@@ -17512,7 +17680,7 @@ async function updateCommand(currentVersion, options) {
|
|
|
17512
17680
|
}
|
|
17513
17681
|
|
|
17514
17682
|
// src/cli/index.ts
|
|
17515
|
-
var getVersion = () => "6.
|
|
17683
|
+
var getVersion = () => "6.8.1";
|
|
17516
17684
|
var main = async () => {
|
|
17517
17685
|
const program = new Command();
|
|
17518
17686
|
const version = getVersion();
|