rulesync 8.2.0 → 8.3.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 +2 -2
- package/dist/{chunk-K4IN6URH.js → chunk-RVBJT5ST.js} +832 -572
- package/dist/cli/index.cjs +474 -214
- package/dist/cli/index.js +2 -2
- package/dist/index.cjs +857 -597
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -825,7 +825,7 @@ function getBaseDirsInLightOfGlobal({
|
|
|
825
825
|
}
|
|
826
826
|
|
|
827
827
|
// src/lib/generate.ts
|
|
828
|
-
var
|
|
828
|
+
var import_node_path140 = require("path");
|
|
829
829
|
var import_es_toolkit5 = require("es-toolkit");
|
|
830
830
|
|
|
831
831
|
// src/features/commands/commands-processor.ts
|
|
@@ -9141,7 +9141,7 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
9141
9141
|
};
|
|
9142
9142
|
|
|
9143
9143
|
// src/features/permissions/permissions-processor.ts
|
|
9144
|
-
var
|
|
9144
|
+
var import_mini32 = require("zod/mini");
|
|
9145
9145
|
|
|
9146
9146
|
// src/features/permissions/claudecode-permissions.ts
|
|
9147
9147
|
var import_node_path65 = require("path");
|
|
@@ -9470,6 +9470,7 @@ function convertClaudeToRulesyncPermissions(params) {
|
|
|
9470
9470
|
var import_node_path66 = require("path");
|
|
9471
9471
|
var smolToml4 = __toESM(require("smol-toml"), 1);
|
|
9472
9472
|
var RULESYNC_PROFILE_NAME = "rulesync";
|
|
9473
|
+
var RULESYNC_BASH_RULES_FILE_NAME = "rulesync.rules";
|
|
9473
9474
|
var CodexcliPermissions = class _CodexcliPermissions extends ToolPermissions {
|
|
9474
9475
|
static getSettablePaths(_options = {}) {
|
|
9475
9476
|
return {
|
|
@@ -9559,6 +9560,22 @@ var CodexcliPermissions = class _CodexcliPermissions extends ToolPermissions {
|
|
|
9559
9560
|
});
|
|
9560
9561
|
}
|
|
9561
9562
|
};
|
|
9563
|
+
var CodexcliRulesFile = class extends ToolFile {
|
|
9564
|
+
validate() {
|
|
9565
|
+
return { success: true, error: null };
|
|
9566
|
+
}
|
|
9567
|
+
};
|
|
9568
|
+
function createCodexcliBashRulesFile({
|
|
9569
|
+
baseDir = process.cwd(),
|
|
9570
|
+
config
|
|
9571
|
+
}) {
|
|
9572
|
+
return new CodexcliRulesFile({
|
|
9573
|
+
baseDir,
|
|
9574
|
+
relativeDirPath: (0, import_node_path66.join)(".codex", "rules"),
|
|
9575
|
+
relativeFilePath: RULESYNC_BASH_RULES_FILE_NAME,
|
|
9576
|
+
fileContent: buildCodexBashRulesContent(config)
|
|
9577
|
+
});
|
|
9578
|
+
}
|
|
9562
9579
|
function convertRulesyncToCodexProfile({
|
|
9563
9580
|
config,
|
|
9564
9581
|
logger
|
|
@@ -9667,6 +9684,46 @@ function mapReadAction(action) {
|
|
|
9667
9684
|
function mapWriteAction(action) {
|
|
9668
9685
|
return action === "allow" ? "write" : "none";
|
|
9669
9686
|
}
|
|
9687
|
+
function buildCodexBashRulesContent(config) {
|
|
9688
|
+
const bashRules = config.permission.bash ?? {};
|
|
9689
|
+
const entries = Object.entries(bashRules);
|
|
9690
|
+
const header = [
|
|
9691
|
+
"# Generated by Rulesync from .rulesync/permissions.json (permission.bash)",
|
|
9692
|
+
"# https://developers.openai.com/codex/rules"
|
|
9693
|
+
];
|
|
9694
|
+
if (entries.length === 0) {
|
|
9695
|
+
return [...header, "# No bash permission rules were configured."].join("\n");
|
|
9696
|
+
}
|
|
9697
|
+
const ruleBlocks = entries.map(([pattern, action]) => {
|
|
9698
|
+
const tokens = toCommandPatternTokens(pattern);
|
|
9699
|
+
if (tokens.length === 0) {
|
|
9700
|
+
return null;
|
|
9701
|
+
}
|
|
9702
|
+
const serializedTokens = tokens.map((token) => JSON.stringify(token)).join(", ");
|
|
9703
|
+
const decision = mapBashActionToDecision(action);
|
|
9704
|
+
return [
|
|
9705
|
+
"",
|
|
9706
|
+
`# ${pattern}`,
|
|
9707
|
+
"prefix_rule(",
|
|
9708
|
+
` pattern = [${serializedTokens}],`,
|
|
9709
|
+
` decision = ${JSON.stringify(decision)},`,
|
|
9710
|
+
` justification = ${JSON.stringify(`Generated from Rulesync permission.bash: ${pattern}`)},`,
|
|
9711
|
+
")"
|
|
9712
|
+
].join("\n");
|
|
9713
|
+
}).filter((block) => block !== null);
|
|
9714
|
+
if (ruleBlocks.length === 0) {
|
|
9715
|
+
return [...header, "# No valid bash patterns were found."].join("\n");
|
|
9716
|
+
}
|
|
9717
|
+
return [...header, ...ruleBlocks].join("\n");
|
|
9718
|
+
}
|
|
9719
|
+
function toCommandPatternTokens(commandPattern) {
|
|
9720
|
+
return commandPattern.trim().split(/\s+/).map((token) => token.trim()).filter((token) => token.length > 0);
|
|
9721
|
+
}
|
|
9722
|
+
function mapBashActionToDecision(action) {
|
|
9723
|
+
if (action === "allow") return "allow";
|
|
9724
|
+
if (action === "ask") return "prompt";
|
|
9725
|
+
return "forbidden";
|
|
9726
|
+
}
|
|
9670
9727
|
|
|
9671
9728
|
// src/features/permissions/geminicli-permissions.ts
|
|
9672
9729
|
var import_node_path67 = require("path");
|
|
@@ -9832,16 +9889,200 @@ function parseGeminicliToolEntry({ entry }) {
|
|
|
9832
9889
|
};
|
|
9833
9890
|
}
|
|
9834
9891
|
|
|
9835
|
-
// src/features/permissions/
|
|
9892
|
+
// src/features/permissions/kiro-permissions.ts
|
|
9836
9893
|
var import_node_path68 = require("path");
|
|
9837
|
-
var import_jsonc_parser5 = require("jsonc-parser");
|
|
9838
9894
|
var import_mini30 = require("zod/mini");
|
|
9839
|
-
var
|
|
9840
|
-
import_mini30.z.
|
|
9841
|
-
import_mini30.z.record(import_mini30.z.string(), import_mini30.z.
|
|
9895
|
+
var KiroAgentSchema = import_mini30.z.looseObject({
|
|
9896
|
+
allowedTools: import_mini30.z.optional(import_mini30.z.array(import_mini30.z.string())),
|
|
9897
|
+
toolsSettings: import_mini30.z.optional(import_mini30.z.record(import_mini30.z.string(), import_mini30.z.unknown()))
|
|
9898
|
+
});
|
|
9899
|
+
var UnknownRecordSchema = import_mini30.z.record(import_mini30.z.string(), import_mini30.z.unknown());
|
|
9900
|
+
var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
9901
|
+
static getSettablePaths(_options = {}) {
|
|
9902
|
+
return {
|
|
9903
|
+
relativeDirPath: (0, import_node_path68.join)(".kiro", "agents"),
|
|
9904
|
+
relativeFilePath: "default.json"
|
|
9905
|
+
};
|
|
9906
|
+
}
|
|
9907
|
+
isDeletable() {
|
|
9908
|
+
return false;
|
|
9909
|
+
}
|
|
9910
|
+
static async fromFile({
|
|
9911
|
+
baseDir = process.cwd(),
|
|
9912
|
+
validate = true
|
|
9913
|
+
}) {
|
|
9914
|
+
const paths = this.getSettablePaths();
|
|
9915
|
+
const filePath = (0, import_node_path68.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
9916
|
+
const fileContent = await readFileContentOrNull(filePath) ?? JSON.stringify({}, null, 2);
|
|
9917
|
+
return new _KiroPermissions({
|
|
9918
|
+
baseDir,
|
|
9919
|
+
relativeDirPath: paths.relativeDirPath,
|
|
9920
|
+
relativeFilePath: paths.relativeFilePath,
|
|
9921
|
+
fileContent,
|
|
9922
|
+
validate
|
|
9923
|
+
});
|
|
9924
|
+
}
|
|
9925
|
+
static async fromRulesyncPermissions({
|
|
9926
|
+
baseDir = process.cwd(),
|
|
9927
|
+
rulesyncPermissions,
|
|
9928
|
+
validate = true,
|
|
9929
|
+
logger
|
|
9930
|
+
}) {
|
|
9931
|
+
const paths = this.getSettablePaths();
|
|
9932
|
+
const filePath = (0, import_node_path68.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
9933
|
+
const existingContent = await readFileContentOrNull(filePath) ?? JSON.stringify({}, null, 2);
|
|
9934
|
+
const parsedResult = KiroAgentSchema.safeParse(JSON.parse(existingContent));
|
|
9935
|
+
if (!parsedResult.success) {
|
|
9936
|
+
throw new Error(
|
|
9937
|
+
`Failed to parse existing Kiro agent config at ${filePath}: ${formatError(parsedResult.error)}`
|
|
9938
|
+
);
|
|
9939
|
+
}
|
|
9940
|
+
const config = rulesyncPermissions.getJson();
|
|
9941
|
+
const next = buildKiroPermissionsFromRulesync({ config, logger, existing: parsedResult.data });
|
|
9942
|
+
return new _KiroPermissions({
|
|
9943
|
+
baseDir,
|
|
9944
|
+
relativeDirPath: paths.relativeDirPath,
|
|
9945
|
+
relativeFilePath: paths.relativeFilePath,
|
|
9946
|
+
fileContent: JSON.stringify(next, null, 2),
|
|
9947
|
+
validate
|
|
9948
|
+
});
|
|
9949
|
+
}
|
|
9950
|
+
toRulesyncPermissions() {
|
|
9951
|
+
let parsed;
|
|
9952
|
+
try {
|
|
9953
|
+
parsed = KiroAgentSchema.parse(JSON.parse(this.getFileContent()));
|
|
9954
|
+
} catch (error) {
|
|
9955
|
+
throw new Error(
|
|
9956
|
+
`Failed to parse Kiro permissions content in ${(0, import_node_path68.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
9957
|
+
{ cause: error }
|
|
9958
|
+
);
|
|
9959
|
+
}
|
|
9960
|
+
const permission = {};
|
|
9961
|
+
const toolsSettings = parsed.toolsSettings ?? {};
|
|
9962
|
+
const shellSettings = asRecord(toolsSettings.shell);
|
|
9963
|
+
const shellAllow = asStringArray(shellSettings.allowedCommands);
|
|
9964
|
+
const shellDeny = asStringArray(shellSettings.deniedCommands);
|
|
9965
|
+
if (shellAllow.length > 0 || shellDeny.length > 0) {
|
|
9966
|
+
permission.bash = {};
|
|
9967
|
+
for (const pattern of shellAllow) permission.bash[pattern] = "allow";
|
|
9968
|
+
for (const pattern of shellDeny) permission.bash[pattern] = "deny";
|
|
9969
|
+
}
|
|
9970
|
+
const readSettings = asRecord(toolsSettings.read);
|
|
9971
|
+
const readAllow = asStringArray(readSettings.allowedPaths);
|
|
9972
|
+
const readDeny = asStringArray(readSettings.deniedPaths);
|
|
9973
|
+
if (readAllow.length > 0 || readDeny.length > 0) {
|
|
9974
|
+
permission.read = {};
|
|
9975
|
+
for (const pattern of readAllow) permission.read[pattern] = "allow";
|
|
9976
|
+
for (const pattern of readDeny) permission.read[pattern] = "deny";
|
|
9977
|
+
}
|
|
9978
|
+
const writeSettings = asRecord(toolsSettings.write);
|
|
9979
|
+
const writeAllow = asStringArray(writeSettings.allowedPaths);
|
|
9980
|
+
const writeDeny = asStringArray(writeSettings.deniedPaths);
|
|
9981
|
+
if (writeAllow.length > 0 || writeDeny.length > 0) {
|
|
9982
|
+
permission.write = {};
|
|
9983
|
+
for (const pattern of writeAllow) permission.write[pattern] = "allow";
|
|
9984
|
+
for (const pattern of writeDeny) permission.write[pattern] = "deny";
|
|
9985
|
+
}
|
|
9986
|
+
const allowedTools = new Set(parsed.allowedTools ?? []);
|
|
9987
|
+
if (allowedTools.has("web_fetch")) {
|
|
9988
|
+
permission.webfetch = { "*": "allow" };
|
|
9989
|
+
}
|
|
9990
|
+
if (allowedTools.has("web_search")) {
|
|
9991
|
+
permission.websearch = { "*": "allow" };
|
|
9992
|
+
}
|
|
9993
|
+
return this.toRulesyncPermissionsDefault({
|
|
9994
|
+
fileContent: JSON.stringify({ permission }, null, 2)
|
|
9995
|
+
});
|
|
9996
|
+
}
|
|
9997
|
+
validate() {
|
|
9998
|
+
return { success: true, error: null };
|
|
9999
|
+
}
|
|
10000
|
+
static forDeletion({
|
|
10001
|
+
baseDir = process.cwd(),
|
|
10002
|
+
relativeDirPath,
|
|
10003
|
+
relativeFilePath
|
|
10004
|
+
}) {
|
|
10005
|
+
return new _KiroPermissions({
|
|
10006
|
+
baseDir,
|
|
10007
|
+
relativeDirPath,
|
|
10008
|
+
relativeFilePath,
|
|
10009
|
+
fileContent: JSON.stringify({}, null, 2),
|
|
10010
|
+
validate: false
|
|
10011
|
+
});
|
|
10012
|
+
}
|
|
10013
|
+
};
|
|
10014
|
+
function buildKiroPermissionsFromRulesync({
|
|
10015
|
+
config,
|
|
10016
|
+
logger,
|
|
10017
|
+
existing
|
|
10018
|
+
}) {
|
|
10019
|
+
const nextAllowedTools = new Set(existing.allowedTools ?? []);
|
|
10020
|
+
const nextToolsSettings = { ...asRecord(existing.toolsSettings) };
|
|
10021
|
+
const shell = {
|
|
10022
|
+
allowedCommands: [],
|
|
10023
|
+
deniedCommands: []
|
|
10024
|
+
};
|
|
10025
|
+
const read = {
|
|
10026
|
+
allowedPaths: [],
|
|
10027
|
+
deniedPaths: []
|
|
10028
|
+
};
|
|
10029
|
+
const write = {
|
|
10030
|
+
allowedPaths: [],
|
|
10031
|
+
deniedPaths: []
|
|
10032
|
+
};
|
|
10033
|
+
for (const [category, rules] of Object.entries(config.permission)) {
|
|
10034
|
+
for (const [pattern, action] of Object.entries(rules)) {
|
|
10035
|
+
if (action === "ask") {
|
|
10036
|
+
logger?.warn(`Kiro permissions do not support "ask". Skipping ${category}:${pattern}`);
|
|
10037
|
+
continue;
|
|
10038
|
+
}
|
|
10039
|
+
if (category === "bash") {
|
|
10040
|
+
(action === "allow" ? shell.allowedCommands : shell.deniedCommands).push(pattern);
|
|
10041
|
+
} else if (category === "read") {
|
|
10042
|
+
(action === "allow" ? read.allowedPaths : read.deniedPaths).push(pattern);
|
|
10043
|
+
} else if (category === "edit" || category === "write") {
|
|
10044
|
+
(action === "allow" ? write.allowedPaths : write.deniedPaths).push(pattern);
|
|
10045
|
+
} else if (category === "webfetch" || category === "websearch") {
|
|
10046
|
+
if (pattern !== "*") {
|
|
10047
|
+
logger?.warn(
|
|
10048
|
+
`Kiro ${category} supports only wildcard (*) via allowedTools. Skipping rule: ${pattern}`
|
|
10049
|
+
);
|
|
10050
|
+
continue;
|
|
10051
|
+
}
|
|
10052
|
+
if (action === "allow")
|
|
10053
|
+
nextAllowedTools.add(category === "webfetch" ? "web_fetch" : "web_search");
|
|
10054
|
+
} else {
|
|
10055
|
+
logger?.warn(`Kiro permissions do not support category: ${category}. Skipping.`);
|
|
10056
|
+
}
|
|
10057
|
+
}
|
|
10058
|
+
}
|
|
10059
|
+
nextToolsSettings.shell = shell;
|
|
10060
|
+
nextToolsSettings.read = read;
|
|
10061
|
+
nextToolsSettings.write = write;
|
|
10062
|
+
return {
|
|
10063
|
+
...existing,
|
|
10064
|
+
allowedTools: [...nextAllowedTools].toSorted(),
|
|
10065
|
+
toolsSettings: nextToolsSettings
|
|
10066
|
+
};
|
|
10067
|
+
}
|
|
10068
|
+
function asRecord(value) {
|
|
10069
|
+
const result = UnknownRecordSchema.safeParse(value);
|
|
10070
|
+
return result.success ? result.data : {};
|
|
10071
|
+
}
|
|
10072
|
+
function asStringArray(value) {
|
|
10073
|
+
return Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
|
|
10074
|
+
}
|
|
10075
|
+
|
|
10076
|
+
// src/features/permissions/opencode-permissions.ts
|
|
10077
|
+
var import_node_path69 = require("path");
|
|
10078
|
+
var import_jsonc_parser5 = require("jsonc-parser");
|
|
10079
|
+
var import_mini31 = require("zod/mini");
|
|
10080
|
+
var OpencodePermissionSchema = import_mini31.z.union([
|
|
10081
|
+
import_mini31.z.enum(["allow", "ask", "deny"]),
|
|
10082
|
+
import_mini31.z.record(import_mini31.z.string(), import_mini31.z.enum(["allow", "ask", "deny"]))
|
|
9842
10083
|
]);
|
|
9843
|
-
var OpencodePermissionsConfigSchema =
|
|
9844
|
-
permission:
|
|
10084
|
+
var OpencodePermissionsConfigSchema = import_mini31.z.looseObject({
|
|
10085
|
+
permission: import_mini31.z.optional(import_mini31.z.record(import_mini31.z.string(), OpencodePermissionSchema))
|
|
9845
10086
|
});
|
|
9846
10087
|
var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
9847
10088
|
json;
|
|
@@ -9858,7 +10099,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
9858
10099
|
static getSettablePaths({
|
|
9859
10100
|
global = false
|
|
9860
10101
|
} = {}) {
|
|
9861
|
-
return global ? { relativeDirPath: (0,
|
|
10102
|
+
return global ? { relativeDirPath: (0, import_node_path69.join)(".config", "opencode"), relativeFilePath: "opencode.json" } : { relativeDirPath: ".", relativeFilePath: "opencode.json" };
|
|
9862
10103
|
}
|
|
9863
10104
|
static async fromFile({
|
|
9864
10105
|
baseDir = process.cwd(),
|
|
@@ -9866,9 +10107,9 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
9866
10107
|
global = false
|
|
9867
10108
|
}) {
|
|
9868
10109
|
const basePaths = _OpencodePermissions.getSettablePaths({ global });
|
|
9869
|
-
const jsonDir = (0,
|
|
9870
|
-
const jsoncPath = (0,
|
|
9871
|
-
const jsonPath = (0,
|
|
10110
|
+
const jsonDir = (0, import_node_path69.join)(baseDir, basePaths.relativeDirPath);
|
|
10111
|
+
const jsoncPath = (0, import_node_path69.join)(jsonDir, "opencode.jsonc");
|
|
10112
|
+
const jsonPath = (0, import_node_path69.join)(jsonDir, "opencode.json");
|
|
9872
10113
|
let fileContent = await readFileContentOrNull(jsoncPath);
|
|
9873
10114
|
let relativeFilePath = "opencode.jsonc";
|
|
9874
10115
|
if (!fileContent) {
|
|
@@ -9893,9 +10134,9 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
9893
10134
|
global = false
|
|
9894
10135
|
}) {
|
|
9895
10136
|
const basePaths = _OpencodePermissions.getSettablePaths({ global });
|
|
9896
|
-
const jsonDir = (0,
|
|
9897
|
-
const jsoncPath = (0,
|
|
9898
|
-
const jsonPath = (0,
|
|
10137
|
+
const jsonDir = (0, import_node_path69.join)(baseDir, basePaths.relativeDirPath);
|
|
10138
|
+
const jsoncPath = (0, import_node_path69.join)(jsonDir, "opencode.jsonc");
|
|
10139
|
+
const jsonPath = (0, import_node_path69.join)(jsonDir, "opencode.json");
|
|
9899
10140
|
let fileContent = await readFileContentOrNull(jsoncPath);
|
|
9900
10141
|
let relativeFilePath = "opencode.jsonc";
|
|
9901
10142
|
if (!fileContent) {
|
|
@@ -9969,9 +10210,10 @@ var permissionsProcessorToolTargetTuple = [
|
|
|
9969
10210
|
"claudecode",
|
|
9970
10211
|
"codexcli",
|
|
9971
10212
|
"geminicli",
|
|
10213
|
+
"kiro",
|
|
9972
10214
|
"opencode"
|
|
9973
10215
|
];
|
|
9974
|
-
var PermissionsProcessorToolTargetSchema =
|
|
10216
|
+
var PermissionsProcessorToolTargetSchema = import_mini32.z.enum(permissionsProcessorToolTargetTuple);
|
|
9975
10217
|
var toolPermissionsFactories = /* @__PURE__ */ new Map([
|
|
9976
10218
|
[
|
|
9977
10219
|
"claudecode",
|
|
@@ -9979,7 +10221,7 @@ var toolPermissionsFactories = /* @__PURE__ */ new Map([
|
|
|
9979
10221
|
class: ClaudecodePermissions,
|
|
9980
10222
|
meta: {
|
|
9981
10223
|
supportsProject: true,
|
|
9982
|
-
supportsGlobal:
|
|
10224
|
+
supportsGlobal: true,
|
|
9983
10225
|
supportsImport: true
|
|
9984
10226
|
}
|
|
9985
10227
|
}
|
|
@@ -10006,6 +10248,17 @@ var toolPermissionsFactories = /* @__PURE__ */ new Map([
|
|
|
10006
10248
|
}
|
|
10007
10249
|
}
|
|
10008
10250
|
],
|
|
10251
|
+
[
|
|
10252
|
+
"kiro",
|
|
10253
|
+
{
|
|
10254
|
+
class: KiroPermissions,
|
|
10255
|
+
meta: {
|
|
10256
|
+
supportsProject: true,
|
|
10257
|
+
supportsGlobal: false,
|
|
10258
|
+
supportsImport: true
|
|
10259
|
+
}
|
|
10260
|
+
}
|
|
10261
|
+
],
|
|
10009
10262
|
[
|
|
10010
10263
|
"opencode",
|
|
10011
10264
|
{
|
|
@@ -10101,7 +10354,14 @@ var PermissionsProcessor = class extends FeatureProcessor {
|
|
|
10101
10354
|
logger: this.logger,
|
|
10102
10355
|
global: this.global
|
|
10103
10356
|
});
|
|
10104
|
-
|
|
10357
|
+
if (this.toolTarget !== "codexcli") {
|
|
10358
|
+
return [toolPermissions];
|
|
10359
|
+
}
|
|
10360
|
+
const bashRulesFile = createCodexcliBashRulesFile({
|
|
10361
|
+
baseDir: this.baseDir,
|
|
10362
|
+
config: rulesyncPermissions.getJson()
|
|
10363
|
+
});
|
|
10364
|
+
return [toolPermissions, bashRulesFile];
|
|
10105
10365
|
}
|
|
10106
10366
|
async convertToolFilesToRulesyncFiles(toolFiles) {
|
|
10107
10367
|
const permissions = toolFiles.filter((f) => f instanceof ToolPermissions);
|
|
@@ -10116,25 +10376,25 @@ var PermissionsProcessor = class extends FeatureProcessor {
|
|
|
10116
10376
|
};
|
|
10117
10377
|
|
|
10118
10378
|
// src/features/rules/rules-processor.ts
|
|
10119
|
-
var
|
|
10379
|
+
var import_node_path139 = require("path");
|
|
10120
10380
|
var import_toon = require("@toon-format/toon");
|
|
10121
|
-
var
|
|
10381
|
+
var import_mini71 = require("zod/mini");
|
|
10122
10382
|
|
|
10123
10383
|
// src/constants/general.ts
|
|
10124
10384
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
10125
10385
|
|
|
10126
10386
|
// src/features/skills/agentsmd-skill.ts
|
|
10127
|
-
var
|
|
10387
|
+
var import_node_path73 = require("path");
|
|
10128
10388
|
|
|
10129
10389
|
// src/features/skills/simulated-skill.ts
|
|
10130
|
-
var
|
|
10131
|
-
var
|
|
10390
|
+
var import_node_path72 = require("path");
|
|
10391
|
+
var import_mini33 = require("zod/mini");
|
|
10132
10392
|
|
|
10133
10393
|
// src/features/skills/tool-skill.ts
|
|
10134
|
-
var
|
|
10394
|
+
var import_node_path71 = require("path");
|
|
10135
10395
|
|
|
10136
10396
|
// src/types/ai-dir.ts
|
|
10137
|
-
var
|
|
10397
|
+
var import_node_path70 = __toESM(require("path"), 1);
|
|
10138
10398
|
var AiDir = class {
|
|
10139
10399
|
/**
|
|
10140
10400
|
* @example "."
|
|
@@ -10168,7 +10428,7 @@ var AiDir = class {
|
|
|
10168
10428
|
otherFiles = [],
|
|
10169
10429
|
global = false
|
|
10170
10430
|
}) {
|
|
10171
|
-
if (dirName.includes(
|
|
10431
|
+
if (dirName.includes(import_node_path70.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
|
|
10172
10432
|
throw new Error(`Directory name cannot contain path separators: dirName="${dirName}"`);
|
|
10173
10433
|
}
|
|
10174
10434
|
this.baseDir = baseDir;
|
|
@@ -10191,11 +10451,11 @@ var AiDir = class {
|
|
|
10191
10451
|
return this.dirName;
|
|
10192
10452
|
}
|
|
10193
10453
|
getDirPath() {
|
|
10194
|
-
const fullPath =
|
|
10195
|
-
const resolvedFull = (0,
|
|
10196
|
-
const resolvedBase = (0,
|
|
10197
|
-
const rel = (0,
|
|
10198
|
-
if (rel.startsWith("..") ||
|
|
10454
|
+
const fullPath = import_node_path70.default.join(this.baseDir, this.relativeDirPath, this.dirName);
|
|
10455
|
+
const resolvedFull = (0, import_node_path70.resolve)(fullPath);
|
|
10456
|
+
const resolvedBase = (0, import_node_path70.resolve)(this.baseDir);
|
|
10457
|
+
const rel = (0, import_node_path70.relative)(resolvedBase, resolvedFull);
|
|
10458
|
+
if (rel.startsWith("..") || import_node_path70.default.isAbsolute(rel)) {
|
|
10199
10459
|
throw new Error(
|
|
10200
10460
|
`Path traversal detected: Final path escapes baseDir. baseDir="${this.baseDir}", relativeDirPath="${this.relativeDirPath}", dirName="${this.dirName}"`
|
|
10201
10461
|
);
|
|
@@ -10212,7 +10472,7 @@ var AiDir = class {
|
|
|
10212
10472
|
* Returns the relative path from CWD with POSIX separators for consistent cross-platform output.
|
|
10213
10473
|
*/
|
|
10214
10474
|
getRelativePathFromCwd() {
|
|
10215
|
-
return toPosixPath(
|
|
10475
|
+
return toPosixPath(import_node_path70.default.join(this.relativeDirPath, this.dirName));
|
|
10216
10476
|
}
|
|
10217
10477
|
getGlobal() {
|
|
10218
10478
|
return this.global;
|
|
@@ -10231,15 +10491,15 @@ var AiDir = class {
|
|
|
10231
10491
|
* @returns Array of files with their relative paths and buffers
|
|
10232
10492
|
*/
|
|
10233
10493
|
static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
|
|
10234
|
-
const dirPath = (0,
|
|
10235
|
-
const glob = (0,
|
|
10494
|
+
const dirPath = (0, import_node_path70.join)(baseDir, relativeDirPath, dirName);
|
|
10495
|
+
const glob = (0, import_node_path70.join)(dirPath, "**", "*");
|
|
10236
10496
|
const filePaths = await findFilesByGlobs(glob, { type: "file" });
|
|
10237
|
-
const filteredPaths = filePaths.filter((filePath) => (0,
|
|
10497
|
+
const filteredPaths = filePaths.filter((filePath) => (0, import_node_path70.basename)(filePath) !== excludeFileName);
|
|
10238
10498
|
const files = await Promise.all(
|
|
10239
10499
|
filteredPaths.map(async (filePath) => {
|
|
10240
10500
|
const fileBuffer = await readFileBuffer(filePath);
|
|
10241
10501
|
return {
|
|
10242
|
-
relativeFilePathToDirPath: (0,
|
|
10502
|
+
relativeFilePathToDirPath: (0, import_node_path70.relative)(dirPath, filePath),
|
|
10243
10503
|
fileBuffer
|
|
10244
10504
|
};
|
|
10245
10505
|
})
|
|
@@ -10333,8 +10593,8 @@ var ToolSkill = class extends AiDir {
|
|
|
10333
10593
|
}) {
|
|
10334
10594
|
const settablePaths = getSettablePaths({ global });
|
|
10335
10595
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
10336
|
-
const skillDirPath = (0,
|
|
10337
|
-
const skillFilePath = (0,
|
|
10596
|
+
const skillDirPath = (0, import_node_path71.join)(baseDir, actualRelativeDirPath, dirName);
|
|
10597
|
+
const skillFilePath = (0, import_node_path71.join)(skillDirPath, SKILL_FILE_NAME);
|
|
10338
10598
|
if (!await fileExists(skillFilePath)) {
|
|
10339
10599
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
10340
10600
|
}
|
|
@@ -10358,16 +10618,16 @@ var ToolSkill = class extends AiDir {
|
|
|
10358
10618
|
}
|
|
10359
10619
|
requireMainFileFrontmatter() {
|
|
10360
10620
|
if (!this.mainFile?.frontmatter) {
|
|
10361
|
-
throw new Error(`Frontmatter is not defined in ${(0,
|
|
10621
|
+
throw new Error(`Frontmatter is not defined in ${(0, import_node_path71.join)(this.relativeDirPath, this.dirName)}`);
|
|
10362
10622
|
}
|
|
10363
10623
|
return this.mainFile.frontmatter;
|
|
10364
10624
|
}
|
|
10365
10625
|
};
|
|
10366
10626
|
|
|
10367
10627
|
// src/features/skills/simulated-skill.ts
|
|
10368
|
-
var SimulatedSkillFrontmatterSchema =
|
|
10369
|
-
name:
|
|
10370
|
-
description:
|
|
10628
|
+
var SimulatedSkillFrontmatterSchema = import_mini33.z.looseObject({
|
|
10629
|
+
name: import_mini33.z.string(),
|
|
10630
|
+
description: import_mini33.z.string()
|
|
10371
10631
|
});
|
|
10372
10632
|
var SimulatedSkill = class extends ToolSkill {
|
|
10373
10633
|
frontmatter;
|
|
@@ -10398,7 +10658,7 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
10398
10658
|
const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
|
|
10399
10659
|
if (!result.success) {
|
|
10400
10660
|
throw new Error(
|
|
10401
|
-
`Invalid frontmatter in ${(0,
|
|
10661
|
+
`Invalid frontmatter in ${(0, import_node_path72.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
|
|
10402
10662
|
);
|
|
10403
10663
|
}
|
|
10404
10664
|
}
|
|
@@ -10457,8 +10717,8 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
10457
10717
|
}) {
|
|
10458
10718
|
const settablePaths = this.getSettablePaths();
|
|
10459
10719
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
10460
|
-
const skillDirPath = (0,
|
|
10461
|
-
const skillFilePath = (0,
|
|
10720
|
+
const skillDirPath = (0, import_node_path72.join)(baseDir, actualRelativeDirPath, dirName);
|
|
10721
|
+
const skillFilePath = (0, import_node_path72.join)(skillDirPath, SKILL_FILE_NAME);
|
|
10462
10722
|
if (!await fileExists(skillFilePath)) {
|
|
10463
10723
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
10464
10724
|
}
|
|
@@ -10535,7 +10795,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
10535
10795
|
throw new Error("AgentsmdSkill does not support global mode.");
|
|
10536
10796
|
}
|
|
10537
10797
|
return {
|
|
10538
|
-
relativeDirPath: (0,
|
|
10798
|
+
relativeDirPath: (0, import_node_path73.join)(".agents", "skills")
|
|
10539
10799
|
};
|
|
10540
10800
|
}
|
|
10541
10801
|
static async fromDir(params) {
|
|
@@ -10562,11 +10822,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
10562
10822
|
};
|
|
10563
10823
|
|
|
10564
10824
|
// src/features/skills/factorydroid-skill.ts
|
|
10565
|
-
var
|
|
10825
|
+
var import_node_path74 = require("path");
|
|
10566
10826
|
var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
10567
10827
|
static getSettablePaths(_options) {
|
|
10568
10828
|
return {
|
|
10569
|
-
relativeDirPath: (0,
|
|
10829
|
+
relativeDirPath: (0, import_node_path74.join)(".factory", "skills")
|
|
10570
10830
|
};
|
|
10571
10831
|
}
|
|
10572
10832
|
static async fromDir(params) {
|
|
@@ -10593,50 +10853,50 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
|
10593
10853
|
};
|
|
10594
10854
|
|
|
10595
10855
|
// src/features/skills/rovodev-skill.ts
|
|
10596
|
-
var
|
|
10597
|
-
var
|
|
10856
|
+
var import_node_path76 = require("path");
|
|
10857
|
+
var import_mini35 = require("zod/mini");
|
|
10598
10858
|
|
|
10599
10859
|
// src/features/skills/rulesync-skill.ts
|
|
10600
|
-
var
|
|
10601
|
-
var
|
|
10602
|
-
var RulesyncSkillFrontmatterSchemaInternal =
|
|
10603
|
-
name:
|
|
10604
|
-
description:
|
|
10605
|
-
targets:
|
|
10606
|
-
claudecode:
|
|
10607
|
-
|
|
10608
|
-
"allowed-tools":
|
|
10609
|
-
model:
|
|
10610
|
-
"disable-model-invocation":
|
|
10860
|
+
var import_node_path75 = require("path");
|
|
10861
|
+
var import_mini34 = require("zod/mini");
|
|
10862
|
+
var RulesyncSkillFrontmatterSchemaInternal = import_mini34.z.looseObject({
|
|
10863
|
+
name: import_mini34.z.string(),
|
|
10864
|
+
description: import_mini34.z.string(),
|
|
10865
|
+
targets: import_mini34.z._default(RulesyncTargetsSchema, ["*"]),
|
|
10866
|
+
claudecode: import_mini34.z.optional(
|
|
10867
|
+
import_mini34.z.looseObject({
|
|
10868
|
+
"allowed-tools": import_mini34.z.optional(import_mini34.z.array(import_mini34.z.string())),
|
|
10869
|
+
model: import_mini34.z.optional(import_mini34.z.string()),
|
|
10870
|
+
"disable-model-invocation": import_mini34.z.optional(import_mini34.z.boolean())
|
|
10611
10871
|
})
|
|
10612
10872
|
),
|
|
10613
|
-
codexcli:
|
|
10614
|
-
|
|
10615
|
-
"short-description":
|
|
10873
|
+
codexcli: import_mini34.z.optional(
|
|
10874
|
+
import_mini34.z.looseObject({
|
|
10875
|
+
"short-description": import_mini34.z.optional(import_mini34.z.string())
|
|
10616
10876
|
})
|
|
10617
10877
|
),
|
|
10618
|
-
opencode:
|
|
10619
|
-
|
|
10620
|
-
"allowed-tools":
|
|
10878
|
+
opencode: import_mini34.z.optional(
|
|
10879
|
+
import_mini34.z.looseObject({
|
|
10880
|
+
"allowed-tools": import_mini34.z.optional(import_mini34.z.array(import_mini34.z.string()))
|
|
10621
10881
|
})
|
|
10622
10882
|
),
|
|
10623
|
-
kilo:
|
|
10624
|
-
|
|
10625
|
-
"allowed-tools":
|
|
10883
|
+
kilo: import_mini34.z.optional(
|
|
10884
|
+
import_mini34.z.looseObject({
|
|
10885
|
+
"allowed-tools": import_mini34.z.optional(import_mini34.z.array(import_mini34.z.string()))
|
|
10626
10886
|
})
|
|
10627
10887
|
),
|
|
10628
|
-
deepagents:
|
|
10629
|
-
|
|
10630
|
-
"allowed-tools":
|
|
10888
|
+
deepagents: import_mini34.z.optional(
|
|
10889
|
+
import_mini34.z.looseObject({
|
|
10890
|
+
"allowed-tools": import_mini34.z.optional(import_mini34.z.array(import_mini34.z.string()))
|
|
10631
10891
|
})
|
|
10632
10892
|
),
|
|
10633
|
-
copilot:
|
|
10634
|
-
|
|
10635
|
-
license:
|
|
10893
|
+
copilot: import_mini34.z.optional(
|
|
10894
|
+
import_mini34.z.looseObject({
|
|
10895
|
+
license: import_mini34.z.optional(import_mini34.z.string())
|
|
10636
10896
|
})
|
|
10637
10897
|
),
|
|
10638
|
-
cline:
|
|
10639
|
-
roo:
|
|
10898
|
+
cline: import_mini34.z.optional(import_mini34.z.looseObject({})),
|
|
10899
|
+
roo: import_mini34.z.optional(import_mini34.z.looseObject({}))
|
|
10640
10900
|
});
|
|
10641
10901
|
var RulesyncSkillFrontmatterSchema = RulesyncSkillFrontmatterSchemaInternal;
|
|
10642
10902
|
var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
@@ -10676,7 +10936,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
10676
10936
|
}
|
|
10677
10937
|
getFrontmatter() {
|
|
10678
10938
|
if (!this.mainFile?.frontmatter) {
|
|
10679
|
-
throw new Error(`Frontmatter is not defined in ${(0,
|
|
10939
|
+
throw new Error(`Frontmatter is not defined in ${(0, import_node_path75.join)(this.relativeDirPath, this.dirName)}`);
|
|
10680
10940
|
}
|
|
10681
10941
|
const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
|
|
10682
10942
|
return result;
|
|
@@ -10702,8 +10962,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
10702
10962
|
dirName,
|
|
10703
10963
|
global = false
|
|
10704
10964
|
}) {
|
|
10705
|
-
const skillDirPath = (0,
|
|
10706
|
-
const skillFilePath = (0,
|
|
10965
|
+
const skillDirPath = (0, import_node_path75.join)(baseDir, relativeDirPath, dirName);
|
|
10966
|
+
const skillFilePath = (0, import_node_path75.join)(skillDirPath, SKILL_FILE_NAME);
|
|
10707
10967
|
if (!await fileExists(skillFilePath)) {
|
|
10708
10968
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
10709
10969
|
}
|
|
@@ -10733,14 +10993,14 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
10733
10993
|
};
|
|
10734
10994
|
|
|
10735
10995
|
// src/features/skills/rovodev-skill.ts
|
|
10736
|
-
var RovodevSkillFrontmatterSchema =
|
|
10737
|
-
name:
|
|
10738
|
-
description:
|
|
10996
|
+
var RovodevSkillFrontmatterSchema = import_mini35.z.looseObject({
|
|
10997
|
+
name: import_mini35.z.string(),
|
|
10998
|
+
description: import_mini35.z.string()
|
|
10739
10999
|
});
|
|
10740
11000
|
var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
10741
11001
|
constructor({
|
|
10742
11002
|
baseDir = process.cwd(),
|
|
10743
|
-
relativeDirPath = (0,
|
|
11003
|
+
relativeDirPath = (0, import_node_path76.join)(".rovodev", "skills"),
|
|
10744
11004
|
dirName,
|
|
10745
11005
|
frontmatter,
|
|
10746
11006
|
body,
|
|
@@ -10769,8 +11029,8 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
10769
11029
|
}
|
|
10770
11030
|
static getSettablePaths(_options) {
|
|
10771
11031
|
return {
|
|
10772
|
-
relativeDirPath: (0,
|
|
10773
|
-
alternativeSkillRoots: [(0,
|
|
11032
|
+
relativeDirPath: (0, import_node_path76.join)(".rovodev", "skills"),
|
|
11033
|
+
alternativeSkillRoots: [(0, import_node_path76.join)(".agents", "skills")]
|
|
10774
11034
|
};
|
|
10775
11035
|
}
|
|
10776
11036
|
getFrontmatter() {
|
|
@@ -10858,13 +11118,13 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
10858
11118
|
});
|
|
10859
11119
|
const result = RovodevSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10860
11120
|
if (!result.success) {
|
|
10861
|
-
const skillDirPath = (0,
|
|
11121
|
+
const skillDirPath = (0, import_node_path76.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10862
11122
|
throw new Error(
|
|
10863
|
-
`Invalid frontmatter in ${(0,
|
|
11123
|
+
`Invalid frontmatter in ${(0, import_node_path76.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10864
11124
|
);
|
|
10865
11125
|
}
|
|
10866
11126
|
if (result.data.name !== loaded.dirName) {
|
|
10867
|
-
const skillFilePath = (0,
|
|
11127
|
+
const skillFilePath = (0, import_node_path76.join)(
|
|
10868
11128
|
loaded.baseDir,
|
|
10869
11129
|
loaded.relativeDirPath,
|
|
10870
11130
|
loaded.dirName,
|
|
@@ -10906,11 +11166,11 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
10906
11166
|
};
|
|
10907
11167
|
|
|
10908
11168
|
// src/features/skills/skills-processor.ts
|
|
10909
|
-
var
|
|
10910
|
-
var
|
|
11169
|
+
var import_node_path94 = require("path");
|
|
11170
|
+
var import_mini51 = require("zod/mini");
|
|
10911
11171
|
|
|
10912
11172
|
// src/types/dir-feature-processor.ts
|
|
10913
|
-
var
|
|
11173
|
+
var import_node_path77 = require("path");
|
|
10914
11174
|
var DirFeatureProcessor = class {
|
|
10915
11175
|
baseDir;
|
|
10916
11176
|
dryRun;
|
|
@@ -10950,7 +11210,7 @@ var DirFeatureProcessor = class {
|
|
|
10950
11210
|
const mainFile = aiDir.getMainFile();
|
|
10951
11211
|
let mainFileContent;
|
|
10952
11212
|
if (mainFile) {
|
|
10953
|
-
const mainFilePath = (0,
|
|
11213
|
+
const mainFilePath = (0, import_node_path77.join)(dirPath, mainFile.name);
|
|
10954
11214
|
const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter, {
|
|
10955
11215
|
avoidBlockScalars: this.avoidBlockScalars
|
|
10956
11216
|
});
|
|
@@ -10970,7 +11230,7 @@ var DirFeatureProcessor = class {
|
|
|
10970
11230
|
const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
|
|
10971
11231
|
otherFileContents.push(contentWithNewline);
|
|
10972
11232
|
if (!dirHasChanges) {
|
|
10973
|
-
const filePath = (0,
|
|
11233
|
+
const filePath = (0, import_node_path77.join)(dirPath, file.relativeFilePathToDirPath);
|
|
10974
11234
|
const existingContent = await readFileContentOrNull(filePath);
|
|
10975
11235
|
if (!fileContentsEquivalent({
|
|
10976
11236
|
filePath,
|
|
@@ -10988,24 +11248,24 @@ var DirFeatureProcessor = class {
|
|
|
10988
11248
|
if (this.dryRun) {
|
|
10989
11249
|
this.logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
|
|
10990
11250
|
if (mainFile) {
|
|
10991
|
-
this.logger.info(`[DRY RUN] Would write: ${(0,
|
|
10992
|
-
changedPaths.push((0,
|
|
11251
|
+
this.logger.info(`[DRY RUN] Would write: ${(0, import_node_path77.join)(dirPath, mainFile.name)}`);
|
|
11252
|
+
changedPaths.push((0, import_node_path77.join)(relativeDir, mainFile.name));
|
|
10993
11253
|
}
|
|
10994
11254
|
for (const file of otherFiles) {
|
|
10995
11255
|
this.logger.info(
|
|
10996
|
-
`[DRY RUN] Would write: ${(0,
|
|
11256
|
+
`[DRY RUN] Would write: ${(0, import_node_path77.join)(dirPath, file.relativeFilePathToDirPath)}`
|
|
10997
11257
|
);
|
|
10998
|
-
changedPaths.push((0,
|
|
11258
|
+
changedPaths.push((0, import_node_path77.join)(relativeDir, file.relativeFilePathToDirPath));
|
|
10999
11259
|
}
|
|
11000
11260
|
} else {
|
|
11001
11261
|
await ensureDir(dirPath);
|
|
11002
11262
|
if (mainFile && mainFileContent) {
|
|
11003
|
-
const mainFilePath = (0,
|
|
11263
|
+
const mainFilePath = (0, import_node_path77.join)(dirPath, mainFile.name);
|
|
11004
11264
|
await writeFileContent(mainFilePath, mainFileContent);
|
|
11005
|
-
changedPaths.push((0,
|
|
11265
|
+
changedPaths.push((0, import_node_path77.join)(relativeDir, mainFile.name));
|
|
11006
11266
|
}
|
|
11007
11267
|
for (const [i, file] of otherFiles.entries()) {
|
|
11008
|
-
const filePath = (0,
|
|
11268
|
+
const filePath = (0, import_node_path77.join)(dirPath, file.relativeFilePathToDirPath);
|
|
11009
11269
|
const content = otherFileContents[i];
|
|
11010
11270
|
if (content === void 0) {
|
|
11011
11271
|
throw new Error(
|
|
@@ -11013,7 +11273,7 @@ var DirFeatureProcessor = class {
|
|
|
11013
11273
|
);
|
|
11014
11274
|
}
|
|
11015
11275
|
await writeFileContent(filePath, content);
|
|
11016
|
-
changedPaths.push((0,
|
|
11276
|
+
changedPaths.push((0, import_node_path77.join)(relativeDir, file.relativeFilePathToDirPath));
|
|
11017
11277
|
}
|
|
11018
11278
|
}
|
|
11019
11279
|
changedCount++;
|
|
@@ -11045,16 +11305,16 @@ var DirFeatureProcessor = class {
|
|
|
11045
11305
|
};
|
|
11046
11306
|
|
|
11047
11307
|
// src/features/skills/agentsskills-skill.ts
|
|
11048
|
-
var
|
|
11049
|
-
var
|
|
11050
|
-
var AgentsSkillsSkillFrontmatterSchema =
|
|
11051
|
-
name:
|
|
11052
|
-
description:
|
|
11308
|
+
var import_node_path78 = require("path");
|
|
11309
|
+
var import_mini36 = require("zod/mini");
|
|
11310
|
+
var AgentsSkillsSkillFrontmatterSchema = import_mini36.z.looseObject({
|
|
11311
|
+
name: import_mini36.z.string(),
|
|
11312
|
+
description: import_mini36.z.string()
|
|
11053
11313
|
});
|
|
11054
11314
|
var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
11055
11315
|
constructor({
|
|
11056
11316
|
baseDir = process.cwd(),
|
|
11057
|
-
relativeDirPath = (0,
|
|
11317
|
+
relativeDirPath = (0, import_node_path78.join)(".agents", "skills"),
|
|
11058
11318
|
dirName,
|
|
11059
11319
|
frontmatter,
|
|
11060
11320
|
body,
|
|
@@ -11086,7 +11346,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
11086
11346
|
throw new Error("AgentsSkillsSkill does not support global mode.");
|
|
11087
11347
|
}
|
|
11088
11348
|
return {
|
|
11089
|
-
relativeDirPath: (0,
|
|
11349
|
+
relativeDirPath: (0, import_node_path78.join)(".agents", "skills")
|
|
11090
11350
|
};
|
|
11091
11351
|
}
|
|
11092
11352
|
getFrontmatter() {
|
|
@@ -11166,9 +11426,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
11166
11426
|
});
|
|
11167
11427
|
const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
11168
11428
|
if (!result.success) {
|
|
11169
|
-
const skillDirPath = (0,
|
|
11429
|
+
const skillDirPath = (0, import_node_path78.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
11170
11430
|
throw new Error(
|
|
11171
|
-
`Invalid frontmatter in ${(0,
|
|
11431
|
+
`Invalid frontmatter in ${(0, import_node_path78.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
11172
11432
|
);
|
|
11173
11433
|
}
|
|
11174
11434
|
return new _AgentsSkillsSkill({
|
|
@@ -11203,16 +11463,16 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
11203
11463
|
};
|
|
11204
11464
|
|
|
11205
11465
|
// src/features/skills/antigravity-skill.ts
|
|
11206
|
-
var
|
|
11207
|
-
var
|
|
11208
|
-
var AntigravitySkillFrontmatterSchema =
|
|
11209
|
-
name:
|
|
11210
|
-
description:
|
|
11466
|
+
var import_node_path79 = require("path");
|
|
11467
|
+
var import_mini37 = require("zod/mini");
|
|
11468
|
+
var AntigravitySkillFrontmatterSchema = import_mini37.z.looseObject({
|
|
11469
|
+
name: import_mini37.z.string(),
|
|
11470
|
+
description: import_mini37.z.string()
|
|
11211
11471
|
});
|
|
11212
11472
|
var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
11213
11473
|
constructor({
|
|
11214
11474
|
baseDir = process.cwd(),
|
|
11215
|
-
relativeDirPath = (0,
|
|
11475
|
+
relativeDirPath = (0, import_node_path79.join)(".agent", "skills"),
|
|
11216
11476
|
dirName,
|
|
11217
11477
|
frontmatter,
|
|
11218
11478
|
body,
|
|
@@ -11244,11 +11504,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
11244
11504
|
} = {}) {
|
|
11245
11505
|
if (global) {
|
|
11246
11506
|
return {
|
|
11247
|
-
relativeDirPath: (0,
|
|
11507
|
+
relativeDirPath: (0, import_node_path79.join)(".gemini", "antigravity", "skills")
|
|
11248
11508
|
};
|
|
11249
11509
|
}
|
|
11250
11510
|
return {
|
|
11251
|
-
relativeDirPath: (0,
|
|
11511
|
+
relativeDirPath: (0, import_node_path79.join)(".agent", "skills")
|
|
11252
11512
|
};
|
|
11253
11513
|
}
|
|
11254
11514
|
getFrontmatter() {
|
|
@@ -11328,9 +11588,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
11328
11588
|
});
|
|
11329
11589
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
11330
11590
|
if (!result.success) {
|
|
11331
|
-
const skillDirPath = (0,
|
|
11591
|
+
const skillDirPath = (0, import_node_path79.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
11332
11592
|
throw new Error(
|
|
11333
|
-
`Invalid frontmatter in ${(0,
|
|
11593
|
+
`Invalid frontmatter in ${(0, import_node_path79.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
11334
11594
|
);
|
|
11335
11595
|
}
|
|
11336
11596
|
return new _AntigravitySkill({
|
|
@@ -11364,19 +11624,19 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
11364
11624
|
};
|
|
11365
11625
|
|
|
11366
11626
|
// src/features/skills/claudecode-skill.ts
|
|
11367
|
-
var
|
|
11368
|
-
var
|
|
11369
|
-
var ClaudecodeSkillFrontmatterSchema =
|
|
11370
|
-
name:
|
|
11371
|
-
description:
|
|
11372
|
-
"allowed-tools":
|
|
11373
|
-
model:
|
|
11374
|
-
"disable-model-invocation":
|
|
11627
|
+
var import_node_path80 = require("path");
|
|
11628
|
+
var import_mini38 = require("zod/mini");
|
|
11629
|
+
var ClaudecodeSkillFrontmatterSchema = import_mini38.z.looseObject({
|
|
11630
|
+
name: import_mini38.z.string(),
|
|
11631
|
+
description: import_mini38.z.string(),
|
|
11632
|
+
"allowed-tools": import_mini38.z.optional(import_mini38.z.array(import_mini38.z.string())),
|
|
11633
|
+
model: import_mini38.z.optional(import_mini38.z.string()),
|
|
11634
|
+
"disable-model-invocation": import_mini38.z.optional(import_mini38.z.boolean())
|
|
11375
11635
|
});
|
|
11376
11636
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
11377
11637
|
constructor({
|
|
11378
11638
|
baseDir = process.cwd(),
|
|
11379
|
-
relativeDirPath = (0,
|
|
11639
|
+
relativeDirPath = (0, import_node_path80.join)(".claude", "skills"),
|
|
11380
11640
|
dirName,
|
|
11381
11641
|
frontmatter,
|
|
11382
11642
|
body,
|
|
@@ -11407,7 +11667,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
11407
11667
|
global: _global = false
|
|
11408
11668
|
} = {}) {
|
|
11409
11669
|
return {
|
|
11410
|
-
relativeDirPath: (0,
|
|
11670
|
+
relativeDirPath: (0, import_node_path80.join)(".claude", "skills")
|
|
11411
11671
|
};
|
|
11412
11672
|
}
|
|
11413
11673
|
getFrontmatter() {
|
|
@@ -11504,9 +11764,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
11504
11764
|
});
|
|
11505
11765
|
const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
11506
11766
|
if (!result.success) {
|
|
11507
|
-
const skillDirPath = (0,
|
|
11767
|
+
const skillDirPath = (0, import_node_path80.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
11508
11768
|
throw new Error(
|
|
11509
|
-
`Invalid frontmatter in ${(0,
|
|
11769
|
+
`Invalid frontmatter in ${(0, import_node_path80.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
11510
11770
|
);
|
|
11511
11771
|
}
|
|
11512
11772
|
return new _ClaudecodeSkill({
|
|
@@ -11540,16 +11800,16 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
11540
11800
|
};
|
|
11541
11801
|
|
|
11542
11802
|
// src/features/skills/cline-skill.ts
|
|
11543
|
-
var
|
|
11544
|
-
var
|
|
11545
|
-
var ClineSkillFrontmatterSchema =
|
|
11546
|
-
name:
|
|
11547
|
-
description:
|
|
11803
|
+
var import_node_path81 = require("path");
|
|
11804
|
+
var import_mini39 = require("zod/mini");
|
|
11805
|
+
var ClineSkillFrontmatterSchema = import_mini39.z.looseObject({
|
|
11806
|
+
name: import_mini39.z.string(),
|
|
11807
|
+
description: import_mini39.z.string()
|
|
11548
11808
|
});
|
|
11549
11809
|
var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
11550
11810
|
constructor({
|
|
11551
11811
|
baseDir = process.cwd(),
|
|
11552
|
-
relativeDirPath = (0,
|
|
11812
|
+
relativeDirPath = (0, import_node_path81.join)(".cline", "skills"),
|
|
11553
11813
|
dirName,
|
|
11554
11814
|
frontmatter,
|
|
11555
11815
|
body,
|
|
@@ -11578,7 +11838,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
11578
11838
|
}
|
|
11579
11839
|
static getSettablePaths(_options = {}) {
|
|
11580
11840
|
return {
|
|
11581
|
-
relativeDirPath: (0,
|
|
11841
|
+
relativeDirPath: (0, import_node_path81.join)(".cline", "skills")
|
|
11582
11842
|
};
|
|
11583
11843
|
}
|
|
11584
11844
|
getFrontmatter() {
|
|
@@ -11666,13 +11926,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
11666
11926
|
});
|
|
11667
11927
|
const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
11668
11928
|
if (!result.success) {
|
|
11669
|
-
const skillDirPath = (0,
|
|
11929
|
+
const skillDirPath = (0, import_node_path81.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
11670
11930
|
throw new Error(
|
|
11671
|
-
`Invalid frontmatter in ${(0,
|
|
11931
|
+
`Invalid frontmatter in ${(0, import_node_path81.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
11672
11932
|
);
|
|
11673
11933
|
}
|
|
11674
11934
|
if (result.data.name !== loaded.dirName) {
|
|
11675
|
-
const skillFilePath = (0,
|
|
11935
|
+
const skillFilePath = (0, import_node_path81.join)(
|
|
11676
11936
|
loaded.baseDir,
|
|
11677
11937
|
loaded.relativeDirPath,
|
|
11678
11938
|
loaded.dirName,
|
|
@@ -11713,21 +11973,21 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
11713
11973
|
};
|
|
11714
11974
|
|
|
11715
11975
|
// src/features/skills/codexcli-skill.ts
|
|
11716
|
-
var
|
|
11717
|
-
var
|
|
11718
|
-
var CodexCliSkillFrontmatterSchema =
|
|
11719
|
-
name:
|
|
11720
|
-
description:
|
|
11721
|
-
metadata:
|
|
11722
|
-
|
|
11723
|
-
"short-description":
|
|
11976
|
+
var import_node_path82 = require("path");
|
|
11977
|
+
var import_mini40 = require("zod/mini");
|
|
11978
|
+
var CodexCliSkillFrontmatterSchema = import_mini40.z.looseObject({
|
|
11979
|
+
name: import_mini40.z.string(),
|
|
11980
|
+
description: import_mini40.z.string(),
|
|
11981
|
+
metadata: import_mini40.z.optional(
|
|
11982
|
+
import_mini40.z.looseObject({
|
|
11983
|
+
"short-description": import_mini40.z.optional(import_mini40.z.string())
|
|
11724
11984
|
})
|
|
11725
11985
|
)
|
|
11726
11986
|
});
|
|
11727
11987
|
var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
11728
11988
|
constructor({
|
|
11729
11989
|
baseDir = process.cwd(),
|
|
11730
|
-
relativeDirPath = (0,
|
|
11990
|
+
relativeDirPath = (0, import_node_path82.join)(".codex", "skills"),
|
|
11731
11991
|
dirName,
|
|
11732
11992
|
frontmatter,
|
|
11733
11993
|
body,
|
|
@@ -11758,7 +12018,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
11758
12018
|
global: _global = false
|
|
11759
12019
|
} = {}) {
|
|
11760
12020
|
return {
|
|
11761
|
-
relativeDirPath: (0,
|
|
12021
|
+
relativeDirPath: (0, import_node_path82.join)(".codex", "skills")
|
|
11762
12022
|
};
|
|
11763
12023
|
}
|
|
11764
12024
|
getFrontmatter() {
|
|
@@ -11848,9 +12108,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
11848
12108
|
});
|
|
11849
12109
|
const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
11850
12110
|
if (!result.success) {
|
|
11851
|
-
const skillDirPath = (0,
|
|
12111
|
+
const skillDirPath = (0, import_node_path82.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
11852
12112
|
throw new Error(
|
|
11853
|
-
`Invalid frontmatter in ${(0,
|
|
12113
|
+
`Invalid frontmatter in ${(0, import_node_path82.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
11854
12114
|
);
|
|
11855
12115
|
}
|
|
11856
12116
|
return new _CodexCliSkill({
|
|
@@ -11884,17 +12144,17 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
11884
12144
|
};
|
|
11885
12145
|
|
|
11886
12146
|
// src/features/skills/copilot-skill.ts
|
|
11887
|
-
var
|
|
11888
|
-
var
|
|
11889
|
-
var CopilotSkillFrontmatterSchema =
|
|
11890
|
-
name:
|
|
11891
|
-
description:
|
|
11892
|
-
license:
|
|
12147
|
+
var import_node_path83 = require("path");
|
|
12148
|
+
var import_mini41 = require("zod/mini");
|
|
12149
|
+
var CopilotSkillFrontmatterSchema = import_mini41.z.looseObject({
|
|
12150
|
+
name: import_mini41.z.string(),
|
|
12151
|
+
description: import_mini41.z.string(),
|
|
12152
|
+
license: import_mini41.z.optional(import_mini41.z.string())
|
|
11893
12153
|
});
|
|
11894
12154
|
var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
11895
12155
|
constructor({
|
|
11896
12156
|
baseDir = process.cwd(),
|
|
11897
|
-
relativeDirPath = (0,
|
|
12157
|
+
relativeDirPath = (0, import_node_path83.join)(".github", "skills"),
|
|
11898
12158
|
dirName,
|
|
11899
12159
|
frontmatter,
|
|
11900
12160
|
body,
|
|
@@ -11926,7 +12186,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
11926
12186
|
throw new Error("CopilotSkill does not support global mode.");
|
|
11927
12187
|
}
|
|
11928
12188
|
return {
|
|
11929
|
-
relativeDirPath: (0,
|
|
12189
|
+
relativeDirPath: (0, import_node_path83.join)(".github", "skills")
|
|
11930
12190
|
};
|
|
11931
12191
|
}
|
|
11932
12192
|
getFrontmatter() {
|
|
@@ -12012,9 +12272,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
12012
12272
|
});
|
|
12013
12273
|
const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12014
12274
|
if (!result.success) {
|
|
12015
|
-
const skillDirPath = (0,
|
|
12275
|
+
const skillDirPath = (0, import_node_path83.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
12016
12276
|
throw new Error(
|
|
12017
|
-
`Invalid frontmatter in ${(0,
|
|
12277
|
+
`Invalid frontmatter in ${(0, import_node_path83.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12018
12278
|
);
|
|
12019
12279
|
}
|
|
12020
12280
|
return new _CopilotSkill({
|
|
@@ -12049,16 +12309,16 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
12049
12309
|
};
|
|
12050
12310
|
|
|
12051
12311
|
// src/features/skills/cursor-skill.ts
|
|
12052
|
-
var
|
|
12053
|
-
var
|
|
12054
|
-
var CursorSkillFrontmatterSchema =
|
|
12055
|
-
name:
|
|
12056
|
-
description:
|
|
12312
|
+
var import_node_path84 = require("path");
|
|
12313
|
+
var import_mini42 = require("zod/mini");
|
|
12314
|
+
var CursorSkillFrontmatterSchema = import_mini42.z.looseObject({
|
|
12315
|
+
name: import_mini42.z.string(),
|
|
12316
|
+
description: import_mini42.z.string()
|
|
12057
12317
|
});
|
|
12058
12318
|
var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
12059
12319
|
constructor({
|
|
12060
12320
|
baseDir = process.cwd(),
|
|
12061
|
-
relativeDirPath = (0,
|
|
12321
|
+
relativeDirPath = (0, import_node_path84.join)(".cursor", "skills"),
|
|
12062
12322
|
dirName,
|
|
12063
12323
|
frontmatter,
|
|
12064
12324
|
body,
|
|
@@ -12087,7 +12347,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
12087
12347
|
}
|
|
12088
12348
|
static getSettablePaths(_options) {
|
|
12089
12349
|
return {
|
|
12090
|
-
relativeDirPath: (0,
|
|
12350
|
+
relativeDirPath: (0, import_node_path84.join)(".cursor", "skills")
|
|
12091
12351
|
};
|
|
12092
12352
|
}
|
|
12093
12353
|
getFrontmatter() {
|
|
@@ -12167,9 +12427,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
12167
12427
|
});
|
|
12168
12428
|
const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12169
12429
|
if (!result.success) {
|
|
12170
|
-
const skillDirPath = (0,
|
|
12430
|
+
const skillDirPath = (0, import_node_path84.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
12171
12431
|
throw new Error(
|
|
12172
|
-
`Invalid frontmatter in ${(0,
|
|
12432
|
+
`Invalid frontmatter in ${(0, import_node_path84.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12173
12433
|
);
|
|
12174
12434
|
}
|
|
12175
12435
|
return new _CursorSkill({
|
|
@@ -12204,17 +12464,17 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
12204
12464
|
};
|
|
12205
12465
|
|
|
12206
12466
|
// src/features/skills/deepagents-skill.ts
|
|
12207
|
-
var
|
|
12208
|
-
var
|
|
12209
|
-
var DeepagentsSkillFrontmatterSchema =
|
|
12210
|
-
name:
|
|
12211
|
-
description:
|
|
12212
|
-
"allowed-tools":
|
|
12467
|
+
var import_node_path85 = require("path");
|
|
12468
|
+
var import_mini43 = require("zod/mini");
|
|
12469
|
+
var DeepagentsSkillFrontmatterSchema = import_mini43.z.looseObject({
|
|
12470
|
+
name: import_mini43.z.string(),
|
|
12471
|
+
description: import_mini43.z.string(),
|
|
12472
|
+
"allowed-tools": import_mini43.z.optional(import_mini43.z.array(import_mini43.z.string()))
|
|
12213
12473
|
});
|
|
12214
12474
|
var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
12215
12475
|
constructor({
|
|
12216
12476
|
baseDir = process.cwd(),
|
|
12217
|
-
relativeDirPath = (0,
|
|
12477
|
+
relativeDirPath = (0, import_node_path85.join)(".deepagents", "skills"),
|
|
12218
12478
|
dirName,
|
|
12219
12479
|
frontmatter,
|
|
12220
12480
|
body,
|
|
@@ -12243,7 +12503,7 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
12243
12503
|
}
|
|
12244
12504
|
static getSettablePaths(_options) {
|
|
12245
12505
|
return {
|
|
12246
|
-
relativeDirPath: (0,
|
|
12506
|
+
relativeDirPath: (0, import_node_path85.join)(".deepagents", "skills")
|
|
12247
12507
|
};
|
|
12248
12508
|
}
|
|
12249
12509
|
getFrontmatter() {
|
|
@@ -12329,9 +12589,9 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
12329
12589
|
});
|
|
12330
12590
|
const result = DeepagentsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12331
12591
|
if (!result.success) {
|
|
12332
|
-
const skillDirPath = (0,
|
|
12592
|
+
const skillDirPath = (0, import_node_path85.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
12333
12593
|
throw new Error(
|
|
12334
|
-
`Invalid frontmatter in ${(0,
|
|
12594
|
+
`Invalid frontmatter in ${(0, import_node_path85.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12335
12595
|
);
|
|
12336
12596
|
}
|
|
12337
12597
|
return new _DeepagentsSkill({
|
|
@@ -12366,11 +12626,11 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
12366
12626
|
};
|
|
12367
12627
|
|
|
12368
12628
|
// src/features/skills/geminicli-skill.ts
|
|
12369
|
-
var
|
|
12370
|
-
var
|
|
12371
|
-
var GeminiCliSkillFrontmatterSchema =
|
|
12372
|
-
name:
|
|
12373
|
-
description:
|
|
12629
|
+
var import_node_path86 = require("path");
|
|
12630
|
+
var import_mini44 = require("zod/mini");
|
|
12631
|
+
var GeminiCliSkillFrontmatterSchema = import_mini44.z.looseObject({
|
|
12632
|
+
name: import_mini44.z.string(),
|
|
12633
|
+
description: import_mini44.z.string()
|
|
12374
12634
|
});
|
|
12375
12635
|
var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
12376
12636
|
constructor({
|
|
@@ -12406,7 +12666,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
12406
12666
|
global: _global = false
|
|
12407
12667
|
} = {}) {
|
|
12408
12668
|
return {
|
|
12409
|
-
relativeDirPath: (0,
|
|
12669
|
+
relativeDirPath: (0, import_node_path86.join)(".gemini", "skills")
|
|
12410
12670
|
};
|
|
12411
12671
|
}
|
|
12412
12672
|
getFrontmatter() {
|
|
@@ -12486,9 +12746,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
12486
12746
|
});
|
|
12487
12747
|
const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12488
12748
|
if (!result.success) {
|
|
12489
|
-
const skillDirPath = (0,
|
|
12749
|
+
const skillDirPath = (0, import_node_path86.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
12490
12750
|
throw new Error(
|
|
12491
|
-
`Invalid frontmatter in ${(0,
|
|
12751
|
+
`Invalid frontmatter in ${(0, import_node_path86.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12492
12752
|
);
|
|
12493
12753
|
}
|
|
12494
12754
|
return new _GeminiCliSkill({
|
|
@@ -12523,16 +12783,16 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
12523
12783
|
};
|
|
12524
12784
|
|
|
12525
12785
|
// src/features/skills/junie-skill.ts
|
|
12526
|
-
var
|
|
12527
|
-
var
|
|
12528
|
-
var JunieSkillFrontmatterSchema =
|
|
12529
|
-
name:
|
|
12530
|
-
description:
|
|
12786
|
+
var import_node_path87 = require("path");
|
|
12787
|
+
var import_mini45 = require("zod/mini");
|
|
12788
|
+
var JunieSkillFrontmatterSchema = import_mini45.z.looseObject({
|
|
12789
|
+
name: import_mini45.z.string(),
|
|
12790
|
+
description: import_mini45.z.string()
|
|
12531
12791
|
});
|
|
12532
12792
|
var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
12533
12793
|
constructor({
|
|
12534
12794
|
baseDir = process.cwd(),
|
|
12535
|
-
relativeDirPath = (0,
|
|
12795
|
+
relativeDirPath = (0, import_node_path87.join)(".junie", "skills"),
|
|
12536
12796
|
dirName,
|
|
12537
12797
|
frontmatter,
|
|
12538
12798
|
body,
|
|
@@ -12564,7 +12824,7 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
12564
12824
|
throw new Error("JunieSkill does not support global mode.");
|
|
12565
12825
|
}
|
|
12566
12826
|
return {
|
|
12567
|
-
relativeDirPath: (0,
|
|
12827
|
+
relativeDirPath: (0, import_node_path87.join)(".junie", "skills")
|
|
12568
12828
|
};
|
|
12569
12829
|
}
|
|
12570
12830
|
getFrontmatter() {
|
|
@@ -12651,13 +12911,13 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
12651
12911
|
});
|
|
12652
12912
|
const result = JunieSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12653
12913
|
if (!result.success) {
|
|
12654
|
-
const skillDirPath = (0,
|
|
12914
|
+
const skillDirPath = (0, import_node_path87.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
12655
12915
|
throw new Error(
|
|
12656
|
-
`Invalid frontmatter in ${(0,
|
|
12916
|
+
`Invalid frontmatter in ${(0, import_node_path87.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12657
12917
|
);
|
|
12658
12918
|
}
|
|
12659
12919
|
if (result.data.name !== loaded.dirName) {
|
|
12660
|
-
const skillFilePath = (0,
|
|
12920
|
+
const skillFilePath = (0, import_node_path87.join)(
|
|
12661
12921
|
loaded.baseDir,
|
|
12662
12922
|
loaded.relativeDirPath,
|
|
12663
12923
|
loaded.dirName,
|
|
@@ -12699,17 +12959,17 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
12699
12959
|
};
|
|
12700
12960
|
|
|
12701
12961
|
// src/features/skills/kilo-skill.ts
|
|
12702
|
-
var
|
|
12703
|
-
var
|
|
12704
|
-
var KiloSkillFrontmatterSchema =
|
|
12705
|
-
name:
|
|
12706
|
-
description:
|
|
12707
|
-
"allowed-tools":
|
|
12962
|
+
var import_node_path88 = require("path");
|
|
12963
|
+
var import_mini46 = require("zod/mini");
|
|
12964
|
+
var KiloSkillFrontmatterSchema = import_mini46.z.looseObject({
|
|
12965
|
+
name: import_mini46.z.string(),
|
|
12966
|
+
description: import_mini46.z.string(),
|
|
12967
|
+
"allowed-tools": import_mini46.z.optional(import_mini46.z.array(import_mini46.z.string()))
|
|
12708
12968
|
});
|
|
12709
12969
|
var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
12710
12970
|
constructor({
|
|
12711
12971
|
baseDir = process.cwd(),
|
|
12712
|
-
relativeDirPath = (0,
|
|
12972
|
+
relativeDirPath = (0, import_node_path88.join)(".kilo", "skills"),
|
|
12713
12973
|
dirName,
|
|
12714
12974
|
frontmatter,
|
|
12715
12975
|
body,
|
|
@@ -12738,7 +12998,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
12738
12998
|
}
|
|
12739
12999
|
static getSettablePaths({ global = false } = {}) {
|
|
12740
13000
|
return {
|
|
12741
|
-
relativeDirPath: global ? (0,
|
|
13001
|
+
relativeDirPath: global ? (0, import_node_path88.join)(".config", "kilo", "skills") : (0, import_node_path88.join)(".kilo", "skills")
|
|
12742
13002
|
};
|
|
12743
13003
|
}
|
|
12744
13004
|
getFrontmatter() {
|
|
@@ -12824,9 +13084,9 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
12824
13084
|
});
|
|
12825
13085
|
const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12826
13086
|
if (!result.success) {
|
|
12827
|
-
const skillDirPath = (0,
|
|
13087
|
+
const skillDirPath = (0, import_node_path88.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
12828
13088
|
throw new Error(
|
|
12829
|
-
`Invalid frontmatter in ${(0,
|
|
13089
|
+
`Invalid frontmatter in ${(0, import_node_path88.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12830
13090
|
);
|
|
12831
13091
|
}
|
|
12832
13092
|
return new _KiloSkill({
|
|
@@ -12860,16 +13120,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
12860
13120
|
};
|
|
12861
13121
|
|
|
12862
13122
|
// src/features/skills/kiro-skill.ts
|
|
12863
|
-
var
|
|
12864
|
-
var
|
|
12865
|
-
var KiroSkillFrontmatterSchema =
|
|
12866
|
-
name:
|
|
12867
|
-
description:
|
|
13123
|
+
var import_node_path89 = require("path");
|
|
13124
|
+
var import_mini47 = require("zod/mini");
|
|
13125
|
+
var KiroSkillFrontmatterSchema = import_mini47.z.looseObject({
|
|
13126
|
+
name: import_mini47.z.string(),
|
|
13127
|
+
description: import_mini47.z.string()
|
|
12868
13128
|
});
|
|
12869
13129
|
var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
12870
13130
|
constructor({
|
|
12871
13131
|
baseDir = process.cwd(),
|
|
12872
|
-
relativeDirPath = (0,
|
|
13132
|
+
relativeDirPath = (0, import_node_path89.join)(".kiro", "skills"),
|
|
12873
13133
|
dirName,
|
|
12874
13134
|
frontmatter,
|
|
12875
13135
|
body,
|
|
@@ -12901,7 +13161,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
12901
13161
|
throw new Error("KiroSkill does not support global mode.");
|
|
12902
13162
|
}
|
|
12903
13163
|
return {
|
|
12904
|
-
relativeDirPath: (0,
|
|
13164
|
+
relativeDirPath: (0, import_node_path89.join)(".kiro", "skills")
|
|
12905
13165
|
};
|
|
12906
13166
|
}
|
|
12907
13167
|
getFrontmatter() {
|
|
@@ -12989,13 +13249,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
12989
13249
|
});
|
|
12990
13250
|
const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12991
13251
|
if (!result.success) {
|
|
12992
|
-
const skillDirPath = (0,
|
|
13252
|
+
const skillDirPath = (0, import_node_path89.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
12993
13253
|
throw new Error(
|
|
12994
|
-
`Invalid frontmatter in ${(0,
|
|
13254
|
+
`Invalid frontmatter in ${(0, import_node_path89.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12995
13255
|
);
|
|
12996
13256
|
}
|
|
12997
13257
|
if (result.data.name !== loaded.dirName) {
|
|
12998
|
-
const skillFilePath = (0,
|
|
13258
|
+
const skillFilePath = (0, import_node_path89.join)(
|
|
12999
13259
|
loaded.baseDir,
|
|
13000
13260
|
loaded.relativeDirPath,
|
|
13001
13261
|
loaded.dirName,
|
|
@@ -13037,17 +13297,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
13037
13297
|
};
|
|
13038
13298
|
|
|
13039
13299
|
// src/features/skills/opencode-skill.ts
|
|
13040
|
-
var
|
|
13041
|
-
var
|
|
13042
|
-
var OpenCodeSkillFrontmatterSchema =
|
|
13043
|
-
name:
|
|
13044
|
-
description:
|
|
13045
|
-
"allowed-tools":
|
|
13300
|
+
var import_node_path90 = require("path");
|
|
13301
|
+
var import_mini48 = require("zod/mini");
|
|
13302
|
+
var OpenCodeSkillFrontmatterSchema = import_mini48.z.looseObject({
|
|
13303
|
+
name: import_mini48.z.string(),
|
|
13304
|
+
description: import_mini48.z.string(),
|
|
13305
|
+
"allowed-tools": import_mini48.z.optional(import_mini48.z.array(import_mini48.z.string()))
|
|
13046
13306
|
});
|
|
13047
13307
|
var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
13048
13308
|
constructor({
|
|
13049
13309
|
baseDir = process.cwd(),
|
|
13050
|
-
relativeDirPath = (0,
|
|
13310
|
+
relativeDirPath = (0, import_node_path90.join)(".opencode", "skill"),
|
|
13051
13311
|
dirName,
|
|
13052
13312
|
frontmatter,
|
|
13053
13313
|
body,
|
|
@@ -13076,7 +13336,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
13076
13336
|
}
|
|
13077
13337
|
static getSettablePaths({ global = false } = {}) {
|
|
13078
13338
|
return {
|
|
13079
|
-
relativeDirPath: global ? (0,
|
|
13339
|
+
relativeDirPath: global ? (0, import_node_path90.join)(".config", "opencode", "skill") : (0, import_node_path90.join)(".opencode", "skill")
|
|
13080
13340
|
};
|
|
13081
13341
|
}
|
|
13082
13342
|
getFrontmatter() {
|
|
@@ -13162,9 +13422,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
13162
13422
|
});
|
|
13163
13423
|
const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
13164
13424
|
if (!result.success) {
|
|
13165
|
-
const skillDirPath = (0,
|
|
13425
|
+
const skillDirPath = (0, import_node_path90.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
13166
13426
|
throw new Error(
|
|
13167
|
-
`Invalid frontmatter in ${(0,
|
|
13427
|
+
`Invalid frontmatter in ${(0, import_node_path90.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
13168
13428
|
);
|
|
13169
13429
|
}
|
|
13170
13430
|
return new _OpenCodeSkill({
|
|
@@ -13198,16 +13458,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
13198
13458
|
};
|
|
13199
13459
|
|
|
13200
13460
|
// src/features/skills/replit-skill.ts
|
|
13201
|
-
var
|
|
13202
|
-
var
|
|
13203
|
-
var ReplitSkillFrontmatterSchema =
|
|
13204
|
-
name:
|
|
13205
|
-
description:
|
|
13461
|
+
var import_node_path91 = require("path");
|
|
13462
|
+
var import_mini49 = require("zod/mini");
|
|
13463
|
+
var ReplitSkillFrontmatterSchema = import_mini49.z.looseObject({
|
|
13464
|
+
name: import_mini49.z.string(),
|
|
13465
|
+
description: import_mini49.z.string()
|
|
13206
13466
|
});
|
|
13207
13467
|
var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
13208
13468
|
constructor({
|
|
13209
13469
|
baseDir = process.cwd(),
|
|
13210
|
-
relativeDirPath = (0,
|
|
13470
|
+
relativeDirPath = (0, import_node_path91.join)(".agents", "skills"),
|
|
13211
13471
|
dirName,
|
|
13212
13472
|
frontmatter,
|
|
13213
13473
|
body,
|
|
@@ -13239,7 +13499,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
13239
13499
|
throw new Error("ReplitSkill does not support global mode.");
|
|
13240
13500
|
}
|
|
13241
13501
|
return {
|
|
13242
|
-
relativeDirPath: (0,
|
|
13502
|
+
relativeDirPath: (0, import_node_path91.join)(".agents", "skills")
|
|
13243
13503
|
};
|
|
13244
13504
|
}
|
|
13245
13505
|
getFrontmatter() {
|
|
@@ -13319,9 +13579,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
13319
13579
|
});
|
|
13320
13580
|
const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
13321
13581
|
if (!result.success) {
|
|
13322
|
-
const skillDirPath = (0,
|
|
13582
|
+
const skillDirPath = (0, import_node_path91.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
13323
13583
|
throw new Error(
|
|
13324
|
-
`Invalid frontmatter in ${(0,
|
|
13584
|
+
`Invalid frontmatter in ${(0, import_node_path91.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
13325
13585
|
);
|
|
13326
13586
|
}
|
|
13327
13587
|
return new _ReplitSkill({
|
|
@@ -13356,16 +13616,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
13356
13616
|
};
|
|
13357
13617
|
|
|
13358
13618
|
// src/features/skills/roo-skill.ts
|
|
13359
|
-
var
|
|
13360
|
-
var
|
|
13361
|
-
var RooSkillFrontmatterSchema =
|
|
13362
|
-
name:
|
|
13363
|
-
description:
|
|
13619
|
+
var import_node_path92 = require("path");
|
|
13620
|
+
var import_mini50 = require("zod/mini");
|
|
13621
|
+
var RooSkillFrontmatterSchema = import_mini50.z.looseObject({
|
|
13622
|
+
name: import_mini50.z.string(),
|
|
13623
|
+
description: import_mini50.z.string()
|
|
13364
13624
|
});
|
|
13365
13625
|
var RooSkill = class _RooSkill extends ToolSkill {
|
|
13366
13626
|
constructor({
|
|
13367
13627
|
baseDir = process.cwd(),
|
|
13368
|
-
relativeDirPath = (0,
|
|
13628
|
+
relativeDirPath = (0, import_node_path92.join)(".roo", "skills"),
|
|
13369
13629
|
dirName,
|
|
13370
13630
|
frontmatter,
|
|
13371
13631
|
body,
|
|
@@ -13396,7 +13656,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
13396
13656
|
global: _global = false
|
|
13397
13657
|
} = {}) {
|
|
13398
13658
|
return {
|
|
13399
|
-
relativeDirPath: (0,
|
|
13659
|
+
relativeDirPath: (0, import_node_path92.join)(".roo", "skills")
|
|
13400
13660
|
};
|
|
13401
13661
|
}
|
|
13402
13662
|
getFrontmatter() {
|
|
@@ -13484,13 +13744,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
13484
13744
|
});
|
|
13485
13745
|
const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
13486
13746
|
if (!result.success) {
|
|
13487
|
-
const skillDirPath = (0,
|
|
13747
|
+
const skillDirPath = (0, import_node_path92.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
13488
13748
|
throw new Error(
|
|
13489
|
-
`Invalid frontmatter in ${(0,
|
|
13749
|
+
`Invalid frontmatter in ${(0, import_node_path92.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
13490
13750
|
);
|
|
13491
13751
|
}
|
|
13492
13752
|
if (result.data.name !== loaded.dirName) {
|
|
13493
|
-
const skillFilePath = (0,
|
|
13753
|
+
const skillFilePath = (0, import_node_path92.join)(
|
|
13494
13754
|
loaded.baseDir,
|
|
13495
13755
|
loaded.relativeDirPath,
|
|
13496
13756
|
loaded.dirName,
|
|
@@ -13531,17 +13791,17 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
13531
13791
|
};
|
|
13532
13792
|
|
|
13533
13793
|
// src/features/skills/skills-utils.ts
|
|
13534
|
-
var
|
|
13794
|
+
var import_node_path93 = require("path");
|
|
13535
13795
|
async function getLocalSkillDirNames(baseDir) {
|
|
13536
|
-
const skillsDir = (0,
|
|
13796
|
+
const skillsDir = (0, import_node_path93.join)(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
|
|
13537
13797
|
const names = /* @__PURE__ */ new Set();
|
|
13538
13798
|
if (!await directoryExists(skillsDir)) {
|
|
13539
13799
|
return names;
|
|
13540
13800
|
}
|
|
13541
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
13801
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path93.join)(skillsDir, "*"), { type: "dir" });
|
|
13542
13802
|
for (const dirPath of dirPaths) {
|
|
13543
|
-
const name = (0,
|
|
13544
|
-
if (name === (0,
|
|
13803
|
+
const name = (0, import_node_path93.basename)(dirPath);
|
|
13804
|
+
if (name === (0, import_node_path93.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
|
|
13545
13805
|
names.add(name);
|
|
13546
13806
|
}
|
|
13547
13807
|
return names;
|
|
@@ -13569,7 +13829,7 @@ var skillsProcessorToolTargetTuple = [
|
|
|
13569
13829
|
"roo",
|
|
13570
13830
|
"rovodev"
|
|
13571
13831
|
];
|
|
13572
|
-
var SkillsProcessorToolTargetSchema =
|
|
13832
|
+
var SkillsProcessorToolTargetSchema = import_mini51.z.enum(skillsProcessorToolTargetTuple);
|
|
13573
13833
|
var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
13574
13834
|
[
|
|
13575
13835
|
"agentsmd",
|
|
@@ -13793,11 +14053,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
13793
14053
|
)
|
|
13794
14054
|
);
|
|
13795
14055
|
const localSkillNames = new Set(localDirNames);
|
|
13796
|
-
const curatedDirPath = (0,
|
|
14056
|
+
const curatedDirPath = (0, import_node_path94.join)(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
|
|
13797
14057
|
let curatedSkills = [];
|
|
13798
14058
|
if (await directoryExists(curatedDirPath)) {
|
|
13799
|
-
const curatedDirPaths = await findFilesByGlobs((0,
|
|
13800
|
-
const curatedDirNames = curatedDirPaths.map((path3) => (0,
|
|
14059
|
+
const curatedDirPaths = await findFilesByGlobs((0, import_node_path94.join)(curatedDirPath, "*"), { type: "dir" });
|
|
14060
|
+
const curatedDirNames = curatedDirPaths.map((path3) => (0, import_node_path94.basename)(path3));
|
|
13801
14061
|
const nonConflicting = curatedDirNames.filter((name) => {
|
|
13802
14062
|
if (localSkillNames.has(name)) {
|
|
13803
14063
|
this.logger.debug(`Skipping curated skill "${name}": local skill takes precedence.`);
|
|
@@ -13834,13 +14094,13 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
13834
14094
|
const seenDirNames = /* @__PURE__ */ new Set();
|
|
13835
14095
|
const loadEntries = [];
|
|
13836
14096
|
for (const root of roots) {
|
|
13837
|
-
const skillsDirPath = (0,
|
|
14097
|
+
const skillsDirPath = (0, import_node_path94.join)(this.baseDir, root);
|
|
13838
14098
|
if (!await directoryExists(skillsDirPath)) {
|
|
13839
14099
|
continue;
|
|
13840
14100
|
}
|
|
13841
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
14101
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path94.join)(skillsDirPath, "*"), { type: "dir" });
|
|
13842
14102
|
for (const dirPath of dirPaths) {
|
|
13843
|
-
const dirName = (0,
|
|
14103
|
+
const dirName = (0, import_node_path94.basename)(dirPath);
|
|
13844
14104
|
if (seenDirNames.has(dirName)) {
|
|
13845
14105
|
continue;
|
|
13846
14106
|
}
|
|
@@ -13869,13 +14129,13 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
13869
14129
|
const roots = toolSkillSearchRoots(paths);
|
|
13870
14130
|
const toolSkills = [];
|
|
13871
14131
|
for (const root of roots) {
|
|
13872
|
-
const skillsDirPath = (0,
|
|
14132
|
+
const skillsDirPath = (0, import_node_path94.join)(this.baseDir, root);
|
|
13873
14133
|
if (!await directoryExists(skillsDirPath)) {
|
|
13874
14134
|
continue;
|
|
13875
14135
|
}
|
|
13876
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
14136
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path94.join)(skillsDirPath, "*"), { type: "dir" });
|
|
13877
14137
|
for (const dirPath of dirPaths) {
|
|
13878
|
-
const dirName = (0,
|
|
14138
|
+
const dirName = (0, import_node_path94.basename)(dirPath);
|
|
13879
14139
|
const toolSkill = factory.class.forDeletion({
|
|
13880
14140
|
baseDir: this.baseDir,
|
|
13881
14141
|
relativeDirPath: root,
|
|
@@ -13937,11 +14197,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
13937
14197
|
};
|
|
13938
14198
|
|
|
13939
14199
|
// src/features/subagents/agentsmd-subagent.ts
|
|
13940
|
-
var
|
|
14200
|
+
var import_node_path96 = require("path");
|
|
13941
14201
|
|
|
13942
14202
|
// src/features/subagents/simulated-subagent.ts
|
|
13943
|
-
var
|
|
13944
|
-
var
|
|
14203
|
+
var import_node_path95 = require("path");
|
|
14204
|
+
var import_mini52 = require("zod/mini");
|
|
13945
14205
|
|
|
13946
14206
|
// src/features/subagents/tool-subagent.ts
|
|
13947
14207
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -13993,9 +14253,9 @@ var ToolSubagent = class extends ToolFile {
|
|
|
13993
14253
|
};
|
|
13994
14254
|
|
|
13995
14255
|
// src/features/subagents/simulated-subagent.ts
|
|
13996
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
13997
|
-
name:
|
|
13998
|
-
description:
|
|
14256
|
+
var SimulatedSubagentFrontmatterSchema = import_mini52.z.object({
|
|
14257
|
+
name: import_mini52.z.string(),
|
|
14258
|
+
description: import_mini52.z.optional(import_mini52.z.string())
|
|
13999
14259
|
});
|
|
14000
14260
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
14001
14261
|
frontmatter;
|
|
@@ -14005,7 +14265,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
14005
14265
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14006
14266
|
if (!result.success) {
|
|
14007
14267
|
throw new Error(
|
|
14008
|
-
`Invalid frontmatter in ${(0,
|
|
14268
|
+
`Invalid frontmatter in ${(0, import_node_path95.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14009
14269
|
);
|
|
14010
14270
|
}
|
|
14011
14271
|
}
|
|
@@ -14056,7 +14316,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
14056
14316
|
return {
|
|
14057
14317
|
success: false,
|
|
14058
14318
|
error: new Error(
|
|
14059
|
-
`Invalid frontmatter in ${(0,
|
|
14319
|
+
`Invalid frontmatter in ${(0, import_node_path95.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14060
14320
|
)
|
|
14061
14321
|
};
|
|
14062
14322
|
}
|
|
@@ -14066,7 +14326,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
14066
14326
|
relativeFilePath,
|
|
14067
14327
|
validate = true
|
|
14068
14328
|
}) {
|
|
14069
|
-
const filePath = (0,
|
|
14329
|
+
const filePath = (0, import_node_path95.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
14070
14330
|
const fileContent = await readFileContent(filePath);
|
|
14071
14331
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14072
14332
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14076,7 +14336,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
14076
14336
|
return {
|
|
14077
14337
|
baseDir,
|
|
14078
14338
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
14079
|
-
relativeFilePath: (0,
|
|
14339
|
+
relativeFilePath: (0, import_node_path95.basename)(relativeFilePath),
|
|
14080
14340
|
frontmatter: result.data,
|
|
14081
14341
|
body: content.trim(),
|
|
14082
14342
|
validate
|
|
@@ -14102,7 +14362,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
14102
14362
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
14103
14363
|
static getSettablePaths() {
|
|
14104
14364
|
return {
|
|
14105
|
-
relativeDirPath: (0,
|
|
14365
|
+
relativeDirPath: (0, import_node_path96.join)(".agents", "subagents")
|
|
14106
14366
|
};
|
|
14107
14367
|
}
|
|
14108
14368
|
static async fromFile(params) {
|
|
@@ -14125,11 +14385,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
14125
14385
|
};
|
|
14126
14386
|
|
|
14127
14387
|
// src/features/subagents/factorydroid-subagent.ts
|
|
14128
|
-
var
|
|
14388
|
+
var import_node_path97 = require("path");
|
|
14129
14389
|
var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
|
|
14130
14390
|
static getSettablePaths(_options) {
|
|
14131
14391
|
return {
|
|
14132
|
-
relativeDirPath: (0,
|
|
14392
|
+
relativeDirPath: (0, import_node_path97.join)(".factory", "droids")
|
|
14133
14393
|
};
|
|
14134
14394
|
}
|
|
14135
14395
|
static async fromFile(params) {
|
|
@@ -14152,16 +14412,16 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
|
|
|
14152
14412
|
};
|
|
14153
14413
|
|
|
14154
14414
|
// src/features/subagents/geminicli-subagent.ts
|
|
14155
|
-
var
|
|
14156
|
-
var
|
|
14415
|
+
var import_node_path99 = require("path");
|
|
14416
|
+
var import_mini54 = require("zod/mini");
|
|
14157
14417
|
|
|
14158
14418
|
// src/features/subagents/rulesync-subagent.ts
|
|
14159
|
-
var
|
|
14160
|
-
var
|
|
14161
|
-
var RulesyncSubagentFrontmatterSchema =
|
|
14162
|
-
targets:
|
|
14163
|
-
name:
|
|
14164
|
-
description:
|
|
14419
|
+
var import_node_path98 = require("path");
|
|
14420
|
+
var import_mini53 = require("zod/mini");
|
|
14421
|
+
var RulesyncSubagentFrontmatterSchema = import_mini53.z.looseObject({
|
|
14422
|
+
targets: import_mini53.z._default(RulesyncTargetsSchema, ["*"]),
|
|
14423
|
+
name: import_mini53.z.string(),
|
|
14424
|
+
description: import_mini53.z.optional(import_mini53.z.string())
|
|
14165
14425
|
});
|
|
14166
14426
|
var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
14167
14427
|
frontmatter;
|
|
@@ -14170,7 +14430,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
14170
14430
|
const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14171
14431
|
if (!parseResult.success && rest.validate !== false) {
|
|
14172
14432
|
throw new Error(
|
|
14173
|
-
`Invalid frontmatter in ${(0,
|
|
14433
|
+
`Invalid frontmatter in ${(0, import_node_path98.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
14174
14434
|
);
|
|
14175
14435
|
}
|
|
14176
14436
|
const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
|
|
@@ -14203,7 +14463,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
14203
14463
|
return {
|
|
14204
14464
|
success: false,
|
|
14205
14465
|
error: new Error(
|
|
14206
|
-
`Invalid frontmatter in ${(0,
|
|
14466
|
+
`Invalid frontmatter in ${(0, import_node_path98.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14207
14467
|
)
|
|
14208
14468
|
};
|
|
14209
14469
|
}
|
|
@@ -14211,14 +14471,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
14211
14471
|
static async fromFile({
|
|
14212
14472
|
relativeFilePath
|
|
14213
14473
|
}) {
|
|
14214
|
-
const filePath = (0,
|
|
14474
|
+
const filePath = (0, import_node_path98.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
|
|
14215
14475
|
const fileContent = await readFileContent(filePath);
|
|
14216
14476
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14217
14477
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14218
14478
|
if (!result.success) {
|
|
14219
14479
|
throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
|
|
14220
14480
|
}
|
|
14221
|
-
const filename = (0,
|
|
14481
|
+
const filename = (0, import_node_path98.basename)(relativeFilePath);
|
|
14222
14482
|
return new _RulesyncSubagent({
|
|
14223
14483
|
baseDir: process.cwd(),
|
|
14224
14484
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
@@ -14230,9 +14490,9 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
14230
14490
|
};
|
|
14231
14491
|
|
|
14232
14492
|
// src/features/subagents/geminicli-subagent.ts
|
|
14233
|
-
var GeminiCliSubagentFrontmatterSchema =
|
|
14234
|
-
name:
|
|
14235
|
-
description:
|
|
14493
|
+
var GeminiCliSubagentFrontmatterSchema = import_mini54.z.looseObject({
|
|
14494
|
+
name: import_mini54.z.string(),
|
|
14495
|
+
description: import_mini54.z.optional(import_mini54.z.string())
|
|
14236
14496
|
});
|
|
14237
14497
|
var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
14238
14498
|
frontmatter;
|
|
@@ -14242,7 +14502,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
14242
14502
|
const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14243
14503
|
if (!result.success) {
|
|
14244
14504
|
throw new Error(
|
|
14245
|
-
`Invalid frontmatter in ${(0,
|
|
14505
|
+
`Invalid frontmatter in ${(0, import_node_path99.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14246
14506
|
);
|
|
14247
14507
|
}
|
|
14248
14508
|
}
|
|
@@ -14255,7 +14515,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
14255
14515
|
}
|
|
14256
14516
|
static getSettablePaths(_options = {}) {
|
|
14257
14517
|
return {
|
|
14258
|
-
relativeDirPath: (0,
|
|
14518
|
+
relativeDirPath: (0, import_node_path99.join)(".gemini", "agents")
|
|
14259
14519
|
};
|
|
14260
14520
|
}
|
|
14261
14521
|
getFrontmatter() {
|
|
@@ -14323,7 +14583,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
14323
14583
|
return {
|
|
14324
14584
|
success: false,
|
|
14325
14585
|
error: new Error(
|
|
14326
|
-
`Invalid frontmatter in ${(0,
|
|
14586
|
+
`Invalid frontmatter in ${(0, import_node_path99.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14327
14587
|
)
|
|
14328
14588
|
};
|
|
14329
14589
|
}
|
|
@@ -14341,7 +14601,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
14341
14601
|
global = false
|
|
14342
14602
|
}) {
|
|
14343
14603
|
const paths = this.getSettablePaths({ global });
|
|
14344
|
-
const filePath = (0,
|
|
14604
|
+
const filePath = (0, import_node_path99.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
14345
14605
|
const fileContent = await readFileContent(filePath);
|
|
14346
14606
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14347
14607
|
const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14377,11 +14637,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
14377
14637
|
};
|
|
14378
14638
|
|
|
14379
14639
|
// src/features/subagents/roo-subagent.ts
|
|
14380
|
-
var
|
|
14640
|
+
var import_node_path100 = require("path");
|
|
14381
14641
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
14382
14642
|
static getSettablePaths() {
|
|
14383
14643
|
return {
|
|
14384
|
-
relativeDirPath: (0,
|
|
14644
|
+
relativeDirPath: (0, import_node_path100.join)(".roo", "subagents")
|
|
14385
14645
|
};
|
|
14386
14646
|
}
|
|
14387
14647
|
static async fromFile(params) {
|
|
@@ -14404,11 +14664,11 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
14404
14664
|
};
|
|
14405
14665
|
|
|
14406
14666
|
// src/features/subagents/rovodev-subagent.ts
|
|
14407
|
-
var
|
|
14408
|
-
var
|
|
14409
|
-
var RovodevSubagentFrontmatterSchema =
|
|
14410
|
-
name:
|
|
14411
|
-
description:
|
|
14667
|
+
var import_node_path101 = require("path");
|
|
14668
|
+
var import_mini55 = require("zod/mini");
|
|
14669
|
+
var RovodevSubagentFrontmatterSchema = import_mini55.z.looseObject({
|
|
14670
|
+
name: import_mini55.z.string(),
|
|
14671
|
+
description: import_mini55.z.optional(import_mini55.z.string())
|
|
14412
14672
|
});
|
|
14413
14673
|
var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
14414
14674
|
frontmatter;
|
|
@@ -14418,7 +14678,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
14418
14678
|
const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14419
14679
|
if (!result.success) {
|
|
14420
14680
|
throw new Error(
|
|
14421
|
-
`Invalid frontmatter in ${(0,
|
|
14681
|
+
`Invalid frontmatter in ${(0, import_node_path101.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14422
14682
|
);
|
|
14423
14683
|
}
|
|
14424
14684
|
}
|
|
@@ -14430,7 +14690,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
14430
14690
|
}
|
|
14431
14691
|
static getSettablePaths(_options = {}) {
|
|
14432
14692
|
return {
|
|
14433
|
-
relativeDirPath: (0,
|
|
14693
|
+
relativeDirPath: (0, import_node_path101.join)(".rovodev", "subagents")
|
|
14434
14694
|
};
|
|
14435
14695
|
}
|
|
14436
14696
|
getFrontmatter() {
|
|
@@ -14493,7 +14753,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
14493
14753
|
return {
|
|
14494
14754
|
success: false,
|
|
14495
14755
|
error: new Error(
|
|
14496
|
-
`Invalid frontmatter in ${(0,
|
|
14756
|
+
`Invalid frontmatter in ${(0, import_node_path101.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14497
14757
|
)
|
|
14498
14758
|
};
|
|
14499
14759
|
}
|
|
@@ -14510,7 +14770,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
14510
14770
|
global = false
|
|
14511
14771
|
}) {
|
|
14512
14772
|
const paths = this.getSettablePaths({ global });
|
|
14513
|
-
const filePath = (0,
|
|
14773
|
+
const filePath = (0, import_node_path101.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
14514
14774
|
const fileContent = await readFileContent(filePath);
|
|
14515
14775
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14516
14776
|
const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14549,19 +14809,19 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
14549
14809
|
};
|
|
14550
14810
|
|
|
14551
14811
|
// src/features/subagents/subagents-processor.ts
|
|
14552
|
-
var
|
|
14553
|
-
var
|
|
14812
|
+
var import_node_path112 = require("path");
|
|
14813
|
+
var import_mini64 = require("zod/mini");
|
|
14554
14814
|
|
|
14555
14815
|
// src/features/subagents/claudecode-subagent.ts
|
|
14556
|
-
var
|
|
14557
|
-
var
|
|
14558
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
14559
|
-
name:
|
|
14560
|
-
description:
|
|
14561
|
-
model:
|
|
14562
|
-
tools:
|
|
14563
|
-
permissionMode:
|
|
14564
|
-
skills:
|
|
14816
|
+
var import_node_path102 = require("path");
|
|
14817
|
+
var import_mini56 = require("zod/mini");
|
|
14818
|
+
var ClaudecodeSubagentFrontmatterSchema = import_mini56.z.looseObject({
|
|
14819
|
+
name: import_mini56.z.string(),
|
|
14820
|
+
description: import_mini56.z.optional(import_mini56.z.string()),
|
|
14821
|
+
model: import_mini56.z.optional(import_mini56.z.string()),
|
|
14822
|
+
tools: import_mini56.z.optional(import_mini56.z.union([import_mini56.z.string(), import_mini56.z.array(import_mini56.z.string())])),
|
|
14823
|
+
permissionMode: import_mini56.z.optional(import_mini56.z.string()),
|
|
14824
|
+
skills: import_mini56.z.optional(import_mini56.z.union([import_mini56.z.string(), import_mini56.z.array(import_mini56.z.string())]))
|
|
14565
14825
|
});
|
|
14566
14826
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
14567
14827
|
frontmatter;
|
|
@@ -14571,7 +14831,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
14571
14831
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14572
14832
|
if (!result.success) {
|
|
14573
14833
|
throw new Error(
|
|
14574
|
-
`Invalid frontmatter in ${(0,
|
|
14834
|
+
`Invalid frontmatter in ${(0, import_node_path102.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14575
14835
|
);
|
|
14576
14836
|
}
|
|
14577
14837
|
}
|
|
@@ -14583,7 +14843,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
14583
14843
|
}
|
|
14584
14844
|
static getSettablePaths(_options = {}) {
|
|
14585
14845
|
return {
|
|
14586
|
-
relativeDirPath: (0,
|
|
14846
|
+
relativeDirPath: (0, import_node_path102.join)(".claude", "agents")
|
|
14587
14847
|
};
|
|
14588
14848
|
}
|
|
14589
14849
|
getFrontmatter() {
|
|
@@ -14662,7 +14922,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
14662
14922
|
return {
|
|
14663
14923
|
success: false,
|
|
14664
14924
|
error: new Error(
|
|
14665
|
-
`Invalid frontmatter in ${(0,
|
|
14925
|
+
`Invalid frontmatter in ${(0, import_node_path102.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14666
14926
|
)
|
|
14667
14927
|
};
|
|
14668
14928
|
}
|
|
@@ -14680,7 +14940,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
14680
14940
|
global = false
|
|
14681
14941
|
}) {
|
|
14682
14942
|
const paths = this.getSettablePaths({ global });
|
|
14683
|
-
const filePath = (0,
|
|
14943
|
+
const filePath = (0, import_node_path102.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
14684
14944
|
const fileContent = await readFileContent(filePath);
|
|
14685
14945
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14686
14946
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14715,16 +14975,16 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
14715
14975
|
};
|
|
14716
14976
|
|
|
14717
14977
|
// src/features/subagents/codexcli-subagent.ts
|
|
14718
|
-
var
|
|
14978
|
+
var import_node_path103 = require("path");
|
|
14719
14979
|
var smolToml5 = __toESM(require("smol-toml"), 1);
|
|
14720
|
-
var
|
|
14721
|
-
var CodexCliSubagentTomlSchema =
|
|
14722
|
-
name:
|
|
14723
|
-
description:
|
|
14724
|
-
developer_instructions:
|
|
14725
|
-
model:
|
|
14726
|
-
model_reasoning_effort:
|
|
14727
|
-
sandbox_mode:
|
|
14980
|
+
var import_mini57 = require("zod/mini");
|
|
14981
|
+
var CodexCliSubagentTomlSchema = import_mini57.z.looseObject({
|
|
14982
|
+
name: import_mini57.z.string(),
|
|
14983
|
+
description: import_mini57.z.optional(import_mini57.z.string()),
|
|
14984
|
+
developer_instructions: import_mini57.z.optional(import_mini57.z.string()),
|
|
14985
|
+
model: import_mini57.z.optional(import_mini57.z.string()),
|
|
14986
|
+
model_reasoning_effort: import_mini57.z.optional(import_mini57.z.string()),
|
|
14987
|
+
sandbox_mode: import_mini57.z.optional(import_mini57.z.string())
|
|
14728
14988
|
});
|
|
14729
14989
|
var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
14730
14990
|
body;
|
|
@@ -14735,7 +14995,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
14735
14995
|
CodexCliSubagentTomlSchema.parse(parsed);
|
|
14736
14996
|
} catch (error) {
|
|
14737
14997
|
throw new Error(
|
|
14738
|
-
`Invalid TOML in ${(0,
|
|
14998
|
+
`Invalid TOML in ${(0, import_node_path103.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
14739
14999
|
{ cause: error }
|
|
14740
15000
|
);
|
|
14741
15001
|
}
|
|
@@ -14747,7 +15007,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
14747
15007
|
}
|
|
14748
15008
|
static getSettablePaths(_options = {}) {
|
|
14749
15009
|
return {
|
|
14750
|
-
relativeDirPath: (0,
|
|
15010
|
+
relativeDirPath: (0, import_node_path103.join)(".codex", "agents")
|
|
14751
15011
|
};
|
|
14752
15012
|
}
|
|
14753
15013
|
getBody() {
|
|
@@ -14759,7 +15019,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
14759
15019
|
parsed = CodexCliSubagentTomlSchema.parse(smolToml5.parse(this.body));
|
|
14760
15020
|
} catch (error) {
|
|
14761
15021
|
throw new Error(
|
|
14762
|
-
`Failed to parse TOML in ${(0,
|
|
15022
|
+
`Failed to parse TOML in ${(0, import_node_path103.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
14763
15023
|
{ cause: error }
|
|
14764
15024
|
);
|
|
14765
15025
|
}
|
|
@@ -14840,7 +15100,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
14840
15100
|
global = false
|
|
14841
15101
|
}) {
|
|
14842
15102
|
const paths = this.getSettablePaths({ global });
|
|
14843
|
-
const filePath = (0,
|
|
15103
|
+
const filePath = (0, import_node_path103.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
14844
15104
|
const fileContent = await readFileContent(filePath);
|
|
14845
15105
|
const subagent = new _CodexCliSubagent({
|
|
14846
15106
|
baseDir,
|
|
@@ -14878,13 +15138,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
14878
15138
|
};
|
|
14879
15139
|
|
|
14880
15140
|
// src/features/subagents/copilot-subagent.ts
|
|
14881
|
-
var
|
|
14882
|
-
var
|
|
15141
|
+
var import_node_path104 = require("path");
|
|
15142
|
+
var import_mini58 = require("zod/mini");
|
|
14883
15143
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
14884
|
-
var CopilotSubagentFrontmatterSchema =
|
|
14885
|
-
name:
|
|
14886
|
-
description:
|
|
14887
|
-
tools:
|
|
15144
|
+
var CopilotSubagentFrontmatterSchema = import_mini58.z.looseObject({
|
|
15145
|
+
name: import_mini58.z.string(),
|
|
15146
|
+
description: import_mini58.z.optional(import_mini58.z.string()),
|
|
15147
|
+
tools: import_mini58.z.optional(import_mini58.z.union([import_mini58.z.string(), import_mini58.z.array(import_mini58.z.string())]))
|
|
14888
15148
|
});
|
|
14889
15149
|
var normalizeTools = (tools) => {
|
|
14890
15150
|
if (!tools) {
|
|
@@ -14904,7 +15164,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
14904
15164
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14905
15165
|
if (!result.success) {
|
|
14906
15166
|
throw new Error(
|
|
14907
|
-
`Invalid frontmatter in ${(0,
|
|
15167
|
+
`Invalid frontmatter in ${(0, import_node_path104.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14908
15168
|
);
|
|
14909
15169
|
}
|
|
14910
15170
|
}
|
|
@@ -14916,7 +15176,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
14916
15176
|
}
|
|
14917
15177
|
static getSettablePaths(_options = {}) {
|
|
14918
15178
|
return {
|
|
14919
|
-
relativeDirPath: (0,
|
|
15179
|
+
relativeDirPath: (0, import_node_path104.join)(".github", "agents")
|
|
14920
15180
|
};
|
|
14921
15181
|
}
|
|
14922
15182
|
getFrontmatter() {
|
|
@@ -14994,7 +15254,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
14994
15254
|
return {
|
|
14995
15255
|
success: false,
|
|
14996
15256
|
error: new Error(
|
|
14997
|
-
`Invalid frontmatter in ${(0,
|
|
15257
|
+
`Invalid frontmatter in ${(0, import_node_path104.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14998
15258
|
)
|
|
14999
15259
|
};
|
|
15000
15260
|
}
|
|
@@ -15012,7 +15272,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
15012
15272
|
global = false
|
|
15013
15273
|
}) {
|
|
15014
15274
|
const paths = this.getSettablePaths({ global });
|
|
15015
|
-
const filePath = (0,
|
|
15275
|
+
const filePath = (0, import_node_path104.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15016
15276
|
const fileContent = await readFileContent(filePath);
|
|
15017
15277
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15018
15278
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15048,11 +15308,11 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
15048
15308
|
};
|
|
15049
15309
|
|
|
15050
15310
|
// src/features/subagents/cursor-subagent.ts
|
|
15051
|
-
var
|
|
15052
|
-
var
|
|
15053
|
-
var CursorSubagentFrontmatterSchema =
|
|
15054
|
-
name:
|
|
15055
|
-
description:
|
|
15311
|
+
var import_node_path105 = require("path");
|
|
15312
|
+
var import_mini59 = require("zod/mini");
|
|
15313
|
+
var CursorSubagentFrontmatterSchema = import_mini59.z.looseObject({
|
|
15314
|
+
name: import_mini59.z.string(),
|
|
15315
|
+
description: import_mini59.z.optional(import_mini59.z.string())
|
|
15056
15316
|
});
|
|
15057
15317
|
var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
15058
15318
|
frontmatter;
|
|
@@ -15062,7 +15322,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
15062
15322
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
15063
15323
|
if (!result.success) {
|
|
15064
15324
|
throw new Error(
|
|
15065
|
-
`Invalid frontmatter in ${(0,
|
|
15325
|
+
`Invalid frontmatter in ${(0, import_node_path105.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15066
15326
|
);
|
|
15067
15327
|
}
|
|
15068
15328
|
}
|
|
@@ -15074,7 +15334,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
15074
15334
|
}
|
|
15075
15335
|
static getSettablePaths(_options = {}) {
|
|
15076
15336
|
return {
|
|
15077
|
-
relativeDirPath: (0,
|
|
15337
|
+
relativeDirPath: (0, import_node_path105.join)(".cursor", "agents")
|
|
15078
15338
|
};
|
|
15079
15339
|
}
|
|
15080
15340
|
getFrontmatter() {
|
|
@@ -15141,7 +15401,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
15141
15401
|
return {
|
|
15142
15402
|
success: false,
|
|
15143
15403
|
error: new Error(
|
|
15144
|
-
`Invalid frontmatter in ${(0,
|
|
15404
|
+
`Invalid frontmatter in ${(0, import_node_path105.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15145
15405
|
)
|
|
15146
15406
|
};
|
|
15147
15407
|
}
|
|
@@ -15159,7 +15419,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
15159
15419
|
global = false
|
|
15160
15420
|
}) {
|
|
15161
15421
|
const paths = this.getSettablePaths({ global });
|
|
15162
|
-
const filePath = (0,
|
|
15422
|
+
const filePath = (0, import_node_path105.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15163
15423
|
const fileContent = await readFileContent(filePath);
|
|
15164
15424
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15165
15425
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15195,12 +15455,12 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
15195
15455
|
};
|
|
15196
15456
|
|
|
15197
15457
|
// src/features/subagents/deepagents-subagent.ts
|
|
15198
|
-
var
|
|
15199
|
-
var
|
|
15200
|
-
var DeepagentsSubagentFrontmatterSchema =
|
|
15201
|
-
name:
|
|
15202
|
-
description:
|
|
15203
|
-
model:
|
|
15458
|
+
var import_node_path106 = require("path");
|
|
15459
|
+
var import_mini60 = require("zod/mini");
|
|
15460
|
+
var DeepagentsSubagentFrontmatterSchema = import_mini60.z.looseObject({
|
|
15461
|
+
name: import_mini60.z.string(),
|
|
15462
|
+
description: import_mini60.z.optional(import_mini60.z.string()),
|
|
15463
|
+
model: import_mini60.z.optional(import_mini60.z.string())
|
|
15204
15464
|
});
|
|
15205
15465
|
var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
15206
15466
|
frontmatter;
|
|
@@ -15210,7 +15470,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
15210
15470
|
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
15211
15471
|
if (!result.success) {
|
|
15212
15472
|
throw new Error(
|
|
15213
|
-
`Invalid frontmatter in ${(0,
|
|
15473
|
+
`Invalid frontmatter in ${(0, import_node_path106.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15214
15474
|
);
|
|
15215
15475
|
}
|
|
15216
15476
|
}
|
|
@@ -15220,7 +15480,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
15220
15480
|
}
|
|
15221
15481
|
static getSettablePaths(_options = {}) {
|
|
15222
15482
|
return {
|
|
15223
|
-
relativeDirPath: (0,
|
|
15483
|
+
relativeDirPath: (0, import_node_path106.join)(".deepagents", "agents")
|
|
15224
15484
|
};
|
|
15225
15485
|
}
|
|
15226
15486
|
getFrontmatter() {
|
|
@@ -15295,7 +15555,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
15295
15555
|
return {
|
|
15296
15556
|
success: false,
|
|
15297
15557
|
error: new Error(
|
|
15298
|
-
`Invalid frontmatter in ${(0,
|
|
15558
|
+
`Invalid frontmatter in ${(0, import_node_path106.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15299
15559
|
)
|
|
15300
15560
|
};
|
|
15301
15561
|
}
|
|
@@ -15313,7 +15573,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
15313
15573
|
global = false
|
|
15314
15574
|
}) {
|
|
15315
15575
|
const paths = this.getSettablePaths({ global });
|
|
15316
|
-
const filePath = (0,
|
|
15576
|
+
const filePath = (0, import_node_path106.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15317
15577
|
const fileContent = await readFileContent(filePath);
|
|
15318
15578
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15319
15579
|
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15348,11 +15608,11 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
15348
15608
|
};
|
|
15349
15609
|
|
|
15350
15610
|
// src/features/subagents/junie-subagent.ts
|
|
15351
|
-
var
|
|
15352
|
-
var
|
|
15353
|
-
var JunieSubagentFrontmatterSchema =
|
|
15354
|
-
name:
|
|
15355
|
-
description:
|
|
15611
|
+
var import_node_path107 = require("path");
|
|
15612
|
+
var import_mini61 = require("zod/mini");
|
|
15613
|
+
var JunieSubagentFrontmatterSchema = import_mini61.z.looseObject({
|
|
15614
|
+
name: import_mini61.z.optional(import_mini61.z.string()),
|
|
15615
|
+
description: import_mini61.z.string()
|
|
15356
15616
|
});
|
|
15357
15617
|
var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
15358
15618
|
frontmatter;
|
|
@@ -15362,7 +15622,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
15362
15622
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
15363
15623
|
if (!result.success) {
|
|
15364
15624
|
throw new Error(
|
|
15365
|
-
`Invalid frontmatter in ${(0,
|
|
15625
|
+
`Invalid frontmatter in ${(0, import_node_path107.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15366
15626
|
);
|
|
15367
15627
|
}
|
|
15368
15628
|
}
|
|
@@ -15377,7 +15637,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
15377
15637
|
throw new Error("JunieSubagent does not support global mode.");
|
|
15378
15638
|
}
|
|
15379
15639
|
return {
|
|
15380
|
-
relativeDirPath: (0,
|
|
15640
|
+
relativeDirPath: (0, import_node_path107.join)(".junie", "agents")
|
|
15381
15641
|
};
|
|
15382
15642
|
}
|
|
15383
15643
|
getFrontmatter() {
|
|
@@ -15453,7 +15713,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
15453
15713
|
return {
|
|
15454
15714
|
success: false,
|
|
15455
15715
|
error: new Error(
|
|
15456
|
-
`Invalid frontmatter in ${(0,
|
|
15716
|
+
`Invalid frontmatter in ${(0, import_node_path107.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15457
15717
|
)
|
|
15458
15718
|
};
|
|
15459
15719
|
}
|
|
@@ -15471,7 +15731,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
15471
15731
|
global = false
|
|
15472
15732
|
}) {
|
|
15473
15733
|
const paths = this.getSettablePaths({ global });
|
|
15474
|
-
const filePath = (0,
|
|
15734
|
+
const filePath = (0, import_node_path107.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15475
15735
|
const fileContent = await readFileContent(filePath);
|
|
15476
15736
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15477
15737
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15506,15 +15766,15 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
15506
15766
|
};
|
|
15507
15767
|
|
|
15508
15768
|
// src/features/subagents/kilo-subagent.ts
|
|
15509
|
-
var
|
|
15769
|
+
var import_node_path109 = require("path");
|
|
15510
15770
|
|
|
15511
15771
|
// src/features/subagents/opencode-style-subagent.ts
|
|
15512
|
-
var
|
|
15513
|
-
var
|
|
15514
|
-
var OpenCodeStyleSubagentFrontmatterSchema =
|
|
15515
|
-
description:
|
|
15516
|
-
mode:
|
|
15517
|
-
name:
|
|
15772
|
+
var import_node_path108 = require("path");
|
|
15773
|
+
var import_mini62 = require("zod/mini");
|
|
15774
|
+
var OpenCodeStyleSubagentFrontmatterSchema = import_mini62.z.looseObject({
|
|
15775
|
+
description: import_mini62.z.optional(import_mini62.z.string()),
|
|
15776
|
+
mode: import_mini62.z._default(import_mini62.z.string(), "subagent"),
|
|
15777
|
+
name: import_mini62.z.optional(import_mini62.z.string())
|
|
15518
15778
|
});
|
|
15519
15779
|
var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
15520
15780
|
frontmatter;
|
|
@@ -15524,7 +15784,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
15524
15784
|
const result = OpenCodeStyleSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
15525
15785
|
if (!result.success) {
|
|
15526
15786
|
throw new Error(
|
|
15527
|
-
`Invalid frontmatter in ${(0,
|
|
15787
|
+
`Invalid frontmatter in ${(0, import_node_path108.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15528
15788
|
);
|
|
15529
15789
|
}
|
|
15530
15790
|
}
|
|
@@ -15544,7 +15804,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
15544
15804
|
const { description, mode, name, ...toolSection } = this.frontmatter;
|
|
15545
15805
|
const rulesyncFrontmatter = {
|
|
15546
15806
|
targets: ["*"],
|
|
15547
|
-
name: name ?? (0,
|
|
15807
|
+
name: name ?? (0, import_node_path108.basename)(this.getRelativeFilePath(), ".md"),
|
|
15548
15808
|
description,
|
|
15549
15809
|
[this.getToolTarget()]: { mode, ...toolSection }
|
|
15550
15810
|
};
|
|
@@ -15566,7 +15826,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
15566
15826
|
return {
|
|
15567
15827
|
success: false,
|
|
15568
15828
|
error: new Error(
|
|
15569
|
-
`Invalid frontmatter in ${(0,
|
|
15829
|
+
`Invalid frontmatter in ${(0, import_node_path108.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15570
15830
|
)
|
|
15571
15831
|
};
|
|
15572
15832
|
}
|
|
@@ -15582,7 +15842,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
15582
15842
|
global = false
|
|
15583
15843
|
} = {}) {
|
|
15584
15844
|
return {
|
|
15585
|
-
relativeDirPath: global ? (0,
|
|
15845
|
+
relativeDirPath: global ? (0, import_node_path109.join)(".config", "kilo", "agent") : (0, import_node_path109.join)(".kilo", "agent")
|
|
15586
15846
|
};
|
|
15587
15847
|
}
|
|
15588
15848
|
static fromRulesyncSubagent({
|
|
@@ -15626,7 +15886,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
15626
15886
|
global = false
|
|
15627
15887
|
}) {
|
|
15628
15888
|
const paths = this.getSettablePaths({ global });
|
|
15629
|
-
const filePath = (0,
|
|
15889
|
+
const filePath = (0, import_node_path109.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15630
15890
|
const fileContent = await readFileContent(filePath);
|
|
15631
15891
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15632
15892
|
const result = KiloSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15662,23 +15922,23 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
15662
15922
|
};
|
|
15663
15923
|
|
|
15664
15924
|
// src/features/subagents/kiro-subagent.ts
|
|
15665
|
-
var
|
|
15666
|
-
var
|
|
15667
|
-
var KiroCliSubagentJsonSchema =
|
|
15668
|
-
name:
|
|
15669
|
-
description:
|
|
15670
|
-
prompt:
|
|
15671
|
-
tools:
|
|
15672
|
-
toolAliases:
|
|
15673
|
-
toolSettings:
|
|
15674
|
-
toolSchema:
|
|
15675
|
-
hooks:
|
|
15676
|
-
model:
|
|
15677
|
-
mcpServers:
|
|
15678
|
-
useLegacyMcpJson:
|
|
15679
|
-
resources:
|
|
15680
|
-
allowedTools:
|
|
15681
|
-
includeMcpJson:
|
|
15925
|
+
var import_node_path110 = require("path");
|
|
15926
|
+
var import_mini63 = require("zod/mini");
|
|
15927
|
+
var KiroCliSubagentJsonSchema = import_mini63.z.looseObject({
|
|
15928
|
+
name: import_mini63.z.string(),
|
|
15929
|
+
description: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.string())),
|
|
15930
|
+
prompt: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.string())),
|
|
15931
|
+
tools: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.array(import_mini63.z.string()))),
|
|
15932
|
+
toolAliases: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.record(import_mini63.z.string(), import_mini63.z.string()))),
|
|
15933
|
+
toolSettings: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.unknown())),
|
|
15934
|
+
toolSchema: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.unknown())),
|
|
15935
|
+
hooks: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.record(import_mini63.z.string(), import_mini63.z.array(import_mini63.z.unknown())))),
|
|
15936
|
+
model: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.string())),
|
|
15937
|
+
mcpServers: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.record(import_mini63.z.string(), import_mini63.z.unknown()))),
|
|
15938
|
+
useLegacyMcpJson: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.boolean())),
|
|
15939
|
+
resources: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.array(import_mini63.z.string()))),
|
|
15940
|
+
allowedTools: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.array(import_mini63.z.string()))),
|
|
15941
|
+
includeMcpJson: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.boolean()))
|
|
15682
15942
|
});
|
|
15683
15943
|
var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
15684
15944
|
body;
|
|
@@ -15689,7 +15949,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
15689
15949
|
KiroCliSubagentJsonSchema.parse(parsed);
|
|
15690
15950
|
} catch (error) {
|
|
15691
15951
|
throw new Error(
|
|
15692
|
-
`Invalid JSON in ${(0,
|
|
15952
|
+
`Invalid JSON in ${(0, import_node_path110.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
15693
15953
|
{ cause: error }
|
|
15694
15954
|
);
|
|
15695
15955
|
}
|
|
@@ -15701,7 +15961,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
15701
15961
|
}
|
|
15702
15962
|
static getSettablePaths(_options = {}) {
|
|
15703
15963
|
return {
|
|
15704
|
-
relativeDirPath: (0,
|
|
15964
|
+
relativeDirPath: (0, import_node_path110.join)(".kiro", "agents")
|
|
15705
15965
|
};
|
|
15706
15966
|
}
|
|
15707
15967
|
getBody() {
|
|
@@ -15713,7 +15973,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
15713
15973
|
parsed = JSON.parse(this.body);
|
|
15714
15974
|
} catch (error) {
|
|
15715
15975
|
throw new Error(
|
|
15716
|
-
`Failed to parse JSON in ${(0,
|
|
15976
|
+
`Failed to parse JSON in ${(0, import_node_path110.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
15717
15977
|
{ cause: error }
|
|
15718
15978
|
);
|
|
15719
15979
|
}
|
|
@@ -15794,7 +16054,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
15794
16054
|
global = false
|
|
15795
16055
|
}) {
|
|
15796
16056
|
const paths = this.getSettablePaths({ global });
|
|
15797
|
-
const filePath = (0,
|
|
16057
|
+
const filePath = (0, import_node_path110.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15798
16058
|
const fileContent = await readFileContent(filePath);
|
|
15799
16059
|
const subagent = new _KiroSubagent({
|
|
15800
16060
|
baseDir,
|
|
@@ -15832,7 +16092,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
15832
16092
|
};
|
|
15833
16093
|
|
|
15834
16094
|
// src/features/subagents/opencode-subagent.ts
|
|
15835
|
-
var
|
|
16095
|
+
var import_node_path111 = require("path");
|
|
15836
16096
|
var OpenCodeSubagentFrontmatterSchema = OpenCodeStyleSubagentFrontmatterSchema;
|
|
15837
16097
|
var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
15838
16098
|
getToolTarget() {
|
|
@@ -15842,7 +16102,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
15842
16102
|
global = false
|
|
15843
16103
|
} = {}) {
|
|
15844
16104
|
return {
|
|
15845
|
-
relativeDirPath: global ? (0,
|
|
16105
|
+
relativeDirPath: global ? (0, import_node_path111.join)(".config", "opencode", "agent") : (0, import_node_path111.join)(".opencode", "agent")
|
|
15846
16106
|
};
|
|
15847
16107
|
}
|
|
15848
16108
|
static fromRulesyncSubagent({
|
|
@@ -15886,7 +16146,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
15886
16146
|
global = false
|
|
15887
16147
|
}) {
|
|
15888
16148
|
const paths = this.getSettablePaths({ global });
|
|
15889
|
-
const filePath = (0,
|
|
16149
|
+
const filePath = (0, import_node_path111.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15890
16150
|
const fileContent = await readFileContent(filePath);
|
|
15891
16151
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15892
16152
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15939,7 +16199,7 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
15939
16199
|
"roo",
|
|
15940
16200
|
"rovodev"
|
|
15941
16201
|
];
|
|
15942
|
-
var SubagentsProcessorToolTargetSchema =
|
|
16202
|
+
var SubagentsProcessorToolTargetSchema = import_mini64.z.enum(subagentsProcessorToolTargetTuple);
|
|
15943
16203
|
var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
15944
16204
|
[
|
|
15945
16205
|
"agentsmd",
|
|
@@ -16130,7 +16390,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
16130
16390
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
16131
16391
|
*/
|
|
16132
16392
|
async loadRulesyncFiles() {
|
|
16133
|
-
const subagentsDir = (0,
|
|
16393
|
+
const subagentsDir = (0, import_node_path112.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
16134
16394
|
const dirExists = await directoryExists(subagentsDir);
|
|
16135
16395
|
if (!dirExists) {
|
|
16136
16396
|
this.logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -16145,7 +16405,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
16145
16405
|
this.logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
16146
16406
|
const rulesyncSubagents = [];
|
|
16147
16407
|
for (const mdFile of mdFiles) {
|
|
16148
|
-
const filepath = (0,
|
|
16408
|
+
const filepath = (0, import_node_path112.join)(subagentsDir, mdFile);
|
|
16149
16409
|
try {
|
|
16150
16410
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
16151
16411
|
relativeFilePath: mdFile,
|
|
@@ -16175,14 +16435,14 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
16175
16435
|
const factory = this.getFactory(this.toolTarget);
|
|
16176
16436
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
16177
16437
|
const subagentFilePaths = await findFilesByGlobs(
|
|
16178
|
-
(0,
|
|
16438
|
+
(0, import_node_path112.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
|
|
16179
16439
|
);
|
|
16180
16440
|
if (forDeletion) {
|
|
16181
16441
|
const toolSubagents2 = subagentFilePaths.map(
|
|
16182
16442
|
(path3) => factory.class.forDeletion({
|
|
16183
16443
|
baseDir: this.baseDir,
|
|
16184
16444
|
relativeDirPath: paths.relativeDirPath,
|
|
16185
|
-
relativeFilePath: (0,
|
|
16445
|
+
relativeFilePath: (0, import_node_path112.basename)(path3),
|
|
16186
16446
|
global: this.global
|
|
16187
16447
|
})
|
|
16188
16448
|
).filter((subagent) => subagent.isDeletable());
|
|
@@ -16195,7 +16455,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
16195
16455
|
subagentFilePaths.map(
|
|
16196
16456
|
(path3) => factory.class.fromFile({
|
|
16197
16457
|
baseDir: this.baseDir,
|
|
16198
|
-
relativeFilePath: (0,
|
|
16458
|
+
relativeFilePath: (0, import_node_path112.basename)(path3),
|
|
16199
16459
|
global: this.global
|
|
16200
16460
|
})
|
|
16201
16461
|
)
|
|
@@ -16242,49 +16502,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
16242
16502
|
};
|
|
16243
16503
|
|
|
16244
16504
|
// src/features/rules/agentsmd-rule.ts
|
|
16245
|
-
var
|
|
16505
|
+
var import_node_path115 = require("path");
|
|
16246
16506
|
|
|
16247
16507
|
// src/features/rules/tool-rule.ts
|
|
16248
|
-
var
|
|
16508
|
+
var import_node_path114 = require("path");
|
|
16249
16509
|
|
|
16250
16510
|
// src/features/rules/rulesync-rule.ts
|
|
16251
|
-
var
|
|
16252
|
-
var
|
|
16253
|
-
var RulesyncRuleFrontmatterSchema =
|
|
16254
|
-
root:
|
|
16255
|
-
localRoot:
|
|
16256
|
-
targets:
|
|
16257
|
-
description:
|
|
16258
|
-
globs:
|
|
16259
|
-
agentsmd:
|
|
16260
|
-
|
|
16511
|
+
var import_node_path113 = require("path");
|
|
16512
|
+
var import_mini65 = require("zod/mini");
|
|
16513
|
+
var RulesyncRuleFrontmatterSchema = import_mini65.z.object({
|
|
16514
|
+
root: import_mini65.z.optional(import_mini65.z.boolean()),
|
|
16515
|
+
localRoot: import_mini65.z.optional(import_mini65.z.boolean()),
|
|
16516
|
+
targets: import_mini65.z._default(RulesyncTargetsSchema, ["*"]),
|
|
16517
|
+
description: import_mini65.z.optional(import_mini65.z.string()),
|
|
16518
|
+
globs: import_mini65.z.optional(import_mini65.z.array(import_mini65.z.string())),
|
|
16519
|
+
agentsmd: import_mini65.z.optional(
|
|
16520
|
+
import_mini65.z.looseObject({
|
|
16261
16521
|
// @example "path/to/subproject"
|
|
16262
|
-
subprojectPath:
|
|
16522
|
+
subprojectPath: import_mini65.z.optional(import_mini65.z.string())
|
|
16263
16523
|
})
|
|
16264
16524
|
),
|
|
16265
|
-
claudecode:
|
|
16266
|
-
|
|
16525
|
+
claudecode: import_mini65.z.optional(
|
|
16526
|
+
import_mini65.z.looseObject({
|
|
16267
16527
|
// Glob patterns for conditional rules (takes precedence over globs)
|
|
16268
16528
|
// @example ["src/**/*.ts", "tests/**/*.test.ts"]
|
|
16269
|
-
paths:
|
|
16529
|
+
paths: import_mini65.z.optional(import_mini65.z.array(import_mini65.z.string()))
|
|
16270
16530
|
})
|
|
16271
16531
|
),
|
|
16272
|
-
cursor:
|
|
16273
|
-
|
|
16274
|
-
alwaysApply:
|
|
16275
|
-
description:
|
|
16276
|
-
globs:
|
|
16532
|
+
cursor: import_mini65.z.optional(
|
|
16533
|
+
import_mini65.z.looseObject({
|
|
16534
|
+
alwaysApply: import_mini65.z.optional(import_mini65.z.boolean()),
|
|
16535
|
+
description: import_mini65.z.optional(import_mini65.z.string()),
|
|
16536
|
+
globs: import_mini65.z.optional(import_mini65.z.array(import_mini65.z.string()))
|
|
16277
16537
|
})
|
|
16278
16538
|
),
|
|
16279
|
-
copilot:
|
|
16280
|
-
|
|
16281
|
-
excludeAgent:
|
|
16539
|
+
copilot: import_mini65.z.optional(
|
|
16540
|
+
import_mini65.z.looseObject({
|
|
16541
|
+
excludeAgent: import_mini65.z.optional(import_mini65.z.union([import_mini65.z.literal("code-review"), import_mini65.z.literal("coding-agent")]))
|
|
16282
16542
|
})
|
|
16283
16543
|
),
|
|
16284
|
-
antigravity:
|
|
16285
|
-
|
|
16286
|
-
trigger:
|
|
16287
|
-
globs:
|
|
16544
|
+
antigravity: import_mini65.z.optional(
|
|
16545
|
+
import_mini65.z.looseObject({
|
|
16546
|
+
trigger: import_mini65.z.optional(import_mini65.z.string()),
|
|
16547
|
+
globs: import_mini65.z.optional(import_mini65.z.array(import_mini65.z.string()))
|
|
16288
16548
|
})
|
|
16289
16549
|
)
|
|
16290
16550
|
});
|
|
@@ -16295,7 +16555,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
16295
16555
|
const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
16296
16556
|
if (!parseResult.success && rest.validate !== false) {
|
|
16297
16557
|
throw new Error(
|
|
16298
|
-
`Invalid frontmatter in ${(0,
|
|
16558
|
+
`Invalid frontmatter in ${(0, import_node_path113.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
16299
16559
|
);
|
|
16300
16560
|
}
|
|
16301
16561
|
const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
|
|
@@ -16330,7 +16590,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
16330
16590
|
return {
|
|
16331
16591
|
success: false,
|
|
16332
16592
|
error: new Error(
|
|
16333
|
-
`Invalid frontmatter in ${(0,
|
|
16593
|
+
`Invalid frontmatter in ${(0, import_node_path113.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
16334
16594
|
)
|
|
16335
16595
|
};
|
|
16336
16596
|
}
|
|
@@ -16339,7 +16599,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
16339
16599
|
relativeFilePath,
|
|
16340
16600
|
validate = true
|
|
16341
16601
|
}) {
|
|
16342
|
-
const filePath = (0,
|
|
16602
|
+
const filePath = (0, import_node_path113.join)(
|
|
16343
16603
|
process.cwd(),
|
|
16344
16604
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
16345
16605
|
relativeFilePath
|
|
@@ -16438,7 +16698,7 @@ var ToolRule = class extends ToolFile {
|
|
|
16438
16698
|
rulesyncRule,
|
|
16439
16699
|
validate = true,
|
|
16440
16700
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
16441
|
-
nonRootPath = { relativeDirPath: (0,
|
|
16701
|
+
nonRootPath = { relativeDirPath: (0, import_node_path114.join)(".agents", "memories") }
|
|
16442
16702
|
}) {
|
|
16443
16703
|
const params = this.buildToolRuleParamsDefault({
|
|
16444
16704
|
baseDir,
|
|
@@ -16449,7 +16709,7 @@ var ToolRule = class extends ToolFile {
|
|
|
16449
16709
|
});
|
|
16450
16710
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
16451
16711
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
16452
|
-
params.relativeDirPath = (0,
|
|
16712
|
+
params.relativeDirPath = (0, import_node_path114.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
16453
16713
|
params.relativeFilePath = "AGENTS.md";
|
|
16454
16714
|
}
|
|
16455
16715
|
return params;
|
|
@@ -16498,7 +16758,7 @@ var ToolRule = class extends ToolFile {
|
|
|
16498
16758
|
}
|
|
16499
16759
|
};
|
|
16500
16760
|
function buildToolPath(toolDir, subDir, excludeToolDir) {
|
|
16501
|
-
return excludeToolDir ? subDir : (0,
|
|
16761
|
+
return excludeToolDir ? subDir : (0, import_node_path114.join)(toolDir, subDir);
|
|
16502
16762
|
}
|
|
16503
16763
|
|
|
16504
16764
|
// src/features/rules/agentsmd-rule.ts
|
|
@@ -16527,8 +16787,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
16527
16787
|
validate = true
|
|
16528
16788
|
}) {
|
|
16529
16789
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
16530
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
16531
|
-
const fileContent = await readFileContent((0,
|
|
16790
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path115.join)(".agents", "memories", relativeFilePath);
|
|
16791
|
+
const fileContent = await readFileContent((0, import_node_path115.join)(baseDir, relativePath));
|
|
16532
16792
|
return new _AgentsMdRule({
|
|
16533
16793
|
baseDir,
|
|
16534
16794
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -16583,21 +16843,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
16583
16843
|
};
|
|
16584
16844
|
|
|
16585
16845
|
// src/features/rules/antigravity-rule.ts
|
|
16586
|
-
var
|
|
16587
|
-
var
|
|
16588
|
-
var AntigravityRuleFrontmatterSchema =
|
|
16589
|
-
trigger:
|
|
16590
|
-
|
|
16591
|
-
|
|
16592
|
-
|
|
16593
|
-
|
|
16594
|
-
|
|
16595
|
-
|
|
16846
|
+
var import_node_path116 = require("path");
|
|
16847
|
+
var import_mini66 = require("zod/mini");
|
|
16848
|
+
var AntigravityRuleFrontmatterSchema = import_mini66.z.looseObject({
|
|
16849
|
+
trigger: import_mini66.z.optional(
|
|
16850
|
+
import_mini66.z.union([
|
|
16851
|
+
import_mini66.z.literal("always_on"),
|
|
16852
|
+
import_mini66.z.literal("glob"),
|
|
16853
|
+
import_mini66.z.literal("manual"),
|
|
16854
|
+
import_mini66.z.literal("model_decision"),
|
|
16855
|
+
import_mini66.z.string()
|
|
16596
16856
|
// accepts any string for forward compatibility
|
|
16597
16857
|
])
|
|
16598
16858
|
),
|
|
16599
|
-
globs:
|
|
16600
|
-
description:
|
|
16859
|
+
globs: import_mini66.z.optional(import_mini66.z.string()),
|
|
16860
|
+
description: import_mini66.z.optional(import_mini66.z.string())
|
|
16601
16861
|
});
|
|
16602
16862
|
function parseGlobsString(globs) {
|
|
16603
16863
|
if (!globs) {
|
|
@@ -16742,7 +17002,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
16742
17002
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
16743
17003
|
if (!result.success) {
|
|
16744
17004
|
throw new Error(
|
|
16745
|
-
`Invalid frontmatter in ${(0,
|
|
17005
|
+
`Invalid frontmatter in ${(0, import_node_path116.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
16746
17006
|
);
|
|
16747
17007
|
}
|
|
16748
17008
|
}
|
|
@@ -16766,7 +17026,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
16766
17026
|
relativeFilePath,
|
|
16767
17027
|
validate = true
|
|
16768
17028
|
}) {
|
|
16769
|
-
const filePath = (0,
|
|
17029
|
+
const filePath = (0, import_node_path116.join)(
|
|
16770
17030
|
baseDir,
|
|
16771
17031
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
16772
17032
|
relativeFilePath
|
|
@@ -16906,7 +17166,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
16906
17166
|
};
|
|
16907
17167
|
|
|
16908
17168
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
16909
|
-
var
|
|
17169
|
+
var import_node_path117 = require("path");
|
|
16910
17170
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
16911
17171
|
toRulesyncRule() {
|
|
16912
17172
|
const rulesyncFrontmatter = {
|
|
@@ -16966,8 +17226,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
16966
17226
|
}) {
|
|
16967
17227
|
const settablePaths = this.getSettablePaths();
|
|
16968
17228
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
16969
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0,
|
|
16970
|
-
const fileContent = await readFileContent((0,
|
|
17229
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path117.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17230
|
+
const fileContent = await readFileContent((0, import_node_path117.join)(baseDir, relativePath));
|
|
16971
17231
|
return new _AugmentcodeLegacyRule({
|
|
16972
17232
|
baseDir,
|
|
16973
17233
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -16996,7 +17256,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
16996
17256
|
};
|
|
16997
17257
|
|
|
16998
17258
|
// src/features/rules/augmentcode-rule.ts
|
|
16999
|
-
var
|
|
17259
|
+
var import_node_path118 = require("path");
|
|
17000
17260
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
17001
17261
|
toRulesyncRule() {
|
|
17002
17262
|
return this.toRulesyncRuleDefault();
|
|
@@ -17027,7 +17287,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
17027
17287
|
relativeFilePath,
|
|
17028
17288
|
validate = true
|
|
17029
17289
|
}) {
|
|
17030
|
-
const filePath = (0,
|
|
17290
|
+
const filePath = (0, import_node_path118.join)(
|
|
17031
17291
|
baseDir,
|
|
17032
17292
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
17033
17293
|
relativeFilePath
|
|
@@ -17067,7 +17327,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
17067
17327
|
};
|
|
17068
17328
|
|
|
17069
17329
|
// src/features/rules/claudecode-legacy-rule.ts
|
|
17070
|
-
var
|
|
17330
|
+
var import_node_path119 = require("path");
|
|
17071
17331
|
var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
17072
17332
|
static getSettablePaths({
|
|
17073
17333
|
global,
|
|
@@ -17109,7 +17369,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
17109
17369
|
if (isRoot) {
|
|
17110
17370
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
17111
17371
|
const fileContent2 = await readFileContent(
|
|
17112
|
-
(0,
|
|
17372
|
+
(0, import_node_path119.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
|
|
17113
17373
|
);
|
|
17114
17374
|
return new _ClaudecodeLegacyRule({
|
|
17115
17375
|
baseDir,
|
|
@@ -17123,8 +17383,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
17123
17383
|
if (!paths.nonRoot) {
|
|
17124
17384
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
17125
17385
|
}
|
|
17126
|
-
const relativePath = (0,
|
|
17127
|
-
const fileContent = await readFileContent((0,
|
|
17386
|
+
const relativePath = (0, import_node_path119.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17387
|
+
const fileContent = await readFileContent((0, import_node_path119.join)(baseDir, relativePath));
|
|
17128
17388
|
return new _ClaudecodeLegacyRule({
|
|
17129
17389
|
baseDir,
|
|
17130
17390
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -17183,10 +17443,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
17183
17443
|
};
|
|
17184
17444
|
|
|
17185
17445
|
// src/features/rules/claudecode-rule.ts
|
|
17186
|
-
var
|
|
17187
|
-
var
|
|
17188
|
-
var ClaudecodeRuleFrontmatterSchema =
|
|
17189
|
-
paths:
|
|
17446
|
+
var import_node_path120 = require("path");
|
|
17447
|
+
var import_mini67 = require("zod/mini");
|
|
17448
|
+
var ClaudecodeRuleFrontmatterSchema = import_mini67.z.object({
|
|
17449
|
+
paths: import_mini67.z.optional(import_mini67.z.array(import_mini67.z.string()))
|
|
17190
17450
|
});
|
|
17191
17451
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
17192
17452
|
frontmatter;
|
|
@@ -17224,7 +17484,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
17224
17484
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
17225
17485
|
if (!result.success) {
|
|
17226
17486
|
throw new Error(
|
|
17227
|
-
`Invalid frontmatter in ${(0,
|
|
17487
|
+
`Invalid frontmatter in ${(0, import_node_path120.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
17228
17488
|
);
|
|
17229
17489
|
}
|
|
17230
17490
|
}
|
|
@@ -17254,7 +17514,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
17254
17514
|
if (isRoot) {
|
|
17255
17515
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
17256
17516
|
const fileContent2 = await readFileContent(
|
|
17257
|
-
(0,
|
|
17517
|
+
(0, import_node_path120.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
|
|
17258
17518
|
);
|
|
17259
17519
|
return new _ClaudecodeRule({
|
|
17260
17520
|
baseDir,
|
|
@@ -17269,8 +17529,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
17269
17529
|
if (!paths.nonRoot) {
|
|
17270
17530
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
17271
17531
|
}
|
|
17272
|
-
const relativePath = (0,
|
|
17273
|
-
const filePath = (0,
|
|
17532
|
+
const relativePath = (0, import_node_path120.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17533
|
+
const filePath = (0, import_node_path120.join)(baseDir, relativePath);
|
|
17274
17534
|
const fileContent = await readFileContent(filePath);
|
|
17275
17535
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
17276
17536
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -17381,7 +17641,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
17381
17641
|
return {
|
|
17382
17642
|
success: false,
|
|
17383
17643
|
error: new Error(
|
|
17384
|
-
`Invalid frontmatter in ${(0,
|
|
17644
|
+
`Invalid frontmatter in ${(0, import_node_path120.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
17385
17645
|
)
|
|
17386
17646
|
};
|
|
17387
17647
|
}
|
|
@@ -17401,10 +17661,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
17401
17661
|
};
|
|
17402
17662
|
|
|
17403
17663
|
// src/features/rules/cline-rule.ts
|
|
17404
|
-
var
|
|
17405
|
-
var
|
|
17406
|
-
var ClineRuleFrontmatterSchema =
|
|
17407
|
-
description:
|
|
17664
|
+
var import_node_path121 = require("path");
|
|
17665
|
+
var import_mini68 = require("zod/mini");
|
|
17666
|
+
var ClineRuleFrontmatterSchema = import_mini68.z.object({
|
|
17667
|
+
description: import_mini68.z.string()
|
|
17408
17668
|
});
|
|
17409
17669
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
17410
17670
|
static getSettablePaths(_options = {}) {
|
|
@@ -17447,7 +17707,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
17447
17707
|
validate = true
|
|
17448
17708
|
}) {
|
|
17449
17709
|
const fileContent = await readFileContent(
|
|
17450
|
-
(0,
|
|
17710
|
+
(0, import_node_path121.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
17451
17711
|
);
|
|
17452
17712
|
return new _ClineRule({
|
|
17453
17713
|
baseDir,
|
|
@@ -17473,7 +17733,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
17473
17733
|
};
|
|
17474
17734
|
|
|
17475
17735
|
// src/features/rules/codexcli-rule.ts
|
|
17476
|
-
var
|
|
17736
|
+
var import_node_path122 = require("path");
|
|
17477
17737
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
17478
17738
|
static getSettablePaths({
|
|
17479
17739
|
global,
|
|
@@ -17508,7 +17768,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
17508
17768
|
if (isRoot) {
|
|
17509
17769
|
const relativePath2 = paths.root.relativeFilePath;
|
|
17510
17770
|
const fileContent2 = await readFileContent(
|
|
17511
|
-
(0,
|
|
17771
|
+
(0, import_node_path122.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
17512
17772
|
);
|
|
17513
17773
|
return new _CodexcliRule({
|
|
17514
17774
|
baseDir,
|
|
@@ -17522,8 +17782,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
17522
17782
|
if (!paths.nonRoot) {
|
|
17523
17783
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
17524
17784
|
}
|
|
17525
|
-
const relativePath = (0,
|
|
17526
|
-
const fileContent = await readFileContent((0,
|
|
17785
|
+
const relativePath = (0, import_node_path122.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17786
|
+
const fileContent = await readFileContent((0, import_node_path122.join)(baseDir, relativePath));
|
|
17527
17787
|
return new _CodexcliRule({
|
|
17528
17788
|
baseDir,
|
|
17529
17789
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -17582,12 +17842,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
17582
17842
|
};
|
|
17583
17843
|
|
|
17584
17844
|
// src/features/rules/copilot-rule.ts
|
|
17585
|
-
var
|
|
17586
|
-
var
|
|
17587
|
-
var CopilotRuleFrontmatterSchema =
|
|
17588
|
-
description:
|
|
17589
|
-
applyTo:
|
|
17590
|
-
excludeAgent:
|
|
17845
|
+
var import_node_path123 = require("path");
|
|
17846
|
+
var import_mini69 = require("zod/mini");
|
|
17847
|
+
var CopilotRuleFrontmatterSchema = import_mini69.z.object({
|
|
17848
|
+
description: import_mini69.z.optional(import_mini69.z.string()),
|
|
17849
|
+
applyTo: import_mini69.z.optional(import_mini69.z.string()),
|
|
17850
|
+
excludeAgent: import_mini69.z.optional(import_mini69.z.union([import_mini69.z.literal("code-review"), import_mini69.z.literal("coding-agent")]))
|
|
17591
17851
|
});
|
|
17592
17852
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
17593
17853
|
frontmatter;
|
|
@@ -17619,7 +17879,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
17619
17879
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
17620
17880
|
if (!result.success) {
|
|
17621
17881
|
throw new Error(
|
|
17622
|
-
`Invalid frontmatter in ${(0,
|
|
17882
|
+
`Invalid frontmatter in ${(0, import_node_path123.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
17623
17883
|
);
|
|
17624
17884
|
}
|
|
17625
17885
|
}
|
|
@@ -17709,8 +17969,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
17709
17969
|
const paths = this.getSettablePaths({ global });
|
|
17710
17970
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
17711
17971
|
if (isRoot) {
|
|
17712
|
-
const relativePath2 = (0,
|
|
17713
|
-
const filePath2 = (0,
|
|
17972
|
+
const relativePath2 = (0, import_node_path123.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
17973
|
+
const filePath2 = (0, import_node_path123.join)(baseDir, relativePath2);
|
|
17714
17974
|
const fileContent2 = await readFileContent(filePath2);
|
|
17715
17975
|
return new _CopilotRule({
|
|
17716
17976
|
baseDir,
|
|
@@ -17725,8 +17985,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
17725
17985
|
if (!paths.nonRoot) {
|
|
17726
17986
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
17727
17987
|
}
|
|
17728
|
-
const relativePath = (0,
|
|
17729
|
-
const filePath = (0,
|
|
17988
|
+
const relativePath = (0, import_node_path123.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17989
|
+
const filePath = (0, import_node_path123.join)(baseDir, relativePath);
|
|
17730
17990
|
const fileContent = await readFileContent(filePath);
|
|
17731
17991
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
17732
17992
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -17772,7 +18032,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
17772
18032
|
return {
|
|
17773
18033
|
success: false,
|
|
17774
18034
|
error: new Error(
|
|
17775
|
-
`Invalid frontmatter in ${(0,
|
|
18035
|
+
`Invalid frontmatter in ${(0, import_node_path123.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
17776
18036
|
)
|
|
17777
18037
|
};
|
|
17778
18038
|
}
|
|
@@ -17828,12 +18088,12 @@ var CopilotcliRule = class _CopilotcliRule extends CopilotRule {
|
|
|
17828
18088
|
};
|
|
17829
18089
|
|
|
17830
18090
|
// src/features/rules/cursor-rule.ts
|
|
17831
|
-
var
|
|
17832
|
-
var
|
|
17833
|
-
var CursorRuleFrontmatterSchema =
|
|
17834
|
-
description:
|
|
17835
|
-
globs:
|
|
17836
|
-
alwaysApply:
|
|
18091
|
+
var import_node_path124 = require("path");
|
|
18092
|
+
var import_mini70 = require("zod/mini");
|
|
18093
|
+
var CursorRuleFrontmatterSchema = import_mini70.z.object({
|
|
18094
|
+
description: import_mini70.z.optional(import_mini70.z.string()),
|
|
18095
|
+
globs: import_mini70.z.optional(import_mini70.z.string()),
|
|
18096
|
+
alwaysApply: import_mini70.z.optional(import_mini70.z.boolean())
|
|
17837
18097
|
});
|
|
17838
18098
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
17839
18099
|
frontmatter;
|
|
@@ -17850,7 +18110,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
17850
18110
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
17851
18111
|
if (!result.success) {
|
|
17852
18112
|
throw new Error(
|
|
17853
|
-
`Invalid frontmatter in ${(0,
|
|
18113
|
+
`Invalid frontmatter in ${(0, import_node_path124.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
17854
18114
|
);
|
|
17855
18115
|
}
|
|
17856
18116
|
}
|
|
@@ -17966,7 +18226,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
17966
18226
|
relativeFilePath,
|
|
17967
18227
|
validate = true
|
|
17968
18228
|
}) {
|
|
17969
|
-
const filePath = (0,
|
|
18229
|
+
const filePath = (0, import_node_path124.join)(
|
|
17970
18230
|
baseDir,
|
|
17971
18231
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
17972
18232
|
relativeFilePath
|
|
@@ -17976,7 +18236,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
17976
18236
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
17977
18237
|
if (!result.success) {
|
|
17978
18238
|
throw new Error(
|
|
17979
|
-
`Invalid frontmatter in ${(0,
|
|
18239
|
+
`Invalid frontmatter in ${(0, import_node_path124.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
17980
18240
|
);
|
|
17981
18241
|
}
|
|
17982
18242
|
return new _CursorRule({
|
|
@@ -18013,7 +18273,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
18013
18273
|
return {
|
|
18014
18274
|
success: false,
|
|
18015
18275
|
error: new Error(
|
|
18016
|
-
`Invalid frontmatter in ${(0,
|
|
18276
|
+
`Invalid frontmatter in ${(0, import_node_path124.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
18017
18277
|
)
|
|
18018
18278
|
};
|
|
18019
18279
|
}
|
|
@@ -18033,7 +18293,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
18033
18293
|
};
|
|
18034
18294
|
|
|
18035
18295
|
// src/features/rules/deepagents-rule.ts
|
|
18036
|
-
var
|
|
18296
|
+
var import_node_path125 = require("path");
|
|
18037
18297
|
var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
18038
18298
|
constructor({ fileContent, root, ...rest }) {
|
|
18039
18299
|
super({
|
|
@@ -18060,8 +18320,8 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
18060
18320
|
}) {
|
|
18061
18321
|
const settablePaths = this.getSettablePaths();
|
|
18062
18322
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
18063
|
-
const relativePath = isRoot ? (0,
|
|
18064
|
-
const fileContent = await readFileContent((0,
|
|
18323
|
+
const relativePath = isRoot ? (0, import_node_path125.join)(".deepagents", "AGENTS.md") : (0, import_node_path125.join)(".deepagents", "memories", relativeFilePath);
|
|
18324
|
+
const fileContent = await readFileContent((0, import_node_path125.join)(baseDir, relativePath));
|
|
18065
18325
|
return new _DeepagentsRule({
|
|
18066
18326
|
baseDir,
|
|
18067
18327
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -18116,7 +18376,7 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
18116
18376
|
};
|
|
18117
18377
|
|
|
18118
18378
|
// src/features/rules/factorydroid-rule.ts
|
|
18119
|
-
var
|
|
18379
|
+
var import_node_path126 = require("path");
|
|
18120
18380
|
var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
18121
18381
|
constructor({ fileContent, root, ...rest }) {
|
|
18122
18382
|
super({
|
|
@@ -18156,8 +18416,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
18156
18416
|
const paths = this.getSettablePaths({ global });
|
|
18157
18417
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
18158
18418
|
if (isRoot) {
|
|
18159
|
-
const relativePath2 = (0,
|
|
18160
|
-
const fileContent2 = await readFileContent((0,
|
|
18419
|
+
const relativePath2 = (0, import_node_path126.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
18420
|
+
const fileContent2 = await readFileContent((0, import_node_path126.join)(baseDir, relativePath2));
|
|
18161
18421
|
return new _FactorydroidRule({
|
|
18162
18422
|
baseDir,
|
|
18163
18423
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -18170,8 +18430,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
18170
18430
|
if (!paths.nonRoot) {
|
|
18171
18431
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18172
18432
|
}
|
|
18173
|
-
const relativePath = (0,
|
|
18174
|
-
const fileContent = await readFileContent((0,
|
|
18433
|
+
const relativePath = (0, import_node_path126.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18434
|
+
const fileContent = await readFileContent((0, import_node_path126.join)(baseDir, relativePath));
|
|
18175
18435
|
return new _FactorydroidRule({
|
|
18176
18436
|
baseDir,
|
|
18177
18437
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18230,7 +18490,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
18230
18490
|
};
|
|
18231
18491
|
|
|
18232
18492
|
// src/features/rules/geminicli-rule.ts
|
|
18233
|
-
var
|
|
18493
|
+
var import_node_path127 = require("path");
|
|
18234
18494
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
18235
18495
|
static getSettablePaths({
|
|
18236
18496
|
global,
|
|
@@ -18265,7 +18525,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
18265
18525
|
if (isRoot) {
|
|
18266
18526
|
const relativePath2 = paths.root.relativeFilePath;
|
|
18267
18527
|
const fileContent2 = await readFileContent(
|
|
18268
|
-
(0,
|
|
18528
|
+
(0, import_node_path127.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
18269
18529
|
);
|
|
18270
18530
|
return new _GeminiCliRule({
|
|
18271
18531
|
baseDir,
|
|
@@ -18279,8 +18539,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
18279
18539
|
if (!paths.nonRoot) {
|
|
18280
18540
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18281
18541
|
}
|
|
18282
|
-
const relativePath = (0,
|
|
18283
|
-
const fileContent = await readFileContent((0,
|
|
18542
|
+
const relativePath = (0, import_node_path127.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18543
|
+
const fileContent = await readFileContent((0, import_node_path127.join)(baseDir, relativePath));
|
|
18284
18544
|
return new _GeminiCliRule({
|
|
18285
18545
|
baseDir,
|
|
18286
18546
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18339,7 +18599,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
18339
18599
|
};
|
|
18340
18600
|
|
|
18341
18601
|
// src/features/rules/goose-rule.ts
|
|
18342
|
-
var
|
|
18602
|
+
var import_node_path128 = require("path");
|
|
18343
18603
|
var GooseRule = class _GooseRule extends ToolRule {
|
|
18344
18604
|
static getSettablePaths({
|
|
18345
18605
|
global,
|
|
@@ -18374,7 +18634,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
18374
18634
|
if (isRoot) {
|
|
18375
18635
|
const relativePath2 = paths.root.relativeFilePath;
|
|
18376
18636
|
const fileContent2 = await readFileContent(
|
|
18377
|
-
(0,
|
|
18637
|
+
(0, import_node_path128.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
18378
18638
|
);
|
|
18379
18639
|
return new _GooseRule({
|
|
18380
18640
|
baseDir,
|
|
@@ -18388,8 +18648,8 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
18388
18648
|
if (!paths.nonRoot) {
|
|
18389
18649
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18390
18650
|
}
|
|
18391
|
-
const relativePath = (0,
|
|
18392
|
-
const fileContent = await readFileContent((0,
|
|
18651
|
+
const relativePath = (0, import_node_path128.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18652
|
+
const fileContent = await readFileContent((0, import_node_path128.join)(baseDir, relativePath));
|
|
18393
18653
|
return new _GooseRule({
|
|
18394
18654
|
baseDir,
|
|
18395
18655
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18448,7 +18708,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
18448
18708
|
};
|
|
18449
18709
|
|
|
18450
18710
|
// src/features/rules/junie-rule.ts
|
|
18451
|
-
var
|
|
18711
|
+
var import_node_path129 = require("path");
|
|
18452
18712
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
18453
18713
|
static getSettablePaths(_options = {}) {
|
|
18454
18714
|
return {
|
|
@@ -18477,8 +18737,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
18477
18737
|
}) {
|
|
18478
18738
|
const isRoot = _JunieRule.isRootRelativeFilePath(relativeFilePath);
|
|
18479
18739
|
const settablePaths = this.getSettablePaths();
|
|
18480
|
-
const relativePath = isRoot ? (0,
|
|
18481
|
-
const fileContent = await readFileContent((0,
|
|
18740
|
+
const relativePath = isRoot ? (0, import_node_path129.join)(settablePaths.root.relativeDirPath, settablePaths.root.relativeFilePath) : (0, import_node_path129.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18741
|
+
const fileContent = await readFileContent((0, import_node_path129.join)(baseDir, relativePath));
|
|
18482
18742
|
return new _JunieRule({
|
|
18483
18743
|
baseDir,
|
|
18484
18744
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -18533,7 +18793,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
18533
18793
|
};
|
|
18534
18794
|
|
|
18535
18795
|
// src/features/rules/kilo-rule.ts
|
|
18536
|
-
var
|
|
18796
|
+
var import_node_path130 = require("path");
|
|
18537
18797
|
var KiloRule = class _KiloRule extends ToolRule {
|
|
18538
18798
|
static getSettablePaths({
|
|
18539
18799
|
global,
|
|
@@ -18568,7 +18828,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
18568
18828
|
if (isRoot) {
|
|
18569
18829
|
const relativePath2 = paths.root.relativeFilePath;
|
|
18570
18830
|
const fileContent2 = await readFileContent(
|
|
18571
|
-
(0,
|
|
18831
|
+
(0, import_node_path130.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
18572
18832
|
);
|
|
18573
18833
|
return new _KiloRule({
|
|
18574
18834
|
baseDir,
|
|
@@ -18582,8 +18842,8 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
18582
18842
|
if (!paths.nonRoot) {
|
|
18583
18843
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18584
18844
|
}
|
|
18585
|
-
const relativePath = (0,
|
|
18586
|
-
const fileContent = await readFileContent((0,
|
|
18845
|
+
const relativePath = (0, import_node_path130.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18846
|
+
const fileContent = await readFileContent((0, import_node_path130.join)(baseDir, relativePath));
|
|
18587
18847
|
return new _KiloRule({
|
|
18588
18848
|
baseDir,
|
|
18589
18849
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18642,7 +18902,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
18642
18902
|
};
|
|
18643
18903
|
|
|
18644
18904
|
// src/features/rules/kiro-rule.ts
|
|
18645
|
-
var
|
|
18905
|
+
var import_node_path131 = require("path");
|
|
18646
18906
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
18647
18907
|
static getSettablePaths(_options = {}) {
|
|
18648
18908
|
return {
|
|
@@ -18657,7 +18917,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
18657
18917
|
validate = true
|
|
18658
18918
|
}) {
|
|
18659
18919
|
const fileContent = await readFileContent(
|
|
18660
|
-
(0,
|
|
18920
|
+
(0, import_node_path131.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
18661
18921
|
);
|
|
18662
18922
|
return new _KiroRule({
|
|
18663
18923
|
baseDir,
|
|
@@ -18711,7 +18971,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
18711
18971
|
};
|
|
18712
18972
|
|
|
18713
18973
|
// src/features/rules/opencode-rule.ts
|
|
18714
|
-
var
|
|
18974
|
+
var import_node_path132 = require("path");
|
|
18715
18975
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
18716
18976
|
static getSettablePaths({
|
|
18717
18977
|
global,
|
|
@@ -18746,7 +19006,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
18746
19006
|
if (isRoot) {
|
|
18747
19007
|
const relativePath2 = paths.root.relativeFilePath;
|
|
18748
19008
|
const fileContent2 = await readFileContent(
|
|
18749
|
-
(0,
|
|
19009
|
+
(0, import_node_path132.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
18750
19010
|
);
|
|
18751
19011
|
return new _OpenCodeRule({
|
|
18752
19012
|
baseDir,
|
|
@@ -18760,8 +19020,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
18760
19020
|
if (!paths.nonRoot) {
|
|
18761
19021
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18762
19022
|
}
|
|
18763
|
-
const relativePath = (0,
|
|
18764
|
-
const fileContent = await readFileContent((0,
|
|
19023
|
+
const relativePath = (0, import_node_path132.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
19024
|
+
const fileContent = await readFileContent((0, import_node_path132.join)(baseDir, relativePath));
|
|
18765
19025
|
return new _OpenCodeRule({
|
|
18766
19026
|
baseDir,
|
|
18767
19027
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18820,7 +19080,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
18820
19080
|
};
|
|
18821
19081
|
|
|
18822
19082
|
// src/features/rules/qwencode-rule.ts
|
|
18823
|
-
var
|
|
19083
|
+
var import_node_path133 = require("path");
|
|
18824
19084
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
18825
19085
|
static getSettablePaths(_options = {}) {
|
|
18826
19086
|
return {
|
|
@@ -18839,8 +19099,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
18839
19099
|
validate = true
|
|
18840
19100
|
}) {
|
|
18841
19101
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
18842
|
-
const relativePath = isRoot ? "QWEN.md" : (0,
|
|
18843
|
-
const fileContent = await readFileContent((0,
|
|
19102
|
+
const relativePath = isRoot ? "QWEN.md" : (0, import_node_path133.join)(".qwen", "memories", relativeFilePath);
|
|
19103
|
+
const fileContent = await readFileContent((0, import_node_path133.join)(baseDir, relativePath));
|
|
18844
19104
|
return new _QwencodeRule({
|
|
18845
19105
|
baseDir,
|
|
18846
19106
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -18892,7 +19152,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
18892
19152
|
};
|
|
18893
19153
|
|
|
18894
19154
|
// src/features/rules/replit-rule.ts
|
|
18895
|
-
var
|
|
19155
|
+
var import_node_path134 = require("path");
|
|
18896
19156
|
var ReplitRule = class _ReplitRule extends ToolRule {
|
|
18897
19157
|
static getSettablePaths(_options = {}) {
|
|
18898
19158
|
return {
|
|
@@ -18914,7 +19174,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
18914
19174
|
}
|
|
18915
19175
|
const relativePath = paths.root.relativeFilePath;
|
|
18916
19176
|
const fileContent = await readFileContent(
|
|
18917
|
-
(0,
|
|
19177
|
+
(0, import_node_path134.join)(baseDir, paths.root.relativeDirPath, relativePath)
|
|
18918
19178
|
);
|
|
18919
19179
|
return new _ReplitRule({
|
|
18920
19180
|
baseDir,
|
|
@@ -18980,7 +19240,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
18980
19240
|
};
|
|
18981
19241
|
|
|
18982
19242
|
// src/features/rules/roo-rule.ts
|
|
18983
|
-
var
|
|
19243
|
+
var import_node_path135 = require("path");
|
|
18984
19244
|
var RooRule = class _RooRule extends ToolRule {
|
|
18985
19245
|
static getSettablePaths(_options = {}) {
|
|
18986
19246
|
return {
|
|
@@ -18995,7 +19255,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
18995
19255
|
validate = true
|
|
18996
19256
|
}) {
|
|
18997
19257
|
const fileContent = await readFileContent(
|
|
18998
|
-
(0,
|
|
19258
|
+
(0, import_node_path135.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
18999
19259
|
);
|
|
19000
19260
|
return new _RooRule({
|
|
19001
19261
|
baseDir,
|
|
@@ -19064,7 +19324,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
19064
19324
|
};
|
|
19065
19325
|
|
|
19066
19326
|
// src/features/rules/rovodev-rule.ts
|
|
19067
|
-
var
|
|
19327
|
+
var import_node_path136 = require("path");
|
|
19068
19328
|
var DISALLOWED_ROVODEV_MODULAR_RULE_BASENAMES = /* @__PURE__ */ new Set(["agents.md", "agents.local.md"]);
|
|
19069
19329
|
var RovodevRule = class _RovodevRule extends ToolRule {
|
|
19070
19330
|
/**
|
|
@@ -19108,7 +19368,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
19108
19368
|
root: rovodevAgents,
|
|
19109
19369
|
alternativeRoots: [{ relativeDirPath: ".", relativeFilePath: "AGENTS.md" }],
|
|
19110
19370
|
nonRoot: {
|
|
19111
|
-
relativeDirPath: (0,
|
|
19371
|
+
relativeDirPath: (0, import_node_path136.join)(".rovodev", ".rulesync", "modular-rules")
|
|
19112
19372
|
}
|
|
19113
19373
|
};
|
|
19114
19374
|
}
|
|
@@ -19147,10 +19407,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
19147
19407
|
}) {
|
|
19148
19408
|
if (!this.isAllowedModularRulesRelativePath(relativeFilePath)) {
|
|
19149
19409
|
throw new Error(
|
|
19150
|
-
`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${(0,
|
|
19410
|
+
`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${(0, import_node_path136.join)(relativeDirPath, relativeFilePath)}`
|
|
19151
19411
|
);
|
|
19152
19412
|
}
|
|
19153
|
-
const fileContent = await readFileContent((0,
|
|
19413
|
+
const fileContent = await readFileContent((0, import_node_path136.join)(baseDir, relativeDirPath, relativeFilePath));
|
|
19154
19414
|
return new _RovodevRule({
|
|
19155
19415
|
baseDir,
|
|
19156
19416
|
relativeDirPath,
|
|
@@ -19170,10 +19430,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
19170
19430
|
paths
|
|
19171
19431
|
}) {
|
|
19172
19432
|
const relativeDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
19173
|
-
const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${(0,
|
|
19433
|
+
const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${(0, import_node_path136.join)(paths.root.relativeDirPath, paths.root.relativeFilePath)} or project root` : (0, import_node_path136.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
19174
19434
|
if (relativeFilePath !== "AGENTS.md") {
|
|
19175
19435
|
throw new Error(
|
|
19176
|
-
`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${(0,
|
|
19436
|
+
`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${(0, import_node_path136.join)(relativeDirPath, relativeFilePath)}`
|
|
19177
19437
|
);
|
|
19178
19438
|
}
|
|
19179
19439
|
const allowed = relativeDirPath === paths.root.relativeDirPath || "alternativeRoots" in paths && paths.alternativeRoots?.some(
|
|
@@ -19181,10 +19441,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
19181
19441
|
);
|
|
19182
19442
|
if (!allowed) {
|
|
19183
19443
|
throw new Error(
|
|
19184
|
-
`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${(0,
|
|
19444
|
+
`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${(0, import_node_path136.join)(relativeDirPath, relativeFilePath)}`
|
|
19185
19445
|
);
|
|
19186
19446
|
}
|
|
19187
|
-
const fileContent = await readFileContent((0,
|
|
19447
|
+
const fileContent = await readFileContent((0, import_node_path136.join)(baseDir, relativeDirPath, relativeFilePath));
|
|
19188
19448
|
return new _RovodevRule({
|
|
19189
19449
|
baseDir,
|
|
19190
19450
|
relativeDirPath,
|
|
@@ -19298,7 +19558,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
19298
19558
|
};
|
|
19299
19559
|
|
|
19300
19560
|
// src/features/rules/warp-rule.ts
|
|
19301
|
-
var
|
|
19561
|
+
var import_node_path137 = require("path");
|
|
19302
19562
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
19303
19563
|
constructor({ fileContent, root, ...rest }) {
|
|
19304
19564
|
super({
|
|
@@ -19324,8 +19584,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
19324
19584
|
validate = true
|
|
19325
19585
|
}) {
|
|
19326
19586
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
19327
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0,
|
|
19328
|
-
const fileContent = await readFileContent((0,
|
|
19587
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path137.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
19588
|
+
const fileContent = await readFileContent((0, import_node_path137.join)(baseDir, relativePath));
|
|
19329
19589
|
return new _WarpRule({
|
|
19330
19590
|
baseDir,
|
|
19331
19591
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -19380,7 +19640,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
19380
19640
|
};
|
|
19381
19641
|
|
|
19382
19642
|
// src/features/rules/windsurf-rule.ts
|
|
19383
|
-
var
|
|
19643
|
+
var import_node_path138 = require("path");
|
|
19384
19644
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
19385
19645
|
static getSettablePaths(_options = {}) {
|
|
19386
19646
|
return {
|
|
@@ -19395,7 +19655,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
19395
19655
|
validate = true
|
|
19396
19656
|
}) {
|
|
19397
19657
|
const fileContent = await readFileContent(
|
|
19398
|
-
(0,
|
|
19658
|
+
(0, import_node_path138.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
19399
19659
|
);
|
|
19400
19660
|
return new _WindsurfRule({
|
|
19401
19661
|
baseDir,
|
|
@@ -19493,11 +19753,11 @@ var rulesProcessorToolTargets = [
|
|
|
19493
19753
|
"warp",
|
|
19494
19754
|
"windsurf"
|
|
19495
19755
|
];
|
|
19496
|
-
var RulesProcessorToolTargetSchema =
|
|
19497
|
-
var formatRulePaths = (rules) => rules.map((r) => (0,
|
|
19498
|
-
var RulesFeatureOptionsSchema =
|
|
19499
|
-
ruleDiscoveryMode:
|
|
19500
|
-
includeLocalRoot:
|
|
19756
|
+
var RulesProcessorToolTargetSchema = import_mini71.z.enum(rulesProcessorToolTargets);
|
|
19757
|
+
var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path139.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
|
|
19758
|
+
var RulesFeatureOptionsSchema = import_mini71.z.looseObject({
|
|
19759
|
+
ruleDiscoveryMode: import_mini71.z.optional(import_mini71.z.enum(["none", "explicit"])),
|
|
19760
|
+
includeLocalRoot: import_mini71.z.optional(import_mini71.z.boolean())
|
|
19501
19761
|
});
|
|
19502
19762
|
var resolveRuleDiscoveryMode = ({
|
|
19503
19763
|
defaultMode,
|
|
@@ -19518,8 +19778,8 @@ var resolveRuleDiscoveryMode = ({
|
|
|
19518
19778
|
}
|
|
19519
19779
|
return parsed.data.ruleDiscoveryMode === "none" ? "auto" : "toon";
|
|
19520
19780
|
};
|
|
19521
|
-
var IncludeLocalRootSchema =
|
|
19522
|
-
includeLocalRoot:
|
|
19781
|
+
var IncludeLocalRootSchema = import_mini71.z.looseObject({
|
|
19782
|
+
includeLocalRoot: import_mini71.z.optional(import_mini71.z.boolean())
|
|
19523
19783
|
});
|
|
19524
19784
|
var resolveIncludeLocalRoot = (options) => {
|
|
19525
19785
|
if (!options) return true;
|
|
@@ -19962,7 +20222,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
19962
20222
|
}).relativeDirPath;
|
|
19963
20223
|
return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
|
|
19964
20224
|
const frontmatter = skill.getFrontmatter();
|
|
19965
|
-
const relativePath = (0,
|
|
20225
|
+
const relativePath = (0, import_node_path139.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
|
|
19966
20226
|
return {
|
|
19967
20227
|
name: frontmatter.name,
|
|
19968
20228
|
description: frontmatter.description,
|
|
@@ -20091,12 +20351,12 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20091
20351
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
20092
20352
|
*/
|
|
20093
20353
|
async loadRulesyncFiles() {
|
|
20094
|
-
const rulesyncBaseDir = (0,
|
|
20095
|
-
const files = await findFilesByGlobs((0,
|
|
20354
|
+
const rulesyncBaseDir = (0, import_node_path139.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
20355
|
+
const files = await findFilesByGlobs((0, import_node_path139.join)(rulesyncBaseDir, "**", "*.md"));
|
|
20096
20356
|
this.logger.debug(`Found ${files.length} rulesync files`);
|
|
20097
20357
|
const rulesyncRules = await Promise.all(
|
|
20098
20358
|
files.map((file) => {
|
|
20099
|
-
const relativeFilePath = (0,
|
|
20359
|
+
const relativeFilePath = (0, import_node_path139.relative)(rulesyncBaseDir, file);
|
|
20100
20360
|
checkPathTraversal({
|
|
20101
20361
|
relativePath: relativeFilePath,
|
|
20102
20362
|
intendedRootDir: rulesyncBaseDir
|
|
@@ -20171,7 +20431,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20171
20431
|
global: this.global
|
|
20172
20432
|
});
|
|
20173
20433
|
const resolveRelativeDirPath = (filePath) => {
|
|
20174
|
-
const dirName = (0,
|
|
20434
|
+
const dirName = (0, import_node_path139.dirname)((0, import_node_path139.relative)(this.baseDir, filePath));
|
|
20175
20435
|
return dirName === "" ? "." : dirName;
|
|
20176
20436
|
};
|
|
20177
20437
|
const buildDeletionRulesFromPaths = (filePaths, opts) => {
|
|
@@ -20179,7 +20439,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20179
20439
|
const effectiveBaseDir = isNonRoot ? opts.baseDirOverride : this.baseDir;
|
|
20180
20440
|
return filePaths.map((filePath) => {
|
|
20181
20441
|
const relativeDirPath = isNonRoot ? opts.relativeDirPathOverride : resolveRelativeDirPath(filePath);
|
|
20182
|
-
const relativeFilePath = isNonRoot ? (0,
|
|
20442
|
+
const relativeFilePath = isNonRoot ? (0, import_node_path139.relative)(effectiveBaseDir, filePath) : (0, import_node_path139.basename)(filePath);
|
|
20183
20443
|
checkPathTraversal({
|
|
20184
20444
|
relativePath: isNonRoot ? relativeFilePath : relativeDirPath,
|
|
20185
20445
|
intendedRootDir: effectiveBaseDir
|
|
@@ -20207,13 +20467,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20207
20467
|
return [];
|
|
20208
20468
|
}
|
|
20209
20469
|
const uniqueRootFilePaths = await findFilesWithFallback(
|
|
20210
|
-
(0,
|
|
20470
|
+
(0, import_node_path139.join)(
|
|
20211
20471
|
this.baseDir,
|
|
20212
20472
|
settablePaths.root.relativeDirPath ?? ".",
|
|
20213
20473
|
settablePaths.root.relativeFilePath
|
|
20214
20474
|
),
|
|
20215
20475
|
settablePaths.alternativeRoots,
|
|
20216
|
-
(alt) => (0,
|
|
20476
|
+
(alt) => (0, import_node_path139.join)(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
|
|
20217
20477
|
);
|
|
20218
20478
|
if (forDeletion) {
|
|
20219
20479
|
return buildDeletionRulesFromPaths(uniqueRootFilePaths);
|
|
@@ -20227,7 +20487,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20227
20487
|
});
|
|
20228
20488
|
return factory.class.fromFile({
|
|
20229
20489
|
baseDir: this.baseDir,
|
|
20230
|
-
relativeFilePath: (0,
|
|
20490
|
+
relativeFilePath: (0, import_node_path139.basename)(filePath),
|
|
20231
20491
|
relativeDirPath,
|
|
20232
20492
|
global: this.global
|
|
20233
20493
|
});
|
|
@@ -20244,7 +20504,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20244
20504
|
return [];
|
|
20245
20505
|
}
|
|
20246
20506
|
const uniqueLocalRootFilePaths2 = await findFilesByGlobs(
|
|
20247
|
-
(0,
|
|
20507
|
+
(0, import_node_path139.join)(this.baseDir, "AGENTS.local.md")
|
|
20248
20508
|
);
|
|
20249
20509
|
return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths2);
|
|
20250
20510
|
}
|
|
@@ -20255,9 +20515,9 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20255
20515
|
return [];
|
|
20256
20516
|
}
|
|
20257
20517
|
const uniqueLocalRootFilePaths = await findFilesWithFallback(
|
|
20258
|
-
(0,
|
|
20518
|
+
(0, import_node_path139.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
|
|
20259
20519
|
settablePaths.alternativeRoots,
|
|
20260
|
-
(alt) => (0,
|
|
20520
|
+
(alt) => (0, import_node_path139.join)(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
|
|
20261
20521
|
);
|
|
20262
20522
|
return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths);
|
|
20263
20523
|
})();
|
|
@@ -20268,20 +20528,20 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20268
20528
|
if (!forDeletion || this.toolTarget !== "rovodev" || this.global) {
|
|
20269
20529
|
return [];
|
|
20270
20530
|
}
|
|
20271
|
-
const primaryPaths = await findFilesByGlobs((0,
|
|
20531
|
+
const primaryPaths = await findFilesByGlobs((0, import_node_path139.join)(this.baseDir, ".rovodev", "AGENTS.md"));
|
|
20272
20532
|
if (primaryPaths.length === 0) {
|
|
20273
20533
|
return [];
|
|
20274
20534
|
}
|
|
20275
|
-
const mirrorPaths = await findFilesByGlobs((0,
|
|
20535
|
+
const mirrorPaths = await findFilesByGlobs((0, import_node_path139.join)(this.baseDir, "AGENTS.md"));
|
|
20276
20536
|
return buildDeletionRulesFromPaths(mirrorPaths);
|
|
20277
20537
|
})();
|
|
20278
20538
|
const nonRootToolRules = await (async () => {
|
|
20279
20539
|
if (!settablePaths.nonRoot) {
|
|
20280
20540
|
return [];
|
|
20281
20541
|
}
|
|
20282
|
-
const nonRootBaseDir = (0,
|
|
20542
|
+
const nonRootBaseDir = (0, import_node_path139.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
|
|
20283
20543
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
20284
|
-
(0,
|
|
20544
|
+
(0, import_node_path139.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
|
|
20285
20545
|
);
|
|
20286
20546
|
if (forDeletion) {
|
|
20287
20547
|
return buildDeletionRulesFromPaths(nonRootFilePaths, {
|
|
@@ -20291,18 +20551,18 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20291
20551
|
}
|
|
20292
20552
|
const modularRootRelative = settablePaths.nonRoot.relativeDirPath;
|
|
20293
20553
|
const nonRootPathsForImport = this.toolTarget === "rovodev" ? nonRootFilePaths.filter((filePath) => {
|
|
20294
|
-
const relativeFilePath = (0,
|
|
20554
|
+
const relativeFilePath = (0, import_node_path139.relative)(nonRootBaseDir, filePath);
|
|
20295
20555
|
const ok = RovodevRule.isAllowedModularRulesRelativePath(relativeFilePath);
|
|
20296
20556
|
if (!ok) {
|
|
20297
20557
|
this.logger.warn(
|
|
20298
|
-
`Skipping reserved Rovodev path under modular-rules (import): ${(0,
|
|
20558
|
+
`Skipping reserved Rovodev path under modular-rules (import): ${(0, import_node_path139.join)(modularRootRelative, relativeFilePath)}`
|
|
20299
20559
|
);
|
|
20300
20560
|
}
|
|
20301
20561
|
return ok;
|
|
20302
20562
|
}) : nonRootFilePaths;
|
|
20303
20563
|
return await Promise.all(
|
|
20304
20564
|
nonRootPathsForImport.map((filePath) => {
|
|
20305
|
-
const relativeFilePath = (0,
|
|
20565
|
+
const relativeFilePath = (0, import_node_path139.relative)(nonRootBaseDir, filePath);
|
|
20306
20566
|
checkPathTraversal({
|
|
20307
20567
|
relativePath: relativeFilePath,
|
|
20308
20568
|
intendedRootDir: nonRootBaseDir
|
|
@@ -20421,14 +20681,14 @@ s/<command> [arguments]
|
|
|
20421
20681
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
20422
20682
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
20423
20683
|
|
|
20424
|
-
When users call a custom slash command, you have to look for the markdown file, \`${(0,
|
|
20684
|
+
When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path139.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
20425
20685
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
20426
20686
|
|
|
20427
20687
|
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.
|
|
20428
20688
|
|
|
20429
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0,
|
|
20689
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path139.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
20430
20690
|
|
|
20431
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0,
|
|
20691
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path139.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
20432
20692
|
const skillsSection = skills ? this.generateSkillsSection(skills) : "";
|
|
20433
20693
|
const result = [
|
|
20434
20694
|
overview,
|
|
@@ -20528,7 +20788,7 @@ function warnUnsupportedTargets(params) {
|
|
|
20528
20788
|
}
|
|
20529
20789
|
}
|
|
20530
20790
|
async function checkRulesyncDirExists(params) {
|
|
20531
|
-
return fileExists((0,
|
|
20791
|
+
return fileExists((0, import_node_path140.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
|
|
20532
20792
|
}
|
|
20533
20793
|
async function generate(params) {
|
|
20534
20794
|
const { config, logger } = params;
|