rulesync 7.6.3 → 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
package/dist/index.cjs
CHANGED
|
@@ -38,8 +38,8 @@ __export(index_exports, {
|
|
|
38
38
|
module.exports = __toCommonJS(index_exports);
|
|
39
39
|
|
|
40
40
|
// src/config/config-resolver.ts
|
|
41
|
-
var import_jsonc_parser = require("jsonc-parser");
|
|
42
41
|
var import_node_path3 = require("path");
|
|
42
|
+
var import_jsonc_parser = require("jsonc-parser");
|
|
43
43
|
|
|
44
44
|
// src/constants/rulesync-paths.ts
|
|
45
45
|
var import_node_path = require("path");
|
|
@@ -80,11 +80,11 @@ function formatError(error) {
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
// src/utils/file.ts
|
|
83
|
-
var import_es_toolkit = require("es-toolkit");
|
|
84
|
-
var import_globby = require("globby");
|
|
85
83
|
var import_promises = require("fs/promises");
|
|
86
84
|
var import_node_os = __toESM(require("os"), 1);
|
|
87
85
|
var import_node_path2 = require("path");
|
|
86
|
+
var import_es_toolkit = require("es-toolkit");
|
|
87
|
+
var import_globby = require("globby");
|
|
88
88
|
|
|
89
89
|
// src/utils/logger.ts
|
|
90
90
|
var import_consola = require("consola");
|
|
@@ -236,7 +236,11 @@ async function findFilesByGlobs(globs, options = {}) {
|
|
|
236
236
|
const { type = "all" } = options;
|
|
237
237
|
const globbyOptions = type === "file" ? { onlyFiles: true, onlyDirectories: false } : type === "dir" ? { onlyFiles: false, onlyDirectories: true } : { onlyFiles: false, onlyDirectories: false };
|
|
238
238
|
const normalizedGlobs = Array.isArray(globs) ? globs.map((g) => g.replaceAll("\\", "/")) : globs.replaceAll("\\", "/");
|
|
239
|
-
const results = (0, import_globby.globbySync)(normalizedGlobs, {
|
|
239
|
+
const results = (0, import_globby.globbySync)(normalizedGlobs, {
|
|
240
|
+
absolute: true,
|
|
241
|
+
followSymbolicLinks: false,
|
|
242
|
+
...globbyOptions
|
|
243
|
+
});
|
|
240
244
|
return results.toSorted();
|
|
241
245
|
}
|
|
242
246
|
async function removeDirectory(dirPath) {
|
|
@@ -630,12 +634,12 @@ function getBaseDirsInLightOfGlobal({
|
|
|
630
634
|
}
|
|
631
635
|
|
|
632
636
|
// src/lib/generate.ts
|
|
637
|
+
var import_node_path113 = require("path");
|
|
633
638
|
var import_es_toolkit4 = require("es-toolkit");
|
|
634
|
-
var import_node_path111 = require("path");
|
|
635
639
|
|
|
636
640
|
// src/features/commands/commands-processor.ts
|
|
637
641
|
var import_node_path20 = require("path");
|
|
638
|
-
var
|
|
642
|
+
var import_mini13 = require("zod/mini");
|
|
639
643
|
|
|
640
644
|
// src/types/feature-processor.ts
|
|
641
645
|
var FeatureProcessor = class {
|
|
@@ -1823,25 +1827,67 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
|
1823
1827
|
|
|
1824
1828
|
// src/features/commands/cursor-command.ts
|
|
1825
1829
|
var import_node_path13 = require("path");
|
|
1830
|
+
var import_mini9 = require("zod/mini");
|
|
1831
|
+
var CursorCommandFrontmatterSchema = import_mini9.z.looseObject({
|
|
1832
|
+
description: import_mini9.z.optional(import_mini9.z.string()),
|
|
1833
|
+
handoffs: import_mini9.z.optional(
|
|
1834
|
+
import_mini9.z.array(
|
|
1835
|
+
import_mini9.z.looseObject({
|
|
1836
|
+
label: import_mini9.z.string(),
|
|
1837
|
+
agent: import_mini9.z.optional(import_mini9.z.string()),
|
|
1838
|
+
prompt: import_mini9.z.optional(import_mini9.z.string()),
|
|
1839
|
+
send: import_mini9.z.optional(import_mini9.z.boolean())
|
|
1840
|
+
})
|
|
1841
|
+
)
|
|
1842
|
+
)
|
|
1843
|
+
});
|
|
1826
1844
|
var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
1845
|
+
frontmatter;
|
|
1846
|
+
body;
|
|
1847
|
+
constructor({ frontmatter, body, ...rest }) {
|
|
1848
|
+
if (rest.validate) {
|
|
1849
|
+
const result = CursorCommandFrontmatterSchema.safeParse(frontmatter);
|
|
1850
|
+
if (!result.success) {
|
|
1851
|
+
throw new Error(
|
|
1852
|
+
`Invalid frontmatter in ${(0, import_node_path13.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
1853
|
+
);
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
super({
|
|
1857
|
+
...rest,
|
|
1858
|
+
fileContent: stringifyFrontmatter(body, frontmatter)
|
|
1859
|
+
});
|
|
1860
|
+
this.frontmatter = frontmatter;
|
|
1861
|
+
this.body = body;
|
|
1862
|
+
}
|
|
1827
1863
|
static getSettablePaths(_options = {}) {
|
|
1828
1864
|
return {
|
|
1829
1865
|
relativeDirPath: (0, import_node_path13.join)(".cursor", "commands")
|
|
1830
1866
|
};
|
|
1831
1867
|
}
|
|
1868
|
+
getBody() {
|
|
1869
|
+
return this.body;
|
|
1870
|
+
}
|
|
1871
|
+
getFrontmatter() {
|
|
1872
|
+
return this.frontmatter;
|
|
1873
|
+
}
|
|
1832
1874
|
toRulesyncCommand() {
|
|
1875
|
+
const { description = "", ...restFields } = this.frontmatter;
|
|
1833
1876
|
const rulesyncFrontmatter = {
|
|
1834
1877
|
targets: ["*"],
|
|
1835
|
-
description
|
|
1878
|
+
description,
|
|
1879
|
+
// Preserve extra fields in cursor section
|
|
1880
|
+
...Object.keys(restFields).length > 0 && { cursor: restFields }
|
|
1836
1881
|
};
|
|
1882
|
+
const fileContent = stringifyFrontmatter(this.body, rulesyncFrontmatter);
|
|
1837
1883
|
return new RulesyncCommand({
|
|
1838
|
-
baseDir:
|
|
1884
|
+
baseDir: ".",
|
|
1839
1885
|
// RulesyncCommand baseDir is always the project root directory
|
|
1840
1886
|
frontmatter: rulesyncFrontmatter,
|
|
1841
|
-
body: this.
|
|
1887
|
+
body: this.body,
|
|
1842
1888
|
relativeDirPath: RulesyncCommand.getSettablePaths().relativeDirPath,
|
|
1843
1889
|
relativeFilePath: this.relativeFilePath,
|
|
1844
|
-
fileContent
|
|
1890
|
+
fileContent,
|
|
1845
1891
|
validate: true
|
|
1846
1892
|
});
|
|
1847
1893
|
}
|
|
@@ -1851,20 +1897,38 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
|
1851
1897
|
validate = true,
|
|
1852
1898
|
global = false
|
|
1853
1899
|
}) {
|
|
1900
|
+
const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
|
|
1901
|
+
const cursorFields = rulesyncFrontmatter.cursor ?? {};
|
|
1902
|
+
const cursorFrontmatter = {
|
|
1903
|
+
...rulesyncFrontmatter.description && { description: rulesyncFrontmatter.description },
|
|
1904
|
+
...cursorFields
|
|
1905
|
+
};
|
|
1906
|
+
const body = rulesyncCommand.getBody();
|
|
1854
1907
|
const paths = this.getSettablePaths({ global });
|
|
1855
1908
|
return new _CursorCommand({
|
|
1856
1909
|
baseDir,
|
|
1857
|
-
|
|
1910
|
+
frontmatter: cursorFrontmatter,
|
|
1911
|
+
body,
|
|
1858
1912
|
relativeDirPath: paths.relativeDirPath,
|
|
1859
1913
|
relativeFilePath: rulesyncCommand.getRelativeFilePath(),
|
|
1860
1914
|
validate
|
|
1861
1915
|
});
|
|
1862
1916
|
}
|
|
1863
1917
|
validate() {
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1918
|
+
if (!this.frontmatter) {
|
|
1919
|
+
return { success: true, error: null };
|
|
1920
|
+
}
|
|
1921
|
+
const result = CursorCommandFrontmatterSchema.safeParse(this.frontmatter);
|
|
1922
|
+
if (result.success) {
|
|
1923
|
+
return { success: true, error: null };
|
|
1924
|
+
} else {
|
|
1925
|
+
return {
|
|
1926
|
+
success: false,
|
|
1927
|
+
error: new Error(
|
|
1928
|
+
`Invalid frontmatter in ${(0, import_node_path13.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
1929
|
+
)
|
|
1930
|
+
};
|
|
1931
|
+
}
|
|
1868
1932
|
}
|
|
1869
1933
|
static isTargetedByRulesyncCommand(rulesyncCommand) {
|
|
1870
1934
|
return this.isTargetedByRulesyncCommandDefault({
|
|
@@ -1881,12 +1945,17 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
|
1881
1945
|
const paths = this.getSettablePaths({ global });
|
|
1882
1946
|
const filePath = (0, import_node_path13.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1883
1947
|
const fileContent = await readFileContent(filePath);
|
|
1884
|
-
const { body: content } = parseFrontmatter(fileContent);
|
|
1948
|
+
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
1949
|
+
const result = CursorCommandFrontmatterSchema.safeParse(frontmatter);
|
|
1950
|
+
if (!result.success) {
|
|
1951
|
+
throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
|
|
1952
|
+
}
|
|
1885
1953
|
return new _CursorCommand({
|
|
1886
1954
|
baseDir,
|
|
1887
1955
|
relativeDirPath: paths.relativeDirPath,
|
|
1888
1956
|
relativeFilePath,
|
|
1889
|
-
|
|
1957
|
+
frontmatter: result.data,
|
|
1958
|
+
body: content.trim(),
|
|
1890
1959
|
validate
|
|
1891
1960
|
});
|
|
1892
1961
|
}
|
|
@@ -1899,7 +1968,8 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
|
1899
1968
|
baseDir,
|
|
1900
1969
|
relativeDirPath,
|
|
1901
1970
|
relativeFilePath,
|
|
1902
|
-
|
|
1971
|
+
frontmatter: {},
|
|
1972
|
+
body: "",
|
|
1903
1973
|
validate: false
|
|
1904
1974
|
});
|
|
1905
1975
|
}
|
|
@@ -1966,10 +2036,10 @@ var FactorydroidCommand = class _FactorydroidCommand extends SimulatedCommand {
|
|
|
1966
2036
|
// src/features/commands/geminicli-command.ts
|
|
1967
2037
|
var import_node_path15 = require("path");
|
|
1968
2038
|
var import_smol_toml = require("smol-toml");
|
|
1969
|
-
var
|
|
1970
|
-
var GeminiCliCommandFrontmatterSchema =
|
|
1971
|
-
description:
|
|
1972
|
-
prompt:
|
|
2039
|
+
var import_mini10 = require("zod/mini");
|
|
2040
|
+
var GeminiCliCommandFrontmatterSchema = import_mini10.z.looseObject({
|
|
2041
|
+
description: import_mini10.z.optional(import_mini10.z.string()),
|
|
2042
|
+
prompt: import_mini10.z.string()
|
|
1973
2043
|
});
|
|
1974
2044
|
var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
|
|
1975
2045
|
frontmatter;
|
|
@@ -2272,12 +2342,12 @@ var KiroCommand = class _KiroCommand extends ToolCommand {
|
|
|
2272
2342
|
|
|
2273
2343
|
// src/features/commands/opencode-command.ts
|
|
2274
2344
|
var import_node_path18 = require("path");
|
|
2275
|
-
var
|
|
2276
|
-
var OpenCodeCommandFrontmatterSchema =
|
|
2277
|
-
description:
|
|
2278
|
-
agent: (0,
|
|
2279
|
-
subtask: (0,
|
|
2280
|
-
model: (0,
|
|
2345
|
+
var import_mini11 = require("zod/mini");
|
|
2346
|
+
var OpenCodeCommandFrontmatterSchema = import_mini11.z.looseObject({
|
|
2347
|
+
description: import_mini11.z.string(),
|
|
2348
|
+
agent: (0, import_mini11.optional)(import_mini11.z.string()),
|
|
2349
|
+
subtask: (0, import_mini11.optional)(import_mini11.z.boolean()),
|
|
2350
|
+
model: (0, import_mini11.optional)(import_mini11.z.string())
|
|
2281
2351
|
});
|
|
2282
2352
|
var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
2283
2353
|
frontmatter;
|
|
@@ -2412,10 +2482,10 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
2412
2482
|
|
|
2413
2483
|
// src/features/commands/roo-command.ts
|
|
2414
2484
|
var import_node_path19 = require("path");
|
|
2415
|
-
var
|
|
2416
|
-
var RooCommandFrontmatterSchema =
|
|
2417
|
-
description:
|
|
2418
|
-
"argument-hint": (0,
|
|
2485
|
+
var import_mini12 = require("zod/mini");
|
|
2486
|
+
var RooCommandFrontmatterSchema = import_mini12.z.looseObject({
|
|
2487
|
+
description: import_mini12.z.string(),
|
|
2488
|
+
"argument-hint": (0, import_mini12.optional)(import_mini12.z.string())
|
|
2419
2489
|
});
|
|
2420
2490
|
var RooCommand = class _RooCommand extends ToolCommand {
|
|
2421
2491
|
frontmatter;
|
|
@@ -2568,7 +2638,7 @@ var commandsProcessorToolTargetTuple = [
|
|
|
2568
2638
|
"opencode",
|
|
2569
2639
|
"roo"
|
|
2570
2640
|
];
|
|
2571
|
-
var CommandsProcessorToolTargetSchema =
|
|
2641
|
+
var CommandsProcessorToolTargetSchema = import_mini13.z.enum(commandsProcessorToolTargetTuple);
|
|
2572
2642
|
var toolCommandFactories = /* @__PURE__ */ new Map([
|
|
2573
2643
|
[
|
|
2574
2644
|
"agentsmd",
|
|
@@ -2814,7 +2884,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
2814
2884
|
const firstOrigin = flattenedPathOrigins.get(flattenedPath);
|
|
2815
2885
|
if (firstOrigin && firstOrigin !== originalRelativePath) {
|
|
2816
2886
|
logger.warn(
|
|
2817
|
-
`Command path collision detected while flattening for ${this.toolTarget}: "${firstOrigin}" and "${originalRelativePath}" both map to "${flattenedPath}".
|
|
2887
|
+
`Command path collision detected while flattening for ${this.toolTarget}: "${firstOrigin}" and "${originalRelativePath}" both map to "${flattenedPath}". Only the last processed command will be used.`
|
|
2818
2888
|
);
|
|
2819
2889
|
} else if (!firstOrigin) {
|
|
2820
2890
|
flattenedPathOrigins.set(flattenedPath, originalRelativePath);
|
|
@@ -2935,26 +3005,26 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
2935
3005
|
};
|
|
2936
3006
|
|
|
2937
3007
|
// src/features/hooks/hooks-processor.ts
|
|
2938
|
-
var
|
|
3008
|
+
var import_mini15 = require("zod/mini");
|
|
2939
3009
|
|
|
2940
3010
|
// src/types/hooks.ts
|
|
2941
|
-
var
|
|
3011
|
+
var import_mini14 = require("zod/mini");
|
|
2942
3012
|
var CONTROL_CHARS = ["\n", "\r", "\0"];
|
|
2943
3013
|
var hasControlChars = (val) => CONTROL_CHARS.some((char) => val.includes(char));
|
|
2944
|
-
var safeString =
|
|
2945
|
-
|
|
2946
|
-
|
|
3014
|
+
var safeString = import_mini14.z.pipe(
|
|
3015
|
+
import_mini14.z.string(),
|
|
3016
|
+
import_mini14.z.custom(
|
|
2947
3017
|
(val) => typeof val === "string" && !hasControlChars(val),
|
|
2948
3018
|
"must not contain newline, carriage return, or NUL characters"
|
|
2949
3019
|
)
|
|
2950
3020
|
);
|
|
2951
|
-
var HookDefinitionSchema =
|
|
2952
|
-
command:
|
|
2953
|
-
type:
|
|
2954
|
-
timeout:
|
|
2955
|
-
matcher:
|
|
2956
|
-
prompt:
|
|
2957
|
-
loop_limit:
|
|
3021
|
+
var HookDefinitionSchema = import_mini14.z.looseObject({
|
|
3022
|
+
command: import_mini14.z.optional(safeString),
|
|
3023
|
+
type: import_mini14.z.optional(import_mini14.z.enum(["command", "prompt"])),
|
|
3024
|
+
timeout: import_mini14.z.optional(import_mini14.z.number()),
|
|
3025
|
+
matcher: import_mini14.z.optional(safeString),
|
|
3026
|
+
prompt: import_mini14.z.optional(import_mini14.z.string()),
|
|
3027
|
+
loop_limit: import_mini14.z.optional(import_mini14.z.nullable(import_mini14.z.number()))
|
|
2958
3028
|
});
|
|
2959
3029
|
var CURSOR_HOOK_EVENTS = [
|
|
2960
3030
|
"sessionStart",
|
|
@@ -3013,14 +3083,14 @@ var FACTORYDROID_HOOK_EVENTS = [
|
|
|
3013
3083
|
"notification",
|
|
3014
3084
|
"setup"
|
|
3015
3085
|
];
|
|
3016
|
-
var hooksRecordSchema =
|
|
3017
|
-
var HooksConfigSchema =
|
|
3018
|
-
version:
|
|
3086
|
+
var hooksRecordSchema = import_mini14.z.record(import_mini14.z.string(), import_mini14.z.array(HookDefinitionSchema));
|
|
3087
|
+
var HooksConfigSchema = import_mini14.z.looseObject({
|
|
3088
|
+
version: import_mini14.z.optional(import_mini14.z.number()),
|
|
3019
3089
|
hooks: hooksRecordSchema,
|
|
3020
|
-
cursor:
|
|
3021
|
-
claudecode:
|
|
3022
|
-
opencode:
|
|
3023
|
-
factorydroid:
|
|
3090
|
+
cursor: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) })),
|
|
3091
|
+
claudecode: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) })),
|
|
3092
|
+
opencode: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) })),
|
|
3093
|
+
factorydroid: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) }))
|
|
3024
3094
|
});
|
|
3025
3095
|
var CANONICAL_TO_CLAUDE_EVENT_NAMES = {
|
|
3026
3096
|
sessionStart: "SessionStart",
|
|
@@ -3809,7 +3879,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
|
|
|
3809
3879
|
|
|
3810
3880
|
// src/features/hooks/hooks-processor.ts
|
|
3811
3881
|
var hooksProcessorToolTargetTuple = ["cursor", "claudecode", "opencode", "factorydroid"];
|
|
3812
|
-
var HooksProcessorToolTargetSchema =
|
|
3882
|
+
var HooksProcessorToolTargetSchema = import_mini15.z.enum(hooksProcessorToolTargetTuple);
|
|
3813
3883
|
var toolHooksFactories = /* @__PURE__ */ new Map([
|
|
3814
3884
|
[
|
|
3815
3885
|
"cursor",
|
|
@@ -3985,7 +4055,7 @@ var HooksProcessor = class extends FeatureProcessor {
|
|
|
3985
4055
|
};
|
|
3986
4056
|
|
|
3987
4057
|
// src/features/ignore/ignore-processor.ts
|
|
3988
|
-
var
|
|
4058
|
+
var import_mini16 = require("zod/mini");
|
|
3989
4059
|
|
|
3990
4060
|
// src/features/ignore/augmentcode-ignore.ts
|
|
3991
4061
|
var import_node_path27 = require("path");
|
|
@@ -4162,8 +4232,8 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
4162
4232
|
};
|
|
4163
4233
|
|
|
4164
4234
|
// src/features/ignore/claudecode-ignore.ts
|
|
4165
|
-
var import_es_toolkit2 = require("es-toolkit");
|
|
4166
4235
|
var import_node_path28 = require("path");
|
|
4236
|
+
var import_es_toolkit2 = require("es-toolkit");
|
|
4167
4237
|
var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
4168
4238
|
constructor(params) {
|
|
4169
4239
|
super(params);
|
|
@@ -4173,11 +4243,11 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
4173
4243
|
static getSettablePaths() {
|
|
4174
4244
|
return {
|
|
4175
4245
|
relativeDirPath: ".claude",
|
|
4176
|
-
relativeFilePath: "settings.
|
|
4246
|
+
relativeFilePath: "settings.json"
|
|
4177
4247
|
};
|
|
4178
4248
|
}
|
|
4179
4249
|
/**
|
|
4180
|
-
* ClaudecodeIgnore uses settings.
|
|
4250
|
+
* ClaudecodeIgnore uses settings.json, which can include non-ignore settings.
|
|
4181
4251
|
* It should not be deleted by rulesync.
|
|
4182
4252
|
*/
|
|
4183
4253
|
isDeletable() {
|
|
@@ -4457,8 +4527,75 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
4457
4527
|
}
|
|
4458
4528
|
};
|
|
4459
4529
|
|
|
4460
|
-
// src/features/ignore/
|
|
4530
|
+
// src/features/ignore/goose-ignore.ts
|
|
4461
4531
|
var import_node_path32 = require("path");
|
|
4532
|
+
var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
4533
|
+
static getSettablePaths() {
|
|
4534
|
+
return {
|
|
4535
|
+
relativeDirPath: ".",
|
|
4536
|
+
relativeFilePath: ".gooseignore"
|
|
4537
|
+
};
|
|
4538
|
+
}
|
|
4539
|
+
/**
|
|
4540
|
+
* Convert GooseIgnore to RulesyncIgnore format
|
|
4541
|
+
*/
|
|
4542
|
+
toRulesyncIgnore() {
|
|
4543
|
+
return this.toRulesyncIgnoreDefault();
|
|
4544
|
+
}
|
|
4545
|
+
/**
|
|
4546
|
+
* Create GooseIgnore from RulesyncIgnore
|
|
4547
|
+
*/
|
|
4548
|
+
static fromRulesyncIgnore({
|
|
4549
|
+
baseDir = process.cwd(),
|
|
4550
|
+
rulesyncIgnore
|
|
4551
|
+
}) {
|
|
4552
|
+
const body = rulesyncIgnore.getFileContent();
|
|
4553
|
+
return new _GooseIgnore({
|
|
4554
|
+
baseDir,
|
|
4555
|
+
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
4556
|
+
relativeFilePath: this.getSettablePaths().relativeFilePath,
|
|
4557
|
+
fileContent: body
|
|
4558
|
+
});
|
|
4559
|
+
}
|
|
4560
|
+
/**
|
|
4561
|
+
* Load GooseIgnore from .gooseignore file
|
|
4562
|
+
*/
|
|
4563
|
+
static async fromFile({
|
|
4564
|
+
baseDir = process.cwd(),
|
|
4565
|
+
validate = true
|
|
4566
|
+
}) {
|
|
4567
|
+
const fileContent = await readFileContent(
|
|
4568
|
+
(0, import_node_path32.join)(
|
|
4569
|
+
baseDir,
|
|
4570
|
+
this.getSettablePaths().relativeDirPath,
|
|
4571
|
+
this.getSettablePaths().relativeFilePath
|
|
4572
|
+
)
|
|
4573
|
+
);
|
|
4574
|
+
return new _GooseIgnore({
|
|
4575
|
+
baseDir,
|
|
4576
|
+
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
4577
|
+
relativeFilePath: this.getSettablePaths().relativeFilePath,
|
|
4578
|
+
fileContent,
|
|
4579
|
+
validate
|
|
4580
|
+
});
|
|
4581
|
+
}
|
|
4582
|
+
static forDeletion({
|
|
4583
|
+
baseDir = process.cwd(),
|
|
4584
|
+
relativeDirPath,
|
|
4585
|
+
relativeFilePath
|
|
4586
|
+
}) {
|
|
4587
|
+
return new _GooseIgnore({
|
|
4588
|
+
baseDir,
|
|
4589
|
+
relativeDirPath,
|
|
4590
|
+
relativeFilePath,
|
|
4591
|
+
fileContent: "",
|
|
4592
|
+
validate: false
|
|
4593
|
+
});
|
|
4594
|
+
}
|
|
4595
|
+
};
|
|
4596
|
+
|
|
4597
|
+
// src/features/ignore/junie-ignore.ts
|
|
4598
|
+
var import_node_path33 = require("path");
|
|
4462
4599
|
var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
4463
4600
|
static getSettablePaths() {
|
|
4464
4601
|
return {
|
|
@@ -4485,7 +4622,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
4485
4622
|
validate = true
|
|
4486
4623
|
}) {
|
|
4487
4624
|
const fileContent = await readFileContent(
|
|
4488
|
-
(0,
|
|
4625
|
+
(0, import_node_path33.join)(
|
|
4489
4626
|
baseDir,
|
|
4490
4627
|
this.getSettablePaths().relativeDirPath,
|
|
4491
4628
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4515,7 +4652,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
4515
4652
|
};
|
|
4516
4653
|
|
|
4517
4654
|
// src/features/ignore/kilo-ignore.ts
|
|
4518
|
-
var
|
|
4655
|
+
var import_node_path34 = require("path");
|
|
4519
4656
|
var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
4520
4657
|
static getSettablePaths() {
|
|
4521
4658
|
return {
|
|
@@ -4552,7 +4689,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
|
4552
4689
|
validate = true
|
|
4553
4690
|
}) {
|
|
4554
4691
|
const fileContent = await readFileContent(
|
|
4555
|
-
(0,
|
|
4692
|
+
(0, import_node_path34.join)(
|
|
4556
4693
|
baseDir,
|
|
4557
4694
|
this.getSettablePaths().relativeDirPath,
|
|
4558
4695
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4582,7 +4719,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
|
4582
4719
|
};
|
|
4583
4720
|
|
|
4584
4721
|
// src/features/ignore/kiro-ignore.ts
|
|
4585
|
-
var
|
|
4722
|
+
var import_node_path35 = require("path");
|
|
4586
4723
|
var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
4587
4724
|
static getSettablePaths() {
|
|
4588
4725
|
return {
|
|
@@ -4609,7 +4746,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
4609
4746
|
validate = true
|
|
4610
4747
|
}) {
|
|
4611
4748
|
const fileContent = await readFileContent(
|
|
4612
|
-
(0,
|
|
4749
|
+
(0, import_node_path35.join)(
|
|
4613
4750
|
baseDir,
|
|
4614
4751
|
this.getSettablePaths().relativeDirPath,
|
|
4615
4752
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4639,7 +4776,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
4639
4776
|
};
|
|
4640
4777
|
|
|
4641
4778
|
// src/features/ignore/qwencode-ignore.ts
|
|
4642
|
-
var
|
|
4779
|
+
var import_node_path36 = require("path");
|
|
4643
4780
|
var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
4644
4781
|
static getSettablePaths() {
|
|
4645
4782
|
return {
|
|
@@ -4666,7 +4803,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
4666
4803
|
validate = true
|
|
4667
4804
|
}) {
|
|
4668
4805
|
const fileContent = await readFileContent(
|
|
4669
|
-
(0,
|
|
4806
|
+
(0, import_node_path36.join)(
|
|
4670
4807
|
baseDir,
|
|
4671
4808
|
this.getSettablePaths().relativeDirPath,
|
|
4672
4809
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4696,7 +4833,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
4696
4833
|
};
|
|
4697
4834
|
|
|
4698
4835
|
// src/features/ignore/roo-ignore.ts
|
|
4699
|
-
var
|
|
4836
|
+
var import_node_path37 = require("path");
|
|
4700
4837
|
var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
4701
4838
|
static getSettablePaths() {
|
|
4702
4839
|
return {
|
|
@@ -4723,7 +4860,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
4723
4860
|
validate = true
|
|
4724
4861
|
}) {
|
|
4725
4862
|
const fileContent = await readFileContent(
|
|
4726
|
-
(0,
|
|
4863
|
+
(0, import_node_path37.join)(
|
|
4727
4864
|
baseDir,
|
|
4728
4865
|
this.getSettablePaths().relativeDirPath,
|
|
4729
4866
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4753,7 +4890,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
4753
4890
|
};
|
|
4754
4891
|
|
|
4755
4892
|
// src/features/ignore/windsurf-ignore.ts
|
|
4756
|
-
var
|
|
4893
|
+
var import_node_path38 = require("path");
|
|
4757
4894
|
var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
4758
4895
|
static getSettablePaths() {
|
|
4759
4896
|
return {
|
|
@@ -4780,7 +4917,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
4780
4917
|
validate = true
|
|
4781
4918
|
}) {
|
|
4782
4919
|
const fileContent = await readFileContent(
|
|
4783
|
-
(0,
|
|
4920
|
+
(0, import_node_path38.join)(
|
|
4784
4921
|
baseDir,
|
|
4785
4922
|
this.getSettablePaths().relativeDirPath,
|
|
4786
4923
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4810,8 +4947,8 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
4810
4947
|
};
|
|
4811
4948
|
|
|
4812
4949
|
// src/features/ignore/zed-ignore.ts
|
|
4950
|
+
var import_node_path39 = require("path");
|
|
4813
4951
|
var import_es_toolkit3 = require("es-toolkit");
|
|
4814
|
-
var import_node_path38 = require("path");
|
|
4815
4952
|
var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
4816
4953
|
constructor(params) {
|
|
4817
4954
|
super(params);
|
|
@@ -4847,7 +4984,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
|
4847
4984
|
}) {
|
|
4848
4985
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
4849
4986
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
4850
|
-
const filePath = (0,
|
|
4987
|
+
const filePath = (0, import_node_path39.join)(
|
|
4851
4988
|
baseDir,
|
|
4852
4989
|
this.getSettablePaths().relativeDirPath,
|
|
4853
4990
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4874,7 +5011,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
|
4874
5011
|
validate = true
|
|
4875
5012
|
}) {
|
|
4876
5013
|
const fileContent = await readFileContent(
|
|
4877
|
-
(0,
|
|
5014
|
+
(0, import_node_path39.join)(
|
|
4878
5015
|
baseDir,
|
|
4879
5016
|
this.getSettablePaths().relativeDirPath,
|
|
4880
5017
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4911,6 +5048,7 @@ var ignoreProcessorToolTargets = [
|
|
|
4911
5048
|
"cline",
|
|
4912
5049
|
"cursor",
|
|
4913
5050
|
"geminicli",
|
|
5051
|
+
"goose",
|
|
4914
5052
|
"junie",
|
|
4915
5053
|
"kilo",
|
|
4916
5054
|
"kiro",
|
|
@@ -4919,7 +5057,7 @@ var ignoreProcessorToolTargets = [
|
|
|
4919
5057
|
"windsurf",
|
|
4920
5058
|
"zed"
|
|
4921
5059
|
];
|
|
4922
|
-
var IgnoreProcessorToolTargetSchema =
|
|
5060
|
+
var IgnoreProcessorToolTargetSchema = import_mini16.z.enum(ignoreProcessorToolTargets);
|
|
4923
5061
|
var toolIgnoreFactories = /* @__PURE__ */ new Map([
|
|
4924
5062
|
["augmentcode", { class: AugmentcodeIgnore }],
|
|
4925
5063
|
["claudecode", { class: ClaudecodeIgnore }],
|
|
@@ -4927,6 +5065,7 @@ var toolIgnoreFactories = /* @__PURE__ */ new Map([
|
|
|
4927
5065
|
["cline", { class: ClineIgnore }],
|
|
4928
5066
|
["cursor", { class: CursorIgnore }],
|
|
4929
5067
|
["geminicli", { class: GeminiCliIgnore }],
|
|
5068
|
+
["goose", { class: GooseIgnore }],
|
|
4930
5069
|
["junie", { class: JunieIgnore }],
|
|
4931
5070
|
["kilo", { class: KiloIgnore }],
|
|
4932
5071
|
["kiro", { class: KiroIgnore }],
|
|
@@ -5056,49 +5195,49 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
5056
5195
|
};
|
|
5057
5196
|
|
|
5058
5197
|
// src/features/mcp/mcp-processor.ts
|
|
5059
|
-
var
|
|
5198
|
+
var import_mini20 = require("zod/mini");
|
|
5060
5199
|
|
|
5061
5200
|
// src/features/mcp/claudecode-mcp.ts
|
|
5062
|
-
var
|
|
5201
|
+
var import_node_path41 = require("path");
|
|
5063
5202
|
|
|
5064
5203
|
// src/features/mcp/rulesync-mcp.ts
|
|
5204
|
+
var import_node_path40 = require("path");
|
|
5065
5205
|
var import_object = require("es-toolkit/object");
|
|
5066
|
-
var
|
|
5067
|
-
var import_mini17 = require("zod/mini");
|
|
5206
|
+
var import_mini18 = require("zod/mini");
|
|
5068
5207
|
|
|
5069
5208
|
// src/types/mcp.ts
|
|
5070
|
-
var
|
|
5071
|
-
var McpServerSchema =
|
|
5072
|
-
type:
|
|
5073
|
-
command:
|
|
5074
|
-
args:
|
|
5075
|
-
url:
|
|
5076
|
-
httpUrl:
|
|
5077
|
-
env:
|
|
5078
|
-
disabled:
|
|
5079
|
-
networkTimeout:
|
|
5080
|
-
timeout:
|
|
5081
|
-
trust:
|
|
5082
|
-
cwd:
|
|
5083
|
-
transport:
|
|
5084
|
-
alwaysAllow:
|
|
5085
|
-
tools:
|
|
5086
|
-
kiroAutoApprove:
|
|
5087
|
-
kiroAutoBlock:
|
|
5088
|
-
headers:
|
|
5089
|
-
enabledTools:
|
|
5090
|
-
disabledTools:
|
|
5209
|
+
var import_mini17 = require("zod/mini");
|
|
5210
|
+
var McpServerSchema = import_mini17.z.object({
|
|
5211
|
+
type: import_mini17.z.optional(import_mini17.z.enum(["stdio", "sse", "http"])),
|
|
5212
|
+
command: import_mini17.z.optional(import_mini17.z.union([import_mini17.z.string(), import_mini17.z.array(import_mini17.z.string())])),
|
|
5213
|
+
args: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string())),
|
|
5214
|
+
url: import_mini17.z.optional(import_mini17.z.string()),
|
|
5215
|
+
httpUrl: import_mini17.z.optional(import_mini17.z.string()),
|
|
5216
|
+
env: import_mini17.z.optional(import_mini17.z.record(import_mini17.z.string(), import_mini17.z.string())),
|
|
5217
|
+
disabled: import_mini17.z.optional(import_mini17.z.boolean()),
|
|
5218
|
+
networkTimeout: import_mini17.z.optional(import_mini17.z.number()),
|
|
5219
|
+
timeout: import_mini17.z.optional(import_mini17.z.number()),
|
|
5220
|
+
trust: import_mini17.z.optional(import_mini17.z.boolean()),
|
|
5221
|
+
cwd: import_mini17.z.optional(import_mini17.z.string()),
|
|
5222
|
+
transport: import_mini17.z.optional(import_mini17.z.enum(["stdio", "sse", "http"])),
|
|
5223
|
+
alwaysAllow: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string())),
|
|
5224
|
+
tools: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string())),
|
|
5225
|
+
kiroAutoApprove: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string())),
|
|
5226
|
+
kiroAutoBlock: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string())),
|
|
5227
|
+
headers: import_mini17.z.optional(import_mini17.z.record(import_mini17.z.string(), import_mini17.z.string())),
|
|
5228
|
+
enabledTools: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string())),
|
|
5229
|
+
disabledTools: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string()))
|
|
5091
5230
|
});
|
|
5092
|
-
var McpServersSchema =
|
|
5231
|
+
var McpServersSchema = import_mini17.z.record(import_mini17.z.string(), McpServerSchema);
|
|
5093
5232
|
|
|
5094
5233
|
// src/features/mcp/rulesync-mcp.ts
|
|
5095
|
-
var RulesyncMcpServerSchema =
|
|
5096
|
-
targets:
|
|
5097
|
-
description:
|
|
5098
|
-
exposed:
|
|
5234
|
+
var RulesyncMcpServerSchema = import_mini18.z.extend(McpServerSchema, {
|
|
5235
|
+
targets: import_mini18.z.optional(RulesyncTargetsSchema),
|
|
5236
|
+
description: import_mini18.z.optional(import_mini18.z.string()),
|
|
5237
|
+
exposed: import_mini18.z.optional(import_mini18.z.boolean())
|
|
5099
5238
|
});
|
|
5100
|
-
var RulesyncMcpConfigSchema =
|
|
5101
|
-
mcpServers:
|
|
5239
|
+
var RulesyncMcpConfigSchema = import_mini18.z.object({
|
|
5240
|
+
mcpServers: import_mini18.z.record(import_mini18.z.string(), RulesyncMcpServerSchema)
|
|
5102
5241
|
});
|
|
5103
5242
|
var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
5104
5243
|
json;
|
|
@@ -5134,12 +5273,12 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
5134
5273
|
static async fromFile({ validate = true }) {
|
|
5135
5274
|
const baseDir = process.cwd();
|
|
5136
5275
|
const paths = this.getSettablePaths();
|
|
5137
|
-
const recommendedPath = (0,
|
|
5276
|
+
const recommendedPath = (0, import_node_path40.join)(
|
|
5138
5277
|
baseDir,
|
|
5139
5278
|
paths.recommended.relativeDirPath,
|
|
5140
5279
|
paths.recommended.relativeFilePath
|
|
5141
5280
|
);
|
|
5142
|
-
const legacyPath = (0,
|
|
5281
|
+
const legacyPath = (0, import_node_path40.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
5143
5282
|
if (await fileExists(recommendedPath)) {
|
|
5144
5283
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
5145
5284
|
return new _RulesyncMcp({
|
|
@@ -5284,7 +5423,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
5284
5423
|
global = false
|
|
5285
5424
|
}) {
|
|
5286
5425
|
const paths = this.getSettablePaths({ global });
|
|
5287
|
-
const fileContent = await readFileContentOrNull((0,
|
|
5426
|
+
const fileContent = await readFileContentOrNull((0, import_node_path41.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
5288
5427
|
const json = JSON.parse(fileContent);
|
|
5289
5428
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
5290
5429
|
return new _ClaudecodeMcp({
|
|
@@ -5303,7 +5442,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
5303
5442
|
}) {
|
|
5304
5443
|
const paths = this.getSettablePaths({ global });
|
|
5305
5444
|
const fileContent = await readOrInitializeFileContent(
|
|
5306
|
-
(0,
|
|
5445
|
+
(0, import_node_path41.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
5307
5446
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
5308
5447
|
);
|
|
5309
5448
|
const json = JSON.parse(fileContent);
|
|
@@ -5342,7 +5481,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
5342
5481
|
};
|
|
5343
5482
|
|
|
5344
5483
|
// src/features/mcp/cline-mcp.ts
|
|
5345
|
-
var
|
|
5484
|
+
var import_node_path42 = require("path");
|
|
5346
5485
|
var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
5347
5486
|
json;
|
|
5348
5487
|
constructor(params) {
|
|
@@ -5363,7 +5502,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
5363
5502
|
validate = true
|
|
5364
5503
|
}) {
|
|
5365
5504
|
const fileContent = await readFileContent(
|
|
5366
|
-
(0,
|
|
5505
|
+
(0, import_node_path42.join)(
|
|
5367
5506
|
baseDir,
|
|
5368
5507
|
this.getSettablePaths().relativeDirPath,
|
|
5369
5508
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5412,7 +5551,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
5412
5551
|
};
|
|
5413
5552
|
|
|
5414
5553
|
// src/features/mcp/codexcli-mcp.ts
|
|
5415
|
-
var
|
|
5554
|
+
var import_node_path43 = require("path");
|
|
5416
5555
|
var smolToml = __toESM(require("smol-toml"), 1);
|
|
5417
5556
|
function convertFromCodexFormat(codexMcp) {
|
|
5418
5557
|
const result = {};
|
|
@@ -5495,7 +5634,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
5495
5634
|
global = false
|
|
5496
5635
|
}) {
|
|
5497
5636
|
const paths = this.getSettablePaths({ global });
|
|
5498
|
-
const fileContent = await readFileContentOrNull((0,
|
|
5637
|
+
const fileContent = await readFileContentOrNull((0, import_node_path43.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
|
|
5499
5638
|
return new _CodexcliMcp({
|
|
5500
5639
|
baseDir,
|
|
5501
5640
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -5511,7 +5650,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
5511
5650
|
global = false
|
|
5512
5651
|
}) {
|
|
5513
5652
|
const paths = this.getSettablePaths({ global });
|
|
5514
|
-
const configTomlFilePath = (0,
|
|
5653
|
+
const configTomlFilePath = (0, import_node_path43.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
5515
5654
|
const configTomlFileContent = await readOrInitializeFileContent(
|
|
5516
5655
|
configTomlFilePath,
|
|
5517
5656
|
smolToml.stringify({})
|
|
@@ -5568,7 +5707,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
5568
5707
|
};
|
|
5569
5708
|
|
|
5570
5709
|
// src/features/mcp/copilot-mcp.ts
|
|
5571
|
-
var
|
|
5710
|
+
var import_node_path44 = require("path");
|
|
5572
5711
|
function convertToCopilotFormat(mcpServers) {
|
|
5573
5712
|
return { servers: mcpServers };
|
|
5574
5713
|
}
|
|
@@ -5595,7 +5734,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
5595
5734
|
validate = true
|
|
5596
5735
|
}) {
|
|
5597
5736
|
const fileContent = await readFileContent(
|
|
5598
|
-
(0,
|
|
5737
|
+
(0, import_node_path44.join)(
|
|
5599
5738
|
baseDir,
|
|
5600
5739
|
this.getSettablePaths().relativeDirPath,
|
|
5601
5740
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5648,7 +5787,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
5648
5787
|
};
|
|
5649
5788
|
|
|
5650
5789
|
// src/features/mcp/cursor-mcp.ts
|
|
5651
|
-
var
|
|
5790
|
+
var import_node_path45 = require("path");
|
|
5652
5791
|
var CURSOR_ENV_VAR_PATTERN = /\$\{env:([^}]+)\}/g;
|
|
5653
5792
|
function isMcpServers(value) {
|
|
5654
5793
|
return value !== void 0 && value !== null && typeof value === "object";
|
|
@@ -5709,7 +5848,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
5709
5848
|
validate = true
|
|
5710
5849
|
}) {
|
|
5711
5850
|
const fileContent = await readFileContent(
|
|
5712
|
-
(0,
|
|
5851
|
+
(0, import_node_path45.join)(
|
|
5713
5852
|
baseDir,
|
|
5714
5853
|
this.getSettablePaths().relativeDirPath,
|
|
5715
5854
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5777,7 +5916,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
5777
5916
|
};
|
|
5778
5917
|
|
|
5779
5918
|
// src/features/mcp/factorydroid-mcp.ts
|
|
5780
|
-
var
|
|
5919
|
+
var import_node_path46 = require("path");
|
|
5781
5920
|
var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
5782
5921
|
json;
|
|
5783
5922
|
constructor(params) {
|
|
@@ -5798,7 +5937,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
5798
5937
|
validate = true
|
|
5799
5938
|
}) {
|
|
5800
5939
|
const fileContent = await readFileContent(
|
|
5801
|
-
(0,
|
|
5940
|
+
(0, import_node_path46.join)(
|
|
5802
5941
|
baseDir,
|
|
5803
5942
|
this.getSettablePaths().relativeDirPath,
|
|
5804
5943
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5858,7 +5997,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
5858
5997
|
};
|
|
5859
5998
|
|
|
5860
5999
|
// src/features/mcp/geminicli-mcp.ts
|
|
5861
|
-
var
|
|
6000
|
+
var import_node_path47 = require("path");
|
|
5862
6001
|
var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
5863
6002
|
json;
|
|
5864
6003
|
constructor(params) {
|
|
@@ -5886,7 +6025,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
5886
6025
|
global = false
|
|
5887
6026
|
}) {
|
|
5888
6027
|
const paths = this.getSettablePaths({ global });
|
|
5889
|
-
const fileContent = await readFileContentOrNull((0,
|
|
6028
|
+
const fileContent = await readFileContentOrNull((0, import_node_path47.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
5890
6029
|
const json = JSON.parse(fileContent);
|
|
5891
6030
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
5892
6031
|
return new _GeminiCliMcp({
|
|
@@ -5905,7 +6044,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
5905
6044
|
}) {
|
|
5906
6045
|
const paths = this.getSettablePaths({ global });
|
|
5907
6046
|
const fileContent = await readOrInitializeFileContent(
|
|
5908
|
-
(0,
|
|
6047
|
+
(0, import_node_path47.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
5909
6048
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
5910
6049
|
);
|
|
5911
6050
|
const json = JSON.parse(fileContent);
|
|
@@ -5950,7 +6089,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
5950
6089
|
};
|
|
5951
6090
|
|
|
5952
6091
|
// src/features/mcp/junie-mcp.ts
|
|
5953
|
-
var
|
|
6092
|
+
var import_node_path48 = require("path");
|
|
5954
6093
|
var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
5955
6094
|
json;
|
|
5956
6095
|
constructor(params) {
|
|
@@ -5962,7 +6101,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
5962
6101
|
}
|
|
5963
6102
|
static getSettablePaths() {
|
|
5964
6103
|
return {
|
|
5965
|
-
relativeDirPath: (0,
|
|
6104
|
+
relativeDirPath: (0, import_node_path48.join)(".junie", "mcp"),
|
|
5966
6105
|
relativeFilePath: "mcp.json"
|
|
5967
6106
|
};
|
|
5968
6107
|
}
|
|
@@ -5971,7 +6110,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
5971
6110
|
validate = true
|
|
5972
6111
|
}) {
|
|
5973
6112
|
const fileContent = await readFileContent(
|
|
5974
|
-
(0,
|
|
6113
|
+
(0, import_node_path48.join)(
|
|
5975
6114
|
baseDir,
|
|
5976
6115
|
this.getSettablePaths().relativeDirPath,
|
|
5977
6116
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6020,7 +6159,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
6020
6159
|
};
|
|
6021
6160
|
|
|
6022
6161
|
// src/features/mcp/kilo-mcp.ts
|
|
6023
|
-
var
|
|
6162
|
+
var import_node_path49 = require("path");
|
|
6024
6163
|
var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
6025
6164
|
json;
|
|
6026
6165
|
constructor(params) {
|
|
@@ -6041,7 +6180,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
6041
6180
|
validate = true
|
|
6042
6181
|
}) {
|
|
6043
6182
|
const paths = this.getSettablePaths();
|
|
6044
|
-
const fileContent = await readFileContentOrNull((0,
|
|
6183
|
+
const fileContent = await readFileContentOrNull((0, import_node_path49.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6045
6184
|
return new _KiloMcp({
|
|
6046
6185
|
baseDir,
|
|
6047
6186
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -6089,7 +6228,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
6089
6228
|
};
|
|
6090
6229
|
|
|
6091
6230
|
// src/features/mcp/kiro-mcp.ts
|
|
6092
|
-
var
|
|
6231
|
+
var import_node_path50 = require("path");
|
|
6093
6232
|
var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
6094
6233
|
json;
|
|
6095
6234
|
constructor(params) {
|
|
@@ -6101,7 +6240,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
6101
6240
|
}
|
|
6102
6241
|
static getSettablePaths() {
|
|
6103
6242
|
return {
|
|
6104
|
-
relativeDirPath: (0,
|
|
6243
|
+
relativeDirPath: (0, import_node_path50.join)(".kiro", "settings"),
|
|
6105
6244
|
relativeFilePath: "mcp.json"
|
|
6106
6245
|
};
|
|
6107
6246
|
}
|
|
@@ -6110,7 +6249,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
6110
6249
|
validate = true
|
|
6111
6250
|
}) {
|
|
6112
6251
|
const paths = this.getSettablePaths();
|
|
6113
|
-
const fileContent = await readFileContentOrNull((0,
|
|
6252
|
+
const fileContent = await readFileContentOrNull((0, import_node_path50.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6114
6253
|
return new _KiroMcp({
|
|
6115
6254
|
baseDir,
|
|
6116
6255
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -6158,29 +6297,29 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
6158
6297
|
};
|
|
6159
6298
|
|
|
6160
6299
|
// src/features/mcp/opencode-mcp.ts
|
|
6161
|
-
var
|
|
6162
|
-
var
|
|
6163
|
-
var OpencodeMcpLocalServerSchema =
|
|
6164
|
-
type:
|
|
6165
|
-
command:
|
|
6166
|
-
environment:
|
|
6167
|
-
enabled:
|
|
6168
|
-
cwd:
|
|
6300
|
+
var import_node_path51 = require("path");
|
|
6301
|
+
var import_mini19 = require("zod/mini");
|
|
6302
|
+
var OpencodeMcpLocalServerSchema = import_mini19.z.object({
|
|
6303
|
+
type: import_mini19.z.literal("local"),
|
|
6304
|
+
command: import_mini19.z.array(import_mini19.z.string()),
|
|
6305
|
+
environment: import_mini19.z.optional(import_mini19.z.record(import_mini19.z.string(), import_mini19.z.string())),
|
|
6306
|
+
enabled: import_mini19.z._default(import_mini19.z.boolean(), true),
|
|
6307
|
+
cwd: import_mini19.z.optional(import_mini19.z.string())
|
|
6169
6308
|
});
|
|
6170
|
-
var OpencodeMcpRemoteServerSchema =
|
|
6171
|
-
type:
|
|
6172
|
-
url:
|
|
6173
|
-
headers:
|
|
6174
|
-
enabled:
|
|
6309
|
+
var OpencodeMcpRemoteServerSchema = import_mini19.z.object({
|
|
6310
|
+
type: import_mini19.z.literal("remote"),
|
|
6311
|
+
url: import_mini19.z.string(),
|
|
6312
|
+
headers: import_mini19.z.optional(import_mini19.z.record(import_mini19.z.string(), import_mini19.z.string())),
|
|
6313
|
+
enabled: import_mini19.z._default(import_mini19.z.boolean(), true)
|
|
6175
6314
|
});
|
|
6176
|
-
var OpencodeMcpServerSchema =
|
|
6315
|
+
var OpencodeMcpServerSchema = import_mini19.z.union([
|
|
6177
6316
|
OpencodeMcpLocalServerSchema,
|
|
6178
6317
|
OpencodeMcpRemoteServerSchema
|
|
6179
6318
|
]);
|
|
6180
|
-
var OpencodeConfigSchema =
|
|
6181
|
-
$schema:
|
|
6182
|
-
mcp:
|
|
6183
|
-
tools:
|
|
6319
|
+
var OpencodeConfigSchema = import_mini19.z.looseObject({
|
|
6320
|
+
$schema: import_mini19.z.optional(import_mini19.z.string()),
|
|
6321
|
+
mcp: import_mini19.z.optional(import_mini19.z.record(import_mini19.z.string(), OpencodeMcpServerSchema)),
|
|
6322
|
+
tools: import_mini19.z.optional(import_mini19.z.record(import_mini19.z.string(), import_mini19.z.boolean()))
|
|
6184
6323
|
});
|
|
6185
6324
|
function convertFromOpencodeFormat(opencodeMcp, tools) {
|
|
6186
6325
|
return Object.fromEntries(
|
|
@@ -6298,7 +6437,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
6298
6437
|
static getSettablePaths({ global } = {}) {
|
|
6299
6438
|
if (global) {
|
|
6300
6439
|
return {
|
|
6301
|
-
relativeDirPath: (0,
|
|
6440
|
+
relativeDirPath: (0, import_node_path51.join)(".config", "opencode"),
|
|
6302
6441
|
relativeFilePath: "opencode.json"
|
|
6303
6442
|
};
|
|
6304
6443
|
}
|
|
@@ -6313,7 +6452,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
6313
6452
|
global = false
|
|
6314
6453
|
}) {
|
|
6315
6454
|
const paths = this.getSettablePaths({ global });
|
|
6316
|
-
const fileContent = await readFileContentOrNull((0,
|
|
6455
|
+
const fileContent = await readFileContentOrNull((0, import_node_path51.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcp":{}}';
|
|
6317
6456
|
const json = JSON.parse(fileContent);
|
|
6318
6457
|
const newJson = { ...json, mcp: json.mcp ?? {} };
|
|
6319
6458
|
return new _OpencodeMcp({
|
|
@@ -6332,7 +6471,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
6332
6471
|
}) {
|
|
6333
6472
|
const paths = this.getSettablePaths({ global });
|
|
6334
6473
|
const fileContent = await readOrInitializeFileContent(
|
|
6335
|
-
(0,
|
|
6474
|
+
(0, import_node_path51.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
6336
6475
|
JSON.stringify({ mcp: {} }, null, 2)
|
|
6337
6476
|
);
|
|
6338
6477
|
const json = JSON.parse(fileContent);
|
|
@@ -6385,7 +6524,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
6385
6524
|
};
|
|
6386
6525
|
|
|
6387
6526
|
// src/features/mcp/roo-mcp.ts
|
|
6388
|
-
var
|
|
6527
|
+
var import_node_path52 = require("path");
|
|
6389
6528
|
function isRooMcpServers(value) {
|
|
6390
6529
|
return value !== void 0 && value !== null && typeof value === "object";
|
|
6391
6530
|
}
|
|
@@ -6437,7 +6576,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
6437
6576
|
validate = true
|
|
6438
6577
|
}) {
|
|
6439
6578
|
const fileContent = await readFileContent(
|
|
6440
|
-
(0,
|
|
6579
|
+
(0, import_node_path52.join)(
|
|
6441
6580
|
baseDir,
|
|
6442
6581
|
this.getSettablePaths().relativeDirPath,
|
|
6443
6582
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6508,7 +6647,7 @@ var mcpProcessorToolTargetTuple = [
|
|
|
6508
6647
|
"opencode",
|
|
6509
6648
|
"roo"
|
|
6510
6649
|
];
|
|
6511
|
-
var McpProcessorToolTargetSchema =
|
|
6650
|
+
var McpProcessorToolTargetSchema = import_mini20.z.enum(mcpProcessorToolTargetTuple);
|
|
6512
6651
|
var toolMcpFactories = /* @__PURE__ */ new Map([
|
|
6513
6652
|
[
|
|
6514
6653
|
"claudecode",
|
|
@@ -6772,11 +6911,11 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
6772
6911
|
}
|
|
6773
6912
|
const factory = this.getFactory(this.toolTarget);
|
|
6774
6913
|
const toolMcps = await Promise.all(
|
|
6775
|
-
[rulesyncMcp].map(async (
|
|
6914
|
+
[rulesyncMcp].map(async (mcp) => {
|
|
6776
6915
|
const fieldsToStrip = [];
|
|
6777
6916
|
if (!factory.meta.supportsEnabledTools) fieldsToStrip.push("enabledTools");
|
|
6778
6917
|
if (!factory.meta.supportsDisabledTools) fieldsToStrip.push("disabledTools");
|
|
6779
|
-
const filteredRulesyncMcp =
|
|
6918
|
+
const filteredRulesyncMcp = mcp.stripMcpServerFields(fieldsToStrip);
|
|
6780
6919
|
return await factory.class.fromRulesyncMcp({
|
|
6781
6920
|
baseDir: this.baseDir,
|
|
6782
6921
|
rulesyncMcp: filteredRulesyncMcp,
|
|
@@ -6810,25 +6949,25 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
6810
6949
|
};
|
|
6811
6950
|
|
|
6812
6951
|
// src/features/rules/rules-processor.ts
|
|
6952
|
+
var import_node_path112 = require("path");
|
|
6813
6953
|
var import_toon = require("@toon-format/toon");
|
|
6814
|
-
var
|
|
6815
|
-
var import_mini50 = require("zod/mini");
|
|
6954
|
+
var import_mini52 = require("zod/mini");
|
|
6816
6955
|
|
|
6817
6956
|
// src/constants/general.ts
|
|
6818
6957
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
6819
6958
|
|
|
6820
6959
|
// src/features/skills/agentsmd-skill.ts
|
|
6821
|
-
var
|
|
6960
|
+
var import_node_path56 = require("path");
|
|
6822
6961
|
|
|
6823
6962
|
// src/features/skills/simulated-skill.ts
|
|
6824
|
-
var
|
|
6825
|
-
var
|
|
6963
|
+
var import_node_path55 = require("path");
|
|
6964
|
+
var import_mini21 = require("zod/mini");
|
|
6826
6965
|
|
|
6827
6966
|
// src/features/skills/tool-skill.ts
|
|
6828
|
-
var
|
|
6967
|
+
var import_node_path54 = require("path");
|
|
6829
6968
|
|
|
6830
6969
|
// src/types/ai-dir.ts
|
|
6831
|
-
var
|
|
6970
|
+
var import_node_path53 = __toESM(require("path"), 1);
|
|
6832
6971
|
var AiDir = class {
|
|
6833
6972
|
/**
|
|
6834
6973
|
* @example "."
|
|
@@ -6862,7 +7001,7 @@ var AiDir = class {
|
|
|
6862
7001
|
otherFiles = [],
|
|
6863
7002
|
global = false
|
|
6864
7003
|
}) {
|
|
6865
|
-
if (dirName.includes(
|
|
7004
|
+
if (dirName.includes(import_node_path53.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
|
|
6866
7005
|
throw new Error(`Directory name cannot contain path separators: dirName="${dirName}"`);
|
|
6867
7006
|
}
|
|
6868
7007
|
this.baseDir = baseDir;
|
|
@@ -6885,11 +7024,11 @@ var AiDir = class {
|
|
|
6885
7024
|
return this.dirName;
|
|
6886
7025
|
}
|
|
6887
7026
|
getDirPath() {
|
|
6888
|
-
const fullPath =
|
|
6889
|
-
const resolvedFull = (0,
|
|
6890
|
-
const resolvedBase = (0,
|
|
6891
|
-
const rel = (0,
|
|
6892
|
-
if (rel.startsWith("..") ||
|
|
7027
|
+
const fullPath = import_node_path53.default.join(this.baseDir, this.relativeDirPath, this.dirName);
|
|
7028
|
+
const resolvedFull = (0, import_node_path53.resolve)(fullPath);
|
|
7029
|
+
const resolvedBase = (0, import_node_path53.resolve)(this.baseDir);
|
|
7030
|
+
const rel = (0, import_node_path53.relative)(resolvedBase, resolvedFull);
|
|
7031
|
+
if (rel.startsWith("..") || import_node_path53.default.isAbsolute(rel)) {
|
|
6893
7032
|
throw new Error(
|
|
6894
7033
|
`Path traversal detected: Final path escapes baseDir. baseDir="${this.baseDir}", relativeDirPath="${this.relativeDirPath}", dirName="${this.dirName}"`
|
|
6895
7034
|
);
|
|
@@ -6903,7 +7042,7 @@ var AiDir = class {
|
|
|
6903
7042
|
return this.otherFiles;
|
|
6904
7043
|
}
|
|
6905
7044
|
getRelativePathFromCwd() {
|
|
6906
|
-
return
|
|
7045
|
+
return import_node_path53.default.join(this.relativeDirPath, this.dirName);
|
|
6907
7046
|
}
|
|
6908
7047
|
getGlobal() {
|
|
6909
7048
|
return this.global;
|
|
@@ -6922,15 +7061,15 @@ var AiDir = class {
|
|
|
6922
7061
|
* @returns Array of files with their relative paths and buffers
|
|
6923
7062
|
*/
|
|
6924
7063
|
static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
|
|
6925
|
-
const dirPath = (0,
|
|
6926
|
-
const glob = (0,
|
|
7064
|
+
const dirPath = (0, import_node_path53.join)(baseDir, relativeDirPath, dirName);
|
|
7065
|
+
const glob = (0, import_node_path53.join)(dirPath, "**", "*");
|
|
6927
7066
|
const filePaths = await findFilesByGlobs(glob, { type: "file" });
|
|
6928
|
-
const filteredPaths = filePaths.filter((filePath) => (0,
|
|
7067
|
+
const filteredPaths = filePaths.filter((filePath) => (0, import_node_path53.basename)(filePath) !== excludeFileName);
|
|
6929
7068
|
const files = await Promise.all(
|
|
6930
7069
|
filteredPaths.map(async (filePath) => {
|
|
6931
7070
|
const fileBuffer = await readFileBuffer(filePath);
|
|
6932
7071
|
return {
|
|
6933
|
-
relativeFilePathToDirPath: (0,
|
|
7072
|
+
relativeFilePathToDirPath: (0, import_node_path53.relative)(dirPath, filePath),
|
|
6934
7073
|
fileBuffer
|
|
6935
7074
|
};
|
|
6936
7075
|
})
|
|
@@ -7021,8 +7160,8 @@ var ToolSkill = class extends AiDir {
|
|
|
7021
7160
|
}) {
|
|
7022
7161
|
const settablePaths = getSettablePaths({ global });
|
|
7023
7162
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
7024
|
-
const skillDirPath = (0,
|
|
7025
|
-
const skillFilePath = (0,
|
|
7163
|
+
const skillDirPath = (0, import_node_path54.join)(baseDir, actualRelativeDirPath, dirName);
|
|
7164
|
+
const skillFilePath = (0, import_node_path54.join)(skillDirPath, SKILL_FILE_NAME);
|
|
7026
7165
|
if (!await fileExists(skillFilePath)) {
|
|
7027
7166
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
7028
7167
|
}
|
|
@@ -7046,16 +7185,16 @@ var ToolSkill = class extends AiDir {
|
|
|
7046
7185
|
}
|
|
7047
7186
|
requireMainFileFrontmatter() {
|
|
7048
7187
|
if (!this.mainFile?.frontmatter) {
|
|
7049
|
-
throw new Error(`Frontmatter is not defined in ${(0,
|
|
7188
|
+
throw new Error(`Frontmatter is not defined in ${(0, import_node_path54.join)(this.relativeDirPath, this.dirName)}`);
|
|
7050
7189
|
}
|
|
7051
7190
|
return this.mainFile.frontmatter;
|
|
7052
7191
|
}
|
|
7053
7192
|
};
|
|
7054
7193
|
|
|
7055
7194
|
// src/features/skills/simulated-skill.ts
|
|
7056
|
-
var SimulatedSkillFrontmatterSchema =
|
|
7057
|
-
name:
|
|
7058
|
-
description:
|
|
7195
|
+
var SimulatedSkillFrontmatterSchema = import_mini21.z.looseObject({
|
|
7196
|
+
name: import_mini21.z.string(),
|
|
7197
|
+
description: import_mini21.z.string()
|
|
7059
7198
|
});
|
|
7060
7199
|
var SimulatedSkill = class extends ToolSkill {
|
|
7061
7200
|
frontmatter;
|
|
@@ -7086,7 +7225,7 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
7086
7225
|
const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
|
|
7087
7226
|
if (!result.success) {
|
|
7088
7227
|
throw new Error(
|
|
7089
|
-
`Invalid frontmatter in ${(0,
|
|
7228
|
+
`Invalid frontmatter in ${(0, import_node_path55.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
|
|
7090
7229
|
);
|
|
7091
7230
|
}
|
|
7092
7231
|
}
|
|
@@ -7144,8 +7283,8 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
7144
7283
|
}) {
|
|
7145
7284
|
const settablePaths = this.getSettablePaths();
|
|
7146
7285
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
7147
|
-
const skillDirPath = (0,
|
|
7148
|
-
const skillFilePath = (0,
|
|
7286
|
+
const skillDirPath = (0, import_node_path55.join)(baseDir, actualRelativeDirPath, dirName);
|
|
7287
|
+
const skillFilePath = (0, import_node_path55.join)(skillDirPath, SKILL_FILE_NAME);
|
|
7149
7288
|
if (!await fileExists(skillFilePath)) {
|
|
7150
7289
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
7151
7290
|
}
|
|
@@ -7222,7 +7361,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
7222
7361
|
throw new Error("AgentsmdSkill does not support global mode.");
|
|
7223
7362
|
}
|
|
7224
7363
|
return {
|
|
7225
|
-
relativeDirPath: (0,
|
|
7364
|
+
relativeDirPath: (0, import_node_path56.join)(".agents", "skills")
|
|
7226
7365
|
};
|
|
7227
7366
|
}
|
|
7228
7367
|
static async fromDir(params) {
|
|
@@ -7249,11 +7388,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
7249
7388
|
};
|
|
7250
7389
|
|
|
7251
7390
|
// src/features/skills/factorydroid-skill.ts
|
|
7252
|
-
var
|
|
7391
|
+
var import_node_path57 = require("path");
|
|
7253
7392
|
var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
7254
7393
|
static getSettablePaths(_options) {
|
|
7255
7394
|
return {
|
|
7256
|
-
relativeDirPath: (0,
|
|
7395
|
+
relativeDirPath: (0, import_node_path57.join)(".factory", "skills")
|
|
7257
7396
|
};
|
|
7258
7397
|
}
|
|
7259
7398
|
static async fromDir(params) {
|
|
@@ -7280,11 +7419,11 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
|
7280
7419
|
};
|
|
7281
7420
|
|
|
7282
7421
|
// src/features/skills/skills-processor.ts
|
|
7283
|
-
var
|
|
7284
|
-
var
|
|
7422
|
+
var import_node_path74 = require("path");
|
|
7423
|
+
var import_mini36 = require("zod/mini");
|
|
7285
7424
|
|
|
7286
7425
|
// src/types/dir-feature-processor.ts
|
|
7287
|
-
var
|
|
7426
|
+
var import_node_path58 = require("path");
|
|
7288
7427
|
var DirFeatureProcessor = class {
|
|
7289
7428
|
baseDir;
|
|
7290
7429
|
dryRun;
|
|
@@ -7315,7 +7454,7 @@ var DirFeatureProcessor = class {
|
|
|
7315
7454
|
const mainFile = aiDir.getMainFile();
|
|
7316
7455
|
let mainFileContent;
|
|
7317
7456
|
if (mainFile) {
|
|
7318
|
-
const mainFilePath = (0,
|
|
7457
|
+
const mainFilePath = (0, import_node_path58.join)(dirPath, mainFile.name);
|
|
7319
7458
|
const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter);
|
|
7320
7459
|
mainFileContent = addTrailingNewline(content);
|
|
7321
7460
|
const existingContent = await readFileContentOrNull(mainFilePath);
|
|
@@ -7329,7 +7468,7 @@ var DirFeatureProcessor = class {
|
|
|
7329
7468
|
const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
|
|
7330
7469
|
otherFileContents.push(contentWithNewline);
|
|
7331
7470
|
if (!dirHasChanges) {
|
|
7332
|
-
const filePath = (0,
|
|
7471
|
+
const filePath = (0, import_node_path58.join)(dirPath, file.relativeFilePathToDirPath);
|
|
7333
7472
|
const existingContent = await readFileContentOrNull(filePath);
|
|
7334
7473
|
if (existingContent !== contentWithNewline) {
|
|
7335
7474
|
dirHasChanges = true;
|
|
@@ -7343,22 +7482,22 @@ var DirFeatureProcessor = class {
|
|
|
7343
7482
|
if (this.dryRun) {
|
|
7344
7483
|
logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
|
|
7345
7484
|
if (mainFile) {
|
|
7346
|
-
logger.info(`[DRY RUN] Would write: ${(0,
|
|
7347
|
-
changedPaths.push((0,
|
|
7485
|
+
logger.info(`[DRY RUN] Would write: ${(0, import_node_path58.join)(dirPath, mainFile.name)}`);
|
|
7486
|
+
changedPaths.push((0, import_node_path58.join)(relativeDir, mainFile.name));
|
|
7348
7487
|
}
|
|
7349
7488
|
for (const file of otherFiles) {
|
|
7350
|
-
logger.info(`[DRY RUN] Would write: ${(0,
|
|
7351
|
-
changedPaths.push((0,
|
|
7489
|
+
logger.info(`[DRY RUN] Would write: ${(0, import_node_path58.join)(dirPath, file.relativeFilePathToDirPath)}`);
|
|
7490
|
+
changedPaths.push((0, import_node_path58.join)(relativeDir, file.relativeFilePathToDirPath));
|
|
7352
7491
|
}
|
|
7353
7492
|
} else {
|
|
7354
7493
|
await ensureDir(dirPath);
|
|
7355
7494
|
if (mainFile && mainFileContent) {
|
|
7356
|
-
const mainFilePath = (0,
|
|
7495
|
+
const mainFilePath = (0, import_node_path58.join)(dirPath, mainFile.name);
|
|
7357
7496
|
await writeFileContent(mainFilePath, mainFileContent);
|
|
7358
|
-
changedPaths.push((0,
|
|
7497
|
+
changedPaths.push((0, import_node_path58.join)(relativeDir, mainFile.name));
|
|
7359
7498
|
}
|
|
7360
7499
|
for (const [i, file] of otherFiles.entries()) {
|
|
7361
|
-
const filePath = (0,
|
|
7500
|
+
const filePath = (0, import_node_path58.join)(dirPath, file.relativeFilePathToDirPath);
|
|
7362
7501
|
const content = otherFileContents[i];
|
|
7363
7502
|
if (content === void 0) {
|
|
7364
7503
|
throw new Error(
|
|
@@ -7366,7 +7505,7 @@ var DirFeatureProcessor = class {
|
|
|
7366
7505
|
);
|
|
7367
7506
|
}
|
|
7368
7507
|
await writeFileContent(filePath, content);
|
|
7369
|
-
changedPaths.push((0,
|
|
7508
|
+
changedPaths.push((0, import_node_path58.join)(relativeDir, file.relativeFilePathToDirPath));
|
|
7370
7509
|
}
|
|
7371
7510
|
}
|
|
7372
7511
|
changedCount++;
|
|
@@ -7398,37 +7537,38 @@ var DirFeatureProcessor = class {
|
|
|
7398
7537
|
};
|
|
7399
7538
|
|
|
7400
7539
|
// src/features/skills/agentsskills-skill.ts
|
|
7401
|
-
var
|
|
7402
|
-
var
|
|
7540
|
+
var import_node_path60 = require("path");
|
|
7541
|
+
var import_mini23 = require("zod/mini");
|
|
7403
7542
|
|
|
7404
7543
|
// src/features/skills/rulesync-skill.ts
|
|
7405
|
-
var
|
|
7406
|
-
var
|
|
7407
|
-
var RulesyncSkillFrontmatterSchemaInternal =
|
|
7408
|
-
name:
|
|
7409
|
-
description:
|
|
7410
|
-
targets:
|
|
7411
|
-
claudecode:
|
|
7412
|
-
|
|
7413
|
-
"allowed-tools":
|
|
7544
|
+
var import_node_path59 = require("path");
|
|
7545
|
+
var import_mini22 = require("zod/mini");
|
|
7546
|
+
var RulesyncSkillFrontmatterSchemaInternal = import_mini22.z.looseObject({
|
|
7547
|
+
name: import_mini22.z.string(),
|
|
7548
|
+
description: import_mini22.z.string(),
|
|
7549
|
+
targets: import_mini22.z._default(RulesyncTargetsSchema, ["*"]),
|
|
7550
|
+
claudecode: import_mini22.z.optional(
|
|
7551
|
+
import_mini22.z.looseObject({
|
|
7552
|
+
"allowed-tools": import_mini22.z.optional(import_mini22.z.array(import_mini22.z.string()))
|
|
7414
7553
|
})
|
|
7415
7554
|
),
|
|
7416
|
-
codexcli:
|
|
7417
|
-
|
|
7418
|
-
"short-description":
|
|
7555
|
+
codexcli: import_mini22.z.optional(
|
|
7556
|
+
import_mini22.z.looseObject({
|
|
7557
|
+
"short-description": import_mini22.z.optional(import_mini22.z.string())
|
|
7419
7558
|
})
|
|
7420
7559
|
),
|
|
7421
|
-
opencode:
|
|
7422
|
-
|
|
7423
|
-
"allowed-tools":
|
|
7560
|
+
opencode: import_mini22.z.optional(
|
|
7561
|
+
import_mini22.z.looseObject({
|
|
7562
|
+
"allowed-tools": import_mini22.z.optional(import_mini22.z.array(import_mini22.z.string()))
|
|
7424
7563
|
})
|
|
7425
7564
|
),
|
|
7426
|
-
copilot:
|
|
7427
|
-
|
|
7428
|
-
license:
|
|
7565
|
+
copilot: import_mini22.z.optional(
|
|
7566
|
+
import_mini22.z.looseObject({
|
|
7567
|
+
license: import_mini22.z.optional(import_mini22.z.string())
|
|
7429
7568
|
})
|
|
7430
7569
|
),
|
|
7431
|
-
|
|
7570
|
+
cline: import_mini22.z.optional(import_mini22.z.looseObject({})),
|
|
7571
|
+
roo: import_mini22.z.optional(import_mini22.z.looseObject({}))
|
|
7432
7572
|
});
|
|
7433
7573
|
var RulesyncSkillFrontmatterSchema = RulesyncSkillFrontmatterSchemaInternal;
|
|
7434
7574
|
var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
@@ -7468,7 +7608,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
7468
7608
|
}
|
|
7469
7609
|
getFrontmatter() {
|
|
7470
7610
|
if (!this.mainFile?.frontmatter) {
|
|
7471
|
-
throw new Error(`Frontmatter is not defined in ${(0,
|
|
7611
|
+
throw new Error(`Frontmatter is not defined in ${(0, import_node_path59.join)(this.relativeDirPath, this.dirName)}`);
|
|
7472
7612
|
}
|
|
7473
7613
|
const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
|
|
7474
7614
|
return result;
|
|
@@ -7494,8 +7634,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
7494
7634
|
dirName,
|
|
7495
7635
|
global = false
|
|
7496
7636
|
}) {
|
|
7497
|
-
const skillDirPath = (0,
|
|
7498
|
-
const skillFilePath = (0,
|
|
7637
|
+
const skillDirPath = (0, import_node_path59.join)(baseDir, relativeDirPath, dirName);
|
|
7638
|
+
const skillFilePath = (0, import_node_path59.join)(skillDirPath, SKILL_FILE_NAME);
|
|
7499
7639
|
if (!await fileExists(skillFilePath)) {
|
|
7500
7640
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
7501
7641
|
}
|
|
@@ -7525,14 +7665,14 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
7525
7665
|
};
|
|
7526
7666
|
|
|
7527
7667
|
// src/features/skills/agentsskills-skill.ts
|
|
7528
|
-
var AgentsSkillsSkillFrontmatterSchema =
|
|
7529
|
-
name:
|
|
7530
|
-
description:
|
|
7668
|
+
var AgentsSkillsSkillFrontmatterSchema = import_mini23.z.looseObject({
|
|
7669
|
+
name: import_mini23.z.string(),
|
|
7670
|
+
description: import_mini23.z.string()
|
|
7531
7671
|
});
|
|
7532
7672
|
var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
7533
7673
|
constructor({
|
|
7534
7674
|
baseDir = process.cwd(),
|
|
7535
|
-
relativeDirPath = (0,
|
|
7675
|
+
relativeDirPath = (0, import_node_path60.join)(".agents", "skills"),
|
|
7536
7676
|
dirName,
|
|
7537
7677
|
frontmatter,
|
|
7538
7678
|
body,
|
|
@@ -7564,7 +7704,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
7564
7704
|
throw new Error("AgentsSkillsSkill does not support global mode.");
|
|
7565
7705
|
}
|
|
7566
7706
|
return {
|
|
7567
|
-
relativeDirPath: (0,
|
|
7707
|
+
relativeDirPath: (0, import_node_path60.join)(".agents", "skills")
|
|
7568
7708
|
};
|
|
7569
7709
|
}
|
|
7570
7710
|
getFrontmatter() {
|
|
@@ -7643,9 +7783,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
7643
7783
|
});
|
|
7644
7784
|
const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
7645
7785
|
if (!result.success) {
|
|
7646
|
-
const skillDirPath = (0,
|
|
7786
|
+
const skillDirPath = (0, import_node_path60.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
7647
7787
|
throw new Error(
|
|
7648
|
-
`Invalid frontmatter in ${(0,
|
|
7788
|
+
`Invalid frontmatter in ${(0, import_node_path60.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
7649
7789
|
);
|
|
7650
7790
|
}
|
|
7651
7791
|
return new _AgentsSkillsSkill({
|
|
@@ -7680,16 +7820,16 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
7680
7820
|
};
|
|
7681
7821
|
|
|
7682
7822
|
// src/features/skills/antigravity-skill.ts
|
|
7683
|
-
var
|
|
7684
|
-
var
|
|
7685
|
-
var AntigravitySkillFrontmatterSchema =
|
|
7686
|
-
name:
|
|
7687
|
-
description:
|
|
7823
|
+
var import_node_path61 = require("path");
|
|
7824
|
+
var import_mini24 = require("zod/mini");
|
|
7825
|
+
var AntigravitySkillFrontmatterSchema = import_mini24.z.looseObject({
|
|
7826
|
+
name: import_mini24.z.string(),
|
|
7827
|
+
description: import_mini24.z.string()
|
|
7688
7828
|
});
|
|
7689
7829
|
var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
7690
7830
|
constructor({
|
|
7691
7831
|
baseDir = process.cwd(),
|
|
7692
|
-
relativeDirPath = (0,
|
|
7832
|
+
relativeDirPath = (0, import_node_path61.join)(".agent", "skills"),
|
|
7693
7833
|
dirName,
|
|
7694
7834
|
frontmatter,
|
|
7695
7835
|
body,
|
|
@@ -7721,11 +7861,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
7721
7861
|
} = {}) {
|
|
7722
7862
|
if (global) {
|
|
7723
7863
|
return {
|
|
7724
|
-
relativeDirPath: (0,
|
|
7864
|
+
relativeDirPath: (0, import_node_path61.join)(".gemini", "antigravity", "skills")
|
|
7725
7865
|
};
|
|
7726
7866
|
}
|
|
7727
7867
|
return {
|
|
7728
|
-
relativeDirPath: (0,
|
|
7868
|
+
relativeDirPath: (0, import_node_path61.join)(".agent", "skills")
|
|
7729
7869
|
};
|
|
7730
7870
|
}
|
|
7731
7871
|
getFrontmatter() {
|
|
@@ -7804,9 +7944,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
7804
7944
|
});
|
|
7805
7945
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
7806
7946
|
if (!result.success) {
|
|
7807
|
-
const skillDirPath = (0,
|
|
7947
|
+
const skillDirPath = (0, import_node_path61.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
7808
7948
|
throw new Error(
|
|
7809
|
-
`Invalid frontmatter in ${(0,
|
|
7949
|
+
`Invalid frontmatter in ${(0, import_node_path61.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
7810
7950
|
);
|
|
7811
7951
|
}
|
|
7812
7952
|
return new _AntigravitySkill({
|
|
@@ -7840,17 +7980,17 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
7840
7980
|
};
|
|
7841
7981
|
|
|
7842
7982
|
// src/features/skills/claudecode-skill.ts
|
|
7843
|
-
var
|
|
7844
|
-
var
|
|
7845
|
-
var ClaudecodeSkillFrontmatterSchema =
|
|
7846
|
-
name:
|
|
7847
|
-
description:
|
|
7848
|
-
"allowed-tools":
|
|
7983
|
+
var import_node_path62 = require("path");
|
|
7984
|
+
var import_mini25 = require("zod/mini");
|
|
7985
|
+
var ClaudecodeSkillFrontmatterSchema = import_mini25.z.looseObject({
|
|
7986
|
+
name: import_mini25.z.string(),
|
|
7987
|
+
description: import_mini25.z.string(),
|
|
7988
|
+
"allowed-tools": import_mini25.z.optional(import_mini25.z.array(import_mini25.z.string()))
|
|
7849
7989
|
});
|
|
7850
7990
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
7851
7991
|
constructor({
|
|
7852
7992
|
baseDir = process.cwd(),
|
|
7853
|
-
relativeDirPath = (0,
|
|
7993
|
+
relativeDirPath = (0, import_node_path62.join)(".claude", "skills"),
|
|
7854
7994
|
dirName,
|
|
7855
7995
|
frontmatter,
|
|
7856
7996
|
body,
|
|
@@ -7881,7 +8021,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
7881
8021
|
global: _global = false
|
|
7882
8022
|
} = {}) {
|
|
7883
8023
|
return {
|
|
7884
|
-
relativeDirPath: (0,
|
|
8024
|
+
relativeDirPath: (0, import_node_path62.join)(".claude", "skills")
|
|
7885
8025
|
};
|
|
7886
8026
|
}
|
|
7887
8027
|
getFrontmatter() {
|
|
@@ -7966,9 +8106,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
7966
8106
|
});
|
|
7967
8107
|
const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
7968
8108
|
if (!result.success) {
|
|
7969
|
-
const skillDirPath = (0,
|
|
8109
|
+
const skillDirPath = (0, import_node_path62.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
7970
8110
|
throw new Error(
|
|
7971
|
-
`Invalid frontmatter in ${(0,
|
|
8111
|
+
`Invalid frontmatter in ${(0, import_node_path62.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
7972
8112
|
);
|
|
7973
8113
|
}
|
|
7974
8114
|
return new _ClaudecodeSkill({
|
|
@@ -8001,22 +8141,194 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
8001
8141
|
}
|
|
8002
8142
|
};
|
|
8003
8143
|
|
|
8144
|
+
// src/features/skills/cline-skill.ts
|
|
8145
|
+
var import_node_path63 = require("path");
|
|
8146
|
+
var import_mini26 = require("zod/mini");
|
|
8147
|
+
var ClineSkillFrontmatterSchema = import_mini26.z.looseObject({
|
|
8148
|
+
name: import_mini26.z.string(),
|
|
8149
|
+
description: import_mini26.z.string()
|
|
8150
|
+
});
|
|
8151
|
+
var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
8152
|
+
constructor({
|
|
8153
|
+
baseDir = process.cwd(),
|
|
8154
|
+
relativeDirPath = (0, import_node_path63.join)(".cline", "skills"),
|
|
8155
|
+
dirName,
|
|
8156
|
+
frontmatter,
|
|
8157
|
+
body,
|
|
8158
|
+
otherFiles = [],
|
|
8159
|
+
validate = true,
|
|
8160
|
+
global = false
|
|
8161
|
+
}) {
|
|
8162
|
+
super({
|
|
8163
|
+
baseDir,
|
|
8164
|
+
relativeDirPath,
|
|
8165
|
+
dirName,
|
|
8166
|
+
mainFile: {
|
|
8167
|
+
name: SKILL_FILE_NAME,
|
|
8168
|
+
body,
|
|
8169
|
+
frontmatter: { ...frontmatter }
|
|
8170
|
+
},
|
|
8171
|
+
otherFiles,
|
|
8172
|
+
global
|
|
8173
|
+
});
|
|
8174
|
+
if (validate) {
|
|
8175
|
+
const result = this.validate();
|
|
8176
|
+
if (!result.success) {
|
|
8177
|
+
throw result.error;
|
|
8178
|
+
}
|
|
8179
|
+
}
|
|
8180
|
+
}
|
|
8181
|
+
static getSettablePaths(_options = {}) {
|
|
8182
|
+
return {
|
|
8183
|
+
relativeDirPath: (0, import_node_path63.join)(".cline", "skills")
|
|
8184
|
+
};
|
|
8185
|
+
}
|
|
8186
|
+
getFrontmatter() {
|
|
8187
|
+
const result = ClineSkillFrontmatterSchema.parse(this.requireMainFileFrontmatter());
|
|
8188
|
+
return result;
|
|
8189
|
+
}
|
|
8190
|
+
getBody() {
|
|
8191
|
+
return this.mainFile?.body ?? "";
|
|
8192
|
+
}
|
|
8193
|
+
validate() {
|
|
8194
|
+
if (!this.mainFile) {
|
|
8195
|
+
return {
|
|
8196
|
+
success: false,
|
|
8197
|
+
error: new Error(`${this.getDirPath()}: ${SKILL_FILE_NAME} file does not exist`)
|
|
8198
|
+
};
|
|
8199
|
+
}
|
|
8200
|
+
const result = ClineSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
|
|
8201
|
+
if (!result.success) {
|
|
8202
|
+
return {
|
|
8203
|
+
success: false,
|
|
8204
|
+
error: new Error(
|
|
8205
|
+
`Invalid frontmatter in ${this.getDirPath()}: ${formatError(result.error)}`
|
|
8206
|
+
)
|
|
8207
|
+
};
|
|
8208
|
+
}
|
|
8209
|
+
if (result.data.name !== this.getDirName()) {
|
|
8210
|
+
return {
|
|
8211
|
+
success: false,
|
|
8212
|
+
error: new Error(
|
|
8213
|
+
`${this.getDirPath()}: frontmatter name (${result.data.name}) must match directory name (${this.getDirName()})`
|
|
8214
|
+
)
|
|
8215
|
+
};
|
|
8216
|
+
}
|
|
8217
|
+
return { success: true, error: null };
|
|
8218
|
+
}
|
|
8219
|
+
toRulesyncSkill() {
|
|
8220
|
+
const frontmatter = this.getFrontmatter();
|
|
8221
|
+
const rulesyncFrontmatter = {
|
|
8222
|
+
name: frontmatter.name,
|
|
8223
|
+
description: frontmatter.description,
|
|
8224
|
+
targets: ["*"]
|
|
8225
|
+
};
|
|
8226
|
+
return new RulesyncSkill({
|
|
8227
|
+
baseDir: this.baseDir,
|
|
8228
|
+
relativeDirPath: RULESYNC_SKILLS_RELATIVE_DIR_PATH,
|
|
8229
|
+
dirName: this.getDirName(),
|
|
8230
|
+
frontmatter: rulesyncFrontmatter,
|
|
8231
|
+
body: this.getBody(),
|
|
8232
|
+
otherFiles: this.getOtherFiles(),
|
|
8233
|
+
validate: true,
|
|
8234
|
+
global: this.global
|
|
8235
|
+
});
|
|
8236
|
+
}
|
|
8237
|
+
static fromRulesyncSkill({
|
|
8238
|
+
rulesyncSkill,
|
|
8239
|
+
validate = true,
|
|
8240
|
+
global = false
|
|
8241
|
+
}) {
|
|
8242
|
+
const settablePaths = _ClineSkill.getSettablePaths({ global });
|
|
8243
|
+
const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
|
|
8244
|
+
const clineFrontmatter = {
|
|
8245
|
+
name: rulesyncFrontmatter.name,
|
|
8246
|
+
description: rulesyncFrontmatter.description
|
|
8247
|
+
};
|
|
8248
|
+
return new _ClineSkill({
|
|
8249
|
+
baseDir: rulesyncSkill.getBaseDir(),
|
|
8250
|
+
relativeDirPath: settablePaths.relativeDirPath,
|
|
8251
|
+
dirName: clineFrontmatter.name,
|
|
8252
|
+
frontmatter: clineFrontmatter,
|
|
8253
|
+
body: rulesyncSkill.getBody(),
|
|
8254
|
+
otherFiles: rulesyncSkill.getOtherFiles(),
|
|
8255
|
+
validate,
|
|
8256
|
+
global
|
|
8257
|
+
});
|
|
8258
|
+
}
|
|
8259
|
+
static isTargetedByRulesyncSkill(rulesyncSkill) {
|
|
8260
|
+
const targets = rulesyncSkill.getFrontmatter().targets;
|
|
8261
|
+
return targets.includes("*") || targets.includes("cline");
|
|
8262
|
+
}
|
|
8263
|
+
static async fromDir(params) {
|
|
8264
|
+
const loaded = await this.loadSkillDirContent({
|
|
8265
|
+
...params,
|
|
8266
|
+
getSettablePaths: _ClineSkill.getSettablePaths
|
|
8267
|
+
});
|
|
8268
|
+
const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8269
|
+
if (!result.success) {
|
|
8270
|
+
const skillDirPath = (0, import_node_path63.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8271
|
+
throw new Error(
|
|
8272
|
+
`Invalid frontmatter in ${(0, import_node_path63.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8273
|
+
);
|
|
8274
|
+
}
|
|
8275
|
+
if (result.data.name !== loaded.dirName) {
|
|
8276
|
+
const skillFilePath = (0, import_node_path63.join)(
|
|
8277
|
+
loaded.baseDir,
|
|
8278
|
+
loaded.relativeDirPath,
|
|
8279
|
+
loaded.dirName,
|
|
8280
|
+
SKILL_FILE_NAME
|
|
8281
|
+
);
|
|
8282
|
+
throw new Error(
|
|
8283
|
+
`Frontmatter name (${result.data.name}) must match directory name (${loaded.dirName}) in ${skillFilePath}`
|
|
8284
|
+
);
|
|
8285
|
+
}
|
|
8286
|
+
return new _ClineSkill({
|
|
8287
|
+
baseDir: loaded.baseDir,
|
|
8288
|
+
relativeDirPath: loaded.relativeDirPath,
|
|
8289
|
+
dirName: loaded.dirName,
|
|
8290
|
+
frontmatter: result.data,
|
|
8291
|
+
body: loaded.body,
|
|
8292
|
+
otherFiles: loaded.otherFiles,
|
|
8293
|
+
validate: true,
|
|
8294
|
+
global: loaded.global
|
|
8295
|
+
});
|
|
8296
|
+
}
|
|
8297
|
+
static forDeletion({
|
|
8298
|
+
baseDir = process.cwd(),
|
|
8299
|
+
relativeDirPath,
|
|
8300
|
+
dirName,
|
|
8301
|
+
global = false
|
|
8302
|
+
}) {
|
|
8303
|
+
return new _ClineSkill({
|
|
8304
|
+
baseDir,
|
|
8305
|
+
relativeDirPath,
|
|
8306
|
+
dirName,
|
|
8307
|
+
frontmatter: { name: "", description: "" },
|
|
8308
|
+
body: "",
|
|
8309
|
+
otherFiles: [],
|
|
8310
|
+
validate: false,
|
|
8311
|
+
global
|
|
8312
|
+
});
|
|
8313
|
+
}
|
|
8314
|
+
};
|
|
8315
|
+
|
|
8004
8316
|
// src/features/skills/codexcli-skill.ts
|
|
8005
|
-
var
|
|
8006
|
-
var
|
|
8007
|
-
var CodexCliSkillFrontmatterSchema =
|
|
8008
|
-
name:
|
|
8009
|
-
description:
|
|
8010
|
-
metadata:
|
|
8011
|
-
|
|
8012
|
-
"short-description":
|
|
8317
|
+
var import_node_path64 = require("path");
|
|
8318
|
+
var import_mini27 = require("zod/mini");
|
|
8319
|
+
var CodexCliSkillFrontmatterSchema = import_mini27.z.looseObject({
|
|
8320
|
+
name: import_mini27.z.string(),
|
|
8321
|
+
description: import_mini27.z.string(),
|
|
8322
|
+
metadata: import_mini27.z.optional(
|
|
8323
|
+
import_mini27.z.looseObject({
|
|
8324
|
+
"short-description": import_mini27.z.optional(import_mini27.z.string())
|
|
8013
8325
|
})
|
|
8014
8326
|
)
|
|
8015
8327
|
});
|
|
8016
8328
|
var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
8017
8329
|
constructor({
|
|
8018
8330
|
baseDir = process.cwd(),
|
|
8019
|
-
relativeDirPath = (0,
|
|
8331
|
+
relativeDirPath = (0, import_node_path64.join)(".codex", "skills"),
|
|
8020
8332
|
dirName,
|
|
8021
8333
|
frontmatter,
|
|
8022
8334
|
body,
|
|
@@ -8047,7 +8359,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
8047
8359
|
global: _global = false
|
|
8048
8360
|
} = {}) {
|
|
8049
8361
|
return {
|
|
8050
|
-
relativeDirPath: (0,
|
|
8362
|
+
relativeDirPath: (0, import_node_path64.join)(".codex", "skills")
|
|
8051
8363
|
};
|
|
8052
8364
|
}
|
|
8053
8365
|
getFrontmatter() {
|
|
@@ -8136,9 +8448,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
8136
8448
|
});
|
|
8137
8449
|
const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8138
8450
|
if (!result.success) {
|
|
8139
|
-
const skillDirPath = (0,
|
|
8451
|
+
const skillDirPath = (0, import_node_path64.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8140
8452
|
throw new Error(
|
|
8141
|
-
`Invalid frontmatter in ${(0,
|
|
8453
|
+
`Invalid frontmatter in ${(0, import_node_path64.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8142
8454
|
);
|
|
8143
8455
|
}
|
|
8144
8456
|
return new _CodexCliSkill({
|
|
@@ -8172,17 +8484,17 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
8172
8484
|
};
|
|
8173
8485
|
|
|
8174
8486
|
// src/features/skills/copilot-skill.ts
|
|
8175
|
-
var
|
|
8176
|
-
var
|
|
8177
|
-
var CopilotSkillFrontmatterSchema =
|
|
8178
|
-
name:
|
|
8179
|
-
description:
|
|
8180
|
-
license:
|
|
8487
|
+
var import_node_path65 = require("path");
|
|
8488
|
+
var import_mini28 = require("zod/mini");
|
|
8489
|
+
var CopilotSkillFrontmatterSchema = import_mini28.z.looseObject({
|
|
8490
|
+
name: import_mini28.z.string(),
|
|
8491
|
+
description: import_mini28.z.string(),
|
|
8492
|
+
license: import_mini28.z.optional(import_mini28.z.string())
|
|
8181
8493
|
});
|
|
8182
8494
|
var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
8183
8495
|
constructor({
|
|
8184
8496
|
baseDir = process.cwd(),
|
|
8185
|
-
relativeDirPath = (0,
|
|
8497
|
+
relativeDirPath = (0, import_node_path65.join)(".github", "skills"),
|
|
8186
8498
|
dirName,
|
|
8187
8499
|
frontmatter,
|
|
8188
8500
|
body,
|
|
@@ -8214,7 +8526,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
8214
8526
|
throw new Error("CopilotSkill does not support global mode.");
|
|
8215
8527
|
}
|
|
8216
8528
|
return {
|
|
8217
|
-
relativeDirPath: (0,
|
|
8529
|
+
relativeDirPath: (0, import_node_path65.join)(".github", "skills")
|
|
8218
8530
|
};
|
|
8219
8531
|
}
|
|
8220
8532
|
getFrontmatter() {
|
|
@@ -8299,9 +8611,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
8299
8611
|
});
|
|
8300
8612
|
const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8301
8613
|
if (!result.success) {
|
|
8302
|
-
const skillDirPath = (0,
|
|
8614
|
+
const skillDirPath = (0, import_node_path65.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8303
8615
|
throw new Error(
|
|
8304
|
-
`Invalid frontmatter in ${(0,
|
|
8616
|
+
`Invalid frontmatter in ${(0, import_node_path65.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8305
8617
|
);
|
|
8306
8618
|
}
|
|
8307
8619
|
return new _CopilotSkill({
|
|
@@ -8336,16 +8648,16 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
8336
8648
|
};
|
|
8337
8649
|
|
|
8338
8650
|
// src/features/skills/cursor-skill.ts
|
|
8339
|
-
var
|
|
8340
|
-
var
|
|
8341
|
-
var CursorSkillFrontmatterSchema =
|
|
8342
|
-
name:
|
|
8343
|
-
description:
|
|
8651
|
+
var import_node_path66 = require("path");
|
|
8652
|
+
var import_mini29 = require("zod/mini");
|
|
8653
|
+
var CursorSkillFrontmatterSchema = import_mini29.z.looseObject({
|
|
8654
|
+
name: import_mini29.z.string(),
|
|
8655
|
+
description: import_mini29.z.string()
|
|
8344
8656
|
});
|
|
8345
8657
|
var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
8346
8658
|
constructor({
|
|
8347
8659
|
baseDir = process.cwd(),
|
|
8348
|
-
relativeDirPath = (0,
|
|
8660
|
+
relativeDirPath = (0, import_node_path66.join)(".cursor", "skills"),
|
|
8349
8661
|
dirName,
|
|
8350
8662
|
frontmatter,
|
|
8351
8663
|
body,
|
|
@@ -8374,7 +8686,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
8374
8686
|
}
|
|
8375
8687
|
static getSettablePaths(_options) {
|
|
8376
8688
|
return {
|
|
8377
|
-
relativeDirPath: (0,
|
|
8689
|
+
relativeDirPath: (0, import_node_path66.join)(".cursor", "skills")
|
|
8378
8690
|
};
|
|
8379
8691
|
}
|
|
8380
8692
|
getFrontmatter() {
|
|
@@ -8453,9 +8765,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
8453
8765
|
});
|
|
8454
8766
|
const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8455
8767
|
if (!result.success) {
|
|
8456
|
-
const skillDirPath = (0,
|
|
8768
|
+
const skillDirPath = (0, import_node_path66.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8457
8769
|
throw new Error(
|
|
8458
|
-
`Invalid frontmatter in ${(0,
|
|
8770
|
+
`Invalid frontmatter in ${(0, import_node_path66.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8459
8771
|
);
|
|
8460
8772
|
}
|
|
8461
8773
|
return new _CursorSkill({
|
|
@@ -8490,11 +8802,11 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
8490
8802
|
};
|
|
8491
8803
|
|
|
8492
8804
|
// src/features/skills/geminicli-skill.ts
|
|
8493
|
-
var
|
|
8494
|
-
var
|
|
8495
|
-
var GeminiCliSkillFrontmatterSchema =
|
|
8496
|
-
name:
|
|
8497
|
-
description:
|
|
8805
|
+
var import_node_path67 = require("path");
|
|
8806
|
+
var import_mini30 = require("zod/mini");
|
|
8807
|
+
var GeminiCliSkillFrontmatterSchema = import_mini30.z.looseObject({
|
|
8808
|
+
name: import_mini30.z.string(),
|
|
8809
|
+
description: import_mini30.z.string()
|
|
8498
8810
|
});
|
|
8499
8811
|
var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
8500
8812
|
constructor({
|
|
@@ -8530,7 +8842,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
8530
8842
|
global: _global = false
|
|
8531
8843
|
} = {}) {
|
|
8532
8844
|
return {
|
|
8533
|
-
relativeDirPath: (0,
|
|
8845
|
+
relativeDirPath: (0, import_node_path67.join)(".gemini", "skills")
|
|
8534
8846
|
};
|
|
8535
8847
|
}
|
|
8536
8848
|
getFrontmatter() {
|
|
@@ -8609,9 +8921,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
8609
8921
|
});
|
|
8610
8922
|
const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8611
8923
|
if (!result.success) {
|
|
8612
|
-
const skillDirPath = (0,
|
|
8924
|
+
const skillDirPath = (0, import_node_path67.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8613
8925
|
throw new Error(
|
|
8614
|
-
`Invalid frontmatter in ${(0,
|
|
8926
|
+
`Invalid frontmatter in ${(0, import_node_path67.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8615
8927
|
);
|
|
8616
8928
|
}
|
|
8617
8929
|
return new _GeminiCliSkill({
|
|
@@ -8646,16 +8958,16 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
8646
8958
|
};
|
|
8647
8959
|
|
|
8648
8960
|
// src/features/skills/kilo-skill.ts
|
|
8649
|
-
var
|
|
8650
|
-
var
|
|
8651
|
-
var KiloSkillFrontmatterSchema =
|
|
8652
|
-
name:
|
|
8653
|
-
description:
|
|
8961
|
+
var import_node_path68 = require("path");
|
|
8962
|
+
var import_mini31 = require("zod/mini");
|
|
8963
|
+
var KiloSkillFrontmatterSchema = import_mini31.z.looseObject({
|
|
8964
|
+
name: import_mini31.z.string(),
|
|
8965
|
+
description: import_mini31.z.string()
|
|
8654
8966
|
});
|
|
8655
8967
|
var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
8656
8968
|
constructor({
|
|
8657
8969
|
baseDir = process.cwd(),
|
|
8658
|
-
relativeDirPath = (0,
|
|
8970
|
+
relativeDirPath = (0, import_node_path68.join)(".kilocode", "skills"),
|
|
8659
8971
|
dirName,
|
|
8660
8972
|
frontmatter,
|
|
8661
8973
|
body,
|
|
@@ -8686,7 +8998,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
8686
8998
|
global: _global = false
|
|
8687
8999
|
} = {}) {
|
|
8688
9000
|
return {
|
|
8689
|
-
relativeDirPath: (0,
|
|
9001
|
+
relativeDirPath: (0, import_node_path68.join)(".kilocode", "skills")
|
|
8690
9002
|
};
|
|
8691
9003
|
}
|
|
8692
9004
|
getFrontmatter() {
|
|
@@ -8773,13 +9085,13 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
8773
9085
|
});
|
|
8774
9086
|
const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8775
9087
|
if (!result.success) {
|
|
8776
|
-
const skillDirPath = (0,
|
|
9088
|
+
const skillDirPath = (0, import_node_path68.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8777
9089
|
throw new Error(
|
|
8778
|
-
`Invalid frontmatter in ${(0,
|
|
9090
|
+
`Invalid frontmatter in ${(0, import_node_path68.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8779
9091
|
);
|
|
8780
9092
|
}
|
|
8781
9093
|
if (result.data.name !== loaded.dirName) {
|
|
8782
|
-
const skillFilePath = (0,
|
|
9094
|
+
const skillFilePath = (0, import_node_path68.join)(
|
|
8783
9095
|
loaded.baseDir,
|
|
8784
9096
|
loaded.relativeDirPath,
|
|
8785
9097
|
loaded.dirName,
|
|
@@ -8820,16 +9132,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
8820
9132
|
};
|
|
8821
9133
|
|
|
8822
9134
|
// src/features/skills/kiro-skill.ts
|
|
8823
|
-
var
|
|
8824
|
-
var
|
|
8825
|
-
var KiroSkillFrontmatterSchema =
|
|
8826
|
-
name:
|
|
8827
|
-
description:
|
|
9135
|
+
var import_node_path69 = require("path");
|
|
9136
|
+
var import_mini32 = require("zod/mini");
|
|
9137
|
+
var KiroSkillFrontmatterSchema = import_mini32.z.looseObject({
|
|
9138
|
+
name: import_mini32.z.string(),
|
|
9139
|
+
description: import_mini32.z.string()
|
|
8828
9140
|
});
|
|
8829
9141
|
var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
8830
9142
|
constructor({
|
|
8831
9143
|
baseDir = process.cwd(),
|
|
8832
|
-
relativeDirPath = (0,
|
|
9144
|
+
relativeDirPath = (0, import_node_path69.join)(".kiro", "skills"),
|
|
8833
9145
|
dirName,
|
|
8834
9146
|
frontmatter,
|
|
8835
9147
|
body,
|
|
@@ -8861,7 +9173,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
8861
9173
|
throw new Error("KiroSkill does not support global mode.");
|
|
8862
9174
|
}
|
|
8863
9175
|
return {
|
|
8864
|
-
relativeDirPath: (0,
|
|
9176
|
+
relativeDirPath: (0, import_node_path69.join)(".kiro", "skills")
|
|
8865
9177
|
};
|
|
8866
9178
|
}
|
|
8867
9179
|
getFrontmatter() {
|
|
@@ -8948,13 +9260,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
8948
9260
|
});
|
|
8949
9261
|
const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8950
9262
|
if (!result.success) {
|
|
8951
|
-
const skillDirPath = (0,
|
|
9263
|
+
const skillDirPath = (0, import_node_path69.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8952
9264
|
throw new Error(
|
|
8953
|
-
`Invalid frontmatter in ${(0,
|
|
9265
|
+
`Invalid frontmatter in ${(0, import_node_path69.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8954
9266
|
);
|
|
8955
9267
|
}
|
|
8956
9268
|
if (result.data.name !== loaded.dirName) {
|
|
8957
|
-
const skillFilePath = (0,
|
|
9269
|
+
const skillFilePath = (0, import_node_path69.join)(
|
|
8958
9270
|
loaded.baseDir,
|
|
8959
9271
|
loaded.relativeDirPath,
|
|
8960
9272
|
loaded.dirName,
|
|
@@ -8996,17 +9308,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
8996
9308
|
};
|
|
8997
9309
|
|
|
8998
9310
|
// src/features/skills/opencode-skill.ts
|
|
8999
|
-
var
|
|
9000
|
-
var
|
|
9001
|
-
var OpenCodeSkillFrontmatterSchema =
|
|
9002
|
-
name:
|
|
9003
|
-
description:
|
|
9004
|
-
"allowed-tools":
|
|
9311
|
+
var import_node_path70 = require("path");
|
|
9312
|
+
var import_mini33 = require("zod/mini");
|
|
9313
|
+
var OpenCodeSkillFrontmatterSchema = import_mini33.z.looseObject({
|
|
9314
|
+
name: import_mini33.z.string(),
|
|
9315
|
+
description: import_mini33.z.string(),
|
|
9316
|
+
"allowed-tools": import_mini33.z.optional(import_mini33.z.array(import_mini33.z.string()))
|
|
9005
9317
|
});
|
|
9006
9318
|
var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
9007
9319
|
constructor({
|
|
9008
9320
|
baseDir = process.cwd(),
|
|
9009
|
-
relativeDirPath = (0,
|
|
9321
|
+
relativeDirPath = (0, import_node_path70.join)(".opencode", "skill"),
|
|
9010
9322
|
dirName,
|
|
9011
9323
|
frontmatter,
|
|
9012
9324
|
body,
|
|
@@ -9035,7 +9347,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
9035
9347
|
}
|
|
9036
9348
|
static getSettablePaths({ global = false } = {}) {
|
|
9037
9349
|
return {
|
|
9038
|
-
relativeDirPath: global ? (0,
|
|
9350
|
+
relativeDirPath: global ? (0, import_node_path70.join)(".config", "opencode", "skill") : (0, import_node_path70.join)(".opencode", "skill")
|
|
9039
9351
|
};
|
|
9040
9352
|
}
|
|
9041
9353
|
getFrontmatter() {
|
|
@@ -9120,9 +9432,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
9120
9432
|
});
|
|
9121
9433
|
const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9122
9434
|
if (!result.success) {
|
|
9123
|
-
const skillDirPath = (0,
|
|
9435
|
+
const skillDirPath = (0, import_node_path70.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9124
9436
|
throw new Error(
|
|
9125
|
-
`Invalid frontmatter in ${(0,
|
|
9437
|
+
`Invalid frontmatter in ${(0, import_node_path70.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9126
9438
|
);
|
|
9127
9439
|
}
|
|
9128
9440
|
return new _OpenCodeSkill({
|
|
@@ -9156,16 +9468,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
9156
9468
|
};
|
|
9157
9469
|
|
|
9158
9470
|
// src/features/skills/replit-skill.ts
|
|
9159
|
-
var
|
|
9160
|
-
var
|
|
9161
|
-
var ReplitSkillFrontmatterSchema =
|
|
9162
|
-
name:
|
|
9163
|
-
description:
|
|
9471
|
+
var import_node_path71 = require("path");
|
|
9472
|
+
var import_mini34 = require("zod/mini");
|
|
9473
|
+
var ReplitSkillFrontmatterSchema = import_mini34.z.looseObject({
|
|
9474
|
+
name: import_mini34.z.string(),
|
|
9475
|
+
description: import_mini34.z.string()
|
|
9164
9476
|
});
|
|
9165
9477
|
var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
9166
9478
|
constructor({
|
|
9167
9479
|
baseDir = process.cwd(),
|
|
9168
|
-
relativeDirPath = (0,
|
|
9480
|
+
relativeDirPath = (0, import_node_path71.join)(".agents", "skills"),
|
|
9169
9481
|
dirName,
|
|
9170
9482
|
frontmatter,
|
|
9171
9483
|
body,
|
|
@@ -9197,7 +9509,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
9197
9509
|
throw new Error("ReplitSkill does not support global mode.");
|
|
9198
9510
|
}
|
|
9199
9511
|
return {
|
|
9200
|
-
relativeDirPath: (0,
|
|
9512
|
+
relativeDirPath: (0, import_node_path71.join)(".agents", "skills")
|
|
9201
9513
|
};
|
|
9202
9514
|
}
|
|
9203
9515
|
getFrontmatter() {
|
|
@@ -9276,9 +9588,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
9276
9588
|
});
|
|
9277
9589
|
const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9278
9590
|
if (!result.success) {
|
|
9279
|
-
const skillDirPath = (0,
|
|
9591
|
+
const skillDirPath = (0, import_node_path71.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9280
9592
|
throw new Error(
|
|
9281
|
-
`Invalid frontmatter in ${(0,
|
|
9593
|
+
`Invalid frontmatter in ${(0, import_node_path71.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9282
9594
|
);
|
|
9283
9595
|
}
|
|
9284
9596
|
return new _ReplitSkill({
|
|
@@ -9313,16 +9625,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
9313
9625
|
};
|
|
9314
9626
|
|
|
9315
9627
|
// src/features/skills/roo-skill.ts
|
|
9316
|
-
var
|
|
9317
|
-
var
|
|
9318
|
-
var RooSkillFrontmatterSchema =
|
|
9319
|
-
name:
|
|
9320
|
-
description:
|
|
9628
|
+
var import_node_path72 = require("path");
|
|
9629
|
+
var import_mini35 = require("zod/mini");
|
|
9630
|
+
var RooSkillFrontmatterSchema = import_mini35.z.looseObject({
|
|
9631
|
+
name: import_mini35.z.string(),
|
|
9632
|
+
description: import_mini35.z.string()
|
|
9321
9633
|
});
|
|
9322
9634
|
var RooSkill = class _RooSkill extends ToolSkill {
|
|
9323
9635
|
constructor({
|
|
9324
9636
|
baseDir = process.cwd(),
|
|
9325
|
-
relativeDirPath = (0,
|
|
9637
|
+
relativeDirPath = (0, import_node_path72.join)(".roo", "skills"),
|
|
9326
9638
|
dirName,
|
|
9327
9639
|
frontmatter,
|
|
9328
9640
|
body,
|
|
@@ -9353,7 +9665,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
9353
9665
|
global: _global = false
|
|
9354
9666
|
} = {}) {
|
|
9355
9667
|
return {
|
|
9356
|
-
relativeDirPath: (0,
|
|
9668
|
+
relativeDirPath: (0, import_node_path72.join)(".roo", "skills")
|
|
9357
9669
|
};
|
|
9358
9670
|
}
|
|
9359
9671
|
getFrontmatter() {
|
|
@@ -9440,13 +9752,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
9440
9752
|
});
|
|
9441
9753
|
const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9442
9754
|
if (!result.success) {
|
|
9443
|
-
const skillDirPath = (0,
|
|
9755
|
+
const skillDirPath = (0, import_node_path72.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9444
9756
|
throw new Error(
|
|
9445
|
-
`Invalid frontmatter in ${(0,
|
|
9757
|
+
`Invalid frontmatter in ${(0, import_node_path72.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9446
9758
|
);
|
|
9447
9759
|
}
|
|
9448
9760
|
if (result.data.name !== loaded.dirName) {
|
|
9449
|
-
const skillFilePath = (0,
|
|
9761
|
+
const skillFilePath = (0, import_node_path72.join)(
|
|
9450
9762
|
loaded.baseDir,
|
|
9451
9763
|
loaded.relativeDirPath,
|
|
9452
9764
|
loaded.dirName,
|
|
@@ -9487,17 +9799,17 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
9487
9799
|
};
|
|
9488
9800
|
|
|
9489
9801
|
// src/features/skills/skills-utils.ts
|
|
9490
|
-
var
|
|
9802
|
+
var import_node_path73 = require("path");
|
|
9491
9803
|
async function getLocalSkillDirNames(baseDir) {
|
|
9492
|
-
const skillsDir = (0,
|
|
9804
|
+
const skillsDir = (0, import_node_path73.join)(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
|
|
9493
9805
|
const names = /* @__PURE__ */ new Set();
|
|
9494
9806
|
if (!await directoryExists(skillsDir)) {
|
|
9495
9807
|
return names;
|
|
9496
9808
|
}
|
|
9497
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
9809
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path73.join)(skillsDir, "*"), { type: "dir" });
|
|
9498
9810
|
for (const dirPath of dirPaths) {
|
|
9499
|
-
const name = (0,
|
|
9500
|
-
if (name === (0,
|
|
9811
|
+
const name = (0, import_node_path73.basename)(dirPath);
|
|
9812
|
+
if (name === (0, import_node_path73.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
|
|
9501
9813
|
names.add(name);
|
|
9502
9814
|
}
|
|
9503
9815
|
return names;
|
|
@@ -9510,6 +9822,7 @@ var skillsProcessorToolTargetTuple = [
|
|
|
9510
9822
|
"antigravity",
|
|
9511
9823
|
"claudecode",
|
|
9512
9824
|
"claudecode-legacy",
|
|
9825
|
+
"cline",
|
|
9513
9826
|
"codexcli",
|
|
9514
9827
|
"copilot",
|
|
9515
9828
|
"cursor",
|
|
@@ -9521,7 +9834,7 @@ var skillsProcessorToolTargetTuple = [
|
|
|
9521
9834
|
"replit",
|
|
9522
9835
|
"roo"
|
|
9523
9836
|
];
|
|
9524
|
-
var SkillsProcessorToolTargetSchema =
|
|
9837
|
+
var SkillsProcessorToolTargetSchema = import_mini36.z.enum(skillsProcessorToolTargetTuple);
|
|
9525
9838
|
var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
9526
9839
|
[
|
|
9527
9840
|
"agentsmd",
|
|
@@ -9558,6 +9871,13 @@ var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
|
9558
9871
|
meta: { supportsProject: true, supportsSimulated: false, supportsGlobal: true }
|
|
9559
9872
|
}
|
|
9560
9873
|
],
|
|
9874
|
+
[
|
|
9875
|
+
"cline",
|
|
9876
|
+
{
|
|
9877
|
+
class: ClineSkill,
|
|
9878
|
+
meta: { supportsProject: true, supportsSimulated: false, supportsGlobal: true }
|
|
9879
|
+
}
|
|
9880
|
+
],
|
|
9561
9881
|
[
|
|
9562
9882
|
"codexcli",
|
|
9563
9883
|
{
|
|
@@ -9715,11 +10035,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
9715
10035
|
)
|
|
9716
10036
|
);
|
|
9717
10037
|
const localSkillNames = new Set(localDirNames);
|
|
9718
|
-
const curatedDirPath = (0,
|
|
10038
|
+
const curatedDirPath = (0, import_node_path74.join)(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
|
|
9719
10039
|
let curatedSkills = [];
|
|
9720
10040
|
if (await directoryExists(curatedDirPath)) {
|
|
9721
|
-
const curatedDirPaths = await findFilesByGlobs((0,
|
|
9722
|
-
const curatedDirNames = curatedDirPaths.map((path3) => (0,
|
|
10041
|
+
const curatedDirPaths = await findFilesByGlobs((0, import_node_path74.join)(curatedDirPath, "*"), { type: "dir" });
|
|
10042
|
+
const curatedDirNames = curatedDirPaths.map((path3) => (0, import_node_path74.basename)(path3));
|
|
9723
10043
|
const nonConflicting = curatedDirNames.filter((name) => {
|
|
9724
10044
|
if (localSkillNames.has(name)) {
|
|
9725
10045
|
logger.debug(`Skipping curated skill "${name}": local skill takes precedence.`);
|
|
@@ -9752,9 +10072,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
9752
10072
|
async loadToolDirs() {
|
|
9753
10073
|
const factory = this.getFactory(this.toolTarget);
|
|
9754
10074
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
9755
|
-
const skillsDirPath = (0,
|
|
9756
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
9757
|
-
const dirNames = dirPaths.map((path3) => (0,
|
|
10075
|
+
const skillsDirPath = (0, import_node_path74.join)(this.baseDir, paths.relativeDirPath);
|
|
10076
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path74.join)(skillsDirPath, "*"), { type: "dir" });
|
|
10077
|
+
const dirNames = dirPaths.map((path3) => (0, import_node_path74.basename)(path3));
|
|
9758
10078
|
const toolSkills = await Promise.all(
|
|
9759
10079
|
dirNames.map(
|
|
9760
10080
|
(dirName) => factory.class.fromDir({
|
|
@@ -9770,9 +10090,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
9770
10090
|
async loadToolDirsToDelete() {
|
|
9771
10091
|
const factory = this.getFactory(this.toolTarget);
|
|
9772
10092
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
9773
|
-
const skillsDirPath = (0,
|
|
9774
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
9775
|
-
const dirNames = dirPaths.map((path3) => (0,
|
|
10093
|
+
const skillsDirPath = (0, import_node_path74.join)(this.baseDir, paths.relativeDirPath);
|
|
10094
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path74.join)(skillsDirPath, "*"), { type: "dir" });
|
|
10095
|
+
const dirNames = dirPaths.map((path3) => (0, import_node_path74.basename)(path3));
|
|
9776
10096
|
const toolSkills = dirNames.map(
|
|
9777
10097
|
(dirName) => factory.class.forDeletion({
|
|
9778
10098
|
baseDir: this.baseDir,
|
|
@@ -9833,11 +10153,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
9833
10153
|
};
|
|
9834
10154
|
|
|
9835
10155
|
// src/features/subagents/agentsmd-subagent.ts
|
|
9836
|
-
var
|
|
10156
|
+
var import_node_path76 = require("path");
|
|
9837
10157
|
|
|
9838
10158
|
// src/features/subagents/simulated-subagent.ts
|
|
9839
|
-
var
|
|
9840
|
-
var
|
|
10159
|
+
var import_node_path75 = require("path");
|
|
10160
|
+
var import_mini37 = require("zod/mini");
|
|
9841
10161
|
|
|
9842
10162
|
// src/features/subagents/tool-subagent.ts
|
|
9843
10163
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -9877,12 +10197,21 @@ var ToolSubagent = class extends ToolFile {
|
|
|
9877
10197
|
}
|
|
9878
10198
|
return false;
|
|
9879
10199
|
}
|
|
10200
|
+
static filterToolSpecificSection(rawSection, excludeFields) {
|
|
10201
|
+
const filtered = {};
|
|
10202
|
+
for (const [key, value] of Object.entries(rawSection)) {
|
|
10203
|
+
if (!excludeFields.includes(key)) {
|
|
10204
|
+
filtered[key] = value;
|
|
10205
|
+
}
|
|
10206
|
+
}
|
|
10207
|
+
return filtered;
|
|
10208
|
+
}
|
|
9880
10209
|
};
|
|
9881
10210
|
|
|
9882
10211
|
// src/features/subagents/simulated-subagent.ts
|
|
9883
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
9884
|
-
name:
|
|
9885
|
-
description:
|
|
10212
|
+
var SimulatedSubagentFrontmatterSchema = import_mini37.z.object({
|
|
10213
|
+
name: import_mini37.z.string(),
|
|
10214
|
+
description: import_mini37.z.string()
|
|
9886
10215
|
});
|
|
9887
10216
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
9888
10217
|
frontmatter;
|
|
@@ -9892,7 +10221,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
9892
10221
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
9893
10222
|
if (!result.success) {
|
|
9894
10223
|
throw new Error(
|
|
9895
|
-
`Invalid frontmatter in ${(0,
|
|
10224
|
+
`Invalid frontmatter in ${(0, import_node_path75.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
9896
10225
|
);
|
|
9897
10226
|
}
|
|
9898
10227
|
}
|
|
@@ -9943,7 +10272,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
9943
10272
|
return {
|
|
9944
10273
|
success: false,
|
|
9945
10274
|
error: new Error(
|
|
9946
|
-
`Invalid frontmatter in ${(0,
|
|
10275
|
+
`Invalid frontmatter in ${(0, import_node_path75.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
9947
10276
|
)
|
|
9948
10277
|
};
|
|
9949
10278
|
}
|
|
@@ -9953,7 +10282,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
9953
10282
|
relativeFilePath,
|
|
9954
10283
|
validate = true
|
|
9955
10284
|
}) {
|
|
9956
|
-
const filePath = (0,
|
|
10285
|
+
const filePath = (0, import_node_path75.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
9957
10286
|
const fileContent = await readFileContent(filePath);
|
|
9958
10287
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
9959
10288
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -9963,7 +10292,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
9963
10292
|
return {
|
|
9964
10293
|
baseDir,
|
|
9965
10294
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
9966
|
-
relativeFilePath: (0,
|
|
10295
|
+
relativeFilePath: (0, import_node_path75.basename)(relativeFilePath),
|
|
9967
10296
|
frontmatter: result.data,
|
|
9968
10297
|
body: content.trim(),
|
|
9969
10298
|
validate
|
|
@@ -9989,7 +10318,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
9989
10318
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
9990
10319
|
static getSettablePaths() {
|
|
9991
10320
|
return {
|
|
9992
|
-
relativeDirPath: (0,
|
|
10321
|
+
relativeDirPath: (0, import_node_path76.join)(".agents", "subagents")
|
|
9993
10322
|
};
|
|
9994
10323
|
}
|
|
9995
10324
|
static async fromFile(params) {
|
|
@@ -10012,11 +10341,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
10012
10341
|
};
|
|
10013
10342
|
|
|
10014
10343
|
// src/features/subagents/factorydroid-subagent.ts
|
|
10015
|
-
var
|
|
10344
|
+
var import_node_path77 = require("path");
|
|
10016
10345
|
var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
|
|
10017
10346
|
static getSettablePaths(_options) {
|
|
10018
10347
|
return {
|
|
10019
|
-
relativeDirPath: (0,
|
|
10348
|
+
relativeDirPath: (0, import_node_path77.join)(".factory", "droids")
|
|
10020
10349
|
};
|
|
10021
10350
|
}
|
|
10022
10351
|
static async fromFile(params) {
|
|
@@ -10039,11 +10368,11 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
|
|
|
10039
10368
|
};
|
|
10040
10369
|
|
|
10041
10370
|
// src/features/subagents/geminicli-subagent.ts
|
|
10042
|
-
var
|
|
10371
|
+
var import_node_path78 = require("path");
|
|
10043
10372
|
var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
10044
10373
|
static getSettablePaths() {
|
|
10045
10374
|
return {
|
|
10046
|
-
relativeDirPath: (0,
|
|
10375
|
+
relativeDirPath: (0, import_node_path78.join)(".gemini", "subagents")
|
|
10047
10376
|
};
|
|
10048
10377
|
}
|
|
10049
10378
|
static async fromFile(params) {
|
|
@@ -10066,11 +10395,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
|
10066
10395
|
};
|
|
10067
10396
|
|
|
10068
10397
|
// src/features/subagents/roo-subagent.ts
|
|
10069
|
-
var
|
|
10398
|
+
var import_node_path79 = require("path");
|
|
10070
10399
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
10071
10400
|
static getSettablePaths() {
|
|
10072
10401
|
return {
|
|
10073
|
-
relativeDirPath: (0,
|
|
10402
|
+
relativeDirPath: (0, import_node_path79.join)(".roo", "subagents")
|
|
10074
10403
|
};
|
|
10075
10404
|
}
|
|
10076
10405
|
static async fromFile(params) {
|
|
@@ -10093,20 +10422,20 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
10093
10422
|
};
|
|
10094
10423
|
|
|
10095
10424
|
// src/features/subagents/subagents-processor.ts
|
|
10096
|
-
var
|
|
10097
|
-
var
|
|
10425
|
+
var import_node_path87 = require("path");
|
|
10426
|
+
var import_mini45 = require("zod/mini");
|
|
10098
10427
|
|
|
10099
10428
|
// src/features/subagents/claudecode-subagent.ts
|
|
10100
|
-
var
|
|
10101
|
-
var
|
|
10429
|
+
var import_node_path81 = require("path");
|
|
10430
|
+
var import_mini39 = require("zod/mini");
|
|
10102
10431
|
|
|
10103
10432
|
// src/features/subagents/rulesync-subagent.ts
|
|
10104
|
-
var
|
|
10105
|
-
var
|
|
10106
|
-
var RulesyncSubagentFrontmatterSchema =
|
|
10107
|
-
targets:
|
|
10108
|
-
name:
|
|
10109
|
-
description:
|
|
10433
|
+
var import_node_path80 = require("path");
|
|
10434
|
+
var import_mini38 = require("zod/mini");
|
|
10435
|
+
var RulesyncSubagentFrontmatterSchema = import_mini38.z.looseObject({
|
|
10436
|
+
targets: import_mini38.z._default(RulesyncTargetsSchema, ["*"]),
|
|
10437
|
+
name: import_mini38.z.string(),
|
|
10438
|
+
description: import_mini38.z.string()
|
|
10110
10439
|
});
|
|
10111
10440
|
var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
10112
10441
|
frontmatter;
|
|
@@ -10115,7 +10444,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
10115
10444
|
const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
10116
10445
|
if (!parseResult.success && rest.validate !== false) {
|
|
10117
10446
|
throw new Error(
|
|
10118
|
-
`Invalid frontmatter in ${(0,
|
|
10447
|
+
`Invalid frontmatter in ${(0, import_node_path80.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
10119
10448
|
);
|
|
10120
10449
|
}
|
|
10121
10450
|
const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
|
|
@@ -10148,7 +10477,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
10148
10477
|
return {
|
|
10149
10478
|
success: false,
|
|
10150
10479
|
error: new Error(
|
|
10151
|
-
`Invalid frontmatter in ${(0,
|
|
10480
|
+
`Invalid frontmatter in ${(0, import_node_path80.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
10152
10481
|
)
|
|
10153
10482
|
};
|
|
10154
10483
|
}
|
|
@@ -10157,14 +10486,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
10157
10486
|
relativeFilePath
|
|
10158
10487
|
}) {
|
|
10159
10488
|
const fileContent = await readFileContent(
|
|
10160
|
-
(0,
|
|
10489
|
+
(0, import_node_path80.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath)
|
|
10161
10490
|
);
|
|
10162
10491
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
10163
10492
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
10164
10493
|
if (!result.success) {
|
|
10165
10494
|
throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
|
|
10166
10495
|
}
|
|
10167
|
-
const filename = (0,
|
|
10496
|
+
const filename = (0, import_node_path80.basename)(relativeFilePath);
|
|
10168
10497
|
return new _RulesyncSubagent({
|
|
10169
10498
|
baseDir: process.cwd(),
|
|
10170
10499
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
@@ -10176,13 +10505,13 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
10176
10505
|
};
|
|
10177
10506
|
|
|
10178
10507
|
// src/features/subagents/claudecode-subagent.ts
|
|
10179
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
10180
|
-
name:
|
|
10181
|
-
description:
|
|
10182
|
-
model:
|
|
10183
|
-
tools:
|
|
10184
|
-
permissionMode:
|
|
10185
|
-
skills:
|
|
10508
|
+
var ClaudecodeSubagentFrontmatterSchema = import_mini39.z.looseObject({
|
|
10509
|
+
name: import_mini39.z.string(),
|
|
10510
|
+
description: import_mini39.z.string(),
|
|
10511
|
+
model: import_mini39.z.optional(import_mini39.z.string()),
|
|
10512
|
+
tools: import_mini39.z.optional(import_mini39.z.union([import_mini39.z.string(), import_mini39.z.array(import_mini39.z.string())])),
|
|
10513
|
+
permissionMode: import_mini39.z.optional(import_mini39.z.string()),
|
|
10514
|
+
skills: import_mini39.z.optional(import_mini39.z.union([import_mini39.z.string(), import_mini39.z.array(import_mini39.z.string())]))
|
|
10186
10515
|
});
|
|
10187
10516
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
10188
10517
|
frontmatter;
|
|
@@ -10192,7 +10521,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
10192
10521
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
10193
10522
|
if (!result.success) {
|
|
10194
10523
|
throw new Error(
|
|
10195
|
-
`Invalid frontmatter in ${(0,
|
|
10524
|
+
`Invalid frontmatter in ${(0, import_node_path81.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
10196
10525
|
);
|
|
10197
10526
|
}
|
|
10198
10527
|
}
|
|
@@ -10204,7 +10533,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
10204
10533
|
}
|
|
10205
10534
|
static getSettablePaths(_options = {}) {
|
|
10206
10535
|
return {
|
|
10207
|
-
relativeDirPath: (0,
|
|
10536
|
+
relativeDirPath: (0, import_node_path81.join)(".claude", "agents")
|
|
10208
10537
|
};
|
|
10209
10538
|
}
|
|
10210
10539
|
getFrontmatter() {
|
|
@@ -10280,7 +10609,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
10280
10609
|
return {
|
|
10281
10610
|
success: false,
|
|
10282
10611
|
error: new Error(
|
|
10283
|
-
`Invalid frontmatter in ${(0,
|
|
10612
|
+
`Invalid frontmatter in ${(0, import_node_path81.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
10284
10613
|
)
|
|
10285
10614
|
};
|
|
10286
10615
|
}
|
|
@@ -10298,7 +10627,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
10298
10627
|
global = false
|
|
10299
10628
|
}) {
|
|
10300
10629
|
const paths = this.getSettablePaths({ global });
|
|
10301
|
-
const filePath = (0,
|
|
10630
|
+
const filePath = (0, import_node_path81.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
10302
10631
|
const fileContent = await readFileContent(filePath);
|
|
10303
10632
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
10304
10633
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -10333,20 +10662,31 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
10333
10662
|
};
|
|
10334
10663
|
|
|
10335
10664
|
// src/features/subagents/codexcli-subagent.ts
|
|
10336
|
-
var
|
|
10665
|
+
var import_node_path82 = require("path");
|
|
10337
10666
|
var smolToml2 = __toESM(require("smol-toml"), 1);
|
|
10338
|
-
var
|
|
10339
|
-
var CodexCliSubagentTomlSchema =
|
|
10340
|
-
name:
|
|
10341
|
-
description:
|
|
10342
|
-
developer_instructions:
|
|
10343
|
-
model:
|
|
10344
|
-
model_reasoning_effort:
|
|
10345
|
-
sandbox_mode:
|
|
10667
|
+
var import_mini40 = require("zod/mini");
|
|
10668
|
+
var CodexCliSubagentTomlSchema = import_mini40.z.looseObject({
|
|
10669
|
+
name: import_mini40.z.string(),
|
|
10670
|
+
description: import_mini40.z.optional(import_mini40.z.string()),
|
|
10671
|
+
developer_instructions: import_mini40.z.optional(import_mini40.z.string()),
|
|
10672
|
+
model: import_mini40.z.optional(import_mini40.z.string()),
|
|
10673
|
+
model_reasoning_effort: import_mini40.z.optional(import_mini40.z.string()),
|
|
10674
|
+
sandbox_mode: import_mini40.z.optional(import_mini40.z.string())
|
|
10346
10675
|
});
|
|
10347
10676
|
var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
10348
10677
|
body;
|
|
10349
10678
|
constructor({ body, ...rest }) {
|
|
10679
|
+
if (rest.validate !== false) {
|
|
10680
|
+
try {
|
|
10681
|
+
const parsed = smolToml2.parse(body);
|
|
10682
|
+
CodexCliSubagentTomlSchema.parse(parsed);
|
|
10683
|
+
} catch (error) {
|
|
10684
|
+
throw new Error(
|
|
10685
|
+
`Invalid TOML in ${(0, import_node_path82.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
10686
|
+
{ cause: error }
|
|
10687
|
+
);
|
|
10688
|
+
}
|
|
10689
|
+
}
|
|
10350
10690
|
super({
|
|
10351
10691
|
...rest
|
|
10352
10692
|
});
|
|
@@ -10354,7 +10694,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
10354
10694
|
}
|
|
10355
10695
|
static getSettablePaths(_options = {}) {
|
|
10356
10696
|
return {
|
|
10357
|
-
relativeDirPath: (0,
|
|
10697
|
+
relativeDirPath: (0, import_node_path82.join)(".codex", "agents")
|
|
10358
10698
|
};
|
|
10359
10699
|
}
|
|
10360
10700
|
getBody() {
|
|
@@ -10366,7 +10706,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
10366
10706
|
parsed = CodexCliSubagentTomlSchema.parse(smolToml2.parse(this.body));
|
|
10367
10707
|
} catch (error) {
|
|
10368
10708
|
throw new Error(
|
|
10369
|
-
`Failed to parse TOML in ${(0,
|
|
10709
|
+
`Failed to parse TOML in ${(0, import_node_path82.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
10370
10710
|
{ cause: error }
|
|
10371
10711
|
);
|
|
10372
10712
|
}
|
|
@@ -10398,12 +10738,11 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
10398
10738
|
}) {
|
|
10399
10739
|
const frontmatter = rulesyncSubagent.getFrontmatter();
|
|
10400
10740
|
const rawSection = frontmatter.codexcli ?? {};
|
|
10401
|
-
const
|
|
10402
|
-
name
|
|
10403
|
-
description
|
|
10404
|
-
developer_instructions
|
|
10405
|
-
|
|
10406
|
-
} = rawSection;
|
|
10741
|
+
const codexcliSection = this.filterToolSpecificSection(rawSection, [
|
|
10742
|
+
"name",
|
|
10743
|
+
"description",
|
|
10744
|
+
"developer_instructions"
|
|
10745
|
+
]);
|
|
10407
10746
|
const tomlObj = {
|
|
10408
10747
|
name: frontmatter.name,
|
|
10409
10748
|
...frontmatter.description ? { description: frontmatter.description } : {},
|
|
@@ -10448,9 +10787,9 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
10448
10787
|
global = false
|
|
10449
10788
|
}) {
|
|
10450
10789
|
const paths = this.getSettablePaths({ global });
|
|
10451
|
-
const filePath = (0,
|
|
10790
|
+
const filePath = (0, import_node_path82.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
10452
10791
|
const fileContent = await readFileContent(filePath);
|
|
10453
|
-
|
|
10792
|
+
const subagent = new _CodexCliSubagent({
|
|
10454
10793
|
baseDir,
|
|
10455
10794
|
relativeDirPath: paths.relativeDirPath,
|
|
10456
10795
|
relativeFilePath,
|
|
@@ -10459,6 +10798,15 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
10459
10798
|
validate,
|
|
10460
10799
|
global
|
|
10461
10800
|
});
|
|
10801
|
+
if (validate) {
|
|
10802
|
+
const result = subagent.validate();
|
|
10803
|
+
if (!result.success) {
|
|
10804
|
+
throw new Error(
|
|
10805
|
+
`Invalid TOML in ${filePath}: ${result.error instanceof Error ? result.error.message : String(result.error)}`
|
|
10806
|
+
);
|
|
10807
|
+
}
|
|
10808
|
+
}
|
|
10809
|
+
return subagent;
|
|
10462
10810
|
}
|
|
10463
10811
|
static forDeletion({
|
|
10464
10812
|
baseDir = process.cwd(),
|
|
@@ -10477,13 +10825,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
10477
10825
|
};
|
|
10478
10826
|
|
|
10479
10827
|
// src/features/subagents/copilot-subagent.ts
|
|
10480
|
-
var
|
|
10481
|
-
var
|
|
10828
|
+
var import_node_path83 = require("path");
|
|
10829
|
+
var import_mini41 = require("zod/mini");
|
|
10482
10830
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
10483
|
-
var CopilotSubagentFrontmatterSchema =
|
|
10484
|
-
name:
|
|
10485
|
-
description:
|
|
10486
|
-
tools:
|
|
10831
|
+
var CopilotSubagentFrontmatterSchema = import_mini41.z.looseObject({
|
|
10832
|
+
name: import_mini41.z.string(),
|
|
10833
|
+
description: import_mini41.z.string(),
|
|
10834
|
+
tools: import_mini41.z.optional(import_mini41.z.union([import_mini41.z.string(), import_mini41.z.array(import_mini41.z.string())]))
|
|
10487
10835
|
});
|
|
10488
10836
|
var normalizeTools = (tools) => {
|
|
10489
10837
|
if (!tools) {
|
|
@@ -10503,7 +10851,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
10503
10851
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
10504
10852
|
if (!result.success) {
|
|
10505
10853
|
throw new Error(
|
|
10506
|
-
`Invalid frontmatter in ${(0,
|
|
10854
|
+
`Invalid frontmatter in ${(0, import_node_path83.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
10507
10855
|
);
|
|
10508
10856
|
}
|
|
10509
10857
|
}
|
|
@@ -10515,7 +10863,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
10515
10863
|
}
|
|
10516
10864
|
static getSettablePaths(_options = {}) {
|
|
10517
10865
|
return {
|
|
10518
|
-
relativeDirPath: (0,
|
|
10866
|
+
relativeDirPath: (0, import_node_path83.join)(".github", "agents")
|
|
10519
10867
|
};
|
|
10520
10868
|
}
|
|
10521
10869
|
getFrontmatter() {
|
|
@@ -10589,7 +10937,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
10589
10937
|
return {
|
|
10590
10938
|
success: false,
|
|
10591
10939
|
error: new Error(
|
|
10592
|
-
`Invalid frontmatter in ${(0,
|
|
10940
|
+
`Invalid frontmatter in ${(0, import_node_path83.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
10593
10941
|
)
|
|
10594
10942
|
};
|
|
10595
10943
|
}
|
|
@@ -10607,7 +10955,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
10607
10955
|
global = false
|
|
10608
10956
|
}) {
|
|
10609
10957
|
const paths = this.getSettablePaths({ global });
|
|
10610
|
-
const filePath = (0,
|
|
10958
|
+
const filePath = (0, import_node_path83.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
10611
10959
|
const fileContent = await readFileContent(filePath);
|
|
10612
10960
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
10613
10961
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -10643,11 +10991,11 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
10643
10991
|
};
|
|
10644
10992
|
|
|
10645
10993
|
// src/features/subagents/cursor-subagent.ts
|
|
10646
|
-
var
|
|
10647
|
-
var
|
|
10648
|
-
var CursorSubagentFrontmatterSchema =
|
|
10649
|
-
name:
|
|
10650
|
-
description:
|
|
10994
|
+
var import_node_path84 = require("path");
|
|
10995
|
+
var import_mini42 = require("zod/mini");
|
|
10996
|
+
var CursorSubagentFrontmatterSchema = import_mini42.z.looseObject({
|
|
10997
|
+
name: import_mini42.z.string(),
|
|
10998
|
+
description: import_mini42.z.string()
|
|
10651
10999
|
});
|
|
10652
11000
|
var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
10653
11001
|
frontmatter;
|
|
@@ -10657,7 +11005,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
10657
11005
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
10658
11006
|
if (!result.success) {
|
|
10659
11007
|
throw new Error(
|
|
10660
|
-
`Invalid frontmatter in ${(0,
|
|
11008
|
+
`Invalid frontmatter in ${(0, import_node_path84.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
10661
11009
|
);
|
|
10662
11010
|
}
|
|
10663
11011
|
}
|
|
@@ -10669,7 +11017,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
10669
11017
|
}
|
|
10670
11018
|
static getSettablePaths(_options = {}) {
|
|
10671
11019
|
return {
|
|
10672
|
-
relativeDirPath: (0,
|
|
11020
|
+
relativeDirPath: (0, import_node_path84.join)(".cursor", "agents")
|
|
10673
11021
|
};
|
|
10674
11022
|
}
|
|
10675
11023
|
getFrontmatter() {
|
|
@@ -10736,7 +11084,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
10736
11084
|
return {
|
|
10737
11085
|
success: false,
|
|
10738
11086
|
error: new Error(
|
|
10739
|
-
`Invalid frontmatter in ${(0,
|
|
11087
|
+
`Invalid frontmatter in ${(0, import_node_path84.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
10740
11088
|
)
|
|
10741
11089
|
};
|
|
10742
11090
|
}
|
|
@@ -10754,7 +11102,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
10754
11102
|
global = false
|
|
10755
11103
|
}) {
|
|
10756
11104
|
const paths = this.getSettablePaths({ global });
|
|
10757
|
-
const filePath = (0,
|
|
11105
|
+
const filePath = (0, import_node_path84.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
10758
11106
|
const fileContent = await readFileContent(filePath);
|
|
10759
11107
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
10760
11108
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -10790,27 +11138,38 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
10790
11138
|
};
|
|
10791
11139
|
|
|
10792
11140
|
// src/features/subagents/kiro-subagent.ts
|
|
10793
|
-
var
|
|
10794
|
-
var
|
|
10795
|
-
var KiroCliSubagentJsonSchema =
|
|
10796
|
-
name:
|
|
10797
|
-
description:
|
|
10798
|
-
prompt:
|
|
10799
|
-
tools:
|
|
10800
|
-
toolAliases:
|
|
10801
|
-
toolSettings:
|
|
10802
|
-
toolSchema:
|
|
10803
|
-
hooks:
|
|
10804
|
-
model:
|
|
10805
|
-
mcpServers:
|
|
10806
|
-
useLegacyMcpJson:
|
|
10807
|
-
resources:
|
|
10808
|
-
allowedTools:
|
|
10809
|
-
includeMcpJson:
|
|
11141
|
+
var import_node_path85 = require("path");
|
|
11142
|
+
var import_mini43 = require("zod/mini");
|
|
11143
|
+
var KiroCliSubagentJsonSchema = import_mini43.z.looseObject({
|
|
11144
|
+
name: import_mini43.z.string(),
|
|
11145
|
+
description: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.string())),
|
|
11146
|
+
prompt: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.string())),
|
|
11147
|
+
tools: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.array(import_mini43.z.string()))),
|
|
11148
|
+
toolAliases: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.record(import_mini43.z.string(), import_mini43.z.string()))),
|
|
11149
|
+
toolSettings: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.unknown())),
|
|
11150
|
+
toolSchema: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.unknown())),
|
|
11151
|
+
hooks: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.record(import_mini43.z.string(), import_mini43.z.array(import_mini43.z.unknown())))),
|
|
11152
|
+
model: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.string())),
|
|
11153
|
+
mcpServers: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.record(import_mini43.z.string(), import_mini43.z.unknown()))),
|
|
11154
|
+
useLegacyMcpJson: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.boolean())),
|
|
11155
|
+
resources: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.array(import_mini43.z.string()))),
|
|
11156
|
+
allowedTools: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.array(import_mini43.z.string()))),
|
|
11157
|
+
includeMcpJson: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.boolean()))
|
|
10810
11158
|
});
|
|
10811
11159
|
var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
10812
11160
|
body;
|
|
10813
11161
|
constructor({ body, ...rest }) {
|
|
11162
|
+
if (rest.validate !== false) {
|
|
11163
|
+
try {
|
|
11164
|
+
const parsed = JSON.parse(body);
|
|
11165
|
+
KiroCliSubagentJsonSchema.parse(parsed);
|
|
11166
|
+
} catch (error) {
|
|
11167
|
+
throw new Error(
|
|
11168
|
+
`Invalid JSON in ${(0, import_node_path85.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
11169
|
+
{ cause: error }
|
|
11170
|
+
);
|
|
11171
|
+
}
|
|
11172
|
+
}
|
|
10814
11173
|
super({
|
|
10815
11174
|
...rest
|
|
10816
11175
|
});
|
|
@@ -10818,14 +11177,22 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
10818
11177
|
}
|
|
10819
11178
|
static getSettablePaths(_options = {}) {
|
|
10820
11179
|
return {
|
|
10821
|
-
relativeDirPath: (0,
|
|
11180
|
+
relativeDirPath: (0, import_node_path85.join)(".kiro", "agents")
|
|
10822
11181
|
};
|
|
10823
11182
|
}
|
|
10824
11183
|
getBody() {
|
|
10825
11184
|
return this.body;
|
|
10826
11185
|
}
|
|
10827
11186
|
toRulesyncSubagent() {
|
|
10828
|
-
|
|
11187
|
+
let parsed;
|
|
11188
|
+
try {
|
|
11189
|
+
parsed = JSON.parse(this.body);
|
|
11190
|
+
} catch (error) {
|
|
11191
|
+
throw new Error(
|
|
11192
|
+
`Failed to parse JSON in ${(0, import_node_path85.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
11193
|
+
{ cause: error }
|
|
11194
|
+
);
|
|
11195
|
+
}
|
|
10829
11196
|
const { name, description, prompt, ...restFields } = parsed;
|
|
10830
11197
|
const kiroSection = {
|
|
10831
11198
|
...restFields
|
|
@@ -10853,7 +11220,12 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
10853
11220
|
global = false
|
|
10854
11221
|
}) {
|
|
10855
11222
|
const frontmatter = rulesyncSubagent.getFrontmatter();
|
|
10856
|
-
const
|
|
11223
|
+
const rawSection = frontmatter.kiro ?? {};
|
|
11224
|
+
const kiroSection = this.filterToolSpecificSection(rawSection, [
|
|
11225
|
+
"name",
|
|
11226
|
+
"description",
|
|
11227
|
+
"prompt"
|
|
11228
|
+
]);
|
|
10857
11229
|
const json = {
|
|
10858
11230
|
name: frontmatter.name,
|
|
10859
11231
|
description: frontmatter.description || null,
|
|
@@ -10898,9 +11270,9 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
10898
11270
|
global = false
|
|
10899
11271
|
}) {
|
|
10900
11272
|
const paths = this.getSettablePaths({ global });
|
|
10901
|
-
const filePath = (0,
|
|
11273
|
+
const filePath = (0, import_node_path85.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
10902
11274
|
const fileContent = await readFileContent(filePath);
|
|
10903
|
-
|
|
11275
|
+
const subagent = new _KiroSubagent({
|
|
10904
11276
|
baseDir,
|
|
10905
11277
|
relativeDirPath: paths.relativeDirPath,
|
|
10906
11278
|
relativeFilePath,
|
|
@@ -10909,6 +11281,15 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
10909
11281
|
validate,
|
|
10910
11282
|
global
|
|
10911
11283
|
});
|
|
11284
|
+
if (validate) {
|
|
11285
|
+
const result = subagent.validate();
|
|
11286
|
+
if (!result.success) {
|
|
11287
|
+
throw new Error(
|
|
11288
|
+
`Invalid JSON in ${filePath}: ${result.error instanceof Error ? result.error.message : String(result.error)}`
|
|
11289
|
+
);
|
|
11290
|
+
}
|
|
11291
|
+
}
|
|
11292
|
+
return subagent;
|
|
10912
11293
|
}
|
|
10913
11294
|
static forDeletion({
|
|
10914
11295
|
baseDir = process.cwd(),
|
|
@@ -10927,12 +11308,12 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
10927
11308
|
};
|
|
10928
11309
|
|
|
10929
11310
|
// src/features/subagents/opencode-subagent.ts
|
|
10930
|
-
var
|
|
10931
|
-
var
|
|
10932
|
-
var OpenCodeSubagentFrontmatterSchema =
|
|
10933
|
-
description:
|
|
10934
|
-
mode:
|
|
10935
|
-
name:
|
|
11311
|
+
var import_node_path86 = require("path");
|
|
11312
|
+
var import_mini44 = require("zod/mini");
|
|
11313
|
+
var OpenCodeSubagentFrontmatterSchema = import_mini44.z.looseObject({
|
|
11314
|
+
description: import_mini44.z.string(),
|
|
11315
|
+
mode: import_mini44.z._default(import_mini44.z.string(), "subagent"),
|
|
11316
|
+
name: import_mini44.z.optional(import_mini44.z.string())
|
|
10936
11317
|
});
|
|
10937
11318
|
var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
10938
11319
|
frontmatter;
|
|
@@ -10942,7 +11323,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
10942
11323
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
10943
11324
|
if (!result.success) {
|
|
10944
11325
|
throw new Error(
|
|
10945
|
-
`Invalid frontmatter in ${(0,
|
|
11326
|
+
`Invalid frontmatter in ${(0, import_node_path86.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
10946
11327
|
);
|
|
10947
11328
|
}
|
|
10948
11329
|
}
|
|
@@ -10956,7 +11337,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
10956
11337
|
global = false
|
|
10957
11338
|
} = {}) {
|
|
10958
11339
|
return {
|
|
10959
|
-
relativeDirPath: global ? (0,
|
|
11340
|
+
relativeDirPath: global ? (0, import_node_path86.join)(".config", "opencode", "agent") : (0, import_node_path86.join)(".opencode", "agent")
|
|
10960
11341
|
};
|
|
10961
11342
|
}
|
|
10962
11343
|
getFrontmatter() {
|
|
@@ -10969,7 +11350,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
10969
11350
|
const { description, mode, name, ...opencodeSection } = this.frontmatter;
|
|
10970
11351
|
const rulesyncFrontmatter = {
|
|
10971
11352
|
targets: ["*"],
|
|
10972
|
-
name: name ?? (0,
|
|
11353
|
+
name: name ?? (0, import_node_path86.basename)(this.getRelativeFilePath(), ".md"),
|
|
10973
11354
|
description,
|
|
10974
11355
|
opencode: { mode, ...opencodeSection }
|
|
10975
11356
|
};
|
|
@@ -11022,7 +11403,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
11022
11403
|
return {
|
|
11023
11404
|
success: false,
|
|
11024
11405
|
error: new Error(
|
|
11025
|
-
`Invalid frontmatter in ${(0,
|
|
11406
|
+
`Invalid frontmatter in ${(0, import_node_path86.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11026
11407
|
)
|
|
11027
11408
|
};
|
|
11028
11409
|
}
|
|
@@ -11039,7 +11420,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
11039
11420
|
global = false
|
|
11040
11421
|
}) {
|
|
11041
11422
|
const paths = this.getSettablePaths({ global });
|
|
11042
|
-
const filePath = (0,
|
|
11423
|
+
const filePath = (0, import_node_path86.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11043
11424
|
const fileContent = await readFileContent(filePath);
|
|
11044
11425
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
11045
11426
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -11088,7 +11469,7 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
11088
11469
|
"opencode",
|
|
11089
11470
|
"roo"
|
|
11090
11471
|
];
|
|
11091
|
-
var SubagentsProcessorToolTargetSchema =
|
|
11472
|
+
var SubagentsProcessorToolTargetSchema = import_mini45.z.enum(subagentsProcessorToolTargetTuple);
|
|
11092
11473
|
var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
11093
11474
|
[
|
|
11094
11475
|
"agentsmd",
|
|
@@ -11250,7 +11631,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
11250
11631
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
11251
11632
|
*/
|
|
11252
11633
|
async loadRulesyncFiles() {
|
|
11253
|
-
const subagentsDir = (0,
|
|
11634
|
+
const subagentsDir = (0, import_node_path87.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
11254
11635
|
const dirExists = await directoryExists(subagentsDir);
|
|
11255
11636
|
if (!dirExists) {
|
|
11256
11637
|
logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -11265,7 +11646,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
11265
11646
|
logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
11266
11647
|
const rulesyncSubagents = [];
|
|
11267
11648
|
for (const mdFile of mdFiles) {
|
|
11268
|
-
const filepath = (0,
|
|
11649
|
+
const filepath = (0, import_node_path87.join)(subagentsDir, mdFile);
|
|
11269
11650
|
try {
|
|
11270
11651
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
11271
11652
|
relativeFilePath: mdFile,
|
|
@@ -11295,14 +11676,14 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
11295
11676
|
const factory = this.getFactory(this.toolTarget);
|
|
11296
11677
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
11297
11678
|
const subagentFilePaths = await findFilesByGlobs(
|
|
11298
|
-
(0,
|
|
11679
|
+
(0, import_node_path87.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
|
|
11299
11680
|
);
|
|
11300
11681
|
if (forDeletion) {
|
|
11301
11682
|
const toolSubagents2 = subagentFilePaths.map(
|
|
11302
11683
|
(path3) => factory.class.forDeletion({
|
|
11303
11684
|
baseDir: this.baseDir,
|
|
11304
11685
|
relativeDirPath: paths.relativeDirPath,
|
|
11305
|
-
relativeFilePath: (0,
|
|
11686
|
+
relativeFilePath: (0, import_node_path87.basename)(path3),
|
|
11306
11687
|
global: this.global
|
|
11307
11688
|
})
|
|
11308
11689
|
).filter((subagent) => subagent.isDeletable());
|
|
@@ -11315,7 +11696,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
11315
11696
|
subagentFilePaths.map(
|
|
11316
11697
|
(path3) => factory.class.fromFile({
|
|
11317
11698
|
baseDir: this.baseDir,
|
|
11318
|
-
relativeFilePath: (0,
|
|
11699
|
+
relativeFilePath: (0, import_node_path87.basename)(path3),
|
|
11319
11700
|
global: this.global
|
|
11320
11701
|
})
|
|
11321
11702
|
)
|
|
@@ -11360,49 +11741,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
11360
11741
|
};
|
|
11361
11742
|
|
|
11362
11743
|
// src/features/rules/agentsmd-rule.ts
|
|
11363
|
-
var
|
|
11744
|
+
var import_node_path90 = require("path");
|
|
11364
11745
|
|
|
11365
11746
|
// src/features/rules/tool-rule.ts
|
|
11366
|
-
var
|
|
11747
|
+
var import_node_path89 = require("path");
|
|
11367
11748
|
|
|
11368
11749
|
// src/features/rules/rulesync-rule.ts
|
|
11369
|
-
var
|
|
11370
|
-
var
|
|
11371
|
-
var RulesyncRuleFrontmatterSchema =
|
|
11372
|
-
root:
|
|
11373
|
-
localRoot:
|
|
11374
|
-
targets:
|
|
11375
|
-
description:
|
|
11376
|
-
globs:
|
|
11377
|
-
agentsmd:
|
|
11378
|
-
|
|
11750
|
+
var import_node_path88 = require("path");
|
|
11751
|
+
var import_mini46 = require("zod/mini");
|
|
11752
|
+
var RulesyncRuleFrontmatterSchema = import_mini46.z.object({
|
|
11753
|
+
root: import_mini46.z.optional(import_mini46.z.boolean()),
|
|
11754
|
+
localRoot: import_mini46.z.optional(import_mini46.z.boolean()),
|
|
11755
|
+
targets: import_mini46.z._default(RulesyncTargetsSchema, ["*"]),
|
|
11756
|
+
description: import_mini46.z.optional(import_mini46.z.string()),
|
|
11757
|
+
globs: import_mini46.z.optional(import_mini46.z.array(import_mini46.z.string())),
|
|
11758
|
+
agentsmd: import_mini46.z.optional(
|
|
11759
|
+
import_mini46.z.object({
|
|
11379
11760
|
// @example "path/to/subproject"
|
|
11380
|
-
subprojectPath:
|
|
11761
|
+
subprojectPath: import_mini46.z.optional(import_mini46.z.string())
|
|
11381
11762
|
})
|
|
11382
11763
|
),
|
|
11383
|
-
claudecode:
|
|
11384
|
-
|
|
11764
|
+
claudecode: import_mini46.z.optional(
|
|
11765
|
+
import_mini46.z.object({
|
|
11385
11766
|
// Glob patterns for conditional rules (takes precedence over globs)
|
|
11386
11767
|
// @example ["src/**/*.ts", "tests/**/*.test.ts"]
|
|
11387
|
-
paths:
|
|
11768
|
+
paths: import_mini46.z.optional(import_mini46.z.array(import_mini46.z.string()))
|
|
11388
11769
|
})
|
|
11389
11770
|
),
|
|
11390
|
-
cursor:
|
|
11391
|
-
|
|
11392
|
-
alwaysApply:
|
|
11393
|
-
description:
|
|
11394
|
-
globs:
|
|
11771
|
+
cursor: import_mini46.z.optional(
|
|
11772
|
+
import_mini46.z.object({
|
|
11773
|
+
alwaysApply: import_mini46.z.optional(import_mini46.z.boolean()),
|
|
11774
|
+
description: import_mini46.z.optional(import_mini46.z.string()),
|
|
11775
|
+
globs: import_mini46.z.optional(import_mini46.z.array(import_mini46.z.string()))
|
|
11395
11776
|
})
|
|
11396
11777
|
),
|
|
11397
|
-
copilot:
|
|
11398
|
-
|
|
11399
|
-
excludeAgent:
|
|
11778
|
+
copilot: import_mini46.z.optional(
|
|
11779
|
+
import_mini46.z.object({
|
|
11780
|
+
excludeAgent: import_mini46.z.optional(import_mini46.z.union([import_mini46.z.literal("code-review"), import_mini46.z.literal("coding-agent")]))
|
|
11400
11781
|
})
|
|
11401
11782
|
),
|
|
11402
|
-
antigravity:
|
|
11403
|
-
|
|
11404
|
-
trigger:
|
|
11405
|
-
globs:
|
|
11783
|
+
antigravity: import_mini46.z.optional(
|
|
11784
|
+
import_mini46.z.looseObject({
|
|
11785
|
+
trigger: import_mini46.z.optional(import_mini46.z.string()),
|
|
11786
|
+
globs: import_mini46.z.optional(import_mini46.z.array(import_mini46.z.string()))
|
|
11406
11787
|
})
|
|
11407
11788
|
)
|
|
11408
11789
|
});
|
|
@@ -11413,7 +11794,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
11413
11794
|
const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
11414
11795
|
if (!parseResult.success && rest.validate !== false) {
|
|
11415
11796
|
throw new Error(
|
|
11416
|
-
`Invalid frontmatter in ${(0,
|
|
11797
|
+
`Invalid frontmatter in ${(0, import_node_path88.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
11417
11798
|
);
|
|
11418
11799
|
}
|
|
11419
11800
|
const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
|
|
@@ -11448,7 +11829,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
11448
11829
|
return {
|
|
11449
11830
|
success: false,
|
|
11450
11831
|
error: new Error(
|
|
11451
|
-
`Invalid frontmatter in ${(0,
|
|
11832
|
+
`Invalid frontmatter in ${(0, import_node_path88.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11452
11833
|
)
|
|
11453
11834
|
};
|
|
11454
11835
|
}
|
|
@@ -11457,7 +11838,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
11457
11838
|
relativeFilePath,
|
|
11458
11839
|
validate = true
|
|
11459
11840
|
}) {
|
|
11460
|
-
const filePath = (0,
|
|
11841
|
+
const filePath = (0, import_node_path88.join)(
|
|
11461
11842
|
process.cwd(),
|
|
11462
11843
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
11463
11844
|
relativeFilePath
|
|
@@ -11559,7 +11940,7 @@ var ToolRule = class extends ToolFile {
|
|
|
11559
11940
|
rulesyncRule,
|
|
11560
11941
|
validate = true,
|
|
11561
11942
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
11562
|
-
nonRootPath = { relativeDirPath: (0,
|
|
11943
|
+
nonRootPath = { relativeDirPath: (0, import_node_path89.join)(".agents", "memories") }
|
|
11563
11944
|
}) {
|
|
11564
11945
|
const params = this.buildToolRuleParamsDefault({
|
|
11565
11946
|
baseDir,
|
|
@@ -11570,7 +11951,7 @@ var ToolRule = class extends ToolFile {
|
|
|
11570
11951
|
});
|
|
11571
11952
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
11572
11953
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
11573
|
-
params.relativeDirPath = (0,
|
|
11954
|
+
params.relativeDirPath = (0, import_node_path89.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
11574
11955
|
params.relativeFilePath = "AGENTS.md";
|
|
11575
11956
|
}
|
|
11576
11957
|
return params;
|
|
@@ -11619,7 +12000,7 @@ var ToolRule = class extends ToolFile {
|
|
|
11619
12000
|
}
|
|
11620
12001
|
};
|
|
11621
12002
|
function buildToolPath(toolDir, subDir, excludeToolDir) {
|
|
11622
|
-
return excludeToolDir ? subDir : (0,
|
|
12003
|
+
return excludeToolDir ? subDir : (0, import_node_path89.join)(toolDir, subDir);
|
|
11623
12004
|
}
|
|
11624
12005
|
|
|
11625
12006
|
// src/features/rules/agentsmd-rule.ts
|
|
@@ -11648,8 +12029,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
11648
12029
|
validate = true
|
|
11649
12030
|
}) {
|
|
11650
12031
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
11651
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
11652
|
-
const fileContent = await readFileContent((0,
|
|
12032
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path90.join)(".agents", "memories", relativeFilePath);
|
|
12033
|
+
const fileContent = await readFileContent((0, import_node_path90.join)(baseDir, relativePath));
|
|
11653
12034
|
return new _AgentsMdRule({
|
|
11654
12035
|
baseDir,
|
|
11655
12036
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -11704,21 +12085,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
11704
12085
|
};
|
|
11705
12086
|
|
|
11706
12087
|
// src/features/rules/antigravity-rule.ts
|
|
11707
|
-
var
|
|
11708
|
-
var
|
|
11709
|
-
var AntigravityRuleFrontmatterSchema =
|
|
11710
|
-
trigger:
|
|
11711
|
-
|
|
11712
|
-
|
|
11713
|
-
|
|
11714
|
-
|
|
11715
|
-
|
|
11716
|
-
|
|
12088
|
+
var import_node_path91 = require("path");
|
|
12089
|
+
var import_mini47 = require("zod/mini");
|
|
12090
|
+
var AntigravityRuleFrontmatterSchema = import_mini47.z.looseObject({
|
|
12091
|
+
trigger: import_mini47.z.optional(
|
|
12092
|
+
import_mini47.z.union([
|
|
12093
|
+
import_mini47.z.literal("always_on"),
|
|
12094
|
+
import_mini47.z.literal("glob"),
|
|
12095
|
+
import_mini47.z.literal("manual"),
|
|
12096
|
+
import_mini47.z.literal("model_decision"),
|
|
12097
|
+
import_mini47.z.string()
|
|
11717
12098
|
// accepts any string for forward compatibility
|
|
11718
12099
|
])
|
|
11719
12100
|
),
|
|
11720
|
-
globs:
|
|
11721
|
-
description:
|
|
12101
|
+
globs: import_mini47.z.optional(import_mini47.z.string()),
|
|
12102
|
+
description: import_mini47.z.optional(import_mini47.z.string())
|
|
11722
12103
|
});
|
|
11723
12104
|
function parseGlobsString(globs) {
|
|
11724
12105
|
if (!globs) {
|
|
@@ -11863,7 +12244,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
11863
12244
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
11864
12245
|
if (!result.success) {
|
|
11865
12246
|
throw new Error(
|
|
11866
|
-
`Invalid frontmatter in ${(0,
|
|
12247
|
+
`Invalid frontmatter in ${(0, import_node_path91.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11867
12248
|
);
|
|
11868
12249
|
}
|
|
11869
12250
|
}
|
|
@@ -11887,7 +12268,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
11887
12268
|
relativeFilePath,
|
|
11888
12269
|
validate = true
|
|
11889
12270
|
}) {
|
|
11890
|
-
const filePath = (0,
|
|
12271
|
+
const filePath = (0, import_node_path91.join)(
|
|
11891
12272
|
baseDir,
|
|
11892
12273
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
11893
12274
|
relativeFilePath
|
|
@@ -12028,7 +12409,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
12028
12409
|
};
|
|
12029
12410
|
|
|
12030
12411
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
12031
|
-
var
|
|
12412
|
+
var import_node_path92 = require("path");
|
|
12032
12413
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
12033
12414
|
toRulesyncRule() {
|
|
12034
12415
|
const rulesyncFrontmatter = {
|
|
@@ -12089,8 +12470,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
12089
12470
|
}) {
|
|
12090
12471
|
const settablePaths = this.getSettablePaths();
|
|
12091
12472
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
12092
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0,
|
|
12093
|
-
const fileContent = await readFileContent((0,
|
|
12473
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path92.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
12474
|
+
const fileContent = await readFileContent((0, import_node_path92.join)(baseDir, relativePath));
|
|
12094
12475
|
return new _AugmentcodeLegacyRule({
|
|
12095
12476
|
baseDir,
|
|
12096
12477
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -12119,7 +12500,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
12119
12500
|
};
|
|
12120
12501
|
|
|
12121
12502
|
// src/features/rules/augmentcode-rule.ts
|
|
12122
|
-
var
|
|
12503
|
+
var import_node_path93 = require("path");
|
|
12123
12504
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
12124
12505
|
toRulesyncRule() {
|
|
12125
12506
|
return this.toRulesyncRuleDefault();
|
|
@@ -12151,7 +12532,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
12151
12532
|
validate = true
|
|
12152
12533
|
}) {
|
|
12153
12534
|
const fileContent = await readFileContent(
|
|
12154
|
-
(0,
|
|
12535
|
+
(0, import_node_path93.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
12155
12536
|
);
|
|
12156
12537
|
const { body: content } = parseFrontmatter(fileContent);
|
|
12157
12538
|
return new _AugmentcodeRule({
|
|
@@ -12187,7 +12568,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
12187
12568
|
};
|
|
12188
12569
|
|
|
12189
12570
|
// src/features/rules/claudecode-legacy-rule.ts
|
|
12190
|
-
var
|
|
12571
|
+
var import_node_path94 = require("path");
|
|
12191
12572
|
var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
12192
12573
|
static getSettablePaths({
|
|
12193
12574
|
global,
|
|
@@ -12222,7 +12603,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
12222
12603
|
if (isRoot) {
|
|
12223
12604
|
const relativePath2 = paths.root.relativeFilePath;
|
|
12224
12605
|
const fileContent2 = await readFileContent(
|
|
12225
|
-
(0,
|
|
12606
|
+
(0, import_node_path94.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
12226
12607
|
);
|
|
12227
12608
|
return new _ClaudecodeLegacyRule({
|
|
12228
12609
|
baseDir,
|
|
@@ -12236,8 +12617,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
12236
12617
|
if (!paths.nonRoot) {
|
|
12237
12618
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
12238
12619
|
}
|
|
12239
|
-
const relativePath = (0,
|
|
12240
|
-
const fileContent = await readFileContent((0,
|
|
12620
|
+
const relativePath = (0, import_node_path94.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
12621
|
+
const fileContent = await readFileContent((0, import_node_path94.join)(baseDir, relativePath));
|
|
12241
12622
|
return new _ClaudecodeLegacyRule({
|
|
12242
12623
|
baseDir,
|
|
12243
12624
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -12296,10 +12677,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
12296
12677
|
};
|
|
12297
12678
|
|
|
12298
12679
|
// src/features/rules/claudecode-rule.ts
|
|
12299
|
-
var
|
|
12300
|
-
var
|
|
12301
|
-
var ClaudecodeRuleFrontmatterSchema =
|
|
12302
|
-
paths:
|
|
12680
|
+
var import_node_path95 = require("path");
|
|
12681
|
+
var import_mini48 = require("zod/mini");
|
|
12682
|
+
var ClaudecodeRuleFrontmatterSchema = import_mini48.z.object({
|
|
12683
|
+
paths: import_mini48.z.optional(import_mini48.z.array(import_mini48.z.string()))
|
|
12303
12684
|
});
|
|
12304
12685
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
12305
12686
|
frontmatter;
|
|
@@ -12331,7 +12712,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
12331
12712
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
12332
12713
|
if (!result.success) {
|
|
12333
12714
|
throw new Error(
|
|
12334
|
-
`Invalid frontmatter in ${(0,
|
|
12715
|
+
`Invalid frontmatter in ${(0, import_node_path95.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
12335
12716
|
);
|
|
12336
12717
|
}
|
|
12337
12718
|
}
|
|
@@ -12359,7 +12740,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
12359
12740
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
12360
12741
|
if (isRoot) {
|
|
12361
12742
|
const fileContent2 = await readFileContent(
|
|
12362
|
-
(0,
|
|
12743
|
+
(0, import_node_path95.join)(baseDir, paths.root.relativeDirPath, paths.root.relativeFilePath)
|
|
12363
12744
|
);
|
|
12364
12745
|
return new _ClaudecodeRule({
|
|
12365
12746
|
baseDir,
|
|
@@ -12374,13 +12755,13 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
12374
12755
|
if (!paths.nonRoot) {
|
|
12375
12756
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
12376
12757
|
}
|
|
12377
|
-
const relativePath = (0,
|
|
12378
|
-
const fileContent = await readFileContent((0,
|
|
12758
|
+
const relativePath = (0, import_node_path95.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
12759
|
+
const fileContent = await readFileContent((0, import_node_path95.join)(baseDir, relativePath));
|
|
12379
12760
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
12380
12761
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
12381
12762
|
if (!result.success) {
|
|
12382
12763
|
throw new Error(
|
|
12383
|
-
`Invalid frontmatter in ${(0,
|
|
12764
|
+
`Invalid frontmatter in ${(0, import_node_path95.join)(baseDir, relativePath)}: ${formatError(result.error)}`
|
|
12384
12765
|
);
|
|
12385
12766
|
}
|
|
12386
12767
|
return new _ClaudecodeRule({
|
|
@@ -12487,7 +12868,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
12487
12868
|
return {
|
|
12488
12869
|
success: false,
|
|
12489
12870
|
error: new Error(
|
|
12490
|
-
`Invalid frontmatter in ${(0,
|
|
12871
|
+
`Invalid frontmatter in ${(0, import_node_path95.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
12491
12872
|
)
|
|
12492
12873
|
};
|
|
12493
12874
|
}
|
|
@@ -12507,10 +12888,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
12507
12888
|
};
|
|
12508
12889
|
|
|
12509
12890
|
// src/features/rules/cline-rule.ts
|
|
12510
|
-
var
|
|
12511
|
-
var
|
|
12512
|
-
var ClineRuleFrontmatterSchema =
|
|
12513
|
-
description:
|
|
12891
|
+
var import_node_path96 = require("path");
|
|
12892
|
+
var import_mini49 = require("zod/mini");
|
|
12893
|
+
var ClineRuleFrontmatterSchema = import_mini49.z.object({
|
|
12894
|
+
description: import_mini49.z.string()
|
|
12514
12895
|
});
|
|
12515
12896
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
12516
12897
|
static getSettablePaths(_options = {}) {
|
|
@@ -12553,7 +12934,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
12553
12934
|
validate = true
|
|
12554
12935
|
}) {
|
|
12555
12936
|
const fileContent = await readFileContent(
|
|
12556
|
-
(0,
|
|
12937
|
+
(0, import_node_path96.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
12557
12938
|
);
|
|
12558
12939
|
return new _ClineRule({
|
|
12559
12940
|
baseDir,
|
|
@@ -12579,7 +12960,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
12579
12960
|
};
|
|
12580
12961
|
|
|
12581
12962
|
// src/features/rules/codexcli-rule.ts
|
|
12582
|
-
var
|
|
12963
|
+
var import_node_path97 = require("path");
|
|
12583
12964
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
12584
12965
|
static getSettablePaths({
|
|
12585
12966
|
global,
|
|
@@ -12614,7 +12995,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
12614
12995
|
if (isRoot) {
|
|
12615
12996
|
const relativePath2 = paths.root.relativeFilePath;
|
|
12616
12997
|
const fileContent2 = await readFileContent(
|
|
12617
|
-
(0,
|
|
12998
|
+
(0, import_node_path97.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
12618
12999
|
);
|
|
12619
13000
|
return new _CodexcliRule({
|
|
12620
13001
|
baseDir,
|
|
@@ -12628,8 +13009,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
12628
13009
|
if (!paths.nonRoot) {
|
|
12629
13010
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
12630
13011
|
}
|
|
12631
|
-
const relativePath = (0,
|
|
12632
|
-
const fileContent = await readFileContent((0,
|
|
13012
|
+
const relativePath = (0, import_node_path97.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13013
|
+
const fileContent = await readFileContent((0, import_node_path97.join)(baseDir, relativePath));
|
|
12633
13014
|
return new _CodexcliRule({
|
|
12634
13015
|
baseDir,
|
|
12635
13016
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -12688,12 +13069,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
12688
13069
|
};
|
|
12689
13070
|
|
|
12690
13071
|
// src/features/rules/copilot-rule.ts
|
|
12691
|
-
var
|
|
12692
|
-
var
|
|
12693
|
-
var CopilotRuleFrontmatterSchema =
|
|
12694
|
-
description:
|
|
12695
|
-
applyTo:
|
|
12696
|
-
excludeAgent:
|
|
13072
|
+
var import_node_path98 = require("path");
|
|
13073
|
+
var import_mini50 = require("zod/mini");
|
|
13074
|
+
var CopilotRuleFrontmatterSchema = import_mini50.z.object({
|
|
13075
|
+
description: import_mini50.z.optional(import_mini50.z.string()),
|
|
13076
|
+
applyTo: import_mini50.z.optional(import_mini50.z.string()),
|
|
13077
|
+
excludeAgent: import_mini50.z.optional(import_mini50.z.union([import_mini50.z.literal("code-review"), import_mini50.z.literal("coding-agent")]))
|
|
12697
13078
|
});
|
|
12698
13079
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
12699
13080
|
frontmatter;
|
|
@@ -12722,7 +13103,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
12722
13103
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
12723
13104
|
if (!result.success) {
|
|
12724
13105
|
throw new Error(
|
|
12725
|
-
`Invalid frontmatter in ${(0,
|
|
13106
|
+
`Invalid frontmatter in ${(0, import_node_path98.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
12726
13107
|
);
|
|
12727
13108
|
}
|
|
12728
13109
|
}
|
|
@@ -12812,8 +13193,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
12812
13193
|
const paths = this.getSettablePaths({ global });
|
|
12813
13194
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
12814
13195
|
if (isRoot) {
|
|
12815
|
-
const relativePath2 = (0,
|
|
12816
|
-
const fileContent2 = await readFileContent((0,
|
|
13196
|
+
const relativePath2 = (0, import_node_path98.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
13197
|
+
const fileContent2 = await readFileContent((0, import_node_path98.join)(baseDir, relativePath2));
|
|
12817
13198
|
return new _CopilotRule({
|
|
12818
13199
|
baseDir,
|
|
12819
13200
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -12827,13 +13208,13 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
12827
13208
|
if (!paths.nonRoot) {
|
|
12828
13209
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
12829
13210
|
}
|
|
12830
|
-
const relativePath = (0,
|
|
12831
|
-
const fileContent = await readFileContent((0,
|
|
13211
|
+
const relativePath = (0, import_node_path98.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13212
|
+
const fileContent = await readFileContent((0, import_node_path98.join)(baseDir, relativePath));
|
|
12832
13213
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
12833
13214
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
12834
13215
|
if (!result.success) {
|
|
12835
13216
|
throw new Error(
|
|
12836
|
-
`Invalid frontmatter in ${(0,
|
|
13217
|
+
`Invalid frontmatter in ${(0, import_node_path98.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
12837
13218
|
);
|
|
12838
13219
|
}
|
|
12839
13220
|
return new _CopilotRule({
|
|
@@ -12875,7 +13256,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
12875
13256
|
return {
|
|
12876
13257
|
success: false,
|
|
12877
13258
|
error: new Error(
|
|
12878
|
-
`Invalid frontmatter in ${(0,
|
|
13259
|
+
`Invalid frontmatter in ${(0, import_node_path98.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
12879
13260
|
)
|
|
12880
13261
|
};
|
|
12881
13262
|
}
|
|
@@ -12895,12 +13276,12 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
12895
13276
|
};
|
|
12896
13277
|
|
|
12897
13278
|
// src/features/rules/cursor-rule.ts
|
|
12898
|
-
var
|
|
12899
|
-
var
|
|
12900
|
-
var CursorRuleFrontmatterSchema =
|
|
12901
|
-
description:
|
|
12902
|
-
globs:
|
|
12903
|
-
alwaysApply:
|
|
13279
|
+
var import_node_path99 = require("path");
|
|
13280
|
+
var import_mini51 = require("zod/mini");
|
|
13281
|
+
var CursorRuleFrontmatterSchema = import_mini51.z.object({
|
|
13282
|
+
description: import_mini51.z.optional(import_mini51.z.string()),
|
|
13283
|
+
globs: import_mini51.z.optional(import_mini51.z.string()),
|
|
13284
|
+
alwaysApply: import_mini51.z.optional(import_mini51.z.boolean())
|
|
12904
13285
|
});
|
|
12905
13286
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
12906
13287
|
frontmatter;
|
|
@@ -12917,7 +13298,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
12917
13298
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
12918
13299
|
if (!result.success) {
|
|
12919
13300
|
throw new Error(
|
|
12920
|
-
`Invalid frontmatter in ${(0,
|
|
13301
|
+
`Invalid frontmatter in ${(0, import_node_path99.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
12921
13302
|
);
|
|
12922
13303
|
}
|
|
12923
13304
|
}
|
|
@@ -13034,13 +13415,13 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
13034
13415
|
validate = true
|
|
13035
13416
|
}) {
|
|
13036
13417
|
const fileContent = await readFileContent(
|
|
13037
|
-
(0,
|
|
13418
|
+
(0, import_node_path99.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
13038
13419
|
);
|
|
13039
13420
|
const { frontmatter, body: content } = _CursorRule.parseCursorFrontmatter(fileContent);
|
|
13040
13421
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
13041
13422
|
if (!result.success) {
|
|
13042
13423
|
throw new Error(
|
|
13043
|
-
`Invalid frontmatter in ${(0,
|
|
13424
|
+
`Invalid frontmatter in ${(0, import_node_path99.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
13044
13425
|
);
|
|
13045
13426
|
}
|
|
13046
13427
|
return new _CursorRule({
|
|
@@ -13077,7 +13458,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
13077
13458
|
return {
|
|
13078
13459
|
success: false,
|
|
13079
13460
|
error: new Error(
|
|
13080
|
-
`Invalid frontmatter in ${(0,
|
|
13461
|
+
`Invalid frontmatter in ${(0, import_node_path99.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
13081
13462
|
)
|
|
13082
13463
|
};
|
|
13083
13464
|
}
|
|
@@ -13097,7 +13478,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
13097
13478
|
};
|
|
13098
13479
|
|
|
13099
13480
|
// src/features/rules/factorydroid-rule.ts
|
|
13100
|
-
var
|
|
13481
|
+
var import_node_path100 = require("path");
|
|
13101
13482
|
var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
13102
13483
|
constructor({ fileContent, root, ...rest }) {
|
|
13103
13484
|
super({
|
|
@@ -13137,8 +13518,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
13137
13518
|
const paths = this.getSettablePaths({ global });
|
|
13138
13519
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
13139
13520
|
if (isRoot) {
|
|
13140
|
-
const relativePath2 = (0,
|
|
13141
|
-
const fileContent2 = await readFileContent((0,
|
|
13521
|
+
const relativePath2 = (0, import_node_path100.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
13522
|
+
const fileContent2 = await readFileContent((0, import_node_path100.join)(baseDir, relativePath2));
|
|
13142
13523
|
return new _FactorydroidRule({
|
|
13143
13524
|
baseDir,
|
|
13144
13525
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -13151,8 +13532,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
13151
13532
|
if (!paths.nonRoot) {
|
|
13152
13533
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13153
13534
|
}
|
|
13154
|
-
const relativePath = (0,
|
|
13155
|
-
const fileContent = await readFileContent((0,
|
|
13535
|
+
const relativePath = (0, import_node_path100.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13536
|
+
const fileContent = await readFileContent((0, import_node_path100.join)(baseDir, relativePath));
|
|
13156
13537
|
return new _FactorydroidRule({
|
|
13157
13538
|
baseDir,
|
|
13158
13539
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -13211,7 +13592,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
13211
13592
|
};
|
|
13212
13593
|
|
|
13213
13594
|
// src/features/rules/geminicli-rule.ts
|
|
13214
|
-
var
|
|
13595
|
+
var import_node_path101 = require("path");
|
|
13215
13596
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
13216
13597
|
static getSettablePaths({
|
|
13217
13598
|
global,
|
|
@@ -13246,7 +13627,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
13246
13627
|
if (isRoot) {
|
|
13247
13628
|
const relativePath2 = paths.root.relativeFilePath;
|
|
13248
13629
|
const fileContent2 = await readFileContent(
|
|
13249
|
-
(0,
|
|
13630
|
+
(0, import_node_path101.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
13250
13631
|
);
|
|
13251
13632
|
return new _GeminiCliRule({
|
|
13252
13633
|
baseDir,
|
|
@@ -13260,8 +13641,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
13260
13641
|
if (!paths.nonRoot) {
|
|
13261
13642
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13262
13643
|
}
|
|
13263
|
-
const relativePath = (0,
|
|
13264
|
-
const fileContent = await readFileContent((0,
|
|
13644
|
+
const relativePath = (0, import_node_path101.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13645
|
+
const fileContent = await readFileContent((0, import_node_path101.join)(baseDir, relativePath));
|
|
13265
13646
|
return new _GeminiCliRule({
|
|
13266
13647
|
baseDir,
|
|
13267
13648
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -13320,7 +13701,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
13320
13701
|
};
|
|
13321
13702
|
|
|
13322
13703
|
// src/features/rules/goose-rule.ts
|
|
13323
|
-
var
|
|
13704
|
+
var import_node_path102 = require("path");
|
|
13324
13705
|
var GooseRule = class _GooseRule extends ToolRule {
|
|
13325
13706
|
static getSettablePaths({
|
|
13326
13707
|
global,
|
|
@@ -13355,7 +13736,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
13355
13736
|
if (isRoot) {
|
|
13356
13737
|
const relativePath2 = paths.root.relativeFilePath;
|
|
13357
13738
|
const fileContent2 = await readFileContent(
|
|
13358
|
-
(0,
|
|
13739
|
+
(0, import_node_path102.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
13359
13740
|
);
|
|
13360
13741
|
return new _GooseRule({
|
|
13361
13742
|
baseDir,
|
|
@@ -13369,8 +13750,8 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
13369
13750
|
if (!paths.nonRoot) {
|
|
13370
13751
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13371
13752
|
}
|
|
13372
|
-
const relativePath = (0,
|
|
13373
|
-
const fileContent = await readFileContent((0,
|
|
13753
|
+
const relativePath = (0, import_node_path102.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13754
|
+
const fileContent = await readFileContent((0, import_node_path102.join)(baseDir, relativePath));
|
|
13374
13755
|
return new _GooseRule({
|
|
13375
13756
|
baseDir,
|
|
13376
13757
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -13429,7 +13810,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
13429
13810
|
};
|
|
13430
13811
|
|
|
13431
13812
|
// src/features/rules/junie-rule.ts
|
|
13432
|
-
var
|
|
13813
|
+
var import_node_path103 = require("path");
|
|
13433
13814
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
13434
13815
|
static getSettablePaths(_options = {}) {
|
|
13435
13816
|
return {
|
|
@@ -13448,8 +13829,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
13448
13829
|
validate = true
|
|
13449
13830
|
}) {
|
|
13450
13831
|
const isRoot = relativeFilePath === "guidelines.md";
|
|
13451
|
-
const relativePath = isRoot ? "guidelines.md" : (0,
|
|
13452
|
-
const fileContent = await readFileContent((0,
|
|
13832
|
+
const relativePath = isRoot ? "guidelines.md" : (0, import_node_path103.join)(".junie", "memories", relativeFilePath);
|
|
13833
|
+
const fileContent = await readFileContent((0, import_node_path103.join)(baseDir, relativePath));
|
|
13453
13834
|
return new _JunieRule({
|
|
13454
13835
|
baseDir,
|
|
13455
13836
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -13504,7 +13885,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
13504
13885
|
};
|
|
13505
13886
|
|
|
13506
13887
|
// src/features/rules/kilo-rule.ts
|
|
13507
|
-
var
|
|
13888
|
+
var import_node_path104 = require("path");
|
|
13508
13889
|
var KiloRule = class _KiloRule extends ToolRule {
|
|
13509
13890
|
static getSettablePaths(_options = {}) {
|
|
13510
13891
|
return {
|
|
@@ -13519,7 +13900,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
13519
13900
|
validate = true
|
|
13520
13901
|
}) {
|
|
13521
13902
|
const fileContent = await readFileContent(
|
|
13522
|
-
(0,
|
|
13903
|
+
(0, import_node_path104.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
13523
13904
|
);
|
|
13524
13905
|
return new _KiloRule({
|
|
13525
13906
|
baseDir,
|
|
@@ -13571,7 +13952,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
13571
13952
|
};
|
|
13572
13953
|
|
|
13573
13954
|
// src/features/rules/kiro-rule.ts
|
|
13574
|
-
var
|
|
13955
|
+
var import_node_path105 = require("path");
|
|
13575
13956
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
13576
13957
|
static getSettablePaths(_options = {}) {
|
|
13577
13958
|
return {
|
|
@@ -13586,7 +13967,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
13586
13967
|
validate = true
|
|
13587
13968
|
}) {
|
|
13588
13969
|
const fileContent = await readFileContent(
|
|
13589
|
-
(0,
|
|
13970
|
+
(0, import_node_path105.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
13590
13971
|
);
|
|
13591
13972
|
return new _KiroRule({
|
|
13592
13973
|
baseDir,
|
|
@@ -13640,7 +14021,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
13640
14021
|
};
|
|
13641
14022
|
|
|
13642
14023
|
// src/features/rules/opencode-rule.ts
|
|
13643
|
-
var
|
|
14024
|
+
var import_node_path106 = require("path");
|
|
13644
14025
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
13645
14026
|
static getSettablePaths({
|
|
13646
14027
|
global,
|
|
@@ -13675,7 +14056,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
13675
14056
|
if (isRoot) {
|
|
13676
14057
|
const relativePath2 = paths.root.relativeFilePath;
|
|
13677
14058
|
const fileContent2 = await readFileContent(
|
|
13678
|
-
(0,
|
|
14059
|
+
(0, import_node_path106.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
13679
14060
|
);
|
|
13680
14061
|
return new _OpenCodeRule({
|
|
13681
14062
|
baseDir,
|
|
@@ -13689,8 +14070,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
13689
14070
|
if (!paths.nonRoot) {
|
|
13690
14071
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13691
14072
|
}
|
|
13692
|
-
const relativePath = (0,
|
|
13693
|
-
const fileContent = await readFileContent((0,
|
|
14073
|
+
const relativePath = (0, import_node_path106.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14074
|
+
const fileContent = await readFileContent((0, import_node_path106.join)(baseDir, relativePath));
|
|
13694
14075
|
return new _OpenCodeRule({
|
|
13695
14076
|
baseDir,
|
|
13696
14077
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -13749,7 +14130,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
13749
14130
|
};
|
|
13750
14131
|
|
|
13751
14132
|
// src/features/rules/qwencode-rule.ts
|
|
13752
|
-
var
|
|
14133
|
+
var import_node_path107 = require("path");
|
|
13753
14134
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
13754
14135
|
static getSettablePaths(_options = {}) {
|
|
13755
14136
|
return {
|
|
@@ -13768,8 +14149,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
13768
14149
|
validate = true
|
|
13769
14150
|
}) {
|
|
13770
14151
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
13771
|
-
const relativePath = isRoot ? "QWEN.md" : (0,
|
|
13772
|
-
const fileContent = await readFileContent((0,
|
|
14152
|
+
const relativePath = isRoot ? "QWEN.md" : (0, import_node_path107.join)(".qwen", "memories", relativeFilePath);
|
|
14153
|
+
const fileContent = await readFileContent((0, import_node_path107.join)(baseDir, relativePath));
|
|
13773
14154
|
return new _QwencodeRule({
|
|
13774
14155
|
baseDir,
|
|
13775
14156
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -13821,7 +14202,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
13821
14202
|
};
|
|
13822
14203
|
|
|
13823
14204
|
// src/features/rules/replit-rule.ts
|
|
13824
|
-
var
|
|
14205
|
+
var import_node_path108 = require("path");
|
|
13825
14206
|
var ReplitRule = class _ReplitRule extends ToolRule {
|
|
13826
14207
|
static getSettablePaths(_options = {}) {
|
|
13827
14208
|
return {
|
|
@@ -13843,7 +14224,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
13843
14224
|
}
|
|
13844
14225
|
const relativePath = paths.root.relativeFilePath;
|
|
13845
14226
|
const fileContent = await readFileContent(
|
|
13846
|
-
(0,
|
|
14227
|
+
(0, import_node_path108.join)(baseDir, paths.root.relativeDirPath, relativePath)
|
|
13847
14228
|
);
|
|
13848
14229
|
return new _ReplitRule({
|
|
13849
14230
|
baseDir,
|
|
@@ -13909,7 +14290,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
13909
14290
|
};
|
|
13910
14291
|
|
|
13911
14292
|
// src/features/rules/roo-rule.ts
|
|
13912
|
-
var
|
|
14293
|
+
var import_node_path109 = require("path");
|
|
13913
14294
|
var RooRule = class _RooRule extends ToolRule {
|
|
13914
14295
|
static getSettablePaths(_options = {}) {
|
|
13915
14296
|
return {
|
|
@@ -13924,7 +14305,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
13924
14305
|
validate = true
|
|
13925
14306
|
}) {
|
|
13926
14307
|
const fileContent = await readFileContent(
|
|
13927
|
-
(0,
|
|
14308
|
+
(0, import_node_path109.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
13928
14309
|
);
|
|
13929
14310
|
return new _RooRule({
|
|
13930
14311
|
baseDir,
|
|
@@ -13993,7 +14374,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
13993
14374
|
};
|
|
13994
14375
|
|
|
13995
14376
|
// src/features/rules/warp-rule.ts
|
|
13996
|
-
var
|
|
14377
|
+
var import_node_path110 = require("path");
|
|
13997
14378
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
13998
14379
|
constructor({ fileContent, root, ...rest }) {
|
|
13999
14380
|
super({
|
|
@@ -14019,8 +14400,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
14019
14400
|
validate = true
|
|
14020
14401
|
}) {
|
|
14021
14402
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
14022
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0,
|
|
14023
|
-
const fileContent = await readFileContent((0,
|
|
14403
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path110.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
14404
|
+
const fileContent = await readFileContent((0, import_node_path110.join)(baseDir, relativePath));
|
|
14024
14405
|
return new _WarpRule({
|
|
14025
14406
|
baseDir,
|
|
14026
14407
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -14075,7 +14456,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
14075
14456
|
};
|
|
14076
14457
|
|
|
14077
14458
|
// src/features/rules/windsurf-rule.ts
|
|
14078
|
-
var
|
|
14459
|
+
var import_node_path111 = require("path");
|
|
14079
14460
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
14080
14461
|
static getSettablePaths(_options = {}) {
|
|
14081
14462
|
return {
|
|
@@ -14090,7 +14471,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
14090
14471
|
validate = true
|
|
14091
14472
|
}) {
|
|
14092
14473
|
const fileContent = await readFileContent(
|
|
14093
|
-
(0,
|
|
14474
|
+
(0, import_node_path111.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
14094
14475
|
);
|
|
14095
14476
|
return new _WindsurfRule({
|
|
14096
14477
|
baseDir,
|
|
@@ -14166,8 +14547,8 @@ var rulesProcessorToolTargets = [
|
|
|
14166
14547
|
"warp",
|
|
14167
14548
|
"windsurf"
|
|
14168
14549
|
];
|
|
14169
|
-
var RulesProcessorToolTargetSchema =
|
|
14170
|
-
var formatRulePaths = (rules) => rules.map((r) => (0,
|
|
14550
|
+
var RulesProcessorToolTargetSchema = import_mini52.z.enum(rulesProcessorToolTargets);
|
|
14551
|
+
var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path112.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
|
|
14171
14552
|
var toolRuleFactories = /* @__PURE__ */ new Map([
|
|
14172
14553
|
[
|
|
14173
14554
|
"agentsmd",
|
|
@@ -14542,7 +14923,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
14542
14923
|
}).relativeDirPath;
|
|
14543
14924
|
return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
|
|
14544
14925
|
const frontmatter = skill.getFrontmatter();
|
|
14545
|
-
const relativePath = (0,
|
|
14926
|
+
const relativePath = (0, import_node_path112.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
|
|
14546
14927
|
return {
|
|
14547
14928
|
name: frontmatter.name,
|
|
14548
14929
|
description: frontmatter.description,
|
|
@@ -14655,12 +15036,12 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
14655
15036
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
14656
15037
|
*/
|
|
14657
15038
|
async loadRulesyncFiles() {
|
|
14658
|
-
const rulesyncBaseDir = (0,
|
|
14659
|
-
const files = await findFilesByGlobs((0,
|
|
15039
|
+
const rulesyncBaseDir = (0, import_node_path112.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
15040
|
+
const files = await findFilesByGlobs((0, import_node_path112.join)(rulesyncBaseDir, "**", "*.md"));
|
|
14660
15041
|
logger.debug(`Found ${files.length} rulesync files`);
|
|
14661
15042
|
const rulesyncRules = await Promise.all(
|
|
14662
15043
|
files.map((file) => {
|
|
14663
|
-
const relativeFilePath = (0,
|
|
15044
|
+
const relativeFilePath = (0, import_node_path112.relative)(rulesyncBaseDir, file);
|
|
14664
15045
|
checkPathTraversal({
|
|
14665
15046
|
relativePath: relativeFilePath,
|
|
14666
15047
|
intendedRootDir: rulesyncBaseDir
|
|
@@ -14723,7 +15104,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
14723
15104
|
return [];
|
|
14724
15105
|
}
|
|
14725
15106
|
const rootFilePaths = await findFilesByGlobs(
|
|
14726
|
-
(0,
|
|
15107
|
+
(0, import_node_path112.join)(
|
|
14727
15108
|
this.baseDir,
|
|
14728
15109
|
settablePaths.root.relativeDirPath ?? ".",
|
|
14729
15110
|
settablePaths.root.relativeFilePath
|
|
@@ -14734,7 +15115,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
14734
15115
|
(filePath) => factory.class.forDeletion({
|
|
14735
15116
|
baseDir: this.baseDir,
|
|
14736
15117
|
relativeDirPath: settablePaths.root?.relativeDirPath ?? ".",
|
|
14737
|
-
relativeFilePath: (0,
|
|
15118
|
+
relativeFilePath: (0, import_node_path112.basename)(filePath),
|
|
14738
15119
|
global: this.global
|
|
14739
15120
|
})
|
|
14740
15121
|
).filter((rule) => rule.isDeletable());
|
|
@@ -14743,7 +15124,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
14743
15124
|
rootFilePaths.map(
|
|
14744
15125
|
(filePath) => factory.class.fromFile({
|
|
14745
15126
|
baseDir: this.baseDir,
|
|
14746
|
-
relativeFilePath: (0,
|
|
15127
|
+
relativeFilePath: (0, import_node_path112.basename)(filePath),
|
|
14747
15128
|
global: this.global
|
|
14748
15129
|
})
|
|
14749
15130
|
)
|
|
@@ -14761,13 +15142,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
14761
15142
|
return [];
|
|
14762
15143
|
}
|
|
14763
15144
|
const localRootFilePaths = await findFilesByGlobs(
|
|
14764
|
-
(0,
|
|
15145
|
+
(0, import_node_path112.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md")
|
|
14765
15146
|
);
|
|
14766
15147
|
return localRootFilePaths.map(
|
|
14767
15148
|
(filePath) => factory.class.forDeletion({
|
|
14768
15149
|
baseDir: this.baseDir,
|
|
14769
15150
|
relativeDirPath: settablePaths.root?.relativeDirPath ?? ".",
|
|
14770
|
-
relativeFilePath: (0,
|
|
15151
|
+
relativeFilePath: (0, import_node_path112.basename)(filePath),
|
|
14771
15152
|
global: this.global
|
|
14772
15153
|
})
|
|
14773
15154
|
).filter((rule) => rule.isDeletable());
|
|
@@ -14777,13 +15158,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
14777
15158
|
if (!settablePaths.nonRoot) {
|
|
14778
15159
|
return [];
|
|
14779
15160
|
}
|
|
14780
|
-
const nonRootBaseDir = (0,
|
|
15161
|
+
const nonRootBaseDir = (0, import_node_path112.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
|
|
14781
15162
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
14782
|
-
(0,
|
|
15163
|
+
(0, import_node_path112.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
|
|
14783
15164
|
);
|
|
14784
15165
|
if (forDeletion) {
|
|
14785
15166
|
return nonRootFilePaths.map((filePath) => {
|
|
14786
|
-
const relativeFilePath = (0,
|
|
15167
|
+
const relativeFilePath = (0, import_node_path112.relative)(nonRootBaseDir, filePath);
|
|
14787
15168
|
checkPathTraversal({
|
|
14788
15169
|
relativePath: relativeFilePath,
|
|
14789
15170
|
intendedRootDir: nonRootBaseDir
|
|
@@ -14798,7 +15179,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
14798
15179
|
}
|
|
14799
15180
|
return await Promise.all(
|
|
14800
15181
|
nonRootFilePaths.map((filePath) => {
|
|
14801
|
-
const relativeFilePath = (0,
|
|
15182
|
+
const relativeFilePath = (0, import_node_path112.relative)(nonRootBaseDir, filePath);
|
|
14802
15183
|
checkPathTraversal({
|
|
14803
15184
|
relativePath: relativeFilePath,
|
|
14804
15185
|
intendedRootDir: nonRootBaseDir
|
|
@@ -14911,14 +15292,14 @@ s/<command> [arguments]
|
|
|
14911
15292
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
14912
15293
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
14913
15294
|
|
|
14914
|
-
When users call a custom slash command, you have to look for the markdown file, \`${(0,
|
|
15295
|
+
When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path112.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
14915
15296
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
14916
15297
|
|
|
14917
15298
|
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.
|
|
14918
15299
|
|
|
14919
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0,
|
|
15300
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path112.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
14920
15301
|
|
|
14921
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0,
|
|
15302
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path112.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
14922
15303
|
const skillsSection = skills ? this.generateSkillsSection(skills) : "";
|
|
14923
15304
|
const result = [
|
|
14924
15305
|
overview,
|
|
@@ -14990,7 +15371,7 @@ async function processEmptyFeatureGeneration(params) {
|
|
|
14990
15371
|
return { count: totalCount, paths: [], hasDiff };
|
|
14991
15372
|
}
|
|
14992
15373
|
async function checkRulesyncDirExists(params) {
|
|
14993
|
-
return fileExists((0,
|
|
15374
|
+
return fileExists((0, import_node_path113.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
|
|
14994
15375
|
}
|
|
14995
15376
|
async function generate(params) {
|
|
14996
15377
|
const { config } = params;
|