rulesync 8.14.0 → 8.15.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 +4 -4
- package/dist/{chunk-C7PHKGD2.js → chunk-UMJWBQ2X.js} +1732 -761
- package/dist/cli/index.cjs +2068 -1093
- package/dist/cli/index.js +6 -2
- package/dist/index.cjs +1768 -797
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -9898,11 +9898,11 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
9898
9898
|
};
|
|
9899
9899
|
|
|
9900
9900
|
// src/features/permissions/permissions-processor.ts
|
|
9901
|
-
var
|
|
9901
|
+
var import_mini37 = require("zod/mini");
|
|
9902
9902
|
|
|
9903
|
-
// src/features/permissions/
|
|
9903
|
+
// src/features/permissions/augmentcode-permissions.ts
|
|
9904
9904
|
var import_node_path68 = require("path");
|
|
9905
|
-
var
|
|
9905
|
+
var import_mini30 = require("zod/mini");
|
|
9906
9906
|
|
|
9907
9907
|
// src/features/permissions/rulesync-permissions.ts
|
|
9908
9908
|
var import_node_path67 = require("path");
|
|
@@ -9997,7 +9997,329 @@ var ToolPermissions = class extends ToolFile {
|
|
|
9997
9997
|
}
|
|
9998
9998
|
};
|
|
9999
9999
|
|
|
10000
|
+
// src/features/permissions/augmentcode-permissions.ts
|
|
10001
|
+
var AugmentPermissionTypeSchema = import_mini30.z.enum(["allow", "deny", "ask-user"]);
|
|
10002
|
+
var AugmentToolPermissionSchema = import_mini30.z.looseObject({
|
|
10003
|
+
toolName: import_mini30.z.string(),
|
|
10004
|
+
shellInputRegex: import_mini30.z.optional(import_mini30.z.string()),
|
|
10005
|
+
permission: import_mini30.z.looseObject({
|
|
10006
|
+
type: AugmentPermissionTypeSchema
|
|
10007
|
+
})
|
|
10008
|
+
});
|
|
10009
|
+
var AugmentSettingsSchema = import_mini30.z.looseObject({
|
|
10010
|
+
toolPermissions: import_mini30.z.optional(import_mini30.z.array(AugmentToolPermissionSchema))
|
|
10011
|
+
});
|
|
10012
|
+
var CANONICAL_TO_AUGMENT_TOOL_NAMES = {
|
|
10013
|
+
bash: "launch-process",
|
|
10014
|
+
read: "view",
|
|
10015
|
+
edit: "str-replace-editor",
|
|
10016
|
+
write: "save-file",
|
|
10017
|
+
webfetch: "web-fetch",
|
|
10018
|
+
websearch: "web-search"
|
|
10019
|
+
};
|
|
10020
|
+
var AUGMENT_TO_CANONICAL_TOOL_NAMES = Object.fromEntries(
|
|
10021
|
+
Object.entries(CANONICAL_TO_AUGMENT_TOOL_NAMES).map(([k, v]) => [v, k])
|
|
10022
|
+
);
|
|
10023
|
+
function toAugmentToolName(canonical) {
|
|
10024
|
+
return CANONICAL_TO_AUGMENT_TOOL_NAMES[canonical] ?? canonical;
|
|
10025
|
+
}
|
|
10026
|
+
function toCanonicalToolName(augmentName) {
|
|
10027
|
+
return AUGMENT_TO_CANONICAL_TOOL_NAMES[augmentName] ?? augmentName;
|
|
10028
|
+
}
|
|
10029
|
+
function actionToAugmentType(action) {
|
|
10030
|
+
switch (action) {
|
|
10031
|
+
case "allow":
|
|
10032
|
+
return "allow";
|
|
10033
|
+
case "deny":
|
|
10034
|
+
return "deny";
|
|
10035
|
+
case "ask":
|
|
10036
|
+
return "ask-user";
|
|
10037
|
+
}
|
|
10038
|
+
}
|
|
10039
|
+
function augmentTypeToAction(type) {
|
|
10040
|
+
switch (type) {
|
|
10041
|
+
case "allow":
|
|
10042
|
+
return "allow";
|
|
10043
|
+
case "deny":
|
|
10044
|
+
return "deny";
|
|
10045
|
+
case "ask-user":
|
|
10046
|
+
return "ask";
|
|
10047
|
+
}
|
|
10048
|
+
}
|
|
10049
|
+
function globToShellRegex(glob) {
|
|
10050
|
+
let regex = "";
|
|
10051
|
+
for (const char of glob) {
|
|
10052
|
+
if (char === "*") {
|
|
10053
|
+
regex += ".*";
|
|
10054
|
+
} else if (char === "?") {
|
|
10055
|
+
regex += ".";
|
|
10056
|
+
} else if (/[\\^$.|+(){}[\]]/.test(char)) {
|
|
10057
|
+
regex += `\\${char}`;
|
|
10058
|
+
} else {
|
|
10059
|
+
regex += char;
|
|
10060
|
+
}
|
|
10061
|
+
}
|
|
10062
|
+
return `^${regex}$`;
|
|
10063
|
+
}
|
|
10064
|
+
function shellRegexToGlob(regex) {
|
|
10065
|
+
let body = regex;
|
|
10066
|
+
if (body.startsWith("^")) body = body.slice(1);
|
|
10067
|
+
if (body.endsWith("$")) body = body.slice(0, -1);
|
|
10068
|
+
let glob = "";
|
|
10069
|
+
let i = 0;
|
|
10070
|
+
while (i < body.length) {
|
|
10071
|
+
const ch = body[i];
|
|
10072
|
+
if (ch === "\\" && i + 1 < body.length) {
|
|
10073
|
+
glob += body[i + 1];
|
|
10074
|
+
i += 2;
|
|
10075
|
+
continue;
|
|
10076
|
+
}
|
|
10077
|
+
if (ch === "." && body[i + 1] === "*") {
|
|
10078
|
+
glob += "*";
|
|
10079
|
+
i += 2;
|
|
10080
|
+
continue;
|
|
10081
|
+
}
|
|
10082
|
+
if (ch === ".") {
|
|
10083
|
+
glob += "?";
|
|
10084
|
+
i += 1;
|
|
10085
|
+
continue;
|
|
10086
|
+
}
|
|
10087
|
+
glob += ch;
|
|
10088
|
+
i += 1;
|
|
10089
|
+
}
|
|
10090
|
+
return glob;
|
|
10091
|
+
}
|
|
10092
|
+
var MANAGED_AUGMENT_TOOL_NAMES = new Set(Object.values(CANONICAL_TO_AUGMENT_TOOL_NAMES));
|
|
10093
|
+
var AugmentcodePermissions = class _AugmentcodePermissions extends ToolPermissions {
|
|
10094
|
+
constructor(params) {
|
|
10095
|
+
super({
|
|
10096
|
+
...params,
|
|
10097
|
+
fileContent: params.fileContent ?? "{}"
|
|
10098
|
+
});
|
|
10099
|
+
}
|
|
10100
|
+
isDeletable() {
|
|
10101
|
+
return false;
|
|
10102
|
+
}
|
|
10103
|
+
static getSettablePaths(_options = {}) {
|
|
10104
|
+
return {
|
|
10105
|
+
relativeDirPath: ".augment",
|
|
10106
|
+
relativeFilePath: "settings.json"
|
|
10107
|
+
};
|
|
10108
|
+
}
|
|
10109
|
+
static async fromFile({
|
|
10110
|
+
outputRoot = process.cwd(),
|
|
10111
|
+
validate = true,
|
|
10112
|
+
global = false
|
|
10113
|
+
}) {
|
|
10114
|
+
const paths = _AugmentcodePermissions.getSettablePaths({ global });
|
|
10115
|
+
const filePath = (0, import_node_path68.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
10116
|
+
const fileContent = await readFileContentOrNull(filePath) ?? '{"toolPermissions":[]}';
|
|
10117
|
+
return new _AugmentcodePermissions({
|
|
10118
|
+
outputRoot,
|
|
10119
|
+
relativeDirPath: paths.relativeDirPath,
|
|
10120
|
+
relativeFilePath: paths.relativeFilePath,
|
|
10121
|
+
fileContent,
|
|
10122
|
+
validate
|
|
10123
|
+
});
|
|
10124
|
+
}
|
|
10125
|
+
static async fromRulesyncPermissions({
|
|
10126
|
+
outputRoot = process.cwd(),
|
|
10127
|
+
rulesyncPermissions,
|
|
10128
|
+
global = false,
|
|
10129
|
+
logger
|
|
10130
|
+
}) {
|
|
10131
|
+
const paths = _AugmentcodePermissions.getSettablePaths({ global });
|
|
10132
|
+
const filePath = (0, import_node_path68.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
10133
|
+
const existingContent = await readFileContentOrNull(filePath) ?? "{}";
|
|
10134
|
+
let settings;
|
|
10135
|
+
try {
|
|
10136
|
+
const parsed = JSON.parse(existingContent);
|
|
10137
|
+
const result = AugmentSettingsSchema.safeParse(parsed);
|
|
10138
|
+
if (!result.success) {
|
|
10139
|
+
throw new Error(formatError(result.error));
|
|
10140
|
+
}
|
|
10141
|
+
settings = result.data;
|
|
10142
|
+
} catch (error) {
|
|
10143
|
+
throw new Error(
|
|
10144
|
+
`Failed to parse existing AugmentCode settings at ${filePath}: ${formatError(error)}`,
|
|
10145
|
+
{ cause: error }
|
|
10146
|
+
);
|
|
10147
|
+
}
|
|
10148
|
+
const config = rulesyncPermissions.getJson();
|
|
10149
|
+
const generated = convertRulesyncToAugmentEntries({ config, logger });
|
|
10150
|
+
const existingEntries = settings.toolPermissions ?? [];
|
|
10151
|
+
const generatedKeys = new Set(
|
|
10152
|
+
generated.map((e) => `${e.toolName}|${e.shellInputRegex ?? ""}|${e.permission.type}`)
|
|
10153
|
+
);
|
|
10154
|
+
const preservedEntries = existingEntries.filter((entry) => {
|
|
10155
|
+
if (!MANAGED_AUGMENT_TOOL_NAMES.has(entry.toolName)) return true;
|
|
10156
|
+
if (entry.permission.type === "deny") {
|
|
10157
|
+
const key = `${entry.toolName}|${entry.shellInputRegex ?? ""}|${entry.permission.type}`;
|
|
10158
|
+
return !generatedKeys.has(key);
|
|
10159
|
+
}
|
|
10160
|
+
return false;
|
|
10161
|
+
});
|
|
10162
|
+
const sortedAll = sortAugmentEntries([...generated, ...preservedEntries]);
|
|
10163
|
+
const merged = {
|
|
10164
|
+
...settings,
|
|
10165
|
+
toolPermissions: sortedAll
|
|
10166
|
+
};
|
|
10167
|
+
const fileContent = JSON.stringify(merged, null, 2);
|
|
10168
|
+
return new _AugmentcodePermissions({
|
|
10169
|
+
outputRoot,
|
|
10170
|
+
relativeDirPath: paths.relativeDirPath,
|
|
10171
|
+
relativeFilePath: paths.relativeFilePath,
|
|
10172
|
+
fileContent,
|
|
10173
|
+
validate: true
|
|
10174
|
+
});
|
|
10175
|
+
}
|
|
10176
|
+
toRulesyncPermissions() {
|
|
10177
|
+
let settings;
|
|
10178
|
+
try {
|
|
10179
|
+
const parsed = JSON.parse(this.getFileContent());
|
|
10180
|
+
const result = AugmentSettingsSchema.safeParse(parsed);
|
|
10181
|
+
if (!result.success) {
|
|
10182
|
+
throw new Error(formatError(result.error));
|
|
10183
|
+
}
|
|
10184
|
+
settings = result.data;
|
|
10185
|
+
} catch (error) {
|
|
10186
|
+
throw new Error(
|
|
10187
|
+
`Failed to parse AugmentCode permissions content in ${(0, import_node_path68.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
10188
|
+
{ cause: error }
|
|
10189
|
+
);
|
|
10190
|
+
}
|
|
10191
|
+
const config = convertAugmentToRulesyncPermissions({
|
|
10192
|
+
entries: settings.toolPermissions ?? []
|
|
10193
|
+
});
|
|
10194
|
+
return this.toRulesyncPermissionsDefault({
|
|
10195
|
+
fileContent: JSON.stringify(config, null, 2)
|
|
10196
|
+
});
|
|
10197
|
+
}
|
|
10198
|
+
validate() {
|
|
10199
|
+
return { success: true, error: null };
|
|
10200
|
+
}
|
|
10201
|
+
static forDeletion({
|
|
10202
|
+
outputRoot = process.cwd(),
|
|
10203
|
+
relativeDirPath,
|
|
10204
|
+
relativeFilePath
|
|
10205
|
+
}) {
|
|
10206
|
+
return new _AugmentcodePermissions({
|
|
10207
|
+
outputRoot,
|
|
10208
|
+
relativeDirPath,
|
|
10209
|
+
relativeFilePath,
|
|
10210
|
+
fileContent: JSON.stringify({ toolPermissions: [] }, null, 2),
|
|
10211
|
+
validate: false
|
|
10212
|
+
});
|
|
10213
|
+
}
|
|
10214
|
+
};
|
|
10215
|
+
function convertRulesyncToAugmentEntries({
|
|
10216
|
+
config,
|
|
10217
|
+
logger
|
|
10218
|
+
}) {
|
|
10219
|
+
const entries = [];
|
|
10220
|
+
for (const [category, rules] of Object.entries(config.permission)) {
|
|
10221
|
+
const augmentToolName = toAugmentToolName(category);
|
|
10222
|
+
const isManaged = MANAGED_AUGMENT_TOOL_NAMES.has(augmentToolName);
|
|
10223
|
+
if (!isManaged && augmentToolName === category) {
|
|
10224
|
+
logger?.warn(
|
|
10225
|
+
`AugmentCode permissions: passing through unknown tool category '${category}' as toolName.`
|
|
10226
|
+
);
|
|
10227
|
+
}
|
|
10228
|
+
if (augmentToolName === "launch-process") {
|
|
10229
|
+
for (const [pattern, action] of Object.entries(rules)) {
|
|
10230
|
+
const augmentType = actionToAugmentType(action);
|
|
10231
|
+
if (pattern === "*") {
|
|
10232
|
+
entries.push({ toolName: augmentToolName, permission: { type: augmentType } });
|
|
10233
|
+
} else {
|
|
10234
|
+
entries.push({
|
|
10235
|
+
toolName: augmentToolName,
|
|
10236
|
+
shellInputRegex: globToShellRegex(pattern),
|
|
10237
|
+
permission: { type: augmentType }
|
|
10238
|
+
});
|
|
10239
|
+
}
|
|
10240
|
+
}
|
|
10241
|
+
continue;
|
|
10242
|
+
}
|
|
10243
|
+
const hasAnyDeny = Object.values(rules).some((a) => a === "deny");
|
|
10244
|
+
if (hasAnyDeny) {
|
|
10245
|
+
const collapsed = Object.keys(rules).filter((p) => p !== "*");
|
|
10246
|
+
if (collapsed.length > 0) {
|
|
10247
|
+
logger?.warn(
|
|
10248
|
+
`AugmentCode permissions: category '${category}' contains a 'deny' rule. AugmentCode lacks a per-input matcher for this tool category, so all rules collapse into a single catch-all 'deny' (fail-closed). Affected patterns: ${collapsed.join(", ")}.`
|
|
10249
|
+
);
|
|
10250
|
+
}
|
|
10251
|
+
entries.push({ toolName: augmentToolName, permission: { type: "deny" } });
|
|
10252
|
+
continue;
|
|
10253
|
+
}
|
|
10254
|
+
const droppedPatterns = [];
|
|
10255
|
+
for (const [pattern, action] of Object.entries(rules)) {
|
|
10256
|
+
if (pattern === "*") {
|
|
10257
|
+
entries.push({
|
|
10258
|
+
toolName: augmentToolName,
|
|
10259
|
+
permission: { type: actionToAugmentType(action) }
|
|
10260
|
+
});
|
|
10261
|
+
} else {
|
|
10262
|
+
droppedPatterns.push(pattern);
|
|
10263
|
+
}
|
|
10264
|
+
}
|
|
10265
|
+
if (droppedPatterns.length > 0) {
|
|
10266
|
+
logger?.warn(
|
|
10267
|
+
`AugmentCode permissions: dropping non-wildcard patterns for category '${category}' (${droppedPatterns.join(", ")}); AugmentCode does not document a per-input matcher for this tool. Use a 'deny' rule with pattern '*' if you need to block this tool entirely.`
|
|
10268
|
+
);
|
|
10269
|
+
}
|
|
10270
|
+
}
|
|
10271
|
+
return entries;
|
|
10272
|
+
}
|
|
10273
|
+
function sortAugmentEntries(entries) {
|
|
10274
|
+
const typePriority = {
|
|
10275
|
+
deny: 0,
|
|
10276
|
+
"ask-user": 1,
|
|
10277
|
+
allow: 2
|
|
10278
|
+
};
|
|
10279
|
+
const decorated = entries.map((entry, index) => ({ entry, index }));
|
|
10280
|
+
decorated.sort((a, b) => {
|
|
10281
|
+
const aHasRegex = a.entry.shellInputRegex ? 1 : 0;
|
|
10282
|
+
const bHasRegex = b.entry.shellInputRegex ? 1 : 0;
|
|
10283
|
+
if (aHasRegex !== bHasRegex) return bHasRegex - aHasRegex;
|
|
10284
|
+
const aType = typePriority[a.entry.permission.type];
|
|
10285
|
+
const bType = typePriority[b.entry.permission.type];
|
|
10286
|
+
if (aType !== bType) return aType - bType;
|
|
10287
|
+
if (a.entry.shellInputRegex && b.entry.shellInputRegex) {
|
|
10288
|
+
const aLen = a.entry.shellInputRegex.length;
|
|
10289
|
+
const bLen = b.entry.shellInputRegex.length;
|
|
10290
|
+
if (aLen !== bLen) return bLen - aLen;
|
|
10291
|
+
}
|
|
10292
|
+
return a.index - b.index;
|
|
10293
|
+
});
|
|
10294
|
+
return decorated.map((d) => d.entry);
|
|
10295
|
+
}
|
|
10296
|
+
function convertAugmentToRulesyncPermissions({
|
|
10297
|
+
entries
|
|
10298
|
+
}) {
|
|
10299
|
+
const actionPriority = {
|
|
10300
|
+
deny: 2,
|
|
10301
|
+
ask: 1,
|
|
10302
|
+
allow: 0
|
|
10303
|
+
};
|
|
10304
|
+
const permission = {};
|
|
10305
|
+
for (const entry of entries) {
|
|
10306
|
+
const canonical = toCanonicalToolName(entry.toolName);
|
|
10307
|
+
const action = augmentTypeToAction(entry.permission.type);
|
|
10308
|
+
const pattern = entry.toolName === "launch-process" && entry.shellInputRegex ? shellRegexToGlob(entry.shellInputRegex) : "*";
|
|
10309
|
+
if (!permission[canonical]) {
|
|
10310
|
+
permission[canonical] = {};
|
|
10311
|
+
}
|
|
10312
|
+
const existing = permission[canonical][pattern];
|
|
10313
|
+
if (existing === void 0 || actionPriority[action] > actionPriority[existing]) {
|
|
10314
|
+
permission[canonical][pattern] = action;
|
|
10315
|
+
}
|
|
10316
|
+
}
|
|
10317
|
+
return { permission };
|
|
10318
|
+
}
|
|
10319
|
+
|
|
10000
10320
|
// src/features/permissions/claudecode-permissions.ts
|
|
10321
|
+
var import_node_path69 = require("path");
|
|
10322
|
+
var import_es_toolkit4 = require("es-toolkit");
|
|
10001
10323
|
var CANONICAL_TO_CLAUDE_TOOL_NAMES = {
|
|
10002
10324
|
bash: "Bash",
|
|
10003
10325
|
read: "Read",
|
|
@@ -10016,7 +10338,7 @@ var CLAUDE_TO_CANONICAL_TOOL_NAMES = Object.fromEntries(
|
|
|
10016
10338
|
function toClaudeToolName(canonical) {
|
|
10017
10339
|
return CANONICAL_TO_CLAUDE_TOOL_NAMES[canonical] ?? canonical;
|
|
10018
10340
|
}
|
|
10019
|
-
function
|
|
10341
|
+
function toCanonicalToolName2(claudeName) {
|
|
10020
10342
|
return CLAUDE_TO_CANONICAL_TOOL_NAMES[claudeName] ?? claudeName;
|
|
10021
10343
|
}
|
|
10022
10344
|
function parseClaudePermissionEntry(entry) {
|
|
@@ -10058,7 +10380,7 @@ var ClaudecodePermissions = class _ClaudecodePermissions extends ToolPermissions
|
|
|
10058
10380
|
validate = true
|
|
10059
10381
|
}) {
|
|
10060
10382
|
const paths = _ClaudecodePermissions.getSettablePaths();
|
|
10061
|
-
const filePath = (0,
|
|
10383
|
+
const filePath = (0, import_node_path69.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
10062
10384
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"permissions":{}}';
|
|
10063
10385
|
return new _ClaudecodePermissions({
|
|
10064
10386
|
outputRoot,
|
|
@@ -10074,7 +10396,7 @@ var ClaudecodePermissions = class _ClaudecodePermissions extends ToolPermissions
|
|
|
10074
10396
|
logger
|
|
10075
10397
|
}) {
|
|
10076
10398
|
const paths = _ClaudecodePermissions.getSettablePaths();
|
|
10077
|
-
const filePath = (0,
|
|
10399
|
+
const filePath = (0, import_node_path69.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
10078
10400
|
const existingContent = await readOrInitializeFileContent(
|
|
10079
10401
|
filePath,
|
|
10080
10402
|
JSON.stringify({}, null, 2)
|
|
@@ -10151,7 +10473,7 @@ var ClaudecodePermissions = class _ClaudecodePermissions extends ToolPermissions
|
|
|
10151
10473
|
settings = JSON.parse(this.getFileContent());
|
|
10152
10474
|
} catch (error) {
|
|
10153
10475
|
throw new Error(
|
|
10154
|
-
`Failed to parse Claude permissions content in ${(0,
|
|
10476
|
+
`Failed to parse Claude permissions content in ${(0, import_node_path69.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
10155
10477
|
{ cause: error }
|
|
10156
10478
|
);
|
|
10157
10479
|
}
|
|
@@ -10210,7 +10532,7 @@ function convertClaudeToRulesyncPermissions(params) {
|
|
|
10210
10532
|
const processEntries = (entries, action) => {
|
|
10211
10533
|
for (const entry of entries) {
|
|
10212
10534
|
const { toolName, pattern } = parseClaudePermissionEntry(entry);
|
|
10213
|
-
const canonical =
|
|
10535
|
+
const canonical = toCanonicalToolName2(toolName);
|
|
10214
10536
|
if (!permission[canonical]) {
|
|
10215
10537
|
permission[canonical] = {};
|
|
10216
10538
|
}
|
|
@@ -10223,30 +10545,40 @@ function convertClaudeToRulesyncPermissions(params) {
|
|
|
10223
10545
|
return { permission };
|
|
10224
10546
|
}
|
|
10225
10547
|
|
|
10226
|
-
// src/features/permissions/
|
|
10227
|
-
var
|
|
10228
|
-
var
|
|
10229
|
-
var
|
|
10230
|
-
var
|
|
10231
|
-
|
|
10232
|
-
|
|
10233
|
-
|
|
10234
|
-
|
|
10235
|
-
|
|
10236
|
-
|
|
10548
|
+
// src/features/permissions/cline-permissions.ts
|
|
10549
|
+
var import_node_path70 = require("path");
|
|
10550
|
+
var import_es_toolkit5 = require("es-toolkit");
|
|
10551
|
+
var import_mini31 = require("zod/mini");
|
|
10552
|
+
var ClineCommandPermissionsSchema = import_mini31.z.looseObject({
|
|
10553
|
+
allow: import_mini31.z.optional(import_mini31.z.array(import_mini31.z.string())),
|
|
10554
|
+
deny: import_mini31.z.optional(import_mini31.z.array(import_mini31.z.string())),
|
|
10555
|
+
allowRedirects: import_mini31.z.optional(import_mini31.z.boolean())
|
|
10556
|
+
});
|
|
10557
|
+
var ClinePermissions = class _ClinePermissions extends ToolPermissions {
|
|
10558
|
+
constructor(params) {
|
|
10559
|
+
super({
|
|
10560
|
+
...params,
|
|
10561
|
+
fileContent: params.fileContent ?? "{}"
|
|
10562
|
+
});
|
|
10237
10563
|
}
|
|
10238
10564
|
isDeletable() {
|
|
10239
10565
|
return false;
|
|
10240
10566
|
}
|
|
10567
|
+
static getSettablePaths(_options = {}) {
|
|
10568
|
+
return {
|
|
10569
|
+
relativeDirPath: ".cline",
|
|
10570
|
+
relativeFilePath: "command-permissions.json"
|
|
10571
|
+
};
|
|
10572
|
+
}
|
|
10241
10573
|
static async fromFile({
|
|
10242
10574
|
outputRoot = process.cwd(),
|
|
10243
10575
|
validate = true,
|
|
10244
10576
|
global = false
|
|
10245
10577
|
}) {
|
|
10246
|
-
const paths =
|
|
10247
|
-
const filePath = (0,
|
|
10248
|
-
const fileContent = await readFileContentOrNull(filePath) ??
|
|
10249
|
-
return new
|
|
10578
|
+
const paths = _ClinePermissions.getSettablePaths({ global });
|
|
10579
|
+
const filePath = (0, import_node_path70.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
10580
|
+
const fileContent = await readFileContentOrNull(filePath) ?? "{}";
|
|
10581
|
+
return new _ClinePermissions({
|
|
10250
10582
|
outputRoot,
|
|
10251
10583
|
relativeDirPath: paths.relativeDirPath,
|
|
10252
10584
|
relativeFilePath: paths.relativeFilePath,
|
|
@@ -10257,56 +10589,216 @@ var CodexcliPermissions = class _CodexcliPermissions extends ToolPermissions {
|
|
|
10257
10589
|
static async fromRulesyncPermissions({
|
|
10258
10590
|
outputRoot = process.cwd(),
|
|
10259
10591
|
rulesyncPermissions,
|
|
10260
|
-
|
|
10261
|
-
logger
|
|
10262
|
-
global = false
|
|
10592
|
+
global = false,
|
|
10593
|
+
logger
|
|
10263
10594
|
}) {
|
|
10264
|
-
const paths =
|
|
10265
|
-
const filePath = (0,
|
|
10266
|
-
const existingContent = await readFileContentOrNull(filePath) ??
|
|
10267
|
-
|
|
10268
|
-
const profile = convertRulesyncToCodexProfile({
|
|
10269
|
-
config: rulesyncPermissions.getJson(),
|
|
10270
|
-
logger
|
|
10271
|
-
});
|
|
10272
|
-
const permissionsTable = toMutableTable(parsed.permissions);
|
|
10273
|
-
permissionsTable[RULESYNC_PROFILE_NAME] = profile;
|
|
10274
|
-
parsed.permissions = permissionsTable;
|
|
10275
|
-
parsed.default_permissions = RULESYNC_PROFILE_NAME;
|
|
10276
|
-
return new _CodexcliPermissions({
|
|
10277
|
-
outputRoot,
|
|
10278
|
-
relativeDirPath: paths.relativeDirPath,
|
|
10279
|
-
relativeFilePath: paths.relativeFilePath,
|
|
10280
|
-
fileContent: smolToml4.stringify(parsed),
|
|
10281
|
-
validate
|
|
10282
|
-
});
|
|
10283
|
-
}
|
|
10284
|
-
toRulesyncPermissions() {
|
|
10285
|
-
let parsed;
|
|
10595
|
+
const paths = _ClinePermissions.getSettablePaths({ global });
|
|
10596
|
+
const filePath = (0, import_node_path70.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
10597
|
+
const existingContent = await readFileContentOrNull(filePath) ?? "{}";
|
|
10598
|
+
let existing;
|
|
10286
10599
|
try {
|
|
10287
|
-
parsed =
|
|
10600
|
+
const parsed = JSON.parse(existingContent);
|
|
10601
|
+
const result = ClineCommandPermissionsSchema.safeParse(parsed);
|
|
10602
|
+
if (!result.success) {
|
|
10603
|
+
throw new Error(formatError(result.error));
|
|
10604
|
+
}
|
|
10605
|
+
existing = result.data;
|
|
10288
10606
|
} catch (error) {
|
|
10289
10607
|
throw new Error(
|
|
10290
|
-
`Failed to parse
|
|
10608
|
+
`Failed to parse existing Cline command-permissions at ${filePath}: ${formatError(error)}`,
|
|
10291
10609
|
{ cause: error }
|
|
10292
10610
|
);
|
|
10293
10611
|
}
|
|
10294
|
-
const
|
|
10295
|
-
const
|
|
10296
|
-
const
|
|
10297
|
-
const
|
|
10298
|
-
const
|
|
10299
|
-
|
|
10300
|
-
|
|
10301
|
-
|
|
10302
|
-
|
|
10303
|
-
|
|
10304
|
-
|
|
10305
|
-
|
|
10306
|
-
|
|
10307
|
-
|
|
10308
|
-
|
|
10309
|
-
|
|
10612
|
+
const config = rulesyncPermissions.getJson();
|
|
10613
|
+
const allow = [];
|
|
10614
|
+
const deny = [];
|
|
10615
|
+
const droppedCategories = [];
|
|
10616
|
+
const translatedAskPatterns = [];
|
|
10617
|
+
for (const [category, rules] of Object.entries(config.permission)) {
|
|
10618
|
+
if (category !== "bash") {
|
|
10619
|
+
droppedCategories.push(category);
|
|
10620
|
+
continue;
|
|
10621
|
+
}
|
|
10622
|
+
for (const [pattern, action] of Object.entries(rules)) {
|
|
10623
|
+
if (action === "ask") {
|
|
10624
|
+
translatedAskPatterns.push(pattern);
|
|
10625
|
+
deny.push(pattern);
|
|
10626
|
+
continue;
|
|
10627
|
+
}
|
|
10628
|
+
if (action === "allow") {
|
|
10629
|
+
allow.push(pattern);
|
|
10630
|
+
} else if (action === "deny") {
|
|
10631
|
+
deny.push(pattern);
|
|
10632
|
+
}
|
|
10633
|
+
}
|
|
10634
|
+
}
|
|
10635
|
+
if (droppedCategories.length > 0 || translatedAskPatterns.length > 0) {
|
|
10636
|
+
const parts = [];
|
|
10637
|
+
if (droppedCategories.length > 0) {
|
|
10638
|
+
parts.push(
|
|
10639
|
+
`non-bash categories [${droppedCategories.join(", ")}] (Cline only enforces shell commands; use the rulesync ignore feature for read/write restrictions)`
|
|
10640
|
+
);
|
|
10641
|
+
}
|
|
10642
|
+
if (translatedAskPatterns.length > 0) {
|
|
10643
|
+
parts.push(
|
|
10644
|
+
`'ask' rules for bash patterns [${translatedAskPatterns.join(", ")}] translated to 'deny' for fail-closed safety, since Cline lacks 'ask'`
|
|
10645
|
+
);
|
|
10646
|
+
}
|
|
10647
|
+
logger?.warn(`WARNING: Cline command permissions translation notice: ${parts.join("; ")}.`);
|
|
10648
|
+
}
|
|
10649
|
+
const dedupedAllow = (0, import_es_toolkit5.uniq)(allow.toSorted());
|
|
10650
|
+
const dedupedDeny = (0, import_es_toolkit5.uniq)(deny.toSorted());
|
|
10651
|
+
const mergedDeny = (0, import_es_toolkit5.uniq)([...existing.deny ?? [], ...dedupedDeny]).toSorted();
|
|
10652
|
+
const denySet = new Set(mergedDeny);
|
|
10653
|
+
const collisions = dedupedAllow.filter((p) => denySet.has(p));
|
|
10654
|
+
if (collisions.length > 0) {
|
|
10655
|
+
logger?.warn(
|
|
10656
|
+
`Cline command permissions: pattern(s) ${collisions.map((p) => `'${p}'`).join(", ")} appear in both 'allow' and 'deny'. Cline's evaluation order is not documented to guarantee deny-priority; the resulting behavior is undefined. Consider removing the duplicate rule from rulesync.`
|
|
10657
|
+
);
|
|
10658
|
+
}
|
|
10659
|
+
const next = {
|
|
10660
|
+
...existing,
|
|
10661
|
+
allow: dedupedAllow,
|
|
10662
|
+
deny: mergedDeny,
|
|
10663
|
+
allowRedirects: existing.allowRedirects ?? false
|
|
10664
|
+
};
|
|
10665
|
+
return new _ClinePermissions({
|
|
10666
|
+
outputRoot,
|
|
10667
|
+
relativeDirPath: paths.relativeDirPath,
|
|
10668
|
+
relativeFilePath: paths.relativeFilePath,
|
|
10669
|
+
fileContent: JSON.stringify(next, null, 2),
|
|
10670
|
+
validate: true
|
|
10671
|
+
});
|
|
10672
|
+
}
|
|
10673
|
+
toRulesyncPermissions() {
|
|
10674
|
+
let parsed;
|
|
10675
|
+
try {
|
|
10676
|
+
const json = JSON.parse(this.getFileContent());
|
|
10677
|
+
const result = ClineCommandPermissionsSchema.safeParse(json);
|
|
10678
|
+
if (!result.success) {
|
|
10679
|
+
throw new Error(formatError(result.error));
|
|
10680
|
+
}
|
|
10681
|
+
parsed = result.data;
|
|
10682
|
+
} catch (error) {
|
|
10683
|
+
throw new Error(
|
|
10684
|
+
`Failed to parse Cline permissions content in ${(0, import_node_path70.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
10685
|
+
{ cause: error }
|
|
10686
|
+
);
|
|
10687
|
+
}
|
|
10688
|
+
const bashRules = {};
|
|
10689
|
+
for (const pattern of parsed.allow ?? []) {
|
|
10690
|
+
bashRules[pattern] = "allow";
|
|
10691
|
+
}
|
|
10692
|
+
for (const pattern of parsed.deny ?? []) {
|
|
10693
|
+
bashRules[pattern] = "deny";
|
|
10694
|
+
}
|
|
10695
|
+
const config = Object.keys(bashRules).length > 0 ? { permission: { bash: bashRules } } : { permission: {} };
|
|
10696
|
+
return this.toRulesyncPermissionsDefault({
|
|
10697
|
+
fileContent: JSON.stringify(config, null, 2)
|
|
10698
|
+
});
|
|
10699
|
+
}
|
|
10700
|
+
validate() {
|
|
10701
|
+
return { success: true, error: null };
|
|
10702
|
+
}
|
|
10703
|
+
static forDeletion({
|
|
10704
|
+
outputRoot = process.cwd(),
|
|
10705
|
+
relativeDirPath,
|
|
10706
|
+
relativeFilePath
|
|
10707
|
+
}) {
|
|
10708
|
+
return new _ClinePermissions({
|
|
10709
|
+
outputRoot,
|
|
10710
|
+
relativeDirPath,
|
|
10711
|
+
relativeFilePath,
|
|
10712
|
+
fileContent: JSON.stringify({ allow: [], deny: [], allowRedirects: false }, null, 2),
|
|
10713
|
+
validate: false
|
|
10714
|
+
});
|
|
10715
|
+
}
|
|
10716
|
+
};
|
|
10717
|
+
|
|
10718
|
+
// src/features/permissions/codexcli-permissions.ts
|
|
10719
|
+
var import_node_path71 = require("path");
|
|
10720
|
+
var smolToml4 = __toESM(require("smol-toml"), 1);
|
|
10721
|
+
var RULESYNC_PROFILE_NAME = "rulesync";
|
|
10722
|
+
var RULESYNC_BASH_RULES_FILE_NAME = "rulesync.rules";
|
|
10723
|
+
var CodexcliPermissions = class _CodexcliPermissions extends ToolPermissions {
|
|
10724
|
+
static getSettablePaths(_options = {}) {
|
|
10725
|
+
return {
|
|
10726
|
+
relativeDirPath: ".codex",
|
|
10727
|
+
relativeFilePath: "config.toml"
|
|
10728
|
+
};
|
|
10729
|
+
}
|
|
10730
|
+
isDeletable() {
|
|
10731
|
+
return false;
|
|
10732
|
+
}
|
|
10733
|
+
static async fromFile({
|
|
10734
|
+
outputRoot = process.cwd(),
|
|
10735
|
+
validate = true,
|
|
10736
|
+
global = false
|
|
10737
|
+
}) {
|
|
10738
|
+
const paths = this.getSettablePaths({ global });
|
|
10739
|
+
const filePath = (0, import_node_path71.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
10740
|
+
const fileContent = await readFileContentOrNull(filePath) ?? smolToml4.stringify({});
|
|
10741
|
+
return new _CodexcliPermissions({
|
|
10742
|
+
outputRoot,
|
|
10743
|
+
relativeDirPath: paths.relativeDirPath,
|
|
10744
|
+
relativeFilePath: paths.relativeFilePath,
|
|
10745
|
+
fileContent,
|
|
10746
|
+
validate
|
|
10747
|
+
});
|
|
10748
|
+
}
|
|
10749
|
+
static async fromRulesyncPermissions({
|
|
10750
|
+
outputRoot = process.cwd(),
|
|
10751
|
+
rulesyncPermissions,
|
|
10752
|
+
validate = true,
|
|
10753
|
+
logger,
|
|
10754
|
+
global = false
|
|
10755
|
+
}) {
|
|
10756
|
+
const paths = this.getSettablePaths({ global });
|
|
10757
|
+
const filePath = (0, import_node_path71.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
10758
|
+
const existingContent = await readFileContentOrNull(filePath) ?? smolToml4.stringify({});
|
|
10759
|
+
const parsed = toMutableTable(smolToml4.parse(existingContent));
|
|
10760
|
+
const profile = convertRulesyncToCodexProfile({
|
|
10761
|
+
config: rulesyncPermissions.getJson(),
|
|
10762
|
+
logger
|
|
10763
|
+
});
|
|
10764
|
+
const permissionsTable = toMutableTable(parsed.permissions);
|
|
10765
|
+
permissionsTable[RULESYNC_PROFILE_NAME] = profile;
|
|
10766
|
+
parsed.permissions = permissionsTable;
|
|
10767
|
+
parsed.default_permissions = RULESYNC_PROFILE_NAME;
|
|
10768
|
+
return new _CodexcliPermissions({
|
|
10769
|
+
outputRoot,
|
|
10770
|
+
relativeDirPath: paths.relativeDirPath,
|
|
10771
|
+
relativeFilePath: paths.relativeFilePath,
|
|
10772
|
+
fileContent: smolToml4.stringify(parsed),
|
|
10773
|
+
validate
|
|
10774
|
+
});
|
|
10775
|
+
}
|
|
10776
|
+
toRulesyncPermissions() {
|
|
10777
|
+
let parsed;
|
|
10778
|
+
try {
|
|
10779
|
+
parsed = smolToml4.parse(this.getFileContent());
|
|
10780
|
+
} catch (error) {
|
|
10781
|
+
throw new Error(
|
|
10782
|
+
`Failed to parse Codex CLI permissions content in ${(0, import_node_path71.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
10783
|
+
{ cause: error }
|
|
10784
|
+
);
|
|
10785
|
+
}
|
|
10786
|
+
const table = toMutableTable(parsed);
|
|
10787
|
+
const defaultProfile = typeof table.default_permissions === "string" ? table.default_permissions : void 0;
|
|
10788
|
+
const permissionsTable = toMutableTable(table.permissions);
|
|
10789
|
+
const profile = toCodexProfile(permissionsTable[defaultProfile ?? RULESYNC_PROFILE_NAME]) ?? toCodexProfile(permissionsTable[RULESYNC_PROFILE_NAME]);
|
|
10790
|
+
const config = convertCodexProfileToRulesync(profile);
|
|
10791
|
+
return this.toRulesyncPermissionsDefault({
|
|
10792
|
+
fileContent: JSON.stringify(config, null, 2)
|
|
10793
|
+
});
|
|
10794
|
+
}
|
|
10795
|
+
validate() {
|
|
10796
|
+
return { success: true, error: null };
|
|
10797
|
+
}
|
|
10798
|
+
static forDeletion({
|
|
10799
|
+
outputRoot = process.cwd(),
|
|
10800
|
+
relativeDirPath,
|
|
10801
|
+
relativeFilePath
|
|
10310
10802
|
}) {
|
|
10311
10803
|
return new _CodexcliPermissions({
|
|
10312
10804
|
outputRoot,
|
|
@@ -10328,7 +10820,7 @@ function createCodexcliBashRulesFile({
|
|
|
10328
10820
|
}) {
|
|
10329
10821
|
return new CodexcliRulesFile({
|
|
10330
10822
|
outputRoot,
|
|
10331
|
-
relativeDirPath: (0,
|
|
10823
|
+
relativeDirPath: (0, import_node_path71.join)(".codex", "rules"),
|
|
10332
10824
|
relativeFilePath: RULESYNC_BASH_RULES_FILE_NAME,
|
|
10333
10825
|
fileContent: buildCodexBashRulesContent(config)
|
|
10334
10826
|
});
|
|
@@ -10483,8 +10975,8 @@ function mapBashActionToDecision(action) {
|
|
|
10483
10975
|
}
|
|
10484
10976
|
|
|
10485
10977
|
// src/features/permissions/cursor-permissions.ts
|
|
10486
|
-
var
|
|
10487
|
-
var
|
|
10978
|
+
var import_node_path72 = require("path");
|
|
10979
|
+
var import_es_toolkit6 = require("es-toolkit");
|
|
10488
10980
|
var CANONICAL_TO_CURSOR_TYPE = {
|
|
10489
10981
|
bash: "Shell",
|
|
10490
10982
|
read: "Read",
|
|
@@ -10601,7 +11093,7 @@ var CursorPermissions = class _CursorPermissions extends ToolPermissions {
|
|
|
10601
11093
|
global = false
|
|
10602
11094
|
}) {
|
|
10603
11095
|
const paths = _CursorPermissions.getSettablePaths({ global });
|
|
10604
|
-
const filePath = (0,
|
|
11096
|
+
const filePath = (0, import_node_path72.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
10605
11097
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"permissions":{}}';
|
|
10606
11098
|
return new _CursorPermissions({
|
|
10607
11099
|
outputRoot,
|
|
@@ -10618,7 +11110,7 @@ var CursorPermissions = class _CursorPermissions extends ToolPermissions {
|
|
|
10618
11110
|
global = false
|
|
10619
11111
|
}) {
|
|
10620
11112
|
const paths = _CursorPermissions.getSettablePaths({ global });
|
|
10621
|
-
const filePath = (0,
|
|
11113
|
+
const filePath = (0, import_node_path72.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
10622
11114
|
const existingContent = await readOrInitializeFileContent(
|
|
10623
11115
|
filePath,
|
|
10624
11116
|
JSON.stringify({}, null, 2)
|
|
@@ -10662,8 +11154,8 @@ var CursorPermissions = class _CursorPermissions extends ToolPermissions {
|
|
|
10662
11154
|
const mergedPermissions = {
|
|
10663
11155
|
...existingPermissions
|
|
10664
11156
|
};
|
|
10665
|
-
const mergedAllow = (0,
|
|
10666
|
-
const mergedDeny = (0,
|
|
11157
|
+
const mergedAllow = (0, import_es_toolkit6.uniq)([...preservedAllow, ...allow].toSorted());
|
|
11158
|
+
const mergedDeny = (0, import_es_toolkit6.uniq)([...preservedDeny, ...deny].toSorted());
|
|
10667
11159
|
if (mergedAllow.length > 0) {
|
|
10668
11160
|
mergedPermissions.allow = mergedAllow;
|
|
10669
11161
|
} else {
|
|
@@ -10694,7 +11186,7 @@ var CursorPermissions = class _CursorPermissions extends ToolPermissions {
|
|
|
10694
11186
|
settings = asCursorCliConfig(JSON.parse(this.getFileContent()));
|
|
10695
11187
|
} catch (error) {
|
|
10696
11188
|
throw new Error(
|
|
10697
|
-
`Failed to parse Cursor CLI permissions content in ${(0,
|
|
11189
|
+
`Failed to parse Cursor CLI permissions content in ${(0, import_node_path72.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
10698
11190
|
{ cause: error }
|
|
10699
11191
|
);
|
|
10700
11192
|
}
|
|
@@ -10769,10 +11261,10 @@ function convertCursorToRulesyncPermissions(params) {
|
|
|
10769
11261
|
}
|
|
10770
11262
|
|
|
10771
11263
|
// src/features/permissions/geminicli-permissions.ts
|
|
10772
|
-
var
|
|
11264
|
+
var import_node_path73 = require("path");
|
|
10773
11265
|
var smolToml5 = __toESM(require("smol-toml"), 1);
|
|
10774
|
-
var
|
|
10775
|
-
var GEMINICLI_POLICY_RELATIVE_DIR_PATH = (0,
|
|
11266
|
+
var import_mini32 = require("zod/mini");
|
|
11267
|
+
var GEMINICLI_POLICY_RELATIVE_DIR_PATH = (0, import_node_path73.join)(".gemini", "policies");
|
|
10776
11268
|
var GEMINICLI_POLICY_FILE_NAME = "rulesync.toml";
|
|
10777
11269
|
var RULESYNC_TO_GEMINICLI_TOOL_NAME = {
|
|
10778
11270
|
bash: "run_shell_command",
|
|
@@ -10813,7 +11305,7 @@ var GeminicliPermissions = class _GeminicliPermissions extends ToolPermissions {
|
|
|
10813
11305
|
global = false
|
|
10814
11306
|
}) {
|
|
10815
11307
|
const paths = this.getSettablePaths({ global });
|
|
10816
|
-
const filePath = (0,
|
|
11308
|
+
const filePath = (0, import_node_path73.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
10817
11309
|
const fileContent = await readFileContentOrNull(filePath) ?? "";
|
|
10818
11310
|
return new _GeminicliPermissions({
|
|
10819
11311
|
outputRoot,
|
|
@@ -10849,7 +11341,7 @@ var GeminicliPermissions = class _GeminicliPermissions extends ToolPermissions {
|
|
|
10849
11341
|
parsed = smolToml5.parse(fileContent);
|
|
10850
11342
|
} catch (error) {
|
|
10851
11343
|
throw new Error(
|
|
10852
|
-
`Failed to parse Gemini CLI policy TOML in ${(0,
|
|
11344
|
+
`Failed to parse Gemini CLI policy TOML in ${(0, import_node_path73.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
10853
11345
|
{ cause: error }
|
|
10854
11346
|
);
|
|
10855
11347
|
}
|
|
@@ -11099,14 +11591,14 @@ function regexToGlobPattern(regex) {
|
|
|
11099
11591
|
}
|
|
11100
11592
|
return glob;
|
|
11101
11593
|
}
|
|
11102
|
-
var GeminicliPolicyRuleSchema =
|
|
11103
|
-
toolName:
|
|
11104
|
-
decision:
|
|
11105
|
-
commandPrefix:
|
|
11106
|
-
argsPattern:
|
|
11594
|
+
var GeminicliPolicyRuleSchema = import_mini32.z.looseObject({
|
|
11595
|
+
toolName: import_mini32.z.string(),
|
|
11596
|
+
decision: import_mini32.z.optional(import_mini32.z.unknown()),
|
|
11597
|
+
commandPrefix: import_mini32.z.optional(import_mini32.z.string()),
|
|
11598
|
+
argsPattern: import_mini32.z.optional(import_mini32.z.string())
|
|
11107
11599
|
});
|
|
11108
|
-
var GeminicliPolicyFileSchema =
|
|
11109
|
-
rule:
|
|
11600
|
+
var GeminicliPolicyFileSchema = import_mini32.z.looseObject({
|
|
11601
|
+
rule: import_mini32.z.optional(import_mini32.z.array(import_mini32.z.looseObject({})))
|
|
11110
11602
|
});
|
|
11111
11603
|
function extractRules(parsed, logger) {
|
|
11112
11604
|
const parsedFile = GeminicliPolicyFileSchema.safeParse(parsed);
|
|
@@ -11140,18 +11632,192 @@ function extractPattern(rule) {
|
|
|
11140
11632
|
return regexToGlobPattern(regex);
|
|
11141
11633
|
}
|
|
11142
11634
|
|
|
11635
|
+
// src/features/permissions/kilo-permissions.ts
|
|
11636
|
+
var import_node_path74 = require("path");
|
|
11637
|
+
var import_jsonc_parser5 = require("jsonc-parser");
|
|
11638
|
+
var import_mini33 = require("zod/mini");
|
|
11639
|
+
var KiloPermissionSchema = import_mini33.z.union([
|
|
11640
|
+
import_mini33.z.enum(["allow", "ask", "deny"]),
|
|
11641
|
+
import_mini33.z.record(import_mini33.z.string(), import_mini33.z.enum(["allow", "ask", "deny"]))
|
|
11642
|
+
]);
|
|
11643
|
+
var KiloPermissionsConfigSchema = import_mini33.z.looseObject({
|
|
11644
|
+
permission: import_mini33.z.optional(import_mini33.z.record(import_mini33.z.string(), KiloPermissionSchema))
|
|
11645
|
+
});
|
|
11646
|
+
var KILO_FILE_NAME = "kilo.jsonc";
|
|
11647
|
+
function parseKiloJsoncStrict(content, filePath) {
|
|
11648
|
+
const errors = [];
|
|
11649
|
+
const parsed = (0, import_jsonc_parser5.parse)(content, errors, { allowTrailingComma: true });
|
|
11650
|
+
const first = errors[0];
|
|
11651
|
+
if (first) {
|
|
11652
|
+
throw new Error(
|
|
11653
|
+
`Failed to parse Kilo Code config at ${filePath}: ${(0, import_jsonc_parser5.printParseErrorCode)(first.error)} at offset ${first.offset}`
|
|
11654
|
+
);
|
|
11655
|
+
}
|
|
11656
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
11657
|
+
return parsed;
|
|
11658
|
+
}
|
|
11659
|
+
return {};
|
|
11660
|
+
}
|
|
11661
|
+
function collectKiloDenyPatterns(value) {
|
|
11662
|
+
if (typeof value === "string") {
|
|
11663
|
+
return value === "deny" ? ["*"] : [];
|
|
11664
|
+
}
|
|
11665
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
11666
|
+
const patterns = [];
|
|
11667
|
+
for (const [pattern, action] of Object.entries(value)) {
|
|
11668
|
+
if (action === "deny") {
|
|
11669
|
+
patterns.push(pattern);
|
|
11670
|
+
}
|
|
11671
|
+
}
|
|
11672
|
+
return patterns;
|
|
11673
|
+
}
|
|
11674
|
+
return [];
|
|
11675
|
+
}
|
|
11676
|
+
var KiloPermissions = class _KiloPermissions extends ToolPermissions {
|
|
11677
|
+
json;
|
|
11678
|
+
constructor(params) {
|
|
11679
|
+
super(params);
|
|
11680
|
+
const parsed = (0, import_jsonc_parser5.parse)(this.fileContent || "{}");
|
|
11681
|
+
if (params.validate !== false) {
|
|
11682
|
+
this.json = KiloPermissionsConfigSchema.parse(parsed);
|
|
11683
|
+
} else {
|
|
11684
|
+
const result = KiloPermissionsConfigSchema.safeParse(parsed);
|
|
11685
|
+
this.json = result.success ? result.data : {};
|
|
11686
|
+
}
|
|
11687
|
+
}
|
|
11688
|
+
getJson() {
|
|
11689
|
+
return this.json;
|
|
11690
|
+
}
|
|
11691
|
+
isDeletable() {
|
|
11692
|
+
return false;
|
|
11693
|
+
}
|
|
11694
|
+
static getSettablePaths({
|
|
11695
|
+
global = false
|
|
11696
|
+
} = {}) {
|
|
11697
|
+
return global ? { relativeDirPath: (0, import_node_path74.join)(".config", "kilo"), relativeFilePath: KILO_FILE_NAME } : { relativeDirPath: ".", relativeFilePath: KILO_FILE_NAME };
|
|
11698
|
+
}
|
|
11699
|
+
static async fromFile({
|
|
11700
|
+
outputRoot = process.cwd(),
|
|
11701
|
+
validate = true,
|
|
11702
|
+
global = false
|
|
11703
|
+
}) {
|
|
11704
|
+
const basePaths = _KiloPermissions.getSettablePaths({ global });
|
|
11705
|
+
const filePath = (0, import_node_path74.join)(outputRoot, basePaths.relativeDirPath, basePaths.relativeFilePath);
|
|
11706
|
+
const fileContent = await readFileContentOrNull(filePath);
|
|
11707
|
+
const parsed = parseKiloJsoncStrict(fileContent ?? "{}", filePath);
|
|
11708
|
+
const nextJson = { ...parsed, permission: parsed.permission ?? {} };
|
|
11709
|
+
return new _KiloPermissions({
|
|
11710
|
+
outputRoot,
|
|
11711
|
+
relativeDirPath: basePaths.relativeDirPath,
|
|
11712
|
+
relativeFilePath: basePaths.relativeFilePath,
|
|
11713
|
+
fileContent: JSON.stringify(nextJson, null, 2),
|
|
11714
|
+
validate
|
|
11715
|
+
});
|
|
11716
|
+
}
|
|
11717
|
+
static async fromRulesyncPermissions({
|
|
11718
|
+
outputRoot = process.cwd(),
|
|
11719
|
+
rulesyncPermissions,
|
|
11720
|
+
global = false,
|
|
11721
|
+
logger
|
|
11722
|
+
}) {
|
|
11723
|
+
const basePaths = _KiloPermissions.getSettablePaths({ global });
|
|
11724
|
+
const filePath = (0, import_node_path74.join)(outputRoot, basePaths.relativeDirPath, basePaths.relativeFilePath);
|
|
11725
|
+
const fileContent = await readFileContentOrNull(filePath);
|
|
11726
|
+
const parsed = parseKiloJsoncStrict(fileContent ?? "{}", filePath);
|
|
11727
|
+
const parsedPermission = parsed.permission;
|
|
11728
|
+
const existingPermission = parsedPermission && typeof parsedPermission === "object" && !Array.isArray(parsedPermission) ? { ...parsedPermission } : {};
|
|
11729
|
+
const rulesyncPermission = rulesyncPermissions.getJson().permission;
|
|
11730
|
+
const droppedDenyByKey = {};
|
|
11731
|
+
for (const key of Object.keys(rulesyncPermission)) {
|
|
11732
|
+
const previous = existingPermission[key];
|
|
11733
|
+
const previousDenyPatterns = collectKiloDenyPatterns(previous);
|
|
11734
|
+
const nextDenyPatterns = new Set(collectKiloDenyPatterns(rulesyncPermission[key]));
|
|
11735
|
+
const dropped = previousDenyPatterns.filter((p) => !nextDenyPatterns.has(p));
|
|
11736
|
+
if (dropped.length > 0) {
|
|
11737
|
+
droppedDenyByKey[key] = dropped;
|
|
11738
|
+
}
|
|
11739
|
+
}
|
|
11740
|
+
if (Object.keys(droppedDenyByKey).length > 0) {
|
|
11741
|
+
const summary = Object.entries(droppedDenyByKey).map(([key, patterns]) => `${key}: [${patterns.join(", ")}]`).join("; ");
|
|
11742
|
+
logger?.warn(
|
|
11743
|
+
`WARNING: Kilo permissions regeneration drops existing 'deny' rule(s) because rulesync output owns these tool keys. Dropped \u2014 ${summary}. To preserve these denies, add them to '.rulesync/permissions.json'.`
|
|
11744
|
+
);
|
|
11745
|
+
}
|
|
11746
|
+
const mergedPermission = { ...existingPermission };
|
|
11747
|
+
for (const [key, value] of Object.entries(rulesyncPermission)) {
|
|
11748
|
+
mergedPermission[key] = value;
|
|
11749
|
+
}
|
|
11750
|
+
const nextJson = {
|
|
11751
|
+
...parsed,
|
|
11752
|
+
permission: mergedPermission
|
|
11753
|
+
};
|
|
11754
|
+
return new _KiloPermissions({
|
|
11755
|
+
outputRoot,
|
|
11756
|
+
relativeDirPath: basePaths.relativeDirPath,
|
|
11757
|
+
relativeFilePath: basePaths.relativeFilePath,
|
|
11758
|
+
fileContent: JSON.stringify(nextJson, null, 2),
|
|
11759
|
+
validate: true
|
|
11760
|
+
});
|
|
11761
|
+
}
|
|
11762
|
+
toRulesyncPermissions() {
|
|
11763
|
+
const permission = this.normalizePermission(this.json.permission);
|
|
11764
|
+
return this.toRulesyncPermissionsDefault({
|
|
11765
|
+
fileContent: JSON.stringify({ permission }, null, 2)
|
|
11766
|
+
});
|
|
11767
|
+
}
|
|
11768
|
+
validate() {
|
|
11769
|
+
try {
|
|
11770
|
+
const json = (0, import_jsonc_parser5.parse)(this.fileContent || "{}");
|
|
11771
|
+
const result = KiloPermissionsConfigSchema.safeParse(json);
|
|
11772
|
+
if (!result.success) {
|
|
11773
|
+
return { success: false, error: result.error };
|
|
11774
|
+
}
|
|
11775
|
+
return { success: true, error: null };
|
|
11776
|
+
} catch (error) {
|
|
11777
|
+
return {
|
|
11778
|
+
success: false,
|
|
11779
|
+
error: new Error(`Failed to parse Kilo permissions JSON: ${formatError(error)}`)
|
|
11780
|
+
};
|
|
11781
|
+
}
|
|
11782
|
+
}
|
|
11783
|
+
static forDeletion({
|
|
11784
|
+
outputRoot = process.cwd(),
|
|
11785
|
+
relativeDirPath,
|
|
11786
|
+
relativeFilePath
|
|
11787
|
+
}) {
|
|
11788
|
+
return new _KiloPermissions({
|
|
11789
|
+
outputRoot,
|
|
11790
|
+
relativeDirPath,
|
|
11791
|
+
relativeFilePath,
|
|
11792
|
+
fileContent: JSON.stringify({ permission: {} }, null, 2),
|
|
11793
|
+
validate: false
|
|
11794
|
+
});
|
|
11795
|
+
}
|
|
11796
|
+
normalizePermission(permission) {
|
|
11797
|
+
if (!permission) {
|
|
11798
|
+
return {};
|
|
11799
|
+
}
|
|
11800
|
+
return Object.fromEntries(
|
|
11801
|
+
Object.entries(permission).map(([tool, value]) => [
|
|
11802
|
+
tool,
|
|
11803
|
+
typeof value === "string" ? { "*": value } : value
|
|
11804
|
+
])
|
|
11805
|
+
);
|
|
11806
|
+
}
|
|
11807
|
+
};
|
|
11808
|
+
|
|
11143
11809
|
// src/features/permissions/kiro-permissions.ts
|
|
11144
|
-
var
|
|
11145
|
-
var
|
|
11146
|
-
var KiroAgentSchema =
|
|
11147
|
-
allowedTools:
|
|
11148
|
-
toolsSettings:
|
|
11810
|
+
var import_node_path75 = require("path");
|
|
11811
|
+
var import_mini34 = require("zod/mini");
|
|
11812
|
+
var KiroAgentSchema = import_mini34.z.looseObject({
|
|
11813
|
+
allowedTools: import_mini34.z.optional(import_mini34.z.array(import_mini34.z.string())),
|
|
11814
|
+
toolsSettings: import_mini34.z.optional(import_mini34.z.record(import_mini34.z.string(), import_mini34.z.unknown()))
|
|
11149
11815
|
});
|
|
11150
|
-
var UnknownRecordSchema =
|
|
11816
|
+
var UnknownRecordSchema = import_mini34.z.record(import_mini34.z.string(), import_mini34.z.unknown());
|
|
11151
11817
|
var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
11152
11818
|
static getSettablePaths(_options = {}) {
|
|
11153
11819
|
return {
|
|
11154
|
-
relativeDirPath: (0,
|
|
11820
|
+
relativeDirPath: (0, import_node_path75.join)(".kiro", "agents"),
|
|
11155
11821
|
relativeFilePath: "default.json"
|
|
11156
11822
|
};
|
|
11157
11823
|
}
|
|
@@ -11163,7 +11829,7 @@ var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
|
11163
11829
|
validate = true
|
|
11164
11830
|
}) {
|
|
11165
11831
|
const paths = this.getSettablePaths();
|
|
11166
|
-
const filePath = (0,
|
|
11832
|
+
const filePath = (0, import_node_path75.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11167
11833
|
const fileContent = await readFileContentOrNull(filePath) ?? JSON.stringify({}, null, 2);
|
|
11168
11834
|
return new _KiroPermissions({
|
|
11169
11835
|
outputRoot,
|
|
@@ -11180,7 +11846,7 @@ var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
|
11180
11846
|
logger
|
|
11181
11847
|
}) {
|
|
11182
11848
|
const paths = this.getSettablePaths();
|
|
11183
|
-
const filePath = (0,
|
|
11849
|
+
const filePath = (0, import_node_path75.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11184
11850
|
const existingContent = await readFileContentOrNull(filePath) ?? JSON.stringify({}, null, 2);
|
|
11185
11851
|
const parsedResult = KiroAgentSchema.safeParse(JSON.parse(existingContent));
|
|
11186
11852
|
if (!parsedResult.success) {
|
|
@@ -11204,7 +11870,7 @@ var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
|
11204
11870
|
parsed = KiroAgentSchema.parse(JSON.parse(this.getFileContent()));
|
|
11205
11871
|
} catch (error) {
|
|
11206
11872
|
throw new Error(
|
|
11207
|
-
`Failed to parse Kiro permissions content in ${(0,
|
|
11873
|
+
`Failed to parse Kiro permissions content in ${(0, import_node_path75.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
11208
11874
|
{ cause: error }
|
|
11209
11875
|
);
|
|
11210
11876
|
}
|
|
@@ -11329,21 +11995,21 @@ function asStringArray(value) {
|
|
|
11329
11995
|
}
|
|
11330
11996
|
|
|
11331
11997
|
// src/features/permissions/opencode-permissions.ts
|
|
11332
|
-
var
|
|
11333
|
-
var
|
|
11334
|
-
var
|
|
11335
|
-
var OpencodePermissionSchema =
|
|
11336
|
-
|
|
11337
|
-
|
|
11998
|
+
var import_node_path76 = require("path");
|
|
11999
|
+
var import_jsonc_parser6 = require("jsonc-parser");
|
|
12000
|
+
var import_mini35 = require("zod/mini");
|
|
12001
|
+
var OpencodePermissionSchema = import_mini35.z.union([
|
|
12002
|
+
import_mini35.z.enum(["allow", "ask", "deny"]),
|
|
12003
|
+
import_mini35.z.record(import_mini35.z.string(), import_mini35.z.enum(["allow", "ask", "deny"]))
|
|
11338
12004
|
]);
|
|
11339
|
-
var OpencodePermissionsConfigSchema =
|
|
11340
|
-
permission:
|
|
12005
|
+
var OpencodePermissionsConfigSchema = import_mini35.z.looseObject({
|
|
12006
|
+
permission: import_mini35.z.optional(import_mini35.z.record(import_mini35.z.string(), OpencodePermissionSchema))
|
|
11341
12007
|
});
|
|
11342
12008
|
var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
11343
12009
|
json;
|
|
11344
12010
|
constructor(params) {
|
|
11345
12011
|
super(params);
|
|
11346
|
-
this.json = OpencodePermissionsConfigSchema.parse((0,
|
|
12012
|
+
this.json = OpencodePermissionsConfigSchema.parse((0, import_jsonc_parser6.parse)(this.fileContent || "{}"));
|
|
11347
12013
|
}
|
|
11348
12014
|
getJson() {
|
|
11349
12015
|
return this.json;
|
|
@@ -11354,7 +12020,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
11354
12020
|
static getSettablePaths({
|
|
11355
12021
|
global = false
|
|
11356
12022
|
} = {}) {
|
|
11357
|
-
return global ? { relativeDirPath: (0,
|
|
12023
|
+
return global ? { relativeDirPath: (0, import_node_path76.join)(".config", "opencode"), relativeFilePath: "opencode.json" } : { relativeDirPath: ".", relativeFilePath: "opencode.json" };
|
|
11358
12024
|
}
|
|
11359
12025
|
static async fromFile({
|
|
11360
12026
|
outputRoot = process.cwd(),
|
|
@@ -11362,9 +12028,9 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
11362
12028
|
global = false
|
|
11363
12029
|
}) {
|
|
11364
12030
|
const basePaths = _OpencodePermissions.getSettablePaths({ global });
|
|
11365
|
-
const jsonDir = (0,
|
|
11366
|
-
const jsoncPath = (0,
|
|
11367
|
-
const jsonPath = (0,
|
|
12031
|
+
const jsonDir = (0, import_node_path76.join)(outputRoot, basePaths.relativeDirPath);
|
|
12032
|
+
const jsoncPath = (0, import_node_path76.join)(jsonDir, "opencode.jsonc");
|
|
12033
|
+
const jsonPath = (0, import_node_path76.join)(jsonDir, "opencode.json");
|
|
11368
12034
|
let fileContent = await readFileContentOrNull(jsoncPath);
|
|
11369
12035
|
let relativeFilePath = "opencode.jsonc";
|
|
11370
12036
|
if (!fileContent) {
|
|
@@ -11373,7 +12039,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
11373
12039
|
relativeFilePath = "opencode.json";
|
|
11374
12040
|
}
|
|
11375
12041
|
}
|
|
11376
|
-
const parsed = (0,
|
|
12042
|
+
const parsed = (0, import_jsonc_parser6.parse)(fileContent ?? "{}");
|
|
11377
12043
|
const nextJson = { ...parsed, permission: parsed.permission ?? {} };
|
|
11378
12044
|
return new _OpencodePermissions({
|
|
11379
12045
|
outputRoot,
|
|
@@ -11389,9 +12055,9 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
11389
12055
|
global = false
|
|
11390
12056
|
}) {
|
|
11391
12057
|
const basePaths = _OpencodePermissions.getSettablePaths({ global });
|
|
11392
|
-
const jsonDir = (0,
|
|
11393
|
-
const jsoncPath = (0,
|
|
11394
|
-
const jsonPath = (0,
|
|
12058
|
+
const jsonDir = (0, import_node_path76.join)(outputRoot, basePaths.relativeDirPath);
|
|
12059
|
+
const jsoncPath = (0, import_node_path76.join)(jsonDir, "opencode.jsonc");
|
|
12060
|
+
const jsonPath = (0, import_node_path76.join)(jsonDir, "opencode.json");
|
|
11395
12061
|
let fileContent = await readFileContentOrNull(jsoncPath);
|
|
11396
12062
|
let relativeFilePath = "opencode.jsonc";
|
|
11397
12063
|
if (!fileContent) {
|
|
@@ -11400,7 +12066,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
11400
12066
|
relativeFilePath = "opencode.json";
|
|
11401
12067
|
}
|
|
11402
12068
|
}
|
|
11403
|
-
const parsed = (0,
|
|
12069
|
+
const parsed = (0, import_jsonc_parser6.parse)(fileContent ?? "{}");
|
|
11404
12070
|
const nextJson = {
|
|
11405
12071
|
...parsed,
|
|
11406
12072
|
permission: rulesyncPermissions.getJson().permission
|
|
@@ -11434,43 +12100,315 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
11434
12100
|
};
|
|
11435
12101
|
}
|
|
11436
12102
|
}
|
|
11437
|
-
static forDeletion({
|
|
11438
|
-
outputRoot = process.cwd(),
|
|
11439
|
-
relativeDirPath,
|
|
11440
|
-
relativeFilePath
|
|
11441
|
-
}) {
|
|
11442
|
-
return new _OpencodePermissions({
|
|
11443
|
-
outputRoot,
|
|
11444
|
-
relativeDirPath,
|
|
11445
|
-
relativeFilePath,
|
|
11446
|
-
fileContent: JSON.stringify({ permission: {} }, null, 2),
|
|
11447
|
-
validate: false
|
|
11448
|
-
});
|
|
11449
|
-
}
|
|
11450
|
-
normalizePermission(permission) {
|
|
11451
|
-
if (!permission) {
|
|
11452
|
-
return {};
|
|
12103
|
+
static forDeletion({
|
|
12104
|
+
outputRoot = process.cwd(),
|
|
12105
|
+
relativeDirPath,
|
|
12106
|
+
relativeFilePath
|
|
12107
|
+
}) {
|
|
12108
|
+
return new _OpencodePermissions({
|
|
12109
|
+
outputRoot,
|
|
12110
|
+
relativeDirPath,
|
|
12111
|
+
relativeFilePath,
|
|
12112
|
+
fileContent: JSON.stringify({ permission: {} }, null, 2),
|
|
12113
|
+
validate: false
|
|
12114
|
+
});
|
|
12115
|
+
}
|
|
12116
|
+
normalizePermission(permission) {
|
|
12117
|
+
if (!permission) {
|
|
12118
|
+
return {};
|
|
12119
|
+
}
|
|
12120
|
+
return Object.fromEntries(
|
|
12121
|
+
Object.entries(permission).map(([tool, value]) => [
|
|
12122
|
+
tool,
|
|
12123
|
+
typeof value === "string" ? { "*": value } : value
|
|
12124
|
+
])
|
|
12125
|
+
);
|
|
12126
|
+
}
|
|
12127
|
+
};
|
|
12128
|
+
|
|
12129
|
+
// src/features/permissions/qwencode-permissions.ts
|
|
12130
|
+
var import_node_path77 = require("path");
|
|
12131
|
+
var import_es_toolkit7 = require("es-toolkit");
|
|
12132
|
+
var import_mini36 = require("zod/mini");
|
|
12133
|
+
var QwenSettingsPermissionsSchema = import_mini36.z.looseObject({
|
|
12134
|
+
allow: import_mini36.z.optional(import_mini36.z.array(import_mini36.z.string())),
|
|
12135
|
+
ask: import_mini36.z.optional(import_mini36.z.array(import_mini36.z.string())),
|
|
12136
|
+
deny: import_mini36.z.optional(import_mini36.z.array(import_mini36.z.string()))
|
|
12137
|
+
});
|
|
12138
|
+
var QwenSettingsSchema = import_mini36.z.looseObject({
|
|
12139
|
+
permissions: import_mini36.z.optional(QwenSettingsPermissionsSchema)
|
|
12140
|
+
});
|
|
12141
|
+
var moduleLogger2 = new ConsoleLogger();
|
|
12142
|
+
var CANONICAL_TO_QWEN_TOOL_NAMES = {
|
|
12143
|
+
bash: "Bash",
|
|
12144
|
+
read: "Read",
|
|
12145
|
+
edit: "Edit",
|
|
12146
|
+
write: "Write",
|
|
12147
|
+
webfetch: "WebFetch",
|
|
12148
|
+
websearch: "WebSearch",
|
|
12149
|
+
grep: "Grep",
|
|
12150
|
+
glob: "Glob",
|
|
12151
|
+
agent: "Agent"
|
|
12152
|
+
};
|
|
12153
|
+
var QWEN_TO_CANONICAL_TOOL_NAMES = Object.fromEntries(
|
|
12154
|
+
Object.entries(CANONICAL_TO_QWEN_TOOL_NAMES).map(([k, v]) => [v, k])
|
|
12155
|
+
);
|
|
12156
|
+
function toQwenToolName(canonical) {
|
|
12157
|
+
return CANONICAL_TO_QWEN_TOOL_NAMES[canonical] ?? canonical;
|
|
12158
|
+
}
|
|
12159
|
+
function toCanonicalToolName3(qwenName) {
|
|
12160
|
+
return QWEN_TO_CANONICAL_TOOL_NAMES[qwenName] ?? qwenName;
|
|
12161
|
+
}
|
|
12162
|
+
function parseQwenPermissionEntry(entry, options = {}) {
|
|
12163
|
+
const parenIndex = entry.indexOf("(");
|
|
12164
|
+
if (parenIndex === -1) {
|
|
12165
|
+
return { ok: true, toolName: entry, pattern: "*" };
|
|
12166
|
+
}
|
|
12167
|
+
const toolName = entry.slice(0, parenIndex);
|
|
12168
|
+
const lastParenIndex = entry.lastIndexOf(")");
|
|
12169
|
+
if (lastParenIndex < parenIndex) {
|
|
12170
|
+
options.logger?.warn(
|
|
12171
|
+
`Qwen permissions: malformed entry '${entry}' is missing a closing parenthesis.`
|
|
12172
|
+
);
|
|
12173
|
+
return { ok: false, toolName, raw: entry };
|
|
12174
|
+
}
|
|
12175
|
+
if (lastParenIndex !== entry.length - 1) {
|
|
12176
|
+
options.logger?.warn(
|
|
12177
|
+
`Qwen permissions: malformed entry '${entry}' has trailing characters after the closing parenthesis.`
|
|
12178
|
+
);
|
|
12179
|
+
return { ok: false, toolName, raw: entry };
|
|
12180
|
+
}
|
|
12181
|
+
const pattern = entry.slice(parenIndex + 1, lastParenIndex);
|
|
12182
|
+
return { ok: true, toolName, pattern: pattern || "*" };
|
|
12183
|
+
}
|
|
12184
|
+
function buildQwenPermissionEntry(toolName, pattern) {
|
|
12185
|
+
if (pattern === "*") {
|
|
12186
|
+
return toolName;
|
|
12187
|
+
}
|
|
12188
|
+
return `${toolName}(${pattern})`;
|
|
12189
|
+
}
|
|
12190
|
+
var QwencodePermissions = class _QwencodePermissions extends ToolPermissions {
|
|
12191
|
+
constructor(params) {
|
|
12192
|
+
super({
|
|
12193
|
+
...params,
|
|
12194
|
+
fileContent: params.fileContent ?? "{}"
|
|
12195
|
+
});
|
|
12196
|
+
}
|
|
12197
|
+
isDeletable() {
|
|
12198
|
+
return false;
|
|
12199
|
+
}
|
|
12200
|
+
static getSettablePaths(_options = {}) {
|
|
12201
|
+
return {
|
|
12202
|
+
relativeDirPath: ".qwen",
|
|
12203
|
+
relativeFilePath: "settings.json"
|
|
12204
|
+
};
|
|
12205
|
+
}
|
|
12206
|
+
static async fromFile({
|
|
12207
|
+
outputRoot = process.cwd(),
|
|
12208
|
+
validate = true,
|
|
12209
|
+
global = false
|
|
12210
|
+
}) {
|
|
12211
|
+
const paths = _QwencodePermissions.getSettablePaths({ global });
|
|
12212
|
+
const filePath = (0, import_node_path77.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
12213
|
+
const fileContent = await readFileContentOrNull(filePath) ?? '{"permissions":{}}';
|
|
12214
|
+
return new _QwencodePermissions({
|
|
12215
|
+
outputRoot,
|
|
12216
|
+
relativeDirPath: paths.relativeDirPath,
|
|
12217
|
+
relativeFilePath: paths.relativeFilePath,
|
|
12218
|
+
fileContent,
|
|
12219
|
+
validate
|
|
12220
|
+
});
|
|
12221
|
+
}
|
|
12222
|
+
static async fromRulesyncPermissions({
|
|
12223
|
+
outputRoot = process.cwd(),
|
|
12224
|
+
rulesyncPermissions,
|
|
12225
|
+
global = false,
|
|
12226
|
+
logger
|
|
12227
|
+
}) {
|
|
12228
|
+
const paths = _QwencodePermissions.getSettablePaths({ global });
|
|
12229
|
+
const filePath = (0, import_node_path77.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
12230
|
+
const existingContent = await readFileContentOrNull(filePath) ?? "{}";
|
|
12231
|
+
let settings;
|
|
12232
|
+
try {
|
|
12233
|
+
const parsed = JSON.parse(existingContent);
|
|
12234
|
+
const result = QwenSettingsSchema.safeParse(parsed);
|
|
12235
|
+
if (!result.success) {
|
|
12236
|
+
throw new Error(formatError(result.error));
|
|
12237
|
+
}
|
|
12238
|
+
settings = result.data;
|
|
12239
|
+
} catch (error) {
|
|
12240
|
+
throw new Error(
|
|
12241
|
+
`Failed to parse existing Qwen settings at ${filePath}: ${formatError(error)}`,
|
|
12242
|
+
{ cause: error }
|
|
12243
|
+
);
|
|
12244
|
+
}
|
|
12245
|
+
const config = rulesyncPermissions.getJson();
|
|
12246
|
+
const { allow, ask, deny } = convertRulesyncToQwenPermissions(config);
|
|
12247
|
+
const managedToolNames = new Set(
|
|
12248
|
+
Object.keys(config.permission).map((category) => toQwenToolName(category))
|
|
12249
|
+
);
|
|
12250
|
+
const existingPermissions = settings.permissions ?? {};
|
|
12251
|
+
const preservedAllow = (existingPermissions.allow ?? []).filter(
|
|
12252
|
+
(entry) => !managedToolNames.has(parseQwenPermissionEntry(entry, { logger }).toolName)
|
|
12253
|
+
);
|
|
12254
|
+
const preservedAsk = (existingPermissions.ask ?? []).filter(
|
|
12255
|
+
(entry) => !managedToolNames.has(parseQwenPermissionEntry(entry, { logger }).toolName)
|
|
12256
|
+
);
|
|
12257
|
+
const preservedDeny = (existingPermissions.deny ?? []).filter(
|
|
12258
|
+
(entry) => !managedToolNames.has(parseQwenPermissionEntry(entry, { logger }).toolName)
|
|
12259
|
+
);
|
|
12260
|
+
const mergedPermissions = {
|
|
12261
|
+
...existingPermissions
|
|
12262
|
+
};
|
|
12263
|
+
const mergedAllow = (0, import_es_toolkit7.uniq)([...preservedAllow, ...allow].toSorted());
|
|
12264
|
+
const mergedAsk = (0, import_es_toolkit7.uniq)([...preservedAsk, ...ask].toSorted());
|
|
12265
|
+
const mergedDeny = (0, import_es_toolkit7.uniq)([...preservedDeny, ...deny].toSorted());
|
|
12266
|
+
if (mergedAllow.length > 0) {
|
|
12267
|
+
mergedPermissions.allow = mergedAllow;
|
|
12268
|
+
} else {
|
|
12269
|
+
delete mergedPermissions.allow;
|
|
12270
|
+
}
|
|
12271
|
+
if (mergedAsk.length > 0) {
|
|
12272
|
+
mergedPermissions.ask = mergedAsk;
|
|
12273
|
+
} else {
|
|
12274
|
+
delete mergedPermissions.ask;
|
|
12275
|
+
}
|
|
12276
|
+
if (mergedDeny.length > 0) {
|
|
12277
|
+
mergedPermissions.deny = mergedDeny;
|
|
12278
|
+
} else {
|
|
12279
|
+
delete mergedPermissions.deny;
|
|
12280
|
+
}
|
|
12281
|
+
const merged = { ...settings, permissions: mergedPermissions };
|
|
12282
|
+
const fileContent = JSON.stringify(merged, null, 2);
|
|
12283
|
+
return new _QwencodePermissions({
|
|
12284
|
+
outputRoot,
|
|
12285
|
+
relativeDirPath: paths.relativeDirPath,
|
|
12286
|
+
relativeFilePath: paths.relativeFilePath,
|
|
12287
|
+
fileContent,
|
|
12288
|
+
validate: true
|
|
12289
|
+
});
|
|
12290
|
+
}
|
|
12291
|
+
toRulesyncPermissions() {
|
|
12292
|
+
let settings;
|
|
12293
|
+
try {
|
|
12294
|
+
const parsed = JSON.parse(this.getFileContent());
|
|
12295
|
+
const result = QwenSettingsSchema.safeParse(parsed);
|
|
12296
|
+
if (!result.success) {
|
|
12297
|
+
throw new Error(formatError(result.error));
|
|
12298
|
+
}
|
|
12299
|
+
settings = result.data;
|
|
12300
|
+
} catch (error) {
|
|
12301
|
+
throw new Error(
|
|
12302
|
+
`Failed to parse Qwen permissions content in ${(0, import_node_path77.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
12303
|
+
{ cause: error }
|
|
12304
|
+
);
|
|
12305
|
+
}
|
|
12306
|
+
const permissions = settings.permissions ?? {};
|
|
12307
|
+
const config = convertQwenToRulesyncPermissions({
|
|
12308
|
+
allow: permissions.allow ?? [],
|
|
12309
|
+
ask: permissions.ask ?? [],
|
|
12310
|
+
deny: permissions.deny ?? []
|
|
12311
|
+
});
|
|
12312
|
+
return this.toRulesyncPermissionsDefault({
|
|
12313
|
+
fileContent: JSON.stringify(config, null, 2)
|
|
12314
|
+
});
|
|
12315
|
+
}
|
|
12316
|
+
validate() {
|
|
12317
|
+
return { success: true, error: null };
|
|
12318
|
+
}
|
|
12319
|
+
static forDeletion({
|
|
12320
|
+
outputRoot = process.cwd(),
|
|
12321
|
+
relativeDirPath,
|
|
12322
|
+
relativeFilePath
|
|
12323
|
+
}) {
|
|
12324
|
+
return new _QwencodePermissions({
|
|
12325
|
+
outputRoot,
|
|
12326
|
+
relativeDirPath,
|
|
12327
|
+
relativeFilePath,
|
|
12328
|
+
fileContent: JSON.stringify({ permissions: {} }, null, 2),
|
|
12329
|
+
validate: false
|
|
12330
|
+
});
|
|
12331
|
+
}
|
|
12332
|
+
};
|
|
12333
|
+
function convertRulesyncToQwenPermissions(config) {
|
|
12334
|
+
const allow = [];
|
|
12335
|
+
const ask = [];
|
|
12336
|
+
const deny = [];
|
|
12337
|
+
for (const [category, rules] of Object.entries(config.permission)) {
|
|
12338
|
+
const qwenToolName = toQwenToolName(category);
|
|
12339
|
+
for (const [pattern, action] of Object.entries(rules)) {
|
|
12340
|
+
const entry = buildQwenPermissionEntry(qwenToolName, pattern);
|
|
12341
|
+
switch (action) {
|
|
12342
|
+
case "allow":
|
|
12343
|
+
allow.push(entry);
|
|
12344
|
+
break;
|
|
12345
|
+
case "ask":
|
|
12346
|
+
ask.push(entry);
|
|
12347
|
+
break;
|
|
12348
|
+
case "deny":
|
|
12349
|
+
deny.push(entry);
|
|
12350
|
+
break;
|
|
12351
|
+
}
|
|
12352
|
+
}
|
|
12353
|
+
}
|
|
12354
|
+
return { allow, ask, deny };
|
|
12355
|
+
}
|
|
12356
|
+
function convertQwenToRulesyncPermissions(params) {
|
|
12357
|
+
const permission = {};
|
|
12358
|
+
const logger = params.logger ?? moduleLogger2;
|
|
12359
|
+
const processEntries = (entries, action) => {
|
|
12360
|
+
for (const entry of entries) {
|
|
12361
|
+
const parsed = parseQwenPermissionEntry(entry, { logger });
|
|
12362
|
+
if (!parsed.ok) {
|
|
12363
|
+
if (action === "deny") {
|
|
12364
|
+
const canonical2 = toCanonicalToolName3(parsed.toolName);
|
|
12365
|
+
if (!permission[canonical2]) {
|
|
12366
|
+
permission[canonical2] = {};
|
|
12367
|
+
}
|
|
12368
|
+
permission[canonical2]["*"] = action;
|
|
12369
|
+
}
|
|
12370
|
+
continue;
|
|
12371
|
+
}
|
|
12372
|
+
const { toolName, pattern } = parsed;
|
|
12373
|
+
const canonical = toCanonicalToolName3(toolName);
|
|
12374
|
+
if (!permission[canonical]) {
|
|
12375
|
+
permission[canonical] = {};
|
|
12376
|
+
}
|
|
12377
|
+
permission[canonical][pattern] = action;
|
|
11453
12378
|
}
|
|
11454
|
-
|
|
11455
|
-
|
|
11456
|
-
|
|
11457
|
-
|
|
11458
|
-
|
|
11459
|
-
|
|
11460
|
-
}
|
|
11461
|
-
};
|
|
12379
|
+
};
|
|
12380
|
+
processEntries(params.allow, "allow");
|
|
12381
|
+
processEntries(params.ask, "ask");
|
|
12382
|
+
processEntries(params.deny, "deny");
|
|
12383
|
+
return { permission };
|
|
12384
|
+
}
|
|
11462
12385
|
|
|
11463
12386
|
// src/features/permissions/permissions-processor.ts
|
|
11464
12387
|
var permissionsProcessorToolTargetTuple = [
|
|
12388
|
+
"augmentcode",
|
|
11465
12389
|
"claudecode",
|
|
12390
|
+
"cline",
|
|
11466
12391
|
"codexcli",
|
|
11467
12392
|
"cursor",
|
|
11468
12393
|
"geminicli",
|
|
12394
|
+
"kilo",
|
|
11469
12395
|
"kiro",
|
|
11470
|
-
"opencode"
|
|
12396
|
+
"opencode",
|
|
12397
|
+
"qwencode"
|
|
11471
12398
|
];
|
|
11472
|
-
var PermissionsProcessorToolTargetSchema =
|
|
12399
|
+
var PermissionsProcessorToolTargetSchema = import_mini37.z.enum(permissionsProcessorToolTargetTuple);
|
|
11473
12400
|
var toolPermissionsFactories = /* @__PURE__ */ new Map([
|
|
12401
|
+
[
|
|
12402
|
+
"augmentcode",
|
|
12403
|
+
{
|
|
12404
|
+
class: AugmentcodePermissions,
|
|
12405
|
+
meta: {
|
|
12406
|
+
supportsProject: true,
|
|
12407
|
+
supportsGlobal: true,
|
|
12408
|
+
supportsImport: true
|
|
12409
|
+
}
|
|
12410
|
+
}
|
|
12411
|
+
],
|
|
11474
12412
|
[
|
|
11475
12413
|
"claudecode",
|
|
11476
12414
|
{
|
|
@@ -11482,6 +12420,17 @@ var toolPermissionsFactories = /* @__PURE__ */ new Map([
|
|
|
11482
12420
|
}
|
|
11483
12421
|
}
|
|
11484
12422
|
],
|
|
12423
|
+
[
|
|
12424
|
+
"cline",
|
|
12425
|
+
{
|
|
12426
|
+
class: ClinePermissions,
|
|
12427
|
+
meta: {
|
|
12428
|
+
supportsProject: true,
|
|
12429
|
+
supportsGlobal: false,
|
|
12430
|
+
supportsImport: true
|
|
12431
|
+
}
|
|
12432
|
+
}
|
|
12433
|
+
],
|
|
11485
12434
|
[
|
|
11486
12435
|
"codexcli",
|
|
11487
12436
|
{
|
|
@@ -11515,6 +12464,17 @@ var toolPermissionsFactories = /* @__PURE__ */ new Map([
|
|
|
11515
12464
|
}
|
|
11516
12465
|
}
|
|
11517
12466
|
],
|
|
12467
|
+
[
|
|
12468
|
+
"kilo",
|
|
12469
|
+
{
|
|
12470
|
+
class: KiloPermissions,
|
|
12471
|
+
meta: {
|
|
12472
|
+
supportsProject: true,
|
|
12473
|
+
supportsGlobal: true,
|
|
12474
|
+
supportsImport: true
|
|
12475
|
+
}
|
|
12476
|
+
}
|
|
12477
|
+
],
|
|
11518
12478
|
[
|
|
11519
12479
|
"kiro",
|
|
11520
12480
|
{
|
|
@@ -11536,6 +12496,17 @@ var toolPermissionsFactories = /* @__PURE__ */ new Map([
|
|
|
11536
12496
|
supportsImport: true
|
|
11537
12497
|
}
|
|
11538
12498
|
}
|
|
12499
|
+
],
|
|
12500
|
+
[
|
|
12501
|
+
"qwencode",
|
|
12502
|
+
{
|
|
12503
|
+
class: QwencodePermissions,
|
|
12504
|
+
meta: {
|
|
12505
|
+
supportsProject: true,
|
|
12506
|
+
supportsGlobal: true,
|
|
12507
|
+
supportsImport: true
|
|
12508
|
+
}
|
|
12509
|
+
}
|
|
11539
12510
|
]
|
|
11540
12511
|
]);
|
|
11541
12512
|
var PermissionsProcessor = class extends FeatureProcessor {
|
|
@@ -11644,25 +12615,25 @@ var PermissionsProcessor = class extends FeatureProcessor {
|
|
|
11644
12615
|
};
|
|
11645
12616
|
|
|
11646
12617
|
// src/features/rules/rules-processor.ts
|
|
11647
|
-
var
|
|
12618
|
+
var import_node_path154 = require("path");
|
|
11648
12619
|
var import_toon = require("@toon-format/toon");
|
|
11649
|
-
var
|
|
12620
|
+
var import_mini79 = require("zod/mini");
|
|
11650
12621
|
|
|
11651
12622
|
// src/constants/general.ts
|
|
11652
12623
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
11653
12624
|
|
|
11654
12625
|
// src/features/skills/agentsmd-skill.ts
|
|
11655
|
-
var
|
|
12626
|
+
var import_node_path81 = require("path");
|
|
11656
12627
|
|
|
11657
12628
|
// src/features/skills/simulated-skill.ts
|
|
11658
|
-
var
|
|
11659
|
-
var
|
|
12629
|
+
var import_node_path80 = require("path");
|
|
12630
|
+
var import_mini38 = require("zod/mini");
|
|
11660
12631
|
|
|
11661
12632
|
// src/features/skills/tool-skill.ts
|
|
11662
|
-
var
|
|
12633
|
+
var import_node_path79 = require("path");
|
|
11663
12634
|
|
|
11664
12635
|
// src/types/ai-dir.ts
|
|
11665
|
-
var
|
|
12636
|
+
var import_node_path78 = __toESM(require("path"), 1);
|
|
11666
12637
|
var AiDir = class {
|
|
11667
12638
|
/**
|
|
11668
12639
|
* @example "."
|
|
@@ -11696,7 +12667,7 @@ var AiDir = class {
|
|
|
11696
12667
|
otherFiles = [],
|
|
11697
12668
|
global = false
|
|
11698
12669
|
}) {
|
|
11699
|
-
if (dirName.includes(
|
|
12670
|
+
if (dirName.includes(import_node_path78.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
|
|
11700
12671
|
throw new Error(`Directory name cannot contain path separators: dirName="${dirName}"`);
|
|
11701
12672
|
}
|
|
11702
12673
|
this.outputRoot = outputRoot;
|
|
@@ -11719,11 +12690,11 @@ var AiDir = class {
|
|
|
11719
12690
|
return this.dirName;
|
|
11720
12691
|
}
|
|
11721
12692
|
getDirPath() {
|
|
11722
|
-
const fullPath =
|
|
11723
|
-
const resolvedFull = (0,
|
|
11724
|
-
const resolvedBase = (0,
|
|
11725
|
-
const rel = (0,
|
|
11726
|
-
if (rel.startsWith("..") ||
|
|
12693
|
+
const fullPath = import_node_path78.default.join(this.outputRoot, this.relativeDirPath, this.dirName);
|
|
12694
|
+
const resolvedFull = (0, import_node_path78.resolve)(fullPath);
|
|
12695
|
+
const resolvedBase = (0, import_node_path78.resolve)(this.outputRoot);
|
|
12696
|
+
const rel = (0, import_node_path78.relative)(resolvedBase, resolvedFull);
|
|
12697
|
+
if (rel.startsWith("..") || import_node_path78.default.isAbsolute(rel)) {
|
|
11727
12698
|
throw new Error(
|
|
11728
12699
|
`Path traversal detected: Final path escapes outputRoot. outputRoot="${this.outputRoot}", relativeDirPath="${this.relativeDirPath}", dirName="${this.dirName}"`
|
|
11729
12700
|
);
|
|
@@ -11740,7 +12711,7 @@ var AiDir = class {
|
|
|
11740
12711
|
* Returns the relative path from CWD with POSIX separators for consistent cross-platform output.
|
|
11741
12712
|
*/
|
|
11742
12713
|
getRelativePathFromCwd() {
|
|
11743
|
-
return toPosixPath(
|
|
12714
|
+
return toPosixPath(import_node_path78.default.join(this.relativeDirPath, this.dirName));
|
|
11744
12715
|
}
|
|
11745
12716
|
getGlobal() {
|
|
11746
12717
|
return this.global;
|
|
@@ -11759,15 +12730,15 @@ var AiDir = class {
|
|
|
11759
12730
|
* @returns Array of files with their relative paths and buffers
|
|
11760
12731
|
*/
|
|
11761
12732
|
static async collectOtherFiles(outputRoot, relativeDirPath, dirName, excludeFileName) {
|
|
11762
|
-
const dirPath = (0,
|
|
11763
|
-
const glob = (0,
|
|
12733
|
+
const dirPath = (0, import_node_path78.join)(outputRoot, relativeDirPath, dirName);
|
|
12734
|
+
const glob = (0, import_node_path78.join)(dirPath, "**", "*");
|
|
11764
12735
|
const filePaths = await findFilesByGlobs(glob, { type: "file" });
|
|
11765
|
-
const filteredPaths = filePaths.filter((filePath) => (0,
|
|
12736
|
+
const filteredPaths = filePaths.filter((filePath) => (0, import_node_path78.basename)(filePath) !== excludeFileName);
|
|
11766
12737
|
const files = await Promise.all(
|
|
11767
12738
|
filteredPaths.map(async (filePath) => {
|
|
11768
12739
|
const fileBuffer = await readFileBuffer(filePath);
|
|
11769
12740
|
return {
|
|
11770
|
-
relativeFilePathToDirPath: (0,
|
|
12741
|
+
relativeFilePathToDirPath: (0, import_node_path78.relative)(dirPath, filePath),
|
|
11771
12742
|
fileBuffer
|
|
11772
12743
|
};
|
|
11773
12744
|
})
|
|
@@ -11861,8 +12832,8 @@ var ToolSkill = class extends AiDir {
|
|
|
11861
12832
|
}) {
|
|
11862
12833
|
const settablePaths = getSettablePaths({ global });
|
|
11863
12834
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
11864
|
-
const skillDirPath = (0,
|
|
11865
|
-
const skillFilePath = (0,
|
|
12835
|
+
const skillDirPath = (0, import_node_path79.join)(outputRoot, actualRelativeDirPath, dirName);
|
|
12836
|
+
const skillFilePath = (0, import_node_path79.join)(skillDirPath, SKILL_FILE_NAME);
|
|
11866
12837
|
if (!await fileExists(skillFilePath)) {
|
|
11867
12838
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
11868
12839
|
}
|
|
@@ -11886,16 +12857,16 @@ var ToolSkill = class extends AiDir {
|
|
|
11886
12857
|
}
|
|
11887
12858
|
requireMainFileFrontmatter() {
|
|
11888
12859
|
if (!this.mainFile?.frontmatter) {
|
|
11889
|
-
throw new Error(`Frontmatter is not defined in ${(0,
|
|
12860
|
+
throw new Error(`Frontmatter is not defined in ${(0, import_node_path79.join)(this.relativeDirPath, this.dirName)}`);
|
|
11890
12861
|
}
|
|
11891
12862
|
return this.mainFile.frontmatter;
|
|
11892
12863
|
}
|
|
11893
12864
|
};
|
|
11894
12865
|
|
|
11895
12866
|
// src/features/skills/simulated-skill.ts
|
|
11896
|
-
var SimulatedSkillFrontmatterSchema =
|
|
11897
|
-
name:
|
|
11898
|
-
description:
|
|
12867
|
+
var SimulatedSkillFrontmatterSchema = import_mini38.z.looseObject({
|
|
12868
|
+
name: import_mini38.z.string(),
|
|
12869
|
+
description: import_mini38.z.string()
|
|
11899
12870
|
});
|
|
11900
12871
|
var SimulatedSkill = class extends ToolSkill {
|
|
11901
12872
|
frontmatter;
|
|
@@ -11926,7 +12897,7 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
11926
12897
|
const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
|
|
11927
12898
|
if (!result.success) {
|
|
11928
12899
|
throw new Error(
|
|
11929
|
-
`Invalid frontmatter in ${(0,
|
|
12900
|
+
`Invalid frontmatter in ${(0, import_node_path80.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
|
|
11930
12901
|
);
|
|
11931
12902
|
}
|
|
11932
12903
|
}
|
|
@@ -11985,8 +12956,8 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
11985
12956
|
}) {
|
|
11986
12957
|
const settablePaths = this.getSettablePaths();
|
|
11987
12958
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
11988
|
-
const skillDirPath = (0,
|
|
11989
|
-
const skillFilePath = (0,
|
|
12959
|
+
const skillDirPath = (0, import_node_path80.join)(outputRoot, actualRelativeDirPath, dirName);
|
|
12960
|
+
const skillFilePath = (0, import_node_path80.join)(skillDirPath, SKILL_FILE_NAME);
|
|
11990
12961
|
if (!await fileExists(skillFilePath)) {
|
|
11991
12962
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
11992
12963
|
}
|
|
@@ -12063,7 +13034,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
12063
13034
|
throw new Error("AgentsmdSkill does not support global mode.");
|
|
12064
13035
|
}
|
|
12065
13036
|
return {
|
|
12066
|
-
relativeDirPath: (0,
|
|
13037
|
+
relativeDirPath: (0, import_node_path81.join)(".agents", "skills")
|
|
12067
13038
|
};
|
|
12068
13039
|
}
|
|
12069
13040
|
static async fromDir(params) {
|
|
@@ -12090,11 +13061,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
12090
13061
|
};
|
|
12091
13062
|
|
|
12092
13063
|
// src/features/skills/factorydroid-skill.ts
|
|
12093
|
-
var
|
|
13064
|
+
var import_node_path82 = require("path");
|
|
12094
13065
|
var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
12095
13066
|
static getSettablePaths(_options) {
|
|
12096
13067
|
return {
|
|
12097
|
-
relativeDirPath: (0,
|
|
13068
|
+
relativeDirPath: (0, import_node_path82.join)(".factory", "skills")
|
|
12098
13069
|
};
|
|
12099
13070
|
}
|
|
12100
13071
|
static async fromDir(params) {
|
|
@@ -12121,55 +13092,55 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
|
12121
13092
|
};
|
|
12122
13093
|
|
|
12123
13094
|
// src/features/skills/rovodev-skill.ts
|
|
12124
|
-
var
|
|
12125
|
-
var
|
|
13095
|
+
var import_node_path84 = require("path");
|
|
13096
|
+
var import_mini40 = require("zod/mini");
|
|
12126
13097
|
|
|
12127
13098
|
// src/features/skills/rulesync-skill.ts
|
|
12128
|
-
var
|
|
12129
|
-
var
|
|
12130
|
-
var RulesyncSkillFrontmatterSchemaInternal =
|
|
12131
|
-
name:
|
|
12132
|
-
description:
|
|
12133
|
-
targets:
|
|
12134
|
-
claudecode:
|
|
12135
|
-
|
|
12136
|
-
"allowed-tools":
|
|
12137
|
-
model:
|
|
12138
|
-
"disable-model-invocation":
|
|
12139
|
-
"scheduled-task":
|
|
13099
|
+
var import_node_path83 = require("path");
|
|
13100
|
+
var import_mini39 = require("zod/mini");
|
|
13101
|
+
var RulesyncSkillFrontmatterSchemaInternal = import_mini39.z.looseObject({
|
|
13102
|
+
name: import_mini39.z.string(),
|
|
13103
|
+
description: import_mini39.z.string(),
|
|
13104
|
+
targets: import_mini39.z._default(RulesyncTargetsSchema, ["*"]),
|
|
13105
|
+
claudecode: import_mini39.z.optional(
|
|
13106
|
+
import_mini39.z.looseObject({
|
|
13107
|
+
"allowed-tools": import_mini39.z.optional(import_mini39.z.array(import_mini39.z.string())),
|
|
13108
|
+
model: import_mini39.z.optional(import_mini39.z.string()),
|
|
13109
|
+
"disable-model-invocation": import_mini39.z.optional(import_mini39.z.boolean()),
|
|
13110
|
+
"scheduled-task": import_mini39.z.optional(import_mini39.z.boolean())
|
|
12140
13111
|
})
|
|
12141
13112
|
),
|
|
12142
|
-
codexcli:
|
|
12143
|
-
|
|
12144
|
-
"short-description":
|
|
13113
|
+
codexcli: import_mini39.z.optional(
|
|
13114
|
+
import_mini39.z.looseObject({
|
|
13115
|
+
"short-description": import_mini39.z.optional(import_mini39.z.string())
|
|
12145
13116
|
})
|
|
12146
13117
|
),
|
|
12147
|
-
opencode:
|
|
12148
|
-
|
|
12149
|
-
"allowed-tools":
|
|
13118
|
+
opencode: import_mini39.z.optional(
|
|
13119
|
+
import_mini39.z.looseObject({
|
|
13120
|
+
"allowed-tools": import_mini39.z.optional(import_mini39.z.array(import_mini39.z.string()))
|
|
12150
13121
|
})
|
|
12151
13122
|
),
|
|
12152
|
-
kilo:
|
|
12153
|
-
|
|
12154
|
-
"allowed-tools":
|
|
13123
|
+
kilo: import_mini39.z.optional(
|
|
13124
|
+
import_mini39.z.looseObject({
|
|
13125
|
+
"allowed-tools": import_mini39.z.optional(import_mini39.z.array(import_mini39.z.string()))
|
|
12155
13126
|
})
|
|
12156
13127
|
),
|
|
12157
|
-
deepagents:
|
|
12158
|
-
|
|
12159
|
-
"allowed-tools":
|
|
13128
|
+
deepagents: import_mini39.z.optional(
|
|
13129
|
+
import_mini39.z.looseObject({
|
|
13130
|
+
"allowed-tools": import_mini39.z.optional(import_mini39.z.array(import_mini39.z.string()))
|
|
12160
13131
|
})
|
|
12161
13132
|
),
|
|
12162
|
-
copilot:
|
|
12163
|
-
|
|
12164
|
-
license:
|
|
13133
|
+
copilot: import_mini39.z.optional(
|
|
13134
|
+
import_mini39.z.looseObject({
|
|
13135
|
+
license: import_mini39.z.optional(import_mini39.z.string())
|
|
12165
13136
|
})
|
|
12166
13137
|
),
|
|
12167
|
-
cline:
|
|
12168
|
-
roo:
|
|
12169
|
-
takt:
|
|
12170
|
-
|
|
13138
|
+
cline: import_mini39.z.optional(import_mini39.z.looseObject({})),
|
|
13139
|
+
roo: import_mini39.z.optional(import_mini39.z.looseObject({})),
|
|
13140
|
+
takt: import_mini39.z.optional(
|
|
13141
|
+
import_mini39.z.looseObject({
|
|
12171
13142
|
// Rename the emitted file stem (e.g. "test-skill.md" → "{name}.md").
|
|
12172
|
-
name:
|
|
13143
|
+
name: import_mini39.z.optional(import_mini39.z.string())
|
|
12173
13144
|
})
|
|
12174
13145
|
)
|
|
12175
13146
|
});
|
|
@@ -12211,7 +13182,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
12211
13182
|
}
|
|
12212
13183
|
getFrontmatter() {
|
|
12213
13184
|
if (!this.mainFile?.frontmatter) {
|
|
12214
|
-
throw new Error(`Frontmatter is not defined in ${(0,
|
|
13185
|
+
throw new Error(`Frontmatter is not defined in ${(0, import_node_path83.join)(this.relativeDirPath, this.dirName)}`);
|
|
12215
13186
|
}
|
|
12216
13187
|
const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
|
|
12217
13188
|
return result;
|
|
@@ -12237,8 +13208,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
12237
13208
|
dirName,
|
|
12238
13209
|
global = false
|
|
12239
13210
|
}) {
|
|
12240
|
-
const skillDirPath = (0,
|
|
12241
|
-
const skillFilePath = (0,
|
|
13211
|
+
const skillDirPath = (0, import_node_path83.join)(outputRoot, relativeDirPath, dirName);
|
|
13212
|
+
const skillFilePath = (0, import_node_path83.join)(skillDirPath, SKILL_FILE_NAME);
|
|
12242
13213
|
if (!await fileExists(skillFilePath)) {
|
|
12243
13214
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
12244
13215
|
}
|
|
@@ -12268,14 +13239,14 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
12268
13239
|
};
|
|
12269
13240
|
|
|
12270
13241
|
// src/features/skills/rovodev-skill.ts
|
|
12271
|
-
var RovodevSkillFrontmatterSchema =
|
|
12272
|
-
name:
|
|
12273
|
-
description:
|
|
13242
|
+
var RovodevSkillFrontmatterSchema = import_mini40.z.looseObject({
|
|
13243
|
+
name: import_mini40.z.string(),
|
|
13244
|
+
description: import_mini40.z.string()
|
|
12274
13245
|
});
|
|
12275
13246
|
var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
12276
13247
|
constructor({
|
|
12277
13248
|
outputRoot = process.cwd(),
|
|
12278
|
-
relativeDirPath = (0,
|
|
13249
|
+
relativeDirPath = (0, import_node_path84.join)(".rovodev", "skills"),
|
|
12279
13250
|
dirName,
|
|
12280
13251
|
frontmatter,
|
|
12281
13252
|
body,
|
|
@@ -12304,8 +13275,8 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
12304
13275
|
}
|
|
12305
13276
|
static getSettablePaths(_options) {
|
|
12306
13277
|
return {
|
|
12307
|
-
relativeDirPath: (0,
|
|
12308
|
-
alternativeSkillRoots: [(0,
|
|
13278
|
+
relativeDirPath: (0, import_node_path84.join)(".rovodev", "skills"),
|
|
13279
|
+
alternativeSkillRoots: [(0, import_node_path84.join)(".agents", "skills")]
|
|
12309
13280
|
};
|
|
12310
13281
|
}
|
|
12311
13282
|
getFrontmatter() {
|
|
@@ -12393,13 +13364,13 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
12393
13364
|
});
|
|
12394
13365
|
const result = RovodevSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12395
13366
|
if (!result.success) {
|
|
12396
|
-
const skillDirPath = (0,
|
|
13367
|
+
const skillDirPath = (0, import_node_path84.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
12397
13368
|
throw new Error(
|
|
12398
|
-
`Invalid frontmatter in ${(0,
|
|
13369
|
+
`Invalid frontmatter in ${(0, import_node_path84.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12399
13370
|
);
|
|
12400
13371
|
}
|
|
12401
13372
|
if (result.data.name !== loaded.dirName) {
|
|
12402
|
-
const skillFilePath = (0,
|
|
13373
|
+
const skillFilePath = (0, import_node_path84.join)(
|
|
12403
13374
|
loaded.outputRoot,
|
|
12404
13375
|
loaded.relativeDirPath,
|
|
12405
13376
|
loaded.dirName,
|
|
@@ -12441,11 +13412,11 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
12441
13412
|
};
|
|
12442
13413
|
|
|
12443
13414
|
// src/features/skills/skills-processor.ts
|
|
12444
|
-
var
|
|
12445
|
-
var
|
|
13415
|
+
var import_node_path105 = require("path");
|
|
13416
|
+
var import_mini58 = require("zod/mini");
|
|
12446
13417
|
|
|
12447
13418
|
// src/types/dir-feature-processor.ts
|
|
12448
|
-
var
|
|
13419
|
+
var import_node_path85 = require("path");
|
|
12449
13420
|
var DirFeatureProcessor = class {
|
|
12450
13421
|
outputRoot;
|
|
12451
13422
|
inputRoot;
|
|
@@ -12488,7 +13459,7 @@ var DirFeatureProcessor = class {
|
|
|
12488
13459
|
const mainFile = aiDir.getMainFile();
|
|
12489
13460
|
let mainFileContent;
|
|
12490
13461
|
if (mainFile) {
|
|
12491
|
-
const mainFilePath = (0,
|
|
13462
|
+
const mainFilePath = (0, import_node_path85.join)(dirPath, mainFile.name);
|
|
12492
13463
|
const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter, {
|
|
12493
13464
|
avoidBlockScalars: this.avoidBlockScalars
|
|
12494
13465
|
});
|
|
@@ -12508,7 +13479,7 @@ var DirFeatureProcessor = class {
|
|
|
12508
13479
|
const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
|
|
12509
13480
|
otherFileContents.push(contentWithNewline);
|
|
12510
13481
|
if (!dirHasChanges) {
|
|
12511
|
-
const filePath = (0,
|
|
13482
|
+
const filePath = (0, import_node_path85.join)(dirPath, file.relativeFilePathToDirPath);
|
|
12512
13483
|
const existingContent = await readFileContentOrNull(filePath);
|
|
12513
13484
|
if (!fileContentsEquivalent({
|
|
12514
13485
|
filePath,
|
|
@@ -12526,24 +13497,24 @@ var DirFeatureProcessor = class {
|
|
|
12526
13497
|
if (this.dryRun) {
|
|
12527
13498
|
this.logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
|
|
12528
13499
|
if (mainFile) {
|
|
12529
|
-
this.logger.info(`[DRY RUN] Would write: ${(0,
|
|
12530
|
-
changedPaths.push((0,
|
|
13500
|
+
this.logger.info(`[DRY RUN] Would write: ${(0, import_node_path85.join)(dirPath, mainFile.name)}`);
|
|
13501
|
+
changedPaths.push((0, import_node_path85.join)(relativeDir, mainFile.name));
|
|
12531
13502
|
}
|
|
12532
13503
|
for (const file of otherFiles) {
|
|
12533
13504
|
this.logger.info(
|
|
12534
|
-
`[DRY RUN] Would write: ${(0,
|
|
13505
|
+
`[DRY RUN] Would write: ${(0, import_node_path85.join)(dirPath, file.relativeFilePathToDirPath)}`
|
|
12535
13506
|
);
|
|
12536
|
-
changedPaths.push((0,
|
|
13507
|
+
changedPaths.push((0, import_node_path85.join)(relativeDir, file.relativeFilePathToDirPath));
|
|
12537
13508
|
}
|
|
12538
13509
|
} else {
|
|
12539
13510
|
await ensureDir(dirPath);
|
|
12540
13511
|
if (mainFile && mainFileContent) {
|
|
12541
|
-
const mainFilePath = (0,
|
|
13512
|
+
const mainFilePath = (0, import_node_path85.join)(dirPath, mainFile.name);
|
|
12542
13513
|
await writeFileContent(mainFilePath, mainFileContent);
|
|
12543
|
-
changedPaths.push((0,
|
|
13514
|
+
changedPaths.push((0, import_node_path85.join)(relativeDir, mainFile.name));
|
|
12544
13515
|
}
|
|
12545
13516
|
for (const [i, file] of otherFiles.entries()) {
|
|
12546
|
-
const filePath = (0,
|
|
13517
|
+
const filePath = (0, import_node_path85.join)(dirPath, file.relativeFilePathToDirPath);
|
|
12547
13518
|
const content = otherFileContents[i];
|
|
12548
13519
|
if (content === void 0) {
|
|
12549
13520
|
throw new Error(
|
|
@@ -12551,7 +13522,7 @@ var DirFeatureProcessor = class {
|
|
|
12551
13522
|
);
|
|
12552
13523
|
}
|
|
12553
13524
|
await writeFileContent(filePath, content);
|
|
12554
|
-
changedPaths.push((0,
|
|
13525
|
+
changedPaths.push((0, import_node_path85.join)(relativeDir, file.relativeFilePathToDirPath));
|
|
12555
13526
|
}
|
|
12556
13527
|
}
|
|
12557
13528
|
changedCount++;
|
|
@@ -12583,16 +13554,16 @@ var DirFeatureProcessor = class {
|
|
|
12583
13554
|
};
|
|
12584
13555
|
|
|
12585
13556
|
// src/features/skills/agentsskills-skill.ts
|
|
12586
|
-
var
|
|
12587
|
-
var
|
|
12588
|
-
var AgentsSkillsSkillFrontmatterSchema =
|
|
12589
|
-
name:
|
|
12590
|
-
description:
|
|
13557
|
+
var import_node_path86 = require("path");
|
|
13558
|
+
var import_mini41 = require("zod/mini");
|
|
13559
|
+
var AgentsSkillsSkillFrontmatterSchema = import_mini41.z.looseObject({
|
|
13560
|
+
name: import_mini41.z.string(),
|
|
13561
|
+
description: import_mini41.z.string()
|
|
12591
13562
|
});
|
|
12592
13563
|
var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
12593
13564
|
constructor({
|
|
12594
13565
|
outputRoot = process.cwd(),
|
|
12595
|
-
relativeDirPath = (0,
|
|
13566
|
+
relativeDirPath = (0, import_node_path86.join)(".agents", "skills"),
|
|
12596
13567
|
dirName,
|
|
12597
13568
|
frontmatter,
|
|
12598
13569
|
body,
|
|
@@ -12624,7 +13595,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
12624
13595
|
throw new Error("AgentsSkillsSkill does not support global mode.");
|
|
12625
13596
|
}
|
|
12626
13597
|
return {
|
|
12627
|
-
relativeDirPath: (0,
|
|
13598
|
+
relativeDirPath: (0, import_node_path86.join)(".agents", "skills")
|
|
12628
13599
|
};
|
|
12629
13600
|
}
|
|
12630
13601
|
getFrontmatter() {
|
|
@@ -12704,9 +13675,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
12704
13675
|
});
|
|
12705
13676
|
const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12706
13677
|
if (!result.success) {
|
|
12707
|
-
const skillDirPath = (0,
|
|
13678
|
+
const skillDirPath = (0, import_node_path86.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
12708
13679
|
throw new Error(
|
|
12709
|
-
`Invalid frontmatter in ${(0,
|
|
13680
|
+
`Invalid frontmatter in ${(0, import_node_path86.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12710
13681
|
);
|
|
12711
13682
|
}
|
|
12712
13683
|
return new _AgentsSkillsSkill({
|
|
@@ -12741,16 +13712,16 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
12741
13712
|
};
|
|
12742
13713
|
|
|
12743
13714
|
// src/features/skills/antigravity-skill.ts
|
|
12744
|
-
var
|
|
12745
|
-
var
|
|
12746
|
-
var AntigravitySkillFrontmatterSchema =
|
|
12747
|
-
name:
|
|
12748
|
-
description:
|
|
13715
|
+
var import_node_path87 = require("path");
|
|
13716
|
+
var import_mini42 = require("zod/mini");
|
|
13717
|
+
var AntigravitySkillFrontmatterSchema = import_mini42.z.looseObject({
|
|
13718
|
+
name: import_mini42.z.string(),
|
|
13719
|
+
description: import_mini42.z.string()
|
|
12749
13720
|
});
|
|
12750
13721
|
var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
12751
13722
|
constructor({
|
|
12752
13723
|
outputRoot = process.cwd(),
|
|
12753
|
-
relativeDirPath = (0,
|
|
13724
|
+
relativeDirPath = (0, import_node_path87.join)(".agent", "skills"),
|
|
12754
13725
|
dirName,
|
|
12755
13726
|
frontmatter,
|
|
12756
13727
|
body,
|
|
@@ -12782,11 +13753,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
12782
13753
|
} = {}) {
|
|
12783
13754
|
if (global) {
|
|
12784
13755
|
return {
|
|
12785
|
-
relativeDirPath: (0,
|
|
13756
|
+
relativeDirPath: (0, import_node_path87.join)(".gemini", "antigravity", "skills")
|
|
12786
13757
|
};
|
|
12787
13758
|
}
|
|
12788
13759
|
return {
|
|
12789
|
-
relativeDirPath: (0,
|
|
13760
|
+
relativeDirPath: (0, import_node_path87.join)(".agent", "skills")
|
|
12790
13761
|
};
|
|
12791
13762
|
}
|
|
12792
13763
|
getFrontmatter() {
|
|
@@ -12866,9 +13837,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
12866
13837
|
});
|
|
12867
13838
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12868
13839
|
if (!result.success) {
|
|
12869
|
-
const skillDirPath = (0,
|
|
13840
|
+
const skillDirPath = (0, import_node_path87.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
12870
13841
|
throw new Error(
|
|
12871
|
-
`Invalid frontmatter in ${(0,
|
|
13842
|
+
`Invalid frontmatter in ${(0, import_node_path87.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12872
13843
|
);
|
|
12873
13844
|
}
|
|
12874
13845
|
return new _AntigravitySkill({
|
|
@@ -12902,21 +13873,21 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
12902
13873
|
};
|
|
12903
13874
|
|
|
12904
13875
|
// src/features/skills/claudecode-skill.ts
|
|
12905
|
-
var
|
|
12906
|
-
var
|
|
12907
|
-
var CLAUDE_SKILLS_DIR_PATH = (0,
|
|
12908
|
-
var CLAUDE_SCHEDULED_TASKS_DIR_PATH = (0,
|
|
12909
|
-
var ClaudecodeSkillFrontmatterSchema =
|
|
12910
|
-
name:
|
|
12911
|
-
description:
|
|
12912
|
-
"allowed-tools":
|
|
12913
|
-
model:
|
|
12914
|
-
"disable-model-invocation":
|
|
13876
|
+
var import_node_path88 = require("path");
|
|
13877
|
+
var import_mini43 = require("zod/mini");
|
|
13878
|
+
var CLAUDE_SKILLS_DIR_PATH = (0, import_node_path88.join)(".claude", "skills");
|
|
13879
|
+
var CLAUDE_SCHEDULED_TASKS_DIR_PATH = (0, import_node_path88.join)(".claude", "scheduled-tasks");
|
|
13880
|
+
var ClaudecodeSkillFrontmatterSchema = import_mini43.z.looseObject({
|
|
13881
|
+
name: import_mini43.z.string(),
|
|
13882
|
+
description: import_mini43.z.string(),
|
|
13883
|
+
"allowed-tools": import_mini43.z.optional(import_mini43.z.array(import_mini43.z.string())),
|
|
13884
|
+
model: import_mini43.z.optional(import_mini43.z.string()),
|
|
13885
|
+
"disable-model-invocation": import_mini43.z.optional(import_mini43.z.boolean())
|
|
12915
13886
|
});
|
|
12916
13887
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
12917
13888
|
constructor({
|
|
12918
13889
|
outputRoot = process.cwd(),
|
|
12919
|
-
relativeDirPath = (0,
|
|
13890
|
+
relativeDirPath = (0, import_node_path88.join)(".claude", "skills"),
|
|
12920
13891
|
dirName,
|
|
12921
13892
|
frontmatter,
|
|
12922
13893
|
body,
|
|
@@ -13051,9 +14022,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
13051
14022
|
});
|
|
13052
14023
|
const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
13053
14024
|
if (!result.success) {
|
|
13054
|
-
const skillDirPath = (0,
|
|
14025
|
+
const skillDirPath = (0, import_node_path88.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
13055
14026
|
throw new Error(
|
|
13056
|
-
`Invalid frontmatter in ${(0,
|
|
14027
|
+
`Invalid frontmatter in ${(0, import_node_path88.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
13057
14028
|
);
|
|
13058
14029
|
}
|
|
13059
14030
|
return new _ClaudecodeSkill({
|
|
@@ -13087,16 +14058,16 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
13087
14058
|
};
|
|
13088
14059
|
|
|
13089
14060
|
// src/features/skills/cline-skill.ts
|
|
13090
|
-
var
|
|
13091
|
-
var
|
|
13092
|
-
var ClineSkillFrontmatterSchema =
|
|
13093
|
-
name:
|
|
13094
|
-
description:
|
|
14061
|
+
var import_node_path89 = require("path");
|
|
14062
|
+
var import_mini44 = require("zod/mini");
|
|
14063
|
+
var ClineSkillFrontmatterSchema = import_mini44.z.looseObject({
|
|
14064
|
+
name: import_mini44.z.string(),
|
|
14065
|
+
description: import_mini44.z.string()
|
|
13095
14066
|
});
|
|
13096
14067
|
var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
13097
14068
|
constructor({
|
|
13098
14069
|
outputRoot = process.cwd(),
|
|
13099
|
-
relativeDirPath = (0,
|
|
14070
|
+
relativeDirPath = (0, import_node_path89.join)(".cline", "skills"),
|
|
13100
14071
|
dirName,
|
|
13101
14072
|
frontmatter,
|
|
13102
14073
|
body,
|
|
@@ -13125,7 +14096,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
13125
14096
|
}
|
|
13126
14097
|
static getSettablePaths(_options = {}) {
|
|
13127
14098
|
return {
|
|
13128
|
-
relativeDirPath: (0,
|
|
14099
|
+
relativeDirPath: (0, import_node_path89.join)(".cline", "skills")
|
|
13129
14100
|
};
|
|
13130
14101
|
}
|
|
13131
14102
|
getFrontmatter() {
|
|
@@ -13213,13 +14184,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
13213
14184
|
});
|
|
13214
14185
|
const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
13215
14186
|
if (!result.success) {
|
|
13216
|
-
const skillDirPath = (0,
|
|
14187
|
+
const skillDirPath = (0, import_node_path89.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
13217
14188
|
throw new Error(
|
|
13218
|
-
`Invalid frontmatter in ${(0,
|
|
14189
|
+
`Invalid frontmatter in ${(0, import_node_path89.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
13219
14190
|
);
|
|
13220
14191
|
}
|
|
13221
14192
|
if (result.data.name !== loaded.dirName) {
|
|
13222
|
-
const skillFilePath = (0,
|
|
14193
|
+
const skillFilePath = (0, import_node_path89.join)(
|
|
13223
14194
|
loaded.outputRoot,
|
|
13224
14195
|
loaded.relativeDirPath,
|
|
13225
14196
|
loaded.dirName,
|
|
@@ -13260,21 +14231,21 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
13260
14231
|
};
|
|
13261
14232
|
|
|
13262
14233
|
// src/features/skills/codexcli-skill.ts
|
|
13263
|
-
var
|
|
13264
|
-
var
|
|
13265
|
-
var CodexCliSkillFrontmatterSchema =
|
|
13266
|
-
name:
|
|
13267
|
-
description:
|
|
13268
|
-
metadata:
|
|
13269
|
-
|
|
13270
|
-
"short-description":
|
|
14234
|
+
var import_node_path90 = require("path");
|
|
14235
|
+
var import_mini45 = require("zod/mini");
|
|
14236
|
+
var CodexCliSkillFrontmatterSchema = import_mini45.z.looseObject({
|
|
14237
|
+
name: import_mini45.z.string(),
|
|
14238
|
+
description: import_mini45.z.string(),
|
|
14239
|
+
metadata: import_mini45.z.optional(
|
|
14240
|
+
import_mini45.z.looseObject({
|
|
14241
|
+
"short-description": import_mini45.z.optional(import_mini45.z.string())
|
|
13271
14242
|
})
|
|
13272
14243
|
)
|
|
13273
14244
|
});
|
|
13274
14245
|
var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
13275
14246
|
constructor({
|
|
13276
14247
|
outputRoot = process.cwd(),
|
|
13277
|
-
relativeDirPath = (0,
|
|
14248
|
+
relativeDirPath = (0, import_node_path90.join)(".codex", "skills"),
|
|
13278
14249
|
dirName,
|
|
13279
14250
|
frontmatter,
|
|
13280
14251
|
body,
|
|
@@ -13305,7 +14276,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
13305
14276
|
global: _global = false
|
|
13306
14277
|
} = {}) {
|
|
13307
14278
|
return {
|
|
13308
|
-
relativeDirPath: (0,
|
|
14279
|
+
relativeDirPath: (0, import_node_path90.join)(".codex", "skills")
|
|
13309
14280
|
};
|
|
13310
14281
|
}
|
|
13311
14282
|
getFrontmatter() {
|
|
@@ -13395,9 +14366,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
13395
14366
|
});
|
|
13396
14367
|
const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
13397
14368
|
if (!result.success) {
|
|
13398
|
-
const skillDirPath = (0,
|
|
14369
|
+
const skillDirPath = (0, import_node_path90.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
13399
14370
|
throw new Error(
|
|
13400
|
-
`Invalid frontmatter in ${(0,
|
|
14371
|
+
`Invalid frontmatter in ${(0, import_node_path90.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
13401
14372
|
);
|
|
13402
14373
|
}
|
|
13403
14374
|
return new _CodexCliSkill({
|
|
@@ -13431,17 +14402,17 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
13431
14402
|
};
|
|
13432
14403
|
|
|
13433
14404
|
// src/features/skills/copilot-skill.ts
|
|
13434
|
-
var
|
|
13435
|
-
var
|
|
13436
|
-
var CopilotSkillFrontmatterSchema =
|
|
13437
|
-
name:
|
|
13438
|
-
description:
|
|
13439
|
-
license:
|
|
14405
|
+
var import_node_path91 = require("path");
|
|
14406
|
+
var import_mini46 = require("zod/mini");
|
|
14407
|
+
var CopilotSkillFrontmatterSchema = import_mini46.z.looseObject({
|
|
14408
|
+
name: import_mini46.z.string(),
|
|
14409
|
+
description: import_mini46.z.string(),
|
|
14410
|
+
license: import_mini46.z.optional(import_mini46.z.string())
|
|
13440
14411
|
});
|
|
13441
14412
|
var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
13442
14413
|
constructor({
|
|
13443
14414
|
outputRoot = process.cwd(),
|
|
13444
|
-
relativeDirPath = (0,
|
|
14415
|
+
relativeDirPath = (0, import_node_path91.join)(".github", "skills"),
|
|
13445
14416
|
dirName,
|
|
13446
14417
|
frontmatter,
|
|
13447
14418
|
body,
|
|
@@ -13473,7 +14444,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
13473
14444
|
throw new Error("CopilotSkill does not support global mode.");
|
|
13474
14445
|
}
|
|
13475
14446
|
return {
|
|
13476
|
-
relativeDirPath: (0,
|
|
14447
|
+
relativeDirPath: (0, import_node_path91.join)(".github", "skills")
|
|
13477
14448
|
};
|
|
13478
14449
|
}
|
|
13479
14450
|
getFrontmatter() {
|
|
@@ -13559,9 +14530,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
13559
14530
|
});
|
|
13560
14531
|
const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
13561
14532
|
if (!result.success) {
|
|
13562
|
-
const skillDirPath = (0,
|
|
14533
|
+
const skillDirPath = (0, import_node_path91.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
13563
14534
|
throw new Error(
|
|
13564
|
-
`Invalid frontmatter in ${(0,
|
|
14535
|
+
`Invalid frontmatter in ${(0, import_node_path91.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
13565
14536
|
);
|
|
13566
14537
|
}
|
|
13567
14538
|
return new _CopilotSkill({
|
|
@@ -13596,16 +14567,16 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
13596
14567
|
};
|
|
13597
14568
|
|
|
13598
14569
|
// src/features/skills/cursor-skill.ts
|
|
13599
|
-
var
|
|
13600
|
-
var
|
|
13601
|
-
var CursorSkillFrontmatterSchema =
|
|
13602
|
-
name:
|
|
13603
|
-
description:
|
|
14570
|
+
var import_node_path92 = require("path");
|
|
14571
|
+
var import_mini47 = require("zod/mini");
|
|
14572
|
+
var CursorSkillFrontmatterSchema = import_mini47.z.looseObject({
|
|
14573
|
+
name: import_mini47.z.string(),
|
|
14574
|
+
description: import_mini47.z.string()
|
|
13604
14575
|
});
|
|
13605
14576
|
var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
13606
14577
|
constructor({
|
|
13607
14578
|
outputRoot = process.cwd(),
|
|
13608
|
-
relativeDirPath = (0,
|
|
14579
|
+
relativeDirPath = (0, import_node_path92.join)(".cursor", "skills"),
|
|
13609
14580
|
dirName,
|
|
13610
14581
|
frontmatter,
|
|
13611
14582
|
body,
|
|
@@ -13634,7 +14605,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
13634
14605
|
}
|
|
13635
14606
|
static getSettablePaths(_options) {
|
|
13636
14607
|
return {
|
|
13637
|
-
relativeDirPath: (0,
|
|
14608
|
+
relativeDirPath: (0, import_node_path92.join)(".cursor", "skills")
|
|
13638
14609
|
};
|
|
13639
14610
|
}
|
|
13640
14611
|
getFrontmatter() {
|
|
@@ -13714,9 +14685,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
13714
14685
|
});
|
|
13715
14686
|
const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
13716
14687
|
if (!result.success) {
|
|
13717
|
-
const skillDirPath = (0,
|
|
14688
|
+
const skillDirPath = (0, import_node_path92.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
13718
14689
|
throw new Error(
|
|
13719
|
-
`Invalid frontmatter in ${(0,
|
|
14690
|
+
`Invalid frontmatter in ${(0, import_node_path92.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
13720
14691
|
);
|
|
13721
14692
|
}
|
|
13722
14693
|
return new _CursorSkill({
|
|
@@ -13751,17 +14722,17 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
13751
14722
|
};
|
|
13752
14723
|
|
|
13753
14724
|
// src/features/skills/deepagents-skill.ts
|
|
13754
|
-
var
|
|
13755
|
-
var
|
|
13756
|
-
var DeepagentsSkillFrontmatterSchema =
|
|
13757
|
-
name:
|
|
13758
|
-
description:
|
|
13759
|
-
"allowed-tools":
|
|
14725
|
+
var import_node_path93 = require("path");
|
|
14726
|
+
var import_mini48 = require("zod/mini");
|
|
14727
|
+
var DeepagentsSkillFrontmatterSchema = import_mini48.z.looseObject({
|
|
14728
|
+
name: import_mini48.z.string(),
|
|
14729
|
+
description: import_mini48.z.string(),
|
|
14730
|
+
"allowed-tools": import_mini48.z.optional(import_mini48.z.array(import_mini48.z.string()))
|
|
13760
14731
|
});
|
|
13761
14732
|
var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
13762
14733
|
constructor({
|
|
13763
14734
|
outputRoot = process.cwd(),
|
|
13764
|
-
relativeDirPath = (0,
|
|
14735
|
+
relativeDirPath = (0, import_node_path93.join)(".deepagents", "skills"),
|
|
13765
14736
|
dirName,
|
|
13766
14737
|
frontmatter,
|
|
13767
14738
|
body,
|
|
@@ -13790,7 +14761,7 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
13790
14761
|
}
|
|
13791
14762
|
static getSettablePaths(_options) {
|
|
13792
14763
|
return {
|
|
13793
|
-
relativeDirPath: (0,
|
|
14764
|
+
relativeDirPath: (0, import_node_path93.join)(".deepagents", "skills")
|
|
13794
14765
|
};
|
|
13795
14766
|
}
|
|
13796
14767
|
getFrontmatter() {
|
|
@@ -13876,9 +14847,9 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
13876
14847
|
});
|
|
13877
14848
|
const result = DeepagentsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
13878
14849
|
if (!result.success) {
|
|
13879
|
-
const skillDirPath = (0,
|
|
14850
|
+
const skillDirPath = (0, import_node_path93.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
13880
14851
|
throw new Error(
|
|
13881
|
-
`Invalid frontmatter in ${(0,
|
|
14852
|
+
`Invalid frontmatter in ${(0, import_node_path93.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
13882
14853
|
);
|
|
13883
14854
|
}
|
|
13884
14855
|
return new _DeepagentsSkill({
|
|
@@ -13913,11 +14884,11 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
13913
14884
|
};
|
|
13914
14885
|
|
|
13915
14886
|
// src/features/skills/geminicli-skill.ts
|
|
13916
|
-
var
|
|
13917
|
-
var
|
|
13918
|
-
var GeminiCliSkillFrontmatterSchema =
|
|
13919
|
-
name:
|
|
13920
|
-
description:
|
|
14887
|
+
var import_node_path94 = require("path");
|
|
14888
|
+
var import_mini49 = require("zod/mini");
|
|
14889
|
+
var GeminiCliSkillFrontmatterSchema = import_mini49.z.looseObject({
|
|
14890
|
+
name: import_mini49.z.string(),
|
|
14891
|
+
description: import_mini49.z.string()
|
|
13921
14892
|
});
|
|
13922
14893
|
var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
13923
14894
|
constructor({
|
|
@@ -13953,7 +14924,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
13953
14924
|
global: _global = false
|
|
13954
14925
|
} = {}) {
|
|
13955
14926
|
return {
|
|
13956
|
-
relativeDirPath: (0,
|
|
14927
|
+
relativeDirPath: (0, import_node_path94.join)(".gemini", "skills")
|
|
13957
14928
|
};
|
|
13958
14929
|
}
|
|
13959
14930
|
getFrontmatter() {
|
|
@@ -14033,9 +15004,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
14033
15004
|
});
|
|
14034
15005
|
const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
14035
15006
|
if (!result.success) {
|
|
14036
|
-
const skillDirPath = (0,
|
|
15007
|
+
const skillDirPath = (0, import_node_path94.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
14037
15008
|
throw new Error(
|
|
14038
|
-
`Invalid frontmatter in ${(0,
|
|
15009
|
+
`Invalid frontmatter in ${(0, import_node_path94.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
14039
15010
|
);
|
|
14040
15011
|
}
|
|
14041
15012
|
return new _GeminiCliSkill({
|
|
@@ -14070,16 +15041,16 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
14070
15041
|
};
|
|
14071
15042
|
|
|
14072
15043
|
// src/features/skills/junie-skill.ts
|
|
14073
|
-
var
|
|
14074
|
-
var
|
|
14075
|
-
var JunieSkillFrontmatterSchema =
|
|
14076
|
-
name:
|
|
14077
|
-
description:
|
|
15044
|
+
var import_node_path95 = require("path");
|
|
15045
|
+
var import_mini50 = require("zod/mini");
|
|
15046
|
+
var JunieSkillFrontmatterSchema = import_mini50.z.looseObject({
|
|
15047
|
+
name: import_mini50.z.string(),
|
|
15048
|
+
description: import_mini50.z.string()
|
|
14078
15049
|
});
|
|
14079
15050
|
var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
14080
15051
|
constructor({
|
|
14081
15052
|
outputRoot = process.cwd(),
|
|
14082
|
-
relativeDirPath = (0,
|
|
15053
|
+
relativeDirPath = (0, import_node_path95.join)(".junie", "skills"),
|
|
14083
15054
|
dirName,
|
|
14084
15055
|
frontmatter,
|
|
14085
15056
|
body,
|
|
@@ -14111,7 +15082,7 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
14111
15082
|
throw new Error("JunieSkill does not support global mode.");
|
|
14112
15083
|
}
|
|
14113
15084
|
return {
|
|
14114
|
-
relativeDirPath: (0,
|
|
15085
|
+
relativeDirPath: (0, import_node_path95.join)(".junie", "skills")
|
|
14115
15086
|
};
|
|
14116
15087
|
}
|
|
14117
15088
|
getFrontmatter() {
|
|
@@ -14198,13 +15169,13 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
14198
15169
|
});
|
|
14199
15170
|
const result = JunieSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
14200
15171
|
if (!result.success) {
|
|
14201
|
-
const skillDirPath = (0,
|
|
15172
|
+
const skillDirPath = (0, import_node_path95.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
14202
15173
|
throw new Error(
|
|
14203
|
-
`Invalid frontmatter in ${(0,
|
|
15174
|
+
`Invalid frontmatter in ${(0, import_node_path95.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
14204
15175
|
);
|
|
14205
15176
|
}
|
|
14206
15177
|
if (result.data.name !== loaded.dirName) {
|
|
14207
|
-
const skillFilePath = (0,
|
|
15178
|
+
const skillFilePath = (0, import_node_path95.join)(
|
|
14208
15179
|
loaded.outputRoot,
|
|
14209
15180
|
loaded.relativeDirPath,
|
|
14210
15181
|
loaded.dirName,
|
|
@@ -14246,17 +15217,17 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
14246
15217
|
};
|
|
14247
15218
|
|
|
14248
15219
|
// src/features/skills/kilo-skill.ts
|
|
14249
|
-
var
|
|
14250
|
-
var
|
|
14251
|
-
var KiloSkillFrontmatterSchema =
|
|
14252
|
-
name:
|
|
14253
|
-
description:
|
|
14254
|
-
"allowed-tools":
|
|
15220
|
+
var import_node_path96 = require("path");
|
|
15221
|
+
var import_mini51 = require("zod/mini");
|
|
15222
|
+
var KiloSkillFrontmatterSchema = import_mini51.z.looseObject({
|
|
15223
|
+
name: import_mini51.z.string(),
|
|
15224
|
+
description: import_mini51.z.string(),
|
|
15225
|
+
"allowed-tools": import_mini51.z.optional(import_mini51.z.array(import_mini51.z.string()))
|
|
14255
15226
|
});
|
|
14256
15227
|
var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
14257
15228
|
constructor({
|
|
14258
15229
|
outputRoot = process.cwd(),
|
|
14259
|
-
relativeDirPath = (0,
|
|
15230
|
+
relativeDirPath = (0, import_node_path96.join)(".kilo", "skills"),
|
|
14260
15231
|
dirName,
|
|
14261
15232
|
frontmatter,
|
|
14262
15233
|
body,
|
|
@@ -14285,7 +15256,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
14285
15256
|
}
|
|
14286
15257
|
static getSettablePaths({ global = false } = {}) {
|
|
14287
15258
|
return {
|
|
14288
|
-
relativeDirPath: global ? (0,
|
|
15259
|
+
relativeDirPath: global ? (0, import_node_path96.join)(".config", "kilo", "skills") : (0, import_node_path96.join)(".kilo", "skills")
|
|
14289
15260
|
};
|
|
14290
15261
|
}
|
|
14291
15262
|
getFrontmatter() {
|
|
@@ -14371,9 +15342,9 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
14371
15342
|
});
|
|
14372
15343
|
const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
14373
15344
|
if (!result.success) {
|
|
14374
|
-
const skillDirPath = (0,
|
|
15345
|
+
const skillDirPath = (0, import_node_path96.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
14375
15346
|
throw new Error(
|
|
14376
|
-
`Invalid frontmatter in ${(0,
|
|
15347
|
+
`Invalid frontmatter in ${(0, import_node_path96.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
14377
15348
|
);
|
|
14378
15349
|
}
|
|
14379
15350
|
return new _KiloSkill({
|
|
@@ -14407,16 +15378,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
14407
15378
|
};
|
|
14408
15379
|
|
|
14409
15380
|
// src/features/skills/kiro-skill.ts
|
|
14410
|
-
var
|
|
14411
|
-
var
|
|
14412
|
-
var KiroSkillFrontmatterSchema =
|
|
14413
|
-
name:
|
|
14414
|
-
description:
|
|
15381
|
+
var import_node_path97 = require("path");
|
|
15382
|
+
var import_mini52 = require("zod/mini");
|
|
15383
|
+
var KiroSkillFrontmatterSchema = import_mini52.z.looseObject({
|
|
15384
|
+
name: import_mini52.z.string(),
|
|
15385
|
+
description: import_mini52.z.string()
|
|
14415
15386
|
});
|
|
14416
15387
|
var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
14417
15388
|
constructor({
|
|
14418
15389
|
outputRoot = process.cwd(),
|
|
14419
|
-
relativeDirPath = (0,
|
|
15390
|
+
relativeDirPath = (0, import_node_path97.join)(".kiro", "skills"),
|
|
14420
15391
|
dirName,
|
|
14421
15392
|
frontmatter,
|
|
14422
15393
|
body,
|
|
@@ -14448,7 +15419,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
14448
15419
|
throw new Error("KiroSkill does not support global mode.");
|
|
14449
15420
|
}
|
|
14450
15421
|
return {
|
|
14451
|
-
relativeDirPath: (0,
|
|
15422
|
+
relativeDirPath: (0, import_node_path97.join)(".kiro", "skills")
|
|
14452
15423
|
};
|
|
14453
15424
|
}
|
|
14454
15425
|
getFrontmatter() {
|
|
@@ -14536,13 +15507,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
14536
15507
|
});
|
|
14537
15508
|
const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
14538
15509
|
if (!result.success) {
|
|
14539
|
-
const skillDirPath = (0,
|
|
15510
|
+
const skillDirPath = (0, import_node_path97.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
14540
15511
|
throw new Error(
|
|
14541
|
-
`Invalid frontmatter in ${(0,
|
|
15512
|
+
`Invalid frontmatter in ${(0, import_node_path97.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
14542
15513
|
);
|
|
14543
15514
|
}
|
|
14544
15515
|
if (result.data.name !== loaded.dirName) {
|
|
14545
|
-
const skillFilePath = (0,
|
|
15516
|
+
const skillFilePath = (0, import_node_path97.join)(
|
|
14546
15517
|
loaded.outputRoot,
|
|
14547
15518
|
loaded.relativeDirPath,
|
|
14548
15519
|
loaded.dirName,
|
|
@@ -14584,17 +15555,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
14584
15555
|
};
|
|
14585
15556
|
|
|
14586
15557
|
// src/features/skills/opencode-skill.ts
|
|
14587
|
-
var
|
|
14588
|
-
var
|
|
14589
|
-
var OpenCodeSkillFrontmatterSchema =
|
|
14590
|
-
name:
|
|
14591
|
-
description:
|
|
14592
|
-
"allowed-tools":
|
|
15558
|
+
var import_node_path98 = require("path");
|
|
15559
|
+
var import_mini53 = require("zod/mini");
|
|
15560
|
+
var OpenCodeSkillFrontmatterSchema = import_mini53.z.looseObject({
|
|
15561
|
+
name: import_mini53.z.string(),
|
|
15562
|
+
description: import_mini53.z.string(),
|
|
15563
|
+
"allowed-tools": import_mini53.z.optional(import_mini53.z.array(import_mini53.z.string()))
|
|
14593
15564
|
});
|
|
14594
15565
|
var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
14595
15566
|
constructor({
|
|
14596
15567
|
outputRoot = process.cwd(),
|
|
14597
|
-
relativeDirPath = (0,
|
|
15568
|
+
relativeDirPath = (0, import_node_path98.join)(".opencode", "skill"),
|
|
14598
15569
|
dirName,
|
|
14599
15570
|
frontmatter,
|
|
14600
15571
|
body,
|
|
@@ -14623,7 +15594,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
14623
15594
|
}
|
|
14624
15595
|
static getSettablePaths({ global = false } = {}) {
|
|
14625
15596
|
return {
|
|
14626
|
-
relativeDirPath: global ? (0,
|
|
15597
|
+
relativeDirPath: global ? (0, import_node_path98.join)(".config", "opencode", "skill") : (0, import_node_path98.join)(".opencode", "skill")
|
|
14627
15598
|
};
|
|
14628
15599
|
}
|
|
14629
15600
|
getFrontmatter() {
|
|
@@ -14709,9 +15680,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
14709
15680
|
});
|
|
14710
15681
|
const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
14711
15682
|
if (!result.success) {
|
|
14712
|
-
const skillDirPath = (0,
|
|
15683
|
+
const skillDirPath = (0, import_node_path98.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
14713
15684
|
throw new Error(
|
|
14714
|
-
`Invalid frontmatter in ${(0,
|
|
15685
|
+
`Invalid frontmatter in ${(0, import_node_path98.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
14715
15686
|
);
|
|
14716
15687
|
}
|
|
14717
15688
|
return new _OpenCodeSkill({
|
|
@@ -14745,11 +15716,11 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
14745
15716
|
};
|
|
14746
15717
|
|
|
14747
15718
|
// src/features/skills/pi-skill.ts
|
|
14748
|
-
var
|
|
14749
|
-
var
|
|
14750
|
-
var PiSkillFrontmatterSchema =
|
|
14751
|
-
name:
|
|
14752
|
-
description:
|
|
15719
|
+
var import_node_path99 = require("path");
|
|
15720
|
+
var import_mini54 = require("zod/mini");
|
|
15721
|
+
var PiSkillFrontmatterSchema = import_mini54.z.looseObject({
|
|
15722
|
+
name: import_mini54.z.string(),
|
|
15723
|
+
description: import_mini54.z.string()
|
|
14753
15724
|
});
|
|
14754
15725
|
var PiSkill = class _PiSkill extends ToolSkill {
|
|
14755
15726
|
constructor({
|
|
@@ -14785,11 +15756,11 @@ var PiSkill = class _PiSkill extends ToolSkill {
|
|
|
14785
15756
|
static getSettablePaths({ global } = {}) {
|
|
14786
15757
|
if (global) {
|
|
14787
15758
|
return {
|
|
14788
|
-
relativeDirPath: (0,
|
|
15759
|
+
relativeDirPath: (0, import_node_path99.join)(".pi", "agent", "skills")
|
|
14789
15760
|
};
|
|
14790
15761
|
}
|
|
14791
15762
|
return {
|
|
14792
|
-
relativeDirPath: (0,
|
|
15763
|
+
relativeDirPath: (0, import_node_path99.join)(".pi", "skills")
|
|
14793
15764
|
};
|
|
14794
15765
|
}
|
|
14795
15766
|
getFrontmatter() {
|
|
@@ -14868,9 +15839,9 @@ var PiSkill = class _PiSkill extends ToolSkill {
|
|
|
14868
15839
|
});
|
|
14869
15840
|
const result = PiSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
14870
15841
|
if (!result.success) {
|
|
14871
|
-
const skillDirPath = (0,
|
|
15842
|
+
const skillDirPath = (0, import_node_path99.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
14872
15843
|
throw new Error(
|
|
14873
|
-
`Invalid frontmatter in ${(0,
|
|
15844
|
+
`Invalid frontmatter in ${(0, import_node_path99.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
14874
15845
|
);
|
|
14875
15846
|
}
|
|
14876
15847
|
return new _PiSkill({
|
|
@@ -14905,16 +15876,16 @@ var PiSkill = class _PiSkill extends ToolSkill {
|
|
|
14905
15876
|
};
|
|
14906
15877
|
|
|
14907
15878
|
// src/features/skills/replit-skill.ts
|
|
14908
|
-
var
|
|
14909
|
-
var
|
|
14910
|
-
var ReplitSkillFrontmatterSchema =
|
|
14911
|
-
name:
|
|
14912
|
-
description:
|
|
15879
|
+
var import_node_path100 = require("path");
|
|
15880
|
+
var import_mini55 = require("zod/mini");
|
|
15881
|
+
var ReplitSkillFrontmatterSchema = import_mini55.z.looseObject({
|
|
15882
|
+
name: import_mini55.z.string(),
|
|
15883
|
+
description: import_mini55.z.string()
|
|
14913
15884
|
});
|
|
14914
15885
|
var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
14915
15886
|
constructor({
|
|
14916
15887
|
outputRoot = process.cwd(),
|
|
14917
|
-
relativeDirPath = (0,
|
|
15888
|
+
relativeDirPath = (0, import_node_path100.join)(".agents", "skills"),
|
|
14918
15889
|
dirName,
|
|
14919
15890
|
frontmatter,
|
|
14920
15891
|
body,
|
|
@@ -14946,7 +15917,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
14946
15917
|
throw new Error("ReplitSkill does not support global mode.");
|
|
14947
15918
|
}
|
|
14948
15919
|
return {
|
|
14949
|
-
relativeDirPath: (0,
|
|
15920
|
+
relativeDirPath: (0, import_node_path100.join)(".agents", "skills")
|
|
14950
15921
|
};
|
|
14951
15922
|
}
|
|
14952
15923
|
getFrontmatter() {
|
|
@@ -15026,9 +15997,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
15026
15997
|
});
|
|
15027
15998
|
const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
15028
15999
|
if (!result.success) {
|
|
15029
|
-
const skillDirPath = (0,
|
|
16000
|
+
const skillDirPath = (0, import_node_path100.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
15030
16001
|
throw new Error(
|
|
15031
|
-
`Invalid frontmatter in ${(0,
|
|
16002
|
+
`Invalid frontmatter in ${(0, import_node_path100.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
15032
16003
|
);
|
|
15033
16004
|
}
|
|
15034
16005
|
return new _ReplitSkill({
|
|
@@ -15063,16 +16034,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
15063
16034
|
};
|
|
15064
16035
|
|
|
15065
16036
|
// src/features/skills/roo-skill.ts
|
|
15066
|
-
var
|
|
15067
|
-
var
|
|
15068
|
-
var RooSkillFrontmatterSchema =
|
|
15069
|
-
name:
|
|
15070
|
-
description:
|
|
16037
|
+
var import_node_path101 = require("path");
|
|
16038
|
+
var import_mini56 = require("zod/mini");
|
|
16039
|
+
var RooSkillFrontmatterSchema = import_mini56.z.looseObject({
|
|
16040
|
+
name: import_mini56.z.string(),
|
|
16041
|
+
description: import_mini56.z.string()
|
|
15071
16042
|
});
|
|
15072
16043
|
var RooSkill = class _RooSkill extends ToolSkill {
|
|
15073
16044
|
constructor({
|
|
15074
16045
|
outputRoot = process.cwd(),
|
|
15075
|
-
relativeDirPath = (0,
|
|
16046
|
+
relativeDirPath = (0, import_node_path101.join)(".roo", "skills"),
|
|
15076
16047
|
dirName,
|
|
15077
16048
|
frontmatter,
|
|
15078
16049
|
body,
|
|
@@ -15103,7 +16074,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
15103
16074
|
global: _global = false
|
|
15104
16075
|
} = {}) {
|
|
15105
16076
|
return {
|
|
15106
|
-
relativeDirPath: (0,
|
|
16077
|
+
relativeDirPath: (0, import_node_path101.join)(".roo", "skills")
|
|
15107
16078
|
};
|
|
15108
16079
|
}
|
|
15109
16080
|
getFrontmatter() {
|
|
@@ -15191,13 +16162,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
15191
16162
|
});
|
|
15192
16163
|
const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
15193
16164
|
if (!result.success) {
|
|
15194
|
-
const skillDirPath = (0,
|
|
16165
|
+
const skillDirPath = (0, import_node_path101.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
15195
16166
|
throw new Error(
|
|
15196
|
-
`Invalid frontmatter in ${(0,
|
|
16167
|
+
`Invalid frontmatter in ${(0, import_node_path101.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
15197
16168
|
);
|
|
15198
16169
|
}
|
|
15199
16170
|
if (result.data.name !== loaded.dirName) {
|
|
15200
|
-
const skillFilePath = (0,
|
|
16171
|
+
const skillFilePath = (0, import_node_path101.join)(
|
|
15201
16172
|
loaded.outputRoot,
|
|
15202
16173
|
loaded.relativeDirPath,
|
|
15203
16174
|
loaded.dirName,
|
|
@@ -15238,24 +16209,24 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
15238
16209
|
};
|
|
15239
16210
|
|
|
15240
16211
|
// src/features/skills/skills-utils.ts
|
|
15241
|
-
var
|
|
16212
|
+
var import_node_path102 = require("path");
|
|
15242
16213
|
async function getLocalSkillDirNames(outputRoot) {
|
|
15243
|
-
const skillsDir = (0,
|
|
16214
|
+
const skillsDir = (0, import_node_path102.join)(outputRoot, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
|
|
15244
16215
|
const names = /* @__PURE__ */ new Set();
|
|
15245
16216
|
if (!await directoryExists(skillsDir)) {
|
|
15246
16217
|
return names;
|
|
15247
16218
|
}
|
|
15248
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
16219
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path102.join)(skillsDir, "*"), { type: "dir" });
|
|
15249
16220
|
for (const dirPath of dirPaths) {
|
|
15250
|
-
const name = (0,
|
|
15251
|
-
if (name === (0,
|
|
16221
|
+
const name = (0, import_node_path102.basename)(dirPath);
|
|
16222
|
+
if (name === (0, import_node_path102.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
|
|
15252
16223
|
names.add(name);
|
|
15253
16224
|
}
|
|
15254
16225
|
return names;
|
|
15255
16226
|
}
|
|
15256
16227
|
|
|
15257
16228
|
// src/features/skills/takt-skill.ts
|
|
15258
|
-
var
|
|
16229
|
+
var import_node_path103 = __toESM(require("path"), 1);
|
|
15259
16230
|
var DEFAULT_TAKT_SKILL_DIR = "knowledge";
|
|
15260
16231
|
var TaktSkill = class _TaktSkill extends ToolSkill {
|
|
15261
16232
|
fileName;
|
|
@@ -15292,7 +16263,7 @@ var TaktSkill = class _TaktSkill extends ToolSkill {
|
|
|
15292
16263
|
}
|
|
15293
16264
|
static getSettablePaths(_options = {}) {
|
|
15294
16265
|
return {
|
|
15295
|
-
relativeDirPath: (0,
|
|
16266
|
+
relativeDirPath: (0, import_node_path103.join)(".takt", "facets", DEFAULT_TAKT_SKILL_DIR)
|
|
15296
16267
|
};
|
|
15297
16268
|
}
|
|
15298
16269
|
/**
|
|
@@ -15303,11 +16274,11 @@ var TaktSkill = class _TaktSkill extends ToolSkill {
|
|
|
15303
16274
|
* malicious `relativeDirPath` cannot escape `outputRoot`.
|
|
15304
16275
|
*/
|
|
15305
16276
|
getDirPath() {
|
|
15306
|
-
const fullPath = (0,
|
|
15307
|
-
const resolvedFull = (0,
|
|
15308
|
-
const resolvedBase = (0,
|
|
15309
|
-
const rel = (0,
|
|
15310
|
-
if (rel.startsWith("..") ||
|
|
16277
|
+
const fullPath = (0, import_node_path103.join)(this.outputRoot, this.relativeDirPath);
|
|
16278
|
+
const resolvedFull = (0, import_node_path103.resolve)(fullPath);
|
|
16279
|
+
const resolvedBase = (0, import_node_path103.resolve)(this.outputRoot);
|
|
16280
|
+
const rel = (0, import_node_path103.relative)(resolvedBase, resolvedFull);
|
|
16281
|
+
if (rel.startsWith("..") || import_node_path103.default.isAbsolute(rel)) {
|
|
15311
16282
|
throw new Error(
|
|
15312
16283
|
`Path traversal detected: Final path escapes outputRoot. outputRoot="${this.outputRoot}", relativeDirPath="${this.relativeDirPath}"`
|
|
15313
16284
|
);
|
|
@@ -15344,7 +16315,7 @@ var TaktSkill = class _TaktSkill extends ToolSkill {
|
|
|
15344
16315
|
const stem = overrideName ?? rulesyncSkill.getDirName();
|
|
15345
16316
|
assertSafeTaktName({ name: stem, featureLabel: "skill", sourceLabel });
|
|
15346
16317
|
const fileName = `${stem}.md`;
|
|
15347
|
-
const relativeDirPath = (0,
|
|
16318
|
+
const relativeDirPath = (0, import_node_path103.join)(".takt", "facets", DEFAULT_TAKT_SKILL_DIR);
|
|
15348
16319
|
return new _TaktSkill({
|
|
15349
16320
|
outputRoot,
|
|
15350
16321
|
relativeDirPath,
|
|
@@ -15394,11 +16365,11 @@ var TaktSkill = class _TaktSkill extends ToolSkill {
|
|
|
15394
16365
|
};
|
|
15395
16366
|
|
|
15396
16367
|
// src/features/skills/windsurf-skill.ts
|
|
15397
|
-
var
|
|
15398
|
-
var
|
|
15399
|
-
var WindsurfSkillFrontmatterSchema =
|
|
15400
|
-
name:
|
|
15401
|
-
description:
|
|
16368
|
+
var import_node_path104 = require("path");
|
|
16369
|
+
var import_mini57 = require("zod/mini");
|
|
16370
|
+
var WindsurfSkillFrontmatterSchema = import_mini57.z.looseObject({
|
|
16371
|
+
name: import_mini57.z.string(),
|
|
16372
|
+
description: import_mini57.z.string()
|
|
15402
16373
|
});
|
|
15403
16374
|
var WindsurfSkill = class _WindsurfSkill extends ToolSkill {
|
|
15404
16375
|
constructor({
|
|
@@ -15433,11 +16404,11 @@ var WindsurfSkill = class _WindsurfSkill extends ToolSkill {
|
|
|
15433
16404
|
static getSettablePaths({ global = false } = {}) {
|
|
15434
16405
|
if (global) {
|
|
15435
16406
|
return {
|
|
15436
|
-
relativeDirPath: (0,
|
|
16407
|
+
relativeDirPath: (0, import_node_path104.join)(".codeium", "windsurf", "skills")
|
|
15437
16408
|
};
|
|
15438
16409
|
}
|
|
15439
16410
|
return {
|
|
15440
|
-
relativeDirPath: (0,
|
|
16411
|
+
relativeDirPath: (0, import_node_path104.join)(".windsurf", "skills")
|
|
15441
16412
|
};
|
|
15442
16413
|
}
|
|
15443
16414
|
getFrontmatter() {
|
|
@@ -15517,9 +16488,9 @@ var WindsurfSkill = class _WindsurfSkill extends ToolSkill {
|
|
|
15517
16488
|
});
|
|
15518
16489
|
const result = WindsurfSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
15519
16490
|
if (!result.success) {
|
|
15520
|
-
const skillDirPath = (0,
|
|
16491
|
+
const skillDirPath = (0, import_node_path104.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
15521
16492
|
throw new Error(
|
|
15522
|
-
`Invalid frontmatter in ${(0,
|
|
16493
|
+
`Invalid frontmatter in ${(0, import_node_path104.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
15523
16494
|
);
|
|
15524
16495
|
}
|
|
15525
16496
|
return new _WindsurfSkill({
|
|
@@ -15578,7 +16549,7 @@ var skillsProcessorToolTargetTuple = [
|
|
|
15578
16549
|
"takt",
|
|
15579
16550
|
"windsurf"
|
|
15580
16551
|
];
|
|
15581
|
-
var SkillsProcessorToolTargetSchema =
|
|
16552
|
+
var SkillsProcessorToolTargetSchema = import_mini58.z.enum(skillsProcessorToolTargetTuple);
|
|
15582
16553
|
var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
15583
16554
|
[
|
|
15584
16555
|
"agentsmd",
|
|
@@ -15829,11 +16800,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
15829
16800
|
)
|
|
15830
16801
|
);
|
|
15831
16802
|
const localSkillNames = new Set(localDirNames);
|
|
15832
|
-
const curatedDirPath = (0,
|
|
16803
|
+
const curatedDirPath = (0, import_node_path105.join)(this.inputRoot, RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
|
|
15833
16804
|
let curatedSkills = [];
|
|
15834
16805
|
if (await directoryExists(curatedDirPath)) {
|
|
15835
|
-
const curatedDirPaths = await findFilesByGlobs((0,
|
|
15836
|
-
const curatedDirNames = curatedDirPaths.map((path4) => (0,
|
|
16806
|
+
const curatedDirPaths = await findFilesByGlobs((0, import_node_path105.join)(curatedDirPath, "*"), { type: "dir" });
|
|
16807
|
+
const curatedDirNames = curatedDirPaths.map((path4) => (0, import_node_path105.basename)(path4));
|
|
15837
16808
|
const nonConflicting = curatedDirNames.filter((name) => {
|
|
15838
16809
|
if (localSkillNames.has(name)) {
|
|
15839
16810
|
this.logger.debug(`Skipping curated skill "${name}": local skill takes precedence.`);
|
|
@@ -15870,13 +16841,13 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
15870
16841
|
const seenDirNames = /* @__PURE__ */ new Set();
|
|
15871
16842
|
const loadEntries = [];
|
|
15872
16843
|
for (const root of roots) {
|
|
15873
|
-
const skillsDirPath = (0,
|
|
16844
|
+
const skillsDirPath = (0, import_node_path105.join)(this.outputRoot, root);
|
|
15874
16845
|
if (!await directoryExists(skillsDirPath)) {
|
|
15875
16846
|
continue;
|
|
15876
16847
|
}
|
|
15877
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
16848
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path105.join)(skillsDirPath, "*"), { type: "dir" });
|
|
15878
16849
|
for (const dirPath of dirPaths) {
|
|
15879
|
-
const dirName = (0,
|
|
16850
|
+
const dirName = (0, import_node_path105.basename)(dirPath);
|
|
15880
16851
|
if (seenDirNames.has(dirName)) {
|
|
15881
16852
|
continue;
|
|
15882
16853
|
}
|
|
@@ -15905,13 +16876,13 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
15905
16876
|
const roots = toolSkillSearchRoots(paths);
|
|
15906
16877
|
const toolSkills = [];
|
|
15907
16878
|
for (const root of roots) {
|
|
15908
|
-
const skillsDirPath = (0,
|
|
16879
|
+
const skillsDirPath = (0, import_node_path105.join)(this.outputRoot, root);
|
|
15909
16880
|
if (!await directoryExists(skillsDirPath)) {
|
|
15910
16881
|
continue;
|
|
15911
16882
|
}
|
|
15912
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
16883
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path105.join)(skillsDirPath, "*"), { type: "dir" });
|
|
15913
16884
|
for (const dirPath of dirPaths) {
|
|
15914
|
-
const dirName = (0,
|
|
16885
|
+
const dirName = (0, import_node_path105.basename)(dirPath);
|
|
15915
16886
|
const toolSkill = factory.class.forDeletion({
|
|
15916
16887
|
outputRoot: this.outputRoot,
|
|
15917
16888
|
relativeDirPath: root,
|
|
@@ -15973,11 +16944,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
15973
16944
|
};
|
|
15974
16945
|
|
|
15975
16946
|
// src/features/subagents/agentsmd-subagent.ts
|
|
15976
|
-
var
|
|
16947
|
+
var import_node_path107 = require("path");
|
|
15977
16948
|
|
|
15978
16949
|
// src/features/subagents/simulated-subagent.ts
|
|
15979
|
-
var
|
|
15980
|
-
var
|
|
16950
|
+
var import_node_path106 = require("path");
|
|
16951
|
+
var import_mini59 = require("zod/mini");
|
|
15981
16952
|
|
|
15982
16953
|
// src/features/subagents/tool-subagent.ts
|
|
15983
16954
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -16029,9 +17000,9 @@ var ToolSubagent = class extends ToolFile {
|
|
|
16029
17000
|
};
|
|
16030
17001
|
|
|
16031
17002
|
// src/features/subagents/simulated-subagent.ts
|
|
16032
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
16033
|
-
name:
|
|
16034
|
-
description:
|
|
17003
|
+
var SimulatedSubagentFrontmatterSchema = import_mini59.z.object({
|
|
17004
|
+
name: import_mini59.z.string(),
|
|
17005
|
+
description: import_mini59.z.optional(import_mini59.z.string())
|
|
16035
17006
|
});
|
|
16036
17007
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
16037
17008
|
frontmatter;
|
|
@@ -16041,7 +17012,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
16041
17012
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
16042
17013
|
if (!result.success) {
|
|
16043
17014
|
throw new Error(
|
|
16044
|
-
`Invalid frontmatter in ${(0,
|
|
17015
|
+
`Invalid frontmatter in ${(0, import_node_path106.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
16045
17016
|
);
|
|
16046
17017
|
}
|
|
16047
17018
|
}
|
|
@@ -16092,7 +17063,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
16092
17063
|
return {
|
|
16093
17064
|
success: false,
|
|
16094
17065
|
error: new Error(
|
|
16095
|
-
`Invalid frontmatter in ${(0,
|
|
17066
|
+
`Invalid frontmatter in ${(0, import_node_path106.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
16096
17067
|
)
|
|
16097
17068
|
};
|
|
16098
17069
|
}
|
|
@@ -16102,7 +17073,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
16102
17073
|
relativeFilePath,
|
|
16103
17074
|
validate = true
|
|
16104
17075
|
}) {
|
|
16105
|
-
const filePath = (0,
|
|
17076
|
+
const filePath = (0, import_node_path106.join)(outputRoot, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
16106
17077
|
const fileContent = await readFileContent(filePath);
|
|
16107
17078
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
16108
17079
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -16112,7 +17083,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
16112
17083
|
return {
|
|
16113
17084
|
outputRoot,
|
|
16114
17085
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
16115
|
-
relativeFilePath: (0,
|
|
17086
|
+
relativeFilePath: (0, import_node_path106.basename)(relativeFilePath),
|
|
16116
17087
|
frontmatter: result.data,
|
|
16117
17088
|
body: content.trim(),
|
|
16118
17089
|
validate
|
|
@@ -16138,7 +17109,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
16138
17109
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
16139
17110
|
static getSettablePaths() {
|
|
16140
17111
|
return {
|
|
16141
|
-
relativeDirPath: (0,
|
|
17112
|
+
relativeDirPath: (0, import_node_path107.join)(".agents", "subagents")
|
|
16142
17113
|
};
|
|
16143
17114
|
}
|
|
16144
17115
|
static async fromFile(params) {
|
|
@@ -16161,11 +17132,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
16161
17132
|
};
|
|
16162
17133
|
|
|
16163
17134
|
// src/features/subagents/factorydroid-subagent.ts
|
|
16164
|
-
var
|
|
17135
|
+
var import_node_path108 = require("path");
|
|
16165
17136
|
var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
|
|
16166
17137
|
static getSettablePaths(_options) {
|
|
16167
17138
|
return {
|
|
16168
|
-
relativeDirPath: (0,
|
|
17139
|
+
relativeDirPath: (0, import_node_path108.join)(".factory", "droids")
|
|
16169
17140
|
};
|
|
16170
17141
|
}
|
|
16171
17142
|
static async fromFile(params) {
|
|
@@ -16188,19 +17159,19 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
|
|
|
16188
17159
|
};
|
|
16189
17160
|
|
|
16190
17161
|
// src/features/subagents/geminicli-subagent.ts
|
|
16191
|
-
var
|
|
16192
|
-
var
|
|
17162
|
+
var import_node_path110 = require("path");
|
|
17163
|
+
var import_mini61 = require("zod/mini");
|
|
16193
17164
|
|
|
16194
17165
|
// src/features/subagents/rulesync-subagent.ts
|
|
16195
|
-
var
|
|
16196
|
-
var
|
|
16197
|
-
var RulesyncSubagentFrontmatterSchema =
|
|
16198
|
-
targets:
|
|
16199
|
-
name:
|
|
16200
|
-
description:
|
|
16201
|
-
takt:
|
|
16202
|
-
|
|
16203
|
-
name:
|
|
17166
|
+
var import_node_path109 = require("path");
|
|
17167
|
+
var import_mini60 = require("zod/mini");
|
|
17168
|
+
var RulesyncSubagentFrontmatterSchema = import_mini60.z.looseObject({
|
|
17169
|
+
targets: import_mini60.z._default(RulesyncTargetsSchema, ["*"]),
|
|
17170
|
+
name: import_mini60.z.string(),
|
|
17171
|
+
description: import_mini60.z.optional(import_mini60.z.string()),
|
|
17172
|
+
takt: import_mini60.z.optional(
|
|
17173
|
+
import_mini60.z.looseObject({
|
|
17174
|
+
name: import_mini60.z.optional(import_mini60.z.string())
|
|
16204
17175
|
})
|
|
16205
17176
|
)
|
|
16206
17177
|
});
|
|
@@ -16211,7 +17182,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
16211
17182
|
const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
16212
17183
|
if (!parseResult.success && rest.validate !== false) {
|
|
16213
17184
|
throw new Error(
|
|
16214
|
-
`Invalid frontmatter in ${(0,
|
|
17185
|
+
`Invalid frontmatter in ${(0, import_node_path109.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
16215
17186
|
);
|
|
16216
17187
|
}
|
|
16217
17188
|
const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
|
|
@@ -16244,7 +17215,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
16244
17215
|
return {
|
|
16245
17216
|
success: false,
|
|
16246
17217
|
error: new Error(
|
|
16247
|
-
`Invalid frontmatter in ${(0,
|
|
17218
|
+
`Invalid frontmatter in ${(0, import_node_path109.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
16248
17219
|
)
|
|
16249
17220
|
};
|
|
16250
17221
|
}
|
|
@@ -16253,14 +17224,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
16253
17224
|
outputRoot = process.cwd(),
|
|
16254
17225
|
relativeFilePath
|
|
16255
17226
|
}) {
|
|
16256
|
-
const filePath = (0,
|
|
17227
|
+
const filePath = (0, import_node_path109.join)(outputRoot, RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
|
|
16257
17228
|
const fileContent = await readFileContent(filePath);
|
|
16258
17229
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
16259
17230
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
16260
17231
|
if (!result.success) {
|
|
16261
17232
|
throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
|
|
16262
17233
|
}
|
|
16263
|
-
const filename = (0,
|
|
17234
|
+
const filename = (0, import_node_path109.basename)(relativeFilePath);
|
|
16264
17235
|
return new _RulesyncSubagent({
|
|
16265
17236
|
outputRoot,
|
|
16266
17237
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
@@ -16272,9 +17243,9 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
16272
17243
|
};
|
|
16273
17244
|
|
|
16274
17245
|
// src/features/subagents/geminicli-subagent.ts
|
|
16275
|
-
var GeminiCliSubagentFrontmatterSchema =
|
|
16276
|
-
name:
|
|
16277
|
-
description:
|
|
17246
|
+
var GeminiCliSubagentFrontmatterSchema = import_mini61.z.looseObject({
|
|
17247
|
+
name: import_mini61.z.string(),
|
|
17248
|
+
description: import_mini61.z.optional(import_mini61.z.string())
|
|
16278
17249
|
});
|
|
16279
17250
|
var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
16280
17251
|
frontmatter;
|
|
@@ -16284,7 +17255,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
16284
17255
|
const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
16285
17256
|
if (!result.success) {
|
|
16286
17257
|
throw new Error(
|
|
16287
|
-
`Invalid frontmatter in ${(0,
|
|
17258
|
+
`Invalid frontmatter in ${(0, import_node_path110.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
16288
17259
|
);
|
|
16289
17260
|
}
|
|
16290
17261
|
}
|
|
@@ -16297,7 +17268,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
16297
17268
|
}
|
|
16298
17269
|
static getSettablePaths(_options = {}) {
|
|
16299
17270
|
return {
|
|
16300
|
-
relativeDirPath: (0,
|
|
17271
|
+
relativeDirPath: (0, import_node_path110.join)(".gemini", "agents")
|
|
16301
17272
|
};
|
|
16302
17273
|
}
|
|
16303
17274
|
getFrontmatter() {
|
|
@@ -16365,7 +17336,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
16365
17336
|
return {
|
|
16366
17337
|
success: false,
|
|
16367
17338
|
error: new Error(
|
|
16368
|
-
`Invalid frontmatter in ${(0,
|
|
17339
|
+
`Invalid frontmatter in ${(0, import_node_path110.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
16369
17340
|
)
|
|
16370
17341
|
};
|
|
16371
17342
|
}
|
|
@@ -16383,7 +17354,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
16383
17354
|
global = false
|
|
16384
17355
|
}) {
|
|
16385
17356
|
const paths = this.getSettablePaths({ global });
|
|
16386
|
-
const filePath = (0,
|
|
17357
|
+
const filePath = (0, import_node_path110.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
16387
17358
|
const fileContent = await readFileContent(filePath);
|
|
16388
17359
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
16389
17360
|
const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -16419,11 +17390,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
16419
17390
|
};
|
|
16420
17391
|
|
|
16421
17392
|
// src/features/subagents/roo-subagent.ts
|
|
16422
|
-
var
|
|
17393
|
+
var import_node_path111 = require("path");
|
|
16423
17394
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
16424
17395
|
static getSettablePaths() {
|
|
16425
17396
|
return {
|
|
16426
|
-
relativeDirPath: (0,
|
|
17397
|
+
relativeDirPath: (0, import_node_path111.join)(".roo", "subagents")
|
|
16427
17398
|
};
|
|
16428
17399
|
}
|
|
16429
17400
|
static async fromFile(params) {
|
|
@@ -16446,11 +17417,11 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
16446
17417
|
};
|
|
16447
17418
|
|
|
16448
17419
|
// src/features/subagents/rovodev-subagent.ts
|
|
16449
|
-
var
|
|
16450
|
-
var
|
|
16451
|
-
var RovodevSubagentFrontmatterSchema =
|
|
16452
|
-
name:
|
|
16453
|
-
description:
|
|
17420
|
+
var import_node_path112 = require("path");
|
|
17421
|
+
var import_mini62 = require("zod/mini");
|
|
17422
|
+
var RovodevSubagentFrontmatterSchema = import_mini62.z.looseObject({
|
|
17423
|
+
name: import_mini62.z.string(),
|
|
17424
|
+
description: import_mini62.z.optional(import_mini62.z.string())
|
|
16454
17425
|
});
|
|
16455
17426
|
var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
16456
17427
|
frontmatter;
|
|
@@ -16460,7 +17431,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
16460
17431
|
const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
16461
17432
|
if (!result.success) {
|
|
16462
17433
|
throw new Error(
|
|
16463
|
-
`Invalid frontmatter in ${(0,
|
|
17434
|
+
`Invalid frontmatter in ${(0, import_node_path112.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
16464
17435
|
);
|
|
16465
17436
|
}
|
|
16466
17437
|
}
|
|
@@ -16472,7 +17443,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
16472
17443
|
}
|
|
16473
17444
|
static getSettablePaths(_options = {}) {
|
|
16474
17445
|
return {
|
|
16475
|
-
relativeDirPath: (0,
|
|
17446
|
+
relativeDirPath: (0, import_node_path112.join)(".rovodev", "subagents")
|
|
16476
17447
|
};
|
|
16477
17448
|
}
|
|
16478
17449
|
getFrontmatter() {
|
|
@@ -16535,7 +17506,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
16535
17506
|
return {
|
|
16536
17507
|
success: false,
|
|
16537
17508
|
error: new Error(
|
|
16538
|
-
`Invalid frontmatter in ${(0,
|
|
17509
|
+
`Invalid frontmatter in ${(0, import_node_path112.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
16539
17510
|
)
|
|
16540
17511
|
};
|
|
16541
17512
|
}
|
|
@@ -16552,7 +17523,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
16552
17523
|
global = false
|
|
16553
17524
|
}) {
|
|
16554
17525
|
const paths = this.getSettablePaths({ global });
|
|
16555
|
-
const filePath = (0,
|
|
17526
|
+
const filePath = (0, import_node_path112.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
16556
17527
|
const fileContent = await readFileContent(filePath);
|
|
16557
17528
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
16558
17529
|
const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -16591,19 +17562,19 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
16591
17562
|
};
|
|
16592
17563
|
|
|
16593
17564
|
// src/features/subagents/subagents-processor.ts
|
|
16594
|
-
var
|
|
16595
|
-
var
|
|
17565
|
+
var import_node_path125 = require("path");
|
|
17566
|
+
var import_mini72 = require("zod/mini");
|
|
16596
17567
|
|
|
16597
17568
|
// src/features/subagents/claudecode-subagent.ts
|
|
16598
|
-
var
|
|
16599
|
-
var
|
|
16600
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
16601
|
-
name:
|
|
16602
|
-
description:
|
|
16603
|
-
model:
|
|
16604
|
-
tools:
|
|
16605
|
-
permissionMode:
|
|
16606
|
-
skills:
|
|
17569
|
+
var import_node_path113 = require("path");
|
|
17570
|
+
var import_mini63 = require("zod/mini");
|
|
17571
|
+
var ClaudecodeSubagentFrontmatterSchema = import_mini63.z.looseObject({
|
|
17572
|
+
name: import_mini63.z.string(),
|
|
17573
|
+
description: import_mini63.z.optional(import_mini63.z.string()),
|
|
17574
|
+
model: import_mini63.z.optional(import_mini63.z.string()),
|
|
17575
|
+
tools: import_mini63.z.optional(import_mini63.z.union([import_mini63.z.string(), import_mini63.z.array(import_mini63.z.string())])),
|
|
17576
|
+
permissionMode: import_mini63.z.optional(import_mini63.z.string()),
|
|
17577
|
+
skills: import_mini63.z.optional(import_mini63.z.union([import_mini63.z.string(), import_mini63.z.array(import_mini63.z.string())]))
|
|
16607
17578
|
});
|
|
16608
17579
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
16609
17580
|
frontmatter;
|
|
@@ -16613,7 +17584,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
16613
17584
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
16614
17585
|
if (!result.success) {
|
|
16615
17586
|
throw new Error(
|
|
16616
|
-
`Invalid frontmatter in ${(0,
|
|
17587
|
+
`Invalid frontmatter in ${(0, import_node_path113.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
16617
17588
|
);
|
|
16618
17589
|
}
|
|
16619
17590
|
}
|
|
@@ -16625,7 +17596,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
16625
17596
|
}
|
|
16626
17597
|
static getSettablePaths(_options = {}) {
|
|
16627
17598
|
return {
|
|
16628
|
-
relativeDirPath: (0,
|
|
17599
|
+
relativeDirPath: (0, import_node_path113.join)(".claude", "agents")
|
|
16629
17600
|
};
|
|
16630
17601
|
}
|
|
16631
17602
|
getFrontmatter() {
|
|
@@ -16704,7 +17675,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
16704
17675
|
return {
|
|
16705
17676
|
success: false,
|
|
16706
17677
|
error: new Error(
|
|
16707
|
-
`Invalid frontmatter in ${(0,
|
|
17678
|
+
`Invalid frontmatter in ${(0, import_node_path113.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
16708
17679
|
)
|
|
16709
17680
|
};
|
|
16710
17681
|
}
|
|
@@ -16722,7 +17693,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
16722
17693
|
global = false
|
|
16723
17694
|
}) {
|
|
16724
17695
|
const paths = this.getSettablePaths({ global });
|
|
16725
|
-
const filePath = (0,
|
|
17696
|
+
const filePath = (0, import_node_path113.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
16726
17697
|
const fileContent = await readFileContent(filePath);
|
|
16727
17698
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
16728
17699
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -16757,16 +17728,16 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
16757
17728
|
};
|
|
16758
17729
|
|
|
16759
17730
|
// src/features/subagents/codexcli-subagent.ts
|
|
16760
|
-
var
|
|
17731
|
+
var import_node_path114 = require("path");
|
|
16761
17732
|
var smolToml6 = __toESM(require("smol-toml"), 1);
|
|
16762
|
-
var
|
|
16763
|
-
var CodexCliSubagentTomlSchema =
|
|
16764
|
-
name:
|
|
16765
|
-
description:
|
|
16766
|
-
developer_instructions:
|
|
16767
|
-
model:
|
|
16768
|
-
model_reasoning_effort:
|
|
16769
|
-
sandbox_mode:
|
|
17733
|
+
var import_mini64 = require("zod/mini");
|
|
17734
|
+
var CodexCliSubagentTomlSchema = import_mini64.z.looseObject({
|
|
17735
|
+
name: import_mini64.z.string(),
|
|
17736
|
+
description: import_mini64.z.optional(import_mini64.z.string()),
|
|
17737
|
+
developer_instructions: import_mini64.z.optional(import_mini64.z.string()),
|
|
17738
|
+
model: import_mini64.z.optional(import_mini64.z.string()),
|
|
17739
|
+
model_reasoning_effort: import_mini64.z.optional(import_mini64.z.string()),
|
|
17740
|
+
sandbox_mode: import_mini64.z.optional(import_mini64.z.string())
|
|
16770
17741
|
});
|
|
16771
17742
|
function stringifyCodexCliSubagentToml(tomlObj) {
|
|
16772
17743
|
const { developer_instructions, ...restFields } = tomlObj;
|
|
@@ -16788,7 +17759,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
16788
17759
|
CodexCliSubagentTomlSchema.parse(parsed);
|
|
16789
17760
|
} catch (error) {
|
|
16790
17761
|
throw new Error(
|
|
16791
|
-
`Invalid TOML in ${(0,
|
|
17762
|
+
`Invalid TOML in ${(0, import_node_path114.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
16792
17763
|
{ cause: error }
|
|
16793
17764
|
);
|
|
16794
17765
|
}
|
|
@@ -16800,7 +17771,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
16800
17771
|
}
|
|
16801
17772
|
static getSettablePaths(_options = {}) {
|
|
16802
17773
|
return {
|
|
16803
|
-
relativeDirPath: (0,
|
|
17774
|
+
relativeDirPath: (0, import_node_path114.join)(".codex", "agents")
|
|
16804
17775
|
};
|
|
16805
17776
|
}
|
|
16806
17777
|
getBody() {
|
|
@@ -16812,7 +17783,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
16812
17783
|
parsed = CodexCliSubagentTomlSchema.parse(smolToml6.parse(this.body));
|
|
16813
17784
|
} catch (error) {
|
|
16814
17785
|
throw new Error(
|
|
16815
|
-
`Failed to parse TOML in ${(0,
|
|
17786
|
+
`Failed to parse TOML in ${(0, import_node_path114.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
16816
17787
|
{ cause: error }
|
|
16817
17788
|
);
|
|
16818
17789
|
}
|
|
@@ -16893,7 +17864,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
16893
17864
|
global = false
|
|
16894
17865
|
}) {
|
|
16895
17866
|
const paths = this.getSettablePaths({ global });
|
|
16896
|
-
const filePath = (0,
|
|
17867
|
+
const filePath = (0, import_node_path114.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
16897
17868
|
const fileContent = await readFileContent(filePath);
|
|
16898
17869
|
const subagent = new _CodexCliSubagent({
|
|
16899
17870
|
outputRoot,
|
|
@@ -16931,13 +17902,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
16931
17902
|
};
|
|
16932
17903
|
|
|
16933
17904
|
// src/features/subagents/copilot-subagent.ts
|
|
16934
|
-
var
|
|
16935
|
-
var
|
|
17905
|
+
var import_node_path115 = require("path");
|
|
17906
|
+
var import_mini65 = require("zod/mini");
|
|
16936
17907
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
16937
|
-
var CopilotSubagentFrontmatterSchema =
|
|
16938
|
-
name:
|
|
16939
|
-
description:
|
|
16940
|
-
tools:
|
|
17908
|
+
var CopilotSubagentFrontmatterSchema = import_mini65.z.looseObject({
|
|
17909
|
+
name: import_mini65.z.string(),
|
|
17910
|
+
description: import_mini65.z.optional(import_mini65.z.string()),
|
|
17911
|
+
tools: import_mini65.z.optional(import_mini65.z.union([import_mini65.z.string(), import_mini65.z.array(import_mini65.z.string())]))
|
|
16941
17912
|
});
|
|
16942
17913
|
var normalizeTools = (tools) => {
|
|
16943
17914
|
if (!tools) {
|
|
@@ -16972,7 +17943,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
16972
17943
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
16973
17944
|
if (!result.success) {
|
|
16974
17945
|
throw new Error(
|
|
16975
|
-
`Invalid frontmatter in ${(0,
|
|
17946
|
+
`Invalid frontmatter in ${(0, import_node_path115.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
16976
17947
|
);
|
|
16977
17948
|
}
|
|
16978
17949
|
}
|
|
@@ -16984,7 +17955,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
16984
17955
|
}
|
|
16985
17956
|
static getSettablePaths(_options = {}) {
|
|
16986
17957
|
return {
|
|
16987
|
-
relativeDirPath: (0,
|
|
17958
|
+
relativeDirPath: (0, import_node_path115.join)(".github", "agents")
|
|
16988
17959
|
};
|
|
16989
17960
|
}
|
|
16990
17961
|
getFrontmatter() {
|
|
@@ -17058,7 +18029,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
17058
18029
|
return {
|
|
17059
18030
|
success: false,
|
|
17060
18031
|
error: new Error(
|
|
17061
|
-
`Invalid frontmatter in ${(0,
|
|
18032
|
+
`Invalid frontmatter in ${(0, import_node_path115.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
17062
18033
|
)
|
|
17063
18034
|
};
|
|
17064
18035
|
}
|
|
@@ -17076,7 +18047,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
17076
18047
|
global = false
|
|
17077
18048
|
}) {
|
|
17078
18049
|
const paths = this.getSettablePaths({ global });
|
|
17079
|
-
const filePath = (0,
|
|
18050
|
+
const filePath = (0, import_node_path115.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
17080
18051
|
const fileContent = await readFileContent(filePath);
|
|
17081
18052
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
17082
18053
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -17112,18 +18083,18 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
17112
18083
|
};
|
|
17113
18084
|
|
|
17114
18085
|
// src/features/subagents/copilotcli-subagent.ts
|
|
17115
|
-
var
|
|
17116
|
-
var
|
|
17117
|
-
var CopilotCliSubagentFrontmatterSchema =
|
|
17118
|
-
description:
|
|
17119
|
-
name:
|
|
17120
|
-
target:
|
|
17121
|
-
tools:
|
|
17122
|
-
model:
|
|
17123
|
-
"disable-model-invocation":
|
|
17124
|
-
"user-invocable":
|
|
17125
|
-
"mcp-servers":
|
|
17126
|
-
metadata:
|
|
18086
|
+
var import_node_path116 = require("path");
|
|
18087
|
+
var import_mini66 = require("zod/mini");
|
|
18088
|
+
var CopilotCliSubagentFrontmatterSchema = import_mini66.z.looseObject({
|
|
18089
|
+
description: import_mini66.z.string(),
|
|
18090
|
+
name: import_mini66.z.optional(import_mini66.z.string()),
|
|
18091
|
+
target: import_mini66.z.optional(import_mini66.z.string()),
|
|
18092
|
+
tools: import_mini66.z.optional(import_mini66.z.union([import_mini66.z.string(), import_mini66.z.array(import_mini66.z.string())])),
|
|
18093
|
+
model: import_mini66.z.optional(import_mini66.z.string()),
|
|
18094
|
+
"disable-model-invocation": import_mini66.z.optional(import_mini66.z.boolean()),
|
|
18095
|
+
"user-invocable": import_mini66.z.optional(import_mini66.z.boolean()),
|
|
18096
|
+
"mcp-servers": import_mini66.z.optional(import_mini66.z.record(import_mini66.z.string(), import_mini66.z.unknown())),
|
|
18097
|
+
metadata: import_mini66.z.optional(import_mini66.z.record(import_mini66.z.string(), import_mini66.z.unknown()))
|
|
17127
18098
|
});
|
|
17128
18099
|
var toCopilotCliAgentFilePath = (relativeFilePath) => {
|
|
17129
18100
|
if (relativeFilePath.endsWith(".agent.md")) {
|
|
@@ -17148,7 +18119,7 @@ var CopilotcliSubagent = class _CopilotcliSubagent extends ToolSubagent {
|
|
|
17148
18119
|
const result = CopilotCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
17149
18120
|
if (!result.success) {
|
|
17150
18121
|
throw new Error(
|
|
17151
|
-
`Invalid frontmatter in ${(0,
|
|
18122
|
+
`Invalid frontmatter in ${(0, import_node_path116.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
17152
18123
|
);
|
|
17153
18124
|
}
|
|
17154
18125
|
}
|
|
@@ -17160,9 +18131,9 @@ var CopilotcliSubagent = class _CopilotcliSubagent extends ToolSubagent {
|
|
|
17160
18131
|
global = false
|
|
17161
18132
|
} = {}) {
|
|
17162
18133
|
if (global) {
|
|
17163
|
-
return { relativeDirPath: (0,
|
|
18134
|
+
return { relativeDirPath: (0, import_node_path116.join)(".copilot", "agents") };
|
|
17164
18135
|
}
|
|
17165
|
-
return { relativeDirPath: (0,
|
|
18136
|
+
return { relativeDirPath: (0, import_node_path116.join)(".github", "agents") };
|
|
17166
18137
|
}
|
|
17167
18138
|
getFrontmatter() {
|
|
17168
18139
|
return this.frontmatter;
|
|
@@ -17240,7 +18211,7 @@ var CopilotcliSubagent = class _CopilotcliSubagent extends ToolSubagent {
|
|
|
17240
18211
|
return {
|
|
17241
18212
|
success: false,
|
|
17242
18213
|
error: new Error(
|
|
17243
|
-
`Invalid frontmatter in ${(0,
|
|
18214
|
+
`Invalid frontmatter in ${(0, import_node_path116.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
17244
18215
|
)
|
|
17245
18216
|
};
|
|
17246
18217
|
}
|
|
@@ -17257,7 +18228,7 @@ var CopilotcliSubagent = class _CopilotcliSubagent extends ToolSubagent {
|
|
|
17257
18228
|
global = false
|
|
17258
18229
|
}) {
|
|
17259
18230
|
const paths = this.getSettablePaths({ global });
|
|
17260
|
-
const filePath = (0,
|
|
18231
|
+
const filePath = (0, import_node_path116.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
17261
18232
|
const fileContent = await readFileContent(filePath);
|
|
17262
18233
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
17263
18234
|
const result = CopilotCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -17293,11 +18264,11 @@ var CopilotcliSubagent = class _CopilotcliSubagent extends ToolSubagent {
|
|
|
17293
18264
|
};
|
|
17294
18265
|
|
|
17295
18266
|
// src/features/subagents/cursor-subagent.ts
|
|
17296
|
-
var
|
|
17297
|
-
var
|
|
17298
|
-
var CursorSubagentFrontmatterSchema =
|
|
17299
|
-
name:
|
|
17300
|
-
description:
|
|
18267
|
+
var import_node_path117 = require("path");
|
|
18268
|
+
var import_mini67 = require("zod/mini");
|
|
18269
|
+
var CursorSubagentFrontmatterSchema = import_mini67.z.looseObject({
|
|
18270
|
+
name: import_mini67.z.string(),
|
|
18271
|
+
description: import_mini67.z.optional(import_mini67.z.string())
|
|
17301
18272
|
});
|
|
17302
18273
|
var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
17303
18274
|
frontmatter;
|
|
@@ -17307,7 +18278,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
17307
18278
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
17308
18279
|
if (!result.success) {
|
|
17309
18280
|
throw new Error(
|
|
17310
|
-
`Invalid frontmatter in ${(0,
|
|
18281
|
+
`Invalid frontmatter in ${(0, import_node_path117.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
17311
18282
|
);
|
|
17312
18283
|
}
|
|
17313
18284
|
}
|
|
@@ -17319,7 +18290,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
17319
18290
|
}
|
|
17320
18291
|
static getSettablePaths(_options = {}) {
|
|
17321
18292
|
return {
|
|
17322
|
-
relativeDirPath: (0,
|
|
18293
|
+
relativeDirPath: (0, import_node_path117.join)(".cursor", "agents")
|
|
17323
18294
|
};
|
|
17324
18295
|
}
|
|
17325
18296
|
getFrontmatter() {
|
|
@@ -17386,7 +18357,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
17386
18357
|
return {
|
|
17387
18358
|
success: false,
|
|
17388
18359
|
error: new Error(
|
|
17389
|
-
`Invalid frontmatter in ${(0,
|
|
18360
|
+
`Invalid frontmatter in ${(0, import_node_path117.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
17390
18361
|
)
|
|
17391
18362
|
};
|
|
17392
18363
|
}
|
|
@@ -17404,7 +18375,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
17404
18375
|
global = false
|
|
17405
18376
|
}) {
|
|
17406
18377
|
const paths = this.getSettablePaths({ global });
|
|
17407
|
-
const filePath = (0,
|
|
18378
|
+
const filePath = (0, import_node_path117.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
17408
18379
|
const fileContent = await readFileContent(filePath);
|
|
17409
18380
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
17410
18381
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -17440,12 +18411,12 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
17440
18411
|
};
|
|
17441
18412
|
|
|
17442
18413
|
// src/features/subagents/deepagents-subagent.ts
|
|
17443
|
-
var
|
|
17444
|
-
var
|
|
17445
|
-
var DeepagentsSubagentFrontmatterSchema =
|
|
17446
|
-
name:
|
|
17447
|
-
description:
|
|
17448
|
-
model:
|
|
18414
|
+
var import_node_path118 = require("path");
|
|
18415
|
+
var import_mini68 = require("zod/mini");
|
|
18416
|
+
var DeepagentsSubagentFrontmatterSchema = import_mini68.z.looseObject({
|
|
18417
|
+
name: import_mini68.z.string(),
|
|
18418
|
+
description: import_mini68.z.optional(import_mini68.z.string()),
|
|
18419
|
+
model: import_mini68.z.optional(import_mini68.z.string())
|
|
17449
18420
|
});
|
|
17450
18421
|
var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
17451
18422
|
frontmatter;
|
|
@@ -17455,7 +18426,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
17455
18426
|
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
17456
18427
|
if (!result.success) {
|
|
17457
18428
|
throw new Error(
|
|
17458
|
-
`Invalid frontmatter in ${(0,
|
|
18429
|
+
`Invalid frontmatter in ${(0, import_node_path118.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
17459
18430
|
);
|
|
17460
18431
|
}
|
|
17461
18432
|
}
|
|
@@ -17465,7 +18436,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
17465
18436
|
}
|
|
17466
18437
|
static getSettablePaths(_options = {}) {
|
|
17467
18438
|
return {
|
|
17468
|
-
relativeDirPath: (0,
|
|
18439
|
+
relativeDirPath: (0, import_node_path118.join)(".deepagents", "agents")
|
|
17469
18440
|
};
|
|
17470
18441
|
}
|
|
17471
18442
|
getFrontmatter() {
|
|
@@ -17540,7 +18511,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
17540
18511
|
return {
|
|
17541
18512
|
success: false,
|
|
17542
18513
|
error: new Error(
|
|
17543
|
-
`Invalid frontmatter in ${(0,
|
|
18514
|
+
`Invalid frontmatter in ${(0, import_node_path118.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
17544
18515
|
)
|
|
17545
18516
|
};
|
|
17546
18517
|
}
|
|
@@ -17558,7 +18529,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
17558
18529
|
global = false
|
|
17559
18530
|
}) {
|
|
17560
18531
|
const paths = this.getSettablePaths({ global });
|
|
17561
|
-
const filePath = (0,
|
|
18532
|
+
const filePath = (0, import_node_path118.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
17562
18533
|
const fileContent = await readFileContent(filePath);
|
|
17563
18534
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
17564
18535
|
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -17593,11 +18564,11 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
17593
18564
|
};
|
|
17594
18565
|
|
|
17595
18566
|
// src/features/subagents/junie-subagent.ts
|
|
17596
|
-
var
|
|
17597
|
-
var
|
|
17598
|
-
var JunieSubagentFrontmatterSchema =
|
|
17599
|
-
name:
|
|
17600
|
-
description:
|
|
18567
|
+
var import_node_path119 = require("path");
|
|
18568
|
+
var import_mini69 = require("zod/mini");
|
|
18569
|
+
var JunieSubagentFrontmatterSchema = import_mini69.z.looseObject({
|
|
18570
|
+
name: import_mini69.z.optional(import_mini69.z.string()),
|
|
18571
|
+
description: import_mini69.z.string()
|
|
17601
18572
|
});
|
|
17602
18573
|
var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
17603
18574
|
frontmatter;
|
|
@@ -17607,7 +18578,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
17607
18578
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
17608
18579
|
if (!result.success) {
|
|
17609
18580
|
throw new Error(
|
|
17610
|
-
`Invalid frontmatter in ${(0,
|
|
18581
|
+
`Invalid frontmatter in ${(0, import_node_path119.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
17611
18582
|
);
|
|
17612
18583
|
}
|
|
17613
18584
|
}
|
|
@@ -17622,7 +18593,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
17622
18593
|
throw new Error("JunieSubagent does not support global mode.");
|
|
17623
18594
|
}
|
|
17624
18595
|
return {
|
|
17625
|
-
relativeDirPath: (0,
|
|
18596
|
+
relativeDirPath: (0, import_node_path119.join)(".junie", "agents")
|
|
17626
18597
|
};
|
|
17627
18598
|
}
|
|
17628
18599
|
getFrontmatter() {
|
|
@@ -17698,7 +18669,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
17698
18669
|
return {
|
|
17699
18670
|
success: false,
|
|
17700
18671
|
error: new Error(
|
|
17701
|
-
`Invalid frontmatter in ${(0,
|
|
18672
|
+
`Invalid frontmatter in ${(0, import_node_path119.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
17702
18673
|
)
|
|
17703
18674
|
};
|
|
17704
18675
|
}
|
|
@@ -17716,7 +18687,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
17716
18687
|
global = false
|
|
17717
18688
|
}) {
|
|
17718
18689
|
const paths = this.getSettablePaths({ global });
|
|
17719
|
-
const filePath = (0,
|
|
18690
|
+
const filePath = (0, import_node_path119.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
17720
18691
|
const fileContent = await readFileContent(filePath);
|
|
17721
18692
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
17722
18693
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -17751,15 +18722,15 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
17751
18722
|
};
|
|
17752
18723
|
|
|
17753
18724
|
// src/features/subagents/kilo-subagent.ts
|
|
17754
|
-
var
|
|
18725
|
+
var import_node_path121 = require("path");
|
|
17755
18726
|
|
|
17756
18727
|
// src/features/subagents/opencode-style-subagent.ts
|
|
17757
|
-
var
|
|
17758
|
-
var
|
|
17759
|
-
var OpenCodeStyleSubagentFrontmatterSchema =
|
|
17760
|
-
description:
|
|
17761
|
-
mode:
|
|
17762
|
-
name:
|
|
18728
|
+
var import_node_path120 = require("path");
|
|
18729
|
+
var import_mini70 = require("zod/mini");
|
|
18730
|
+
var OpenCodeStyleSubagentFrontmatterSchema = import_mini70.z.looseObject({
|
|
18731
|
+
description: import_mini70.z.optional(import_mini70.z.string()),
|
|
18732
|
+
mode: import_mini70.z._default(import_mini70.z.string(), "subagent"),
|
|
18733
|
+
name: import_mini70.z.optional(import_mini70.z.string())
|
|
17763
18734
|
});
|
|
17764
18735
|
var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
17765
18736
|
frontmatter;
|
|
@@ -17769,7 +18740,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
17769
18740
|
const result = OpenCodeStyleSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
17770
18741
|
if (!result.success) {
|
|
17771
18742
|
throw new Error(
|
|
17772
|
-
`Invalid frontmatter in ${(0,
|
|
18743
|
+
`Invalid frontmatter in ${(0, import_node_path120.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
17773
18744
|
);
|
|
17774
18745
|
}
|
|
17775
18746
|
}
|
|
@@ -17789,7 +18760,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
17789
18760
|
const { description, mode, name, ...toolSection } = this.frontmatter;
|
|
17790
18761
|
const rulesyncFrontmatter = {
|
|
17791
18762
|
targets: ["*"],
|
|
17792
|
-
name: name ?? (0,
|
|
18763
|
+
name: name ?? (0, import_node_path120.basename)(this.getRelativeFilePath(), ".md"),
|
|
17793
18764
|
description,
|
|
17794
18765
|
[this.getToolTarget()]: { mode, ...toolSection }
|
|
17795
18766
|
};
|
|
@@ -17811,7 +18782,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
17811
18782
|
return {
|
|
17812
18783
|
success: false,
|
|
17813
18784
|
error: new Error(
|
|
17814
|
-
`Invalid frontmatter in ${(0,
|
|
18785
|
+
`Invalid frontmatter in ${(0, import_node_path120.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
17815
18786
|
)
|
|
17816
18787
|
};
|
|
17817
18788
|
}
|
|
@@ -17827,7 +18798,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
17827
18798
|
global = false
|
|
17828
18799
|
} = {}) {
|
|
17829
18800
|
return {
|
|
17830
|
-
relativeDirPath: global ? (0,
|
|
18801
|
+
relativeDirPath: global ? (0, import_node_path121.join)(".config", "kilo", "agent") : (0, import_node_path121.join)(".kilo", "agent")
|
|
17831
18802
|
};
|
|
17832
18803
|
}
|
|
17833
18804
|
static fromRulesyncSubagent({
|
|
@@ -17871,7 +18842,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
17871
18842
|
global = false
|
|
17872
18843
|
}) {
|
|
17873
18844
|
const paths = this.getSettablePaths({ global });
|
|
17874
|
-
const filePath = (0,
|
|
18845
|
+
const filePath = (0, import_node_path121.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
17875
18846
|
const fileContent = await readFileContent(filePath);
|
|
17876
18847
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
17877
18848
|
const result = KiloSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -17907,23 +18878,23 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
17907
18878
|
};
|
|
17908
18879
|
|
|
17909
18880
|
// src/features/subagents/kiro-subagent.ts
|
|
17910
|
-
var
|
|
17911
|
-
var
|
|
17912
|
-
var KiroCliSubagentJsonSchema =
|
|
17913
|
-
name:
|
|
17914
|
-
description:
|
|
17915
|
-
prompt:
|
|
17916
|
-
tools:
|
|
17917
|
-
toolAliases:
|
|
17918
|
-
toolSettings:
|
|
17919
|
-
toolSchema:
|
|
17920
|
-
hooks:
|
|
17921
|
-
model:
|
|
17922
|
-
mcpServers:
|
|
17923
|
-
useLegacyMcpJson:
|
|
17924
|
-
resources:
|
|
17925
|
-
allowedTools:
|
|
17926
|
-
includeMcpJson:
|
|
18881
|
+
var import_node_path122 = require("path");
|
|
18882
|
+
var import_mini71 = require("zod/mini");
|
|
18883
|
+
var KiroCliSubagentJsonSchema = import_mini71.z.looseObject({
|
|
18884
|
+
name: import_mini71.z.string(),
|
|
18885
|
+
description: import_mini71.z.optional(import_mini71.z.nullable(import_mini71.z.string())),
|
|
18886
|
+
prompt: import_mini71.z.optional(import_mini71.z.nullable(import_mini71.z.string())),
|
|
18887
|
+
tools: import_mini71.z.optional(import_mini71.z.nullable(import_mini71.z.array(import_mini71.z.string()))),
|
|
18888
|
+
toolAliases: import_mini71.z.optional(import_mini71.z.nullable(import_mini71.z.record(import_mini71.z.string(), import_mini71.z.string()))),
|
|
18889
|
+
toolSettings: import_mini71.z.optional(import_mini71.z.nullable(import_mini71.z.unknown())),
|
|
18890
|
+
toolSchema: import_mini71.z.optional(import_mini71.z.nullable(import_mini71.z.unknown())),
|
|
18891
|
+
hooks: import_mini71.z.optional(import_mini71.z.nullable(import_mini71.z.record(import_mini71.z.string(), import_mini71.z.array(import_mini71.z.unknown())))),
|
|
18892
|
+
model: import_mini71.z.optional(import_mini71.z.nullable(import_mini71.z.string())),
|
|
18893
|
+
mcpServers: import_mini71.z.optional(import_mini71.z.nullable(import_mini71.z.record(import_mini71.z.string(), import_mini71.z.unknown()))),
|
|
18894
|
+
useLegacyMcpJson: import_mini71.z.optional(import_mini71.z.nullable(import_mini71.z.boolean())),
|
|
18895
|
+
resources: import_mini71.z.optional(import_mini71.z.nullable(import_mini71.z.array(import_mini71.z.string()))),
|
|
18896
|
+
allowedTools: import_mini71.z.optional(import_mini71.z.nullable(import_mini71.z.array(import_mini71.z.string()))),
|
|
18897
|
+
includeMcpJson: import_mini71.z.optional(import_mini71.z.nullable(import_mini71.z.boolean()))
|
|
17927
18898
|
});
|
|
17928
18899
|
var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
17929
18900
|
body;
|
|
@@ -17934,7 +18905,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
17934
18905
|
KiroCliSubagentJsonSchema.parse(parsed);
|
|
17935
18906
|
} catch (error) {
|
|
17936
18907
|
throw new Error(
|
|
17937
|
-
`Invalid JSON in ${(0,
|
|
18908
|
+
`Invalid JSON in ${(0, import_node_path122.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
17938
18909
|
{ cause: error }
|
|
17939
18910
|
);
|
|
17940
18911
|
}
|
|
@@ -17946,7 +18917,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
17946
18917
|
}
|
|
17947
18918
|
static getSettablePaths(_options = {}) {
|
|
17948
18919
|
return {
|
|
17949
|
-
relativeDirPath: (0,
|
|
18920
|
+
relativeDirPath: (0, import_node_path122.join)(".kiro", "agents")
|
|
17950
18921
|
};
|
|
17951
18922
|
}
|
|
17952
18923
|
getBody() {
|
|
@@ -17958,7 +18929,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
17958
18929
|
parsed = JSON.parse(this.body);
|
|
17959
18930
|
} catch (error) {
|
|
17960
18931
|
throw new Error(
|
|
17961
|
-
`Failed to parse JSON in ${(0,
|
|
18932
|
+
`Failed to parse JSON in ${(0, import_node_path122.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
17962
18933
|
{ cause: error }
|
|
17963
18934
|
);
|
|
17964
18935
|
}
|
|
@@ -18039,7 +19010,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
18039
19010
|
global = false
|
|
18040
19011
|
}) {
|
|
18041
19012
|
const paths = this.getSettablePaths({ global });
|
|
18042
|
-
const filePath = (0,
|
|
19013
|
+
const filePath = (0, import_node_path122.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
18043
19014
|
const fileContent = await readFileContent(filePath);
|
|
18044
19015
|
const subagent = new _KiroSubagent({
|
|
18045
19016
|
outputRoot,
|
|
@@ -18077,7 +19048,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
18077
19048
|
};
|
|
18078
19049
|
|
|
18079
19050
|
// src/features/subagents/opencode-subagent.ts
|
|
18080
|
-
var
|
|
19051
|
+
var import_node_path123 = require("path");
|
|
18081
19052
|
var OpenCodeSubagentFrontmatterSchema = OpenCodeStyleSubagentFrontmatterSchema;
|
|
18082
19053
|
var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
18083
19054
|
getToolTarget() {
|
|
@@ -18087,7 +19058,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
18087
19058
|
global = false
|
|
18088
19059
|
} = {}) {
|
|
18089
19060
|
return {
|
|
18090
|
-
relativeDirPath: global ? (0,
|
|
19061
|
+
relativeDirPath: global ? (0, import_node_path123.join)(".config", "opencode", "agent") : (0, import_node_path123.join)(".opencode", "agent")
|
|
18091
19062
|
};
|
|
18092
19063
|
}
|
|
18093
19064
|
static fromRulesyncSubagent({
|
|
@@ -18131,7 +19102,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
18131
19102
|
global = false
|
|
18132
19103
|
}) {
|
|
18133
19104
|
const paths = this.getSettablePaths({ global });
|
|
18134
|
-
const filePath = (0,
|
|
19105
|
+
const filePath = (0, import_node_path123.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
18135
19106
|
const fileContent = await readFileContent(filePath);
|
|
18136
19107
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
18137
19108
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -18167,7 +19138,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
18167
19138
|
};
|
|
18168
19139
|
|
|
18169
19140
|
// src/features/subagents/takt-subagent.ts
|
|
18170
|
-
var
|
|
19141
|
+
var import_node_path124 = require("path");
|
|
18171
19142
|
var DEFAULT_TAKT_SUBAGENT_DIR = "personas";
|
|
18172
19143
|
var TaktSubagent = class _TaktSubagent extends ToolSubagent {
|
|
18173
19144
|
body;
|
|
@@ -18179,7 +19150,7 @@ var TaktSubagent = class _TaktSubagent extends ToolSubagent {
|
|
|
18179
19150
|
}
|
|
18180
19151
|
static getSettablePaths(_options = {}) {
|
|
18181
19152
|
return {
|
|
18182
|
-
relativeDirPath: (0,
|
|
19153
|
+
relativeDirPath: (0, import_node_path124.join)(".takt", "facets", DEFAULT_TAKT_SUBAGENT_DIR)
|
|
18183
19154
|
};
|
|
18184
19155
|
}
|
|
18185
19156
|
getBody() {
|
|
@@ -18241,7 +19212,7 @@ var TaktSubagent = class _TaktSubagent extends ToolSubagent {
|
|
|
18241
19212
|
global = false
|
|
18242
19213
|
}) {
|
|
18243
19214
|
const paths = this.getSettablePaths({ global });
|
|
18244
|
-
const filePath = (0,
|
|
19215
|
+
const filePath = (0, import_node_path124.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
18245
19216
|
const fileContent = await readFileContent(filePath);
|
|
18246
19217
|
const { body } = parseFrontmatter(fileContent, filePath);
|
|
18247
19218
|
return new _TaktSubagent({
|
|
@@ -18289,7 +19260,7 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
18289
19260
|
"rovodev",
|
|
18290
19261
|
"takt"
|
|
18291
19262
|
];
|
|
18292
|
-
var SubagentsProcessorToolTargetSchema =
|
|
19263
|
+
var SubagentsProcessorToolTargetSchema = import_mini72.z.enum(subagentsProcessorToolTargetTuple);
|
|
18293
19264
|
var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
18294
19265
|
[
|
|
18295
19266
|
"agentsmd",
|
|
@@ -18498,7 +19469,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
18498
19469
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
18499
19470
|
*/
|
|
18500
19471
|
async loadRulesyncFiles() {
|
|
18501
|
-
const subagentsDir = (0,
|
|
19472
|
+
const subagentsDir = (0, import_node_path125.join)(this.inputRoot, RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
18502
19473
|
const dirExists = await directoryExists(subagentsDir);
|
|
18503
19474
|
if (!dirExists) {
|
|
18504
19475
|
this.logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -18513,7 +19484,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
18513
19484
|
this.logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
18514
19485
|
const rulesyncSubagents = [];
|
|
18515
19486
|
for (const mdFile of mdFiles) {
|
|
18516
|
-
const filepath = (0,
|
|
19487
|
+
const filepath = (0, import_node_path125.join)(subagentsDir, mdFile);
|
|
18517
19488
|
try {
|
|
18518
19489
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
18519
19490
|
outputRoot: this.inputRoot,
|
|
@@ -18544,14 +19515,14 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
18544
19515
|
const factory = this.getFactory(this.toolTarget);
|
|
18545
19516
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
18546
19517
|
const subagentFilePaths = await findFilesByGlobs(
|
|
18547
|
-
(0,
|
|
19518
|
+
(0, import_node_path125.join)(this.outputRoot, paths.relativeDirPath, factory.meta.filePattern)
|
|
18548
19519
|
);
|
|
18549
19520
|
if (forDeletion) {
|
|
18550
19521
|
const toolSubagents2 = subagentFilePaths.map(
|
|
18551
19522
|
(path4) => factory.class.forDeletion({
|
|
18552
19523
|
outputRoot: this.outputRoot,
|
|
18553
19524
|
relativeDirPath: paths.relativeDirPath,
|
|
18554
|
-
relativeFilePath: (0,
|
|
19525
|
+
relativeFilePath: (0, import_node_path125.basename)(path4),
|
|
18555
19526
|
global: this.global
|
|
18556
19527
|
})
|
|
18557
19528
|
).filter((subagent) => subagent.isDeletable());
|
|
@@ -18564,7 +19535,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
18564
19535
|
subagentFilePaths.map(
|
|
18565
19536
|
(path4) => factory.class.fromFile({
|
|
18566
19537
|
outputRoot: this.outputRoot,
|
|
18567
|
-
relativeFilePath: (0,
|
|
19538
|
+
relativeFilePath: (0, import_node_path125.basename)(path4),
|
|
18568
19539
|
global: this.global
|
|
18569
19540
|
})
|
|
18570
19541
|
)
|
|
@@ -18611,55 +19582,55 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
18611
19582
|
};
|
|
18612
19583
|
|
|
18613
19584
|
// src/features/rules/agentsmd-rule.ts
|
|
18614
|
-
var
|
|
19585
|
+
var import_node_path128 = require("path");
|
|
18615
19586
|
|
|
18616
19587
|
// src/features/rules/tool-rule.ts
|
|
18617
|
-
var
|
|
19588
|
+
var import_node_path127 = require("path");
|
|
18618
19589
|
|
|
18619
19590
|
// src/features/rules/rulesync-rule.ts
|
|
18620
|
-
var
|
|
18621
|
-
var
|
|
18622
|
-
var RulesyncRuleFrontmatterSchema =
|
|
18623
|
-
root:
|
|
18624
|
-
localRoot:
|
|
18625
|
-
targets:
|
|
18626
|
-
description:
|
|
18627
|
-
globs:
|
|
18628
|
-
agentsmd:
|
|
18629
|
-
|
|
19591
|
+
var import_node_path126 = require("path");
|
|
19592
|
+
var import_mini73 = require("zod/mini");
|
|
19593
|
+
var RulesyncRuleFrontmatterSchema = import_mini73.z.object({
|
|
19594
|
+
root: import_mini73.z.optional(import_mini73.z.boolean()),
|
|
19595
|
+
localRoot: import_mini73.z.optional(import_mini73.z.boolean()),
|
|
19596
|
+
targets: import_mini73.z._default(RulesyncTargetsSchema, ["*"]),
|
|
19597
|
+
description: import_mini73.z.optional(import_mini73.z.string()),
|
|
19598
|
+
globs: import_mini73.z.optional(import_mini73.z.array(import_mini73.z.string())),
|
|
19599
|
+
agentsmd: import_mini73.z.optional(
|
|
19600
|
+
import_mini73.z.looseObject({
|
|
18630
19601
|
// @example "path/to/subproject"
|
|
18631
|
-
subprojectPath:
|
|
19602
|
+
subprojectPath: import_mini73.z.optional(import_mini73.z.string())
|
|
18632
19603
|
})
|
|
18633
19604
|
),
|
|
18634
|
-
claudecode:
|
|
18635
|
-
|
|
19605
|
+
claudecode: import_mini73.z.optional(
|
|
19606
|
+
import_mini73.z.looseObject({
|
|
18636
19607
|
// Glob patterns for conditional rules (takes precedence over globs)
|
|
18637
19608
|
// @example ["src/**/*.ts", "tests/**/*.test.ts"]
|
|
18638
|
-
paths:
|
|
19609
|
+
paths: import_mini73.z.optional(import_mini73.z.array(import_mini73.z.string()))
|
|
18639
19610
|
})
|
|
18640
19611
|
),
|
|
18641
|
-
cursor:
|
|
18642
|
-
|
|
18643
|
-
alwaysApply:
|
|
18644
|
-
description:
|
|
18645
|
-
globs:
|
|
19612
|
+
cursor: import_mini73.z.optional(
|
|
19613
|
+
import_mini73.z.looseObject({
|
|
19614
|
+
alwaysApply: import_mini73.z.optional(import_mini73.z.boolean()),
|
|
19615
|
+
description: import_mini73.z.optional(import_mini73.z.string()),
|
|
19616
|
+
globs: import_mini73.z.optional(import_mini73.z.array(import_mini73.z.string()))
|
|
18646
19617
|
})
|
|
18647
19618
|
),
|
|
18648
|
-
copilot:
|
|
18649
|
-
|
|
18650
|
-
excludeAgent:
|
|
19619
|
+
copilot: import_mini73.z.optional(
|
|
19620
|
+
import_mini73.z.looseObject({
|
|
19621
|
+
excludeAgent: import_mini73.z.optional(import_mini73.z.union([import_mini73.z.literal("code-review"), import_mini73.z.literal("coding-agent")]))
|
|
18651
19622
|
})
|
|
18652
19623
|
),
|
|
18653
|
-
antigravity:
|
|
18654
|
-
|
|
18655
|
-
trigger:
|
|
18656
|
-
globs:
|
|
19624
|
+
antigravity: import_mini73.z.optional(
|
|
19625
|
+
import_mini73.z.looseObject({
|
|
19626
|
+
trigger: import_mini73.z.optional(import_mini73.z.string()),
|
|
19627
|
+
globs: import_mini73.z.optional(import_mini73.z.array(import_mini73.z.string()))
|
|
18657
19628
|
})
|
|
18658
19629
|
),
|
|
18659
|
-
takt:
|
|
18660
|
-
|
|
19630
|
+
takt: import_mini73.z.optional(
|
|
19631
|
+
import_mini73.z.looseObject({
|
|
18661
19632
|
// Rename the emitted file stem (e.g. "coder.md" → "{name}.md").
|
|
18662
|
-
name:
|
|
19633
|
+
name: import_mini73.z.optional(import_mini73.z.string())
|
|
18663
19634
|
})
|
|
18664
19635
|
)
|
|
18665
19636
|
});
|
|
@@ -18670,7 +19641,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
18670
19641
|
const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
18671
19642
|
if (!parseResult.success && rest.validate !== false) {
|
|
18672
19643
|
throw new Error(
|
|
18673
|
-
`Invalid frontmatter in ${(0,
|
|
19644
|
+
`Invalid frontmatter in ${(0, import_node_path126.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
18674
19645
|
);
|
|
18675
19646
|
}
|
|
18676
19647
|
const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
|
|
@@ -18705,7 +19676,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
18705
19676
|
return {
|
|
18706
19677
|
success: false,
|
|
18707
19678
|
error: new Error(
|
|
18708
|
-
`Invalid frontmatter in ${(0,
|
|
19679
|
+
`Invalid frontmatter in ${(0, import_node_path126.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
18709
19680
|
)
|
|
18710
19681
|
};
|
|
18711
19682
|
}
|
|
@@ -18715,7 +19686,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
18715
19686
|
relativeFilePath,
|
|
18716
19687
|
validate = true
|
|
18717
19688
|
}) {
|
|
18718
|
-
const filePath = (0,
|
|
19689
|
+
const filePath = (0, import_node_path126.join)(
|
|
18719
19690
|
outputRoot,
|
|
18720
19691
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
18721
19692
|
relativeFilePath
|
|
@@ -18814,7 +19785,7 @@ var ToolRule = class extends ToolFile {
|
|
|
18814
19785
|
rulesyncRule,
|
|
18815
19786
|
validate = true,
|
|
18816
19787
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
18817
|
-
nonRootPath = { relativeDirPath: (0,
|
|
19788
|
+
nonRootPath = { relativeDirPath: (0, import_node_path127.join)(".agents", "memories") }
|
|
18818
19789
|
}) {
|
|
18819
19790
|
const params = this.buildToolRuleParamsDefault({
|
|
18820
19791
|
outputRoot,
|
|
@@ -18825,7 +19796,7 @@ var ToolRule = class extends ToolFile {
|
|
|
18825
19796
|
});
|
|
18826
19797
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
18827
19798
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
18828
|
-
params.relativeDirPath = (0,
|
|
19799
|
+
params.relativeDirPath = (0, import_node_path127.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
18829
19800
|
params.relativeFilePath = "AGENTS.md";
|
|
18830
19801
|
}
|
|
18831
19802
|
return params;
|
|
@@ -18874,7 +19845,7 @@ var ToolRule = class extends ToolFile {
|
|
|
18874
19845
|
}
|
|
18875
19846
|
};
|
|
18876
19847
|
function buildToolPath(toolDir, subDir, excludeToolDir) {
|
|
18877
|
-
return excludeToolDir ? subDir : (0,
|
|
19848
|
+
return excludeToolDir ? subDir : (0, import_node_path127.join)(toolDir, subDir);
|
|
18878
19849
|
}
|
|
18879
19850
|
|
|
18880
19851
|
// src/features/rules/agentsmd-rule.ts
|
|
@@ -18903,8 +19874,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
18903
19874
|
validate = true
|
|
18904
19875
|
}) {
|
|
18905
19876
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
18906
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
18907
|
-
const fileContent = await readFileContent((0,
|
|
19877
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path128.join)(".agents", "memories", relativeFilePath);
|
|
19878
|
+
const fileContent = await readFileContent((0, import_node_path128.join)(outputRoot, relativePath));
|
|
18908
19879
|
return new _AgentsMdRule({
|
|
18909
19880
|
outputRoot,
|
|
18910
19881
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -18959,21 +19930,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
18959
19930
|
};
|
|
18960
19931
|
|
|
18961
19932
|
// src/features/rules/antigravity-rule.ts
|
|
18962
|
-
var
|
|
18963
|
-
var
|
|
18964
|
-
var AntigravityRuleFrontmatterSchema =
|
|
18965
|
-
trigger:
|
|
18966
|
-
|
|
18967
|
-
|
|
18968
|
-
|
|
18969
|
-
|
|
18970
|
-
|
|
18971
|
-
|
|
19933
|
+
var import_node_path129 = require("path");
|
|
19934
|
+
var import_mini74 = require("zod/mini");
|
|
19935
|
+
var AntigravityRuleFrontmatterSchema = import_mini74.z.looseObject({
|
|
19936
|
+
trigger: import_mini74.z.optional(
|
|
19937
|
+
import_mini74.z.union([
|
|
19938
|
+
import_mini74.z.literal("always_on"),
|
|
19939
|
+
import_mini74.z.literal("glob"),
|
|
19940
|
+
import_mini74.z.literal("manual"),
|
|
19941
|
+
import_mini74.z.literal("model_decision"),
|
|
19942
|
+
import_mini74.z.string()
|
|
18972
19943
|
// accepts any string for forward compatibility
|
|
18973
19944
|
])
|
|
18974
19945
|
),
|
|
18975
|
-
globs:
|
|
18976
|
-
description:
|
|
19946
|
+
globs: import_mini74.z.optional(import_mini74.z.string()),
|
|
19947
|
+
description: import_mini74.z.optional(import_mini74.z.string())
|
|
18977
19948
|
});
|
|
18978
19949
|
function parseGlobsString(globs) {
|
|
18979
19950
|
if (!globs) {
|
|
@@ -19118,7 +20089,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
19118
20089
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
19119
20090
|
if (!result.success) {
|
|
19120
20091
|
throw new Error(
|
|
19121
|
-
`Invalid frontmatter in ${(0,
|
|
20092
|
+
`Invalid frontmatter in ${(0, import_node_path129.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
19122
20093
|
);
|
|
19123
20094
|
}
|
|
19124
20095
|
}
|
|
@@ -19142,7 +20113,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
19142
20113
|
relativeFilePath,
|
|
19143
20114
|
validate = true
|
|
19144
20115
|
}) {
|
|
19145
|
-
const filePath = (0,
|
|
20116
|
+
const filePath = (0, import_node_path129.join)(
|
|
19146
20117
|
outputRoot,
|
|
19147
20118
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
19148
20119
|
relativeFilePath
|
|
@@ -19282,7 +20253,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
19282
20253
|
};
|
|
19283
20254
|
|
|
19284
20255
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
19285
|
-
var
|
|
20256
|
+
var import_node_path130 = require("path");
|
|
19286
20257
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
19287
20258
|
toRulesyncRule() {
|
|
19288
20259
|
const rulesyncFrontmatter = {
|
|
@@ -19342,8 +20313,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
19342
20313
|
}) {
|
|
19343
20314
|
const settablePaths = this.getSettablePaths();
|
|
19344
20315
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
19345
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0,
|
|
19346
|
-
const fileContent = await readFileContent((0,
|
|
20316
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path130.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
20317
|
+
const fileContent = await readFileContent((0, import_node_path130.join)(outputRoot, relativePath));
|
|
19347
20318
|
return new _AugmentcodeLegacyRule({
|
|
19348
20319
|
outputRoot,
|
|
19349
20320
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -19372,7 +20343,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
19372
20343
|
};
|
|
19373
20344
|
|
|
19374
20345
|
// src/features/rules/augmentcode-rule.ts
|
|
19375
|
-
var
|
|
20346
|
+
var import_node_path131 = require("path");
|
|
19376
20347
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
19377
20348
|
toRulesyncRule() {
|
|
19378
20349
|
return this.toRulesyncRuleDefault();
|
|
@@ -19403,7 +20374,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
19403
20374
|
relativeFilePath,
|
|
19404
20375
|
validate = true
|
|
19405
20376
|
}) {
|
|
19406
|
-
const filePath = (0,
|
|
20377
|
+
const filePath = (0, import_node_path131.join)(
|
|
19407
20378
|
outputRoot,
|
|
19408
20379
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
19409
20380
|
relativeFilePath
|
|
@@ -19443,7 +20414,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
19443
20414
|
};
|
|
19444
20415
|
|
|
19445
20416
|
// src/features/rules/claudecode-legacy-rule.ts
|
|
19446
|
-
var
|
|
20417
|
+
var import_node_path132 = require("path");
|
|
19447
20418
|
var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
19448
20419
|
static getSettablePaths({
|
|
19449
20420
|
global,
|
|
@@ -19485,7 +20456,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
19485
20456
|
if (isRoot) {
|
|
19486
20457
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
19487
20458
|
const fileContent2 = await readFileContent(
|
|
19488
|
-
(0,
|
|
20459
|
+
(0, import_node_path132.join)(outputRoot, rootDirPath, paths.root.relativeFilePath)
|
|
19489
20460
|
);
|
|
19490
20461
|
return new _ClaudecodeLegacyRule({
|
|
19491
20462
|
outputRoot,
|
|
@@ -19499,8 +20470,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
19499
20470
|
if (!paths.nonRoot) {
|
|
19500
20471
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
19501
20472
|
}
|
|
19502
|
-
const relativePath = (0,
|
|
19503
|
-
const fileContent = await readFileContent((0,
|
|
20473
|
+
const relativePath = (0, import_node_path132.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
20474
|
+
const fileContent = await readFileContent((0, import_node_path132.join)(outputRoot, relativePath));
|
|
19504
20475
|
return new _ClaudecodeLegacyRule({
|
|
19505
20476
|
outputRoot,
|
|
19506
20477
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -19559,10 +20530,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
19559
20530
|
};
|
|
19560
20531
|
|
|
19561
20532
|
// src/features/rules/claudecode-rule.ts
|
|
19562
|
-
var
|
|
19563
|
-
var
|
|
19564
|
-
var ClaudecodeRuleFrontmatterSchema =
|
|
19565
|
-
paths:
|
|
20533
|
+
var import_node_path133 = require("path");
|
|
20534
|
+
var import_mini75 = require("zod/mini");
|
|
20535
|
+
var ClaudecodeRuleFrontmatterSchema = import_mini75.z.object({
|
|
20536
|
+
paths: import_mini75.z.optional(import_mini75.z.array(import_mini75.z.string()))
|
|
19566
20537
|
});
|
|
19567
20538
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
19568
20539
|
frontmatter;
|
|
@@ -19600,7 +20571,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
19600
20571
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
19601
20572
|
if (!result.success) {
|
|
19602
20573
|
throw new Error(
|
|
19603
|
-
`Invalid frontmatter in ${(0,
|
|
20574
|
+
`Invalid frontmatter in ${(0, import_node_path133.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
19604
20575
|
);
|
|
19605
20576
|
}
|
|
19606
20577
|
}
|
|
@@ -19630,7 +20601,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
19630
20601
|
if (isRoot) {
|
|
19631
20602
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
19632
20603
|
const fileContent2 = await readFileContent(
|
|
19633
|
-
(0,
|
|
20604
|
+
(0, import_node_path133.join)(outputRoot, rootDirPath, paths.root.relativeFilePath)
|
|
19634
20605
|
);
|
|
19635
20606
|
return new _ClaudecodeRule({
|
|
19636
20607
|
outputRoot,
|
|
@@ -19645,8 +20616,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
19645
20616
|
if (!paths.nonRoot) {
|
|
19646
20617
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
19647
20618
|
}
|
|
19648
|
-
const relativePath = (0,
|
|
19649
|
-
const filePath = (0,
|
|
20619
|
+
const relativePath = (0, import_node_path133.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
20620
|
+
const filePath = (0, import_node_path133.join)(outputRoot, relativePath);
|
|
19650
20621
|
const fileContent = await readFileContent(filePath);
|
|
19651
20622
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
19652
20623
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -19757,7 +20728,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
19757
20728
|
return {
|
|
19758
20729
|
success: false,
|
|
19759
20730
|
error: new Error(
|
|
19760
|
-
`Invalid frontmatter in ${(0,
|
|
20731
|
+
`Invalid frontmatter in ${(0, import_node_path133.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
19761
20732
|
)
|
|
19762
20733
|
};
|
|
19763
20734
|
}
|
|
@@ -19777,10 +20748,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
19777
20748
|
};
|
|
19778
20749
|
|
|
19779
20750
|
// src/features/rules/cline-rule.ts
|
|
19780
|
-
var
|
|
19781
|
-
var
|
|
19782
|
-
var ClineRuleFrontmatterSchema =
|
|
19783
|
-
description:
|
|
20751
|
+
var import_node_path134 = require("path");
|
|
20752
|
+
var import_mini76 = require("zod/mini");
|
|
20753
|
+
var ClineRuleFrontmatterSchema = import_mini76.z.object({
|
|
20754
|
+
description: import_mini76.z.string()
|
|
19784
20755
|
});
|
|
19785
20756
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
19786
20757
|
static getSettablePaths(_options = {}) {
|
|
@@ -19823,7 +20794,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
19823
20794
|
validate = true
|
|
19824
20795
|
}) {
|
|
19825
20796
|
const fileContent = await readFileContent(
|
|
19826
|
-
(0,
|
|
20797
|
+
(0, import_node_path134.join)(outputRoot, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
19827
20798
|
);
|
|
19828
20799
|
return new _ClineRule({
|
|
19829
20800
|
outputRoot,
|
|
@@ -19849,7 +20820,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
19849
20820
|
};
|
|
19850
20821
|
|
|
19851
20822
|
// src/features/rules/codexcli-rule.ts
|
|
19852
|
-
var
|
|
20823
|
+
var import_node_path135 = require("path");
|
|
19853
20824
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
19854
20825
|
static getSettablePaths({
|
|
19855
20826
|
global,
|
|
@@ -19884,7 +20855,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
19884
20855
|
if (isRoot) {
|
|
19885
20856
|
const relativePath2 = paths.root.relativeFilePath;
|
|
19886
20857
|
const fileContent2 = await readFileContent(
|
|
19887
|
-
(0,
|
|
20858
|
+
(0, import_node_path135.join)(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
19888
20859
|
);
|
|
19889
20860
|
return new _CodexcliRule({
|
|
19890
20861
|
outputRoot,
|
|
@@ -19898,8 +20869,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
19898
20869
|
if (!paths.nonRoot) {
|
|
19899
20870
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
19900
20871
|
}
|
|
19901
|
-
const relativePath = (0,
|
|
19902
|
-
const fileContent = await readFileContent((0,
|
|
20872
|
+
const relativePath = (0, import_node_path135.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
20873
|
+
const fileContent = await readFileContent((0, import_node_path135.join)(outputRoot, relativePath));
|
|
19903
20874
|
return new _CodexcliRule({
|
|
19904
20875
|
outputRoot,
|
|
19905
20876
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -19958,12 +20929,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
19958
20929
|
};
|
|
19959
20930
|
|
|
19960
20931
|
// src/features/rules/copilot-rule.ts
|
|
19961
|
-
var
|
|
19962
|
-
var
|
|
19963
|
-
var CopilotRuleFrontmatterSchema =
|
|
19964
|
-
description:
|
|
19965
|
-
applyTo:
|
|
19966
|
-
excludeAgent:
|
|
20932
|
+
var import_node_path136 = require("path");
|
|
20933
|
+
var import_mini77 = require("zod/mini");
|
|
20934
|
+
var CopilotRuleFrontmatterSchema = import_mini77.z.object({
|
|
20935
|
+
description: import_mini77.z.optional(import_mini77.z.string()),
|
|
20936
|
+
applyTo: import_mini77.z.optional(import_mini77.z.string()),
|
|
20937
|
+
excludeAgent: import_mini77.z.optional(import_mini77.z.union([import_mini77.z.literal("code-review"), import_mini77.z.literal("coding-agent")]))
|
|
19967
20938
|
});
|
|
19968
20939
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
19969
20940
|
frontmatter;
|
|
@@ -19995,7 +20966,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
19995
20966
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
19996
20967
|
if (!result.success) {
|
|
19997
20968
|
throw new Error(
|
|
19998
|
-
`Invalid frontmatter in ${(0,
|
|
20969
|
+
`Invalid frontmatter in ${(0, import_node_path136.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
19999
20970
|
);
|
|
20000
20971
|
}
|
|
20001
20972
|
}
|
|
@@ -20082,11 +21053,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
20082
21053
|
global = false
|
|
20083
21054
|
}) {
|
|
20084
21055
|
const paths = this.getSettablePaths({ global });
|
|
20085
|
-
const isRoot = relativeDirPath ? (0,
|
|
21056
|
+
const isRoot = relativeDirPath ? (0, import_node_path136.join)(relativeDirPath, relativeFilePath) === (0, import_node_path136.join)(paths.root.relativeDirPath, paths.root.relativeFilePath) : relativeFilePath === paths.root.relativeFilePath;
|
|
20086
21057
|
const resolvedRelativeDirPath = relativeDirPath ?? (isRoot ? paths.root.relativeDirPath : paths.nonRoot?.relativeDirPath ?? paths.root.relativeDirPath);
|
|
20087
21058
|
if (isRoot) {
|
|
20088
|
-
const relativePath2 = (0,
|
|
20089
|
-
const filePath2 = (0,
|
|
21059
|
+
const relativePath2 = (0, import_node_path136.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
21060
|
+
const filePath2 = (0, import_node_path136.join)(outputRoot, relativePath2);
|
|
20090
21061
|
const fileContent2 = await readFileContent(filePath2);
|
|
20091
21062
|
return new _CopilotRule({
|
|
20092
21063
|
outputRoot,
|
|
@@ -20101,8 +21072,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
20101
21072
|
if (!paths.nonRoot) {
|
|
20102
21073
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
20103
21074
|
}
|
|
20104
|
-
const relativePath = (0,
|
|
20105
|
-
const filePath = (0,
|
|
21075
|
+
const relativePath = (0, import_node_path136.join)(resolvedRelativeDirPath, relativeFilePath);
|
|
21076
|
+
const filePath = (0, import_node_path136.join)(outputRoot, relativePath);
|
|
20106
21077
|
const fileContent = await readFileContent(filePath);
|
|
20107
21078
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
20108
21079
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -20126,7 +21097,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
20126
21097
|
global = false
|
|
20127
21098
|
}) {
|
|
20128
21099
|
const paths = this.getSettablePaths({ global });
|
|
20129
|
-
const isRoot = (0,
|
|
21100
|
+
const isRoot = (0, import_node_path136.join)(relativeDirPath, relativeFilePath) === (0, import_node_path136.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
20130
21101
|
return new _CopilotRule({
|
|
20131
21102
|
outputRoot,
|
|
20132
21103
|
relativeDirPath,
|
|
@@ -20148,7 +21119,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
20148
21119
|
return {
|
|
20149
21120
|
success: false,
|
|
20150
21121
|
error: new Error(
|
|
20151
|
-
`Invalid frontmatter in ${(0,
|
|
21122
|
+
`Invalid frontmatter in ${(0, import_node_path136.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
20152
21123
|
)
|
|
20153
21124
|
};
|
|
20154
21125
|
}
|
|
@@ -20204,12 +21175,12 @@ var CopilotcliRule = class _CopilotcliRule extends CopilotRule {
|
|
|
20204
21175
|
};
|
|
20205
21176
|
|
|
20206
21177
|
// src/features/rules/cursor-rule.ts
|
|
20207
|
-
var
|
|
20208
|
-
var
|
|
20209
|
-
var CursorRuleFrontmatterSchema =
|
|
20210
|
-
description:
|
|
20211
|
-
globs:
|
|
20212
|
-
alwaysApply:
|
|
21178
|
+
var import_node_path137 = require("path");
|
|
21179
|
+
var import_mini78 = require("zod/mini");
|
|
21180
|
+
var CursorRuleFrontmatterSchema = import_mini78.z.object({
|
|
21181
|
+
description: import_mini78.z.optional(import_mini78.z.string()),
|
|
21182
|
+
globs: import_mini78.z.optional(import_mini78.z.string()),
|
|
21183
|
+
alwaysApply: import_mini78.z.optional(import_mini78.z.boolean())
|
|
20213
21184
|
});
|
|
20214
21185
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
20215
21186
|
frontmatter;
|
|
@@ -20226,7 +21197,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
20226
21197
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
20227
21198
|
if (!result.success) {
|
|
20228
21199
|
throw new Error(
|
|
20229
|
-
`Invalid frontmatter in ${(0,
|
|
21200
|
+
`Invalid frontmatter in ${(0, import_node_path137.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
20230
21201
|
);
|
|
20231
21202
|
}
|
|
20232
21203
|
}
|
|
@@ -20342,7 +21313,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
20342
21313
|
relativeFilePath,
|
|
20343
21314
|
validate = true
|
|
20344
21315
|
}) {
|
|
20345
|
-
const filePath = (0,
|
|
21316
|
+
const filePath = (0, import_node_path137.join)(
|
|
20346
21317
|
outputRoot,
|
|
20347
21318
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
20348
21319
|
relativeFilePath
|
|
@@ -20352,7 +21323,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
20352
21323
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
20353
21324
|
if (!result.success) {
|
|
20354
21325
|
throw new Error(
|
|
20355
|
-
`Invalid frontmatter in ${(0,
|
|
21326
|
+
`Invalid frontmatter in ${(0, import_node_path137.join)(outputRoot, relativeFilePath)}: ${formatError(result.error)}`
|
|
20356
21327
|
);
|
|
20357
21328
|
}
|
|
20358
21329
|
return new _CursorRule({
|
|
@@ -20389,7 +21360,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
20389
21360
|
return {
|
|
20390
21361
|
success: false,
|
|
20391
21362
|
error: new Error(
|
|
20392
|
-
`Invalid frontmatter in ${(0,
|
|
21363
|
+
`Invalid frontmatter in ${(0, import_node_path137.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
20393
21364
|
)
|
|
20394
21365
|
};
|
|
20395
21366
|
}
|
|
@@ -20409,7 +21380,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
20409
21380
|
};
|
|
20410
21381
|
|
|
20411
21382
|
// src/features/rules/deepagents-rule.ts
|
|
20412
|
-
var
|
|
21383
|
+
var import_node_path138 = require("path");
|
|
20413
21384
|
var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
20414
21385
|
constructor({ fileContent, root, ...rest }) {
|
|
20415
21386
|
super({
|
|
@@ -20436,8 +21407,8 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
20436
21407
|
}) {
|
|
20437
21408
|
const settablePaths = this.getSettablePaths();
|
|
20438
21409
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
20439
|
-
const relativePath = isRoot ? (0,
|
|
20440
|
-
const fileContent = await readFileContent((0,
|
|
21410
|
+
const relativePath = isRoot ? (0, import_node_path138.join)(".deepagents", "AGENTS.md") : (0, import_node_path138.join)(".deepagents", "memories", relativeFilePath);
|
|
21411
|
+
const fileContent = await readFileContent((0, import_node_path138.join)(outputRoot, relativePath));
|
|
20441
21412
|
return new _DeepagentsRule({
|
|
20442
21413
|
outputRoot,
|
|
20443
21414
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -20492,7 +21463,7 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
20492
21463
|
};
|
|
20493
21464
|
|
|
20494
21465
|
// src/features/rules/factorydroid-rule.ts
|
|
20495
|
-
var
|
|
21466
|
+
var import_node_path139 = require("path");
|
|
20496
21467
|
var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
20497
21468
|
constructor({ fileContent, root, ...rest }) {
|
|
20498
21469
|
super({
|
|
@@ -20532,8 +21503,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
20532
21503
|
const paths = this.getSettablePaths({ global });
|
|
20533
21504
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
20534
21505
|
if (isRoot) {
|
|
20535
|
-
const relativePath2 = (0,
|
|
20536
|
-
const fileContent2 = await readFileContent((0,
|
|
21506
|
+
const relativePath2 = (0, import_node_path139.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
21507
|
+
const fileContent2 = await readFileContent((0, import_node_path139.join)(outputRoot, relativePath2));
|
|
20537
21508
|
return new _FactorydroidRule({
|
|
20538
21509
|
outputRoot,
|
|
20539
21510
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -20546,8 +21517,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
20546
21517
|
if (!paths.nonRoot) {
|
|
20547
21518
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
20548
21519
|
}
|
|
20549
|
-
const relativePath = (0,
|
|
20550
|
-
const fileContent = await readFileContent((0,
|
|
21520
|
+
const relativePath = (0, import_node_path139.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
21521
|
+
const fileContent = await readFileContent((0, import_node_path139.join)(outputRoot, relativePath));
|
|
20551
21522
|
return new _FactorydroidRule({
|
|
20552
21523
|
outputRoot,
|
|
20553
21524
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -20606,7 +21577,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
20606
21577
|
};
|
|
20607
21578
|
|
|
20608
21579
|
// src/features/rules/geminicli-rule.ts
|
|
20609
|
-
var
|
|
21580
|
+
var import_node_path140 = require("path");
|
|
20610
21581
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
20611
21582
|
static getSettablePaths({
|
|
20612
21583
|
global,
|
|
@@ -20641,7 +21612,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
20641
21612
|
if (isRoot) {
|
|
20642
21613
|
const relativePath2 = paths.root.relativeFilePath;
|
|
20643
21614
|
const fileContent2 = await readFileContent(
|
|
20644
|
-
(0,
|
|
21615
|
+
(0, import_node_path140.join)(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
20645
21616
|
);
|
|
20646
21617
|
return new _GeminiCliRule({
|
|
20647
21618
|
outputRoot,
|
|
@@ -20655,8 +21626,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
20655
21626
|
if (!paths.nonRoot) {
|
|
20656
21627
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
20657
21628
|
}
|
|
20658
|
-
const relativePath = (0,
|
|
20659
|
-
const fileContent = await readFileContent((0,
|
|
21629
|
+
const relativePath = (0, import_node_path140.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
21630
|
+
const fileContent = await readFileContent((0, import_node_path140.join)(outputRoot, relativePath));
|
|
20660
21631
|
return new _GeminiCliRule({
|
|
20661
21632
|
outputRoot,
|
|
20662
21633
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -20715,7 +21686,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
20715
21686
|
};
|
|
20716
21687
|
|
|
20717
21688
|
// src/features/rules/goose-rule.ts
|
|
20718
|
-
var
|
|
21689
|
+
var import_node_path141 = require("path");
|
|
20719
21690
|
var GooseRule = class _GooseRule extends ToolRule {
|
|
20720
21691
|
static getSettablePaths({
|
|
20721
21692
|
global,
|
|
@@ -20750,7 +21721,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
20750
21721
|
if (isRoot) {
|
|
20751
21722
|
const relativePath2 = paths.root.relativeFilePath;
|
|
20752
21723
|
const fileContent2 = await readFileContent(
|
|
20753
|
-
(0,
|
|
21724
|
+
(0, import_node_path141.join)(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
20754
21725
|
);
|
|
20755
21726
|
return new _GooseRule({
|
|
20756
21727
|
outputRoot,
|
|
@@ -20764,8 +21735,8 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
20764
21735
|
if (!paths.nonRoot) {
|
|
20765
21736
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
20766
21737
|
}
|
|
20767
|
-
const relativePath = (0,
|
|
20768
|
-
const fileContent = await readFileContent((0,
|
|
21738
|
+
const relativePath = (0, import_node_path141.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
21739
|
+
const fileContent = await readFileContent((0, import_node_path141.join)(outputRoot, relativePath));
|
|
20769
21740
|
return new _GooseRule({
|
|
20770
21741
|
outputRoot,
|
|
20771
21742
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -20824,7 +21795,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
20824
21795
|
};
|
|
20825
21796
|
|
|
20826
21797
|
// src/features/rules/junie-rule.ts
|
|
20827
|
-
var
|
|
21798
|
+
var import_node_path142 = require("path");
|
|
20828
21799
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
20829
21800
|
static getSettablePaths(_options = {}) {
|
|
20830
21801
|
return {
|
|
@@ -20853,8 +21824,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
20853
21824
|
}) {
|
|
20854
21825
|
const isRoot = _JunieRule.isRootRelativeFilePath(relativeFilePath);
|
|
20855
21826
|
const settablePaths = this.getSettablePaths();
|
|
20856
|
-
const relativePath = isRoot ? (0,
|
|
20857
|
-
const fileContent = await readFileContent((0,
|
|
21827
|
+
const relativePath = isRoot ? (0, import_node_path142.join)(settablePaths.root.relativeDirPath, settablePaths.root.relativeFilePath) : (0, import_node_path142.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
21828
|
+
const fileContent = await readFileContent((0, import_node_path142.join)(outputRoot, relativePath));
|
|
20858
21829
|
return new _JunieRule({
|
|
20859
21830
|
outputRoot,
|
|
20860
21831
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -20909,7 +21880,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
20909
21880
|
};
|
|
20910
21881
|
|
|
20911
21882
|
// src/features/rules/kilo-rule.ts
|
|
20912
|
-
var
|
|
21883
|
+
var import_node_path143 = require("path");
|
|
20913
21884
|
var KiloRule = class _KiloRule extends ToolRule {
|
|
20914
21885
|
static getSettablePaths({
|
|
20915
21886
|
global,
|
|
@@ -20944,7 +21915,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
20944
21915
|
if (isRoot) {
|
|
20945
21916
|
const relativePath2 = paths.root.relativeFilePath;
|
|
20946
21917
|
const fileContent2 = await readFileContent(
|
|
20947
|
-
(0,
|
|
21918
|
+
(0, import_node_path143.join)(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
20948
21919
|
);
|
|
20949
21920
|
return new _KiloRule({
|
|
20950
21921
|
outputRoot,
|
|
@@ -20958,8 +21929,8 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
20958
21929
|
if (!paths.nonRoot) {
|
|
20959
21930
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
20960
21931
|
}
|
|
20961
|
-
const relativePath = (0,
|
|
20962
|
-
const fileContent = await readFileContent((0,
|
|
21932
|
+
const relativePath = (0, import_node_path143.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
21933
|
+
const fileContent = await readFileContent((0, import_node_path143.join)(outputRoot, relativePath));
|
|
20963
21934
|
return new _KiloRule({
|
|
20964
21935
|
outputRoot,
|
|
20965
21936
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -21018,7 +21989,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
21018
21989
|
};
|
|
21019
21990
|
|
|
21020
21991
|
// src/features/rules/kiro-rule.ts
|
|
21021
|
-
var
|
|
21992
|
+
var import_node_path144 = require("path");
|
|
21022
21993
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
21023
21994
|
static getSettablePaths(_options = {}) {
|
|
21024
21995
|
return {
|
|
@@ -21033,7 +22004,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
21033
22004
|
validate = true
|
|
21034
22005
|
}) {
|
|
21035
22006
|
const fileContent = await readFileContent(
|
|
21036
|
-
(0,
|
|
22007
|
+
(0, import_node_path144.join)(outputRoot, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
21037
22008
|
);
|
|
21038
22009
|
return new _KiroRule({
|
|
21039
22010
|
outputRoot,
|
|
@@ -21087,7 +22058,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
21087
22058
|
};
|
|
21088
22059
|
|
|
21089
22060
|
// src/features/rules/opencode-rule.ts
|
|
21090
|
-
var
|
|
22061
|
+
var import_node_path145 = require("path");
|
|
21091
22062
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
21092
22063
|
static getSettablePaths({
|
|
21093
22064
|
global,
|
|
@@ -21122,7 +22093,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
21122
22093
|
if (isRoot) {
|
|
21123
22094
|
const relativePath2 = paths.root.relativeFilePath;
|
|
21124
22095
|
const fileContent2 = await readFileContent(
|
|
21125
|
-
(0,
|
|
22096
|
+
(0, import_node_path145.join)(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
21126
22097
|
);
|
|
21127
22098
|
return new _OpenCodeRule({
|
|
21128
22099
|
outputRoot,
|
|
@@ -21136,8 +22107,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
21136
22107
|
if (!paths.nonRoot) {
|
|
21137
22108
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
21138
22109
|
}
|
|
21139
|
-
const relativePath = (0,
|
|
21140
|
-
const fileContent = await readFileContent((0,
|
|
22110
|
+
const relativePath = (0, import_node_path145.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
22111
|
+
const fileContent = await readFileContent((0, import_node_path145.join)(outputRoot, relativePath));
|
|
21141
22112
|
return new _OpenCodeRule({
|
|
21142
22113
|
outputRoot,
|
|
21143
22114
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -21196,7 +22167,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
21196
22167
|
};
|
|
21197
22168
|
|
|
21198
22169
|
// src/features/rules/pi-rule.ts
|
|
21199
|
-
var
|
|
22170
|
+
var import_node_path146 = require("path");
|
|
21200
22171
|
var PiRule = class _PiRule extends ToolRule {
|
|
21201
22172
|
static getSettablePaths({
|
|
21202
22173
|
global,
|
|
@@ -21230,7 +22201,7 @@ var PiRule = class _PiRule extends ToolRule {
|
|
|
21230
22201
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
21231
22202
|
if (isRoot) {
|
|
21232
22203
|
const fileContent2 = await readFileContent(
|
|
21233
|
-
(0,
|
|
22204
|
+
(0, import_node_path146.join)(outputRoot, paths.root.relativeDirPath, paths.root.relativeFilePath)
|
|
21234
22205
|
);
|
|
21235
22206
|
return new _PiRule({
|
|
21236
22207
|
outputRoot,
|
|
@@ -21246,8 +22217,8 @@ var PiRule = class _PiRule extends ToolRule {
|
|
|
21246
22217
|
`PiRule does not support non-root rules in global mode; expected '${paths.root.relativeFilePath}' but got '${relativeFilePath}'`
|
|
21247
22218
|
);
|
|
21248
22219
|
}
|
|
21249
|
-
const relativePath = (0,
|
|
21250
|
-
const fileContent = await readFileContent((0,
|
|
22220
|
+
const relativePath = (0, import_node_path146.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
22221
|
+
const fileContent = await readFileContent((0, import_node_path146.join)(outputRoot, relativePath));
|
|
21251
22222
|
return new _PiRule({
|
|
21252
22223
|
outputRoot,
|
|
21253
22224
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -21311,7 +22282,7 @@ var PiRule = class _PiRule extends ToolRule {
|
|
|
21311
22282
|
};
|
|
21312
22283
|
|
|
21313
22284
|
// src/features/rules/qwencode-rule.ts
|
|
21314
|
-
var
|
|
22285
|
+
var import_node_path147 = require("path");
|
|
21315
22286
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
21316
22287
|
static getSettablePaths(_options = {}) {
|
|
21317
22288
|
return {
|
|
@@ -21330,8 +22301,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
21330
22301
|
validate = true
|
|
21331
22302
|
}) {
|
|
21332
22303
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
21333
|
-
const relativePath = isRoot ? "QWEN.md" : (0,
|
|
21334
|
-
const fileContent = await readFileContent((0,
|
|
22304
|
+
const relativePath = isRoot ? "QWEN.md" : (0, import_node_path147.join)(".qwen", "memories", relativeFilePath);
|
|
22305
|
+
const fileContent = await readFileContent((0, import_node_path147.join)(outputRoot, relativePath));
|
|
21335
22306
|
return new _QwencodeRule({
|
|
21336
22307
|
outputRoot,
|
|
21337
22308
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -21383,7 +22354,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
21383
22354
|
};
|
|
21384
22355
|
|
|
21385
22356
|
// src/features/rules/replit-rule.ts
|
|
21386
|
-
var
|
|
22357
|
+
var import_node_path148 = require("path");
|
|
21387
22358
|
var ReplitRule = class _ReplitRule extends ToolRule {
|
|
21388
22359
|
static getSettablePaths(_options = {}) {
|
|
21389
22360
|
return {
|
|
@@ -21405,7 +22376,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
21405
22376
|
}
|
|
21406
22377
|
const relativePath = paths.root.relativeFilePath;
|
|
21407
22378
|
const fileContent = await readFileContent(
|
|
21408
|
-
(0,
|
|
22379
|
+
(0, import_node_path148.join)(outputRoot, paths.root.relativeDirPath, relativePath)
|
|
21409
22380
|
);
|
|
21410
22381
|
return new _ReplitRule({
|
|
21411
22382
|
outputRoot,
|
|
@@ -21471,7 +22442,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
21471
22442
|
};
|
|
21472
22443
|
|
|
21473
22444
|
// src/features/rules/roo-rule.ts
|
|
21474
|
-
var
|
|
22445
|
+
var import_node_path149 = require("path");
|
|
21475
22446
|
var RooRule = class _RooRule extends ToolRule {
|
|
21476
22447
|
static getSettablePaths(_options = {}) {
|
|
21477
22448
|
return {
|
|
@@ -21486,7 +22457,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
21486
22457
|
validate = true
|
|
21487
22458
|
}) {
|
|
21488
22459
|
const fileContent = await readFileContent(
|
|
21489
|
-
(0,
|
|
22460
|
+
(0, import_node_path149.join)(outputRoot, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
21490
22461
|
);
|
|
21491
22462
|
return new _RooRule({
|
|
21492
22463
|
outputRoot,
|
|
@@ -21555,7 +22526,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
21555
22526
|
};
|
|
21556
22527
|
|
|
21557
22528
|
// src/features/rules/rovodev-rule.ts
|
|
21558
|
-
var
|
|
22529
|
+
var import_node_path150 = require("path");
|
|
21559
22530
|
var DISALLOWED_ROVODEV_MODULAR_RULE_BASENAMES = /* @__PURE__ */ new Set(["agents.md", "agents.local.md"]);
|
|
21560
22531
|
var RovodevRule = class _RovodevRule extends ToolRule {
|
|
21561
22532
|
/**
|
|
@@ -21599,7 +22570,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
21599
22570
|
root: rovodevAgents,
|
|
21600
22571
|
alternativeRoots: [{ relativeDirPath: ".", relativeFilePath: "AGENTS.md" }],
|
|
21601
22572
|
nonRoot: {
|
|
21602
|
-
relativeDirPath: (0,
|
|
22573
|
+
relativeDirPath: (0, import_node_path150.join)(".rovodev", ".rulesync", "modular-rules")
|
|
21603
22574
|
}
|
|
21604
22575
|
};
|
|
21605
22576
|
}
|
|
@@ -21638,10 +22609,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
21638
22609
|
}) {
|
|
21639
22610
|
if (!this.isAllowedModularRulesRelativePath(relativeFilePath)) {
|
|
21640
22611
|
throw new Error(
|
|
21641
|
-
`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${(0,
|
|
22612
|
+
`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${(0, import_node_path150.join)(relativeDirPath, relativeFilePath)}`
|
|
21642
22613
|
);
|
|
21643
22614
|
}
|
|
21644
|
-
const fileContent = await readFileContent((0,
|
|
22615
|
+
const fileContent = await readFileContent((0, import_node_path150.join)(outputRoot, relativeDirPath, relativeFilePath));
|
|
21645
22616
|
return new _RovodevRule({
|
|
21646
22617
|
outputRoot,
|
|
21647
22618
|
relativeDirPath,
|
|
@@ -21661,10 +22632,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
21661
22632
|
paths
|
|
21662
22633
|
}) {
|
|
21663
22634
|
const relativeDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
21664
|
-
const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${(0,
|
|
22635
|
+
const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${(0, import_node_path150.join)(paths.root.relativeDirPath, paths.root.relativeFilePath)} or project root` : (0, import_node_path150.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
21665
22636
|
if (relativeFilePath !== "AGENTS.md") {
|
|
21666
22637
|
throw new Error(
|
|
21667
|
-
`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${(0,
|
|
22638
|
+
`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${(0, import_node_path150.join)(relativeDirPath, relativeFilePath)}`
|
|
21668
22639
|
);
|
|
21669
22640
|
}
|
|
21670
22641
|
const allowed = relativeDirPath === paths.root.relativeDirPath || "alternativeRoots" in paths && paths.alternativeRoots?.some(
|
|
@@ -21672,10 +22643,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
21672
22643
|
);
|
|
21673
22644
|
if (!allowed) {
|
|
21674
22645
|
throw new Error(
|
|
21675
|
-
`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${(0,
|
|
22646
|
+
`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${(0, import_node_path150.join)(relativeDirPath, relativeFilePath)}`
|
|
21676
22647
|
);
|
|
21677
22648
|
}
|
|
21678
|
-
const fileContent = await readFileContent((0,
|
|
22649
|
+
const fileContent = await readFileContent((0, import_node_path150.join)(outputRoot, relativeDirPath, relativeFilePath));
|
|
21679
22650
|
return new _RovodevRule({
|
|
21680
22651
|
outputRoot,
|
|
21681
22652
|
relativeDirPath,
|
|
@@ -21789,7 +22760,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
21789
22760
|
};
|
|
21790
22761
|
|
|
21791
22762
|
// src/features/rules/takt-rule.ts
|
|
21792
|
-
var
|
|
22763
|
+
var import_node_path151 = require("path");
|
|
21793
22764
|
var DEFAULT_TAKT_RULE_DIR = "policies";
|
|
21794
22765
|
var TaktRule = class _TaktRule extends ToolRule {
|
|
21795
22766
|
static getSettablePaths({
|
|
@@ -21801,7 +22772,7 @@ var TaktRule = class _TaktRule extends ToolRule {
|
|
|
21801
22772
|
root: {
|
|
21802
22773
|
relativeDirPath: buildToolPath(
|
|
21803
22774
|
".takt",
|
|
21804
|
-
(0,
|
|
22775
|
+
(0, import_node_path151.join)("facets", DEFAULT_TAKT_RULE_DIR),
|
|
21805
22776
|
excludeToolDir
|
|
21806
22777
|
),
|
|
21807
22778
|
relativeFilePath: "overview.md"
|
|
@@ -21812,7 +22783,7 @@ var TaktRule = class _TaktRule extends ToolRule {
|
|
|
21812
22783
|
nonRoot: {
|
|
21813
22784
|
relativeDirPath: buildToolPath(
|
|
21814
22785
|
".takt",
|
|
21815
|
-
(0,
|
|
22786
|
+
(0, import_node_path151.join)("facets", DEFAULT_TAKT_RULE_DIR),
|
|
21816
22787
|
excludeToolDir
|
|
21817
22788
|
)
|
|
21818
22789
|
}
|
|
@@ -21830,8 +22801,8 @@ var TaktRule = class _TaktRule extends ToolRule {
|
|
|
21830
22801
|
validate = true,
|
|
21831
22802
|
relativeDirPath: overrideDirPath
|
|
21832
22803
|
}) {
|
|
21833
|
-
const dirPath = overrideDirPath ?? (0,
|
|
21834
|
-
const filePath = (0,
|
|
22804
|
+
const dirPath = overrideDirPath ?? (0, import_node_path151.join)(".takt", "facets", DEFAULT_TAKT_RULE_DIR);
|
|
22805
|
+
const filePath = (0, import_node_path151.join)(outputRoot, dirPath, relativeFilePath);
|
|
21835
22806
|
const fileContent = await readFileContent(filePath);
|
|
21836
22807
|
const { body } = parseFrontmatter(fileContent, filePath);
|
|
21837
22808
|
return new _TaktRule({
|
|
@@ -21870,7 +22841,7 @@ var TaktRule = class _TaktRule extends ToolRule {
|
|
|
21870
22841
|
const stem = overrideName ?? sourceStem;
|
|
21871
22842
|
assertSafeTaktName({ name: stem, featureLabel: "rule", sourceLabel });
|
|
21872
22843
|
const relativeFilePath = `${stem}.md`;
|
|
21873
|
-
const relativeDirPath = (0,
|
|
22844
|
+
const relativeDirPath = (0, import_node_path151.join)(".takt", "facets", DEFAULT_TAKT_RULE_DIR);
|
|
21874
22845
|
return new _TaktRule({
|
|
21875
22846
|
outputRoot,
|
|
21876
22847
|
relativeDirPath,
|
|
@@ -21895,7 +22866,7 @@ var TaktRule = class _TaktRule extends ToolRule {
|
|
|
21895
22866
|
};
|
|
21896
22867
|
|
|
21897
22868
|
// src/features/rules/warp-rule.ts
|
|
21898
|
-
var
|
|
22869
|
+
var import_node_path152 = require("path");
|
|
21899
22870
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
21900
22871
|
constructor({ fileContent, root, ...rest }) {
|
|
21901
22872
|
super({
|
|
@@ -21921,8 +22892,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
21921
22892
|
validate = true
|
|
21922
22893
|
}) {
|
|
21923
22894
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
21924
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0,
|
|
21925
|
-
const fileContent = await readFileContent((0,
|
|
22895
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path152.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
22896
|
+
const fileContent = await readFileContent((0, import_node_path152.join)(outputRoot, relativePath));
|
|
21926
22897
|
return new _WarpRule({
|
|
21927
22898
|
outputRoot,
|
|
21928
22899
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -21977,7 +22948,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
21977
22948
|
};
|
|
21978
22949
|
|
|
21979
22950
|
// src/features/rules/windsurf-rule.ts
|
|
21980
|
-
var
|
|
22951
|
+
var import_node_path153 = require("path");
|
|
21981
22952
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
21982
22953
|
static getSettablePaths(_options = {}) {
|
|
21983
22954
|
return {
|
|
@@ -21992,7 +22963,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
21992
22963
|
validate = true
|
|
21993
22964
|
}) {
|
|
21994
22965
|
const fileContent = await readFileContent(
|
|
21995
|
-
(0,
|
|
22966
|
+
(0, import_node_path153.join)(outputRoot, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
21996
22967
|
);
|
|
21997
22968
|
return new _WindsurfRule({
|
|
21998
22969
|
outputRoot,
|
|
@@ -22092,11 +23063,11 @@ var rulesProcessorToolTargets = [
|
|
|
22092
23063
|
"warp",
|
|
22093
23064
|
"windsurf"
|
|
22094
23065
|
];
|
|
22095
|
-
var RulesProcessorToolTargetSchema =
|
|
22096
|
-
var formatRulePaths = (rules) => rules.map((r) => (0,
|
|
22097
|
-
var RulesFeatureOptionsSchema =
|
|
22098
|
-
ruleDiscoveryMode:
|
|
22099
|
-
includeLocalRoot:
|
|
23066
|
+
var RulesProcessorToolTargetSchema = import_mini79.z.enum(rulesProcessorToolTargets);
|
|
23067
|
+
var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path154.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
|
|
23068
|
+
var RulesFeatureOptionsSchema = import_mini79.z.looseObject({
|
|
23069
|
+
ruleDiscoveryMode: import_mini79.z.optional(import_mini79.z.enum(["none", "explicit"])),
|
|
23070
|
+
includeLocalRoot: import_mini79.z.optional(import_mini79.z.boolean())
|
|
22100
23071
|
});
|
|
22101
23072
|
var resolveRuleDiscoveryMode = ({
|
|
22102
23073
|
defaultMode,
|
|
@@ -22117,8 +23088,8 @@ var resolveRuleDiscoveryMode = ({
|
|
|
22117
23088
|
}
|
|
22118
23089
|
return parsed.data.ruleDiscoveryMode === "none" ? "auto" : "toon";
|
|
22119
23090
|
};
|
|
22120
|
-
var IncludeLocalRootSchema =
|
|
22121
|
-
includeLocalRoot:
|
|
23091
|
+
var IncludeLocalRootSchema = import_mini79.z.looseObject({
|
|
23092
|
+
includeLocalRoot: import_mini79.z.optional(import_mini79.z.boolean())
|
|
22122
23093
|
});
|
|
22123
23094
|
var resolveIncludeLocalRoot = (options) => {
|
|
22124
23095
|
if (!options) return true;
|
|
@@ -22589,7 +23560,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
22589
23560
|
}).relativeDirPath;
|
|
22590
23561
|
return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
|
|
22591
23562
|
const frontmatter = skill.getFrontmatter();
|
|
22592
|
-
const relativePath = (0,
|
|
23563
|
+
const relativePath = (0, import_node_path154.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
|
|
22593
23564
|
return {
|
|
22594
23565
|
name: frontmatter.name,
|
|
22595
23566
|
description: frontmatter.description,
|
|
@@ -22718,12 +23689,12 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
22718
23689
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
22719
23690
|
*/
|
|
22720
23691
|
async loadRulesyncFiles() {
|
|
22721
|
-
const rulesyncOutputRoot = (0,
|
|
22722
|
-
const files = await findFilesByGlobs((0,
|
|
23692
|
+
const rulesyncOutputRoot = (0, import_node_path154.join)(this.inputRoot, RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
23693
|
+
const files = await findFilesByGlobs((0, import_node_path154.join)(rulesyncOutputRoot, "**", "*.md"));
|
|
22723
23694
|
this.logger.debug(`Found ${files.length} rulesync files`);
|
|
22724
23695
|
const rulesyncRules = await Promise.all(
|
|
22725
23696
|
files.map((file) => {
|
|
22726
|
-
const relativeFilePath = (0,
|
|
23697
|
+
const relativeFilePath = (0, import_node_path154.relative)(rulesyncOutputRoot, file);
|
|
22727
23698
|
checkPathTraversal({
|
|
22728
23699
|
relativePath: relativeFilePath,
|
|
22729
23700
|
intendedRootDir: rulesyncOutputRoot
|
|
@@ -22799,7 +23770,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
22799
23770
|
global: this.global
|
|
22800
23771
|
});
|
|
22801
23772
|
const resolveRelativeDirPath = (filePath) => {
|
|
22802
|
-
const dirName = (0,
|
|
23773
|
+
const dirName = (0, import_node_path154.dirname)((0, import_node_path154.relative)(this.outputRoot, filePath));
|
|
22803
23774
|
return dirName === "" ? "." : dirName;
|
|
22804
23775
|
};
|
|
22805
23776
|
const buildDeletionRulesFromPaths = (filePaths, opts) => {
|
|
@@ -22807,7 +23778,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
22807
23778
|
const effectiveOutputRoot = isNonRoot ? opts.outputRootOverride : this.outputRoot;
|
|
22808
23779
|
return filePaths.map((filePath) => {
|
|
22809
23780
|
const relativeDirPath = isNonRoot ? opts.relativeDirPathOverride : resolveRelativeDirPath(filePath);
|
|
22810
|
-
const relativeFilePath = isNonRoot ? (0,
|
|
23781
|
+
const relativeFilePath = isNonRoot ? (0, import_node_path154.relative)(effectiveOutputRoot, filePath) : (0, import_node_path154.basename)(filePath);
|
|
22811
23782
|
checkPathTraversal({
|
|
22812
23783
|
relativePath: isNonRoot ? relativeFilePath : relativeDirPath,
|
|
22813
23784
|
intendedRootDir: effectiveOutputRoot
|
|
@@ -22835,13 +23806,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
22835
23806
|
return [];
|
|
22836
23807
|
}
|
|
22837
23808
|
const uniqueRootFilePaths = await findFilesWithFallback(
|
|
22838
|
-
(0,
|
|
23809
|
+
(0, import_node_path154.join)(
|
|
22839
23810
|
this.outputRoot,
|
|
22840
23811
|
settablePaths.root.relativeDirPath ?? ".",
|
|
22841
23812
|
settablePaths.root.relativeFilePath
|
|
22842
23813
|
),
|
|
22843
23814
|
settablePaths.alternativeRoots,
|
|
22844
|
-
(alt) => (0,
|
|
23815
|
+
(alt) => (0, import_node_path154.join)(this.outputRoot, alt.relativeDirPath, alt.relativeFilePath)
|
|
22845
23816
|
);
|
|
22846
23817
|
if (forDeletion) {
|
|
22847
23818
|
return buildDeletionRulesFromPaths(uniqueRootFilePaths);
|
|
@@ -22855,7 +23826,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
22855
23826
|
});
|
|
22856
23827
|
return factory.class.fromFile({
|
|
22857
23828
|
outputRoot: this.outputRoot,
|
|
22858
|
-
relativeFilePath: (0,
|
|
23829
|
+
relativeFilePath: (0, import_node_path154.basename)(filePath),
|
|
22859
23830
|
relativeDirPath,
|
|
22860
23831
|
global: this.global
|
|
22861
23832
|
});
|
|
@@ -22872,7 +23843,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
22872
23843
|
return [];
|
|
22873
23844
|
}
|
|
22874
23845
|
const uniqueLocalRootFilePaths2 = await findFilesByGlobs(
|
|
22875
|
-
(0,
|
|
23846
|
+
(0, import_node_path154.join)(this.outputRoot, "AGENTS.local.md")
|
|
22876
23847
|
);
|
|
22877
23848
|
return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths2);
|
|
22878
23849
|
}
|
|
@@ -22883,9 +23854,9 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
22883
23854
|
return [];
|
|
22884
23855
|
}
|
|
22885
23856
|
const uniqueLocalRootFilePaths = await findFilesWithFallback(
|
|
22886
|
-
(0,
|
|
23857
|
+
(0, import_node_path154.join)(this.outputRoot, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
|
|
22887
23858
|
settablePaths.alternativeRoots,
|
|
22888
|
-
(alt) => (0,
|
|
23859
|
+
(alt) => (0, import_node_path154.join)(this.outputRoot, alt.relativeDirPath, "CLAUDE.local.md")
|
|
22889
23860
|
);
|
|
22890
23861
|
return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths);
|
|
22891
23862
|
})();
|
|
@@ -22896,20 +23867,20 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
22896
23867
|
if (!forDeletion || this.toolTarget !== "rovodev" || this.global) {
|
|
22897
23868
|
return [];
|
|
22898
23869
|
}
|
|
22899
|
-
const primaryPaths = await findFilesByGlobs((0,
|
|
23870
|
+
const primaryPaths = await findFilesByGlobs((0, import_node_path154.join)(this.outputRoot, ".rovodev", "AGENTS.md"));
|
|
22900
23871
|
if (primaryPaths.length === 0) {
|
|
22901
23872
|
return [];
|
|
22902
23873
|
}
|
|
22903
|
-
const mirrorPaths = await findFilesByGlobs((0,
|
|
23874
|
+
const mirrorPaths = await findFilesByGlobs((0, import_node_path154.join)(this.outputRoot, "AGENTS.md"));
|
|
22904
23875
|
return buildDeletionRulesFromPaths(mirrorPaths);
|
|
22905
23876
|
})();
|
|
22906
23877
|
const nonRootToolRules = await (async () => {
|
|
22907
23878
|
if (!settablePaths.nonRoot) {
|
|
22908
23879
|
return [];
|
|
22909
23880
|
}
|
|
22910
|
-
const nonRootOutputRoot = (0,
|
|
23881
|
+
const nonRootOutputRoot = (0, import_node_path154.join)(this.outputRoot, settablePaths.nonRoot.relativeDirPath);
|
|
22911
23882
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
22912
|
-
(0,
|
|
23883
|
+
(0, import_node_path154.join)(nonRootOutputRoot, "**", `*.${factory.meta.extension}`)
|
|
22913
23884
|
);
|
|
22914
23885
|
if (forDeletion) {
|
|
22915
23886
|
return buildDeletionRulesFromPaths(nonRootFilePaths, {
|
|
@@ -22919,18 +23890,18 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
22919
23890
|
}
|
|
22920
23891
|
const modularRootRelative = settablePaths.nonRoot.relativeDirPath;
|
|
22921
23892
|
const nonRootPathsForImport = this.toolTarget === "rovodev" ? nonRootFilePaths.filter((filePath) => {
|
|
22922
|
-
const relativeFilePath = (0,
|
|
23893
|
+
const relativeFilePath = (0, import_node_path154.relative)(nonRootOutputRoot, filePath);
|
|
22923
23894
|
const ok = RovodevRule.isAllowedModularRulesRelativePath(relativeFilePath);
|
|
22924
23895
|
if (!ok) {
|
|
22925
23896
|
this.logger.warn(
|
|
22926
|
-
`Skipping reserved Rovodev path under modular-rules (import): ${(0,
|
|
23897
|
+
`Skipping reserved Rovodev path under modular-rules (import): ${(0, import_node_path154.join)(modularRootRelative, relativeFilePath)}`
|
|
22927
23898
|
);
|
|
22928
23899
|
}
|
|
22929
23900
|
return ok;
|
|
22930
23901
|
}) : nonRootFilePaths;
|
|
22931
23902
|
return await Promise.all(
|
|
22932
23903
|
nonRootPathsForImport.map((filePath) => {
|
|
22933
|
-
const relativeFilePath = (0,
|
|
23904
|
+
const relativeFilePath = (0, import_node_path154.relative)(nonRootOutputRoot, filePath);
|
|
22934
23905
|
checkPathTraversal({
|
|
22935
23906
|
relativePath: relativeFilePath,
|
|
22936
23907
|
intendedRootDir: nonRootOutputRoot
|
|
@@ -23049,14 +24020,14 @@ s/<command> [arguments]
|
|
|
23049
24020
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
23050
24021
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
23051
24022
|
|
|
23052
|
-
When users call a custom slash command, you have to look for the markdown file, \`${(0,
|
|
24023
|
+
When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path154.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
23053
24024
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
23054
24025
|
|
|
23055
24026
|
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.
|
|
23056
24027
|
|
|
23057
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0,
|
|
24028
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path154.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
23058
24029
|
|
|
23059
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0,
|
|
24030
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path154.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
23060
24031
|
const skillsSection = skills ? this.generateSkillsSection(skills) : "";
|
|
23061
24032
|
const result = [
|
|
23062
24033
|
overview,
|
|
@@ -23314,8 +24285,8 @@ function buildPermissionsStrategy(ctx) {
|
|
|
23314
24285
|
}
|
|
23315
24286
|
|
|
23316
24287
|
// src/lib/generate.ts
|
|
23317
|
-
var
|
|
23318
|
-
var
|
|
24288
|
+
var import_node_path155 = require("path");
|
|
24289
|
+
var import_es_toolkit8 = require("es-toolkit");
|
|
23319
24290
|
async function processFeatureGeneration(params) {
|
|
23320
24291
|
const { config, processor, toolFiles } = params;
|
|
23321
24292
|
let totalCount = 0;
|
|
@@ -23388,7 +24359,7 @@ function warnUnsupportedTargets(params) {
|
|
|
23388
24359
|
}
|
|
23389
24360
|
}
|
|
23390
24361
|
async function checkRulesyncDirExists(params) {
|
|
23391
|
-
return fileExists((0,
|
|
24362
|
+
return fileExists((0, import_node_path155.join)(params.inputRoot, RULESYNC_RELATIVE_DIR_PATH));
|
|
23392
24363
|
}
|
|
23393
24364
|
async function generate(params) {
|
|
23394
24365
|
const { config, logger } = params;
|
|
@@ -23428,7 +24399,7 @@ async function generateRulesCore(params) {
|
|
|
23428
24399
|
const allPaths = [];
|
|
23429
24400
|
let hasDiff = false;
|
|
23430
24401
|
const supportedTargets = RulesProcessor.getToolTargets({ global: config.getGlobal() });
|
|
23431
|
-
const toolTargets = (0,
|
|
24402
|
+
const toolTargets = (0, import_es_toolkit8.intersection)(config.getTargets(), supportedTargets);
|
|
23432
24403
|
warnUnsupportedTargets({ config, supportedTargets, featureName: "rules", logger });
|
|
23433
24404
|
for (const outputRoot of config.getOutputRoots()) {
|
|
23434
24405
|
for (const toolTarget of toolTargets) {
|
|
@@ -23472,7 +24443,7 @@ async function generateIgnoreCore(params) {
|
|
|
23472
24443
|
let totalCount = 0;
|
|
23473
24444
|
const allPaths = [];
|
|
23474
24445
|
let hasDiff = false;
|
|
23475
|
-
for (const toolTarget of (0,
|
|
24446
|
+
for (const toolTarget of (0, import_es_toolkit8.intersection)(config.getTargets(), supportedIgnoreTargets)) {
|
|
23476
24447
|
if (!config.getFeatures(toolTarget).includes("ignore")) {
|
|
23477
24448
|
continue;
|
|
23478
24449
|
}
|
|
@@ -23512,7 +24483,7 @@ async function generateMcpCore(params) {
|
|
|
23512
24483
|
const allPaths = [];
|
|
23513
24484
|
let hasDiff = false;
|
|
23514
24485
|
const supportedMcpTargets = McpProcessor.getToolTargets({ global: config.getGlobal() });
|
|
23515
|
-
const toolTargets = (0,
|
|
24486
|
+
const toolTargets = (0, import_es_toolkit8.intersection)(config.getTargets(), supportedMcpTargets);
|
|
23516
24487
|
warnUnsupportedTargets({
|
|
23517
24488
|
config,
|
|
23518
24489
|
supportedTargets: supportedMcpTargets,
|
|
@@ -23550,7 +24521,7 @@ async function generateCommandsCore(params) {
|
|
|
23550
24521
|
global: config.getGlobal(),
|
|
23551
24522
|
includeSimulated: config.getSimulateCommands()
|
|
23552
24523
|
});
|
|
23553
|
-
const toolTargets = (0,
|
|
24524
|
+
const toolTargets = (0, import_es_toolkit8.intersection)(config.getTargets(), supportedCommandsTargets);
|
|
23554
24525
|
warnUnsupportedTargets({
|
|
23555
24526
|
config,
|
|
23556
24527
|
supportedTargets: supportedCommandsTargets,
|
|
@@ -23593,7 +24564,7 @@ async function generateSubagentsCore(params) {
|
|
|
23593
24564
|
global: config.getGlobal(),
|
|
23594
24565
|
includeSimulated: config.getSimulateSubagents()
|
|
23595
24566
|
});
|
|
23596
|
-
const toolTargets = (0,
|
|
24567
|
+
const toolTargets = (0, import_es_toolkit8.intersection)(config.getTargets(), supportedSubagentsTargets);
|
|
23597
24568
|
warnUnsupportedTargets({
|
|
23598
24569
|
config,
|
|
23599
24570
|
supportedTargets: supportedSubagentsTargets,
|
|
@@ -23633,7 +24604,7 @@ async function generateSkillsCore(params) {
|
|
|
23633
24604
|
global: config.getGlobal(),
|
|
23634
24605
|
includeSimulated: config.getSimulateSkills()
|
|
23635
24606
|
});
|
|
23636
|
-
const toolTargets = (0,
|
|
24607
|
+
const toolTargets = (0, import_es_toolkit8.intersection)(config.getTargets(), supportedSkillsTargets);
|
|
23637
24608
|
warnUnsupportedTargets({
|
|
23638
24609
|
config,
|
|
23639
24610
|
supportedTargets: supportedSkillsTargets,
|
|
@@ -23679,7 +24650,7 @@ async function generateHooksCore(params) {
|
|
|
23679
24650
|
const allPaths = [];
|
|
23680
24651
|
let hasDiff = false;
|
|
23681
24652
|
const supportedHooksTargets = HooksProcessor.getToolTargets({ global: config.getGlobal() });
|
|
23682
|
-
const toolTargets = (0,
|
|
24653
|
+
const toolTargets = (0, import_es_toolkit8.intersection)(config.getTargets(), supportedHooksTargets);
|
|
23683
24654
|
warnUnsupportedTargets({
|
|
23684
24655
|
config,
|
|
23685
24656
|
supportedTargets: supportedHooksTargets,
|
|
@@ -23723,7 +24694,7 @@ async function generatePermissionsCore(params) {
|
|
|
23723
24694
|
const allPaths = [];
|
|
23724
24695
|
let hasDiff = false;
|
|
23725
24696
|
for (const outputRoot of config.getOutputRoots()) {
|
|
23726
|
-
for (const toolTarget of (0,
|
|
24697
|
+
for (const toolTarget of (0, import_es_toolkit8.intersection)(config.getTargets(), supportedPermissionsTargets)) {
|
|
23727
24698
|
if (!config.getFeatures(toolTarget).includes("permissions")) {
|
|
23728
24699
|
continue;
|
|
23729
24700
|
}
|