rulesync 7.6.2 → 7.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{chunk-MG4OE47A.js → chunk-KDYNNWMK.js} +987 -606
- package/dist/cli/index.cjs +1275 -890
- package/dist/cli/index.js +8 -4
- package/dist/index.cjs +1011 -630
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/package.json +13 -13
|
@@ -130,8 +130,8 @@ var ToolTargetsSchema = z2.array(ToolTargetSchema);
|
|
|
130
130
|
var RulesyncTargetsSchema = z2.array(z2.enum(ALL_TOOL_TARGETS_WITH_WILDCARD));
|
|
131
131
|
|
|
132
132
|
// src/config/config-resolver.ts
|
|
133
|
-
import { parse as parseJsonc } from "jsonc-parser";
|
|
134
133
|
import { dirname as dirname2, join as join3, resolve as resolve2 } from "path";
|
|
134
|
+
import { parse as parseJsonc } from "jsonc-parser";
|
|
135
135
|
|
|
136
136
|
// src/constants/rulesync-paths.ts
|
|
137
137
|
import { join } from "path";
|
|
@@ -159,11 +159,11 @@ var MAX_FILE_SIZE = 10 * 1024 * 1024;
|
|
|
159
159
|
var FETCH_CONCURRENCY_LIMIT = 10;
|
|
160
160
|
|
|
161
161
|
// src/utils/file.ts
|
|
162
|
-
import { kebabCase } from "es-toolkit";
|
|
163
|
-
import { globbySync } from "globby";
|
|
164
162
|
import { mkdir, mkdtemp, readdir, readFile, rm, stat, writeFile } from "fs/promises";
|
|
165
163
|
import os from "os";
|
|
166
164
|
import { dirname, join as join2, relative, resolve } from "path";
|
|
165
|
+
import { kebabCase } from "es-toolkit";
|
|
166
|
+
import { globbySync } from "globby";
|
|
167
167
|
async function ensureDir(dirPath) {
|
|
168
168
|
try {
|
|
169
169
|
await stat(dirPath);
|
|
@@ -251,7 +251,11 @@ async function findFilesByGlobs(globs, options = {}) {
|
|
|
251
251
|
const { type = "all" } = options;
|
|
252
252
|
const globbyOptions = type === "file" ? { onlyFiles: true, onlyDirectories: false } : type === "dir" ? { onlyFiles: false, onlyDirectories: true } : { onlyFiles: false, onlyDirectories: false };
|
|
253
253
|
const normalizedGlobs = Array.isArray(globs) ? globs.map((g) => g.replaceAll("\\", "/")) : globs.replaceAll("\\", "/");
|
|
254
|
-
const results = globbySync(normalizedGlobs, {
|
|
254
|
+
const results = globbySync(normalizedGlobs, {
|
|
255
|
+
absolute: true,
|
|
256
|
+
followSymbolicLinks: false,
|
|
257
|
+
...globbyOptions
|
|
258
|
+
});
|
|
255
259
|
return results.toSorted();
|
|
256
260
|
}
|
|
257
261
|
async function removeDirectory(dirPath) {
|
|
@@ -602,12 +606,12 @@ function getBaseDirsInLightOfGlobal({
|
|
|
602
606
|
}
|
|
603
607
|
|
|
604
608
|
// src/lib/generate.ts
|
|
609
|
+
import { join as join112 } from "path";
|
|
605
610
|
import { intersection } from "es-toolkit";
|
|
606
|
-
import { join as join110 } from "path";
|
|
607
611
|
|
|
608
612
|
// src/features/commands/commands-processor.ts
|
|
609
613
|
import { basename as basename2, join as join19, relative as relative3 } from "path";
|
|
610
|
-
import { z as
|
|
614
|
+
import { z as z13 } from "zod/mini";
|
|
611
615
|
|
|
612
616
|
// src/types/feature-processor.ts
|
|
613
617
|
var FeatureProcessor = class {
|
|
@@ -1795,25 +1799,67 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
|
1795
1799
|
|
|
1796
1800
|
// src/features/commands/cursor-command.ts
|
|
1797
1801
|
import { join as join12 } from "path";
|
|
1802
|
+
import { z as z9 } from "zod/mini";
|
|
1803
|
+
var CursorCommandFrontmatterSchema = z9.looseObject({
|
|
1804
|
+
description: z9.optional(z9.string()),
|
|
1805
|
+
handoffs: z9.optional(
|
|
1806
|
+
z9.array(
|
|
1807
|
+
z9.looseObject({
|
|
1808
|
+
label: z9.string(),
|
|
1809
|
+
agent: z9.optional(z9.string()),
|
|
1810
|
+
prompt: z9.optional(z9.string()),
|
|
1811
|
+
send: z9.optional(z9.boolean())
|
|
1812
|
+
})
|
|
1813
|
+
)
|
|
1814
|
+
)
|
|
1815
|
+
});
|
|
1798
1816
|
var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
1817
|
+
frontmatter;
|
|
1818
|
+
body;
|
|
1819
|
+
constructor({ frontmatter, body, ...rest }) {
|
|
1820
|
+
if (rest.validate) {
|
|
1821
|
+
const result = CursorCommandFrontmatterSchema.safeParse(frontmatter);
|
|
1822
|
+
if (!result.success) {
|
|
1823
|
+
throw new Error(
|
|
1824
|
+
`Invalid frontmatter in ${join12(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
1825
|
+
);
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
super({
|
|
1829
|
+
...rest,
|
|
1830
|
+
fileContent: stringifyFrontmatter(body, frontmatter)
|
|
1831
|
+
});
|
|
1832
|
+
this.frontmatter = frontmatter;
|
|
1833
|
+
this.body = body;
|
|
1834
|
+
}
|
|
1799
1835
|
static getSettablePaths(_options = {}) {
|
|
1800
1836
|
return {
|
|
1801
1837
|
relativeDirPath: join12(".cursor", "commands")
|
|
1802
1838
|
};
|
|
1803
1839
|
}
|
|
1840
|
+
getBody() {
|
|
1841
|
+
return this.body;
|
|
1842
|
+
}
|
|
1843
|
+
getFrontmatter() {
|
|
1844
|
+
return this.frontmatter;
|
|
1845
|
+
}
|
|
1804
1846
|
toRulesyncCommand() {
|
|
1847
|
+
const { description = "", ...restFields } = this.frontmatter;
|
|
1805
1848
|
const rulesyncFrontmatter = {
|
|
1806
1849
|
targets: ["*"],
|
|
1807
|
-
description
|
|
1850
|
+
description,
|
|
1851
|
+
// Preserve extra fields in cursor section
|
|
1852
|
+
...Object.keys(restFields).length > 0 && { cursor: restFields }
|
|
1808
1853
|
};
|
|
1854
|
+
const fileContent = stringifyFrontmatter(this.body, rulesyncFrontmatter);
|
|
1809
1855
|
return new RulesyncCommand({
|
|
1810
|
-
baseDir:
|
|
1856
|
+
baseDir: ".",
|
|
1811
1857
|
// RulesyncCommand baseDir is always the project root directory
|
|
1812
1858
|
frontmatter: rulesyncFrontmatter,
|
|
1813
|
-
body: this.
|
|
1859
|
+
body: this.body,
|
|
1814
1860
|
relativeDirPath: RulesyncCommand.getSettablePaths().relativeDirPath,
|
|
1815
1861
|
relativeFilePath: this.relativeFilePath,
|
|
1816
|
-
fileContent
|
|
1862
|
+
fileContent,
|
|
1817
1863
|
validate: true
|
|
1818
1864
|
});
|
|
1819
1865
|
}
|
|
@@ -1823,20 +1869,38 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
|
1823
1869
|
validate = true,
|
|
1824
1870
|
global = false
|
|
1825
1871
|
}) {
|
|
1872
|
+
const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
|
|
1873
|
+
const cursorFields = rulesyncFrontmatter.cursor ?? {};
|
|
1874
|
+
const cursorFrontmatter = {
|
|
1875
|
+
...rulesyncFrontmatter.description && { description: rulesyncFrontmatter.description },
|
|
1876
|
+
...cursorFields
|
|
1877
|
+
};
|
|
1878
|
+
const body = rulesyncCommand.getBody();
|
|
1826
1879
|
const paths = this.getSettablePaths({ global });
|
|
1827
1880
|
return new _CursorCommand({
|
|
1828
1881
|
baseDir,
|
|
1829
|
-
|
|
1882
|
+
frontmatter: cursorFrontmatter,
|
|
1883
|
+
body,
|
|
1830
1884
|
relativeDirPath: paths.relativeDirPath,
|
|
1831
1885
|
relativeFilePath: rulesyncCommand.getRelativeFilePath(),
|
|
1832
1886
|
validate
|
|
1833
1887
|
});
|
|
1834
1888
|
}
|
|
1835
1889
|
validate() {
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1890
|
+
if (!this.frontmatter) {
|
|
1891
|
+
return { success: true, error: null };
|
|
1892
|
+
}
|
|
1893
|
+
const result = CursorCommandFrontmatterSchema.safeParse(this.frontmatter);
|
|
1894
|
+
if (result.success) {
|
|
1895
|
+
return { success: true, error: null };
|
|
1896
|
+
} else {
|
|
1897
|
+
return {
|
|
1898
|
+
success: false,
|
|
1899
|
+
error: new Error(
|
|
1900
|
+
`Invalid frontmatter in ${join12(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
1901
|
+
)
|
|
1902
|
+
};
|
|
1903
|
+
}
|
|
1840
1904
|
}
|
|
1841
1905
|
static isTargetedByRulesyncCommand(rulesyncCommand) {
|
|
1842
1906
|
return this.isTargetedByRulesyncCommandDefault({
|
|
@@ -1853,12 +1917,17 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
|
1853
1917
|
const paths = this.getSettablePaths({ global });
|
|
1854
1918
|
const filePath = join12(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1855
1919
|
const fileContent = await readFileContent(filePath);
|
|
1856
|
-
const { body: content } = parseFrontmatter(fileContent);
|
|
1920
|
+
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
1921
|
+
const result = CursorCommandFrontmatterSchema.safeParse(frontmatter);
|
|
1922
|
+
if (!result.success) {
|
|
1923
|
+
throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
|
|
1924
|
+
}
|
|
1857
1925
|
return new _CursorCommand({
|
|
1858
1926
|
baseDir,
|
|
1859
1927
|
relativeDirPath: paths.relativeDirPath,
|
|
1860
1928
|
relativeFilePath,
|
|
1861
|
-
|
|
1929
|
+
frontmatter: result.data,
|
|
1930
|
+
body: content.trim(),
|
|
1862
1931
|
validate
|
|
1863
1932
|
});
|
|
1864
1933
|
}
|
|
@@ -1871,7 +1940,8 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
|
1871
1940
|
baseDir,
|
|
1872
1941
|
relativeDirPath,
|
|
1873
1942
|
relativeFilePath,
|
|
1874
|
-
|
|
1943
|
+
frontmatter: {},
|
|
1944
|
+
body: "",
|
|
1875
1945
|
validate: false
|
|
1876
1946
|
});
|
|
1877
1947
|
}
|
|
@@ -1938,10 +2008,10 @@ var FactorydroidCommand = class _FactorydroidCommand extends SimulatedCommand {
|
|
|
1938
2008
|
// src/features/commands/geminicli-command.ts
|
|
1939
2009
|
import { join as join14 } from "path";
|
|
1940
2010
|
import { parse as parseToml } from "smol-toml";
|
|
1941
|
-
import { z as
|
|
1942
|
-
var GeminiCliCommandFrontmatterSchema =
|
|
1943
|
-
description:
|
|
1944
|
-
prompt:
|
|
2011
|
+
import { z as z10 } from "zod/mini";
|
|
2012
|
+
var GeminiCliCommandFrontmatterSchema = z10.looseObject({
|
|
2013
|
+
description: z10.optional(z10.string()),
|
|
2014
|
+
prompt: z10.string()
|
|
1945
2015
|
});
|
|
1946
2016
|
var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
|
|
1947
2017
|
frontmatter;
|
|
@@ -2244,12 +2314,12 @@ var KiroCommand = class _KiroCommand extends ToolCommand {
|
|
|
2244
2314
|
|
|
2245
2315
|
// src/features/commands/opencode-command.ts
|
|
2246
2316
|
import { join as join17 } from "path";
|
|
2247
|
-
import { optional as optional2, z as
|
|
2248
|
-
var OpenCodeCommandFrontmatterSchema =
|
|
2249
|
-
description:
|
|
2250
|
-
agent: optional2(
|
|
2251
|
-
subtask: optional2(
|
|
2252
|
-
model: optional2(
|
|
2317
|
+
import { optional as optional2, z as z11 } from "zod/mini";
|
|
2318
|
+
var OpenCodeCommandFrontmatterSchema = z11.looseObject({
|
|
2319
|
+
description: z11.string(),
|
|
2320
|
+
agent: optional2(z11.string()),
|
|
2321
|
+
subtask: optional2(z11.boolean()),
|
|
2322
|
+
model: optional2(z11.string())
|
|
2253
2323
|
});
|
|
2254
2324
|
var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
2255
2325
|
frontmatter;
|
|
@@ -2384,10 +2454,10 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
2384
2454
|
|
|
2385
2455
|
// src/features/commands/roo-command.ts
|
|
2386
2456
|
import { join as join18 } from "path";
|
|
2387
|
-
import { optional as optional3, z as
|
|
2388
|
-
var RooCommandFrontmatterSchema =
|
|
2389
|
-
description:
|
|
2390
|
-
"argument-hint": optional3(
|
|
2457
|
+
import { optional as optional3, z as z12 } from "zod/mini";
|
|
2458
|
+
var RooCommandFrontmatterSchema = z12.looseObject({
|
|
2459
|
+
description: z12.string(),
|
|
2460
|
+
"argument-hint": optional3(z12.string())
|
|
2391
2461
|
});
|
|
2392
2462
|
var RooCommand = class _RooCommand extends ToolCommand {
|
|
2393
2463
|
frontmatter;
|
|
@@ -2540,7 +2610,7 @@ var commandsProcessorToolTargetTuple = [
|
|
|
2540
2610
|
"opencode",
|
|
2541
2611
|
"roo"
|
|
2542
2612
|
];
|
|
2543
|
-
var CommandsProcessorToolTargetSchema =
|
|
2613
|
+
var CommandsProcessorToolTargetSchema = z13.enum(commandsProcessorToolTargetTuple);
|
|
2544
2614
|
var toolCommandFactories = /* @__PURE__ */ new Map([
|
|
2545
2615
|
[
|
|
2546
2616
|
"agentsmd",
|
|
@@ -2786,7 +2856,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
2786
2856
|
const firstOrigin = flattenedPathOrigins.get(flattenedPath);
|
|
2787
2857
|
if (firstOrigin && firstOrigin !== originalRelativePath) {
|
|
2788
2858
|
logger.warn(
|
|
2789
|
-
`Command path collision detected while flattening for ${this.toolTarget}: "${firstOrigin}" and "${originalRelativePath}" both map to "${flattenedPath}".
|
|
2859
|
+
`Command path collision detected while flattening for ${this.toolTarget}: "${firstOrigin}" and "${originalRelativePath}" both map to "${flattenedPath}". Only the last processed command will be used.`
|
|
2790
2860
|
);
|
|
2791
2861
|
} else if (!firstOrigin) {
|
|
2792
2862
|
flattenedPathOrigins.set(flattenedPath, originalRelativePath);
|
|
@@ -2907,26 +2977,26 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
2907
2977
|
};
|
|
2908
2978
|
|
|
2909
2979
|
// src/features/hooks/hooks-processor.ts
|
|
2910
|
-
import { z as
|
|
2980
|
+
import { z as z15 } from "zod/mini";
|
|
2911
2981
|
|
|
2912
2982
|
// src/types/hooks.ts
|
|
2913
|
-
import { z as
|
|
2983
|
+
import { z as z14 } from "zod/mini";
|
|
2914
2984
|
var CONTROL_CHARS = ["\n", "\r", "\0"];
|
|
2915
2985
|
var hasControlChars = (val) => CONTROL_CHARS.some((char) => val.includes(char));
|
|
2916
|
-
var safeString =
|
|
2917
|
-
|
|
2918
|
-
|
|
2986
|
+
var safeString = z14.pipe(
|
|
2987
|
+
z14.string(),
|
|
2988
|
+
z14.custom(
|
|
2919
2989
|
(val) => typeof val === "string" && !hasControlChars(val),
|
|
2920
2990
|
"must not contain newline, carriage return, or NUL characters"
|
|
2921
2991
|
)
|
|
2922
2992
|
);
|
|
2923
|
-
var HookDefinitionSchema =
|
|
2924
|
-
command:
|
|
2925
|
-
type:
|
|
2926
|
-
timeout:
|
|
2927
|
-
matcher:
|
|
2928
|
-
prompt:
|
|
2929
|
-
loop_limit:
|
|
2993
|
+
var HookDefinitionSchema = z14.looseObject({
|
|
2994
|
+
command: z14.optional(safeString),
|
|
2995
|
+
type: z14.optional(z14.enum(["command", "prompt"])),
|
|
2996
|
+
timeout: z14.optional(z14.number()),
|
|
2997
|
+
matcher: z14.optional(safeString),
|
|
2998
|
+
prompt: z14.optional(z14.string()),
|
|
2999
|
+
loop_limit: z14.optional(z14.nullable(z14.number()))
|
|
2930
3000
|
});
|
|
2931
3001
|
var CURSOR_HOOK_EVENTS = [
|
|
2932
3002
|
"sessionStart",
|
|
@@ -2985,14 +3055,14 @@ var FACTORYDROID_HOOK_EVENTS = [
|
|
|
2985
3055
|
"notification",
|
|
2986
3056
|
"setup"
|
|
2987
3057
|
];
|
|
2988
|
-
var hooksRecordSchema =
|
|
2989
|
-
var HooksConfigSchema =
|
|
2990
|
-
version:
|
|
3058
|
+
var hooksRecordSchema = z14.record(z14.string(), z14.array(HookDefinitionSchema));
|
|
3059
|
+
var HooksConfigSchema = z14.looseObject({
|
|
3060
|
+
version: z14.optional(z14.number()),
|
|
2991
3061
|
hooks: hooksRecordSchema,
|
|
2992
|
-
cursor:
|
|
2993
|
-
claudecode:
|
|
2994
|
-
opencode:
|
|
2995
|
-
factorydroid:
|
|
3062
|
+
cursor: z14.optional(z14.looseObject({ hooks: z14.optional(hooksRecordSchema) })),
|
|
3063
|
+
claudecode: z14.optional(z14.looseObject({ hooks: z14.optional(hooksRecordSchema) })),
|
|
3064
|
+
opencode: z14.optional(z14.looseObject({ hooks: z14.optional(hooksRecordSchema) })),
|
|
3065
|
+
factorydroid: z14.optional(z14.looseObject({ hooks: z14.optional(hooksRecordSchema) }))
|
|
2996
3066
|
});
|
|
2997
3067
|
var CANONICAL_TO_CLAUDE_EVENT_NAMES = {
|
|
2998
3068
|
sessionStart: "SessionStart",
|
|
@@ -3781,7 +3851,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
|
|
|
3781
3851
|
|
|
3782
3852
|
// src/features/hooks/hooks-processor.ts
|
|
3783
3853
|
var hooksProcessorToolTargetTuple = ["cursor", "claudecode", "opencode", "factorydroid"];
|
|
3784
|
-
var HooksProcessorToolTargetSchema =
|
|
3854
|
+
var HooksProcessorToolTargetSchema = z15.enum(hooksProcessorToolTargetTuple);
|
|
3785
3855
|
var toolHooksFactories = /* @__PURE__ */ new Map([
|
|
3786
3856
|
[
|
|
3787
3857
|
"cursor",
|
|
@@ -3957,7 +4027,7 @@ var HooksProcessor = class extends FeatureProcessor {
|
|
|
3957
4027
|
};
|
|
3958
4028
|
|
|
3959
4029
|
// src/features/ignore/ignore-processor.ts
|
|
3960
|
-
import { z as
|
|
4030
|
+
import { z as z16 } from "zod/mini";
|
|
3961
4031
|
|
|
3962
4032
|
// src/features/ignore/augmentcode-ignore.ts
|
|
3963
4033
|
import { join as join26 } from "path";
|
|
@@ -4134,8 +4204,8 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
4134
4204
|
};
|
|
4135
4205
|
|
|
4136
4206
|
// src/features/ignore/claudecode-ignore.ts
|
|
4137
|
-
import { uniq } from "es-toolkit";
|
|
4138
4207
|
import { join as join27 } from "path";
|
|
4208
|
+
import { uniq } from "es-toolkit";
|
|
4139
4209
|
var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
4140
4210
|
constructor(params) {
|
|
4141
4211
|
super(params);
|
|
@@ -4145,11 +4215,11 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
4145
4215
|
static getSettablePaths() {
|
|
4146
4216
|
return {
|
|
4147
4217
|
relativeDirPath: ".claude",
|
|
4148
|
-
relativeFilePath: "settings.
|
|
4218
|
+
relativeFilePath: "settings.json"
|
|
4149
4219
|
};
|
|
4150
4220
|
}
|
|
4151
4221
|
/**
|
|
4152
|
-
* ClaudecodeIgnore uses settings.
|
|
4222
|
+
* ClaudecodeIgnore uses settings.json, which can include non-ignore settings.
|
|
4153
4223
|
* It should not be deleted by rulesync.
|
|
4154
4224
|
*/
|
|
4155
4225
|
isDeletable() {
|
|
@@ -4429,8 +4499,75 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
4429
4499
|
}
|
|
4430
4500
|
};
|
|
4431
4501
|
|
|
4432
|
-
// src/features/ignore/
|
|
4502
|
+
// src/features/ignore/goose-ignore.ts
|
|
4433
4503
|
import { join as join31 } from "path";
|
|
4504
|
+
var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
4505
|
+
static getSettablePaths() {
|
|
4506
|
+
return {
|
|
4507
|
+
relativeDirPath: ".",
|
|
4508
|
+
relativeFilePath: ".gooseignore"
|
|
4509
|
+
};
|
|
4510
|
+
}
|
|
4511
|
+
/**
|
|
4512
|
+
* Convert GooseIgnore to RulesyncIgnore format
|
|
4513
|
+
*/
|
|
4514
|
+
toRulesyncIgnore() {
|
|
4515
|
+
return this.toRulesyncIgnoreDefault();
|
|
4516
|
+
}
|
|
4517
|
+
/**
|
|
4518
|
+
* Create GooseIgnore from RulesyncIgnore
|
|
4519
|
+
*/
|
|
4520
|
+
static fromRulesyncIgnore({
|
|
4521
|
+
baseDir = process.cwd(),
|
|
4522
|
+
rulesyncIgnore
|
|
4523
|
+
}) {
|
|
4524
|
+
const body = rulesyncIgnore.getFileContent();
|
|
4525
|
+
return new _GooseIgnore({
|
|
4526
|
+
baseDir,
|
|
4527
|
+
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
4528
|
+
relativeFilePath: this.getSettablePaths().relativeFilePath,
|
|
4529
|
+
fileContent: body
|
|
4530
|
+
});
|
|
4531
|
+
}
|
|
4532
|
+
/**
|
|
4533
|
+
* Load GooseIgnore from .gooseignore file
|
|
4534
|
+
*/
|
|
4535
|
+
static async fromFile({
|
|
4536
|
+
baseDir = process.cwd(),
|
|
4537
|
+
validate = true
|
|
4538
|
+
}) {
|
|
4539
|
+
const fileContent = await readFileContent(
|
|
4540
|
+
join31(
|
|
4541
|
+
baseDir,
|
|
4542
|
+
this.getSettablePaths().relativeDirPath,
|
|
4543
|
+
this.getSettablePaths().relativeFilePath
|
|
4544
|
+
)
|
|
4545
|
+
);
|
|
4546
|
+
return new _GooseIgnore({
|
|
4547
|
+
baseDir,
|
|
4548
|
+
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
4549
|
+
relativeFilePath: this.getSettablePaths().relativeFilePath,
|
|
4550
|
+
fileContent,
|
|
4551
|
+
validate
|
|
4552
|
+
});
|
|
4553
|
+
}
|
|
4554
|
+
static forDeletion({
|
|
4555
|
+
baseDir = process.cwd(),
|
|
4556
|
+
relativeDirPath,
|
|
4557
|
+
relativeFilePath
|
|
4558
|
+
}) {
|
|
4559
|
+
return new _GooseIgnore({
|
|
4560
|
+
baseDir,
|
|
4561
|
+
relativeDirPath,
|
|
4562
|
+
relativeFilePath,
|
|
4563
|
+
fileContent: "",
|
|
4564
|
+
validate: false
|
|
4565
|
+
});
|
|
4566
|
+
}
|
|
4567
|
+
};
|
|
4568
|
+
|
|
4569
|
+
// src/features/ignore/junie-ignore.ts
|
|
4570
|
+
import { join as join32 } from "path";
|
|
4434
4571
|
var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
4435
4572
|
static getSettablePaths() {
|
|
4436
4573
|
return {
|
|
@@ -4457,7 +4594,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
4457
4594
|
validate = true
|
|
4458
4595
|
}) {
|
|
4459
4596
|
const fileContent = await readFileContent(
|
|
4460
|
-
|
|
4597
|
+
join32(
|
|
4461
4598
|
baseDir,
|
|
4462
4599
|
this.getSettablePaths().relativeDirPath,
|
|
4463
4600
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4487,7 +4624,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
4487
4624
|
};
|
|
4488
4625
|
|
|
4489
4626
|
// src/features/ignore/kilo-ignore.ts
|
|
4490
|
-
import { join as
|
|
4627
|
+
import { join as join33 } from "path";
|
|
4491
4628
|
var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
4492
4629
|
static getSettablePaths() {
|
|
4493
4630
|
return {
|
|
@@ -4524,7 +4661,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
|
4524
4661
|
validate = true
|
|
4525
4662
|
}) {
|
|
4526
4663
|
const fileContent = await readFileContent(
|
|
4527
|
-
|
|
4664
|
+
join33(
|
|
4528
4665
|
baseDir,
|
|
4529
4666
|
this.getSettablePaths().relativeDirPath,
|
|
4530
4667
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4554,7 +4691,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
|
4554
4691
|
};
|
|
4555
4692
|
|
|
4556
4693
|
// src/features/ignore/kiro-ignore.ts
|
|
4557
|
-
import { join as
|
|
4694
|
+
import { join as join34 } from "path";
|
|
4558
4695
|
var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
4559
4696
|
static getSettablePaths() {
|
|
4560
4697
|
return {
|
|
@@ -4581,7 +4718,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
4581
4718
|
validate = true
|
|
4582
4719
|
}) {
|
|
4583
4720
|
const fileContent = await readFileContent(
|
|
4584
|
-
|
|
4721
|
+
join34(
|
|
4585
4722
|
baseDir,
|
|
4586
4723
|
this.getSettablePaths().relativeDirPath,
|
|
4587
4724
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4611,7 +4748,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
4611
4748
|
};
|
|
4612
4749
|
|
|
4613
4750
|
// src/features/ignore/qwencode-ignore.ts
|
|
4614
|
-
import { join as
|
|
4751
|
+
import { join as join35 } from "path";
|
|
4615
4752
|
var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
4616
4753
|
static getSettablePaths() {
|
|
4617
4754
|
return {
|
|
@@ -4638,7 +4775,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
4638
4775
|
validate = true
|
|
4639
4776
|
}) {
|
|
4640
4777
|
const fileContent = await readFileContent(
|
|
4641
|
-
|
|
4778
|
+
join35(
|
|
4642
4779
|
baseDir,
|
|
4643
4780
|
this.getSettablePaths().relativeDirPath,
|
|
4644
4781
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4668,7 +4805,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
4668
4805
|
};
|
|
4669
4806
|
|
|
4670
4807
|
// src/features/ignore/roo-ignore.ts
|
|
4671
|
-
import { join as
|
|
4808
|
+
import { join as join36 } from "path";
|
|
4672
4809
|
var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
4673
4810
|
static getSettablePaths() {
|
|
4674
4811
|
return {
|
|
@@ -4695,7 +4832,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
4695
4832
|
validate = true
|
|
4696
4833
|
}) {
|
|
4697
4834
|
const fileContent = await readFileContent(
|
|
4698
|
-
|
|
4835
|
+
join36(
|
|
4699
4836
|
baseDir,
|
|
4700
4837
|
this.getSettablePaths().relativeDirPath,
|
|
4701
4838
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4725,7 +4862,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
4725
4862
|
};
|
|
4726
4863
|
|
|
4727
4864
|
// src/features/ignore/windsurf-ignore.ts
|
|
4728
|
-
import { join as
|
|
4865
|
+
import { join as join37 } from "path";
|
|
4729
4866
|
var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
4730
4867
|
static getSettablePaths() {
|
|
4731
4868
|
return {
|
|
@@ -4752,7 +4889,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
4752
4889
|
validate = true
|
|
4753
4890
|
}) {
|
|
4754
4891
|
const fileContent = await readFileContent(
|
|
4755
|
-
|
|
4892
|
+
join37(
|
|
4756
4893
|
baseDir,
|
|
4757
4894
|
this.getSettablePaths().relativeDirPath,
|
|
4758
4895
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4782,8 +4919,8 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
4782
4919
|
};
|
|
4783
4920
|
|
|
4784
4921
|
// src/features/ignore/zed-ignore.ts
|
|
4922
|
+
import { join as join38 } from "path";
|
|
4785
4923
|
import { uniq as uniq2 } from "es-toolkit";
|
|
4786
|
-
import { join as join37 } from "path";
|
|
4787
4924
|
var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
4788
4925
|
constructor(params) {
|
|
4789
4926
|
super(params);
|
|
@@ -4819,7 +4956,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
|
4819
4956
|
}) {
|
|
4820
4957
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
4821
4958
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
4822
|
-
const filePath =
|
|
4959
|
+
const filePath = join38(
|
|
4823
4960
|
baseDir,
|
|
4824
4961
|
this.getSettablePaths().relativeDirPath,
|
|
4825
4962
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4846,7 +4983,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
|
4846
4983
|
validate = true
|
|
4847
4984
|
}) {
|
|
4848
4985
|
const fileContent = await readFileContent(
|
|
4849
|
-
|
|
4986
|
+
join38(
|
|
4850
4987
|
baseDir,
|
|
4851
4988
|
this.getSettablePaths().relativeDirPath,
|
|
4852
4989
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4883,6 +5020,7 @@ var ignoreProcessorToolTargets = [
|
|
|
4883
5020
|
"cline",
|
|
4884
5021
|
"cursor",
|
|
4885
5022
|
"geminicli",
|
|
5023
|
+
"goose",
|
|
4886
5024
|
"junie",
|
|
4887
5025
|
"kilo",
|
|
4888
5026
|
"kiro",
|
|
@@ -4891,7 +5029,7 @@ var ignoreProcessorToolTargets = [
|
|
|
4891
5029
|
"windsurf",
|
|
4892
5030
|
"zed"
|
|
4893
5031
|
];
|
|
4894
|
-
var IgnoreProcessorToolTargetSchema =
|
|
5032
|
+
var IgnoreProcessorToolTargetSchema = z16.enum(ignoreProcessorToolTargets);
|
|
4895
5033
|
var toolIgnoreFactories = /* @__PURE__ */ new Map([
|
|
4896
5034
|
["augmentcode", { class: AugmentcodeIgnore }],
|
|
4897
5035
|
["claudecode", { class: ClaudecodeIgnore }],
|
|
@@ -4899,6 +5037,7 @@ var toolIgnoreFactories = /* @__PURE__ */ new Map([
|
|
|
4899
5037
|
["cline", { class: ClineIgnore }],
|
|
4900
5038
|
["cursor", { class: CursorIgnore }],
|
|
4901
5039
|
["geminicli", { class: GeminiCliIgnore }],
|
|
5040
|
+
["goose", { class: GooseIgnore }],
|
|
4902
5041
|
["junie", { class: JunieIgnore }],
|
|
4903
5042
|
["kilo", { class: KiloIgnore }],
|
|
4904
5043
|
["kiro", { class: KiroIgnore }],
|
|
@@ -5028,49 +5167,49 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
5028
5167
|
};
|
|
5029
5168
|
|
|
5030
5169
|
// src/features/mcp/mcp-processor.ts
|
|
5031
|
-
import { z as
|
|
5170
|
+
import { z as z20 } from "zod/mini";
|
|
5032
5171
|
|
|
5033
5172
|
// src/features/mcp/claudecode-mcp.ts
|
|
5034
|
-
import { join as
|
|
5173
|
+
import { join as join40 } from "path";
|
|
5035
5174
|
|
|
5036
5175
|
// src/features/mcp/rulesync-mcp.ts
|
|
5176
|
+
import { join as join39 } from "path";
|
|
5037
5177
|
import { omit } from "es-toolkit/object";
|
|
5038
|
-
import {
|
|
5039
|
-
import { z as z17 } from "zod/mini";
|
|
5178
|
+
import { z as z18 } from "zod/mini";
|
|
5040
5179
|
|
|
5041
5180
|
// src/types/mcp.ts
|
|
5042
|
-
import { z as
|
|
5043
|
-
var McpServerSchema =
|
|
5044
|
-
type:
|
|
5045
|
-
command:
|
|
5046
|
-
args:
|
|
5047
|
-
url:
|
|
5048
|
-
httpUrl:
|
|
5049
|
-
env:
|
|
5050
|
-
disabled:
|
|
5051
|
-
networkTimeout:
|
|
5052
|
-
timeout:
|
|
5053
|
-
trust:
|
|
5054
|
-
cwd:
|
|
5055
|
-
transport:
|
|
5056
|
-
alwaysAllow:
|
|
5057
|
-
tools:
|
|
5058
|
-
kiroAutoApprove:
|
|
5059
|
-
kiroAutoBlock:
|
|
5060
|
-
headers:
|
|
5061
|
-
enabledTools:
|
|
5062
|
-
disabledTools:
|
|
5181
|
+
import { z as z17 } from "zod/mini";
|
|
5182
|
+
var McpServerSchema = z17.object({
|
|
5183
|
+
type: z17.optional(z17.enum(["stdio", "sse", "http"])),
|
|
5184
|
+
command: z17.optional(z17.union([z17.string(), z17.array(z17.string())])),
|
|
5185
|
+
args: z17.optional(z17.array(z17.string())),
|
|
5186
|
+
url: z17.optional(z17.string()),
|
|
5187
|
+
httpUrl: z17.optional(z17.string()),
|
|
5188
|
+
env: z17.optional(z17.record(z17.string(), z17.string())),
|
|
5189
|
+
disabled: z17.optional(z17.boolean()),
|
|
5190
|
+
networkTimeout: z17.optional(z17.number()),
|
|
5191
|
+
timeout: z17.optional(z17.number()),
|
|
5192
|
+
trust: z17.optional(z17.boolean()),
|
|
5193
|
+
cwd: z17.optional(z17.string()),
|
|
5194
|
+
transport: z17.optional(z17.enum(["stdio", "sse", "http"])),
|
|
5195
|
+
alwaysAllow: z17.optional(z17.array(z17.string())),
|
|
5196
|
+
tools: z17.optional(z17.array(z17.string())),
|
|
5197
|
+
kiroAutoApprove: z17.optional(z17.array(z17.string())),
|
|
5198
|
+
kiroAutoBlock: z17.optional(z17.array(z17.string())),
|
|
5199
|
+
headers: z17.optional(z17.record(z17.string(), z17.string())),
|
|
5200
|
+
enabledTools: z17.optional(z17.array(z17.string())),
|
|
5201
|
+
disabledTools: z17.optional(z17.array(z17.string()))
|
|
5063
5202
|
});
|
|
5064
|
-
var McpServersSchema =
|
|
5203
|
+
var McpServersSchema = z17.record(z17.string(), McpServerSchema);
|
|
5065
5204
|
|
|
5066
5205
|
// src/features/mcp/rulesync-mcp.ts
|
|
5067
|
-
var RulesyncMcpServerSchema =
|
|
5068
|
-
targets:
|
|
5069
|
-
description:
|
|
5070
|
-
exposed:
|
|
5206
|
+
var RulesyncMcpServerSchema = z18.extend(McpServerSchema, {
|
|
5207
|
+
targets: z18.optional(RulesyncTargetsSchema),
|
|
5208
|
+
description: z18.optional(z18.string()),
|
|
5209
|
+
exposed: z18.optional(z18.boolean())
|
|
5071
5210
|
});
|
|
5072
|
-
var RulesyncMcpConfigSchema =
|
|
5073
|
-
mcpServers:
|
|
5211
|
+
var RulesyncMcpConfigSchema = z18.object({
|
|
5212
|
+
mcpServers: z18.record(z18.string(), RulesyncMcpServerSchema)
|
|
5074
5213
|
});
|
|
5075
5214
|
var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
5076
5215
|
json;
|
|
@@ -5106,12 +5245,12 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
5106
5245
|
static async fromFile({ validate = true }) {
|
|
5107
5246
|
const baseDir = process.cwd();
|
|
5108
5247
|
const paths = this.getSettablePaths();
|
|
5109
|
-
const recommendedPath =
|
|
5248
|
+
const recommendedPath = join39(
|
|
5110
5249
|
baseDir,
|
|
5111
5250
|
paths.recommended.relativeDirPath,
|
|
5112
5251
|
paths.recommended.relativeFilePath
|
|
5113
5252
|
);
|
|
5114
|
-
const legacyPath =
|
|
5253
|
+
const legacyPath = join39(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
5115
5254
|
if (await fileExists(recommendedPath)) {
|
|
5116
5255
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
5117
5256
|
return new _RulesyncMcp({
|
|
@@ -5256,7 +5395,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
5256
5395
|
global = false
|
|
5257
5396
|
}) {
|
|
5258
5397
|
const paths = this.getSettablePaths({ global });
|
|
5259
|
-
const fileContent = await readFileContentOrNull(
|
|
5398
|
+
const fileContent = await readFileContentOrNull(join40(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
5260
5399
|
const json = JSON.parse(fileContent);
|
|
5261
5400
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
5262
5401
|
return new _ClaudecodeMcp({
|
|
@@ -5275,7 +5414,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
5275
5414
|
}) {
|
|
5276
5415
|
const paths = this.getSettablePaths({ global });
|
|
5277
5416
|
const fileContent = await readOrInitializeFileContent(
|
|
5278
|
-
|
|
5417
|
+
join40(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
5279
5418
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
5280
5419
|
);
|
|
5281
5420
|
const json = JSON.parse(fileContent);
|
|
@@ -5314,7 +5453,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
5314
5453
|
};
|
|
5315
5454
|
|
|
5316
5455
|
// src/features/mcp/cline-mcp.ts
|
|
5317
|
-
import { join as
|
|
5456
|
+
import { join as join41 } from "path";
|
|
5318
5457
|
var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
5319
5458
|
json;
|
|
5320
5459
|
constructor(params) {
|
|
@@ -5335,7 +5474,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
5335
5474
|
validate = true
|
|
5336
5475
|
}) {
|
|
5337
5476
|
const fileContent = await readFileContent(
|
|
5338
|
-
|
|
5477
|
+
join41(
|
|
5339
5478
|
baseDir,
|
|
5340
5479
|
this.getSettablePaths().relativeDirPath,
|
|
5341
5480
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5384,7 +5523,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
5384
5523
|
};
|
|
5385
5524
|
|
|
5386
5525
|
// src/features/mcp/codexcli-mcp.ts
|
|
5387
|
-
import { join as
|
|
5526
|
+
import { join as join42 } from "path";
|
|
5388
5527
|
import * as smolToml from "smol-toml";
|
|
5389
5528
|
function convertFromCodexFormat(codexMcp) {
|
|
5390
5529
|
const result = {};
|
|
@@ -5467,7 +5606,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
5467
5606
|
global = false
|
|
5468
5607
|
}) {
|
|
5469
5608
|
const paths = this.getSettablePaths({ global });
|
|
5470
|
-
const fileContent = await readFileContentOrNull(
|
|
5609
|
+
const fileContent = await readFileContentOrNull(join42(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
|
|
5471
5610
|
return new _CodexcliMcp({
|
|
5472
5611
|
baseDir,
|
|
5473
5612
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -5483,7 +5622,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
5483
5622
|
global = false
|
|
5484
5623
|
}) {
|
|
5485
5624
|
const paths = this.getSettablePaths({ global });
|
|
5486
|
-
const configTomlFilePath =
|
|
5625
|
+
const configTomlFilePath = join42(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
5487
5626
|
const configTomlFileContent = await readOrInitializeFileContent(
|
|
5488
5627
|
configTomlFilePath,
|
|
5489
5628
|
smolToml.stringify({})
|
|
@@ -5540,7 +5679,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
5540
5679
|
};
|
|
5541
5680
|
|
|
5542
5681
|
// src/features/mcp/copilot-mcp.ts
|
|
5543
|
-
import { join as
|
|
5682
|
+
import { join as join43 } from "path";
|
|
5544
5683
|
function convertToCopilotFormat(mcpServers) {
|
|
5545
5684
|
return { servers: mcpServers };
|
|
5546
5685
|
}
|
|
@@ -5567,7 +5706,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
5567
5706
|
validate = true
|
|
5568
5707
|
}) {
|
|
5569
5708
|
const fileContent = await readFileContent(
|
|
5570
|
-
|
|
5709
|
+
join43(
|
|
5571
5710
|
baseDir,
|
|
5572
5711
|
this.getSettablePaths().relativeDirPath,
|
|
5573
5712
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5620,7 +5759,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
5620
5759
|
};
|
|
5621
5760
|
|
|
5622
5761
|
// src/features/mcp/cursor-mcp.ts
|
|
5623
|
-
import { join as
|
|
5762
|
+
import { join as join44 } from "path";
|
|
5624
5763
|
var CURSOR_ENV_VAR_PATTERN = /\$\{env:([^}]+)\}/g;
|
|
5625
5764
|
function isMcpServers(value) {
|
|
5626
5765
|
return value !== void 0 && value !== null && typeof value === "object";
|
|
@@ -5681,7 +5820,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
5681
5820
|
validate = true
|
|
5682
5821
|
}) {
|
|
5683
5822
|
const fileContent = await readFileContent(
|
|
5684
|
-
|
|
5823
|
+
join44(
|
|
5685
5824
|
baseDir,
|
|
5686
5825
|
this.getSettablePaths().relativeDirPath,
|
|
5687
5826
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5749,7 +5888,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
5749
5888
|
};
|
|
5750
5889
|
|
|
5751
5890
|
// src/features/mcp/factorydroid-mcp.ts
|
|
5752
|
-
import { join as
|
|
5891
|
+
import { join as join45 } from "path";
|
|
5753
5892
|
var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
5754
5893
|
json;
|
|
5755
5894
|
constructor(params) {
|
|
@@ -5770,7 +5909,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
5770
5909
|
validate = true
|
|
5771
5910
|
}) {
|
|
5772
5911
|
const fileContent = await readFileContent(
|
|
5773
|
-
|
|
5912
|
+
join45(
|
|
5774
5913
|
baseDir,
|
|
5775
5914
|
this.getSettablePaths().relativeDirPath,
|
|
5776
5915
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5830,7 +5969,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
5830
5969
|
};
|
|
5831
5970
|
|
|
5832
5971
|
// src/features/mcp/geminicli-mcp.ts
|
|
5833
|
-
import { join as
|
|
5972
|
+
import { join as join46 } from "path";
|
|
5834
5973
|
var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
5835
5974
|
json;
|
|
5836
5975
|
constructor(params) {
|
|
@@ -5858,7 +5997,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
5858
5997
|
global = false
|
|
5859
5998
|
}) {
|
|
5860
5999
|
const paths = this.getSettablePaths({ global });
|
|
5861
|
-
const fileContent = await readFileContentOrNull(
|
|
6000
|
+
const fileContent = await readFileContentOrNull(join46(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
5862
6001
|
const json = JSON.parse(fileContent);
|
|
5863
6002
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
5864
6003
|
return new _GeminiCliMcp({
|
|
@@ -5877,7 +6016,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
5877
6016
|
}) {
|
|
5878
6017
|
const paths = this.getSettablePaths({ global });
|
|
5879
6018
|
const fileContent = await readOrInitializeFileContent(
|
|
5880
|
-
|
|
6019
|
+
join46(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
5881
6020
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
5882
6021
|
);
|
|
5883
6022
|
const json = JSON.parse(fileContent);
|
|
@@ -5922,7 +6061,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
5922
6061
|
};
|
|
5923
6062
|
|
|
5924
6063
|
// src/features/mcp/junie-mcp.ts
|
|
5925
|
-
import { join as
|
|
6064
|
+
import { join as join47 } from "path";
|
|
5926
6065
|
var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
5927
6066
|
json;
|
|
5928
6067
|
constructor(params) {
|
|
@@ -5934,7 +6073,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
5934
6073
|
}
|
|
5935
6074
|
static getSettablePaths() {
|
|
5936
6075
|
return {
|
|
5937
|
-
relativeDirPath:
|
|
6076
|
+
relativeDirPath: join47(".junie", "mcp"),
|
|
5938
6077
|
relativeFilePath: "mcp.json"
|
|
5939
6078
|
};
|
|
5940
6079
|
}
|
|
@@ -5943,7 +6082,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
5943
6082
|
validate = true
|
|
5944
6083
|
}) {
|
|
5945
6084
|
const fileContent = await readFileContent(
|
|
5946
|
-
|
|
6085
|
+
join47(
|
|
5947
6086
|
baseDir,
|
|
5948
6087
|
this.getSettablePaths().relativeDirPath,
|
|
5949
6088
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5992,7 +6131,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
5992
6131
|
};
|
|
5993
6132
|
|
|
5994
6133
|
// src/features/mcp/kilo-mcp.ts
|
|
5995
|
-
import { join as
|
|
6134
|
+
import { join as join48 } from "path";
|
|
5996
6135
|
var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
5997
6136
|
json;
|
|
5998
6137
|
constructor(params) {
|
|
@@ -6013,7 +6152,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
6013
6152
|
validate = true
|
|
6014
6153
|
}) {
|
|
6015
6154
|
const paths = this.getSettablePaths();
|
|
6016
|
-
const fileContent = await readFileContentOrNull(
|
|
6155
|
+
const fileContent = await readFileContentOrNull(join48(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6017
6156
|
return new _KiloMcp({
|
|
6018
6157
|
baseDir,
|
|
6019
6158
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -6061,7 +6200,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
6061
6200
|
};
|
|
6062
6201
|
|
|
6063
6202
|
// src/features/mcp/kiro-mcp.ts
|
|
6064
|
-
import { join as
|
|
6203
|
+
import { join as join49 } from "path";
|
|
6065
6204
|
var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
6066
6205
|
json;
|
|
6067
6206
|
constructor(params) {
|
|
@@ -6073,7 +6212,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
6073
6212
|
}
|
|
6074
6213
|
static getSettablePaths() {
|
|
6075
6214
|
return {
|
|
6076
|
-
relativeDirPath:
|
|
6215
|
+
relativeDirPath: join49(".kiro", "settings"),
|
|
6077
6216
|
relativeFilePath: "mcp.json"
|
|
6078
6217
|
};
|
|
6079
6218
|
}
|
|
@@ -6082,7 +6221,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
6082
6221
|
validate = true
|
|
6083
6222
|
}) {
|
|
6084
6223
|
const paths = this.getSettablePaths();
|
|
6085
|
-
const fileContent = await readFileContentOrNull(
|
|
6224
|
+
const fileContent = await readFileContentOrNull(join49(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6086
6225
|
return new _KiroMcp({
|
|
6087
6226
|
baseDir,
|
|
6088
6227
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -6130,29 +6269,29 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
6130
6269
|
};
|
|
6131
6270
|
|
|
6132
6271
|
// src/features/mcp/opencode-mcp.ts
|
|
6133
|
-
import { join as
|
|
6134
|
-
import { z as
|
|
6135
|
-
var OpencodeMcpLocalServerSchema =
|
|
6136
|
-
type:
|
|
6137
|
-
command:
|
|
6138
|
-
environment:
|
|
6139
|
-
enabled:
|
|
6140
|
-
cwd:
|
|
6272
|
+
import { join as join50 } from "path";
|
|
6273
|
+
import { z as z19 } from "zod/mini";
|
|
6274
|
+
var OpencodeMcpLocalServerSchema = z19.object({
|
|
6275
|
+
type: z19.literal("local"),
|
|
6276
|
+
command: z19.array(z19.string()),
|
|
6277
|
+
environment: z19.optional(z19.record(z19.string(), z19.string())),
|
|
6278
|
+
enabled: z19._default(z19.boolean(), true),
|
|
6279
|
+
cwd: z19.optional(z19.string())
|
|
6141
6280
|
});
|
|
6142
|
-
var OpencodeMcpRemoteServerSchema =
|
|
6143
|
-
type:
|
|
6144
|
-
url:
|
|
6145
|
-
headers:
|
|
6146
|
-
enabled:
|
|
6281
|
+
var OpencodeMcpRemoteServerSchema = z19.object({
|
|
6282
|
+
type: z19.literal("remote"),
|
|
6283
|
+
url: z19.string(),
|
|
6284
|
+
headers: z19.optional(z19.record(z19.string(), z19.string())),
|
|
6285
|
+
enabled: z19._default(z19.boolean(), true)
|
|
6147
6286
|
});
|
|
6148
|
-
var OpencodeMcpServerSchema =
|
|
6287
|
+
var OpencodeMcpServerSchema = z19.union([
|
|
6149
6288
|
OpencodeMcpLocalServerSchema,
|
|
6150
6289
|
OpencodeMcpRemoteServerSchema
|
|
6151
6290
|
]);
|
|
6152
|
-
var OpencodeConfigSchema =
|
|
6153
|
-
$schema:
|
|
6154
|
-
mcp:
|
|
6155
|
-
tools:
|
|
6291
|
+
var OpencodeConfigSchema = z19.looseObject({
|
|
6292
|
+
$schema: z19.optional(z19.string()),
|
|
6293
|
+
mcp: z19.optional(z19.record(z19.string(), OpencodeMcpServerSchema)),
|
|
6294
|
+
tools: z19.optional(z19.record(z19.string(), z19.boolean()))
|
|
6156
6295
|
});
|
|
6157
6296
|
function convertFromOpencodeFormat(opencodeMcp, tools) {
|
|
6158
6297
|
return Object.fromEntries(
|
|
@@ -6270,7 +6409,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
6270
6409
|
static getSettablePaths({ global } = {}) {
|
|
6271
6410
|
if (global) {
|
|
6272
6411
|
return {
|
|
6273
|
-
relativeDirPath:
|
|
6412
|
+
relativeDirPath: join50(".config", "opencode"),
|
|
6274
6413
|
relativeFilePath: "opencode.json"
|
|
6275
6414
|
};
|
|
6276
6415
|
}
|
|
@@ -6285,7 +6424,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
6285
6424
|
global = false
|
|
6286
6425
|
}) {
|
|
6287
6426
|
const paths = this.getSettablePaths({ global });
|
|
6288
|
-
const fileContent = await readFileContentOrNull(
|
|
6427
|
+
const fileContent = await readFileContentOrNull(join50(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcp":{}}';
|
|
6289
6428
|
const json = JSON.parse(fileContent);
|
|
6290
6429
|
const newJson = { ...json, mcp: json.mcp ?? {} };
|
|
6291
6430
|
return new _OpencodeMcp({
|
|
@@ -6304,7 +6443,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
6304
6443
|
}) {
|
|
6305
6444
|
const paths = this.getSettablePaths({ global });
|
|
6306
6445
|
const fileContent = await readOrInitializeFileContent(
|
|
6307
|
-
|
|
6446
|
+
join50(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
6308
6447
|
JSON.stringify({ mcp: {} }, null, 2)
|
|
6309
6448
|
);
|
|
6310
6449
|
const json = JSON.parse(fileContent);
|
|
@@ -6357,7 +6496,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
6357
6496
|
};
|
|
6358
6497
|
|
|
6359
6498
|
// src/features/mcp/roo-mcp.ts
|
|
6360
|
-
import { join as
|
|
6499
|
+
import { join as join51 } from "path";
|
|
6361
6500
|
function isRooMcpServers(value) {
|
|
6362
6501
|
return value !== void 0 && value !== null && typeof value === "object";
|
|
6363
6502
|
}
|
|
@@ -6409,7 +6548,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
6409
6548
|
validate = true
|
|
6410
6549
|
}) {
|
|
6411
6550
|
const fileContent = await readFileContent(
|
|
6412
|
-
|
|
6551
|
+
join51(
|
|
6413
6552
|
baseDir,
|
|
6414
6553
|
this.getSettablePaths().relativeDirPath,
|
|
6415
6554
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6480,7 +6619,7 @@ var mcpProcessorToolTargetTuple = [
|
|
|
6480
6619
|
"opencode",
|
|
6481
6620
|
"roo"
|
|
6482
6621
|
];
|
|
6483
|
-
var McpProcessorToolTargetSchema =
|
|
6622
|
+
var McpProcessorToolTargetSchema = z20.enum(mcpProcessorToolTargetTuple);
|
|
6484
6623
|
var toolMcpFactories = /* @__PURE__ */ new Map([
|
|
6485
6624
|
[
|
|
6486
6625
|
"claudecode",
|
|
@@ -6744,11 +6883,11 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
6744
6883
|
}
|
|
6745
6884
|
const factory = this.getFactory(this.toolTarget);
|
|
6746
6885
|
const toolMcps = await Promise.all(
|
|
6747
|
-
[rulesyncMcp].map(async (
|
|
6886
|
+
[rulesyncMcp].map(async (mcp) => {
|
|
6748
6887
|
const fieldsToStrip = [];
|
|
6749
6888
|
if (!factory.meta.supportsEnabledTools) fieldsToStrip.push("enabledTools");
|
|
6750
6889
|
if (!factory.meta.supportsDisabledTools) fieldsToStrip.push("disabledTools");
|
|
6751
|
-
const filteredRulesyncMcp =
|
|
6890
|
+
const filteredRulesyncMcp = mcp.stripMcpServerFields(fieldsToStrip);
|
|
6752
6891
|
return await factory.class.fromRulesyncMcp({
|
|
6753
6892
|
baseDir: this.baseDir,
|
|
6754
6893
|
rulesyncMcp: filteredRulesyncMcp,
|
|
@@ -6782,25 +6921,25 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
6782
6921
|
};
|
|
6783
6922
|
|
|
6784
6923
|
// src/features/rules/rules-processor.ts
|
|
6924
|
+
import { basename as basename10, join as join111, relative as relative5 } from "path";
|
|
6785
6925
|
import { encode } from "@toon-format/toon";
|
|
6786
|
-
import {
|
|
6787
|
-
import { z as z50 } from "zod/mini";
|
|
6926
|
+
import { z as z52 } from "zod/mini";
|
|
6788
6927
|
|
|
6789
6928
|
// src/constants/general.ts
|
|
6790
6929
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
6791
6930
|
|
|
6792
6931
|
// src/features/skills/agentsmd-skill.ts
|
|
6793
|
-
import { join as
|
|
6932
|
+
import { join as join55 } from "path";
|
|
6794
6933
|
|
|
6795
6934
|
// src/features/skills/simulated-skill.ts
|
|
6796
|
-
import { join as
|
|
6797
|
-
import { z as
|
|
6935
|
+
import { join as join54 } from "path";
|
|
6936
|
+
import { z as z21 } from "zod/mini";
|
|
6798
6937
|
|
|
6799
6938
|
// src/features/skills/tool-skill.ts
|
|
6800
|
-
import { join as
|
|
6939
|
+
import { join as join53 } from "path";
|
|
6801
6940
|
|
|
6802
6941
|
// src/types/ai-dir.ts
|
|
6803
|
-
import path2, { basename as basename3, join as
|
|
6942
|
+
import path2, { basename as basename3, join as join52, relative as relative4, resolve as resolve4 } from "path";
|
|
6804
6943
|
var AiDir = class {
|
|
6805
6944
|
/**
|
|
6806
6945
|
* @example "."
|
|
@@ -6894,8 +7033,8 @@ var AiDir = class {
|
|
|
6894
7033
|
* @returns Array of files with their relative paths and buffers
|
|
6895
7034
|
*/
|
|
6896
7035
|
static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
|
|
6897
|
-
const dirPath =
|
|
6898
|
-
const glob =
|
|
7036
|
+
const dirPath = join52(baseDir, relativeDirPath, dirName);
|
|
7037
|
+
const glob = join52(dirPath, "**", "*");
|
|
6899
7038
|
const filePaths = await findFilesByGlobs(glob, { type: "file" });
|
|
6900
7039
|
const filteredPaths = filePaths.filter((filePath) => basename3(filePath) !== excludeFileName);
|
|
6901
7040
|
const files = await Promise.all(
|
|
@@ -6993,8 +7132,8 @@ var ToolSkill = class extends AiDir {
|
|
|
6993
7132
|
}) {
|
|
6994
7133
|
const settablePaths = getSettablePaths({ global });
|
|
6995
7134
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
6996
|
-
const skillDirPath =
|
|
6997
|
-
const skillFilePath =
|
|
7135
|
+
const skillDirPath = join53(baseDir, actualRelativeDirPath, dirName);
|
|
7136
|
+
const skillFilePath = join53(skillDirPath, SKILL_FILE_NAME);
|
|
6998
7137
|
if (!await fileExists(skillFilePath)) {
|
|
6999
7138
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
7000
7139
|
}
|
|
@@ -7018,16 +7157,16 @@ var ToolSkill = class extends AiDir {
|
|
|
7018
7157
|
}
|
|
7019
7158
|
requireMainFileFrontmatter() {
|
|
7020
7159
|
if (!this.mainFile?.frontmatter) {
|
|
7021
|
-
throw new Error(`Frontmatter is not defined in ${
|
|
7160
|
+
throw new Error(`Frontmatter is not defined in ${join53(this.relativeDirPath, this.dirName)}`);
|
|
7022
7161
|
}
|
|
7023
7162
|
return this.mainFile.frontmatter;
|
|
7024
7163
|
}
|
|
7025
7164
|
};
|
|
7026
7165
|
|
|
7027
7166
|
// src/features/skills/simulated-skill.ts
|
|
7028
|
-
var SimulatedSkillFrontmatterSchema =
|
|
7029
|
-
name:
|
|
7030
|
-
description:
|
|
7167
|
+
var SimulatedSkillFrontmatterSchema = z21.looseObject({
|
|
7168
|
+
name: z21.string(),
|
|
7169
|
+
description: z21.string()
|
|
7031
7170
|
});
|
|
7032
7171
|
var SimulatedSkill = class extends ToolSkill {
|
|
7033
7172
|
frontmatter;
|
|
@@ -7058,7 +7197,7 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
7058
7197
|
const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
|
|
7059
7198
|
if (!result.success) {
|
|
7060
7199
|
throw new Error(
|
|
7061
|
-
`Invalid frontmatter in ${
|
|
7200
|
+
`Invalid frontmatter in ${join54(relativeDirPath, dirName)}: ${formatError(result.error)}`
|
|
7062
7201
|
);
|
|
7063
7202
|
}
|
|
7064
7203
|
}
|
|
@@ -7116,8 +7255,8 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
7116
7255
|
}) {
|
|
7117
7256
|
const settablePaths = this.getSettablePaths();
|
|
7118
7257
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
7119
|
-
const skillDirPath =
|
|
7120
|
-
const skillFilePath =
|
|
7258
|
+
const skillDirPath = join54(baseDir, actualRelativeDirPath, dirName);
|
|
7259
|
+
const skillFilePath = join54(skillDirPath, SKILL_FILE_NAME);
|
|
7121
7260
|
if (!await fileExists(skillFilePath)) {
|
|
7122
7261
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
7123
7262
|
}
|
|
@@ -7194,7 +7333,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
7194
7333
|
throw new Error("AgentsmdSkill does not support global mode.");
|
|
7195
7334
|
}
|
|
7196
7335
|
return {
|
|
7197
|
-
relativeDirPath:
|
|
7336
|
+
relativeDirPath: join55(".agents", "skills")
|
|
7198
7337
|
};
|
|
7199
7338
|
}
|
|
7200
7339
|
static async fromDir(params) {
|
|
@@ -7221,11 +7360,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
7221
7360
|
};
|
|
7222
7361
|
|
|
7223
7362
|
// src/features/skills/factorydroid-skill.ts
|
|
7224
|
-
import { join as
|
|
7363
|
+
import { join as join56 } from "path";
|
|
7225
7364
|
var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
7226
7365
|
static getSettablePaths(_options) {
|
|
7227
7366
|
return {
|
|
7228
|
-
relativeDirPath:
|
|
7367
|
+
relativeDirPath: join56(".factory", "skills")
|
|
7229
7368
|
};
|
|
7230
7369
|
}
|
|
7231
7370
|
static async fromDir(params) {
|
|
@@ -7252,11 +7391,11 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
|
7252
7391
|
};
|
|
7253
7392
|
|
|
7254
7393
|
// src/features/skills/skills-processor.ts
|
|
7255
|
-
import { basename as basename5, join as
|
|
7256
|
-
import { z as
|
|
7394
|
+
import { basename as basename5, join as join73 } from "path";
|
|
7395
|
+
import { z as z36 } from "zod/mini";
|
|
7257
7396
|
|
|
7258
7397
|
// src/types/dir-feature-processor.ts
|
|
7259
|
-
import { join as
|
|
7398
|
+
import { join as join57 } from "path";
|
|
7260
7399
|
var DirFeatureProcessor = class {
|
|
7261
7400
|
baseDir;
|
|
7262
7401
|
dryRun;
|
|
@@ -7287,7 +7426,7 @@ var DirFeatureProcessor = class {
|
|
|
7287
7426
|
const mainFile = aiDir.getMainFile();
|
|
7288
7427
|
let mainFileContent;
|
|
7289
7428
|
if (mainFile) {
|
|
7290
|
-
const mainFilePath =
|
|
7429
|
+
const mainFilePath = join57(dirPath, mainFile.name);
|
|
7291
7430
|
const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter);
|
|
7292
7431
|
mainFileContent = addTrailingNewline(content);
|
|
7293
7432
|
const existingContent = await readFileContentOrNull(mainFilePath);
|
|
@@ -7301,7 +7440,7 @@ var DirFeatureProcessor = class {
|
|
|
7301
7440
|
const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
|
|
7302
7441
|
otherFileContents.push(contentWithNewline);
|
|
7303
7442
|
if (!dirHasChanges) {
|
|
7304
|
-
const filePath =
|
|
7443
|
+
const filePath = join57(dirPath, file.relativeFilePathToDirPath);
|
|
7305
7444
|
const existingContent = await readFileContentOrNull(filePath);
|
|
7306
7445
|
if (existingContent !== contentWithNewline) {
|
|
7307
7446
|
dirHasChanges = true;
|
|
@@ -7315,22 +7454,22 @@ var DirFeatureProcessor = class {
|
|
|
7315
7454
|
if (this.dryRun) {
|
|
7316
7455
|
logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
|
|
7317
7456
|
if (mainFile) {
|
|
7318
|
-
logger.info(`[DRY RUN] Would write: ${
|
|
7319
|
-
changedPaths.push(
|
|
7457
|
+
logger.info(`[DRY RUN] Would write: ${join57(dirPath, mainFile.name)}`);
|
|
7458
|
+
changedPaths.push(join57(relativeDir, mainFile.name));
|
|
7320
7459
|
}
|
|
7321
7460
|
for (const file of otherFiles) {
|
|
7322
|
-
logger.info(`[DRY RUN] Would write: ${
|
|
7323
|
-
changedPaths.push(
|
|
7461
|
+
logger.info(`[DRY RUN] Would write: ${join57(dirPath, file.relativeFilePathToDirPath)}`);
|
|
7462
|
+
changedPaths.push(join57(relativeDir, file.relativeFilePathToDirPath));
|
|
7324
7463
|
}
|
|
7325
7464
|
} else {
|
|
7326
7465
|
await ensureDir(dirPath);
|
|
7327
7466
|
if (mainFile && mainFileContent) {
|
|
7328
|
-
const mainFilePath =
|
|
7467
|
+
const mainFilePath = join57(dirPath, mainFile.name);
|
|
7329
7468
|
await writeFileContent(mainFilePath, mainFileContent);
|
|
7330
|
-
changedPaths.push(
|
|
7469
|
+
changedPaths.push(join57(relativeDir, mainFile.name));
|
|
7331
7470
|
}
|
|
7332
7471
|
for (const [i, file] of otherFiles.entries()) {
|
|
7333
|
-
const filePath =
|
|
7472
|
+
const filePath = join57(dirPath, file.relativeFilePathToDirPath);
|
|
7334
7473
|
const content = otherFileContents[i];
|
|
7335
7474
|
if (content === void 0) {
|
|
7336
7475
|
throw new Error(
|
|
@@ -7338,7 +7477,7 @@ var DirFeatureProcessor = class {
|
|
|
7338
7477
|
);
|
|
7339
7478
|
}
|
|
7340
7479
|
await writeFileContent(filePath, content);
|
|
7341
|
-
changedPaths.push(
|
|
7480
|
+
changedPaths.push(join57(relativeDir, file.relativeFilePathToDirPath));
|
|
7342
7481
|
}
|
|
7343
7482
|
}
|
|
7344
7483
|
changedCount++;
|
|
@@ -7370,37 +7509,38 @@ var DirFeatureProcessor = class {
|
|
|
7370
7509
|
};
|
|
7371
7510
|
|
|
7372
7511
|
// src/features/skills/agentsskills-skill.ts
|
|
7373
|
-
import { join as
|
|
7374
|
-
import { z as
|
|
7512
|
+
import { join as join59 } from "path";
|
|
7513
|
+
import { z as z23 } from "zod/mini";
|
|
7375
7514
|
|
|
7376
7515
|
// src/features/skills/rulesync-skill.ts
|
|
7377
|
-
import { join as
|
|
7378
|
-
import { z as
|
|
7379
|
-
var RulesyncSkillFrontmatterSchemaInternal =
|
|
7380
|
-
name:
|
|
7381
|
-
description:
|
|
7382
|
-
targets:
|
|
7383
|
-
claudecode:
|
|
7384
|
-
|
|
7385
|
-
"allowed-tools":
|
|
7516
|
+
import { join as join58 } from "path";
|
|
7517
|
+
import { z as z22 } from "zod/mini";
|
|
7518
|
+
var RulesyncSkillFrontmatterSchemaInternal = z22.looseObject({
|
|
7519
|
+
name: z22.string(),
|
|
7520
|
+
description: z22.string(),
|
|
7521
|
+
targets: z22._default(RulesyncTargetsSchema, ["*"]),
|
|
7522
|
+
claudecode: z22.optional(
|
|
7523
|
+
z22.looseObject({
|
|
7524
|
+
"allowed-tools": z22.optional(z22.array(z22.string()))
|
|
7386
7525
|
})
|
|
7387
7526
|
),
|
|
7388
|
-
codexcli:
|
|
7389
|
-
|
|
7390
|
-
"short-description":
|
|
7527
|
+
codexcli: z22.optional(
|
|
7528
|
+
z22.looseObject({
|
|
7529
|
+
"short-description": z22.optional(z22.string())
|
|
7391
7530
|
})
|
|
7392
7531
|
),
|
|
7393
|
-
opencode:
|
|
7394
|
-
|
|
7395
|
-
"allowed-tools":
|
|
7532
|
+
opencode: z22.optional(
|
|
7533
|
+
z22.looseObject({
|
|
7534
|
+
"allowed-tools": z22.optional(z22.array(z22.string()))
|
|
7396
7535
|
})
|
|
7397
7536
|
),
|
|
7398
|
-
copilot:
|
|
7399
|
-
|
|
7400
|
-
license:
|
|
7537
|
+
copilot: z22.optional(
|
|
7538
|
+
z22.looseObject({
|
|
7539
|
+
license: z22.optional(z22.string())
|
|
7401
7540
|
})
|
|
7402
7541
|
),
|
|
7403
|
-
|
|
7542
|
+
cline: z22.optional(z22.looseObject({})),
|
|
7543
|
+
roo: z22.optional(z22.looseObject({}))
|
|
7404
7544
|
});
|
|
7405
7545
|
var RulesyncSkillFrontmatterSchema = RulesyncSkillFrontmatterSchemaInternal;
|
|
7406
7546
|
var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
@@ -7440,7 +7580,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
7440
7580
|
}
|
|
7441
7581
|
getFrontmatter() {
|
|
7442
7582
|
if (!this.mainFile?.frontmatter) {
|
|
7443
|
-
throw new Error(`Frontmatter is not defined in ${
|
|
7583
|
+
throw new Error(`Frontmatter is not defined in ${join58(this.relativeDirPath, this.dirName)}`);
|
|
7444
7584
|
}
|
|
7445
7585
|
const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
|
|
7446
7586
|
return result;
|
|
@@ -7466,8 +7606,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
7466
7606
|
dirName,
|
|
7467
7607
|
global = false
|
|
7468
7608
|
}) {
|
|
7469
|
-
const skillDirPath =
|
|
7470
|
-
const skillFilePath =
|
|
7609
|
+
const skillDirPath = join58(baseDir, relativeDirPath, dirName);
|
|
7610
|
+
const skillFilePath = join58(skillDirPath, SKILL_FILE_NAME);
|
|
7471
7611
|
if (!await fileExists(skillFilePath)) {
|
|
7472
7612
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
7473
7613
|
}
|
|
@@ -7497,14 +7637,14 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
7497
7637
|
};
|
|
7498
7638
|
|
|
7499
7639
|
// src/features/skills/agentsskills-skill.ts
|
|
7500
|
-
var AgentsSkillsSkillFrontmatterSchema =
|
|
7501
|
-
name:
|
|
7502
|
-
description:
|
|
7640
|
+
var AgentsSkillsSkillFrontmatterSchema = z23.looseObject({
|
|
7641
|
+
name: z23.string(),
|
|
7642
|
+
description: z23.string()
|
|
7503
7643
|
});
|
|
7504
7644
|
var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
7505
7645
|
constructor({
|
|
7506
7646
|
baseDir = process.cwd(),
|
|
7507
|
-
relativeDirPath =
|
|
7647
|
+
relativeDirPath = join59(".agents", "skills"),
|
|
7508
7648
|
dirName,
|
|
7509
7649
|
frontmatter,
|
|
7510
7650
|
body,
|
|
@@ -7536,7 +7676,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
7536
7676
|
throw new Error("AgentsSkillsSkill does not support global mode.");
|
|
7537
7677
|
}
|
|
7538
7678
|
return {
|
|
7539
|
-
relativeDirPath:
|
|
7679
|
+
relativeDirPath: join59(".agents", "skills")
|
|
7540
7680
|
};
|
|
7541
7681
|
}
|
|
7542
7682
|
getFrontmatter() {
|
|
@@ -7615,9 +7755,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
7615
7755
|
});
|
|
7616
7756
|
const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
7617
7757
|
if (!result.success) {
|
|
7618
|
-
const skillDirPath =
|
|
7758
|
+
const skillDirPath = join59(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
7619
7759
|
throw new Error(
|
|
7620
|
-
`Invalid frontmatter in ${
|
|
7760
|
+
`Invalid frontmatter in ${join59(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
7621
7761
|
);
|
|
7622
7762
|
}
|
|
7623
7763
|
return new _AgentsSkillsSkill({
|
|
@@ -7652,16 +7792,16 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
7652
7792
|
};
|
|
7653
7793
|
|
|
7654
7794
|
// src/features/skills/antigravity-skill.ts
|
|
7655
|
-
import { join as
|
|
7656
|
-
import { z as
|
|
7657
|
-
var AntigravitySkillFrontmatterSchema =
|
|
7658
|
-
name:
|
|
7659
|
-
description:
|
|
7660
|
-
});
|
|
7795
|
+
import { join as join60 } from "path";
|
|
7796
|
+
import { z as z24 } from "zod/mini";
|
|
7797
|
+
var AntigravitySkillFrontmatterSchema = z24.looseObject({
|
|
7798
|
+
name: z24.string(),
|
|
7799
|
+
description: z24.string()
|
|
7800
|
+
});
|
|
7661
7801
|
var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
7662
7802
|
constructor({
|
|
7663
7803
|
baseDir = process.cwd(),
|
|
7664
|
-
relativeDirPath =
|
|
7804
|
+
relativeDirPath = join60(".agent", "skills"),
|
|
7665
7805
|
dirName,
|
|
7666
7806
|
frontmatter,
|
|
7667
7807
|
body,
|
|
@@ -7693,11 +7833,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
7693
7833
|
} = {}) {
|
|
7694
7834
|
if (global) {
|
|
7695
7835
|
return {
|
|
7696
|
-
relativeDirPath:
|
|
7836
|
+
relativeDirPath: join60(".gemini", "antigravity", "skills")
|
|
7697
7837
|
};
|
|
7698
7838
|
}
|
|
7699
7839
|
return {
|
|
7700
|
-
relativeDirPath:
|
|
7840
|
+
relativeDirPath: join60(".agent", "skills")
|
|
7701
7841
|
};
|
|
7702
7842
|
}
|
|
7703
7843
|
getFrontmatter() {
|
|
@@ -7776,9 +7916,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
7776
7916
|
});
|
|
7777
7917
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
7778
7918
|
if (!result.success) {
|
|
7779
|
-
const skillDirPath =
|
|
7919
|
+
const skillDirPath = join60(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
7780
7920
|
throw new Error(
|
|
7781
|
-
`Invalid frontmatter in ${
|
|
7921
|
+
`Invalid frontmatter in ${join60(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
7782
7922
|
);
|
|
7783
7923
|
}
|
|
7784
7924
|
return new _AntigravitySkill({
|
|
@@ -7812,17 +7952,17 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
7812
7952
|
};
|
|
7813
7953
|
|
|
7814
7954
|
// src/features/skills/claudecode-skill.ts
|
|
7815
|
-
import { join as
|
|
7816
|
-
import { z as
|
|
7817
|
-
var ClaudecodeSkillFrontmatterSchema =
|
|
7818
|
-
name:
|
|
7819
|
-
description:
|
|
7820
|
-
"allowed-tools":
|
|
7955
|
+
import { join as join61 } from "path";
|
|
7956
|
+
import { z as z25 } from "zod/mini";
|
|
7957
|
+
var ClaudecodeSkillFrontmatterSchema = z25.looseObject({
|
|
7958
|
+
name: z25.string(),
|
|
7959
|
+
description: z25.string(),
|
|
7960
|
+
"allowed-tools": z25.optional(z25.array(z25.string()))
|
|
7821
7961
|
});
|
|
7822
7962
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
7823
7963
|
constructor({
|
|
7824
7964
|
baseDir = process.cwd(),
|
|
7825
|
-
relativeDirPath =
|
|
7965
|
+
relativeDirPath = join61(".claude", "skills"),
|
|
7826
7966
|
dirName,
|
|
7827
7967
|
frontmatter,
|
|
7828
7968
|
body,
|
|
@@ -7853,7 +7993,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
7853
7993
|
global: _global = false
|
|
7854
7994
|
} = {}) {
|
|
7855
7995
|
return {
|
|
7856
|
-
relativeDirPath:
|
|
7996
|
+
relativeDirPath: join61(".claude", "skills")
|
|
7857
7997
|
};
|
|
7858
7998
|
}
|
|
7859
7999
|
getFrontmatter() {
|
|
@@ -7938,9 +8078,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
7938
8078
|
});
|
|
7939
8079
|
const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
7940
8080
|
if (!result.success) {
|
|
7941
|
-
const skillDirPath =
|
|
8081
|
+
const skillDirPath = join61(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
7942
8082
|
throw new Error(
|
|
7943
|
-
`Invalid frontmatter in ${
|
|
8083
|
+
`Invalid frontmatter in ${join61(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
7944
8084
|
);
|
|
7945
8085
|
}
|
|
7946
8086
|
return new _ClaudecodeSkill({
|
|
@@ -7973,22 +8113,194 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
7973
8113
|
}
|
|
7974
8114
|
};
|
|
7975
8115
|
|
|
8116
|
+
// src/features/skills/cline-skill.ts
|
|
8117
|
+
import { join as join62 } from "path";
|
|
8118
|
+
import { z as z26 } from "zod/mini";
|
|
8119
|
+
var ClineSkillFrontmatterSchema = z26.looseObject({
|
|
8120
|
+
name: z26.string(),
|
|
8121
|
+
description: z26.string()
|
|
8122
|
+
});
|
|
8123
|
+
var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
8124
|
+
constructor({
|
|
8125
|
+
baseDir = process.cwd(),
|
|
8126
|
+
relativeDirPath = join62(".cline", "skills"),
|
|
8127
|
+
dirName,
|
|
8128
|
+
frontmatter,
|
|
8129
|
+
body,
|
|
8130
|
+
otherFiles = [],
|
|
8131
|
+
validate = true,
|
|
8132
|
+
global = false
|
|
8133
|
+
}) {
|
|
8134
|
+
super({
|
|
8135
|
+
baseDir,
|
|
8136
|
+
relativeDirPath,
|
|
8137
|
+
dirName,
|
|
8138
|
+
mainFile: {
|
|
8139
|
+
name: SKILL_FILE_NAME,
|
|
8140
|
+
body,
|
|
8141
|
+
frontmatter: { ...frontmatter }
|
|
8142
|
+
},
|
|
8143
|
+
otherFiles,
|
|
8144
|
+
global
|
|
8145
|
+
});
|
|
8146
|
+
if (validate) {
|
|
8147
|
+
const result = this.validate();
|
|
8148
|
+
if (!result.success) {
|
|
8149
|
+
throw result.error;
|
|
8150
|
+
}
|
|
8151
|
+
}
|
|
8152
|
+
}
|
|
8153
|
+
static getSettablePaths(_options = {}) {
|
|
8154
|
+
return {
|
|
8155
|
+
relativeDirPath: join62(".cline", "skills")
|
|
8156
|
+
};
|
|
8157
|
+
}
|
|
8158
|
+
getFrontmatter() {
|
|
8159
|
+
const result = ClineSkillFrontmatterSchema.parse(this.requireMainFileFrontmatter());
|
|
8160
|
+
return result;
|
|
8161
|
+
}
|
|
8162
|
+
getBody() {
|
|
8163
|
+
return this.mainFile?.body ?? "";
|
|
8164
|
+
}
|
|
8165
|
+
validate() {
|
|
8166
|
+
if (!this.mainFile) {
|
|
8167
|
+
return {
|
|
8168
|
+
success: false,
|
|
8169
|
+
error: new Error(`${this.getDirPath()}: ${SKILL_FILE_NAME} file does not exist`)
|
|
8170
|
+
};
|
|
8171
|
+
}
|
|
8172
|
+
const result = ClineSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
|
|
8173
|
+
if (!result.success) {
|
|
8174
|
+
return {
|
|
8175
|
+
success: false,
|
|
8176
|
+
error: new Error(
|
|
8177
|
+
`Invalid frontmatter in ${this.getDirPath()}: ${formatError(result.error)}`
|
|
8178
|
+
)
|
|
8179
|
+
};
|
|
8180
|
+
}
|
|
8181
|
+
if (result.data.name !== this.getDirName()) {
|
|
8182
|
+
return {
|
|
8183
|
+
success: false,
|
|
8184
|
+
error: new Error(
|
|
8185
|
+
`${this.getDirPath()}: frontmatter name (${result.data.name}) must match directory name (${this.getDirName()})`
|
|
8186
|
+
)
|
|
8187
|
+
};
|
|
8188
|
+
}
|
|
8189
|
+
return { success: true, error: null };
|
|
8190
|
+
}
|
|
8191
|
+
toRulesyncSkill() {
|
|
8192
|
+
const frontmatter = this.getFrontmatter();
|
|
8193
|
+
const rulesyncFrontmatter = {
|
|
8194
|
+
name: frontmatter.name,
|
|
8195
|
+
description: frontmatter.description,
|
|
8196
|
+
targets: ["*"]
|
|
8197
|
+
};
|
|
8198
|
+
return new RulesyncSkill({
|
|
8199
|
+
baseDir: this.baseDir,
|
|
8200
|
+
relativeDirPath: RULESYNC_SKILLS_RELATIVE_DIR_PATH,
|
|
8201
|
+
dirName: this.getDirName(),
|
|
8202
|
+
frontmatter: rulesyncFrontmatter,
|
|
8203
|
+
body: this.getBody(),
|
|
8204
|
+
otherFiles: this.getOtherFiles(),
|
|
8205
|
+
validate: true,
|
|
8206
|
+
global: this.global
|
|
8207
|
+
});
|
|
8208
|
+
}
|
|
8209
|
+
static fromRulesyncSkill({
|
|
8210
|
+
rulesyncSkill,
|
|
8211
|
+
validate = true,
|
|
8212
|
+
global = false
|
|
8213
|
+
}) {
|
|
8214
|
+
const settablePaths = _ClineSkill.getSettablePaths({ global });
|
|
8215
|
+
const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
|
|
8216
|
+
const clineFrontmatter = {
|
|
8217
|
+
name: rulesyncFrontmatter.name,
|
|
8218
|
+
description: rulesyncFrontmatter.description
|
|
8219
|
+
};
|
|
8220
|
+
return new _ClineSkill({
|
|
8221
|
+
baseDir: rulesyncSkill.getBaseDir(),
|
|
8222
|
+
relativeDirPath: settablePaths.relativeDirPath,
|
|
8223
|
+
dirName: clineFrontmatter.name,
|
|
8224
|
+
frontmatter: clineFrontmatter,
|
|
8225
|
+
body: rulesyncSkill.getBody(),
|
|
8226
|
+
otherFiles: rulesyncSkill.getOtherFiles(),
|
|
8227
|
+
validate,
|
|
8228
|
+
global
|
|
8229
|
+
});
|
|
8230
|
+
}
|
|
8231
|
+
static isTargetedByRulesyncSkill(rulesyncSkill) {
|
|
8232
|
+
const targets = rulesyncSkill.getFrontmatter().targets;
|
|
8233
|
+
return targets.includes("*") || targets.includes("cline");
|
|
8234
|
+
}
|
|
8235
|
+
static async fromDir(params) {
|
|
8236
|
+
const loaded = await this.loadSkillDirContent({
|
|
8237
|
+
...params,
|
|
8238
|
+
getSettablePaths: _ClineSkill.getSettablePaths
|
|
8239
|
+
});
|
|
8240
|
+
const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8241
|
+
if (!result.success) {
|
|
8242
|
+
const skillDirPath = join62(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8243
|
+
throw new Error(
|
|
8244
|
+
`Invalid frontmatter in ${join62(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8245
|
+
);
|
|
8246
|
+
}
|
|
8247
|
+
if (result.data.name !== loaded.dirName) {
|
|
8248
|
+
const skillFilePath = join62(
|
|
8249
|
+
loaded.baseDir,
|
|
8250
|
+
loaded.relativeDirPath,
|
|
8251
|
+
loaded.dirName,
|
|
8252
|
+
SKILL_FILE_NAME
|
|
8253
|
+
);
|
|
8254
|
+
throw new Error(
|
|
8255
|
+
`Frontmatter name (${result.data.name}) must match directory name (${loaded.dirName}) in ${skillFilePath}`
|
|
8256
|
+
);
|
|
8257
|
+
}
|
|
8258
|
+
return new _ClineSkill({
|
|
8259
|
+
baseDir: loaded.baseDir,
|
|
8260
|
+
relativeDirPath: loaded.relativeDirPath,
|
|
8261
|
+
dirName: loaded.dirName,
|
|
8262
|
+
frontmatter: result.data,
|
|
8263
|
+
body: loaded.body,
|
|
8264
|
+
otherFiles: loaded.otherFiles,
|
|
8265
|
+
validate: true,
|
|
8266
|
+
global: loaded.global
|
|
8267
|
+
});
|
|
8268
|
+
}
|
|
8269
|
+
static forDeletion({
|
|
8270
|
+
baseDir = process.cwd(),
|
|
8271
|
+
relativeDirPath,
|
|
8272
|
+
dirName,
|
|
8273
|
+
global = false
|
|
8274
|
+
}) {
|
|
8275
|
+
return new _ClineSkill({
|
|
8276
|
+
baseDir,
|
|
8277
|
+
relativeDirPath,
|
|
8278
|
+
dirName,
|
|
8279
|
+
frontmatter: { name: "", description: "" },
|
|
8280
|
+
body: "",
|
|
8281
|
+
otherFiles: [],
|
|
8282
|
+
validate: false,
|
|
8283
|
+
global
|
|
8284
|
+
});
|
|
8285
|
+
}
|
|
8286
|
+
};
|
|
8287
|
+
|
|
7976
8288
|
// src/features/skills/codexcli-skill.ts
|
|
7977
|
-
import { join as
|
|
7978
|
-
import { z as
|
|
7979
|
-
var CodexCliSkillFrontmatterSchema =
|
|
7980
|
-
name:
|
|
7981
|
-
description:
|
|
7982
|
-
metadata:
|
|
7983
|
-
|
|
7984
|
-
"short-description":
|
|
8289
|
+
import { join as join63 } from "path";
|
|
8290
|
+
import { z as z27 } from "zod/mini";
|
|
8291
|
+
var CodexCliSkillFrontmatterSchema = z27.looseObject({
|
|
8292
|
+
name: z27.string(),
|
|
8293
|
+
description: z27.string(),
|
|
8294
|
+
metadata: z27.optional(
|
|
8295
|
+
z27.looseObject({
|
|
8296
|
+
"short-description": z27.optional(z27.string())
|
|
7985
8297
|
})
|
|
7986
8298
|
)
|
|
7987
8299
|
});
|
|
7988
8300
|
var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
7989
8301
|
constructor({
|
|
7990
8302
|
baseDir = process.cwd(),
|
|
7991
|
-
relativeDirPath =
|
|
8303
|
+
relativeDirPath = join63(".codex", "skills"),
|
|
7992
8304
|
dirName,
|
|
7993
8305
|
frontmatter,
|
|
7994
8306
|
body,
|
|
@@ -8019,7 +8331,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
8019
8331
|
global: _global = false
|
|
8020
8332
|
} = {}) {
|
|
8021
8333
|
return {
|
|
8022
|
-
relativeDirPath:
|
|
8334
|
+
relativeDirPath: join63(".codex", "skills")
|
|
8023
8335
|
};
|
|
8024
8336
|
}
|
|
8025
8337
|
getFrontmatter() {
|
|
@@ -8108,9 +8420,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
8108
8420
|
});
|
|
8109
8421
|
const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8110
8422
|
if (!result.success) {
|
|
8111
|
-
const skillDirPath =
|
|
8423
|
+
const skillDirPath = join63(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8112
8424
|
throw new Error(
|
|
8113
|
-
`Invalid frontmatter in ${
|
|
8425
|
+
`Invalid frontmatter in ${join63(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8114
8426
|
);
|
|
8115
8427
|
}
|
|
8116
8428
|
return new _CodexCliSkill({
|
|
@@ -8144,17 +8456,17 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
8144
8456
|
};
|
|
8145
8457
|
|
|
8146
8458
|
// src/features/skills/copilot-skill.ts
|
|
8147
|
-
import { join as
|
|
8148
|
-
import { z as
|
|
8149
|
-
var CopilotSkillFrontmatterSchema =
|
|
8150
|
-
name:
|
|
8151
|
-
description:
|
|
8152
|
-
license:
|
|
8459
|
+
import { join as join64 } from "path";
|
|
8460
|
+
import { z as z28 } from "zod/mini";
|
|
8461
|
+
var CopilotSkillFrontmatterSchema = z28.looseObject({
|
|
8462
|
+
name: z28.string(),
|
|
8463
|
+
description: z28.string(),
|
|
8464
|
+
license: z28.optional(z28.string())
|
|
8153
8465
|
});
|
|
8154
8466
|
var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
8155
8467
|
constructor({
|
|
8156
8468
|
baseDir = process.cwd(),
|
|
8157
|
-
relativeDirPath =
|
|
8469
|
+
relativeDirPath = join64(".github", "skills"),
|
|
8158
8470
|
dirName,
|
|
8159
8471
|
frontmatter,
|
|
8160
8472
|
body,
|
|
@@ -8186,7 +8498,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
8186
8498
|
throw new Error("CopilotSkill does not support global mode.");
|
|
8187
8499
|
}
|
|
8188
8500
|
return {
|
|
8189
|
-
relativeDirPath:
|
|
8501
|
+
relativeDirPath: join64(".github", "skills")
|
|
8190
8502
|
};
|
|
8191
8503
|
}
|
|
8192
8504
|
getFrontmatter() {
|
|
@@ -8271,9 +8583,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
8271
8583
|
});
|
|
8272
8584
|
const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8273
8585
|
if (!result.success) {
|
|
8274
|
-
const skillDirPath =
|
|
8586
|
+
const skillDirPath = join64(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8275
8587
|
throw new Error(
|
|
8276
|
-
`Invalid frontmatter in ${
|
|
8588
|
+
`Invalid frontmatter in ${join64(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8277
8589
|
);
|
|
8278
8590
|
}
|
|
8279
8591
|
return new _CopilotSkill({
|
|
@@ -8308,16 +8620,16 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
8308
8620
|
};
|
|
8309
8621
|
|
|
8310
8622
|
// src/features/skills/cursor-skill.ts
|
|
8311
|
-
import { join as
|
|
8312
|
-
import { z as
|
|
8313
|
-
var CursorSkillFrontmatterSchema =
|
|
8314
|
-
name:
|
|
8315
|
-
description:
|
|
8623
|
+
import { join as join65 } from "path";
|
|
8624
|
+
import { z as z29 } from "zod/mini";
|
|
8625
|
+
var CursorSkillFrontmatterSchema = z29.looseObject({
|
|
8626
|
+
name: z29.string(),
|
|
8627
|
+
description: z29.string()
|
|
8316
8628
|
});
|
|
8317
8629
|
var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
8318
8630
|
constructor({
|
|
8319
8631
|
baseDir = process.cwd(),
|
|
8320
|
-
relativeDirPath =
|
|
8632
|
+
relativeDirPath = join65(".cursor", "skills"),
|
|
8321
8633
|
dirName,
|
|
8322
8634
|
frontmatter,
|
|
8323
8635
|
body,
|
|
@@ -8346,7 +8658,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
8346
8658
|
}
|
|
8347
8659
|
static getSettablePaths(_options) {
|
|
8348
8660
|
return {
|
|
8349
|
-
relativeDirPath:
|
|
8661
|
+
relativeDirPath: join65(".cursor", "skills")
|
|
8350
8662
|
};
|
|
8351
8663
|
}
|
|
8352
8664
|
getFrontmatter() {
|
|
@@ -8425,9 +8737,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
8425
8737
|
});
|
|
8426
8738
|
const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8427
8739
|
if (!result.success) {
|
|
8428
|
-
const skillDirPath =
|
|
8740
|
+
const skillDirPath = join65(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8429
8741
|
throw new Error(
|
|
8430
|
-
`Invalid frontmatter in ${
|
|
8742
|
+
`Invalid frontmatter in ${join65(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8431
8743
|
);
|
|
8432
8744
|
}
|
|
8433
8745
|
return new _CursorSkill({
|
|
@@ -8462,11 +8774,11 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
8462
8774
|
};
|
|
8463
8775
|
|
|
8464
8776
|
// src/features/skills/geminicli-skill.ts
|
|
8465
|
-
import { join as
|
|
8466
|
-
import { z as
|
|
8467
|
-
var GeminiCliSkillFrontmatterSchema =
|
|
8468
|
-
name:
|
|
8469
|
-
description:
|
|
8777
|
+
import { join as join66 } from "path";
|
|
8778
|
+
import { z as z30 } from "zod/mini";
|
|
8779
|
+
var GeminiCliSkillFrontmatterSchema = z30.looseObject({
|
|
8780
|
+
name: z30.string(),
|
|
8781
|
+
description: z30.string()
|
|
8470
8782
|
});
|
|
8471
8783
|
var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
8472
8784
|
constructor({
|
|
@@ -8502,7 +8814,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
8502
8814
|
global: _global = false
|
|
8503
8815
|
} = {}) {
|
|
8504
8816
|
return {
|
|
8505
|
-
relativeDirPath:
|
|
8817
|
+
relativeDirPath: join66(".gemini", "skills")
|
|
8506
8818
|
};
|
|
8507
8819
|
}
|
|
8508
8820
|
getFrontmatter() {
|
|
@@ -8581,9 +8893,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
8581
8893
|
});
|
|
8582
8894
|
const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8583
8895
|
if (!result.success) {
|
|
8584
|
-
const skillDirPath =
|
|
8896
|
+
const skillDirPath = join66(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8585
8897
|
throw new Error(
|
|
8586
|
-
`Invalid frontmatter in ${
|
|
8898
|
+
`Invalid frontmatter in ${join66(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8587
8899
|
);
|
|
8588
8900
|
}
|
|
8589
8901
|
return new _GeminiCliSkill({
|
|
@@ -8618,16 +8930,16 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
8618
8930
|
};
|
|
8619
8931
|
|
|
8620
8932
|
// src/features/skills/kilo-skill.ts
|
|
8621
|
-
import { join as
|
|
8622
|
-
import { z as
|
|
8623
|
-
var KiloSkillFrontmatterSchema =
|
|
8624
|
-
name:
|
|
8625
|
-
description:
|
|
8933
|
+
import { join as join67 } from "path";
|
|
8934
|
+
import { z as z31 } from "zod/mini";
|
|
8935
|
+
var KiloSkillFrontmatterSchema = z31.looseObject({
|
|
8936
|
+
name: z31.string(),
|
|
8937
|
+
description: z31.string()
|
|
8626
8938
|
});
|
|
8627
8939
|
var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
8628
8940
|
constructor({
|
|
8629
8941
|
baseDir = process.cwd(),
|
|
8630
|
-
relativeDirPath =
|
|
8942
|
+
relativeDirPath = join67(".kilocode", "skills"),
|
|
8631
8943
|
dirName,
|
|
8632
8944
|
frontmatter,
|
|
8633
8945
|
body,
|
|
@@ -8658,7 +8970,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
8658
8970
|
global: _global = false
|
|
8659
8971
|
} = {}) {
|
|
8660
8972
|
return {
|
|
8661
|
-
relativeDirPath:
|
|
8973
|
+
relativeDirPath: join67(".kilocode", "skills")
|
|
8662
8974
|
};
|
|
8663
8975
|
}
|
|
8664
8976
|
getFrontmatter() {
|
|
@@ -8745,13 +9057,13 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
8745
9057
|
});
|
|
8746
9058
|
const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8747
9059
|
if (!result.success) {
|
|
8748
|
-
const skillDirPath =
|
|
9060
|
+
const skillDirPath = join67(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8749
9061
|
throw new Error(
|
|
8750
|
-
`Invalid frontmatter in ${
|
|
9062
|
+
`Invalid frontmatter in ${join67(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8751
9063
|
);
|
|
8752
9064
|
}
|
|
8753
9065
|
if (result.data.name !== loaded.dirName) {
|
|
8754
|
-
const skillFilePath =
|
|
9066
|
+
const skillFilePath = join67(
|
|
8755
9067
|
loaded.baseDir,
|
|
8756
9068
|
loaded.relativeDirPath,
|
|
8757
9069
|
loaded.dirName,
|
|
@@ -8792,16 +9104,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
8792
9104
|
};
|
|
8793
9105
|
|
|
8794
9106
|
// src/features/skills/kiro-skill.ts
|
|
8795
|
-
import { join as
|
|
8796
|
-
import { z as
|
|
8797
|
-
var KiroSkillFrontmatterSchema =
|
|
8798
|
-
name:
|
|
8799
|
-
description:
|
|
9107
|
+
import { join as join68 } from "path";
|
|
9108
|
+
import { z as z32 } from "zod/mini";
|
|
9109
|
+
var KiroSkillFrontmatterSchema = z32.looseObject({
|
|
9110
|
+
name: z32.string(),
|
|
9111
|
+
description: z32.string()
|
|
8800
9112
|
});
|
|
8801
9113
|
var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
8802
9114
|
constructor({
|
|
8803
9115
|
baseDir = process.cwd(),
|
|
8804
|
-
relativeDirPath =
|
|
9116
|
+
relativeDirPath = join68(".kiro", "skills"),
|
|
8805
9117
|
dirName,
|
|
8806
9118
|
frontmatter,
|
|
8807
9119
|
body,
|
|
@@ -8833,7 +9145,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
8833
9145
|
throw new Error("KiroSkill does not support global mode.");
|
|
8834
9146
|
}
|
|
8835
9147
|
return {
|
|
8836
|
-
relativeDirPath:
|
|
9148
|
+
relativeDirPath: join68(".kiro", "skills")
|
|
8837
9149
|
};
|
|
8838
9150
|
}
|
|
8839
9151
|
getFrontmatter() {
|
|
@@ -8920,13 +9232,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
8920
9232
|
});
|
|
8921
9233
|
const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8922
9234
|
if (!result.success) {
|
|
8923
|
-
const skillDirPath =
|
|
9235
|
+
const skillDirPath = join68(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8924
9236
|
throw new Error(
|
|
8925
|
-
`Invalid frontmatter in ${
|
|
9237
|
+
`Invalid frontmatter in ${join68(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8926
9238
|
);
|
|
8927
9239
|
}
|
|
8928
9240
|
if (result.data.name !== loaded.dirName) {
|
|
8929
|
-
const skillFilePath =
|
|
9241
|
+
const skillFilePath = join68(
|
|
8930
9242
|
loaded.baseDir,
|
|
8931
9243
|
loaded.relativeDirPath,
|
|
8932
9244
|
loaded.dirName,
|
|
@@ -8968,17 +9280,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
8968
9280
|
};
|
|
8969
9281
|
|
|
8970
9282
|
// src/features/skills/opencode-skill.ts
|
|
8971
|
-
import { join as
|
|
8972
|
-
import { z as
|
|
8973
|
-
var OpenCodeSkillFrontmatterSchema =
|
|
8974
|
-
name:
|
|
8975
|
-
description:
|
|
8976
|
-
"allowed-tools":
|
|
9283
|
+
import { join as join69 } from "path";
|
|
9284
|
+
import { z as z33 } from "zod/mini";
|
|
9285
|
+
var OpenCodeSkillFrontmatterSchema = z33.looseObject({
|
|
9286
|
+
name: z33.string(),
|
|
9287
|
+
description: z33.string(),
|
|
9288
|
+
"allowed-tools": z33.optional(z33.array(z33.string()))
|
|
8977
9289
|
});
|
|
8978
9290
|
var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
8979
9291
|
constructor({
|
|
8980
9292
|
baseDir = process.cwd(),
|
|
8981
|
-
relativeDirPath =
|
|
9293
|
+
relativeDirPath = join69(".opencode", "skill"),
|
|
8982
9294
|
dirName,
|
|
8983
9295
|
frontmatter,
|
|
8984
9296
|
body,
|
|
@@ -9007,7 +9319,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
9007
9319
|
}
|
|
9008
9320
|
static getSettablePaths({ global = false } = {}) {
|
|
9009
9321
|
return {
|
|
9010
|
-
relativeDirPath: global ?
|
|
9322
|
+
relativeDirPath: global ? join69(".config", "opencode", "skill") : join69(".opencode", "skill")
|
|
9011
9323
|
};
|
|
9012
9324
|
}
|
|
9013
9325
|
getFrontmatter() {
|
|
@@ -9092,9 +9404,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
9092
9404
|
});
|
|
9093
9405
|
const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9094
9406
|
if (!result.success) {
|
|
9095
|
-
const skillDirPath =
|
|
9407
|
+
const skillDirPath = join69(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9096
9408
|
throw new Error(
|
|
9097
|
-
`Invalid frontmatter in ${
|
|
9409
|
+
`Invalid frontmatter in ${join69(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9098
9410
|
);
|
|
9099
9411
|
}
|
|
9100
9412
|
return new _OpenCodeSkill({
|
|
@@ -9128,16 +9440,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
9128
9440
|
};
|
|
9129
9441
|
|
|
9130
9442
|
// src/features/skills/replit-skill.ts
|
|
9131
|
-
import { join as
|
|
9132
|
-
import { z as
|
|
9133
|
-
var ReplitSkillFrontmatterSchema =
|
|
9134
|
-
name:
|
|
9135
|
-
description:
|
|
9443
|
+
import { join as join70 } from "path";
|
|
9444
|
+
import { z as z34 } from "zod/mini";
|
|
9445
|
+
var ReplitSkillFrontmatterSchema = z34.looseObject({
|
|
9446
|
+
name: z34.string(),
|
|
9447
|
+
description: z34.string()
|
|
9136
9448
|
});
|
|
9137
9449
|
var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
9138
9450
|
constructor({
|
|
9139
9451
|
baseDir = process.cwd(),
|
|
9140
|
-
relativeDirPath =
|
|
9452
|
+
relativeDirPath = join70(".agents", "skills"),
|
|
9141
9453
|
dirName,
|
|
9142
9454
|
frontmatter,
|
|
9143
9455
|
body,
|
|
@@ -9169,7 +9481,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
9169
9481
|
throw new Error("ReplitSkill does not support global mode.");
|
|
9170
9482
|
}
|
|
9171
9483
|
return {
|
|
9172
|
-
relativeDirPath:
|
|
9484
|
+
relativeDirPath: join70(".agents", "skills")
|
|
9173
9485
|
};
|
|
9174
9486
|
}
|
|
9175
9487
|
getFrontmatter() {
|
|
@@ -9248,9 +9560,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
9248
9560
|
});
|
|
9249
9561
|
const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9250
9562
|
if (!result.success) {
|
|
9251
|
-
const skillDirPath =
|
|
9563
|
+
const skillDirPath = join70(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9252
9564
|
throw new Error(
|
|
9253
|
-
`Invalid frontmatter in ${
|
|
9565
|
+
`Invalid frontmatter in ${join70(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9254
9566
|
);
|
|
9255
9567
|
}
|
|
9256
9568
|
return new _ReplitSkill({
|
|
@@ -9285,16 +9597,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
9285
9597
|
};
|
|
9286
9598
|
|
|
9287
9599
|
// src/features/skills/roo-skill.ts
|
|
9288
|
-
import { join as
|
|
9289
|
-
import { z as
|
|
9290
|
-
var RooSkillFrontmatterSchema =
|
|
9291
|
-
name:
|
|
9292
|
-
description:
|
|
9600
|
+
import { join as join71 } from "path";
|
|
9601
|
+
import { z as z35 } from "zod/mini";
|
|
9602
|
+
var RooSkillFrontmatterSchema = z35.looseObject({
|
|
9603
|
+
name: z35.string(),
|
|
9604
|
+
description: z35.string()
|
|
9293
9605
|
});
|
|
9294
9606
|
var RooSkill = class _RooSkill extends ToolSkill {
|
|
9295
9607
|
constructor({
|
|
9296
9608
|
baseDir = process.cwd(),
|
|
9297
|
-
relativeDirPath =
|
|
9609
|
+
relativeDirPath = join71(".roo", "skills"),
|
|
9298
9610
|
dirName,
|
|
9299
9611
|
frontmatter,
|
|
9300
9612
|
body,
|
|
@@ -9325,7 +9637,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
9325
9637
|
global: _global = false
|
|
9326
9638
|
} = {}) {
|
|
9327
9639
|
return {
|
|
9328
|
-
relativeDirPath:
|
|
9640
|
+
relativeDirPath: join71(".roo", "skills")
|
|
9329
9641
|
};
|
|
9330
9642
|
}
|
|
9331
9643
|
getFrontmatter() {
|
|
@@ -9412,13 +9724,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
9412
9724
|
});
|
|
9413
9725
|
const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9414
9726
|
if (!result.success) {
|
|
9415
|
-
const skillDirPath =
|
|
9727
|
+
const skillDirPath = join71(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9416
9728
|
throw new Error(
|
|
9417
|
-
`Invalid frontmatter in ${
|
|
9729
|
+
`Invalid frontmatter in ${join71(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9418
9730
|
);
|
|
9419
9731
|
}
|
|
9420
9732
|
if (result.data.name !== loaded.dirName) {
|
|
9421
|
-
const skillFilePath =
|
|
9733
|
+
const skillFilePath = join71(
|
|
9422
9734
|
loaded.baseDir,
|
|
9423
9735
|
loaded.relativeDirPath,
|
|
9424
9736
|
loaded.dirName,
|
|
@@ -9459,14 +9771,14 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
9459
9771
|
};
|
|
9460
9772
|
|
|
9461
9773
|
// src/features/skills/skills-utils.ts
|
|
9462
|
-
import { basename as basename4, join as
|
|
9774
|
+
import { basename as basename4, join as join72 } from "path";
|
|
9463
9775
|
async function getLocalSkillDirNames(baseDir) {
|
|
9464
|
-
const skillsDir =
|
|
9776
|
+
const skillsDir = join72(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
|
|
9465
9777
|
const names = /* @__PURE__ */ new Set();
|
|
9466
9778
|
if (!await directoryExists(skillsDir)) {
|
|
9467
9779
|
return names;
|
|
9468
9780
|
}
|
|
9469
|
-
const dirPaths = await findFilesByGlobs(
|
|
9781
|
+
const dirPaths = await findFilesByGlobs(join72(skillsDir, "*"), { type: "dir" });
|
|
9470
9782
|
for (const dirPath of dirPaths) {
|
|
9471
9783
|
const name = basename4(dirPath);
|
|
9472
9784
|
if (name === basename4(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
|
|
@@ -9482,6 +9794,7 @@ var skillsProcessorToolTargetTuple = [
|
|
|
9482
9794
|
"antigravity",
|
|
9483
9795
|
"claudecode",
|
|
9484
9796
|
"claudecode-legacy",
|
|
9797
|
+
"cline",
|
|
9485
9798
|
"codexcli",
|
|
9486
9799
|
"copilot",
|
|
9487
9800
|
"cursor",
|
|
@@ -9493,7 +9806,7 @@ var skillsProcessorToolTargetTuple = [
|
|
|
9493
9806
|
"replit",
|
|
9494
9807
|
"roo"
|
|
9495
9808
|
];
|
|
9496
|
-
var SkillsProcessorToolTargetSchema =
|
|
9809
|
+
var SkillsProcessorToolTargetSchema = z36.enum(skillsProcessorToolTargetTuple);
|
|
9497
9810
|
var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
9498
9811
|
[
|
|
9499
9812
|
"agentsmd",
|
|
@@ -9530,6 +9843,13 @@ var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
|
9530
9843
|
meta: { supportsProject: true, supportsSimulated: false, supportsGlobal: true }
|
|
9531
9844
|
}
|
|
9532
9845
|
],
|
|
9846
|
+
[
|
|
9847
|
+
"cline",
|
|
9848
|
+
{
|
|
9849
|
+
class: ClineSkill,
|
|
9850
|
+
meta: { supportsProject: true, supportsSimulated: false, supportsGlobal: true }
|
|
9851
|
+
}
|
|
9852
|
+
],
|
|
9533
9853
|
[
|
|
9534
9854
|
"codexcli",
|
|
9535
9855
|
{
|
|
@@ -9687,10 +10007,10 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
9687
10007
|
)
|
|
9688
10008
|
);
|
|
9689
10009
|
const localSkillNames = new Set(localDirNames);
|
|
9690
|
-
const curatedDirPath =
|
|
10010
|
+
const curatedDirPath = join73(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
|
|
9691
10011
|
let curatedSkills = [];
|
|
9692
10012
|
if (await directoryExists(curatedDirPath)) {
|
|
9693
|
-
const curatedDirPaths = await findFilesByGlobs(
|
|
10013
|
+
const curatedDirPaths = await findFilesByGlobs(join73(curatedDirPath, "*"), { type: "dir" });
|
|
9694
10014
|
const curatedDirNames = curatedDirPaths.map((path3) => basename5(path3));
|
|
9695
10015
|
const nonConflicting = curatedDirNames.filter((name) => {
|
|
9696
10016
|
if (localSkillNames.has(name)) {
|
|
@@ -9724,8 +10044,8 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
9724
10044
|
async loadToolDirs() {
|
|
9725
10045
|
const factory = this.getFactory(this.toolTarget);
|
|
9726
10046
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
9727
|
-
const skillsDirPath =
|
|
9728
|
-
const dirPaths = await findFilesByGlobs(
|
|
10047
|
+
const skillsDirPath = join73(this.baseDir, paths.relativeDirPath);
|
|
10048
|
+
const dirPaths = await findFilesByGlobs(join73(skillsDirPath, "*"), { type: "dir" });
|
|
9729
10049
|
const dirNames = dirPaths.map((path3) => basename5(path3));
|
|
9730
10050
|
const toolSkills = await Promise.all(
|
|
9731
10051
|
dirNames.map(
|
|
@@ -9742,8 +10062,8 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
9742
10062
|
async loadToolDirsToDelete() {
|
|
9743
10063
|
const factory = this.getFactory(this.toolTarget);
|
|
9744
10064
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
9745
|
-
const skillsDirPath =
|
|
9746
|
-
const dirPaths = await findFilesByGlobs(
|
|
10065
|
+
const skillsDirPath = join73(this.baseDir, paths.relativeDirPath);
|
|
10066
|
+
const dirPaths = await findFilesByGlobs(join73(skillsDirPath, "*"), { type: "dir" });
|
|
9747
10067
|
const dirNames = dirPaths.map((path3) => basename5(path3));
|
|
9748
10068
|
const toolSkills = dirNames.map(
|
|
9749
10069
|
(dirName) => factory.class.forDeletion({
|
|
@@ -9805,11 +10125,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
9805
10125
|
};
|
|
9806
10126
|
|
|
9807
10127
|
// src/features/subagents/agentsmd-subagent.ts
|
|
9808
|
-
import { join as
|
|
10128
|
+
import { join as join75 } from "path";
|
|
9809
10129
|
|
|
9810
10130
|
// src/features/subagents/simulated-subagent.ts
|
|
9811
|
-
import { basename as basename6, join as
|
|
9812
|
-
import { z as
|
|
10131
|
+
import { basename as basename6, join as join74 } from "path";
|
|
10132
|
+
import { z as z37 } from "zod/mini";
|
|
9813
10133
|
|
|
9814
10134
|
// src/features/subagents/tool-subagent.ts
|
|
9815
10135
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -9849,12 +10169,21 @@ var ToolSubagent = class extends ToolFile {
|
|
|
9849
10169
|
}
|
|
9850
10170
|
return false;
|
|
9851
10171
|
}
|
|
10172
|
+
static filterToolSpecificSection(rawSection, excludeFields) {
|
|
10173
|
+
const filtered = {};
|
|
10174
|
+
for (const [key, value] of Object.entries(rawSection)) {
|
|
10175
|
+
if (!excludeFields.includes(key)) {
|
|
10176
|
+
filtered[key] = value;
|
|
10177
|
+
}
|
|
10178
|
+
}
|
|
10179
|
+
return filtered;
|
|
10180
|
+
}
|
|
9852
10181
|
};
|
|
9853
10182
|
|
|
9854
10183
|
// src/features/subagents/simulated-subagent.ts
|
|
9855
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
9856
|
-
name:
|
|
9857
|
-
description:
|
|
10184
|
+
var SimulatedSubagentFrontmatterSchema = z37.object({
|
|
10185
|
+
name: z37.string(),
|
|
10186
|
+
description: z37.string()
|
|
9858
10187
|
});
|
|
9859
10188
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
9860
10189
|
frontmatter;
|
|
@@ -9864,7 +10193,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
9864
10193
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
9865
10194
|
if (!result.success) {
|
|
9866
10195
|
throw new Error(
|
|
9867
|
-
`Invalid frontmatter in ${
|
|
10196
|
+
`Invalid frontmatter in ${join74(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
9868
10197
|
);
|
|
9869
10198
|
}
|
|
9870
10199
|
}
|
|
@@ -9915,7 +10244,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
9915
10244
|
return {
|
|
9916
10245
|
success: false,
|
|
9917
10246
|
error: new Error(
|
|
9918
|
-
`Invalid frontmatter in ${
|
|
10247
|
+
`Invalid frontmatter in ${join74(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
9919
10248
|
)
|
|
9920
10249
|
};
|
|
9921
10250
|
}
|
|
@@ -9925,7 +10254,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
9925
10254
|
relativeFilePath,
|
|
9926
10255
|
validate = true
|
|
9927
10256
|
}) {
|
|
9928
|
-
const filePath =
|
|
10257
|
+
const filePath = join74(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
9929
10258
|
const fileContent = await readFileContent(filePath);
|
|
9930
10259
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
9931
10260
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -9961,7 +10290,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
9961
10290
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
9962
10291
|
static getSettablePaths() {
|
|
9963
10292
|
return {
|
|
9964
|
-
relativeDirPath:
|
|
10293
|
+
relativeDirPath: join75(".agents", "subagents")
|
|
9965
10294
|
};
|
|
9966
10295
|
}
|
|
9967
10296
|
static async fromFile(params) {
|
|
@@ -9984,11 +10313,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
9984
10313
|
};
|
|
9985
10314
|
|
|
9986
10315
|
// src/features/subagents/factorydroid-subagent.ts
|
|
9987
|
-
import { join as
|
|
10316
|
+
import { join as join76 } from "path";
|
|
9988
10317
|
var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
|
|
9989
10318
|
static getSettablePaths(_options) {
|
|
9990
10319
|
return {
|
|
9991
|
-
relativeDirPath:
|
|
10320
|
+
relativeDirPath: join76(".factory", "droids")
|
|
9992
10321
|
};
|
|
9993
10322
|
}
|
|
9994
10323
|
static async fromFile(params) {
|
|
@@ -10011,11 +10340,11 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
|
|
|
10011
10340
|
};
|
|
10012
10341
|
|
|
10013
10342
|
// src/features/subagents/geminicli-subagent.ts
|
|
10014
|
-
import { join as
|
|
10343
|
+
import { join as join77 } from "path";
|
|
10015
10344
|
var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
10016
10345
|
static getSettablePaths() {
|
|
10017
10346
|
return {
|
|
10018
|
-
relativeDirPath:
|
|
10347
|
+
relativeDirPath: join77(".gemini", "subagents")
|
|
10019
10348
|
};
|
|
10020
10349
|
}
|
|
10021
10350
|
static async fromFile(params) {
|
|
@@ -10038,11 +10367,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
|
10038
10367
|
};
|
|
10039
10368
|
|
|
10040
10369
|
// src/features/subagents/roo-subagent.ts
|
|
10041
|
-
import { join as
|
|
10370
|
+
import { join as join78 } from "path";
|
|
10042
10371
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
10043
10372
|
static getSettablePaths() {
|
|
10044
10373
|
return {
|
|
10045
|
-
relativeDirPath:
|
|
10374
|
+
relativeDirPath: join78(".roo", "subagents")
|
|
10046
10375
|
};
|
|
10047
10376
|
}
|
|
10048
10377
|
static async fromFile(params) {
|
|
@@ -10065,20 +10394,20 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
10065
10394
|
};
|
|
10066
10395
|
|
|
10067
10396
|
// src/features/subagents/subagents-processor.ts
|
|
10068
|
-
import { basename as basename9, join as
|
|
10069
|
-
import { z as
|
|
10397
|
+
import { basename as basename9, join as join86 } from "path";
|
|
10398
|
+
import { z as z45 } from "zod/mini";
|
|
10070
10399
|
|
|
10071
10400
|
// src/features/subagents/claudecode-subagent.ts
|
|
10072
|
-
import { join as
|
|
10073
|
-
import { z as
|
|
10401
|
+
import { join as join80 } from "path";
|
|
10402
|
+
import { z as z39 } from "zod/mini";
|
|
10074
10403
|
|
|
10075
10404
|
// src/features/subagents/rulesync-subagent.ts
|
|
10076
|
-
import { basename as basename7, join as
|
|
10077
|
-
import { z as
|
|
10078
|
-
var RulesyncSubagentFrontmatterSchema =
|
|
10079
|
-
targets:
|
|
10080
|
-
name:
|
|
10081
|
-
description:
|
|
10405
|
+
import { basename as basename7, join as join79 } from "path";
|
|
10406
|
+
import { z as z38 } from "zod/mini";
|
|
10407
|
+
var RulesyncSubagentFrontmatterSchema = z38.looseObject({
|
|
10408
|
+
targets: z38._default(RulesyncTargetsSchema, ["*"]),
|
|
10409
|
+
name: z38.string(),
|
|
10410
|
+
description: z38.string()
|
|
10082
10411
|
});
|
|
10083
10412
|
var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
10084
10413
|
frontmatter;
|
|
@@ -10087,7 +10416,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
10087
10416
|
const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
10088
10417
|
if (!parseResult.success && rest.validate !== false) {
|
|
10089
10418
|
throw new Error(
|
|
10090
|
-
`Invalid frontmatter in ${
|
|
10419
|
+
`Invalid frontmatter in ${join79(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
10091
10420
|
);
|
|
10092
10421
|
}
|
|
10093
10422
|
const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
|
|
@@ -10120,7 +10449,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
10120
10449
|
return {
|
|
10121
10450
|
success: false,
|
|
10122
10451
|
error: new Error(
|
|
10123
|
-
`Invalid frontmatter in ${
|
|
10452
|
+
`Invalid frontmatter in ${join79(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
10124
10453
|
)
|
|
10125
10454
|
};
|
|
10126
10455
|
}
|
|
@@ -10129,7 +10458,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
10129
10458
|
relativeFilePath
|
|
10130
10459
|
}) {
|
|
10131
10460
|
const fileContent = await readFileContent(
|
|
10132
|
-
|
|
10461
|
+
join79(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath)
|
|
10133
10462
|
);
|
|
10134
10463
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
10135
10464
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -10148,13 +10477,13 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
10148
10477
|
};
|
|
10149
10478
|
|
|
10150
10479
|
// src/features/subagents/claudecode-subagent.ts
|
|
10151
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
10152
|
-
name:
|
|
10153
|
-
description:
|
|
10154
|
-
model:
|
|
10155
|
-
tools:
|
|
10156
|
-
permissionMode:
|
|
10157
|
-
skills:
|
|
10480
|
+
var ClaudecodeSubagentFrontmatterSchema = z39.looseObject({
|
|
10481
|
+
name: z39.string(),
|
|
10482
|
+
description: z39.string(),
|
|
10483
|
+
model: z39.optional(z39.string()),
|
|
10484
|
+
tools: z39.optional(z39.union([z39.string(), z39.array(z39.string())])),
|
|
10485
|
+
permissionMode: z39.optional(z39.string()),
|
|
10486
|
+
skills: z39.optional(z39.union([z39.string(), z39.array(z39.string())]))
|
|
10158
10487
|
});
|
|
10159
10488
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
10160
10489
|
frontmatter;
|
|
@@ -10164,7 +10493,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
10164
10493
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
10165
10494
|
if (!result.success) {
|
|
10166
10495
|
throw new Error(
|
|
10167
|
-
`Invalid frontmatter in ${
|
|
10496
|
+
`Invalid frontmatter in ${join80(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
10168
10497
|
);
|
|
10169
10498
|
}
|
|
10170
10499
|
}
|
|
@@ -10176,7 +10505,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
10176
10505
|
}
|
|
10177
10506
|
static getSettablePaths(_options = {}) {
|
|
10178
10507
|
return {
|
|
10179
|
-
relativeDirPath:
|
|
10508
|
+
relativeDirPath: join80(".claude", "agents")
|
|
10180
10509
|
};
|
|
10181
10510
|
}
|
|
10182
10511
|
getFrontmatter() {
|
|
@@ -10252,7 +10581,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
10252
10581
|
return {
|
|
10253
10582
|
success: false,
|
|
10254
10583
|
error: new Error(
|
|
10255
|
-
`Invalid frontmatter in ${
|
|
10584
|
+
`Invalid frontmatter in ${join80(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
10256
10585
|
)
|
|
10257
10586
|
};
|
|
10258
10587
|
}
|
|
@@ -10270,7 +10599,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
10270
10599
|
global = false
|
|
10271
10600
|
}) {
|
|
10272
10601
|
const paths = this.getSettablePaths({ global });
|
|
10273
|
-
const filePath =
|
|
10602
|
+
const filePath = join80(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
10274
10603
|
const fileContent = await readFileContent(filePath);
|
|
10275
10604
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
10276
10605
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -10305,20 +10634,31 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
10305
10634
|
};
|
|
10306
10635
|
|
|
10307
10636
|
// src/features/subagents/codexcli-subagent.ts
|
|
10308
|
-
import { join as
|
|
10637
|
+
import { join as join81 } from "path";
|
|
10309
10638
|
import * as smolToml2 from "smol-toml";
|
|
10310
|
-
import { z as
|
|
10311
|
-
var CodexCliSubagentTomlSchema =
|
|
10312
|
-
name:
|
|
10313
|
-
description:
|
|
10314
|
-
developer_instructions:
|
|
10315
|
-
model:
|
|
10316
|
-
model_reasoning_effort:
|
|
10317
|
-
sandbox_mode:
|
|
10639
|
+
import { z as z40 } from "zod/mini";
|
|
10640
|
+
var CodexCliSubagentTomlSchema = z40.looseObject({
|
|
10641
|
+
name: z40.string(),
|
|
10642
|
+
description: z40.optional(z40.string()),
|
|
10643
|
+
developer_instructions: z40.optional(z40.string()),
|
|
10644
|
+
model: z40.optional(z40.string()),
|
|
10645
|
+
model_reasoning_effort: z40.optional(z40.string()),
|
|
10646
|
+
sandbox_mode: z40.optional(z40.string())
|
|
10318
10647
|
});
|
|
10319
10648
|
var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
10320
10649
|
body;
|
|
10321
10650
|
constructor({ body, ...rest }) {
|
|
10651
|
+
if (rest.validate !== false) {
|
|
10652
|
+
try {
|
|
10653
|
+
const parsed = smolToml2.parse(body);
|
|
10654
|
+
CodexCliSubagentTomlSchema.parse(parsed);
|
|
10655
|
+
} catch (error) {
|
|
10656
|
+
throw new Error(
|
|
10657
|
+
`Invalid TOML in ${join81(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
10658
|
+
{ cause: error }
|
|
10659
|
+
);
|
|
10660
|
+
}
|
|
10661
|
+
}
|
|
10322
10662
|
super({
|
|
10323
10663
|
...rest
|
|
10324
10664
|
});
|
|
@@ -10326,7 +10666,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
10326
10666
|
}
|
|
10327
10667
|
static getSettablePaths(_options = {}) {
|
|
10328
10668
|
return {
|
|
10329
|
-
relativeDirPath:
|
|
10669
|
+
relativeDirPath: join81(".codex", "agents")
|
|
10330
10670
|
};
|
|
10331
10671
|
}
|
|
10332
10672
|
getBody() {
|
|
@@ -10338,7 +10678,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
10338
10678
|
parsed = CodexCliSubagentTomlSchema.parse(smolToml2.parse(this.body));
|
|
10339
10679
|
} catch (error) {
|
|
10340
10680
|
throw new Error(
|
|
10341
|
-
`Failed to parse TOML in ${
|
|
10681
|
+
`Failed to parse TOML in ${join81(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
10342
10682
|
{ cause: error }
|
|
10343
10683
|
);
|
|
10344
10684
|
}
|
|
@@ -10370,12 +10710,11 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
10370
10710
|
}) {
|
|
10371
10711
|
const frontmatter = rulesyncSubagent.getFrontmatter();
|
|
10372
10712
|
const rawSection = frontmatter.codexcli ?? {};
|
|
10373
|
-
const
|
|
10374
|
-
name
|
|
10375
|
-
description
|
|
10376
|
-
developer_instructions
|
|
10377
|
-
|
|
10378
|
-
} = rawSection;
|
|
10713
|
+
const codexcliSection = this.filterToolSpecificSection(rawSection, [
|
|
10714
|
+
"name",
|
|
10715
|
+
"description",
|
|
10716
|
+
"developer_instructions"
|
|
10717
|
+
]);
|
|
10379
10718
|
const tomlObj = {
|
|
10380
10719
|
name: frontmatter.name,
|
|
10381
10720
|
...frontmatter.description ? { description: frontmatter.description } : {},
|
|
@@ -10420,9 +10759,9 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
10420
10759
|
global = false
|
|
10421
10760
|
}) {
|
|
10422
10761
|
const paths = this.getSettablePaths({ global });
|
|
10423
|
-
const filePath =
|
|
10762
|
+
const filePath = join81(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
10424
10763
|
const fileContent = await readFileContent(filePath);
|
|
10425
|
-
|
|
10764
|
+
const subagent = new _CodexCliSubagent({
|
|
10426
10765
|
baseDir,
|
|
10427
10766
|
relativeDirPath: paths.relativeDirPath,
|
|
10428
10767
|
relativeFilePath,
|
|
@@ -10431,6 +10770,15 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
10431
10770
|
validate,
|
|
10432
10771
|
global
|
|
10433
10772
|
});
|
|
10773
|
+
if (validate) {
|
|
10774
|
+
const result = subagent.validate();
|
|
10775
|
+
if (!result.success) {
|
|
10776
|
+
throw new Error(
|
|
10777
|
+
`Invalid TOML in ${filePath}: ${result.error instanceof Error ? result.error.message : String(result.error)}`
|
|
10778
|
+
);
|
|
10779
|
+
}
|
|
10780
|
+
}
|
|
10781
|
+
return subagent;
|
|
10434
10782
|
}
|
|
10435
10783
|
static forDeletion({
|
|
10436
10784
|
baseDir = process.cwd(),
|
|
@@ -10449,13 +10797,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
10449
10797
|
};
|
|
10450
10798
|
|
|
10451
10799
|
// src/features/subagents/copilot-subagent.ts
|
|
10452
|
-
import { join as
|
|
10453
|
-
import { z as
|
|
10800
|
+
import { join as join82 } from "path";
|
|
10801
|
+
import { z as z41 } from "zod/mini";
|
|
10454
10802
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
10455
|
-
var CopilotSubagentFrontmatterSchema =
|
|
10456
|
-
name:
|
|
10457
|
-
description:
|
|
10458
|
-
tools:
|
|
10803
|
+
var CopilotSubagentFrontmatterSchema = z41.looseObject({
|
|
10804
|
+
name: z41.string(),
|
|
10805
|
+
description: z41.string(),
|
|
10806
|
+
tools: z41.optional(z41.union([z41.string(), z41.array(z41.string())]))
|
|
10459
10807
|
});
|
|
10460
10808
|
var normalizeTools = (tools) => {
|
|
10461
10809
|
if (!tools) {
|
|
@@ -10475,7 +10823,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
10475
10823
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
10476
10824
|
if (!result.success) {
|
|
10477
10825
|
throw new Error(
|
|
10478
|
-
`Invalid frontmatter in ${
|
|
10826
|
+
`Invalid frontmatter in ${join82(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
10479
10827
|
);
|
|
10480
10828
|
}
|
|
10481
10829
|
}
|
|
@@ -10487,7 +10835,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
10487
10835
|
}
|
|
10488
10836
|
static getSettablePaths(_options = {}) {
|
|
10489
10837
|
return {
|
|
10490
|
-
relativeDirPath:
|
|
10838
|
+
relativeDirPath: join82(".github", "agents")
|
|
10491
10839
|
};
|
|
10492
10840
|
}
|
|
10493
10841
|
getFrontmatter() {
|
|
@@ -10561,7 +10909,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
10561
10909
|
return {
|
|
10562
10910
|
success: false,
|
|
10563
10911
|
error: new Error(
|
|
10564
|
-
`Invalid frontmatter in ${
|
|
10912
|
+
`Invalid frontmatter in ${join82(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
10565
10913
|
)
|
|
10566
10914
|
};
|
|
10567
10915
|
}
|
|
@@ -10579,7 +10927,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
10579
10927
|
global = false
|
|
10580
10928
|
}) {
|
|
10581
10929
|
const paths = this.getSettablePaths({ global });
|
|
10582
|
-
const filePath =
|
|
10930
|
+
const filePath = join82(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
10583
10931
|
const fileContent = await readFileContent(filePath);
|
|
10584
10932
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
10585
10933
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -10615,11 +10963,11 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
10615
10963
|
};
|
|
10616
10964
|
|
|
10617
10965
|
// src/features/subagents/cursor-subagent.ts
|
|
10618
|
-
import { join as
|
|
10619
|
-
import { z as
|
|
10620
|
-
var CursorSubagentFrontmatterSchema =
|
|
10621
|
-
name:
|
|
10622
|
-
description:
|
|
10966
|
+
import { join as join83 } from "path";
|
|
10967
|
+
import { z as z42 } from "zod/mini";
|
|
10968
|
+
var CursorSubagentFrontmatterSchema = z42.looseObject({
|
|
10969
|
+
name: z42.string(),
|
|
10970
|
+
description: z42.string()
|
|
10623
10971
|
});
|
|
10624
10972
|
var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
10625
10973
|
frontmatter;
|
|
@@ -10629,7 +10977,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
10629
10977
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
10630
10978
|
if (!result.success) {
|
|
10631
10979
|
throw new Error(
|
|
10632
|
-
`Invalid frontmatter in ${
|
|
10980
|
+
`Invalid frontmatter in ${join83(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
10633
10981
|
);
|
|
10634
10982
|
}
|
|
10635
10983
|
}
|
|
@@ -10641,7 +10989,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
10641
10989
|
}
|
|
10642
10990
|
static getSettablePaths(_options = {}) {
|
|
10643
10991
|
return {
|
|
10644
|
-
relativeDirPath:
|
|
10992
|
+
relativeDirPath: join83(".cursor", "agents")
|
|
10645
10993
|
};
|
|
10646
10994
|
}
|
|
10647
10995
|
getFrontmatter() {
|
|
@@ -10708,7 +11056,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
10708
11056
|
return {
|
|
10709
11057
|
success: false,
|
|
10710
11058
|
error: new Error(
|
|
10711
|
-
`Invalid frontmatter in ${
|
|
11059
|
+
`Invalid frontmatter in ${join83(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
10712
11060
|
)
|
|
10713
11061
|
};
|
|
10714
11062
|
}
|
|
@@ -10726,7 +11074,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
10726
11074
|
global = false
|
|
10727
11075
|
}) {
|
|
10728
11076
|
const paths = this.getSettablePaths({ global });
|
|
10729
|
-
const filePath =
|
|
11077
|
+
const filePath = join83(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
10730
11078
|
const fileContent = await readFileContent(filePath);
|
|
10731
11079
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
10732
11080
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -10762,27 +11110,38 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
10762
11110
|
};
|
|
10763
11111
|
|
|
10764
11112
|
// src/features/subagents/kiro-subagent.ts
|
|
10765
|
-
import { join as
|
|
10766
|
-
import { z as
|
|
10767
|
-
var KiroCliSubagentJsonSchema =
|
|
10768
|
-
name:
|
|
10769
|
-
description:
|
|
10770
|
-
prompt:
|
|
10771
|
-
tools:
|
|
10772
|
-
toolAliases:
|
|
10773
|
-
toolSettings:
|
|
10774
|
-
toolSchema:
|
|
10775
|
-
hooks:
|
|
10776
|
-
model:
|
|
10777
|
-
mcpServers:
|
|
10778
|
-
useLegacyMcpJson:
|
|
10779
|
-
resources:
|
|
10780
|
-
allowedTools:
|
|
10781
|
-
includeMcpJson:
|
|
11113
|
+
import { join as join84 } from "path";
|
|
11114
|
+
import { z as z43 } from "zod/mini";
|
|
11115
|
+
var KiroCliSubagentJsonSchema = z43.looseObject({
|
|
11116
|
+
name: z43.string(),
|
|
11117
|
+
description: z43.optional(z43.nullable(z43.string())),
|
|
11118
|
+
prompt: z43.optional(z43.nullable(z43.string())),
|
|
11119
|
+
tools: z43.optional(z43.nullable(z43.array(z43.string()))),
|
|
11120
|
+
toolAliases: z43.optional(z43.nullable(z43.record(z43.string(), z43.string()))),
|
|
11121
|
+
toolSettings: z43.optional(z43.nullable(z43.unknown())),
|
|
11122
|
+
toolSchema: z43.optional(z43.nullable(z43.unknown())),
|
|
11123
|
+
hooks: z43.optional(z43.nullable(z43.record(z43.string(), z43.array(z43.unknown())))),
|
|
11124
|
+
model: z43.optional(z43.nullable(z43.string())),
|
|
11125
|
+
mcpServers: z43.optional(z43.nullable(z43.record(z43.string(), z43.unknown()))),
|
|
11126
|
+
useLegacyMcpJson: z43.optional(z43.nullable(z43.boolean())),
|
|
11127
|
+
resources: z43.optional(z43.nullable(z43.array(z43.string()))),
|
|
11128
|
+
allowedTools: z43.optional(z43.nullable(z43.array(z43.string()))),
|
|
11129
|
+
includeMcpJson: z43.optional(z43.nullable(z43.boolean()))
|
|
10782
11130
|
});
|
|
10783
11131
|
var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
10784
11132
|
body;
|
|
10785
11133
|
constructor({ body, ...rest }) {
|
|
11134
|
+
if (rest.validate !== false) {
|
|
11135
|
+
try {
|
|
11136
|
+
const parsed = JSON.parse(body);
|
|
11137
|
+
KiroCliSubagentJsonSchema.parse(parsed);
|
|
11138
|
+
} catch (error) {
|
|
11139
|
+
throw new Error(
|
|
11140
|
+
`Invalid JSON in ${join84(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
11141
|
+
{ cause: error }
|
|
11142
|
+
);
|
|
11143
|
+
}
|
|
11144
|
+
}
|
|
10786
11145
|
super({
|
|
10787
11146
|
...rest
|
|
10788
11147
|
});
|
|
@@ -10790,14 +11149,22 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
10790
11149
|
}
|
|
10791
11150
|
static getSettablePaths(_options = {}) {
|
|
10792
11151
|
return {
|
|
10793
|
-
relativeDirPath:
|
|
11152
|
+
relativeDirPath: join84(".kiro", "agents")
|
|
10794
11153
|
};
|
|
10795
11154
|
}
|
|
10796
11155
|
getBody() {
|
|
10797
11156
|
return this.body;
|
|
10798
11157
|
}
|
|
10799
11158
|
toRulesyncSubagent() {
|
|
10800
|
-
|
|
11159
|
+
let parsed;
|
|
11160
|
+
try {
|
|
11161
|
+
parsed = JSON.parse(this.body);
|
|
11162
|
+
} catch (error) {
|
|
11163
|
+
throw new Error(
|
|
11164
|
+
`Failed to parse JSON in ${join84(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
11165
|
+
{ cause: error }
|
|
11166
|
+
);
|
|
11167
|
+
}
|
|
10801
11168
|
const { name, description, prompt, ...restFields } = parsed;
|
|
10802
11169
|
const kiroSection = {
|
|
10803
11170
|
...restFields
|
|
@@ -10825,7 +11192,12 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
10825
11192
|
global = false
|
|
10826
11193
|
}) {
|
|
10827
11194
|
const frontmatter = rulesyncSubagent.getFrontmatter();
|
|
10828
|
-
const
|
|
11195
|
+
const rawSection = frontmatter.kiro ?? {};
|
|
11196
|
+
const kiroSection = this.filterToolSpecificSection(rawSection, [
|
|
11197
|
+
"name",
|
|
11198
|
+
"description",
|
|
11199
|
+
"prompt"
|
|
11200
|
+
]);
|
|
10829
11201
|
const json = {
|
|
10830
11202
|
name: frontmatter.name,
|
|
10831
11203
|
description: frontmatter.description || null,
|
|
@@ -10870,9 +11242,9 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
10870
11242
|
global = false
|
|
10871
11243
|
}) {
|
|
10872
11244
|
const paths = this.getSettablePaths({ global });
|
|
10873
|
-
const filePath =
|
|
11245
|
+
const filePath = join84(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
10874
11246
|
const fileContent = await readFileContent(filePath);
|
|
10875
|
-
|
|
11247
|
+
const subagent = new _KiroSubagent({
|
|
10876
11248
|
baseDir,
|
|
10877
11249
|
relativeDirPath: paths.relativeDirPath,
|
|
10878
11250
|
relativeFilePath,
|
|
@@ -10881,6 +11253,15 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
10881
11253
|
validate,
|
|
10882
11254
|
global
|
|
10883
11255
|
});
|
|
11256
|
+
if (validate) {
|
|
11257
|
+
const result = subagent.validate();
|
|
11258
|
+
if (!result.success) {
|
|
11259
|
+
throw new Error(
|
|
11260
|
+
`Invalid JSON in ${filePath}: ${result.error instanceof Error ? result.error.message : String(result.error)}`
|
|
11261
|
+
);
|
|
11262
|
+
}
|
|
11263
|
+
}
|
|
11264
|
+
return subagent;
|
|
10884
11265
|
}
|
|
10885
11266
|
static forDeletion({
|
|
10886
11267
|
baseDir = process.cwd(),
|
|
@@ -10899,12 +11280,12 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
10899
11280
|
};
|
|
10900
11281
|
|
|
10901
11282
|
// src/features/subagents/opencode-subagent.ts
|
|
10902
|
-
import { basename as basename8, join as
|
|
10903
|
-
import { z as
|
|
10904
|
-
var OpenCodeSubagentFrontmatterSchema =
|
|
10905
|
-
description:
|
|
10906
|
-
mode:
|
|
10907
|
-
name:
|
|
11283
|
+
import { basename as basename8, join as join85 } from "path";
|
|
11284
|
+
import { z as z44 } from "zod/mini";
|
|
11285
|
+
var OpenCodeSubagentFrontmatterSchema = z44.looseObject({
|
|
11286
|
+
description: z44.string(),
|
|
11287
|
+
mode: z44._default(z44.string(), "subagent"),
|
|
11288
|
+
name: z44.optional(z44.string())
|
|
10908
11289
|
});
|
|
10909
11290
|
var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
10910
11291
|
frontmatter;
|
|
@@ -10914,7 +11295,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
10914
11295
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
10915
11296
|
if (!result.success) {
|
|
10916
11297
|
throw new Error(
|
|
10917
|
-
`Invalid frontmatter in ${
|
|
11298
|
+
`Invalid frontmatter in ${join85(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
10918
11299
|
);
|
|
10919
11300
|
}
|
|
10920
11301
|
}
|
|
@@ -10928,7 +11309,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
10928
11309
|
global = false
|
|
10929
11310
|
} = {}) {
|
|
10930
11311
|
return {
|
|
10931
|
-
relativeDirPath: global ?
|
|
11312
|
+
relativeDirPath: global ? join85(".config", "opencode", "agent") : join85(".opencode", "agent")
|
|
10932
11313
|
};
|
|
10933
11314
|
}
|
|
10934
11315
|
getFrontmatter() {
|
|
@@ -10994,7 +11375,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
10994
11375
|
return {
|
|
10995
11376
|
success: false,
|
|
10996
11377
|
error: new Error(
|
|
10997
|
-
`Invalid frontmatter in ${
|
|
11378
|
+
`Invalid frontmatter in ${join85(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
10998
11379
|
)
|
|
10999
11380
|
};
|
|
11000
11381
|
}
|
|
@@ -11011,7 +11392,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
11011
11392
|
global = false
|
|
11012
11393
|
}) {
|
|
11013
11394
|
const paths = this.getSettablePaths({ global });
|
|
11014
|
-
const filePath =
|
|
11395
|
+
const filePath = join85(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11015
11396
|
const fileContent = await readFileContent(filePath);
|
|
11016
11397
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
11017
11398
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -11060,7 +11441,7 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
11060
11441
|
"opencode",
|
|
11061
11442
|
"roo"
|
|
11062
11443
|
];
|
|
11063
|
-
var SubagentsProcessorToolTargetSchema =
|
|
11444
|
+
var SubagentsProcessorToolTargetSchema = z45.enum(subagentsProcessorToolTargetTuple);
|
|
11064
11445
|
var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
11065
11446
|
[
|
|
11066
11447
|
"agentsmd",
|
|
@@ -11222,7 +11603,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
11222
11603
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
11223
11604
|
*/
|
|
11224
11605
|
async loadRulesyncFiles() {
|
|
11225
|
-
const subagentsDir =
|
|
11606
|
+
const subagentsDir = join86(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
11226
11607
|
const dirExists = await directoryExists(subagentsDir);
|
|
11227
11608
|
if (!dirExists) {
|
|
11228
11609
|
logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -11237,7 +11618,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
11237
11618
|
logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
11238
11619
|
const rulesyncSubagents = [];
|
|
11239
11620
|
for (const mdFile of mdFiles) {
|
|
11240
|
-
const filepath =
|
|
11621
|
+
const filepath = join86(subagentsDir, mdFile);
|
|
11241
11622
|
try {
|
|
11242
11623
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
11243
11624
|
relativeFilePath: mdFile,
|
|
@@ -11267,7 +11648,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
11267
11648
|
const factory = this.getFactory(this.toolTarget);
|
|
11268
11649
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
11269
11650
|
const subagentFilePaths = await findFilesByGlobs(
|
|
11270
|
-
|
|
11651
|
+
join86(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
|
|
11271
11652
|
);
|
|
11272
11653
|
if (forDeletion) {
|
|
11273
11654
|
const toolSubagents2 = subagentFilePaths.map(
|
|
@@ -11332,49 +11713,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
11332
11713
|
};
|
|
11333
11714
|
|
|
11334
11715
|
// src/features/rules/agentsmd-rule.ts
|
|
11335
|
-
import { join as
|
|
11716
|
+
import { join as join89 } from "path";
|
|
11336
11717
|
|
|
11337
11718
|
// src/features/rules/tool-rule.ts
|
|
11338
|
-
import { join as
|
|
11719
|
+
import { join as join88 } from "path";
|
|
11339
11720
|
|
|
11340
11721
|
// src/features/rules/rulesync-rule.ts
|
|
11341
|
-
import { join as
|
|
11342
|
-
import { z as
|
|
11343
|
-
var RulesyncRuleFrontmatterSchema =
|
|
11344
|
-
root:
|
|
11345
|
-
localRoot:
|
|
11346
|
-
targets:
|
|
11347
|
-
description:
|
|
11348
|
-
globs:
|
|
11349
|
-
agentsmd:
|
|
11350
|
-
|
|
11722
|
+
import { join as join87 } from "path";
|
|
11723
|
+
import { z as z46 } from "zod/mini";
|
|
11724
|
+
var RulesyncRuleFrontmatterSchema = z46.object({
|
|
11725
|
+
root: z46.optional(z46.boolean()),
|
|
11726
|
+
localRoot: z46.optional(z46.boolean()),
|
|
11727
|
+
targets: z46._default(RulesyncTargetsSchema, ["*"]),
|
|
11728
|
+
description: z46.optional(z46.string()),
|
|
11729
|
+
globs: z46.optional(z46.array(z46.string())),
|
|
11730
|
+
agentsmd: z46.optional(
|
|
11731
|
+
z46.object({
|
|
11351
11732
|
// @example "path/to/subproject"
|
|
11352
|
-
subprojectPath:
|
|
11733
|
+
subprojectPath: z46.optional(z46.string())
|
|
11353
11734
|
})
|
|
11354
11735
|
),
|
|
11355
|
-
claudecode:
|
|
11356
|
-
|
|
11736
|
+
claudecode: z46.optional(
|
|
11737
|
+
z46.object({
|
|
11357
11738
|
// Glob patterns for conditional rules (takes precedence over globs)
|
|
11358
11739
|
// @example ["src/**/*.ts", "tests/**/*.test.ts"]
|
|
11359
|
-
paths:
|
|
11740
|
+
paths: z46.optional(z46.array(z46.string()))
|
|
11360
11741
|
})
|
|
11361
11742
|
),
|
|
11362
|
-
cursor:
|
|
11363
|
-
|
|
11364
|
-
alwaysApply:
|
|
11365
|
-
description:
|
|
11366
|
-
globs:
|
|
11743
|
+
cursor: z46.optional(
|
|
11744
|
+
z46.object({
|
|
11745
|
+
alwaysApply: z46.optional(z46.boolean()),
|
|
11746
|
+
description: z46.optional(z46.string()),
|
|
11747
|
+
globs: z46.optional(z46.array(z46.string()))
|
|
11367
11748
|
})
|
|
11368
11749
|
),
|
|
11369
|
-
copilot:
|
|
11370
|
-
|
|
11371
|
-
excludeAgent:
|
|
11750
|
+
copilot: z46.optional(
|
|
11751
|
+
z46.object({
|
|
11752
|
+
excludeAgent: z46.optional(z46.union([z46.literal("code-review"), z46.literal("coding-agent")]))
|
|
11372
11753
|
})
|
|
11373
11754
|
),
|
|
11374
|
-
antigravity:
|
|
11375
|
-
|
|
11376
|
-
trigger:
|
|
11377
|
-
globs:
|
|
11755
|
+
antigravity: z46.optional(
|
|
11756
|
+
z46.looseObject({
|
|
11757
|
+
trigger: z46.optional(z46.string()),
|
|
11758
|
+
globs: z46.optional(z46.array(z46.string()))
|
|
11378
11759
|
})
|
|
11379
11760
|
)
|
|
11380
11761
|
});
|
|
@@ -11385,7 +11766,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
11385
11766
|
const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
11386
11767
|
if (!parseResult.success && rest.validate !== false) {
|
|
11387
11768
|
throw new Error(
|
|
11388
|
-
`Invalid frontmatter in ${
|
|
11769
|
+
`Invalid frontmatter in ${join87(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
11389
11770
|
);
|
|
11390
11771
|
}
|
|
11391
11772
|
const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
|
|
@@ -11420,7 +11801,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
11420
11801
|
return {
|
|
11421
11802
|
success: false,
|
|
11422
11803
|
error: new Error(
|
|
11423
|
-
`Invalid frontmatter in ${
|
|
11804
|
+
`Invalid frontmatter in ${join87(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11424
11805
|
)
|
|
11425
11806
|
};
|
|
11426
11807
|
}
|
|
@@ -11429,7 +11810,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
11429
11810
|
relativeFilePath,
|
|
11430
11811
|
validate = true
|
|
11431
11812
|
}) {
|
|
11432
|
-
const filePath =
|
|
11813
|
+
const filePath = join87(
|
|
11433
11814
|
process.cwd(),
|
|
11434
11815
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
11435
11816
|
relativeFilePath
|
|
@@ -11531,7 +11912,7 @@ var ToolRule = class extends ToolFile {
|
|
|
11531
11912
|
rulesyncRule,
|
|
11532
11913
|
validate = true,
|
|
11533
11914
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
11534
|
-
nonRootPath = { relativeDirPath:
|
|
11915
|
+
nonRootPath = { relativeDirPath: join88(".agents", "memories") }
|
|
11535
11916
|
}) {
|
|
11536
11917
|
const params = this.buildToolRuleParamsDefault({
|
|
11537
11918
|
baseDir,
|
|
@@ -11542,7 +11923,7 @@ var ToolRule = class extends ToolFile {
|
|
|
11542
11923
|
});
|
|
11543
11924
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
11544
11925
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
11545
|
-
params.relativeDirPath =
|
|
11926
|
+
params.relativeDirPath = join88(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
11546
11927
|
params.relativeFilePath = "AGENTS.md";
|
|
11547
11928
|
}
|
|
11548
11929
|
return params;
|
|
@@ -11591,7 +11972,7 @@ var ToolRule = class extends ToolFile {
|
|
|
11591
11972
|
}
|
|
11592
11973
|
};
|
|
11593
11974
|
function buildToolPath(toolDir, subDir, excludeToolDir) {
|
|
11594
|
-
return excludeToolDir ? subDir :
|
|
11975
|
+
return excludeToolDir ? subDir : join88(toolDir, subDir);
|
|
11595
11976
|
}
|
|
11596
11977
|
|
|
11597
11978
|
// src/features/rules/agentsmd-rule.ts
|
|
@@ -11620,8 +12001,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
11620
12001
|
validate = true
|
|
11621
12002
|
}) {
|
|
11622
12003
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
11623
|
-
const relativePath = isRoot ? "AGENTS.md" :
|
|
11624
|
-
const fileContent = await readFileContent(
|
|
12004
|
+
const relativePath = isRoot ? "AGENTS.md" : join89(".agents", "memories", relativeFilePath);
|
|
12005
|
+
const fileContent = await readFileContent(join89(baseDir, relativePath));
|
|
11625
12006
|
return new _AgentsMdRule({
|
|
11626
12007
|
baseDir,
|
|
11627
12008
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -11676,21 +12057,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
11676
12057
|
};
|
|
11677
12058
|
|
|
11678
12059
|
// src/features/rules/antigravity-rule.ts
|
|
11679
|
-
import { join as
|
|
11680
|
-
import { z as
|
|
11681
|
-
var AntigravityRuleFrontmatterSchema =
|
|
11682
|
-
trigger:
|
|
11683
|
-
|
|
11684
|
-
|
|
11685
|
-
|
|
11686
|
-
|
|
11687
|
-
|
|
11688
|
-
|
|
12060
|
+
import { join as join90 } from "path";
|
|
12061
|
+
import { z as z47 } from "zod/mini";
|
|
12062
|
+
var AntigravityRuleFrontmatterSchema = z47.looseObject({
|
|
12063
|
+
trigger: z47.optional(
|
|
12064
|
+
z47.union([
|
|
12065
|
+
z47.literal("always_on"),
|
|
12066
|
+
z47.literal("glob"),
|
|
12067
|
+
z47.literal("manual"),
|
|
12068
|
+
z47.literal("model_decision"),
|
|
12069
|
+
z47.string()
|
|
11689
12070
|
// accepts any string for forward compatibility
|
|
11690
12071
|
])
|
|
11691
12072
|
),
|
|
11692
|
-
globs:
|
|
11693
|
-
description:
|
|
12073
|
+
globs: z47.optional(z47.string()),
|
|
12074
|
+
description: z47.optional(z47.string())
|
|
11694
12075
|
});
|
|
11695
12076
|
function parseGlobsString(globs) {
|
|
11696
12077
|
if (!globs) {
|
|
@@ -11835,7 +12216,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
11835
12216
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
11836
12217
|
if (!result.success) {
|
|
11837
12218
|
throw new Error(
|
|
11838
|
-
`Invalid frontmatter in ${
|
|
12219
|
+
`Invalid frontmatter in ${join90(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11839
12220
|
);
|
|
11840
12221
|
}
|
|
11841
12222
|
}
|
|
@@ -11859,7 +12240,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
11859
12240
|
relativeFilePath,
|
|
11860
12241
|
validate = true
|
|
11861
12242
|
}) {
|
|
11862
|
-
const filePath =
|
|
12243
|
+
const filePath = join90(
|
|
11863
12244
|
baseDir,
|
|
11864
12245
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
11865
12246
|
relativeFilePath
|
|
@@ -12000,7 +12381,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
12000
12381
|
};
|
|
12001
12382
|
|
|
12002
12383
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
12003
|
-
import { join as
|
|
12384
|
+
import { join as join91 } from "path";
|
|
12004
12385
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
12005
12386
|
toRulesyncRule() {
|
|
12006
12387
|
const rulesyncFrontmatter = {
|
|
@@ -12061,8 +12442,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
12061
12442
|
}) {
|
|
12062
12443
|
const settablePaths = this.getSettablePaths();
|
|
12063
12444
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
12064
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath :
|
|
12065
|
-
const fileContent = await readFileContent(
|
|
12445
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : join91(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
12446
|
+
const fileContent = await readFileContent(join91(baseDir, relativePath));
|
|
12066
12447
|
return new _AugmentcodeLegacyRule({
|
|
12067
12448
|
baseDir,
|
|
12068
12449
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -12091,7 +12472,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
12091
12472
|
};
|
|
12092
12473
|
|
|
12093
12474
|
// src/features/rules/augmentcode-rule.ts
|
|
12094
|
-
import { join as
|
|
12475
|
+
import { join as join92 } from "path";
|
|
12095
12476
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
12096
12477
|
toRulesyncRule() {
|
|
12097
12478
|
return this.toRulesyncRuleDefault();
|
|
@@ -12123,7 +12504,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
12123
12504
|
validate = true
|
|
12124
12505
|
}) {
|
|
12125
12506
|
const fileContent = await readFileContent(
|
|
12126
|
-
|
|
12507
|
+
join92(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
12127
12508
|
);
|
|
12128
12509
|
const { body: content } = parseFrontmatter(fileContent);
|
|
12129
12510
|
return new _AugmentcodeRule({
|
|
@@ -12159,7 +12540,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
12159
12540
|
};
|
|
12160
12541
|
|
|
12161
12542
|
// src/features/rules/claudecode-legacy-rule.ts
|
|
12162
|
-
import { join as
|
|
12543
|
+
import { join as join93 } from "path";
|
|
12163
12544
|
var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
12164
12545
|
static getSettablePaths({
|
|
12165
12546
|
global,
|
|
@@ -12194,7 +12575,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
12194
12575
|
if (isRoot) {
|
|
12195
12576
|
const relativePath2 = paths.root.relativeFilePath;
|
|
12196
12577
|
const fileContent2 = await readFileContent(
|
|
12197
|
-
|
|
12578
|
+
join93(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
12198
12579
|
);
|
|
12199
12580
|
return new _ClaudecodeLegacyRule({
|
|
12200
12581
|
baseDir,
|
|
@@ -12208,8 +12589,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
12208
12589
|
if (!paths.nonRoot) {
|
|
12209
12590
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
12210
12591
|
}
|
|
12211
|
-
const relativePath =
|
|
12212
|
-
const fileContent = await readFileContent(
|
|
12592
|
+
const relativePath = join93(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
12593
|
+
const fileContent = await readFileContent(join93(baseDir, relativePath));
|
|
12213
12594
|
return new _ClaudecodeLegacyRule({
|
|
12214
12595
|
baseDir,
|
|
12215
12596
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -12268,10 +12649,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
12268
12649
|
};
|
|
12269
12650
|
|
|
12270
12651
|
// src/features/rules/claudecode-rule.ts
|
|
12271
|
-
import { join as
|
|
12272
|
-
import { z as
|
|
12273
|
-
var ClaudecodeRuleFrontmatterSchema =
|
|
12274
|
-
paths:
|
|
12652
|
+
import { join as join94 } from "path";
|
|
12653
|
+
import { z as z48 } from "zod/mini";
|
|
12654
|
+
var ClaudecodeRuleFrontmatterSchema = z48.object({
|
|
12655
|
+
paths: z48.optional(z48.array(z48.string()))
|
|
12275
12656
|
});
|
|
12276
12657
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
12277
12658
|
frontmatter;
|
|
@@ -12303,7 +12684,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
12303
12684
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
12304
12685
|
if (!result.success) {
|
|
12305
12686
|
throw new Error(
|
|
12306
|
-
`Invalid frontmatter in ${
|
|
12687
|
+
`Invalid frontmatter in ${join94(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
12307
12688
|
);
|
|
12308
12689
|
}
|
|
12309
12690
|
}
|
|
@@ -12331,7 +12712,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
12331
12712
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
12332
12713
|
if (isRoot) {
|
|
12333
12714
|
const fileContent2 = await readFileContent(
|
|
12334
|
-
|
|
12715
|
+
join94(baseDir, paths.root.relativeDirPath, paths.root.relativeFilePath)
|
|
12335
12716
|
);
|
|
12336
12717
|
return new _ClaudecodeRule({
|
|
12337
12718
|
baseDir,
|
|
@@ -12346,13 +12727,13 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
12346
12727
|
if (!paths.nonRoot) {
|
|
12347
12728
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
12348
12729
|
}
|
|
12349
|
-
const relativePath =
|
|
12350
|
-
const fileContent = await readFileContent(
|
|
12730
|
+
const relativePath = join94(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
12731
|
+
const fileContent = await readFileContent(join94(baseDir, relativePath));
|
|
12351
12732
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
12352
12733
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
12353
12734
|
if (!result.success) {
|
|
12354
12735
|
throw new Error(
|
|
12355
|
-
`Invalid frontmatter in ${
|
|
12736
|
+
`Invalid frontmatter in ${join94(baseDir, relativePath)}: ${formatError(result.error)}`
|
|
12356
12737
|
);
|
|
12357
12738
|
}
|
|
12358
12739
|
return new _ClaudecodeRule({
|
|
@@ -12459,7 +12840,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
12459
12840
|
return {
|
|
12460
12841
|
success: false,
|
|
12461
12842
|
error: new Error(
|
|
12462
|
-
`Invalid frontmatter in ${
|
|
12843
|
+
`Invalid frontmatter in ${join94(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
12463
12844
|
)
|
|
12464
12845
|
};
|
|
12465
12846
|
}
|
|
@@ -12479,10 +12860,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
12479
12860
|
};
|
|
12480
12861
|
|
|
12481
12862
|
// src/features/rules/cline-rule.ts
|
|
12482
|
-
import { join as
|
|
12483
|
-
import { z as
|
|
12484
|
-
var ClineRuleFrontmatterSchema =
|
|
12485
|
-
description:
|
|
12863
|
+
import { join as join95 } from "path";
|
|
12864
|
+
import { z as z49 } from "zod/mini";
|
|
12865
|
+
var ClineRuleFrontmatterSchema = z49.object({
|
|
12866
|
+
description: z49.string()
|
|
12486
12867
|
});
|
|
12487
12868
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
12488
12869
|
static getSettablePaths(_options = {}) {
|
|
@@ -12525,7 +12906,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
12525
12906
|
validate = true
|
|
12526
12907
|
}) {
|
|
12527
12908
|
const fileContent = await readFileContent(
|
|
12528
|
-
|
|
12909
|
+
join95(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
12529
12910
|
);
|
|
12530
12911
|
return new _ClineRule({
|
|
12531
12912
|
baseDir,
|
|
@@ -12551,7 +12932,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
12551
12932
|
};
|
|
12552
12933
|
|
|
12553
12934
|
// src/features/rules/codexcli-rule.ts
|
|
12554
|
-
import { join as
|
|
12935
|
+
import { join as join96 } from "path";
|
|
12555
12936
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
12556
12937
|
static getSettablePaths({
|
|
12557
12938
|
global,
|
|
@@ -12586,7 +12967,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
12586
12967
|
if (isRoot) {
|
|
12587
12968
|
const relativePath2 = paths.root.relativeFilePath;
|
|
12588
12969
|
const fileContent2 = await readFileContent(
|
|
12589
|
-
|
|
12970
|
+
join96(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
12590
12971
|
);
|
|
12591
12972
|
return new _CodexcliRule({
|
|
12592
12973
|
baseDir,
|
|
@@ -12600,8 +12981,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
12600
12981
|
if (!paths.nonRoot) {
|
|
12601
12982
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
12602
12983
|
}
|
|
12603
|
-
const relativePath =
|
|
12604
|
-
const fileContent = await readFileContent(
|
|
12984
|
+
const relativePath = join96(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
12985
|
+
const fileContent = await readFileContent(join96(baseDir, relativePath));
|
|
12605
12986
|
return new _CodexcliRule({
|
|
12606
12987
|
baseDir,
|
|
12607
12988
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -12660,12 +13041,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
12660
13041
|
};
|
|
12661
13042
|
|
|
12662
13043
|
// src/features/rules/copilot-rule.ts
|
|
12663
|
-
import { join as
|
|
12664
|
-
import { z as
|
|
12665
|
-
var CopilotRuleFrontmatterSchema =
|
|
12666
|
-
description:
|
|
12667
|
-
applyTo:
|
|
12668
|
-
excludeAgent:
|
|
13044
|
+
import { join as join97 } from "path";
|
|
13045
|
+
import { z as z50 } from "zod/mini";
|
|
13046
|
+
var CopilotRuleFrontmatterSchema = z50.object({
|
|
13047
|
+
description: z50.optional(z50.string()),
|
|
13048
|
+
applyTo: z50.optional(z50.string()),
|
|
13049
|
+
excludeAgent: z50.optional(z50.union([z50.literal("code-review"), z50.literal("coding-agent")]))
|
|
12669
13050
|
});
|
|
12670
13051
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
12671
13052
|
frontmatter;
|
|
@@ -12694,7 +13075,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
12694
13075
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
12695
13076
|
if (!result.success) {
|
|
12696
13077
|
throw new Error(
|
|
12697
|
-
`Invalid frontmatter in ${
|
|
13078
|
+
`Invalid frontmatter in ${join97(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
12698
13079
|
);
|
|
12699
13080
|
}
|
|
12700
13081
|
}
|
|
@@ -12784,8 +13165,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
12784
13165
|
const paths = this.getSettablePaths({ global });
|
|
12785
13166
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
12786
13167
|
if (isRoot) {
|
|
12787
|
-
const relativePath2 =
|
|
12788
|
-
const fileContent2 = await readFileContent(
|
|
13168
|
+
const relativePath2 = join97(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
13169
|
+
const fileContent2 = await readFileContent(join97(baseDir, relativePath2));
|
|
12789
13170
|
return new _CopilotRule({
|
|
12790
13171
|
baseDir,
|
|
12791
13172
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -12799,13 +13180,13 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
12799
13180
|
if (!paths.nonRoot) {
|
|
12800
13181
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
12801
13182
|
}
|
|
12802
|
-
const relativePath =
|
|
12803
|
-
const fileContent = await readFileContent(
|
|
13183
|
+
const relativePath = join97(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13184
|
+
const fileContent = await readFileContent(join97(baseDir, relativePath));
|
|
12804
13185
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
12805
13186
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
12806
13187
|
if (!result.success) {
|
|
12807
13188
|
throw new Error(
|
|
12808
|
-
`Invalid frontmatter in ${
|
|
13189
|
+
`Invalid frontmatter in ${join97(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
12809
13190
|
);
|
|
12810
13191
|
}
|
|
12811
13192
|
return new _CopilotRule({
|
|
@@ -12847,7 +13228,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
12847
13228
|
return {
|
|
12848
13229
|
success: false,
|
|
12849
13230
|
error: new Error(
|
|
12850
|
-
`Invalid frontmatter in ${
|
|
13231
|
+
`Invalid frontmatter in ${join97(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
12851
13232
|
)
|
|
12852
13233
|
};
|
|
12853
13234
|
}
|
|
@@ -12867,12 +13248,12 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
12867
13248
|
};
|
|
12868
13249
|
|
|
12869
13250
|
// src/features/rules/cursor-rule.ts
|
|
12870
|
-
import { join as
|
|
12871
|
-
import { z as
|
|
12872
|
-
var CursorRuleFrontmatterSchema =
|
|
12873
|
-
description:
|
|
12874
|
-
globs:
|
|
12875
|
-
alwaysApply:
|
|
13251
|
+
import { join as join98 } from "path";
|
|
13252
|
+
import { z as z51 } from "zod/mini";
|
|
13253
|
+
var CursorRuleFrontmatterSchema = z51.object({
|
|
13254
|
+
description: z51.optional(z51.string()),
|
|
13255
|
+
globs: z51.optional(z51.string()),
|
|
13256
|
+
alwaysApply: z51.optional(z51.boolean())
|
|
12876
13257
|
});
|
|
12877
13258
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
12878
13259
|
frontmatter;
|
|
@@ -12889,7 +13270,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
12889
13270
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
12890
13271
|
if (!result.success) {
|
|
12891
13272
|
throw new Error(
|
|
12892
|
-
`Invalid frontmatter in ${
|
|
13273
|
+
`Invalid frontmatter in ${join98(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
12893
13274
|
);
|
|
12894
13275
|
}
|
|
12895
13276
|
}
|
|
@@ -13006,13 +13387,13 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
13006
13387
|
validate = true
|
|
13007
13388
|
}) {
|
|
13008
13389
|
const fileContent = await readFileContent(
|
|
13009
|
-
|
|
13390
|
+
join98(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
13010
13391
|
);
|
|
13011
13392
|
const { frontmatter, body: content } = _CursorRule.parseCursorFrontmatter(fileContent);
|
|
13012
13393
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
13013
13394
|
if (!result.success) {
|
|
13014
13395
|
throw new Error(
|
|
13015
|
-
`Invalid frontmatter in ${
|
|
13396
|
+
`Invalid frontmatter in ${join98(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
13016
13397
|
);
|
|
13017
13398
|
}
|
|
13018
13399
|
return new _CursorRule({
|
|
@@ -13049,7 +13430,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
13049
13430
|
return {
|
|
13050
13431
|
success: false,
|
|
13051
13432
|
error: new Error(
|
|
13052
|
-
`Invalid frontmatter in ${
|
|
13433
|
+
`Invalid frontmatter in ${join98(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
13053
13434
|
)
|
|
13054
13435
|
};
|
|
13055
13436
|
}
|
|
@@ -13069,7 +13450,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
13069
13450
|
};
|
|
13070
13451
|
|
|
13071
13452
|
// src/features/rules/factorydroid-rule.ts
|
|
13072
|
-
import { join as
|
|
13453
|
+
import { join as join99 } from "path";
|
|
13073
13454
|
var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
13074
13455
|
constructor({ fileContent, root, ...rest }) {
|
|
13075
13456
|
super({
|
|
@@ -13109,8 +13490,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
13109
13490
|
const paths = this.getSettablePaths({ global });
|
|
13110
13491
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
13111
13492
|
if (isRoot) {
|
|
13112
|
-
const relativePath2 =
|
|
13113
|
-
const fileContent2 = await readFileContent(
|
|
13493
|
+
const relativePath2 = join99(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
13494
|
+
const fileContent2 = await readFileContent(join99(baseDir, relativePath2));
|
|
13114
13495
|
return new _FactorydroidRule({
|
|
13115
13496
|
baseDir,
|
|
13116
13497
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -13123,8 +13504,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
13123
13504
|
if (!paths.nonRoot) {
|
|
13124
13505
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13125
13506
|
}
|
|
13126
|
-
const relativePath =
|
|
13127
|
-
const fileContent = await readFileContent(
|
|
13507
|
+
const relativePath = join99(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13508
|
+
const fileContent = await readFileContent(join99(baseDir, relativePath));
|
|
13128
13509
|
return new _FactorydroidRule({
|
|
13129
13510
|
baseDir,
|
|
13130
13511
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -13183,7 +13564,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
13183
13564
|
};
|
|
13184
13565
|
|
|
13185
13566
|
// src/features/rules/geminicli-rule.ts
|
|
13186
|
-
import { join as
|
|
13567
|
+
import { join as join100 } from "path";
|
|
13187
13568
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
13188
13569
|
static getSettablePaths({
|
|
13189
13570
|
global,
|
|
@@ -13218,7 +13599,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
13218
13599
|
if (isRoot) {
|
|
13219
13600
|
const relativePath2 = paths.root.relativeFilePath;
|
|
13220
13601
|
const fileContent2 = await readFileContent(
|
|
13221
|
-
|
|
13602
|
+
join100(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
13222
13603
|
);
|
|
13223
13604
|
return new _GeminiCliRule({
|
|
13224
13605
|
baseDir,
|
|
@@ -13232,8 +13613,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
13232
13613
|
if (!paths.nonRoot) {
|
|
13233
13614
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13234
13615
|
}
|
|
13235
|
-
const relativePath =
|
|
13236
|
-
const fileContent = await readFileContent(
|
|
13616
|
+
const relativePath = join100(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13617
|
+
const fileContent = await readFileContent(join100(baseDir, relativePath));
|
|
13237
13618
|
return new _GeminiCliRule({
|
|
13238
13619
|
baseDir,
|
|
13239
13620
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -13292,7 +13673,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
13292
13673
|
};
|
|
13293
13674
|
|
|
13294
13675
|
// src/features/rules/goose-rule.ts
|
|
13295
|
-
import { join as
|
|
13676
|
+
import { join as join101 } from "path";
|
|
13296
13677
|
var GooseRule = class _GooseRule extends ToolRule {
|
|
13297
13678
|
static getSettablePaths({
|
|
13298
13679
|
global,
|
|
@@ -13327,7 +13708,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
13327
13708
|
if (isRoot) {
|
|
13328
13709
|
const relativePath2 = paths.root.relativeFilePath;
|
|
13329
13710
|
const fileContent2 = await readFileContent(
|
|
13330
|
-
|
|
13711
|
+
join101(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
13331
13712
|
);
|
|
13332
13713
|
return new _GooseRule({
|
|
13333
13714
|
baseDir,
|
|
@@ -13341,8 +13722,8 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
13341
13722
|
if (!paths.nonRoot) {
|
|
13342
13723
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13343
13724
|
}
|
|
13344
|
-
const relativePath =
|
|
13345
|
-
const fileContent = await readFileContent(
|
|
13725
|
+
const relativePath = join101(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13726
|
+
const fileContent = await readFileContent(join101(baseDir, relativePath));
|
|
13346
13727
|
return new _GooseRule({
|
|
13347
13728
|
baseDir,
|
|
13348
13729
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -13401,7 +13782,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
13401
13782
|
};
|
|
13402
13783
|
|
|
13403
13784
|
// src/features/rules/junie-rule.ts
|
|
13404
|
-
import { join as
|
|
13785
|
+
import { join as join102 } from "path";
|
|
13405
13786
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
13406
13787
|
static getSettablePaths(_options = {}) {
|
|
13407
13788
|
return {
|
|
@@ -13420,8 +13801,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
13420
13801
|
validate = true
|
|
13421
13802
|
}) {
|
|
13422
13803
|
const isRoot = relativeFilePath === "guidelines.md";
|
|
13423
|
-
const relativePath = isRoot ? "guidelines.md" :
|
|
13424
|
-
const fileContent = await readFileContent(
|
|
13804
|
+
const relativePath = isRoot ? "guidelines.md" : join102(".junie", "memories", relativeFilePath);
|
|
13805
|
+
const fileContent = await readFileContent(join102(baseDir, relativePath));
|
|
13425
13806
|
return new _JunieRule({
|
|
13426
13807
|
baseDir,
|
|
13427
13808
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -13476,7 +13857,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
13476
13857
|
};
|
|
13477
13858
|
|
|
13478
13859
|
// src/features/rules/kilo-rule.ts
|
|
13479
|
-
import { join as
|
|
13860
|
+
import { join as join103 } from "path";
|
|
13480
13861
|
var KiloRule = class _KiloRule extends ToolRule {
|
|
13481
13862
|
static getSettablePaths(_options = {}) {
|
|
13482
13863
|
return {
|
|
@@ -13491,7 +13872,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
13491
13872
|
validate = true
|
|
13492
13873
|
}) {
|
|
13493
13874
|
const fileContent = await readFileContent(
|
|
13494
|
-
|
|
13875
|
+
join103(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
13495
13876
|
);
|
|
13496
13877
|
return new _KiloRule({
|
|
13497
13878
|
baseDir,
|
|
@@ -13543,7 +13924,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
13543
13924
|
};
|
|
13544
13925
|
|
|
13545
13926
|
// src/features/rules/kiro-rule.ts
|
|
13546
|
-
import { join as
|
|
13927
|
+
import { join as join104 } from "path";
|
|
13547
13928
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
13548
13929
|
static getSettablePaths(_options = {}) {
|
|
13549
13930
|
return {
|
|
@@ -13558,7 +13939,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
13558
13939
|
validate = true
|
|
13559
13940
|
}) {
|
|
13560
13941
|
const fileContent = await readFileContent(
|
|
13561
|
-
|
|
13942
|
+
join104(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
13562
13943
|
);
|
|
13563
13944
|
return new _KiroRule({
|
|
13564
13945
|
baseDir,
|
|
@@ -13612,7 +13993,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
13612
13993
|
};
|
|
13613
13994
|
|
|
13614
13995
|
// src/features/rules/opencode-rule.ts
|
|
13615
|
-
import { join as
|
|
13996
|
+
import { join as join105 } from "path";
|
|
13616
13997
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
13617
13998
|
static getSettablePaths({
|
|
13618
13999
|
global,
|
|
@@ -13647,7 +14028,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
13647
14028
|
if (isRoot) {
|
|
13648
14029
|
const relativePath2 = paths.root.relativeFilePath;
|
|
13649
14030
|
const fileContent2 = await readFileContent(
|
|
13650
|
-
|
|
14031
|
+
join105(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
13651
14032
|
);
|
|
13652
14033
|
return new _OpenCodeRule({
|
|
13653
14034
|
baseDir,
|
|
@@ -13661,8 +14042,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
13661
14042
|
if (!paths.nonRoot) {
|
|
13662
14043
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13663
14044
|
}
|
|
13664
|
-
const relativePath =
|
|
13665
|
-
const fileContent = await readFileContent(
|
|
14045
|
+
const relativePath = join105(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14046
|
+
const fileContent = await readFileContent(join105(baseDir, relativePath));
|
|
13666
14047
|
return new _OpenCodeRule({
|
|
13667
14048
|
baseDir,
|
|
13668
14049
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -13721,7 +14102,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
13721
14102
|
};
|
|
13722
14103
|
|
|
13723
14104
|
// src/features/rules/qwencode-rule.ts
|
|
13724
|
-
import { join as
|
|
14105
|
+
import { join as join106 } from "path";
|
|
13725
14106
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
13726
14107
|
static getSettablePaths(_options = {}) {
|
|
13727
14108
|
return {
|
|
@@ -13740,8 +14121,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
13740
14121
|
validate = true
|
|
13741
14122
|
}) {
|
|
13742
14123
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
13743
|
-
const relativePath = isRoot ? "QWEN.md" :
|
|
13744
|
-
const fileContent = await readFileContent(
|
|
14124
|
+
const relativePath = isRoot ? "QWEN.md" : join106(".qwen", "memories", relativeFilePath);
|
|
14125
|
+
const fileContent = await readFileContent(join106(baseDir, relativePath));
|
|
13745
14126
|
return new _QwencodeRule({
|
|
13746
14127
|
baseDir,
|
|
13747
14128
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -13793,7 +14174,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
13793
14174
|
};
|
|
13794
14175
|
|
|
13795
14176
|
// src/features/rules/replit-rule.ts
|
|
13796
|
-
import { join as
|
|
14177
|
+
import { join as join107 } from "path";
|
|
13797
14178
|
var ReplitRule = class _ReplitRule extends ToolRule {
|
|
13798
14179
|
static getSettablePaths(_options = {}) {
|
|
13799
14180
|
return {
|
|
@@ -13815,7 +14196,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
13815
14196
|
}
|
|
13816
14197
|
const relativePath = paths.root.relativeFilePath;
|
|
13817
14198
|
const fileContent = await readFileContent(
|
|
13818
|
-
|
|
14199
|
+
join107(baseDir, paths.root.relativeDirPath, relativePath)
|
|
13819
14200
|
);
|
|
13820
14201
|
return new _ReplitRule({
|
|
13821
14202
|
baseDir,
|
|
@@ -13881,7 +14262,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
13881
14262
|
};
|
|
13882
14263
|
|
|
13883
14264
|
// src/features/rules/roo-rule.ts
|
|
13884
|
-
import { join as
|
|
14265
|
+
import { join as join108 } from "path";
|
|
13885
14266
|
var RooRule = class _RooRule extends ToolRule {
|
|
13886
14267
|
static getSettablePaths(_options = {}) {
|
|
13887
14268
|
return {
|
|
@@ -13896,7 +14277,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
13896
14277
|
validate = true
|
|
13897
14278
|
}) {
|
|
13898
14279
|
const fileContent = await readFileContent(
|
|
13899
|
-
|
|
14280
|
+
join108(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
13900
14281
|
);
|
|
13901
14282
|
return new _RooRule({
|
|
13902
14283
|
baseDir,
|
|
@@ -13965,7 +14346,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
13965
14346
|
};
|
|
13966
14347
|
|
|
13967
14348
|
// src/features/rules/warp-rule.ts
|
|
13968
|
-
import { join as
|
|
14349
|
+
import { join as join109 } from "path";
|
|
13969
14350
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
13970
14351
|
constructor({ fileContent, root, ...rest }) {
|
|
13971
14352
|
super({
|
|
@@ -13991,8 +14372,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
13991
14372
|
validate = true
|
|
13992
14373
|
}) {
|
|
13993
14374
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
13994
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath :
|
|
13995
|
-
const fileContent = await readFileContent(
|
|
14375
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : join109(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
14376
|
+
const fileContent = await readFileContent(join109(baseDir, relativePath));
|
|
13996
14377
|
return new _WarpRule({
|
|
13997
14378
|
baseDir,
|
|
13998
14379
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -14047,7 +14428,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
14047
14428
|
};
|
|
14048
14429
|
|
|
14049
14430
|
// src/features/rules/windsurf-rule.ts
|
|
14050
|
-
import { join as
|
|
14431
|
+
import { join as join110 } from "path";
|
|
14051
14432
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
14052
14433
|
static getSettablePaths(_options = {}) {
|
|
14053
14434
|
return {
|
|
@@ -14062,7 +14443,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
14062
14443
|
validate = true
|
|
14063
14444
|
}) {
|
|
14064
14445
|
const fileContent = await readFileContent(
|
|
14065
|
-
|
|
14446
|
+
join110(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
14066
14447
|
);
|
|
14067
14448
|
return new _WindsurfRule({
|
|
14068
14449
|
baseDir,
|
|
@@ -14138,8 +14519,8 @@ var rulesProcessorToolTargets = [
|
|
|
14138
14519
|
"warp",
|
|
14139
14520
|
"windsurf"
|
|
14140
14521
|
];
|
|
14141
|
-
var RulesProcessorToolTargetSchema =
|
|
14142
|
-
var formatRulePaths = (rules) => rules.map((r) =>
|
|
14522
|
+
var RulesProcessorToolTargetSchema = z52.enum(rulesProcessorToolTargets);
|
|
14523
|
+
var formatRulePaths = (rules) => rules.map((r) => join111(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
|
|
14143
14524
|
var toolRuleFactories = /* @__PURE__ */ new Map([
|
|
14144
14525
|
[
|
|
14145
14526
|
"agentsmd",
|
|
@@ -14514,7 +14895,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
14514
14895
|
}).relativeDirPath;
|
|
14515
14896
|
return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
|
|
14516
14897
|
const frontmatter = skill.getFrontmatter();
|
|
14517
|
-
const relativePath =
|
|
14898
|
+
const relativePath = join111(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
|
|
14518
14899
|
return {
|
|
14519
14900
|
name: frontmatter.name,
|
|
14520
14901
|
description: frontmatter.description,
|
|
@@ -14627,8 +15008,8 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
14627
15008
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
14628
15009
|
*/
|
|
14629
15010
|
async loadRulesyncFiles() {
|
|
14630
|
-
const rulesyncBaseDir =
|
|
14631
|
-
const files = await findFilesByGlobs(
|
|
15011
|
+
const rulesyncBaseDir = join111(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
15012
|
+
const files = await findFilesByGlobs(join111(rulesyncBaseDir, "**", "*.md"));
|
|
14632
15013
|
logger.debug(`Found ${files.length} rulesync files`);
|
|
14633
15014
|
const rulesyncRules = await Promise.all(
|
|
14634
15015
|
files.map((file) => {
|
|
@@ -14695,7 +15076,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
14695
15076
|
return [];
|
|
14696
15077
|
}
|
|
14697
15078
|
const rootFilePaths = await findFilesByGlobs(
|
|
14698
|
-
|
|
15079
|
+
join111(
|
|
14699
15080
|
this.baseDir,
|
|
14700
15081
|
settablePaths.root.relativeDirPath ?? ".",
|
|
14701
15082
|
settablePaths.root.relativeFilePath
|
|
@@ -14733,7 +15114,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
14733
15114
|
return [];
|
|
14734
15115
|
}
|
|
14735
15116
|
const localRootFilePaths = await findFilesByGlobs(
|
|
14736
|
-
|
|
15117
|
+
join111(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md")
|
|
14737
15118
|
);
|
|
14738
15119
|
return localRootFilePaths.map(
|
|
14739
15120
|
(filePath) => factory.class.forDeletion({
|
|
@@ -14749,9 +15130,9 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
14749
15130
|
if (!settablePaths.nonRoot) {
|
|
14750
15131
|
return [];
|
|
14751
15132
|
}
|
|
14752
|
-
const nonRootBaseDir =
|
|
15133
|
+
const nonRootBaseDir = join111(this.baseDir, settablePaths.nonRoot.relativeDirPath);
|
|
14753
15134
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
14754
|
-
|
|
15135
|
+
join111(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
|
|
14755
15136
|
);
|
|
14756
15137
|
if (forDeletion) {
|
|
14757
15138
|
return nonRootFilePaths.map((filePath) => {
|
|
@@ -14883,14 +15264,14 @@ s/<command> [arguments]
|
|
|
14883
15264
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
14884
15265
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
14885
15266
|
|
|
14886
|
-
When users call a custom slash command, you have to look for the markdown file, \`${
|
|
15267
|
+
When users call a custom slash command, you have to look for the markdown file, \`${join111(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
14887
15268
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
14888
15269
|
|
|
14889
15270
|
Simulated subagents are specialized AI assistants that can be invoked to handle specific types of tasks. In this case, it can be appear something like custom slash commands simply. Simulated subagents can be called by custom slash commands.
|
|
14890
15271
|
|
|
14891
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${
|
|
15272
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${join111(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
14892
15273
|
|
|
14893
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${
|
|
15274
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${join111(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
14894
15275
|
const skillsSection = skills ? this.generateSkillsSection(skills) : "";
|
|
14895
15276
|
const result = [
|
|
14896
15277
|
overview,
|
|
@@ -14962,7 +15343,7 @@ async function processEmptyFeatureGeneration(params) {
|
|
|
14962
15343
|
return { count: totalCount, paths: [], hasDiff };
|
|
14963
15344
|
}
|
|
14964
15345
|
async function checkRulesyncDirExists(params) {
|
|
14965
|
-
return fileExists(
|
|
15346
|
+
return fileExists(join112(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
|
|
14966
15347
|
}
|
|
14967
15348
|
async function generate(params) {
|
|
14968
15349
|
const { config } = params;
|