rulesync 8.2.0 → 8.4.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-MMBSR2RA.js} +844 -573
- package/dist/cli/index.cjs +486 -215
- package/dist/cli/index.js +2 -2
- package/dist/index.cjs +869 -598
- 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,17 +14975,28 @@ 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
|
});
|
|
14989
|
+
function stringifyCodexCliSubagentToml(tomlObj) {
|
|
14990
|
+
const { developer_instructions, ...restFields } = tomlObj;
|
|
14991
|
+
const restToml = smolToml5.stringify(restFields).trimEnd();
|
|
14992
|
+
if (developer_instructions === void 0) {
|
|
14993
|
+
return restToml;
|
|
14994
|
+
}
|
|
14995
|
+
const developerInstructionsToml = developer_instructions.includes("\n") ? developer_instructions.includes("'''") ? smolToml5.stringify({ developer_instructions }).trimEnd() : `developer_instructions = '''
|
|
14996
|
+
${developer_instructions}
|
|
14997
|
+
'''` : smolToml5.stringify({ developer_instructions }).trimEnd();
|
|
14998
|
+
return [restToml, developerInstructionsToml].filter((value) => value.length > 0).join("\n");
|
|
14999
|
+
}
|
|
14729
15000
|
var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
14730
15001
|
body;
|
|
14731
15002
|
constructor({ body, ...rest }) {
|
|
@@ -14735,7 +15006,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
14735
15006
|
CodexCliSubagentTomlSchema.parse(parsed);
|
|
14736
15007
|
} catch (error) {
|
|
14737
15008
|
throw new Error(
|
|
14738
|
-
`Invalid TOML in ${(0,
|
|
15009
|
+
`Invalid TOML in ${(0, import_node_path103.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
14739
15010
|
{ cause: error }
|
|
14740
15011
|
);
|
|
14741
15012
|
}
|
|
@@ -14747,7 +15018,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
14747
15018
|
}
|
|
14748
15019
|
static getSettablePaths(_options = {}) {
|
|
14749
15020
|
return {
|
|
14750
|
-
relativeDirPath: (0,
|
|
15021
|
+
relativeDirPath: (0, import_node_path103.join)(".codex", "agents")
|
|
14751
15022
|
};
|
|
14752
15023
|
}
|
|
14753
15024
|
getBody() {
|
|
@@ -14759,7 +15030,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
14759
15030
|
parsed = CodexCliSubagentTomlSchema.parse(smolToml5.parse(this.body));
|
|
14760
15031
|
} catch (error) {
|
|
14761
15032
|
throw new Error(
|
|
14762
|
-
`Failed to parse TOML in ${(0,
|
|
15033
|
+
`Failed to parse TOML in ${(0, import_node_path103.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
14763
15034
|
{ cause: error }
|
|
14764
15035
|
);
|
|
14765
15036
|
}
|
|
@@ -14802,7 +15073,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
14802
15073
|
...rulesyncSubagent.getBody() ? { developer_instructions: rulesyncSubagent.getBody() } : {},
|
|
14803
15074
|
...codexcliSection
|
|
14804
15075
|
};
|
|
14805
|
-
const body =
|
|
15076
|
+
const body = stringifyCodexCliSubagentToml(tomlObj);
|
|
14806
15077
|
const paths = this.getSettablePaths({ global });
|
|
14807
15078
|
const relativeFilePath = rulesyncSubagent.getRelativeFilePath().replace(/\.md$/, ".toml");
|
|
14808
15079
|
return new _CodexCliSubagent({
|
|
@@ -14840,7 +15111,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
14840
15111
|
global = false
|
|
14841
15112
|
}) {
|
|
14842
15113
|
const paths = this.getSettablePaths({ global });
|
|
14843
|
-
const filePath = (0,
|
|
15114
|
+
const filePath = (0, import_node_path103.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
14844
15115
|
const fileContent = await readFileContent(filePath);
|
|
14845
15116
|
const subagent = new _CodexCliSubagent({
|
|
14846
15117
|
baseDir,
|
|
@@ -14878,13 +15149,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
14878
15149
|
};
|
|
14879
15150
|
|
|
14880
15151
|
// src/features/subagents/copilot-subagent.ts
|
|
14881
|
-
var
|
|
14882
|
-
var
|
|
15152
|
+
var import_node_path104 = require("path");
|
|
15153
|
+
var import_mini58 = require("zod/mini");
|
|
14883
15154
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
14884
|
-
var CopilotSubagentFrontmatterSchema =
|
|
14885
|
-
name:
|
|
14886
|
-
description:
|
|
14887
|
-
tools:
|
|
15155
|
+
var CopilotSubagentFrontmatterSchema = import_mini58.z.looseObject({
|
|
15156
|
+
name: import_mini58.z.string(),
|
|
15157
|
+
description: import_mini58.z.optional(import_mini58.z.string()),
|
|
15158
|
+
tools: import_mini58.z.optional(import_mini58.z.union([import_mini58.z.string(), import_mini58.z.array(import_mini58.z.string())]))
|
|
14888
15159
|
});
|
|
14889
15160
|
var normalizeTools = (tools) => {
|
|
14890
15161
|
if (!tools) {
|
|
@@ -14904,7 +15175,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
14904
15175
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14905
15176
|
if (!result.success) {
|
|
14906
15177
|
throw new Error(
|
|
14907
|
-
`Invalid frontmatter in ${(0,
|
|
15178
|
+
`Invalid frontmatter in ${(0, import_node_path104.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14908
15179
|
);
|
|
14909
15180
|
}
|
|
14910
15181
|
}
|
|
@@ -14916,7 +15187,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
14916
15187
|
}
|
|
14917
15188
|
static getSettablePaths(_options = {}) {
|
|
14918
15189
|
return {
|
|
14919
|
-
relativeDirPath: (0,
|
|
15190
|
+
relativeDirPath: (0, import_node_path104.join)(".github", "agents")
|
|
14920
15191
|
};
|
|
14921
15192
|
}
|
|
14922
15193
|
getFrontmatter() {
|
|
@@ -14994,7 +15265,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
14994
15265
|
return {
|
|
14995
15266
|
success: false,
|
|
14996
15267
|
error: new Error(
|
|
14997
|
-
`Invalid frontmatter in ${(0,
|
|
15268
|
+
`Invalid frontmatter in ${(0, import_node_path104.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14998
15269
|
)
|
|
14999
15270
|
};
|
|
15000
15271
|
}
|
|
@@ -15012,7 +15283,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
15012
15283
|
global = false
|
|
15013
15284
|
}) {
|
|
15014
15285
|
const paths = this.getSettablePaths({ global });
|
|
15015
|
-
const filePath = (0,
|
|
15286
|
+
const filePath = (0, import_node_path104.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15016
15287
|
const fileContent = await readFileContent(filePath);
|
|
15017
15288
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15018
15289
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15048,11 +15319,11 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
15048
15319
|
};
|
|
15049
15320
|
|
|
15050
15321
|
// src/features/subagents/cursor-subagent.ts
|
|
15051
|
-
var
|
|
15052
|
-
var
|
|
15053
|
-
var CursorSubagentFrontmatterSchema =
|
|
15054
|
-
name:
|
|
15055
|
-
description:
|
|
15322
|
+
var import_node_path105 = require("path");
|
|
15323
|
+
var import_mini59 = require("zod/mini");
|
|
15324
|
+
var CursorSubagentFrontmatterSchema = import_mini59.z.looseObject({
|
|
15325
|
+
name: import_mini59.z.string(),
|
|
15326
|
+
description: import_mini59.z.optional(import_mini59.z.string())
|
|
15056
15327
|
});
|
|
15057
15328
|
var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
15058
15329
|
frontmatter;
|
|
@@ -15062,7 +15333,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
15062
15333
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
15063
15334
|
if (!result.success) {
|
|
15064
15335
|
throw new Error(
|
|
15065
|
-
`Invalid frontmatter in ${(0,
|
|
15336
|
+
`Invalid frontmatter in ${(0, import_node_path105.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15066
15337
|
);
|
|
15067
15338
|
}
|
|
15068
15339
|
}
|
|
@@ -15074,7 +15345,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
15074
15345
|
}
|
|
15075
15346
|
static getSettablePaths(_options = {}) {
|
|
15076
15347
|
return {
|
|
15077
|
-
relativeDirPath: (0,
|
|
15348
|
+
relativeDirPath: (0, import_node_path105.join)(".cursor", "agents")
|
|
15078
15349
|
};
|
|
15079
15350
|
}
|
|
15080
15351
|
getFrontmatter() {
|
|
@@ -15141,7 +15412,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
15141
15412
|
return {
|
|
15142
15413
|
success: false,
|
|
15143
15414
|
error: new Error(
|
|
15144
|
-
`Invalid frontmatter in ${(0,
|
|
15415
|
+
`Invalid frontmatter in ${(0, import_node_path105.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15145
15416
|
)
|
|
15146
15417
|
};
|
|
15147
15418
|
}
|
|
@@ -15159,7 +15430,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
15159
15430
|
global = false
|
|
15160
15431
|
}) {
|
|
15161
15432
|
const paths = this.getSettablePaths({ global });
|
|
15162
|
-
const filePath = (0,
|
|
15433
|
+
const filePath = (0, import_node_path105.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15163
15434
|
const fileContent = await readFileContent(filePath);
|
|
15164
15435
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15165
15436
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15195,12 +15466,12 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
15195
15466
|
};
|
|
15196
15467
|
|
|
15197
15468
|
// src/features/subagents/deepagents-subagent.ts
|
|
15198
|
-
var
|
|
15199
|
-
var
|
|
15200
|
-
var DeepagentsSubagentFrontmatterSchema =
|
|
15201
|
-
name:
|
|
15202
|
-
description:
|
|
15203
|
-
model:
|
|
15469
|
+
var import_node_path106 = require("path");
|
|
15470
|
+
var import_mini60 = require("zod/mini");
|
|
15471
|
+
var DeepagentsSubagentFrontmatterSchema = import_mini60.z.looseObject({
|
|
15472
|
+
name: import_mini60.z.string(),
|
|
15473
|
+
description: import_mini60.z.optional(import_mini60.z.string()),
|
|
15474
|
+
model: import_mini60.z.optional(import_mini60.z.string())
|
|
15204
15475
|
});
|
|
15205
15476
|
var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
15206
15477
|
frontmatter;
|
|
@@ -15210,7 +15481,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
15210
15481
|
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
15211
15482
|
if (!result.success) {
|
|
15212
15483
|
throw new Error(
|
|
15213
|
-
`Invalid frontmatter in ${(0,
|
|
15484
|
+
`Invalid frontmatter in ${(0, import_node_path106.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15214
15485
|
);
|
|
15215
15486
|
}
|
|
15216
15487
|
}
|
|
@@ -15220,7 +15491,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
15220
15491
|
}
|
|
15221
15492
|
static getSettablePaths(_options = {}) {
|
|
15222
15493
|
return {
|
|
15223
|
-
relativeDirPath: (0,
|
|
15494
|
+
relativeDirPath: (0, import_node_path106.join)(".deepagents", "agents")
|
|
15224
15495
|
};
|
|
15225
15496
|
}
|
|
15226
15497
|
getFrontmatter() {
|
|
@@ -15295,7 +15566,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
15295
15566
|
return {
|
|
15296
15567
|
success: false,
|
|
15297
15568
|
error: new Error(
|
|
15298
|
-
`Invalid frontmatter in ${(0,
|
|
15569
|
+
`Invalid frontmatter in ${(0, import_node_path106.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15299
15570
|
)
|
|
15300
15571
|
};
|
|
15301
15572
|
}
|
|
@@ -15313,7 +15584,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
15313
15584
|
global = false
|
|
15314
15585
|
}) {
|
|
15315
15586
|
const paths = this.getSettablePaths({ global });
|
|
15316
|
-
const filePath = (0,
|
|
15587
|
+
const filePath = (0, import_node_path106.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15317
15588
|
const fileContent = await readFileContent(filePath);
|
|
15318
15589
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15319
15590
|
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15348,11 +15619,11 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
15348
15619
|
};
|
|
15349
15620
|
|
|
15350
15621
|
// src/features/subagents/junie-subagent.ts
|
|
15351
|
-
var
|
|
15352
|
-
var
|
|
15353
|
-
var JunieSubagentFrontmatterSchema =
|
|
15354
|
-
name:
|
|
15355
|
-
description:
|
|
15622
|
+
var import_node_path107 = require("path");
|
|
15623
|
+
var import_mini61 = require("zod/mini");
|
|
15624
|
+
var JunieSubagentFrontmatterSchema = import_mini61.z.looseObject({
|
|
15625
|
+
name: import_mini61.z.optional(import_mini61.z.string()),
|
|
15626
|
+
description: import_mini61.z.string()
|
|
15356
15627
|
});
|
|
15357
15628
|
var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
15358
15629
|
frontmatter;
|
|
@@ -15362,7 +15633,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
15362
15633
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
15363
15634
|
if (!result.success) {
|
|
15364
15635
|
throw new Error(
|
|
15365
|
-
`Invalid frontmatter in ${(0,
|
|
15636
|
+
`Invalid frontmatter in ${(0, import_node_path107.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15366
15637
|
);
|
|
15367
15638
|
}
|
|
15368
15639
|
}
|
|
@@ -15377,7 +15648,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
15377
15648
|
throw new Error("JunieSubagent does not support global mode.");
|
|
15378
15649
|
}
|
|
15379
15650
|
return {
|
|
15380
|
-
relativeDirPath: (0,
|
|
15651
|
+
relativeDirPath: (0, import_node_path107.join)(".junie", "agents")
|
|
15381
15652
|
};
|
|
15382
15653
|
}
|
|
15383
15654
|
getFrontmatter() {
|
|
@@ -15453,7 +15724,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
15453
15724
|
return {
|
|
15454
15725
|
success: false,
|
|
15455
15726
|
error: new Error(
|
|
15456
|
-
`Invalid frontmatter in ${(0,
|
|
15727
|
+
`Invalid frontmatter in ${(0, import_node_path107.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15457
15728
|
)
|
|
15458
15729
|
};
|
|
15459
15730
|
}
|
|
@@ -15471,7 +15742,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
15471
15742
|
global = false
|
|
15472
15743
|
}) {
|
|
15473
15744
|
const paths = this.getSettablePaths({ global });
|
|
15474
|
-
const filePath = (0,
|
|
15745
|
+
const filePath = (0, import_node_path107.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15475
15746
|
const fileContent = await readFileContent(filePath);
|
|
15476
15747
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15477
15748
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15506,15 +15777,15 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
15506
15777
|
};
|
|
15507
15778
|
|
|
15508
15779
|
// src/features/subagents/kilo-subagent.ts
|
|
15509
|
-
var
|
|
15780
|
+
var import_node_path109 = require("path");
|
|
15510
15781
|
|
|
15511
15782
|
// src/features/subagents/opencode-style-subagent.ts
|
|
15512
|
-
var
|
|
15513
|
-
var
|
|
15514
|
-
var OpenCodeStyleSubagentFrontmatterSchema =
|
|
15515
|
-
description:
|
|
15516
|
-
mode:
|
|
15517
|
-
name:
|
|
15783
|
+
var import_node_path108 = require("path");
|
|
15784
|
+
var import_mini62 = require("zod/mini");
|
|
15785
|
+
var OpenCodeStyleSubagentFrontmatterSchema = import_mini62.z.looseObject({
|
|
15786
|
+
description: import_mini62.z.optional(import_mini62.z.string()),
|
|
15787
|
+
mode: import_mini62.z._default(import_mini62.z.string(), "subagent"),
|
|
15788
|
+
name: import_mini62.z.optional(import_mini62.z.string())
|
|
15518
15789
|
});
|
|
15519
15790
|
var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
15520
15791
|
frontmatter;
|
|
@@ -15524,7 +15795,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
15524
15795
|
const result = OpenCodeStyleSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
15525
15796
|
if (!result.success) {
|
|
15526
15797
|
throw new Error(
|
|
15527
|
-
`Invalid frontmatter in ${(0,
|
|
15798
|
+
`Invalid frontmatter in ${(0, import_node_path108.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15528
15799
|
);
|
|
15529
15800
|
}
|
|
15530
15801
|
}
|
|
@@ -15544,7 +15815,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
15544
15815
|
const { description, mode, name, ...toolSection } = this.frontmatter;
|
|
15545
15816
|
const rulesyncFrontmatter = {
|
|
15546
15817
|
targets: ["*"],
|
|
15547
|
-
name: name ?? (0,
|
|
15818
|
+
name: name ?? (0, import_node_path108.basename)(this.getRelativeFilePath(), ".md"),
|
|
15548
15819
|
description,
|
|
15549
15820
|
[this.getToolTarget()]: { mode, ...toolSection }
|
|
15550
15821
|
};
|
|
@@ -15566,7 +15837,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
15566
15837
|
return {
|
|
15567
15838
|
success: false,
|
|
15568
15839
|
error: new Error(
|
|
15569
|
-
`Invalid frontmatter in ${(0,
|
|
15840
|
+
`Invalid frontmatter in ${(0, import_node_path108.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15570
15841
|
)
|
|
15571
15842
|
};
|
|
15572
15843
|
}
|
|
@@ -15582,7 +15853,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
15582
15853
|
global = false
|
|
15583
15854
|
} = {}) {
|
|
15584
15855
|
return {
|
|
15585
|
-
relativeDirPath: global ? (0,
|
|
15856
|
+
relativeDirPath: global ? (0, import_node_path109.join)(".config", "kilo", "agent") : (0, import_node_path109.join)(".kilo", "agent")
|
|
15586
15857
|
};
|
|
15587
15858
|
}
|
|
15588
15859
|
static fromRulesyncSubagent({
|
|
@@ -15626,7 +15897,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
15626
15897
|
global = false
|
|
15627
15898
|
}) {
|
|
15628
15899
|
const paths = this.getSettablePaths({ global });
|
|
15629
|
-
const filePath = (0,
|
|
15900
|
+
const filePath = (0, import_node_path109.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15630
15901
|
const fileContent = await readFileContent(filePath);
|
|
15631
15902
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15632
15903
|
const result = KiloSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15662,23 +15933,23 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
15662
15933
|
};
|
|
15663
15934
|
|
|
15664
15935
|
// 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:
|
|
15936
|
+
var import_node_path110 = require("path");
|
|
15937
|
+
var import_mini63 = require("zod/mini");
|
|
15938
|
+
var KiroCliSubagentJsonSchema = import_mini63.z.looseObject({
|
|
15939
|
+
name: import_mini63.z.string(),
|
|
15940
|
+
description: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.string())),
|
|
15941
|
+
prompt: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.string())),
|
|
15942
|
+
tools: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.array(import_mini63.z.string()))),
|
|
15943
|
+
toolAliases: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.record(import_mini63.z.string(), import_mini63.z.string()))),
|
|
15944
|
+
toolSettings: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.unknown())),
|
|
15945
|
+
toolSchema: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.unknown())),
|
|
15946
|
+
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())))),
|
|
15947
|
+
model: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.string())),
|
|
15948
|
+
mcpServers: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.record(import_mini63.z.string(), import_mini63.z.unknown()))),
|
|
15949
|
+
useLegacyMcpJson: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.boolean())),
|
|
15950
|
+
resources: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.array(import_mini63.z.string()))),
|
|
15951
|
+
allowedTools: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.array(import_mini63.z.string()))),
|
|
15952
|
+
includeMcpJson: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.boolean()))
|
|
15682
15953
|
});
|
|
15683
15954
|
var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
15684
15955
|
body;
|
|
@@ -15689,7 +15960,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
15689
15960
|
KiroCliSubagentJsonSchema.parse(parsed);
|
|
15690
15961
|
} catch (error) {
|
|
15691
15962
|
throw new Error(
|
|
15692
|
-
`Invalid JSON in ${(0,
|
|
15963
|
+
`Invalid JSON in ${(0, import_node_path110.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
15693
15964
|
{ cause: error }
|
|
15694
15965
|
);
|
|
15695
15966
|
}
|
|
@@ -15701,7 +15972,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
15701
15972
|
}
|
|
15702
15973
|
static getSettablePaths(_options = {}) {
|
|
15703
15974
|
return {
|
|
15704
|
-
relativeDirPath: (0,
|
|
15975
|
+
relativeDirPath: (0, import_node_path110.join)(".kiro", "agents")
|
|
15705
15976
|
};
|
|
15706
15977
|
}
|
|
15707
15978
|
getBody() {
|
|
@@ -15713,7 +15984,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
15713
15984
|
parsed = JSON.parse(this.body);
|
|
15714
15985
|
} catch (error) {
|
|
15715
15986
|
throw new Error(
|
|
15716
|
-
`Failed to parse JSON in ${(0,
|
|
15987
|
+
`Failed to parse JSON in ${(0, import_node_path110.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
15717
15988
|
{ cause: error }
|
|
15718
15989
|
);
|
|
15719
15990
|
}
|
|
@@ -15794,7 +16065,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
15794
16065
|
global = false
|
|
15795
16066
|
}) {
|
|
15796
16067
|
const paths = this.getSettablePaths({ global });
|
|
15797
|
-
const filePath = (0,
|
|
16068
|
+
const filePath = (0, import_node_path110.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15798
16069
|
const fileContent = await readFileContent(filePath);
|
|
15799
16070
|
const subagent = new _KiroSubagent({
|
|
15800
16071
|
baseDir,
|
|
@@ -15832,7 +16103,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
15832
16103
|
};
|
|
15833
16104
|
|
|
15834
16105
|
// src/features/subagents/opencode-subagent.ts
|
|
15835
|
-
var
|
|
16106
|
+
var import_node_path111 = require("path");
|
|
15836
16107
|
var OpenCodeSubagentFrontmatterSchema = OpenCodeStyleSubagentFrontmatterSchema;
|
|
15837
16108
|
var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
15838
16109
|
getToolTarget() {
|
|
@@ -15842,7 +16113,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
15842
16113
|
global = false
|
|
15843
16114
|
} = {}) {
|
|
15844
16115
|
return {
|
|
15845
|
-
relativeDirPath: global ? (0,
|
|
16116
|
+
relativeDirPath: global ? (0, import_node_path111.join)(".config", "opencode", "agent") : (0, import_node_path111.join)(".opencode", "agent")
|
|
15846
16117
|
};
|
|
15847
16118
|
}
|
|
15848
16119
|
static fromRulesyncSubagent({
|
|
@@ -15886,7 +16157,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
15886
16157
|
global = false
|
|
15887
16158
|
}) {
|
|
15888
16159
|
const paths = this.getSettablePaths({ global });
|
|
15889
|
-
const filePath = (0,
|
|
16160
|
+
const filePath = (0, import_node_path111.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15890
16161
|
const fileContent = await readFileContent(filePath);
|
|
15891
16162
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15892
16163
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15939,7 +16210,7 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
15939
16210
|
"roo",
|
|
15940
16211
|
"rovodev"
|
|
15941
16212
|
];
|
|
15942
|
-
var SubagentsProcessorToolTargetSchema =
|
|
16213
|
+
var SubagentsProcessorToolTargetSchema = import_mini64.z.enum(subagentsProcessorToolTargetTuple);
|
|
15943
16214
|
var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
15944
16215
|
[
|
|
15945
16216
|
"agentsmd",
|
|
@@ -16130,7 +16401,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
16130
16401
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
16131
16402
|
*/
|
|
16132
16403
|
async loadRulesyncFiles() {
|
|
16133
|
-
const subagentsDir = (0,
|
|
16404
|
+
const subagentsDir = (0, import_node_path112.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
16134
16405
|
const dirExists = await directoryExists(subagentsDir);
|
|
16135
16406
|
if (!dirExists) {
|
|
16136
16407
|
this.logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -16145,7 +16416,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
16145
16416
|
this.logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
16146
16417
|
const rulesyncSubagents = [];
|
|
16147
16418
|
for (const mdFile of mdFiles) {
|
|
16148
|
-
const filepath = (0,
|
|
16419
|
+
const filepath = (0, import_node_path112.join)(subagentsDir, mdFile);
|
|
16149
16420
|
try {
|
|
16150
16421
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
16151
16422
|
relativeFilePath: mdFile,
|
|
@@ -16175,14 +16446,14 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
16175
16446
|
const factory = this.getFactory(this.toolTarget);
|
|
16176
16447
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
16177
16448
|
const subagentFilePaths = await findFilesByGlobs(
|
|
16178
|
-
(0,
|
|
16449
|
+
(0, import_node_path112.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
|
|
16179
16450
|
);
|
|
16180
16451
|
if (forDeletion) {
|
|
16181
16452
|
const toolSubagents2 = subagentFilePaths.map(
|
|
16182
16453
|
(path3) => factory.class.forDeletion({
|
|
16183
16454
|
baseDir: this.baseDir,
|
|
16184
16455
|
relativeDirPath: paths.relativeDirPath,
|
|
16185
|
-
relativeFilePath: (0,
|
|
16456
|
+
relativeFilePath: (0, import_node_path112.basename)(path3),
|
|
16186
16457
|
global: this.global
|
|
16187
16458
|
})
|
|
16188
16459
|
).filter((subagent) => subagent.isDeletable());
|
|
@@ -16195,7 +16466,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
16195
16466
|
subagentFilePaths.map(
|
|
16196
16467
|
(path3) => factory.class.fromFile({
|
|
16197
16468
|
baseDir: this.baseDir,
|
|
16198
|
-
relativeFilePath: (0,
|
|
16469
|
+
relativeFilePath: (0, import_node_path112.basename)(path3),
|
|
16199
16470
|
global: this.global
|
|
16200
16471
|
})
|
|
16201
16472
|
)
|
|
@@ -16242,49 +16513,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
16242
16513
|
};
|
|
16243
16514
|
|
|
16244
16515
|
// src/features/rules/agentsmd-rule.ts
|
|
16245
|
-
var
|
|
16516
|
+
var import_node_path115 = require("path");
|
|
16246
16517
|
|
|
16247
16518
|
// src/features/rules/tool-rule.ts
|
|
16248
|
-
var
|
|
16519
|
+
var import_node_path114 = require("path");
|
|
16249
16520
|
|
|
16250
16521
|
// 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
|
-
|
|
16522
|
+
var import_node_path113 = require("path");
|
|
16523
|
+
var import_mini65 = require("zod/mini");
|
|
16524
|
+
var RulesyncRuleFrontmatterSchema = import_mini65.z.object({
|
|
16525
|
+
root: import_mini65.z.optional(import_mini65.z.boolean()),
|
|
16526
|
+
localRoot: import_mini65.z.optional(import_mini65.z.boolean()),
|
|
16527
|
+
targets: import_mini65.z._default(RulesyncTargetsSchema, ["*"]),
|
|
16528
|
+
description: import_mini65.z.optional(import_mini65.z.string()),
|
|
16529
|
+
globs: import_mini65.z.optional(import_mini65.z.array(import_mini65.z.string())),
|
|
16530
|
+
agentsmd: import_mini65.z.optional(
|
|
16531
|
+
import_mini65.z.looseObject({
|
|
16261
16532
|
// @example "path/to/subproject"
|
|
16262
|
-
subprojectPath:
|
|
16533
|
+
subprojectPath: import_mini65.z.optional(import_mini65.z.string())
|
|
16263
16534
|
})
|
|
16264
16535
|
),
|
|
16265
|
-
claudecode:
|
|
16266
|
-
|
|
16536
|
+
claudecode: import_mini65.z.optional(
|
|
16537
|
+
import_mini65.z.looseObject({
|
|
16267
16538
|
// Glob patterns for conditional rules (takes precedence over globs)
|
|
16268
16539
|
// @example ["src/**/*.ts", "tests/**/*.test.ts"]
|
|
16269
|
-
paths:
|
|
16540
|
+
paths: import_mini65.z.optional(import_mini65.z.array(import_mini65.z.string()))
|
|
16270
16541
|
})
|
|
16271
16542
|
),
|
|
16272
|
-
cursor:
|
|
16273
|
-
|
|
16274
|
-
alwaysApply:
|
|
16275
|
-
description:
|
|
16276
|
-
globs:
|
|
16543
|
+
cursor: import_mini65.z.optional(
|
|
16544
|
+
import_mini65.z.looseObject({
|
|
16545
|
+
alwaysApply: import_mini65.z.optional(import_mini65.z.boolean()),
|
|
16546
|
+
description: import_mini65.z.optional(import_mini65.z.string()),
|
|
16547
|
+
globs: import_mini65.z.optional(import_mini65.z.array(import_mini65.z.string()))
|
|
16277
16548
|
})
|
|
16278
16549
|
),
|
|
16279
|
-
copilot:
|
|
16280
|
-
|
|
16281
|
-
excludeAgent:
|
|
16550
|
+
copilot: import_mini65.z.optional(
|
|
16551
|
+
import_mini65.z.looseObject({
|
|
16552
|
+
excludeAgent: import_mini65.z.optional(import_mini65.z.union([import_mini65.z.literal("code-review"), import_mini65.z.literal("coding-agent")]))
|
|
16282
16553
|
})
|
|
16283
16554
|
),
|
|
16284
|
-
antigravity:
|
|
16285
|
-
|
|
16286
|
-
trigger:
|
|
16287
|
-
globs:
|
|
16555
|
+
antigravity: import_mini65.z.optional(
|
|
16556
|
+
import_mini65.z.looseObject({
|
|
16557
|
+
trigger: import_mini65.z.optional(import_mini65.z.string()),
|
|
16558
|
+
globs: import_mini65.z.optional(import_mini65.z.array(import_mini65.z.string()))
|
|
16288
16559
|
})
|
|
16289
16560
|
)
|
|
16290
16561
|
});
|
|
@@ -16295,7 +16566,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
16295
16566
|
const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
16296
16567
|
if (!parseResult.success && rest.validate !== false) {
|
|
16297
16568
|
throw new Error(
|
|
16298
|
-
`Invalid frontmatter in ${(0,
|
|
16569
|
+
`Invalid frontmatter in ${(0, import_node_path113.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
16299
16570
|
);
|
|
16300
16571
|
}
|
|
16301
16572
|
const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
|
|
@@ -16330,7 +16601,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
16330
16601
|
return {
|
|
16331
16602
|
success: false,
|
|
16332
16603
|
error: new Error(
|
|
16333
|
-
`Invalid frontmatter in ${(0,
|
|
16604
|
+
`Invalid frontmatter in ${(0, import_node_path113.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
16334
16605
|
)
|
|
16335
16606
|
};
|
|
16336
16607
|
}
|
|
@@ -16339,7 +16610,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
16339
16610
|
relativeFilePath,
|
|
16340
16611
|
validate = true
|
|
16341
16612
|
}) {
|
|
16342
|
-
const filePath = (0,
|
|
16613
|
+
const filePath = (0, import_node_path113.join)(
|
|
16343
16614
|
process.cwd(),
|
|
16344
16615
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
16345
16616
|
relativeFilePath
|
|
@@ -16438,7 +16709,7 @@ var ToolRule = class extends ToolFile {
|
|
|
16438
16709
|
rulesyncRule,
|
|
16439
16710
|
validate = true,
|
|
16440
16711
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
16441
|
-
nonRootPath = { relativeDirPath: (0,
|
|
16712
|
+
nonRootPath = { relativeDirPath: (0, import_node_path114.join)(".agents", "memories") }
|
|
16442
16713
|
}) {
|
|
16443
16714
|
const params = this.buildToolRuleParamsDefault({
|
|
16444
16715
|
baseDir,
|
|
@@ -16449,7 +16720,7 @@ var ToolRule = class extends ToolFile {
|
|
|
16449
16720
|
});
|
|
16450
16721
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
16451
16722
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
16452
|
-
params.relativeDirPath = (0,
|
|
16723
|
+
params.relativeDirPath = (0, import_node_path114.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
16453
16724
|
params.relativeFilePath = "AGENTS.md";
|
|
16454
16725
|
}
|
|
16455
16726
|
return params;
|
|
@@ -16498,7 +16769,7 @@ var ToolRule = class extends ToolFile {
|
|
|
16498
16769
|
}
|
|
16499
16770
|
};
|
|
16500
16771
|
function buildToolPath(toolDir, subDir, excludeToolDir) {
|
|
16501
|
-
return excludeToolDir ? subDir : (0,
|
|
16772
|
+
return excludeToolDir ? subDir : (0, import_node_path114.join)(toolDir, subDir);
|
|
16502
16773
|
}
|
|
16503
16774
|
|
|
16504
16775
|
// src/features/rules/agentsmd-rule.ts
|
|
@@ -16527,8 +16798,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
16527
16798
|
validate = true
|
|
16528
16799
|
}) {
|
|
16529
16800
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
16530
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
16531
|
-
const fileContent = await readFileContent((0,
|
|
16801
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path115.join)(".agents", "memories", relativeFilePath);
|
|
16802
|
+
const fileContent = await readFileContent((0, import_node_path115.join)(baseDir, relativePath));
|
|
16532
16803
|
return new _AgentsMdRule({
|
|
16533
16804
|
baseDir,
|
|
16534
16805
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -16583,21 +16854,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
16583
16854
|
};
|
|
16584
16855
|
|
|
16585
16856
|
// src/features/rules/antigravity-rule.ts
|
|
16586
|
-
var
|
|
16587
|
-
var
|
|
16588
|
-
var AntigravityRuleFrontmatterSchema =
|
|
16589
|
-
trigger:
|
|
16590
|
-
|
|
16591
|
-
|
|
16592
|
-
|
|
16593
|
-
|
|
16594
|
-
|
|
16595
|
-
|
|
16857
|
+
var import_node_path116 = require("path");
|
|
16858
|
+
var import_mini66 = require("zod/mini");
|
|
16859
|
+
var AntigravityRuleFrontmatterSchema = import_mini66.z.looseObject({
|
|
16860
|
+
trigger: import_mini66.z.optional(
|
|
16861
|
+
import_mini66.z.union([
|
|
16862
|
+
import_mini66.z.literal("always_on"),
|
|
16863
|
+
import_mini66.z.literal("glob"),
|
|
16864
|
+
import_mini66.z.literal("manual"),
|
|
16865
|
+
import_mini66.z.literal("model_decision"),
|
|
16866
|
+
import_mini66.z.string()
|
|
16596
16867
|
// accepts any string for forward compatibility
|
|
16597
16868
|
])
|
|
16598
16869
|
),
|
|
16599
|
-
globs:
|
|
16600
|
-
description:
|
|
16870
|
+
globs: import_mini66.z.optional(import_mini66.z.string()),
|
|
16871
|
+
description: import_mini66.z.optional(import_mini66.z.string())
|
|
16601
16872
|
});
|
|
16602
16873
|
function parseGlobsString(globs) {
|
|
16603
16874
|
if (!globs) {
|
|
@@ -16742,7 +17013,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
16742
17013
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
16743
17014
|
if (!result.success) {
|
|
16744
17015
|
throw new Error(
|
|
16745
|
-
`Invalid frontmatter in ${(0,
|
|
17016
|
+
`Invalid frontmatter in ${(0, import_node_path116.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
16746
17017
|
);
|
|
16747
17018
|
}
|
|
16748
17019
|
}
|
|
@@ -16766,7 +17037,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
16766
17037
|
relativeFilePath,
|
|
16767
17038
|
validate = true
|
|
16768
17039
|
}) {
|
|
16769
|
-
const filePath = (0,
|
|
17040
|
+
const filePath = (0, import_node_path116.join)(
|
|
16770
17041
|
baseDir,
|
|
16771
17042
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
16772
17043
|
relativeFilePath
|
|
@@ -16906,7 +17177,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
16906
17177
|
};
|
|
16907
17178
|
|
|
16908
17179
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
16909
|
-
var
|
|
17180
|
+
var import_node_path117 = require("path");
|
|
16910
17181
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
16911
17182
|
toRulesyncRule() {
|
|
16912
17183
|
const rulesyncFrontmatter = {
|
|
@@ -16966,8 +17237,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
16966
17237
|
}) {
|
|
16967
17238
|
const settablePaths = this.getSettablePaths();
|
|
16968
17239
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
16969
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0,
|
|
16970
|
-
const fileContent = await readFileContent((0,
|
|
17240
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path117.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17241
|
+
const fileContent = await readFileContent((0, import_node_path117.join)(baseDir, relativePath));
|
|
16971
17242
|
return new _AugmentcodeLegacyRule({
|
|
16972
17243
|
baseDir,
|
|
16973
17244
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -16996,7 +17267,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
16996
17267
|
};
|
|
16997
17268
|
|
|
16998
17269
|
// src/features/rules/augmentcode-rule.ts
|
|
16999
|
-
var
|
|
17270
|
+
var import_node_path118 = require("path");
|
|
17000
17271
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
17001
17272
|
toRulesyncRule() {
|
|
17002
17273
|
return this.toRulesyncRuleDefault();
|
|
@@ -17027,7 +17298,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
17027
17298
|
relativeFilePath,
|
|
17028
17299
|
validate = true
|
|
17029
17300
|
}) {
|
|
17030
|
-
const filePath = (0,
|
|
17301
|
+
const filePath = (0, import_node_path118.join)(
|
|
17031
17302
|
baseDir,
|
|
17032
17303
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
17033
17304
|
relativeFilePath
|
|
@@ -17067,7 +17338,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
17067
17338
|
};
|
|
17068
17339
|
|
|
17069
17340
|
// src/features/rules/claudecode-legacy-rule.ts
|
|
17070
|
-
var
|
|
17341
|
+
var import_node_path119 = require("path");
|
|
17071
17342
|
var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
17072
17343
|
static getSettablePaths({
|
|
17073
17344
|
global,
|
|
@@ -17109,7 +17380,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
17109
17380
|
if (isRoot) {
|
|
17110
17381
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
17111
17382
|
const fileContent2 = await readFileContent(
|
|
17112
|
-
(0,
|
|
17383
|
+
(0, import_node_path119.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
|
|
17113
17384
|
);
|
|
17114
17385
|
return new _ClaudecodeLegacyRule({
|
|
17115
17386
|
baseDir,
|
|
@@ -17123,8 +17394,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
17123
17394
|
if (!paths.nonRoot) {
|
|
17124
17395
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
17125
17396
|
}
|
|
17126
|
-
const relativePath = (0,
|
|
17127
|
-
const fileContent = await readFileContent((0,
|
|
17397
|
+
const relativePath = (0, import_node_path119.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17398
|
+
const fileContent = await readFileContent((0, import_node_path119.join)(baseDir, relativePath));
|
|
17128
17399
|
return new _ClaudecodeLegacyRule({
|
|
17129
17400
|
baseDir,
|
|
17130
17401
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -17183,10 +17454,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
17183
17454
|
};
|
|
17184
17455
|
|
|
17185
17456
|
// src/features/rules/claudecode-rule.ts
|
|
17186
|
-
var
|
|
17187
|
-
var
|
|
17188
|
-
var ClaudecodeRuleFrontmatterSchema =
|
|
17189
|
-
paths:
|
|
17457
|
+
var import_node_path120 = require("path");
|
|
17458
|
+
var import_mini67 = require("zod/mini");
|
|
17459
|
+
var ClaudecodeRuleFrontmatterSchema = import_mini67.z.object({
|
|
17460
|
+
paths: import_mini67.z.optional(import_mini67.z.array(import_mini67.z.string()))
|
|
17190
17461
|
});
|
|
17191
17462
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
17192
17463
|
frontmatter;
|
|
@@ -17224,7 +17495,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
17224
17495
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
17225
17496
|
if (!result.success) {
|
|
17226
17497
|
throw new Error(
|
|
17227
|
-
`Invalid frontmatter in ${(0,
|
|
17498
|
+
`Invalid frontmatter in ${(0, import_node_path120.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
17228
17499
|
);
|
|
17229
17500
|
}
|
|
17230
17501
|
}
|
|
@@ -17254,7 +17525,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
17254
17525
|
if (isRoot) {
|
|
17255
17526
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
17256
17527
|
const fileContent2 = await readFileContent(
|
|
17257
|
-
(0,
|
|
17528
|
+
(0, import_node_path120.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
|
|
17258
17529
|
);
|
|
17259
17530
|
return new _ClaudecodeRule({
|
|
17260
17531
|
baseDir,
|
|
@@ -17269,8 +17540,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
17269
17540
|
if (!paths.nonRoot) {
|
|
17270
17541
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
17271
17542
|
}
|
|
17272
|
-
const relativePath = (0,
|
|
17273
|
-
const filePath = (0,
|
|
17543
|
+
const relativePath = (0, import_node_path120.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17544
|
+
const filePath = (0, import_node_path120.join)(baseDir, relativePath);
|
|
17274
17545
|
const fileContent = await readFileContent(filePath);
|
|
17275
17546
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
17276
17547
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -17381,7 +17652,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
17381
17652
|
return {
|
|
17382
17653
|
success: false,
|
|
17383
17654
|
error: new Error(
|
|
17384
|
-
`Invalid frontmatter in ${(0,
|
|
17655
|
+
`Invalid frontmatter in ${(0, import_node_path120.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
17385
17656
|
)
|
|
17386
17657
|
};
|
|
17387
17658
|
}
|
|
@@ -17401,10 +17672,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
17401
17672
|
};
|
|
17402
17673
|
|
|
17403
17674
|
// src/features/rules/cline-rule.ts
|
|
17404
|
-
var
|
|
17405
|
-
var
|
|
17406
|
-
var ClineRuleFrontmatterSchema =
|
|
17407
|
-
description:
|
|
17675
|
+
var import_node_path121 = require("path");
|
|
17676
|
+
var import_mini68 = require("zod/mini");
|
|
17677
|
+
var ClineRuleFrontmatterSchema = import_mini68.z.object({
|
|
17678
|
+
description: import_mini68.z.string()
|
|
17408
17679
|
});
|
|
17409
17680
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
17410
17681
|
static getSettablePaths(_options = {}) {
|
|
@@ -17447,7 +17718,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
17447
17718
|
validate = true
|
|
17448
17719
|
}) {
|
|
17449
17720
|
const fileContent = await readFileContent(
|
|
17450
|
-
(0,
|
|
17721
|
+
(0, import_node_path121.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
17451
17722
|
);
|
|
17452
17723
|
return new _ClineRule({
|
|
17453
17724
|
baseDir,
|
|
@@ -17473,7 +17744,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
17473
17744
|
};
|
|
17474
17745
|
|
|
17475
17746
|
// src/features/rules/codexcli-rule.ts
|
|
17476
|
-
var
|
|
17747
|
+
var import_node_path122 = require("path");
|
|
17477
17748
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
17478
17749
|
static getSettablePaths({
|
|
17479
17750
|
global,
|
|
@@ -17508,7 +17779,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
17508
17779
|
if (isRoot) {
|
|
17509
17780
|
const relativePath2 = paths.root.relativeFilePath;
|
|
17510
17781
|
const fileContent2 = await readFileContent(
|
|
17511
|
-
(0,
|
|
17782
|
+
(0, import_node_path122.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
17512
17783
|
);
|
|
17513
17784
|
return new _CodexcliRule({
|
|
17514
17785
|
baseDir,
|
|
@@ -17522,8 +17793,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
17522
17793
|
if (!paths.nonRoot) {
|
|
17523
17794
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
17524
17795
|
}
|
|
17525
|
-
const relativePath = (0,
|
|
17526
|
-
const fileContent = await readFileContent((0,
|
|
17796
|
+
const relativePath = (0, import_node_path122.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17797
|
+
const fileContent = await readFileContent((0, import_node_path122.join)(baseDir, relativePath));
|
|
17527
17798
|
return new _CodexcliRule({
|
|
17528
17799
|
baseDir,
|
|
17529
17800
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -17582,12 +17853,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
17582
17853
|
};
|
|
17583
17854
|
|
|
17584
17855
|
// src/features/rules/copilot-rule.ts
|
|
17585
|
-
var
|
|
17586
|
-
var
|
|
17587
|
-
var CopilotRuleFrontmatterSchema =
|
|
17588
|
-
description:
|
|
17589
|
-
applyTo:
|
|
17590
|
-
excludeAgent:
|
|
17856
|
+
var import_node_path123 = require("path");
|
|
17857
|
+
var import_mini69 = require("zod/mini");
|
|
17858
|
+
var CopilotRuleFrontmatterSchema = import_mini69.z.object({
|
|
17859
|
+
description: import_mini69.z.optional(import_mini69.z.string()),
|
|
17860
|
+
applyTo: import_mini69.z.optional(import_mini69.z.string()),
|
|
17861
|
+
excludeAgent: import_mini69.z.optional(import_mini69.z.union([import_mini69.z.literal("code-review"), import_mini69.z.literal("coding-agent")]))
|
|
17591
17862
|
});
|
|
17592
17863
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
17593
17864
|
frontmatter;
|
|
@@ -17619,7 +17890,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
17619
17890
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
17620
17891
|
if (!result.success) {
|
|
17621
17892
|
throw new Error(
|
|
17622
|
-
`Invalid frontmatter in ${(0,
|
|
17893
|
+
`Invalid frontmatter in ${(0, import_node_path123.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
17623
17894
|
);
|
|
17624
17895
|
}
|
|
17625
17896
|
}
|
|
@@ -17709,8 +17980,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
17709
17980
|
const paths = this.getSettablePaths({ global });
|
|
17710
17981
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
17711
17982
|
if (isRoot) {
|
|
17712
|
-
const relativePath2 = (0,
|
|
17713
|
-
const filePath2 = (0,
|
|
17983
|
+
const relativePath2 = (0, import_node_path123.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
17984
|
+
const filePath2 = (0, import_node_path123.join)(baseDir, relativePath2);
|
|
17714
17985
|
const fileContent2 = await readFileContent(filePath2);
|
|
17715
17986
|
return new _CopilotRule({
|
|
17716
17987
|
baseDir,
|
|
@@ -17725,8 +17996,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
17725
17996
|
if (!paths.nonRoot) {
|
|
17726
17997
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
17727
17998
|
}
|
|
17728
|
-
const relativePath = (0,
|
|
17729
|
-
const filePath = (0,
|
|
17999
|
+
const relativePath = (0, import_node_path123.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18000
|
+
const filePath = (0, import_node_path123.join)(baseDir, relativePath);
|
|
17730
18001
|
const fileContent = await readFileContent(filePath);
|
|
17731
18002
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
17732
18003
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -17772,7 +18043,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
17772
18043
|
return {
|
|
17773
18044
|
success: false,
|
|
17774
18045
|
error: new Error(
|
|
17775
|
-
`Invalid frontmatter in ${(0,
|
|
18046
|
+
`Invalid frontmatter in ${(0, import_node_path123.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
17776
18047
|
)
|
|
17777
18048
|
};
|
|
17778
18049
|
}
|
|
@@ -17828,12 +18099,12 @@ var CopilotcliRule = class _CopilotcliRule extends CopilotRule {
|
|
|
17828
18099
|
};
|
|
17829
18100
|
|
|
17830
18101
|
// src/features/rules/cursor-rule.ts
|
|
17831
|
-
var
|
|
17832
|
-
var
|
|
17833
|
-
var CursorRuleFrontmatterSchema =
|
|
17834
|
-
description:
|
|
17835
|
-
globs:
|
|
17836
|
-
alwaysApply:
|
|
18102
|
+
var import_node_path124 = require("path");
|
|
18103
|
+
var import_mini70 = require("zod/mini");
|
|
18104
|
+
var CursorRuleFrontmatterSchema = import_mini70.z.object({
|
|
18105
|
+
description: import_mini70.z.optional(import_mini70.z.string()),
|
|
18106
|
+
globs: import_mini70.z.optional(import_mini70.z.string()),
|
|
18107
|
+
alwaysApply: import_mini70.z.optional(import_mini70.z.boolean())
|
|
17837
18108
|
});
|
|
17838
18109
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
17839
18110
|
frontmatter;
|
|
@@ -17850,7 +18121,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
17850
18121
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
17851
18122
|
if (!result.success) {
|
|
17852
18123
|
throw new Error(
|
|
17853
|
-
`Invalid frontmatter in ${(0,
|
|
18124
|
+
`Invalid frontmatter in ${(0, import_node_path124.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
17854
18125
|
);
|
|
17855
18126
|
}
|
|
17856
18127
|
}
|
|
@@ -17966,7 +18237,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
17966
18237
|
relativeFilePath,
|
|
17967
18238
|
validate = true
|
|
17968
18239
|
}) {
|
|
17969
|
-
const filePath = (0,
|
|
18240
|
+
const filePath = (0, import_node_path124.join)(
|
|
17970
18241
|
baseDir,
|
|
17971
18242
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
17972
18243
|
relativeFilePath
|
|
@@ -17976,7 +18247,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
17976
18247
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
17977
18248
|
if (!result.success) {
|
|
17978
18249
|
throw new Error(
|
|
17979
|
-
`Invalid frontmatter in ${(0,
|
|
18250
|
+
`Invalid frontmatter in ${(0, import_node_path124.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
17980
18251
|
);
|
|
17981
18252
|
}
|
|
17982
18253
|
return new _CursorRule({
|
|
@@ -18013,7 +18284,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
18013
18284
|
return {
|
|
18014
18285
|
success: false,
|
|
18015
18286
|
error: new Error(
|
|
18016
|
-
`Invalid frontmatter in ${(0,
|
|
18287
|
+
`Invalid frontmatter in ${(0, import_node_path124.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
18017
18288
|
)
|
|
18018
18289
|
};
|
|
18019
18290
|
}
|
|
@@ -18033,7 +18304,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
18033
18304
|
};
|
|
18034
18305
|
|
|
18035
18306
|
// src/features/rules/deepagents-rule.ts
|
|
18036
|
-
var
|
|
18307
|
+
var import_node_path125 = require("path");
|
|
18037
18308
|
var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
18038
18309
|
constructor({ fileContent, root, ...rest }) {
|
|
18039
18310
|
super({
|
|
@@ -18060,8 +18331,8 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
18060
18331
|
}) {
|
|
18061
18332
|
const settablePaths = this.getSettablePaths();
|
|
18062
18333
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
18063
|
-
const relativePath = isRoot ? (0,
|
|
18064
|
-
const fileContent = await readFileContent((0,
|
|
18334
|
+
const relativePath = isRoot ? (0, import_node_path125.join)(".deepagents", "AGENTS.md") : (0, import_node_path125.join)(".deepagents", "memories", relativeFilePath);
|
|
18335
|
+
const fileContent = await readFileContent((0, import_node_path125.join)(baseDir, relativePath));
|
|
18065
18336
|
return new _DeepagentsRule({
|
|
18066
18337
|
baseDir,
|
|
18067
18338
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -18116,7 +18387,7 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
18116
18387
|
};
|
|
18117
18388
|
|
|
18118
18389
|
// src/features/rules/factorydroid-rule.ts
|
|
18119
|
-
var
|
|
18390
|
+
var import_node_path126 = require("path");
|
|
18120
18391
|
var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
18121
18392
|
constructor({ fileContent, root, ...rest }) {
|
|
18122
18393
|
super({
|
|
@@ -18156,8 +18427,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
18156
18427
|
const paths = this.getSettablePaths({ global });
|
|
18157
18428
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
18158
18429
|
if (isRoot) {
|
|
18159
|
-
const relativePath2 = (0,
|
|
18160
|
-
const fileContent2 = await readFileContent((0,
|
|
18430
|
+
const relativePath2 = (0, import_node_path126.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
18431
|
+
const fileContent2 = await readFileContent((0, import_node_path126.join)(baseDir, relativePath2));
|
|
18161
18432
|
return new _FactorydroidRule({
|
|
18162
18433
|
baseDir,
|
|
18163
18434
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -18170,8 +18441,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
18170
18441
|
if (!paths.nonRoot) {
|
|
18171
18442
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18172
18443
|
}
|
|
18173
|
-
const relativePath = (0,
|
|
18174
|
-
const fileContent = await readFileContent((0,
|
|
18444
|
+
const relativePath = (0, import_node_path126.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18445
|
+
const fileContent = await readFileContent((0, import_node_path126.join)(baseDir, relativePath));
|
|
18175
18446
|
return new _FactorydroidRule({
|
|
18176
18447
|
baseDir,
|
|
18177
18448
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18230,7 +18501,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
18230
18501
|
};
|
|
18231
18502
|
|
|
18232
18503
|
// src/features/rules/geminicli-rule.ts
|
|
18233
|
-
var
|
|
18504
|
+
var import_node_path127 = require("path");
|
|
18234
18505
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
18235
18506
|
static getSettablePaths({
|
|
18236
18507
|
global,
|
|
@@ -18265,7 +18536,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
18265
18536
|
if (isRoot) {
|
|
18266
18537
|
const relativePath2 = paths.root.relativeFilePath;
|
|
18267
18538
|
const fileContent2 = await readFileContent(
|
|
18268
|
-
(0,
|
|
18539
|
+
(0, import_node_path127.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
18269
18540
|
);
|
|
18270
18541
|
return new _GeminiCliRule({
|
|
18271
18542
|
baseDir,
|
|
@@ -18279,8 +18550,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
18279
18550
|
if (!paths.nonRoot) {
|
|
18280
18551
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18281
18552
|
}
|
|
18282
|
-
const relativePath = (0,
|
|
18283
|
-
const fileContent = await readFileContent((0,
|
|
18553
|
+
const relativePath = (0, import_node_path127.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18554
|
+
const fileContent = await readFileContent((0, import_node_path127.join)(baseDir, relativePath));
|
|
18284
18555
|
return new _GeminiCliRule({
|
|
18285
18556
|
baseDir,
|
|
18286
18557
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18339,7 +18610,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
18339
18610
|
};
|
|
18340
18611
|
|
|
18341
18612
|
// src/features/rules/goose-rule.ts
|
|
18342
|
-
var
|
|
18613
|
+
var import_node_path128 = require("path");
|
|
18343
18614
|
var GooseRule = class _GooseRule extends ToolRule {
|
|
18344
18615
|
static getSettablePaths({
|
|
18345
18616
|
global,
|
|
@@ -18374,7 +18645,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
18374
18645
|
if (isRoot) {
|
|
18375
18646
|
const relativePath2 = paths.root.relativeFilePath;
|
|
18376
18647
|
const fileContent2 = await readFileContent(
|
|
18377
|
-
(0,
|
|
18648
|
+
(0, import_node_path128.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
18378
18649
|
);
|
|
18379
18650
|
return new _GooseRule({
|
|
18380
18651
|
baseDir,
|
|
@@ -18388,8 +18659,8 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
18388
18659
|
if (!paths.nonRoot) {
|
|
18389
18660
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18390
18661
|
}
|
|
18391
|
-
const relativePath = (0,
|
|
18392
|
-
const fileContent = await readFileContent((0,
|
|
18662
|
+
const relativePath = (0, import_node_path128.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18663
|
+
const fileContent = await readFileContent((0, import_node_path128.join)(baseDir, relativePath));
|
|
18393
18664
|
return new _GooseRule({
|
|
18394
18665
|
baseDir,
|
|
18395
18666
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18448,7 +18719,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
18448
18719
|
};
|
|
18449
18720
|
|
|
18450
18721
|
// src/features/rules/junie-rule.ts
|
|
18451
|
-
var
|
|
18722
|
+
var import_node_path129 = require("path");
|
|
18452
18723
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
18453
18724
|
static getSettablePaths(_options = {}) {
|
|
18454
18725
|
return {
|
|
@@ -18477,8 +18748,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
18477
18748
|
}) {
|
|
18478
18749
|
const isRoot = _JunieRule.isRootRelativeFilePath(relativeFilePath);
|
|
18479
18750
|
const settablePaths = this.getSettablePaths();
|
|
18480
|
-
const relativePath = isRoot ? (0,
|
|
18481
|
-
const fileContent = await readFileContent((0,
|
|
18751
|
+
const relativePath = isRoot ? (0, import_node_path129.join)(settablePaths.root.relativeDirPath, settablePaths.root.relativeFilePath) : (0, import_node_path129.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18752
|
+
const fileContent = await readFileContent((0, import_node_path129.join)(baseDir, relativePath));
|
|
18482
18753
|
return new _JunieRule({
|
|
18483
18754
|
baseDir,
|
|
18484
18755
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -18533,7 +18804,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
18533
18804
|
};
|
|
18534
18805
|
|
|
18535
18806
|
// src/features/rules/kilo-rule.ts
|
|
18536
|
-
var
|
|
18807
|
+
var import_node_path130 = require("path");
|
|
18537
18808
|
var KiloRule = class _KiloRule extends ToolRule {
|
|
18538
18809
|
static getSettablePaths({
|
|
18539
18810
|
global,
|
|
@@ -18568,7 +18839,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
18568
18839
|
if (isRoot) {
|
|
18569
18840
|
const relativePath2 = paths.root.relativeFilePath;
|
|
18570
18841
|
const fileContent2 = await readFileContent(
|
|
18571
|
-
(0,
|
|
18842
|
+
(0, import_node_path130.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
18572
18843
|
);
|
|
18573
18844
|
return new _KiloRule({
|
|
18574
18845
|
baseDir,
|
|
@@ -18582,8 +18853,8 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
18582
18853
|
if (!paths.nonRoot) {
|
|
18583
18854
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18584
18855
|
}
|
|
18585
|
-
const relativePath = (0,
|
|
18586
|
-
const fileContent = await readFileContent((0,
|
|
18856
|
+
const relativePath = (0, import_node_path130.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18857
|
+
const fileContent = await readFileContent((0, import_node_path130.join)(baseDir, relativePath));
|
|
18587
18858
|
return new _KiloRule({
|
|
18588
18859
|
baseDir,
|
|
18589
18860
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18642,7 +18913,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
18642
18913
|
};
|
|
18643
18914
|
|
|
18644
18915
|
// src/features/rules/kiro-rule.ts
|
|
18645
|
-
var
|
|
18916
|
+
var import_node_path131 = require("path");
|
|
18646
18917
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
18647
18918
|
static getSettablePaths(_options = {}) {
|
|
18648
18919
|
return {
|
|
@@ -18657,7 +18928,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
18657
18928
|
validate = true
|
|
18658
18929
|
}) {
|
|
18659
18930
|
const fileContent = await readFileContent(
|
|
18660
|
-
(0,
|
|
18931
|
+
(0, import_node_path131.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
18661
18932
|
);
|
|
18662
18933
|
return new _KiroRule({
|
|
18663
18934
|
baseDir,
|
|
@@ -18711,7 +18982,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
18711
18982
|
};
|
|
18712
18983
|
|
|
18713
18984
|
// src/features/rules/opencode-rule.ts
|
|
18714
|
-
var
|
|
18985
|
+
var import_node_path132 = require("path");
|
|
18715
18986
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
18716
18987
|
static getSettablePaths({
|
|
18717
18988
|
global,
|
|
@@ -18746,7 +19017,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
18746
19017
|
if (isRoot) {
|
|
18747
19018
|
const relativePath2 = paths.root.relativeFilePath;
|
|
18748
19019
|
const fileContent2 = await readFileContent(
|
|
18749
|
-
(0,
|
|
19020
|
+
(0, import_node_path132.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
18750
19021
|
);
|
|
18751
19022
|
return new _OpenCodeRule({
|
|
18752
19023
|
baseDir,
|
|
@@ -18760,8 +19031,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
18760
19031
|
if (!paths.nonRoot) {
|
|
18761
19032
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18762
19033
|
}
|
|
18763
|
-
const relativePath = (0,
|
|
18764
|
-
const fileContent = await readFileContent((0,
|
|
19034
|
+
const relativePath = (0, import_node_path132.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
19035
|
+
const fileContent = await readFileContent((0, import_node_path132.join)(baseDir, relativePath));
|
|
18765
19036
|
return new _OpenCodeRule({
|
|
18766
19037
|
baseDir,
|
|
18767
19038
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18820,7 +19091,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
18820
19091
|
};
|
|
18821
19092
|
|
|
18822
19093
|
// src/features/rules/qwencode-rule.ts
|
|
18823
|
-
var
|
|
19094
|
+
var import_node_path133 = require("path");
|
|
18824
19095
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
18825
19096
|
static getSettablePaths(_options = {}) {
|
|
18826
19097
|
return {
|
|
@@ -18839,8 +19110,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
18839
19110
|
validate = true
|
|
18840
19111
|
}) {
|
|
18841
19112
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
18842
|
-
const relativePath = isRoot ? "QWEN.md" : (0,
|
|
18843
|
-
const fileContent = await readFileContent((0,
|
|
19113
|
+
const relativePath = isRoot ? "QWEN.md" : (0, import_node_path133.join)(".qwen", "memories", relativeFilePath);
|
|
19114
|
+
const fileContent = await readFileContent((0, import_node_path133.join)(baseDir, relativePath));
|
|
18844
19115
|
return new _QwencodeRule({
|
|
18845
19116
|
baseDir,
|
|
18846
19117
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -18892,7 +19163,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
18892
19163
|
};
|
|
18893
19164
|
|
|
18894
19165
|
// src/features/rules/replit-rule.ts
|
|
18895
|
-
var
|
|
19166
|
+
var import_node_path134 = require("path");
|
|
18896
19167
|
var ReplitRule = class _ReplitRule extends ToolRule {
|
|
18897
19168
|
static getSettablePaths(_options = {}) {
|
|
18898
19169
|
return {
|
|
@@ -18914,7 +19185,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
18914
19185
|
}
|
|
18915
19186
|
const relativePath = paths.root.relativeFilePath;
|
|
18916
19187
|
const fileContent = await readFileContent(
|
|
18917
|
-
(0,
|
|
19188
|
+
(0, import_node_path134.join)(baseDir, paths.root.relativeDirPath, relativePath)
|
|
18918
19189
|
);
|
|
18919
19190
|
return new _ReplitRule({
|
|
18920
19191
|
baseDir,
|
|
@@ -18980,7 +19251,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
18980
19251
|
};
|
|
18981
19252
|
|
|
18982
19253
|
// src/features/rules/roo-rule.ts
|
|
18983
|
-
var
|
|
19254
|
+
var import_node_path135 = require("path");
|
|
18984
19255
|
var RooRule = class _RooRule extends ToolRule {
|
|
18985
19256
|
static getSettablePaths(_options = {}) {
|
|
18986
19257
|
return {
|
|
@@ -18995,7 +19266,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
18995
19266
|
validate = true
|
|
18996
19267
|
}) {
|
|
18997
19268
|
const fileContent = await readFileContent(
|
|
18998
|
-
(0,
|
|
19269
|
+
(0, import_node_path135.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
18999
19270
|
);
|
|
19000
19271
|
return new _RooRule({
|
|
19001
19272
|
baseDir,
|
|
@@ -19064,7 +19335,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
19064
19335
|
};
|
|
19065
19336
|
|
|
19066
19337
|
// src/features/rules/rovodev-rule.ts
|
|
19067
|
-
var
|
|
19338
|
+
var import_node_path136 = require("path");
|
|
19068
19339
|
var DISALLOWED_ROVODEV_MODULAR_RULE_BASENAMES = /* @__PURE__ */ new Set(["agents.md", "agents.local.md"]);
|
|
19069
19340
|
var RovodevRule = class _RovodevRule extends ToolRule {
|
|
19070
19341
|
/**
|
|
@@ -19108,7 +19379,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
19108
19379
|
root: rovodevAgents,
|
|
19109
19380
|
alternativeRoots: [{ relativeDirPath: ".", relativeFilePath: "AGENTS.md" }],
|
|
19110
19381
|
nonRoot: {
|
|
19111
|
-
relativeDirPath: (0,
|
|
19382
|
+
relativeDirPath: (0, import_node_path136.join)(".rovodev", ".rulesync", "modular-rules")
|
|
19112
19383
|
}
|
|
19113
19384
|
};
|
|
19114
19385
|
}
|
|
@@ -19147,10 +19418,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
19147
19418
|
}) {
|
|
19148
19419
|
if (!this.isAllowedModularRulesRelativePath(relativeFilePath)) {
|
|
19149
19420
|
throw new Error(
|
|
19150
|
-
`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${(0,
|
|
19421
|
+
`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${(0, import_node_path136.join)(relativeDirPath, relativeFilePath)}`
|
|
19151
19422
|
);
|
|
19152
19423
|
}
|
|
19153
|
-
const fileContent = await readFileContent((0,
|
|
19424
|
+
const fileContent = await readFileContent((0, import_node_path136.join)(baseDir, relativeDirPath, relativeFilePath));
|
|
19154
19425
|
return new _RovodevRule({
|
|
19155
19426
|
baseDir,
|
|
19156
19427
|
relativeDirPath,
|
|
@@ -19170,10 +19441,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
19170
19441
|
paths
|
|
19171
19442
|
}) {
|
|
19172
19443
|
const relativeDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
19173
|
-
const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${(0,
|
|
19444
|
+
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
19445
|
if (relativeFilePath !== "AGENTS.md") {
|
|
19175
19446
|
throw new Error(
|
|
19176
|
-
`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${(0,
|
|
19447
|
+
`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${(0, import_node_path136.join)(relativeDirPath, relativeFilePath)}`
|
|
19177
19448
|
);
|
|
19178
19449
|
}
|
|
19179
19450
|
const allowed = relativeDirPath === paths.root.relativeDirPath || "alternativeRoots" in paths && paths.alternativeRoots?.some(
|
|
@@ -19181,10 +19452,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
19181
19452
|
);
|
|
19182
19453
|
if (!allowed) {
|
|
19183
19454
|
throw new Error(
|
|
19184
|
-
`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${(0,
|
|
19455
|
+
`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${(0, import_node_path136.join)(relativeDirPath, relativeFilePath)}`
|
|
19185
19456
|
);
|
|
19186
19457
|
}
|
|
19187
|
-
const fileContent = await readFileContent((0,
|
|
19458
|
+
const fileContent = await readFileContent((0, import_node_path136.join)(baseDir, relativeDirPath, relativeFilePath));
|
|
19188
19459
|
return new _RovodevRule({
|
|
19189
19460
|
baseDir,
|
|
19190
19461
|
relativeDirPath,
|
|
@@ -19298,7 +19569,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
19298
19569
|
};
|
|
19299
19570
|
|
|
19300
19571
|
// src/features/rules/warp-rule.ts
|
|
19301
|
-
var
|
|
19572
|
+
var import_node_path137 = require("path");
|
|
19302
19573
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
19303
19574
|
constructor({ fileContent, root, ...rest }) {
|
|
19304
19575
|
super({
|
|
@@ -19324,8 +19595,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
19324
19595
|
validate = true
|
|
19325
19596
|
}) {
|
|
19326
19597
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
19327
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0,
|
|
19328
|
-
const fileContent = await readFileContent((0,
|
|
19598
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path137.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
19599
|
+
const fileContent = await readFileContent((0, import_node_path137.join)(baseDir, relativePath));
|
|
19329
19600
|
return new _WarpRule({
|
|
19330
19601
|
baseDir,
|
|
19331
19602
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -19380,7 +19651,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
19380
19651
|
};
|
|
19381
19652
|
|
|
19382
19653
|
// src/features/rules/windsurf-rule.ts
|
|
19383
|
-
var
|
|
19654
|
+
var import_node_path138 = require("path");
|
|
19384
19655
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
19385
19656
|
static getSettablePaths(_options = {}) {
|
|
19386
19657
|
return {
|
|
@@ -19395,7 +19666,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
19395
19666
|
validate = true
|
|
19396
19667
|
}) {
|
|
19397
19668
|
const fileContent = await readFileContent(
|
|
19398
|
-
(0,
|
|
19669
|
+
(0, import_node_path138.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
19399
19670
|
);
|
|
19400
19671
|
return new _WindsurfRule({
|
|
19401
19672
|
baseDir,
|
|
@@ -19493,11 +19764,11 @@ var rulesProcessorToolTargets = [
|
|
|
19493
19764
|
"warp",
|
|
19494
19765
|
"windsurf"
|
|
19495
19766
|
];
|
|
19496
|
-
var RulesProcessorToolTargetSchema =
|
|
19497
|
-
var formatRulePaths = (rules) => rules.map((r) => (0,
|
|
19498
|
-
var RulesFeatureOptionsSchema =
|
|
19499
|
-
ruleDiscoveryMode:
|
|
19500
|
-
includeLocalRoot:
|
|
19767
|
+
var RulesProcessorToolTargetSchema = import_mini71.z.enum(rulesProcessorToolTargets);
|
|
19768
|
+
var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path139.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
|
|
19769
|
+
var RulesFeatureOptionsSchema = import_mini71.z.looseObject({
|
|
19770
|
+
ruleDiscoveryMode: import_mini71.z.optional(import_mini71.z.enum(["none", "explicit"])),
|
|
19771
|
+
includeLocalRoot: import_mini71.z.optional(import_mini71.z.boolean())
|
|
19501
19772
|
});
|
|
19502
19773
|
var resolveRuleDiscoveryMode = ({
|
|
19503
19774
|
defaultMode,
|
|
@@ -19518,8 +19789,8 @@ var resolveRuleDiscoveryMode = ({
|
|
|
19518
19789
|
}
|
|
19519
19790
|
return parsed.data.ruleDiscoveryMode === "none" ? "auto" : "toon";
|
|
19520
19791
|
};
|
|
19521
|
-
var IncludeLocalRootSchema =
|
|
19522
|
-
includeLocalRoot:
|
|
19792
|
+
var IncludeLocalRootSchema = import_mini71.z.looseObject({
|
|
19793
|
+
includeLocalRoot: import_mini71.z.optional(import_mini71.z.boolean())
|
|
19523
19794
|
});
|
|
19524
19795
|
var resolveIncludeLocalRoot = (options) => {
|
|
19525
19796
|
if (!options) return true;
|
|
@@ -19962,7 +20233,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
19962
20233
|
}).relativeDirPath;
|
|
19963
20234
|
return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
|
|
19964
20235
|
const frontmatter = skill.getFrontmatter();
|
|
19965
|
-
const relativePath = (0,
|
|
20236
|
+
const relativePath = (0, import_node_path139.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
|
|
19966
20237
|
return {
|
|
19967
20238
|
name: frontmatter.name,
|
|
19968
20239
|
description: frontmatter.description,
|
|
@@ -20091,12 +20362,12 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20091
20362
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
20092
20363
|
*/
|
|
20093
20364
|
async loadRulesyncFiles() {
|
|
20094
|
-
const rulesyncBaseDir = (0,
|
|
20095
|
-
const files = await findFilesByGlobs((0,
|
|
20365
|
+
const rulesyncBaseDir = (0, import_node_path139.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
20366
|
+
const files = await findFilesByGlobs((0, import_node_path139.join)(rulesyncBaseDir, "**", "*.md"));
|
|
20096
20367
|
this.logger.debug(`Found ${files.length} rulesync files`);
|
|
20097
20368
|
const rulesyncRules = await Promise.all(
|
|
20098
20369
|
files.map((file) => {
|
|
20099
|
-
const relativeFilePath = (0,
|
|
20370
|
+
const relativeFilePath = (0, import_node_path139.relative)(rulesyncBaseDir, file);
|
|
20100
20371
|
checkPathTraversal({
|
|
20101
20372
|
relativePath: relativeFilePath,
|
|
20102
20373
|
intendedRootDir: rulesyncBaseDir
|
|
@@ -20171,7 +20442,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20171
20442
|
global: this.global
|
|
20172
20443
|
});
|
|
20173
20444
|
const resolveRelativeDirPath = (filePath) => {
|
|
20174
|
-
const dirName = (0,
|
|
20445
|
+
const dirName = (0, import_node_path139.dirname)((0, import_node_path139.relative)(this.baseDir, filePath));
|
|
20175
20446
|
return dirName === "" ? "." : dirName;
|
|
20176
20447
|
};
|
|
20177
20448
|
const buildDeletionRulesFromPaths = (filePaths, opts) => {
|
|
@@ -20179,7 +20450,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20179
20450
|
const effectiveBaseDir = isNonRoot ? opts.baseDirOverride : this.baseDir;
|
|
20180
20451
|
return filePaths.map((filePath) => {
|
|
20181
20452
|
const relativeDirPath = isNonRoot ? opts.relativeDirPathOverride : resolveRelativeDirPath(filePath);
|
|
20182
|
-
const relativeFilePath = isNonRoot ? (0,
|
|
20453
|
+
const relativeFilePath = isNonRoot ? (0, import_node_path139.relative)(effectiveBaseDir, filePath) : (0, import_node_path139.basename)(filePath);
|
|
20183
20454
|
checkPathTraversal({
|
|
20184
20455
|
relativePath: isNonRoot ? relativeFilePath : relativeDirPath,
|
|
20185
20456
|
intendedRootDir: effectiveBaseDir
|
|
@@ -20207,13 +20478,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20207
20478
|
return [];
|
|
20208
20479
|
}
|
|
20209
20480
|
const uniqueRootFilePaths = await findFilesWithFallback(
|
|
20210
|
-
(0,
|
|
20481
|
+
(0, import_node_path139.join)(
|
|
20211
20482
|
this.baseDir,
|
|
20212
20483
|
settablePaths.root.relativeDirPath ?? ".",
|
|
20213
20484
|
settablePaths.root.relativeFilePath
|
|
20214
20485
|
),
|
|
20215
20486
|
settablePaths.alternativeRoots,
|
|
20216
|
-
(alt) => (0,
|
|
20487
|
+
(alt) => (0, import_node_path139.join)(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
|
|
20217
20488
|
);
|
|
20218
20489
|
if (forDeletion) {
|
|
20219
20490
|
return buildDeletionRulesFromPaths(uniqueRootFilePaths);
|
|
@@ -20227,7 +20498,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20227
20498
|
});
|
|
20228
20499
|
return factory.class.fromFile({
|
|
20229
20500
|
baseDir: this.baseDir,
|
|
20230
|
-
relativeFilePath: (0,
|
|
20501
|
+
relativeFilePath: (0, import_node_path139.basename)(filePath),
|
|
20231
20502
|
relativeDirPath,
|
|
20232
20503
|
global: this.global
|
|
20233
20504
|
});
|
|
@@ -20244,7 +20515,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20244
20515
|
return [];
|
|
20245
20516
|
}
|
|
20246
20517
|
const uniqueLocalRootFilePaths2 = await findFilesByGlobs(
|
|
20247
|
-
(0,
|
|
20518
|
+
(0, import_node_path139.join)(this.baseDir, "AGENTS.local.md")
|
|
20248
20519
|
);
|
|
20249
20520
|
return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths2);
|
|
20250
20521
|
}
|
|
@@ -20255,9 +20526,9 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20255
20526
|
return [];
|
|
20256
20527
|
}
|
|
20257
20528
|
const uniqueLocalRootFilePaths = await findFilesWithFallback(
|
|
20258
|
-
(0,
|
|
20529
|
+
(0, import_node_path139.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
|
|
20259
20530
|
settablePaths.alternativeRoots,
|
|
20260
|
-
(alt) => (0,
|
|
20531
|
+
(alt) => (0, import_node_path139.join)(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
|
|
20261
20532
|
);
|
|
20262
20533
|
return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths);
|
|
20263
20534
|
})();
|
|
@@ -20268,20 +20539,20 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20268
20539
|
if (!forDeletion || this.toolTarget !== "rovodev" || this.global) {
|
|
20269
20540
|
return [];
|
|
20270
20541
|
}
|
|
20271
|
-
const primaryPaths = await findFilesByGlobs((0,
|
|
20542
|
+
const primaryPaths = await findFilesByGlobs((0, import_node_path139.join)(this.baseDir, ".rovodev", "AGENTS.md"));
|
|
20272
20543
|
if (primaryPaths.length === 0) {
|
|
20273
20544
|
return [];
|
|
20274
20545
|
}
|
|
20275
|
-
const mirrorPaths = await findFilesByGlobs((0,
|
|
20546
|
+
const mirrorPaths = await findFilesByGlobs((0, import_node_path139.join)(this.baseDir, "AGENTS.md"));
|
|
20276
20547
|
return buildDeletionRulesFromPaths(mirrorPaths);
|
|
20277
20548
|
})();
|
|
20278
20549
|
const nonRootToolRules = await (async () => {
|
|
20279
20550
|
if (!settablePaths.nonRoot) {
|
|
20280
20551
|
return [];
|
|
20281
20552
|
}
|
|
20282
|
-
const nonRootBaseDir = (0,
|
|
20553
|
+
const nonRootBaseDir = (0, import_node_path139.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
|
|
20283
20554
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
20284
|
-
(0,
|
|
20555
|
+
(0, import_node_path139.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
|
|
20285
20556
|
);
|
|
20286
20557
|
if (forDeletion) {
|
|
20287
20558
|
return buildDeletionRulesFromPaths(nonRootFilePaths, {
|
|
@@ -20291,18 +20562,18 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20291
20562
|
}
|
|
20292
20563
|
const modularRootRelative = settablePaths.nonRoot.relativeDirPath;
|
|
20293
20564
|
const nonRootPathsForImport = this.toolTarget === "rovodev" ? nonRootFilePaths.filter((filePath) => {
|
|
20294
|
-
const relativeFilePath = (0,
|
|
20565
|
+
const relativeFilePath = (0, import_node_path139.relative)(nonRootBaseDir, filePath);
|
|
20295
20566
|
const ok = RovodevRule.isAllowedModularRulesRelativePath(relativeFilePath);
|
|
20296
20567
|
if (!ok) {
|
|
20297
20568
|
this.logger.warn(
|
|
20298
|
-
`Skipping reserved Rovodev path under modular-rules (import): ${(0,
|
|
20569
|
+
`Skipping reserved Rovodev path under modular-rules (import): ${(0, import_node_path139.join)(modularRootRelative, relativeFilePath)}`
|
|
20299
20570
|
);
|
|
20300
20571
|
}
|
|
20301
20572
|
return ok;
|
|
20302
20573
|
}) : nonRootFilePaths;
|
|
20303
20574
|
return await Promise.all(
|
|
20304
20575
|
nonRootPathsForImport.map((filePath) => {
|
|
20305
|
-
const relativeFilePath = (0,
|
|
20576
|
+
const relativeFilePath = (0, import_node_path139.relative)(nonRootBaseDir, filePath);
|
|
20306
20577
|
checkPathTraversal({
|
|
20307
20578
|
relativePath: relativeFilePath,
|
|
20308
20579
|
intendedRootDir: nonRootBaseDir
|
|
@@ -20421,14 +20692,14 @@ s/<command> [arguments]
|
|
|
20421
20692
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
20422
20693
|
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
20694
|
|
|
20424
|
-
When users call a custom slash command, you have to look for the markdown file, \`${(0,
|
|
20695
|
+
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
20696
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
20426
20697
|
|
|
20427
20698
|
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
20699
|
|
|
20429
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0,
|
|
20700
|
+
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
20701
|
|
|
20431
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0,
|
|
20702
|
+
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
20703
|
const skillsSection = skills ? this.generateSkillsSection(skills) : "";
|
|
20433
20704
|
const result = [
|
|
20434
20705
|
overview,
|
|
@@ -20528,7 +20799,7 @@ function warnUnsupportedTargets(params) {
|
|
|
20528
20799
|
}
|
|
20529
20800
|
}
|
|
20530
20801
|
async function checkRulesyncDirExists(params) {
|
|
20531
|
-
return fileExists((0,
|
|
20802
|
+
return fileExists((0, import_node_path140.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
|
|
20532
20803
|
}
|
|
20533
20804
|
async function generate(params) {
|
|
20534
20805
|
const { config, logger } = params;
|