rulesync 8.23.0 → 8.24.1
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 +42 -36
- package/dist/{chunk-G2YWSXTU.js → chunk-YM6XKTQO.js} +913 -523
- package/dist/cli/index.cjs +1109 -718
- package/dist/cli/index.js +5 -4
- package/dist/index.cjs +943 -553
- package/dist/index.d.cts +29 -1
- package/dist/index.d.ts +29 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -379,6 +379,7 @@ var import_mini2 = require("zod/mini");
|
|
|
379
379
|
var ALL_TOOL_TARGETS = [
|
|
380
380
|
"agentsmd",
|
|
381
381
|
"agentsskills",
|
|
382
|
+
"amp",
|
|
382
383
|
"antigravity",
|
|
383
384
|
"antigravity-cli",
|
|
384
385
|
"antigravity-ide",
|
|
@@ -6199,9 +6200,11 @@ function generateOpencodeStylePluginCode(config, supportedEvents, toolConfigKey,
|
|
|
6199
6200
|
const escapedCommand = escapeForTemplateLiteral(handler.command);
|
|
6200
6201
|
if (handler.matcher) {
|
|
6201
6202
|
const safeMatcher = validateAndSanitizeMatcher(handler.matcher);
|
|
6202
|
-
lines.push(
|
|
6203
|
-
lines.push(`
|
|
6204
|
-
lines.push(`
|
|
6203
|
+
lines.push(" {");
|
|
6204
|
+
lines.push(` const __re = new RegExp("${safeMatcher}");`);
|
|
6205
|
+
lines.push(` if (__re.test(input.tool)) {`);
|
|
6206
|
+
lines.push(` await $\`${escapedCommand}\`;`);
|
|
6207
|
+
lines.push(" }");
|
|
6205
6208
|
lines.push(" }");
|
|
6206
6209
|
} else {
|
|
6207
6210
|
lines.push(` await $\`${escapedCommand}\`;`);
|
|
@@ -8082,8 +8085,19 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
8082
8085
|
// src/features/mcp/mcp-processor.ts
|
|
8083
8086
|
var import_mini29 = require("zod/mini");
|
|
8084
8087
|
|
|
8085
|
-
// src/features/mcp/
|
|
8088
|
+
// src/features/mcp/amp-mcp.ts
|
|
8086
8089
|
var import_node_path56 = require("path");
|
|
8090
|
+
var import_jsonc_parser3 = require("jsonc-parser");
|
|
8091
|
+
|
|
8092
|
+
// src/utils/prototype-pollution.ts
|
|
8093
|
+
var PROTOTYPE_POLLUTION_KEYS = /* @__PURE__ */ new Set([
|
|
8094
|
+
"__proto__",
|
|
8095
|
+
"constructor",
|
|
8096
|
+
"prototype"
|
|
8097
|
+
]);
|
|
8098
|
+
function isPrototypePollutionKey(key) {
|
|
8099
|
+
return PROTOTYPE_POLLUTION_KEYS.has(key);
|
|
8100
|
+
}
|
|
8087
8101
|
|
|
8088
8102
|
// src/features/mcp/rulesync-mcp.ts
|
|
8089
8103
|
var import_node_path55 = require("path");
|
|
@@ -8312,7 +8326,200 @@ var ToolMcp = class extends ToolFile {
|
|
|
8312
8326
|
}
|
|
8313
8327
|
};
|
|
8314
8328
|
|
|
8329
|
+
// src/features/mcp/amp-mcp.ts
|
|
8330
|
+
var AMP_MCP_SERVERS_KEY = "amp.mcpServers";
|
|
8331
|
+
function parseAmpSettingsJsonc(fileContent) {
|
|
8332
|
+
const errors = [];
|
|
8333
|
+
const parsed = (0, import_jsonc_parser3.parse)(fileContent || "{}", errors, { allowTrailingComma: true });
|
|
8334
|
+
if (errors.length > 0) {
|
|
8335
|
+
const details = errors.map((error) => `${(0, import_jsonc_parser3.printParseErrorCode)(error.error)} at offset ${error.offset}`).join(", ");
|
|
8336
|
+
throw new Error(`Failed to parse Amp settings: ${details}`);
|
|
8337
|
+
}
|
|
8338
|
+
if (!isRecord(parsed)) {
|
|
8339
|
+
throw new Error("Amp settings must be a JSON object");
|
|
8340
|
+
}
|
|
8341
|
+
return parsed;
|
|
8342
|
+
}
|
|
8343
|
+
function filterMcpServers(mcpServers) {
|
|
8344
|
+
const filtered = {};
|
|
8345
|
+
if (!isRecord(mcpServers)) return filtered;
|
|
8346
|
+
for (const [name, config] of Object.entries(mcpServers)) {
|
|
8347
|
+
if (isPrototypePollutionKey(name) || !isRecord(config)) continue;
|
|
8348
|
+
const filteredConfig = {};
|
|
8349
|
+
for (const [key, value] of Object.entries(config)) {
|
|
8350
|
+
if (isPrototypePollutionKey(key)) continue;
|
|
8351
|
+
filteredConfig[key] = value;
|
|
8352
|
+
}
|
|
8353
|
+
filtered[name] = filteredConfig;
|
|
8354
|
+
}
|
|
8355
|
+
return filtered;
|
|
8356
|
+
}
|
|
8357
|
+
var AmpMcp = class _AmpMcp extends ToolMcp {
|
|
8358
|
+
json;
|
|
8359
|
+
constructor(params) {
|
|
8360
|
+
super(params);
|
|
8361
|
+
this.json = parseAmpSettingsJsonc(this.fileContent);
|
|
8362
|
+
}
|
|
8363
|
+
getJson() {
|
|
8364
|
+
return structuredClone(this.json);
|
|
8365
|
+
}
|
|
8366
|
+
static getSettablePaths({ global } = {}) {
|
|
8367
|
+
if (global) {
|
|
8368
|
+
return {
|
|
8369
|
+
relativeDirPath: (0, import_node_path56.join)(".config", "amp"),
|
|
8370
|
+
relativeFilePath: "settings.jsonc"
|
|
8371
|
+
};
|
|
8372
|
+
}
|
|
8373
|
+
return {
|
|
8374
|
+
relativeDirPath: ".amp",
|
|
8375
|
+
relativeFilePath: "settings.jsonc"
|
|
8376
|
+
};
|
|
8377
|
+
}
|
|
8378
|
+
/**
|
|
8379
|
+
* Probe `<jsonDir>/settings.jsonc` first, falling back to `settings.json`,
|
|
8380
|
+
* so existing user files are read-modified-written in place instead of a
|
|
8381
|
+
* fresh `.json` sibling being created next to a hand-authored `.jsonc`.
|
|
8382
|
+
* Defaults to `settings.jsonc` when neither file exists.
|
|
8383
|
+
*/
|
|
8384
|
+
static async resolveSettingsFile(jsonDir) {
|
|
8385
|
+
const jsoncContent = await readFileContentOrNull((0, import_node_path56.join)(jsonDir, "settings.jsonc"));
|
|
8386
|
+
if (jsoncContent !== null) {
|
|
8387
|
+
return { fileContent: jsoncContent, relativeFilePath: "settings.jsonc" };
|
|
8388
|
+
}
|
|
8389
|
+
const jsonContent = await readFileContentOrNull((0, import_node_path56.join)(jsonDir, "settings.json"));
|
|
8390
|
+
if (jsonContent !== null) {
|
|
8391
|
+
return { fileContent: jsonContent, relativeFilePath: "settings.json" };
|
|
8392
|
+
}
|
|
8393
|
+
return { fileContent: null, relativeFilePath: "settings.jsonc" };
|
|
8394
|
+
}
|
|
8395
|
+
static async fromFile({
|
|
8396
|
+
outputRoot = process.cwd(),
|
|
8397
|
+
validate = true,
|
|
8398
|
+
global = false
|
|
8399
|
+
}) {
|
|
8400
|
+
const basePaths = this.getSettablePaths({ global });
|
|
8401
|
+
const jsonDir = (0, import_node_path56.join)(outputRoot, basePaths.relativeDirPath);
|
|
8402
|
+
const { fileContent, relativeFilePath } = await this.resolveSettingsFile(jsonDir);
|
|
8403
|
+
const json = fileContent ? parseAmpSettingsJsonc(fileContent) : {};
|
|
8404
|
+
const mcpServers = json[AMP_MCP_SERVERS_KEY];
|
|
8405
|
+
const newJson = { ...json, [AMP_MCP_SERVERS_KEY]: mcpServers ?? {} };
|
|
8406
|
+
return new _AmpMcp({
|
|
8407
|
+
outputRoot,
|
|
8408
|
+
relativeDirPath: basePaths.relativeDirPath,
|
|
8409
|
+
relativeFilePath,
|
|
8410
|
+
fileContent: JSON.stringify(newJson, null, 2),
|
|
8411
|
+
validate,
|
|
8412
|
+
global
|
|
8413
|
+
});
|
|
8414
|
+
}
|
|
8415
|
+
static async fromRulesyncMcp({
|
|
8416
|
+
outputRoot = process.cwd(),
|
|
8417
|
+
rulesyncMcp,
|
|
8418
|
+
validate = true,
|
|
8419
|
+
global = false
|
|
8420
|
+
}) {
|
|
8421
|
+
const basePaths = this.getSettablePaths({ global });
|
|
8422
|
+
const jsonDir = (0, import_node_path56.join)(outputRoot, basePaths.relativeDirPath);
|
|
8423
|
+
const { fileContent, relativeFilePath } = await this.resolveSettingsFile(jsonDir);
|
|
8424
|
+
const json = fileContent ? parseAmpSettingsJsonc(fileContent) : { [AMP_MCP_SERVERS_KEY]: {} };
|
|
8425
|
+
const filteredMcpServers = filterMcpServers(rulesyncMcp.getMcpServers());
|
|
8426
|
+
const newJson = { ...json, [AMP_MCP_SERVERS_KEY]: filteredMcpServers };
|
|
8427
|
+
return new _AmpMcp({
|
|
8428
|
+
outputRoot,
|
|
8429
|
+
relativeDirPath: basePaths.relativeDirPath,
|
|
8430
|
+
relativeFilePath,
|
|
8431
|
+
fileContent: JSON.stringify(newJson, null, 2),
|
|
8432
|
+
validate,
|
|
8433
|
+
global
|
|
8434
|
+
});
|
|
8435
|
+
}
|
|
8436
|
+
toRulesyncMcp() {
|
|
8437
|
+
const filtered = filterMcpServers(this.json[AMP_MCP_SERVERS_KEY]);
|
|
8438
|
+
return this.toRulesyncMcpDefault({
|
|
8439
|
+
fileContent: JSON.stringify({ mcpServers: filtered }, null, 2)
|
|
8440
|
+
});
|
|
8441
|
+
}
|
|
8442
|
+
validate() {
|
|
8443
|
+
let json;
|
|
8444
|
+
try {
|
|
8445
|
+
json = parseAmpSettingsJsonc(this.fileContent);
|
|
8446
|
+
} catch (error) {
|
|
8447
|
+
return {
|
|
8448
|
+
success: false,
|
|
8449
|
+
error: error instanceof Error ? error : new Error(String(error))
|
|
8450
|
+
};
|
|
8451
|
+
}
|
|
8452
|
+
for (const key of Object.keys(json)) {
|
|
8453
|
+
if (isPrototypePollutionKey(key)) {
|
|
8454
|
+
return {
|
|
8455
|
+
success: false,
|
|
8456
|
+
error: new Error(`Prototype pollution key "${key}" is not allowed`)
|
|
8457
|
+
};
|
|
8458
|
+
}
|
|
8459
|
+
}
|
|
8460
|
+
const mcpServers = json[AMP_MCP_SERVERS_KEY];
|
|
8461
|
+
if (mcpServers === void 0) {
|
|
8462
|
+
return { success: true, error: null };
|
|
8463
|
+
}
|
|
8464
|
+
if (!isRecord(mcpServers)) {
|
|
8465
|
+
return {
|
|
8466
|
+
success: false,
|
|
8467
|
+
error: new Error(`${AMP_MCP_SERVERS_KEY} must be a JSON object`)
|
|
8468
|
+
};
|
|
8469
|
+
}
|
|
8470
|
+
for (const [serverName, serverConfig] of Object.entries(mcpServers)) {
|
|
8471
|
+
if (isPrototypePollutionKey(serverName)) {
|
|
8472
|
+
return {
|
|
8473
|
+
success: false,
|
|
8474
|
+
error: new Error(
|
|
8475
|
+
`Server name "${serverName}" is a prototype pollution key and is not allowed`
|
|
8476
|
+
)
|
|
8477
|
+
};
|
|
8478
|
+
}
|
|
8479
|
+
if (!isRecord(serverConfig)) {
|
|
8480
|
+
return {
|
|
8481
|
+
success: false,
|
|
8482
|
+
error: new Error(`MCP server "${serverName}" must be a JSON object`)
|
|
8483
|
+
};
|
|
8484
|
+
}
|
|
8485
|
+
for (const key of Object.keys(serverConfig)) {
|
|
8486
|
+
if (isPrototypePollutionKey(key)) {
|
|
8487
|
+
return {
|
|
8488
|
+
success: false,
|
|
8489
|
+
error: new Error(
|
|
8490
|
+
`Config key "${key}" in server "${serverName}" is a prototype pollution key and is not allowed`
|
|
8491
|
+
)
|
|
8492
|
+
};
|
|
8493
|
+
}
|
|
8494
|
+
}
|
|
8495
|
+
}
|
|
8496
|
+
return { success: true, error: null };
|
|
8497
|
+
}
|
|
8498
|
+
/**
|
|
8499
|
+
* settings.json may contain other Amp settings, so it should not be deleted.
|
|
8500
|
+
*/
|
|
8501
|
+
isDeletable() {
|
|
8502
|
+
return false;
|
|
8503
|
+
}
|
|
8504
|
+
static forDeletion({
|
|
8505
|
+
outputRoot = process.cwd(),
|
|
8506
|
+
relativeDirPath,
|
|
8507
|
+
relativeFilePath,
|
|
8508
|
+
global = false
|
|
8509
|
+
}) {
|
|
8510
|
+
return new _AmpMcp({
|
|
8511
|
+
outputRoot,
|
|
8512
|
+
relativeDirPath,
|
|
8513
|
+
relativeFilePath,
|
|
8514
|
+
fileContent: "{}",
|
|
8515
|
+
validate: false,
|
|
8516
|
+
global
|
|
8517
|
+
});
|
|
8518
|
+
}
|
|
8519
|
+
};
|
|
8520
|
+
|
|
8315
8521
|
// src/features/mcp/antigravity-mcp.ts
|
|
8522
|
+
var import_node_path57 = require("path");
|
|
8316
8523
|
function renameServerField(servers, from, to) {
|
|
8317
8524
|
if (servers === null || typeof servers !== "object" || Array.isArray(servers)) {
|
|
8318
8525
|
return {};
|
|
@@ -8351,7 +8558,7 @@ var AntigravityMcp = class extends ToolMcp {
|
|
|
8351
8558
|
static getSettablePaths({ global } = {}) {
|
|
8352
8559
|
if (global) {
|
|
8353
8560
|
return {
|
|
8354
|
-
relativeDirPath: (0,
|
|
8561
|
+
relativeDirPath: (0, import_node_path57.join)(".gemini", this.getGlobalSubdir()),
|
|
8355
8562
|
relativeFilePath: "mcp_config.json"
|
|
8356
8563
|
};
|
|
8357
8564
|
}
|
|
@@ -8367,7 +8574,7 @@ var AntigravityMcp = class extends ToolMcp {
|
|
|
8367
8574
|
}) {
|
|
8368
8575
|
const paths = this.getSettablePaths({ global });
|
|
8369
8576
|
const fileContent = await readFileContentOrNull(
|
|
8370
|
-
(0,
|
|
8577
|
+
(0, import_node_path57.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
8371
8578
|
) ?? '{"mcpServers":{}}';
|
|
8372
8579
|
const json = JSON.parse(fileContent);
|
|
8373
8580
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
@@ -8388,7 +8595,7 @@ var AntigravityMcp = class extends ToolMcp {
|
|
|
8388
8595
|
}) {
|
|
8389
8596
|
const paths = this.getSettablePaths({ global });
|
|
8390
8597
|
const fileContent = await readOrInitializeFileContent(
|
|
8391
|
-
(0,
|
|
8598
|
+
(0, import_node_path57.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
8392
8599
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
8393
8600
|
);
|
|
8394
8601
|
const json = JSON.parse(fileContent);
|
|
@@ -8446,7 +8653,7 @@ var AntigravityIdeMcp = class extends AntigravityMcp {
|
|
|
8446
8653
|
};
|
|
8447
8654
|
|
|
8448
8655
|
// src/features/mcp/claudecode-mcp.ts
|
|
8449
|
-
var
|
|
8656
|
+
var import_node_path58 = require("path");
|
|
8450
8657
|
var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
8451
8658
|
json;
|
|
8452
8659
|
constructor(params) {
|
|
@@ -8492,7 +8699,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
8492
8699
|
logger
|
|
8493
8700
|
}) {
|
|
8494
8701
|
const paths = this.getSettablePaths({ global });
|
|
8495
|
-
const recommendedPath = (0,
|
|
8702
|
+
const recommendedPath = (0, import_node_path58.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
8496
8703
|
if (await fileExists(recommendedPath)) {
|
|
8497
8704
|
const fileContent = await readFileContent(recommendedPath);
|
|
8498
8705
|
const json = JSON.parse(fileContent);
|
|
@@ -8507,7 +8714,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
8507
8714
|
});
|
|
8508
8715
|
}
|
|
8509
8716
|
if (global) {
|
|
8510
|
-
const legacyPath = (0,
|
|
8717
|
+
const legacyPath = (0, import_node_path58.join)(
|
|
8511
8718
|
outputRoot,
|
|
8512
8719
|
_ClaudecodeMcp.LEGACY_GLOBAL_DIR,
|
|
8513
8720
|
_ClaudecodeMcp.LEGACY_GLOBAL_FILE
|
|
@@ -8546,7 +8753,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
8546
8753
|
}) {
|
|
8547
8754
|
const paths = this.getSettablePaths({ global });
|
|
8548
8755
|
const fileContent = await readOrInitializeFileContent(
|
|
8549
|
-
(0,
|
|
8756
|
+
(0, import_node_path58.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
8550
8757
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
8551
8758
|
);
|
|
8552
8759
|
const json = JSON.parse(fileContent);
|
|
@@ -8586,7 +8793,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
8586
8793
|
};
|
|
8587
8794
|
|
|
8588
8795
|
// src/features/mcp/cline-mcp.ts
|
|
8589
|
-
var
|
|
8796
|
+
var import_node_path59 = require("path");
|
|
8590
8797
|
var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
8591
8798
|
json;
|
|
8592
8799
|
constructor(params) {
|
|
@@ -8607,7 +8814,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
8607
8814
|
validate = true
|
|
8608
8815
|
}) {
|
|
8609
8816
|
const fileContent = await readFileContent(
|
|
8610
|
-
(0,
|
|
8817
|
+
(0, import_node_path59.join)(
|
|
8611
8818
|
outputRoot,
|
|
8612
8819
|
this.getSettablePaths().relativeDirPath,
|
|
8613
8820
|
this.getSettablePaths().relativeFilePath
|
|
@@ -8662,7 +8869,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
8662
8869
|
};
|
|
8663
8870
|
|
|
8664
8871
|
// src/features/mcp/codexcli-mcp.ts
|
|
8665
|
-
var
|
|
8872
|
+
var import_node_path60 = require("path");
|
|
8666
8873
|
var smolToml3 = __toESM(require("smol-toml"), 1);
|
|
8667
8874
|
var CODEX_TO_RULESYNC_FIELD_MAP = {
|
|
8668
8875
|
enabled_tools: "enabledTools",
|
|
@@ -8675,7 +8882,6 @@ var RULESYNC_TO_CODEX_FIELD_MAP = {
|
|
|
8675
8882
|
envVars: "env_vars"
|
|
8676
8883
|
};
|
|
8677
8884
|
var MAX_REMOVE_EMPTY_ENTRIES_DEPTH = 32;
|
|
8678
|
-
var PROTOTYPE_POLLUTION_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
8679
8885
|
function convertFromCodexFormat(codexMcp) {
|
|
8680
8886
|
const result = {};
|
|
8681
8887
|
for (const [name, config] of Object.entries(codexMcp)) {
|
|
@@ -8773,7 +8979,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
8773
8979
|
}) {
|
|
8774
8980
|
const paths = this.getSettablePaths({ global });
|
|
8775
8981
|
const fileContent = await readFileContentOrNull(
|
|
8776
|
-
(0,
|
|
8982
|
+
(0, import_node_path60.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
8777
8983
|
) ?? smolToml3.stringify({});
|
|
8778
8984
|
return new _CodexcliMcp({
|
|
8779
8985
|
outputRoot,
|
|
@@ -8790,7 +8996,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
8790
8996
|
global = false
|
|
8791
8997
|
}) {
|
|
8792
8998
|
const paths = this.getSettablePaths({ global });
|
|
8793
|
-
const configTomlFilePath = (0,
|
|
8999
|
+
const configTomlFilePath = (0, import_node_path60.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
8794
9000
|
const configTomlFileContent = await readOrInitializeFileContent(
|
|
8795
9001
|
configTomlFilePath,
|
|
8796
9002
|
smolToml3.stringify({})
|
|
@@ -8880,7 +9086,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
8880
9086
|
};
|
|
8881
9087
|
|
|
8882
9088
|
// src/features/mcp/copilot-mcp.ts
|
|
8883
|
-
var
|
|
9089
|
+
var import_node_path61 = require("path");
|
|
8884
9090
|
function convertToCopilotFormat(mcpServers) {
|
|
8885
9091
|
return { servers: mcpServers };
|
|
8886
9092
|
}
|
|
@@ -8907,7 +9113,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
8907
9113
|
validate = true
|
|
8908
9114
|
}) {
|
|
8909
9115
|
const fileContent = await readFileContent(
|
|
8910
|
-
(0,
|
|
9116
|
+
(0, import_node_path61.join)(
|
|
8911
9117
|
outputRoot,
|
|
8912
9118
|
this.getSettablePaths().relativeDirPath,
|
|
8913
9119
|
this.getSettablePaths().relativeFilePath
|
|
@@ -8960,7 +9166,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
8960
9166
|
};
|
|
8961
9167
|
|
|
8962
9168
|
// src/features/mcp/copilotcli-mcp.ts
|
|
8963
|
-
var
|
|
9169
|
+
var import_node_path62 = require("path");
|
|
8964
9170
|
var isRemoteServerType = (type) => {
|
|
8965
9171
|
return type === "http" || type === "sse";
|
|
8966
9172
|
};
|
|
@@ -9059,7 +9265,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
|
|
|
9059
9265
|
}) {
|
|
9060
9266
|
const paths = this.getSettablePaths({ global });
|
|
9061
9267
|
const fileContent = await readFileContentOrNull(
|
|
9062
|
-
(0,
|
|
9268
|
+
(0, import_node_path62.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
9063
9269
|
) ?? '{"mcpServers":{}}';
|
|
9064
9270
|
const json = JSON.parse(fileContent);
|
|
9065
9271
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
@@ -9080,7 +9286,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
|
|
|
9080
9286
|
}) {
|
|
9081
9287
|
const paths = this.getSettablePaths({ global });
|
|
9082
9288
|
const fileContent = await readOrInitializeFileContent(
|
|
9083
|
-
(0,
|
|
9289
|
+
(0, import_node_path62.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
9084
9290
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
9085
9291
|
);
|
|
9086
9292
|
const json = JSON.parse(fileContent);
|
|
@@ -9122,7 +9328,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
|
|
|
9122
9328
|
};
|
|
9123
9329
|
|
|
9124
9330
|
// src/features/mcp/cursor-mcp.ts
|
|
9125
|
-
var
|
|
9331
|
+
var import_node_path63 = require("path");
|
|
9126
9332
|
|
|
9127
9333
|
// src/features/mcp/mcp-env-var-format.ts
|
|
9128
9334
|
var CANONICAL_ENV_VAR_PATTERN = /\$\{(?!env:)([^}:]+)\}/g;
|
|
@@ -9193,7 +9399,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
9193
9399
|
this.json = JSON.parse(this.fileContent);
|
|
9194
9400
|
} catch (error) {
|
|
9195
9401
|
throw new Error(
|
|
9196
|
-
`Failed to parse Cursor MCP config at ${(0,
|
|
9402
|
+
`Failed to parse Cursor MCP config at ${(0, import_node_path63.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(error)}`,
|
|
9197
9403
|
{ cause: error }
|
|
9198
9404
|
);
|
|
9199
9405
|
}
|
|
@@ -9219,14 +9425,14 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
9219
9425
|
global = false
|
|
9220
9426
|
}) {
|
|
9221
9427
|
const paths = this.getSettablePaths({ global });
|
|
9222
|
-
const filePath = (0,
|
|
9428
|
+
const filePath = (0, import_node_path63.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
9223
9429
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"mcpServers":{}}';
|
|
9224
9430
|
let json;
|
|
9225
9431
|
try {
|
|
9226
9432
|
json = JSON.parse(fileContent);
|
|
9227
9433
|
} catch (error) {
|
|
9228
9434
|
throw new Error(
|
|
9229
|
-
`Failed to parse Cursor MCP config at ${(0,
|
|
9435
|
+
`Failed to parse Cursor MCP config at ${(0, import_node_path63.join)(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
|
|
9230
9436
|
{ cause: error }
|
|
9231
9437
|
);
|
|
9232
9438
|
}
|
|
@@ -9248,7 +9454,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
9248
9454
|
}) {
|
|
9249
9455
|
const paths = this.getSettablePaths({ global });
|
|
9250
9456
|
const fileContent = await readOrInitializeFileContent(
|
|
9251
|
-
(0,
|
|
9457
|
+
(0, import_node_path63.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
9252
9458
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
9253
9459
|
);
|
|
9254
9460
|
let json;
|
|
@@ -9256,7 +9462,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
9256
9462
|
json = JSON.parse(fileContent);
|
|
9257
9463
|
} catch (error) {
|
|
9258
9464
|
throw new Error(
|
|
9259
|
-
`Failed to parse Cursor MCP config at ${(0,
|
|
9465
|
+
`Failed to parse Cursor MCP config at ${(0, import_node_path63.join)(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
|
|
9260
9466
|
{ cause: error }
|
|
9261
9467
|
);
|
|
9262
9468
|
}
|
|
@@ -9310,7 +9516,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
9310
9516
|
};
|
|
9311
9517
|
|
|
9312
9518
|
// src/features/mcp/deepagents-mcp.ts
|
|
9313
|
-
var
|
|
9519
|
+
var import_node_path64 = require("path");
|
|
9314
9520
|
var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
|
|
9315
9521
|
json;
|
|
9316
9522
|
constructor(params) {
|
|
@@ -9336,7 +9542,7 @@ var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
|
|
|
9336
9542
|
}) {
|
|
9337
9543
|
const paths = this.getSettablePaths({ global });
|
|
9338
9544
|
const fileContent = await readFileContentOrNull(
|
|
9339
|
-
(0,
|
|
9545
|
+
(0, import_node_path64.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
9340
9546
|
) ?? '{"mcpServers":{}}';
|
|
9341
9547
|
const json = JSON.parse(fileContent);
|
|
9342
9548
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
@@ -9356,7 +9562,7 @@ var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
|
|
|
9356
9562
|
}) {
|
|
9357
9563
|
const paths = this.getSettablePaths({ global });
|
|
9358
9564
|
const fileContent = await readOrInitializeFileContent(
|
|
9359
|
-
(0,
|
|
9565
|
+
(0, import_node_path64.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
9360
9566
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
9361
9567
|
);
|
|
9362
9568
|
const json = JSON.parse(fileContent);
|
|
@@ -9395,7 +9601,7 @@ var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
|
|
|
9395
9601
|
};
|
|
9396
9602
|
|
|
9397
9603
|
// src/features/mcp/factorydroid-mcp.ts
|
|
9398
|
-
var
|
|
9604
|
+
var import_node_path65 = require("path");
|
|
9399
9605
|
var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
9400
9606
|
json;
|
|
9401
9607
|
constructor(params) {
|
|
@@ -9416,7 +9622,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
9416
9622
|
validate = true
|
|
9417
9623
|
}) {
|
|
9418
9624
|
const fileContent = await readFileContent(
|
|
9419
|
-
(0,
|
|
9625
|
+
(0, import_node_path65.join)(
|
|
9420
9626
|
outputRoot,
|
|
9421
9627
|
this.getSettablePaths().relativeDirPath,
|
|
9422
9628
|
this.getSettablePaths().relativeFilePath
|
|
@@ -9470,7 +9676,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
9470
9676
|
};
|
|
9471
9677
|
|
|
9472
9678
|
// src/features/mcp/geminicli-mcp.ts
|
|
9473
|
-
var
|
|
9679
|
+
var import_node_path66 = require("path");
|
|
9474
9680
|
var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
9475
9681
|
json;
|
|
9476
9682
|
constructor(params) {
|
|
@@ -9499,7 +9705,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
9499
9705
|
}) {
|
|
9500
9706
|
const paths = this.getSettablePaths({ global });
|
|
9501
9707
|
const fileContent = await readFileContentOrNull(
|
|
9502
|
-
(0,
|
|
9708
|
+
(0, import_node_path66.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
9503
9709
|
) ?? '{"mcpServers":{}}';
|
|
9504
9710
|
const json = JSON.parse(fileContent);
|
|
9505
9711
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
@@ -9519,7 +9725,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
9519
9725
|
}) {
|
|
9520
9726
|
const paths = this.getSettablePaths({ global });
|
|
9521
9727
|
const fileContent = await readOrInitializeFileContent(
|
|
9522
|
-
(0,
|
|
9728
|
+
(0, import_node_path66.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
9523
9729
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
9524
9730
|
);
|
|
9525
9731
|
const json = JSON.parse(fileContent);
|
|
@@ -9564,7 +9770,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
9564
9770
|
};
|
|
9565
9771
|
|
|
9566
9772
|
// src/features/mcp/junie-mcp.ts
|
|
9567
|
-
var
|
|
9773
|
+
var import_node_path67 = require("path");
|
|
9568
9774
|
var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
9569
9775
|
json;
|
|
9570
9776
|
constructor(params) {
|
|
@@ -9576,7 +9782,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
9576
9782
|
}
|
|
9577
9783
|
static getSettablePaths() {
|
|
9578
9784
|
return {
|
|
9579
|
-
relativeDirPath: (0,
|
|
9785
|
+
relativeDirPath: (0, import_node_path67.join)(".junie", "mcp"),
|
|
9580
9786
|
relativeFilePath: "mcp.json"
|
|
9581
9787
|
};
|
|
9582
9788
|
}
|
|
@@ -9585,7 +9791,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
9585
9791
|
validate = true
|
|
9586
9792
|
}) {
|
|
9587
9793
|
const fileContent = await readFileContent(
|
|
9588
|
-
(0,
|
|
9794
|
+
(0, import_node_path67.join)(
|
|
9589
9795
|
outputRoot,
|
|
9590
9796
|
this.getSettablePaths().relativeDirPath,
|
|
9591
9797
|
this.getSettablePaths().relativeFilePath
|
|
@@ -9640,8 +9846,8 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
9640
9846
|
};
|
|
9641
9847
|
|
|
9642
9848
|
// src/features/mcp/kilo-mcp.ts
|
|
9643
|
-
var
|
|
9644
|
-
var
|
|
9849
|
+
var import_node_path68 = require("path");
|
|
9850
|
+
var import_jsonc_parser4 = require("jsonc-parser");
|
|
9645
9851
|
var import_mini27 = require("zod/mini");
|
|
9646
9852
|
var KiloMcpLocalServerSchema = import_mini27.z.object({
|
|
9647
9853
|
type: import_mini27.z.literal("local"),
|
|
@@ -9764,7 +9970,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9764
9970
|
json;
|
|
9765
9971
|
constructor(params) {
|
|
9766
9972
|
super(params);
|
|
9767
|
-
this.json = KiloConfigSchema.parse((0,
|
|
9973
|
+
this.json = KiloConfigSchema.parse((0, import_jsonc_parser4.parse)(this.fileContent || "{}"));
|
|
9768
9974
|
}
|
|
9769
9975
|
getJson() {
|
|
9770
9976
|
return this.json;
|
|
@@ -9778,7 +9984,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9778
9984
|
static getSettablePaths({ global } = {}) {
|
|
9779
9985
|
if (global) {
|
|
9780
9986
|
return {
|
|
9781
|
-
relativeDirPath: (0,
|
|
9987
|
+
relativeDirPath: (0, import_node_path68.join)(".config", "kilo"),
|
|
9782
9988
|
relativeFilePath: "kilo.json"
|
|
9783
9989
|
};
|
|
9784
9990
|
}
|
|
@@ -9793,11 +9999,11 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9793
9999
|
global = false
|
|
9794
10000
|
}) {
|
|
9795
10001
|
const basePaths = this.getSettablePaths({ global });
|
|
9796
|
-
const jsonDir = (0,
|
|
10002
|
+
const jsonDir = (0, import_node_path68.join)(outputRoot, basePaths.relativeDirPath);
|
|
9797
10003
|
let fileContent = null;
|
|
9798
10004
|
let relativeFilePath = "kilo.jsonc";
|
|
9799
|
-
const jsoncPath = (0,
|
|
9800
|
-
const jsonPath = (0,
|
|
10005
|
+
const jsoncPath = (0, import_node_path68.join)(jsonDir, "kilo.jsonc");
|
|
10006
|
+
const jsonPath = (0, import_node_path68.join)(jsonDir, "kilo.json");
|
|
9801
10007
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
9802
10008
|
if (!fileContent) {
|
|
9803
10009
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -9806,7 +10012,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9806
10012
|
}
|
|
9807
10013
|
}
|
|
9808
10014
|
const fileContentToUse = fileContent ?? '{"mcp":{}}';
|
|
9809
|
-
const json = (0,
|
|
10015
|
+
const json = (0, import_jsonc_parser4.parse)(fileContentToUse);
|
|
9810
10016
|
const newJson = { ...json, mcp: json.mcp ?? {} };
|
|
9811
10017
|
return new _KiloMcp({
|
|
9812
10018
|
outputRoot,
|
|
@@ -9823,11 +10029,11 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9823
10029
|
global = false
|
|
9824
10030
|
}) {
|
|
9825
10031
|
const basePaths = this.getSettablePaths({ global });
|
|
9826
|
-
const jsonDir = (0,
|
|
10032
|
+
const jsonDir = (0, import_node_path68.join)(outputRoot, basePaths.relativeDirPath);
|
|
9827
10033
|
let fileContent = null;
|
|
9828
10034
|
let relativeFilePath = "kilo.jsonc";
|
|
9829
|
-
const jsoncPath = (0,
|
|
9830
|
-
const jsonPath = (0,
|
|
10035
|
+
const jsoncPath = (0, import_node_path68.join)(jsonDir, "kilo.jsonc");
|
|
10036
|
+
const jsonPath = (0, import_node_path68.join)(jsonDir, "kilo.json");
|
|
9831
10037
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
9832
10038
|
if (!fileContent) {
|
|
9833
10039
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -9838,7 +10044,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9838
10044
|
if (!fileContent) {
|
|
9839
10045
|
fileContent = JSON.stringify({ mcp: {} }, null, 2);
|
|
9840
10046
|
}
|
|
9841
|
-
const json = (0,
|
|
10047
|
+
const json = (0, import_jsonc_parser4.parse)(fileContent);
|
|
9842
10048
|
const { mcp: convertedMcp, tools: mcpTools } = convertToKiloFormat(rulesyncMcp.getMcpServers());
|
|
9843
10049
|
const { tools: _existingTools, ...jsonWithoutTools } = json;
|
|
9844
10050
|
const newJson = {
|
|
@@ -9886,7 +10092,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9886
10092
|
};
|
|
9887
10093
|
|
|
9888
10094
|
// src/features/mcp/kiro-mcp.ts
|
|
9889
|
-
var
|
|
10095
|
+
var import_node_path69 = require("path");
|
|
9890
10096
|
var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
9891
10097
|
json;
|
|
9892
10098
|
constructor(params) {
|
|
@@ -9898,7 +10104,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
9898
10104
|
}
|
|
9899
10105
|
static getSettablePaths() {
|
|
9900
10106
|
return {
|
|
9901
|
-
relativeDirPath: (0,
|
|
10107
|
+
relativeDirPath: (0, import_node_path69.join)(".kiro", "settings"),
|
|
9902
10108
|
relativeFilePath: "mcp.json"
|
|
9903
10109
|
};
|
|
9904
10110
|
}
|
|
@@ -9908,7 +10114,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
9908
10114
|
}) {
|
|
9909
10115
|
const paths = this.getSettablePaths();
|
|
9910
10116
|
const fileContent = await readFileContentOrNull(
|
|
9911
|
-
(0,
|
|
10117
|
+
(0, import_node_path69.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
9912
10118
|
) ?? '{"mcpServers":{}}';
|
|
9913
10119
|
return new _KiroMcp({
|
|
9914
10120
|
outputRoot,
|
|
@@ -9957,8 +10163,8 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
9957
10163
|
};
|
|
9958
10164
|
|
|
9959
10165
|
// src/features/mcp/opencode-mcp.ts
|
|
9960
|
-
var
|
|
9961
|
-
var
|
|
10166
|
+
var import_node_path70 = require("path");
|
|
10167
|
+
var import_jsonc_parser5 = require("jsonc-parser");
|
|
9962
10168
|
var import_mini28 = require("zod/mini");
|
|
9963
10169
|
var OPENCODE_ENV_VAR_PATTERN = /(?<!\$)\{env:([^}:]+)\}/g;
|
|
9964
10170
|
var OpencodeMcpLocalServerSchema = import_mini28.z.object({
|
|
@@ -10085,7 +10291,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10085
10291
|
json;
|
|
10086
10292
|
constructor(params) {
|
|
10087
10293
|
super(params);
|
|
10088
|
-
this.json = OpencodeConfigSchema.parse((0,
|
|
10294
|
+
this.json = OpencodeConfigSchema.parse((0, import_jsonc_parser5.parse)(this.fileContent || "{}"));
|
|
10089
10295
|
}
|
|
10090
10296
|
getJson() {
|
|
10091
10297
|
return this.json;
|
|
@@ -10099,7 +10305,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10099
10305
|
static getSettablePaths({ global } = {}) {
|
|
10100
10306
|
if (global) {
|
|
10101
10307
|
return {
|
|
10102
|
-
relativeDirPath: (0,
|
|
10308
|
+
relativeDirPath: (0, import_node_path70.join)(".config", "opencode"),
|
|
10103
10309
|
relativeFilePath: "opencode.json"
|
|
10104
10310
|
};
|
|
10105
10311
|
}
|
|
@@ -10114,11 +10320,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10114
10320
|
global = false
|
|
10115
10321
|
}) {
|
|
10116
10322
|
const basePaths = this.getSettablePaths({ global });
|
|
10117
|
-
const jsonDir = (0,
|
|
10323
|
+
const jsonDir = (0, import_node_path70.join)(outputRoot, basePaths.relativeDirPath);
|
|
10118
10324
|
let fileContent = null;
|
|
10119
10325
|
let relativeFilePath = "opencode.jsonc";
|
|
10120
|
-
const jsoncPath = (0,
|
|
10121
|
-
const jsonPath = (0,
|
|
10326
|
+
const jsoncPath = (0, import_node_path70.join)(jsonDir, "opencode.jsonc");
|
|
10327
|
+
const jsonPath = (0, import_node_path70.join)(jsonDir, "opencode.json");
|
|
10122
10328
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
10123
10329
|
if (!fileContent) {
|
|
10124
10330
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -10127,7 +10333,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10127
10333
|
}
|
|
10128
10334
|
}
|
|
10129
10335
|
const fileContentToUse = fileContent ?? '{"mcp":{}}';
|
|
10130
|
-
const json = (0,
|
|
10336
|
+
const json = (0, import_jsonc_parser5.parse)(fileContentToUse);
|
|
10131
10337
|
const newJson = { ...json, mcp: json.mcp ?? {} };
|
|
10132
10338
|
return new _OpencodeMcp({
|
|
10133
10339
|
outputRoot,
|
|
@@ -10144,11 +10350,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10144
10350
|
global = false
|
|
10145
10351
|
}) {
|
|
10146
10352
|
const basePaths = this.getSettablePaths({ global });
|
|
10147
|
-
const jsonDir = (0,
|
|
10353
|
+
const jsonDir = (0, import_node_path70.join)(outputRoot, basePaths.relativeDirPath);
|
|
10148
10354
|
let fileContent = null;
|
|
10149
10355
|
let relativeFilePath = "opencode.jsonc";
|
|
10150
|
-
const jsoncPath = (0,
|
|
10151
|
-
const jsonPath = (0,
|
|
10356
|
+
const jsoncPath = (0, import_node_path70.join)(jsonDir, "opencode.jsonc");
|
|
10357
|
+
const jsonPath = (0, import_node_path70.join)(jsonDir, "opencode.json");
|
|
10152
10358
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
10153
10359
|
if (!fileContent) {
|
|
10154
10360
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -10159,7 +10365,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10159
10365
|
if (!fileContent) {
|
|
10160
10366
|
fileContent = JSON.stringify({ mcp: {} }, null, 2);
|
|
10161
10367
|
}
|
|
10162
|
-
const json = (0,
|
|
10368
|
+
const json = (0, import_jsonc_parser5.parse)(fileContent);
|
|
10163
10369
|
const mcpServers = rulesyncMcp.getMcpServers();
|
|
10164
10370
|
const transformedServers = convertEnvVarRefsToToolFormat({
|
|
10165
10371
|
mcpServers,
|
|
@@ -10216,7 +10422,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10216
10422
|
};
|
|
10217
10423
|
|
|
10218
10424
|
// src/features/mcp/roo-mcp.ts
|
|
10219
|
-
var
|
|
10425
|
+
var import_node_path71 = require("path");
|
|
10220
10426
|
function convertToRooFormat(mcpServers) {
|
|
10221
10427
|
return Object.fromEntries(
|
|
10222
10428
|
Object.entries(mcpServers).map(([serverName, serverConfig]) => {
|
|
@@ -10268,7 +10474,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
10268
10474
|
validate = true
|
|
10269
10475
|
}) {
|
|
10270
10476
|
const fileContent = await readFileContent(
|
|
10271
|
-
(0,
|
|
10477
|
+
(0, import_node_path71.join)(
|
|
10272
10478
|
outputRoot,
|
|
10273
10479
|
this.getSettablePaths().relativeDirPath,
|
|
10274
10480
|
this.getSettablePaths().relativeFilePath
|
|
@@ -10323,9 +10529,9 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
10323
10529
|
};
|
|
10324
10530
|
|
|
10325
10531
|
// src/features/mcp/rovodev-mcp.ts
|
|
10326
|
-
var
|
|
10532
|
+
var import_node_path72 = require("path");
|
|
10327
10533
|
function parseRovodevMcpJson(fileContent, relativeDirPath, relativeFilePath) {
|
|
10328
|
-
const configPath = (0,
|
|
10534
|
+
const configPath = (0, import_node_path72.join)(relativeDirPath, relativeFilePath);
|
|
10329
10535
|
let parsed;
|
|
10330
10536
|
try {
|
|
10331
10537
|
parsed = JSON.parse(fileContent);
|
|
@@ -10374,7 +10580,7 @@ var RovodevMcp = class _RovodevMcp extends ToolMcp {
|
|
|
10374
10580
|
throw new Error("Rovodev MCP is global-only; use --global to sync ~/.rovodev/mcp.json");
|
|
10375
10581
|
}
|
|
10376
10582
|
const paths = this.getSettablePaths({ global });
|
|
10377
|
-
const filePath = (0,
|
|
10583
|
+
const filePath = (0, import_node_path72.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
10378
10584
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"mcpServers":{}}';
|
|
10379
10585
|
const json = parseRovodevMcpJson(fileContent, paths.relativeDirPath, paths.relativeFilePath);
|
|
10380
10586
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
@@ -10398,7 +10604,7 @@ var RovodevMcp = class _RovodevMcp extends ToolMcp {
|
|
|
10398
10604
|
}
|
|
10399
10605
|
const paths = this.getSettablePaths({ global });
|
|
10400
10606
|
const fileContent = await readOrInitializeFileContent(
|
|
10401
|
-
(0,
|
|
10607
|
+
(0, import_node_path72.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
10402
10608
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
10403
10609
|
);
|
|
10404
10610
|
const json = parseRovodevMcpJson(fileContent, paths.relativeDirPath, paths.relativeFilePath);
|
|
@@ -10439,8 +10645,101 @@ var RovodevMcp = class _RovodevMcp extends ToolMcp {
|
|
|
10439
10645
|
}
|
|
10440
10646
|
};
|
|
10441
10647
|
|
|
10648
|
+
// src/features/mcp/warp-mcp.ts
|
|
10649
|
+
var import_node_path73 = require("path");
|
|
10650
|
+
var WarpMcp = class _WarpMcp extends ToolMcp {
|
|
10651
|
+
json;
|
|
10652
|
+
constructor(params) {
|
|
10653
|
+
super(params);
|
|
10654
|
+
this.json = this.fileContent !== void 0 ? _WarpMcp.parseJsonOrThrow(this.fileContent, this.relativeDirPath, this.relativeFilePath) : {};
|
|
10655
|
+
}
|
|
10656
|
+
getJson() {
|
|
10657
|
+
return this.json;
|
|
10658
|
+
}
|
|
10659
|
+
static parseJsonOrThrow(content, relativeDirPath, relativeFilePath) {
|
|
10660
|
+
try {
|
|
10661
|
+
return JSON.parse(content);
|
|
10662
|
+
} catch (error) {
|
|
10663
|
+
throw new Error(
|
|
10664
|
+
`Failed to parse Warp MCP config at ${(0, import_node_path73.join)(relativeDirPath, relativeFilePath)}: ${formatError(error)}`,
|
|
10665
|
+
{ cause: error }
|
|
10666
|
+
);
|
|
10667
|
+
}
|
|
10668
|
+
}
|
|
10669
|
+
static getSettablePaths(_options) {
|
|
10670
|
+
return {
|
|
10671
|
+
relativeDirPath: ".warp",
|
|
10672
|
+
relativeFilePath: ".mcp.json"
|
|
10673
|
+
};
|
|
10674
|
+
}
|
|
10675
|
+
static async fromFile({
|
|
10676
|
+
outputRoot = process.cwd(),
|
|
10677
|
+
validate = true,
|
|
10678
|
+
global = false
|
|
10679
|
+
}) {
|
|
10680
|
+
const paths = this.getSettablePaths({ global });
|
|
10681
|
+
const filePath = (0, import_node_path73.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
10682
|
+
const fileContent = await readFileContentOrNull(filePath) ?? '{"mcpServers":{}}';
|
|
10683
|
+
const json = this.parseJsonOrThrow(fileContent, paths.relativeDirPath, paths.relativeFilePath);
|
|
10684
|
+
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
10685
|
+
return new _WarpMcp({
|
|
10686
|
+
outputRoot,
|
|
10687
|
+
relativeDirPath: paths.relativeDirPath,
|
|
10688
|
+
relativeFilePath: paths.relativeFilePath,
|
|
10689
|
+
fileContent: JSON.stringify(newJson, null, 2),
|
|
10690
|
+
validate,
|
|
10691
|
+
global
|
|
10692
|
+
});
|
|
10693
|
+
}
|
|
10694
|
+
static async fromRulesyncMcp({
|
|
10695
|
+
outputRoot = process.cwd(),
|
|
10696
|
+
rulesyncMcp,
|
|
10697
|
+
validate = true,
|
|
10698
|
+
global = false
|
|
10699
|
+
}) {
|
|
10700
|
+
const paths = this.getSettablePaths({ global });
|
|
10701
|
+
const fileContent = await readOrInitializeFileContent(
|
|
10702
|
+
(0, import_node_path73.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
10703
|
+
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
10704
|
+
);
|
|
10705
|
+
const json = this.parseJsonOrThrow(fileContent, paths.relativeDirPath, paths.relativeFilePath);
|
|
10706
|
+
const warpConfig = { ...json, mcpServers: rulesyncMcp.getMcpServers() };
|
|
10707
|
+
return new _WarpMcp({
|
|
10708
|
+
outputRoot,
|
|
10709
|
+
relativeDirPath: paths.relativeDirPath,
|
|
10710
|
+
relativeFilePath: paths.relativeFilePath,
|
|
10711
|
+
fileContent: JSON.stringify(warpConfig, null, 2),
|
|
10712
|
+
validate,
|
|
10713
|
+
global
|
|
10714
|
+
});
|
|
10715
|
+
}
|
|
10716
|
+
toRulesyncMcp() {
|
|
10717
|
+
return this.toRulesyncMcpDefault({
|
|
10718
|
+
fileContent: JSON.stringify({ mcpServers: this.json.mcpServers ?? {} }, null, 2)
|
|
10719
|
+
});
|
|
10720
|
+
}
|
|
10721
|
+
validate() {
|
|
10722
|
+
return { success: true, error: null };
|
|
10723
|
+
}
|
|
10724
|
+
static forDeletion({
|
|
10725
|
+
outputRoot = process.cwd(),
|
|
10726
|
+
relativeDirPath,
|
|
10727
|
+
relativeFilePath,
|
|
10728
|
+
global = false
|
|
10729
|
+
}) {
|
|
10730
|
+
return new _WarpMcp({
|
|
10731
|
+
outputRoot,
|
|
10732
|
+
relativeDirPath,
|
|
10733
|
+
relativeFilePath,
|
|
10734
|
+
fileContent: "{}",
|
|
10735
|
+
validate: false,
|
|
10736
|
+
global
|
|
10737
|
+
});
|
|
10738
|
+
}
|
|
10739
|
+
};
|
|
10740
|
+
|
|
10442
10741
|
// src/features/mcp/zed-mcp.ts
|
|
10443
|
-
var
|
|
10742
|
+
var import_node_path74 = require("path");
|
|
10444
10743
|
var ZedMcp = class _ZedMcp extends ToolMcp {
|
|
10445
10744
|
json;
|
|
10446
10745
|
constructor(params) {
|
|
@@ -10453,7 +10752,7 @@ var ZedMcp = class _ZedMcp extends ToolMcp {
|
|
|
10453
10752
|
static getSettablePaths({ global } = {}) {
|
|
10454
10753
|
if (global) {
|
|
10455
10754
|
return {
|
|
10456
|
-
relativeDirPath: (0,
|
|
10755
|
+
relativeDirPath: (0, import_node_path74.join)(".config", "zed"),
|
|
10457
10756
|
relativeFilePath: "settings.json"
|
|
10458
10757
|
};
|
|
10459
10758
|
}
|
|
@@ -10469,7 +10768,7 @@ var ZedMcp = class _ZedMcp extends ToolMcp {
|
|
|
10469
10768
|
}) {
|
|
10470
10769
|
const paths = this.getSettablePaths({ global });
|
|
10471
10770
|
const fileContent = await readFileContentOrNull(
|
|
10472
|
-
(0,
|
|
10771
|
+
(0, import_node_path74.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
10473
10772
|
) ?? "{}";
|
|
10474
10773
|
const json = JSON.parse(fileContent);
|
|
10475
10774
|
const newJson = { ...json, context_servers: json.context_servers ?? {} };
|
|
@@ -10489,7 +10788,7 @@ var ZedMcp = class _ZedMcp extends ToolMcp {
|
|
|
10489
10788
|
}) {
|
|
10490
10789
|
const paths = this.getSettablePaths({ global });
|
|
10491
10790
|
const fileContent = await readOrInitializeFileContent(
|
|
10492
|
-
(0,
|
|
10791
|
+
(0, import_node_path74.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
10493
10792
|
"{}"
|
|
10494
10793
|
);
|
|
10495
10794
|
const json = JSON.parse(fileContent);
|
|
@@ -10536,6 +10835,7 @@ var ZedMcp = class _ZedMcp extends ToolMcp {
|
|
|
10536
10835
|
|
|
10537
10836
|
// src/features/mcp/mcp-processor.ts
|
|
10538
10837
|
var mcpProcessorToolTargetTuple = [
|
|
10838
|
+
"amp",
|
|
10539
10839
|
"antigravity-cli",
|
|
10540
10840
|
"antigravity-ide",
|
|
10541
10841
|
"claudecode",
|
|
@@ -10554,10 +10854,23 @@ var mcpProcessorToolTargetTuple = [
|
|
|
10554
10854
|
"opencode",
|
|
10555
10855
|
"roo",
|
|
10556
10856
|
"rovodev",
|
|
10857
|
+
"warp",
|
|
10557
10858
|
"zed"
|
|
10558
10859
|
];
|
|
10559
10860
|
var McpProcessorToolTargetSchema = import_mini29.z.enum(mcpProcessorToolTargetTuple);
|
|
10560
10861
|
var toolMcpFactories = /* @__PURE__ */ new Map([
|
|
10862
|
+
[
|
|
10863
|
+
"amp",
|
|
10864
|
+
{
|
|
10865
|
+
class: AmpMcp,
|
|
10866
|
+
meta: {
|
|
10867
|
+
supportsProject: true,
|
|
10868
|
+
supportsGlobal: true,
|
|
10869
|
+
supportsEnabledTools: false,
|
|
10870
|
+
supportsDisabledTools: false
|
|
10871
|
+
}
|
|
10872
|
+
}
|
|
10873
|
+
],
|
|
10561
10874
|
[
|
|
10562
10875
|
"antigravity-cli",
|
|
10563
10876
|
{
|
|
@@ -10780,6 +11093,18 @@ var toolMcpFactories = /* @__PURE__ */ new Map([
|
|
|
10780
11093
|
}
|
|
10781
11094
|
}
|
|
10782
11095
|
],
|
|
11096
|
+
[
|
|
11097
|
+
"warp",
|
|
11098
|
+
{
|
|
11099
|
+
class: WarpMcp,
|
|
11100
|
+
meta: {
|
|
11101
|
+
supportsProject: true,
|
|
11102
|
+
supportsGlobal: true,
|
|
11103
|
+
supportsEnabledTools: false,
|
|
11104
|
+
supportsDisabledTools: false
|
|
11105
|
+
}
|
|
11106
|
+
}
|
|
11107
|
+
],
|
|
10783
11108
|
[
|
|
10784
11109
|
"zed",
|
|
10785
11110
|
{
|
|
@@ -10942,11 +11267,11 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
10942
11267
|
var import_mini38 = require("zod/mini");
|
|
10943
11268
|
|
|
10944
11269
|
// src/features/permissions/antigravity-cli-permissions.ts
|
|
10945
|
-
var
|
|
11270
|
+
var import_node_path76 = require("path");
|
|
10946
11271
|
var import_es_toolkit4 = require("es-toolkit");
|
|
10947
11272
|
|
|
10948
11273
|
// src/features/permissions/rulesync-permissions.ts
|
|
10949
|
-
var
|
|
11274
|
+
var import_node_path75 = require("path");
|
|
10950
11275
|
|
|
10951
11276
|
// src/types/permissions.ts
|
|
10952
11277
|
var import_mini30 = require("zod/mini");
|
|
@@ -10991,7 +11316,7 @@ var RulesyncPermissions = class _RulesyncPermissions extends RulesyncFile {
|
|
|
10991
11316
|
validate = true
|
|
10992
11317
|
}) {
|
|
10993
11318
|
const paths = _RulesyncPermissions.getSettablePaths();
|
|
10994
|
-
const filePath = (0,
|
|
11319
|
+
const filePath = (0, import_node_path75.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
10995
11320
|
if (!await fileExists(filePath)) {
|
|
10996
11321
|
throw new Error(`No ${RULESYNC_PERMISSIONS_RELATIVE_FILE_PATH} found.`);
|
|
10997
11322
|
}
|
|
@@ -11081,7 +11406,7 @@ var AntigravityCliPermissions = class _AntigravityCliPermissions extends ToolPer
|
|
|
11081
11406
|
}
|
|
11082
11407
|
static getSettablePaths() {
|
|
11083
11408
|
return {
|
|
11084
|
-
relativeDirPath: (0,
|
|
11409
|
+
relativeDirPath: (0, import_node_path76.join)(".gemini", "antigravity-cli"),
|
|
11085
11410
|
relativeFilePath: "settings.json"
|
|
11086
11411
|
};
|
|
11087
11412
|
}
|
|
@@ -11090,7 +11415,7 @@ var AntigravityCliPermissions = class _AntigravityCliPermissions extends ToolPer
|
|
|
11090
11415
|
validate = true
|
|
11091
11416
|
}) {
|
|
11092
11417
|
const paths = _AntigravityCliPermissions.getSettablePaths();
|
|
11093
|
-
const filePath = (0,
|
|
11418
|
+
const filePath = (0, import_node_path76.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11094
11419
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"permissions":{}}';
|
|
11095
11420
|
return new _AntigravityCliPermissions({
|
|
11096
11421
|
outputRoot,
|
|
@@ -11106,7 +11431,7 @@ var AntigravityCliPermissions = class _AntigravityCliPermissions extends ToolPer
|
|
|
11106
11431
|
rulesyncPermissions
|
|
11107
11432
|
}) {
|
|
11108
11433
|
const paths = _AntigravityCliPermissions.getSettablePaths();
|
|
11109
|
-
const filePath = (0,
|
|
11434
|
+
const filePath = (0, import_node_path76.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11110
11435
|
const existingContent = await readOrInitializeFileContent(
|
|
11111
11436
|
filePath,
|
|
11112
11437
|
JSON.stringify({}, null, 2)
|
|
@@ -11173,7 +11498,7 @@ var AntigravityCliPermissions = class _AntigravityCliPermissions extends ToolPer
|
|
|
11173
11498
|
settings = JSON.parse(this.getFileContent());
|
|
11174
11499
|
} catch (error) {
|
|
11175
11500
|
throw new Error(
|
|
11176
|
-
`Failed to parse Antigravity CLI permissions content in ${(0,
|
|
11501
|
+
`Failed to parse Antigravity CLI permissions content in ${(0, import_node_path76.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
11177
11502
|
{ cause: error }
|
|
11178
11503
|
);
|
|
11179
11504
|
}
|
|
@@ -11247,7 +11572,7 @@ function convertAntigravityCliToRulesyncPermissions(params) {
|
|
|
11247
11572
|
}
|
|
11248
11573
|
|
|
11249
11574
|
// src/features/permissions/augmentcode-permissions.ts
|
|
11250
|
-
var
|
|
11575
|
+
var import_node_path77 = require("path");
|
|
11251
11576
|
var import_mini31 = require("zod/mini");
|
|
11252
11577
|
var moduleLogger = new ConsoleLogger();
|
|
11253
11578
|
var AugmentPermissionTypeSchema = import_mini31.z.enum(["allow", "deny", "ask-user"]);
|
|
@@ -11397,7 +11722,7 @@ var AugmentcodePermissions = class _AugmentcodePermissions extends ToolPermissio
|
|
|
11397
11722
|
global = false
|
|
11398
11723
|
}) {
|
|
11399
11724
|
const paths = _AugmentcodePermissions.getSettablePaths({ global });
|
|
11400
|
-
const filePath = (0,
|
|
11725
|
+
const filePath = (0, import_node_path77.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11401
11726
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"toolPermissions":[]}';
|
|
11402
11727
|
return new _AugmentcodePermissions({
|
|
11403
11728
|
outputRoot,
|
|
@@ -11414,7 +11739,7 @@ var AugmentcodePermissions = class _AugmentcodePermissions extends ToolPermissio
|
|
|
11414
11739
|
logger
|
|
11415
11740
|
}) {
|
|
11416
11741
|
const paths = _AugmentcodePermissions.getSettablePaths({ global });
|
|
11417
|
-
const filePath = (0,
|
|
11742
|
+
const filePath = (0, import_node_path77.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11418
11743
|
const existingContent = await readFileContentOrNull(filePath) ?? "{}";
|
|
11419
11744
|
let settings;
|
|
11420
11745
|
try {
|
|
@@ -11469,7 +11794,7 @@ var AugmentcodePermissions = class _AugmentcodePermissions extends ToolPermissio
|
|
|
11469
11794
|
settings = result.data;
|
|
11470
11795
|
} catch (error) {
|
|
11471
11796
|
throw new Error(
|
|
11472
|
-
`Failed to parse AugmentCode permissions content in ${(0,
|
|
11797
|
+
`Failed to parse AugmentCode permissions content in ${(0, import_node_path77.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
11473
11798
|
{ cause: error }
|
|
11474
11799
|
);
|
|
11475
11800
|
}
|
|
@@ -11637,7 +11962,7 @@ function convertAugmentToRulesyncPermissions({
|
|
|
11637
11962
|
}
|
|
11638
11963
|
|
|
11639
11964
|
// src/features/permissions/claudecode-permissions.ts
|
|
11640
|
-
var
|
|
11965
|
+
var import_node_path78 = require("path");
|
|
11641
11966
|
var import_es_toolkit5 = require("es-toolkit");
|
|
11642
11967
|
var CANONICAL_TO_CLAUDE_TOOL_NAMES = {
|
|
11643
11968
|
bash: "Bash",
|
|
@@ -11699,7 +12024,7 @@ var ClaudecodePermissions = class _ClaudecodePermissions extends ToolPermissions
|
|
|
11699
12024
|
validate = true
|
|
11700
12025
|
}) {
|
|
11701
12026
|
const paths = _ClaudecodePermissions.getSettablePaths();
|
|
11702
|
-
const filePath = (0,
|
|
12027
|
+
const filePath = (0, import_node_path78.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11703
12028
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"permissions":{}}';
|
|
11704
12029
|
return new _ClaudecodePermissions({
|
|
11705
12030
|
outputRoot,
|
|
@@ -11715,7 +12040,7 @@ var ClaudecodePermissions = class _ClaudecodePermissions extends ToolPermissions
|
|
|
11715
12040
|
logger
|
|
11716
12041
|
}) {
|
|
11717
12042
|
const paths = _ClaudecodePermissions.getSettablePaths();
|
|
11718
|
-
const filePath = (0,
|
|
12043
|
+
const filePath = (0, import_node_path78.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11719
12044
|
const existingContent = await readOrInitializeFileContent(
|
|
11720
12045
|
filePath,
|
|
11721
12046
|
JSON.stringify({}, null, 2)
|
|
@@ -11792,7 +12117,7 @@ var ClaudecodePermissions = class _ClaudecodePermissions extends ToolPermissions
|
|
|
11792
12117
|
settings = JSON.parse(this.getFileContent());
|
|
11793
12118
|
} catch (error) {
|
|
11794
12119
|
throw new Error(
|
|
11795
|
-
`Failed to parse Claude permissions content in ${(0,
|
|
12120
|
+
`Failed to parse Claude permissions content in ${(0, import_node_path78.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
11796
12121
|
{ cause: error }
|
|
11797
12122
|
);
|
|
11798
12123
|
}
|
|
@@ -11865,7 +12190,7 @@ function convertClaudeToRulesyncPermissions(params) {
|
|
|
11865
12190
|
}
|
|
11866
12191
|
|
|
11867
12192
|
// src/features/permissions/cline-permissions.ts
|
|
11868
|
-
var
|
|
12193
|
+
var import_node_path79 = require("path");
|
|
11869
12194
|
var import_es_toolkit6 = require("es-toolkit");
|
|
11870
12195
|
var import_mini32 = require("zod/mini");
|
|
11871
12196
|
var ClineCommandPermissionsSchema = import_mini32.z.looseObject({
|
|
@@ -11901,7 +12226,7 @@ var ClinePermissions = class _ClinePermissions extends ToolPermissions {
|
|
|
11901
12226
|
global = false
|
|
11902
12227
|
}) {
|
|
11903
12228
|
const paths = _ClinePermissions.getSettablePaths({ global });
|
|
11904
|
-
const filePath = (0,
|
|
12229
|
+
const filePath = (0, import_node_path79.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11905
12230
|
const fileContent = await readFileContentOrNull(filePath) ?? "{}";
|
|
11906
12231
|
return new _ClinePermissions({
|
|
11907
12232
|
outputRoot,
|
|
@@ -11918,7 +12243,7 @@ var ClinePermissions = class _ClinePermissions extends ToolPermissions {
|
|
|
11918
12243
|
logger
|
|
11919
12244
|
}) {
|
|
11920
12245
|
const paths = _ClinePermissions.getSettablePaths({ global });
|
|
11921
|
-
const filePath = (0,
|
|
12246
|
+
const filePath = (0, import_node_path79.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11922
12247
|
const existingContent = await readFileContentOrNull(filePath) ?? "{}";
|
|
11923
12248
|
let existing;
|
|
11924
12249
|
try {
|
|
@@ -12006,7 +12331,7 @@ var ClinePermissions = class _ClinePermissions extends ToolPermissions {
|
|
|
12006
12331
|
parsed = result.data;
|
|
12007
12332
|
} catch (error) {
|
|
12008
12333
|
throw new Error(
|
|
12009
|
-
`Failed to parse Cline permissions content in ${(0,
|
|
12334
|
+
`Failed to parse Cline permissions content in ${(0, import_node_path79.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
12010
12335
|
{ cause: error }
|
|
12011
12336
|
);
|
|
12012
12337
|
}
|
|
@@ -12053,7 +12378,7 @@ var ClinePermissions = class _ClinePermissions extends ToolPermissions {
|
|
|
12053
12378
|
};
|
|
12054
12379
|
|
|
12055
12380
|
// src/features/permissions/codexcli-permissions.ts
|
|
12056
|
-
var
|
|
12381
|
+
var import_node_path80 = require("path");
|
|
12057
12382
|
var smolToml4 = __toESM(require("smol-toml"), 1);
|
|
12058
12383
|
var RULESYNC_PROFILE_NAME = "rulesync";
|
|
12059
12384
|
var RULESYNC_BASH_RULES_FILE_NAME = "rulesync.rules";
|
|
@@ -12075,7 +12400,7 @@ var CodexcliPermissions = class _CodexcliPermissions extends ToolPermissions {
|
|
|
12075
12400
|
global = false
|
|
12076
12401
|
}) {
|
|
12077
12402
|
const paths = this.getSettablePaths({ global });
|
|
12078
|
-
const filePath = (0,
|
|
12403
|
+
const filePath = (0, import_node_path80.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
12079
12404
|
const fileContent = await readFileContentOrNull(filePath) ?? smolToml4.stringify({});
|
|
12080
12405
|
return new _CodexcliPermissions({
|
|
12081
12406
|
outputRoot,
|
|
@@ -12093,7 +12418,7 @@ var CodexcliPermissions = class _CodexcliPermissions extends ToolPermissions {
|
|
|
12093
12418
|
global = false
|
|
12094
12419
|
}) {
|
|
12095
12420
|
const paths = this.getSettablePaths({ global });
|
|
12096
|
-
const filePath = (0,
|
|
12421
|
+
const filePath = (0, import_node_path80.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
12097
12422
|
const existingContent = await readFileContentOrNull(filePath) ?? smolToml4.stringify({});
|
|
12098
12423
|
const parsed = toMutableTable(smolToml4.parse(existingContent));
|
|
12099
12424
|
const profile = convertRulesyncToCodexProfile({
|
|
@@ -12118,7 +12443,7 @@ var CodexcliPermissions = class _CodexcliPermissions extends ToolPermissions {
|
|
|
12118
12443
|
parsed = smolToml4.parse(this.getFileContent());
|
|
12119
12444
|
} catch (error) {
|
|
12120
12445
|
throw new Error(
|
|
12121
|
-
`Failed to parse Codex CLI permissions content in ${(0,
|
|
12446
|
+
`Failed to parse Codex CLI permissions content in ${(0, import_node_path80.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
12122
12447
|
{ cause: error }
|
|
12123
12448
|
);
|
|
12124
12449
|
}
|
|
@@ -12159,7 +12484,7 @@ function createCodexcliBashRulesFile({
|
|
|
12159
12484
|
}) {
|
|
12160
12485
|
return new CodexcliRulesFile({
|
|
12161
12486
|
outputRoot,
|
|
12162
|
-
relativeDirPath: (0,
|
|
12487
|
+
relativeDirPath: (0, import_node_path80.join)(".codex", "rules"),
|
|
12163
12488
|
relativeFilePath: RULESYNC_BASH_RULES_FILE_NAME,
|
|
12164
12489
|
fileContent: buildCodexBashRulesContent(config)
|
|
12165
12490
|
});
|
|
@@ -12282,7 +12607,7 @@ function addFilesystemRule({
|
|
|
12282
12607
|
workspaceRootFilesystem[pattern] = access;
|
|
12283
12608
|
}
|
|
12284
12609
|
function canBeCodexFilesystemRoot(pattern) {
|
|
12285
|
-
return (0,
|
|
12610
|
+
return (0, import_node_path80.isAbsolute)(pattern) || /^[A-Za-z]:[\\/]/.test(pattern) || pattern.startsWith("~/") || pattern === "~" || pattern.startsWith(":");
|
|
12286
12611
|
}
|
|
12287
12612
|
function addRulesyncFilesystemRule(permission, pattern, access) {
|
|
12288
12613
|
if (access === "deny" || access === "none") {
|
|
@@ -12398,7 +12723,7 @@ function mapBashActionToDecision(action) {
|
|
|
12398
12723
|
}
|
|
12399
12724
|
|
|
12400
12725
|
// src/features/permissions/cursor-permissions.ts
|
|
12401
|
-
var
|
|
12726
|
+
var import_node_path81 = require("path");
|
|
12402
12727
|
var import_es_toolkit7 = require("es-toolkit");
|
|
12403
12728
|
var CANONICAL_TO_CURSOR_TYPE = {
|
|
12404
12729
|
bash: "Shell",
|
|
@@ -12516,7 +12841,7 @@ var CursorPermissions = class _CursorPermissions extends ToolPermissions {
|
|
|
12516
12841
|
global = false
|
|
12517
12842
|
}) {
|
|
12518
12843
|
const paths = _CursorPermissions.getSettablePaths({ global });
|
|
12519
|
-
const filePath = (0,
|
|
12844
|
+
const filePath = (0, import_node_path81.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
12520
12845
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"permissions":{}}';
|
|
12521
12846
|
return new _CursorPermissions({
|
|
12522
12847
|
outputRoot,
|
|
@@ -12533,7 +12858,7 @@ var CursorPermissions = class _CursorPermissions extends ToolPermissions {
|
|
|
12533
12858
|
global = false
|
|
12534
12859
|
}) {
|
|
12535
12860
|
const paths = _CursorPermissions.getSettablePaths({ global });
|
|
12536
|
-
const filePath = (0,
|
|
12861
|
+
const filePath = (0, import_node_path81.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
12537
12862
|
const existingContent = await readOrInitializeFileContent(
|
|
12538
12863
|
filePath,
|
|
12539
12864
|
JSON.stringify({}, null, 2)
|
|
@@ -12552,6 +12877,18 @@ var CursorPermissions = class _CursorPermissions extends ToolPermissions {
|
|
|
12552
12877
|
const managedTypes = new Set(
|
|
12553
12878
|
Object.keys(config.permission).map((category) => toCursorType(category))
|
|
12554
12879
|
);
|
|
12880
|
+
const existingEditorRaw = settings.editor;
|
|
12881
|
+
let existingEditor;
|
|
12882
|
+
if (existingEditorRaw === void 0) {
|
|
12883
|
+
existingEditor = {};
|
|
12884
|
+
} else if (existingEditorRaw !== null && typeof existingEditorRaw === "object" && !Array.isArray(existingEditorRaw)) {
|
|
12885
|
+
existingEditor = existingEditorRaw;
|
|
12886
|
+
} else {
|
|
12887
|
+
logger?.warn(
|
|
12888
|
+
`Cursor CLI config at ${filePath} has a non-object \`editor\` field; ignoring existing editor settings.`
|
|
12889
|
+
);
|
|
12890
|
+
existingEditor = {};
|
|
12891
|
+
}
|
|
12555
12892
|
const existingPermissionsRaw = settings.permissions;
|
|
12556
12893
|
let existingPermissions;
|
|
12557
12894
|
if (existingPermissionsRaw === void 0) {
|
|
@@ -12579,11 +12916,7 @@ var CursorPermissions = class _CursorPermissions extends ToolPermissions {
|
|
|
12579
12916
|
};
|
|
12580
12917
|
const mergedAllow = (0, import_es_toolkit7.uniq)([...preservedAllow, ...allow].toSorted());
|
|
12581
12918
|
const mergedDeny = (0, import_es_toolkit7.uniq)([...preservedDeny, ...deny].toSorted());
|
|
12582
|
-
|
|
12583
|
-
mergedPermissions.allow = mergedAllow;
|
|
12584
|
-
} else {
|
|
12585
|
-
delete mergedPermissions.allow;
|
|
12586
|
-
}
|
|
12919
|
+
mergedPermissions.allow = mergedAllow;
|
|
12587
12920
|
if (mergedDeny.length > 0) {
|
|
12588
12921
|
mergedPermissions.deny = mergedDeny;
|
|
12589
12922
|
} else {
|
|
@@ -12592,6 +12925,10 @@ var CursorPermissions = class _CursorPermissions extends ToolPermissions {
|
|
|
12592
12925
|
const merged = {
|
|
12593
12926
|
...settings,
|
|
12594
12927
|
version: settings.version ?? 1,
|
|
12928
|
+
editor: {
|
|
12929
|
+
...existingEditor,
|
|
12930
|
+
vimMode: existingEditor.vimMode ?? false
|
|
12931
|
+
},
|
|
12595
12932
|
permissions: mergedPermissions
|
|
12596
12933
|
};
|
|
12597
12934
|
const fileContent = JSON.stringify(merged, null, 2);
|
|
@@ -12609,7 +12946,7 @@ var CursorPermissions = class _CursorPermissions extends ToolPermissions {
|
|
|
12609
12946
|
settings = asCursorCliConfig(JSON.parse(this.getFileContent()));
|
|
12610
12947
|
} catch (error) {
|
|
12611
12948
|
throw new Error(
|
|
12612
|
-
`Failed to parse Cursor CLI permissions content in ${(0,
|
|
12949
|
+
`Failed to parse Cursor CLI permissions content in ${(0, import_node_path81.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
12613
12950
|
{ cause: error }
|
|
12614
12951
|
);
|
|
12615
12952
|
}
|
|
@@ -12684,10 +13021,10 @@ function convertCursorToRulesyncPermissions(params) {
|
|
|
12684
13021
|
}
|
|
12685
13022
|
|
|
12686
13023
|
// src/features/permissions/geminicli-permissions.ts
|
|
12687
|
-
var
|
|
13024
|
+
var import_node_path82 = require("path");
|
|
12688
13025
|
var smolToml5 = __toESM(require("smol-toml"), 1);
|
|
12689
13026
|
var import_mini33 = require("zod/mini");
|
|
12690
|
-
var GEMINICLI_POLICY_RELATIVE_DIR_PATH = (0,
|
|
13027
|
+
var GEMINICLI_POLICY_RELATIVE_DIR_PATH = (0, import_node_path82.join)(".gemini", "policies");
|
|
12691
13028
|
var GEMINICLI_POLICY_FILE_NAME = "rulesync.toml";
|
|
12692
13029
|
var RULESYNC_TO_GEMINICLI_TOOL_NAME = {
|
|
12693
13030
|
bash: "run_shell_command",
|
|
@@ -12728,7 +13065,7 @@ var GeminicliPermissions = class _GeminicliPermissions extends ToolPermissions {
|
|
|
12728
13065
|
global = false
|
|
12729
13066
|
}) {
|
|
12730
13067
|
const paths = this.getSettablePaths({ global });
|
|
12731
|
-
const filePath = (0,
|
|
13068
|
+
const filePath = (0, import_node_path82.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
12732
13069
|
const fileContent = await readFileContentOrNull(filePath) ?? "";
|
|
12733
13070
|
return new _GeminicliPermissions({
|
|
12734
13071
|
outputRoot,
|
|
@@ -12764,7 +13101,7 @@ var GeminicliPermissions = class _GeminicliPermissions extends ToolPermissions {
|
|
|
12764
13101
|
parsed = smolToml5.parse(fileContent);
|
|
12765
13102
|
} catch (error) {
|
|
12766
13103
|
throw new Error(
|
|
12767
|
-
`Failed to parse Gemini CLI policy TOML in ${(0,
|
|
13104
|
+
`Failed to parse Gemini CLI policy TOML in ${(0, import_node_path82.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
12768
13105
|
{ cause: error }
|
|
12769
13106
|
);
|
|
12770
13107
|
}
|
|
@@ -13056,8 +13393,8 @@ function extractPattern(rule) {
|
|
|
13056
13393
|
}
|
|
13057
13394
|
|
|
13058
13395
|
// src/features/permissions/kilo-permissions.ts
|
|
13059
|
-
var
|
|
13060
|
-
var
|
|
13396
|
+
var import_node_path83 = require("path");
|
|
13397
|
+
var import_jsonc_parser6 = require("jsonc-parser");
|
|
13061
13398
|
var import_mini34 = require("zod/mini");
|
|
13062
13399
|
var KiloPermissionSchema = import_mini34.z.union([
|
|
13063
13400
|
import_mini34.z.enum(["allow", "ask", "deny"]),
|
|
@@ -13069,11 +13406,11 @@ var KiloPermissionsConfigSchema = import_mini34.z.looseObject({
|
|
|
13069
13406
|
var KILO_FILE_NAME = "kilo.jsonc";
|
|
13070
13407
|
function parseKiloJsoncStrict(content, filePath) {
|
|
13071
13408
|
const errors = [];
|
|
13072
|
-
const parsed = (0,
|
|
13409
|
+
const parsed = (0, import_jsonc_parser6.parse)(content, errors, { allowTrailingComma: true });
|
|
13073
13410
|
const first = errors[0];
|
|
13074
13411
|
if (first) {
|
|
13075
13412
|
throw new Error(
|
|
13076
|
-
`Failed to parse Kilo Code config at ${filePath}: ${(0,
|
|
13413
|
+
`Failed to parse Kilo Code config at ${filePath}: ${(0, import_jsonc_parser6.printParseErrorCode)(first.error)} at offset ${first.offset}`
|
|
13077
13414
|
);
|
|
13078
13415
|
}
|
|
13079
13416
|
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
@@ -13100,7 +13437,7 @@ var KiloPermissions = class _KiloPermissions extends ToolPermissions {
|
|
|
13100
13437
|
json;
|
|
13101
13438
|
constructor(params) {
|
|
13102
13439
|
super(params);
|
|
13103
|
-
const parsed = (0,
|
|
13440
|
+
const parsed = (0, import_jsonc_parser6.parse)(this.fileContent || "{}");
|
|
13104
13441
|
if (params.validate !== false) {
|
|
13105
13442
|
this.json = KiloPermissionsConfigSchema.parse(parsed);
|
|
13106
13443
|
} else {
|
|
@@ -13117,7 +13454,7 @@ var KiloPermissions = class _KiloPermissions extends ToolPermissions {
|
|
|
13117
13454
|
static getSettablePaths({
|
|
13118
13455
|
global = false
|
|
13119
13456
|
} = {}) {
|
|
13120
|
-
return global ? { relativeDirPath: (0,
|
|
13457
|
+
return global ? { relativeDirPath: (0, import_node_path83.join)(".config", "kilo"), relativeFilePath: KILO_FILE_NAME } : { relativeDirPath: ".", relativeFilePath: KILO_FILE_NAME };
|
|
13121
13458
|
}
|
|
13122
13459
|
static async fromFile({
|
|
13123
13460
|
outputRoot = process.cwd(),
|
|
@@ -13125,7 +13462,7 @@ var KiloPermissions = class _KiloPermissions extends ToolPermissions {
|
|
|
13125
13462
|
global = false
|
|
13126
13463
|
}) {
|
|
13127
13464
|
const basePaths = _KiloPermissions.getSettablePaths({ global });
|
|
13128
|
-
const filePath = (0,
|
|
13465
|
+
const filePath = (0, import_node_path83.join)(outputRoot, basePaths.relativeDirPath, basePaths.relativeFilePath);
|
|
13129
13466
|
const fileContent = await readFileContentOrNull(filePath);
|
|
13130
13467
|
const parsed = parseKiloJsoncStrict(fileContent ?? "{}", filePath);
|
|
13131
13468
|
const nextJson = { ...parsed, permission: parsed.permission ?? {} };
|
|
@@ -13144,7 +13481,7 @@ var KiloPermissions = class _KiloPermissions extends ToolPermissions {
|
|
|
13144
13481
|
logger
|
|
13145
13482
|
}) {
|
|
13146
13483
|
const basePaths = _KiloPermissions.getSettablePaths({ global });
|
|
13147
|
-
const filePath = (0,
|
|
13484
|
+
const filePath = (0, import_node_path83.join)(outputRoot, basePaths.relativeDirPath, basePaths.relativeFilePath);
|
|
13148
13485
|
const fileContent = await readFileContentOrNull(filePath);
|
|
13149
13486
|
const parsed = parseKiloJsoncStrict(fileContent ?? "{}", filePath);
|
|
13150
13487
|
const parsedPermission = parsed.permission;
|
|
@@ -13190,7 +13527,7 @@ var KiloPermissions = class _KiloPermissions extends ToolPermissions {
|
|
|
13190
13527
|
}
|
|
13191
13528
|
validate() {
|
|
13192
13529
|
try {
|
|
13193
|
-
const json = (0,
|
|
13530
|
+
const json = (0, import_jsonc_parser6.parse)(this.fileContent || "{}");
|
|
13194
13531
|
const result = KiloPermissionsConfigSchema.safeParse(json);
|
|
13195
13532
|
if (!result.success) {
|
|
13196
13533
|
return { success: false, error: result.error };
|
|
@@ -13230,7 +13567,7 @@ var KiloPermissions = class _KiloPermissions extends ToolPermissions {
|
|
|
13230
13567
|
};
|
|
13231
13568
|
|
|
13232
13569
|
// src/features/permissions/kiro-permissions.ts
|
|
13233
|
-
var
|
|
13570
|
+
var import_node_path84 = require("path");
|
|
13234
13571
|
var import_mini35 = require("zod/mini");
|
|
13235
13572
|
var KiroAgentSchema = import_mini35.z.looseObject({
|
|
13236
13573
|
allowedTools: import_mini35.z.optional(import_mini35.z.array(import_mini35.z.string())),
|
|
@@ -13240,7 +13577,7 @@ var UnknownRecordSchema = import_mini35.z.record(import_mini35.z.string(), impor
|
|
|
13240
13577
|
var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
13241
13578
|
static getSettablePaths(_options = {}) {
|
|
13242
13579
|
return {
|
|
13243
|
-
relativeDirPath: (0,
|
|
13580
|
+
relativeDirPath: (0, import_node_path84.join)(".kiro", "agents"),
|
|
13244
13581
|
relativeFilePath: "default.json"
|
|
13245
13582
|
};
|
|
13246
13583
|
}
|
|
@@ -13252,7 +13589,7 @@ var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
|
13252
13589
|
validate = true
|
|
13253
13590
|
}) {
|
|
13254
13591
|
const paths = this.getSettablePaths();
|
|
13255
|
-
const filePath = (0,
|
|
13592
|
+
const filePath = (0, import_node_path84.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
13256
13593
|
const fileContent = await readFileContentOrNull(filePath) ?? JSON.stringify({}, null, 2);
|
|
13257
13594
|
return new _KiroPermissions({
|
|
13258
13595
|
outputRoot,
|
|
@@ -13269,7 +13606,7 @@ var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
|
13269
13606
|
logger
|
|
13270
13607
|
}) {
|
|
13271
13608
|
const paths = this.getSettablePaths();
|
|
13272
|
-
const filePath = (0,
|
|
13609
|
+
const filePath = (0, import_node_path84.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
13273
13610
|
const existingContent = await readFileContentOrNull(filePath) ?? JSON.stringify({}, null, 2);
|
|
13274
13611
|
const parsedResult = KiroAgentSchema.safeParse(JSON.parse(existingContent));
|
|
13275
13612
|
if (!parsedResult.success) {
|
|
@@ -13293,7 +13630,7 @@ var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
|
13293
13630
|
parsed = KiroAgentSchema.parse(JSON.parse(this.getFileContent()));
|
|
13294
13631
|
} catch (error) {
|
|
13295
13632
|
throw new Error(
|
|
13296
|
-
`Failed to parse Kiro permissions content in ${(0,
|
|
13633
|
+
`Failed to parse Kiro permissions content in ${(0, import_node_path84.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
13297
13634
|
{ cause: error }
|
|
13298
13635
|
);
|
|
13299
13636
|
}
|
|
@@ -13418,8 +13755,8 @@ function asStringArray(value) {
|
|
|
13418
13755
|
}
|
|
13419
13756
|
|
|
13420
13757
|
// src/features/permissions/opencode-permissions.ts
|
|
13421
|
-
var
|
|
13422
|
-
var
|
|
13758
|
+
var import_node_path85 = require("path");
|
|
13759
|
+
var import_jsonc_parser7 = require("jsonc-parser");
|
|
13423
13760
|
var import_mini36 = require("zod/mini");
|
|
13424
13761
|
var OpencodePermissionSchema = import_mini36.z.union([
|
|
13425
13762
|
import_mini36.z.enum(["allow", "ask", "deny"]),
|
|
@@ -13432,7 +13769,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13432
13769
|
json;
|
|
13433
13770
|
constructor(params) {
|
|
13434
13771
|
super(params);
|
|
13435
|
-
this.json = OpencodePermissionsConfigSchema.parse((0,
|
|
13772
|
+
this.json = OpencodePermissionsConfigSchema.parse((0, import_jsonc_parser7.parse)(this.fileContent || "{}"));
|
|
13436
13773
|
}
|
|
13437
13774
|
getJson() {
|
|
13438
13775
|
return this.json;
|
|
@@ -13443,7 +13780,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13443
13780
|
static getSettablePaths({
|
|
13444
13781
|
global = false
|
|
13445
13782
|
} = {}) {
|
|
13446
|
-
return global ? { relativeDirPath: (0,
|
|
13783
|
+
return global ? { relativeDirPath: (0, import_node_path85.join)(".config", "opencode"), relativeFilePath: "opencode.json" } : { relativeDirPath: ".", relativeFilePath: "opencode.json" };
|
|
13447
13784
|
}
|
|
13448
13785
|
static async fromFile({
|
|
13449
13786
|
outputRoot = process.cwd(),
|
|
@@ -13451,9 +13788,9 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13451
13788
|
global = false
|
|
13452
13789
|
}) {
|
|
13453
13790
|
const basePaths = _OpencodePermissions.getSettablePaths({ global });
|
|
13454
|
-
const jsonDir = (0,
|
|
13455
|
-
const jsoncPath = (0,
|
|
13456
|
-
const jsonPath = (0,
|
|
13791
|
+
const jsonDir = (0, import_node_path85.join)(outputRoot, basePaths.relativeDirPath);
|
|
13792
|
+
const jsoncPath = (0, import_node_path85.join)(jsonDir, "opencode.jsonc");
|
|
13793
|
+
const jsonPath = (0, import_node_path85.join)(jsonDir, "opencode.json");
|
|
13457
13794
|
let fileContent = await readFileContentOrNull(jsoncPath);
|
|
13458
13795
|
let relativeFilePath = "opencode.jsonc";
|
|
13459
13796
|
if (!fileContent) {
|
|
@@ -13462,7 +13799,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13462
13799
|
relativeFilePath = "opencode.json";
|
|
13463
13800
|
}
|
|
13464
13801
|
}
|
|
13465
|
-
const parsed = (0,
|
|
13802
|
+
const parsed = (0, import_jsonc_parser7.parse)(fileContent ?? "{}");
|
|
13466
13803
|
const nextJson = { ...parsed, permission: parsed.permission ?? {} };
|
|
13467
13804
|
return new _OpencodePermissions({
|
|
13468
13805
|
outputRoot,
|
|
@@ -13478,9 +13815,9 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13478
13815
|
global = false
|
|
13479
13816
|
}) {
|
|
13480
13817
|
const basePaths = _OpencodePermissions.getSettablePaths({ global });
|
|
13481
|
-
const jsonDir = (0,
|
|
13482
|
-
const jsoncPath = (0,
|
|
13483
|
-
const jsonPath = (0,
|
|
13818
|
+
const jsonDir = (0, import_node_path85.join)(outputRoot, basePaths.relativeDirPath);
|
|
13819
|
+
const jsoncPath = (0, import_node_path85.join)(jsonDir, "opencode.jsonc");
|
|
13820
|
+
const jsonPath = (0, import_node_path85.join)(jsonDir, "opencode.json");
|
|
13484
13821
|
let fileContent = await readFileContentOrNull(jsoncPath);
|
|
13485
13822
|
let relativeFilePath = "opencode.jsonc";
|
|
13486
13823
|
if (!fileContent) {
|
|
@@ -13489,7 +13826,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13489
13826
|
relativeFilePath = "opencode.json";
|
|
13490
13827
|
}
|
|
13491
13828
|
}
|
|
13492
|
-
const parsed = (0,
|
|
13829
|
+
const parsed = (0, import_jsonc_parser7.parse)(fileContent ?? "{}");
|
|
13493
13830
|
const nextJson = {
|
|
13494
13831
|
...parsed,
|
|
13495
13832
|
permission: rulesyncPermissions.getJson().permission
|
|
@@ -13550,7 +13887,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13550
13887
|
};
|
|
13551
13888
|
|
|
13552
13889
|
// src/features/permissions/qwencode-permissions.ts
|
|
13553
|
-
var
|
|
13890
|
+
var import_node_path86 = require("path");
|
|
13554
13891
|
var import_es_toolkit8 = require("es-toolkit");
|
|
13555
13892
|
var import_mini37 = require("zod/mini");
|
|
13556
13893
|
var QwenSettingsPermissionsSchema = import_mini37.z.looseObject({
|
|
@@ -13638,7 +13975,7 @@ var QwencodePermissions = class _QwencodePermissions extends ToolPermissions {
|
|
|
13638
13975
|
global = false
|
|
13639
13976
|
}) {
|
|
13640
13977
|
const paths = _QwencodePermissions.getSettablePaths({ global });
|
|
13641
|
-
const filePath = (0,
|
|
13978
|
+
const filePath = (0, import_node_path86.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
13642
13979
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"permissions":{}}';
|
|
13643
13980
|
return new _QwencodePermissions({
|
|
13644
13981
|
outputRoot,
|
|
@@ -13655,7 +13992,7 @@ var QwencodePermissions = class _QwencodePermissions extends ToolPermissions {
|
|
|
13655
13992
|
logger
|
|
13656
13993
|
}) {
|
|
13657
13994
|
const paths = _QwencodePermissions.getSettablePaths({ global });
|
|
13658
|
-
const filePath = (0,
|
|
13995
|
+
const filePath = (0, import_node_path86.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
13659
13996
|
const existingContent = await readFileContentOrNull(filePath) ?? "{}";
|
|
13660
13997
|
let settings;
|
|
13661
13998
|
try {
|
|
@@ -13728,7 +14065,7 @@ var QwencodePermissions = class _QwencodePermissions extends ToolPermissions {
|
|
|
13728
14065
|
settings = result.data;
|
|
13729
14066
|
} catch (error) {
|
|
13730
14067
|
throw new Error(
|
|
13731
|
-
`Failed to parse Qwen permissions content in ${(0,
|
|
14068
|
+
`Failed to parse Qwen permissions content in ${(0, import_node_path86.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
13732
14069
|
{ cause: error }
|
|
13733
14070
|
);
|
|
13734
14071
|
}
|
|
@@ -14071,7 +14408,7 @@ var PermissionsProcessor = class extends FeatureProcessor {
|
|
|
14071
14408
|
};
|
|
14072
14409
|
|
|
14073
14410
|
// src/features/rules/rules-processor.ts
|
|
14074
|
-
var
|
|
14411
|
+
var import_node_path168 = require("path");
|
|
14075
14412
|
var import_toon = require("@toon-format/toon");
|
|
14076
14413
|
var import_mini82 = require("zod/mini");
|
|
14077
14414
|
|
|
@@ -14079,17 +14416,17 @@ var import_mini82 = require("zod/mini");
|
|
|
14079
14416
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
14080
14417
|
|
|
14081
14418
|
// src/features/skills/agentsmd-skill.ts
|
|
14082
|
-
var
|
|
14419
|
+
var import_node_path90 = require("path");
|
|
14083
14420
|
|
|
14084
14421
|
// src/features/skills/simulated-skill.ts
|
|
14085
|
-
var
|
|
14422
|
+
var import_node_path89 = require("path");
|
|
14086
14423
|
var import_mini39 = require("zod/mini");
|
|
14087
14424
|
|
|
14088
14425
|
// src/features/skills/tool-skill.ts
|
|
14089
|
-
var
|
|
14426
|
+
var import_node_path88 = require("path");
|
|
14090
14427
|
|
|
14091
14428
|
// src/types/ai-dir.ts
|
|
14092
|
-
var
|
|
14429
|
+
var import_node_path87 = __toESM(require("path"), 1);
|
|
14093
14430
|
var AiDir = class {
|
|
14094
14431
|
/**
|
|
14095
14432
|
* @example "."
|
|
@@ -14123,7 +14460,7 @@ var AiDir = class {
|
|
|
14123
14460
|
otherFiles = [],
|
|
14124
14461
|
global = false
|
|
14125
14462
|
}) {
|
|
14126
|
-
if (dirName.includes(
|
|
14463
|
+
if (dirName.includes(import_node_path87.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
|
|
14127
14464
|
throw new Error(`Directory name cannot contain path separators: dirName="${dirName}"`);
|
|
14128
14465
|
}
|
|
14129
14466
|
this.outputRoot = outputRoot;
|
|
@@ -14146,11 +14483,11 @@ var AiDir = class {
|
|
|
14146
14483
|
return this.dirName;
|
|
14147
14484
|
}
|
|
14148
14485
|
getDirPath() {
|
|
14149
|
-
const fullPath =
|
|
14150
|
-
const resolvedFull = (0,
|
|
14151
|
-
const resolvedBase = (0,
|
|
14152
|
-
const rel = (0,
|
|
14153
|
-
if (rel.startsWith("..") ||
|
|
14486
|
+
const fullPath = import_node_path87.default.join(this.outputRoot, this.relativeDirPath, this.dirName);
|
|
14487
|
+
const resolvedFull = (0, import_node_path87.resolve)(fullPath);
|
|
14488
|
+
const resolvedBase = (0, import_node_path87.resolve)(this.outputRoot);
|
|
14489
|
+
const rel = (0, import_node_path87.relative)(resolvedBase, resolvedFull);
|
|
14490
|
+
if (rel.startsWith("..") || import_node_path87.default.isAbsolute(rel)) {
|
|
14154
14491
|
throw new Error(
|
|
14155
14492
|
`Path traversal detected: Final path escapes outputRoot. outputRoot="${this.outputRoot}", relativeDirPath="${this.relativeDirPath}", dirName="${this.dirName}"`
|
|
14156
14493
|
);
|
|
@@ -14167,7 +14504,7 @@ var AiDir = class {
|
|
|
14167
14504
|
* Returns the relative path from CWD with POSIX separators for consistent cross-platform output.
|
|
14168
14505
|
*/
|
|
14169
14506
|
getRelativePathFromCwd() {
|
|
14170
|
-
return toPosixPath(
|
|
14507
|
+
return toPosixPath(import_node_path87.default.join(this.relativeDirPath, this.dirName));
|
|
14171
14508
|
}
|
|
14172
14509
|
getGlobal() {
|
|
14173
14510
|
return this.global;
|
|
@@ -14186,15 +14523,15 @@ var AiDir = class {
|
|
|
14186
14523
|
* @returns Array of files with their relative paths and buffers
|
|
14187
14524
|
*/
|
|
14188
14525
|
static async collectOtherFiles(outputRoot, relativeDirPath, dirName, excludeFileName) {
|
|
14189
|
-
const dirPath = (0,
|
|
14190
|
-
const glob = (0,
|
|
14526
|
+
const dirPath = (0, import_node_path87.join)(outputRoot, relativeDirPath, dirName);
|
|
14527
|
+
const glob = (0, import_node_path87.join)(dirPath, "**", "*");
|
|
14191
14528
|
const filePaths = await findFilesByGlobs(glob, { type: "file" });
|
|
14192
|
-
const filteredPaths = filePaths.filter((filePath) => (0,
|
|
14529
|
+
const filteredPaths = filePaths.filter((filePath) => (0, import_node_path87.basename)(filePath) !== excludeFileName);
|
|
14193
14530
|
const files = await Promise.all(
|
|
14194
14531
|
filteredPaths.map(async (filePath) => {
|
|
14195
14532
|
const fileBuffer = await readFileBuffer(filePath);
|
|
14196
14533
|
return {
|
|
14197
|
-
relativeFilePathToDirPath: (0,
|
|
14534
|
+
relativeFilePathToDirPath: (0, import_node_path87.relative)(dirPath, filePath),
|
|
14198
14535
|
fileBuffer
|
|
14199
14536
|
};
|
|
14200
14537
|
})
|
|
@@ -14288,8 +14625,8 @@ var ToolSkill = class extends AiDir {
|
|
|
14288
14625
|
}) {
|
|
14289
14626
|
const settablePaths = getSettablePaths({ global });
|
|
14290
14627
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
14291
|
-
const skillDirPath = (0,
|
|
14292
|
-
const skillFilePath = (0,
|
|
14628
|
+
const skillDirPath = (0, import_node_path88.join)(outputRoot, actualRelativeDirPath, dirName);
|
|
14629
|
+
const skillFilePath = (0, import_node_path88.join)(skillDirPath, SKILL_FILE_NAME);
|
|
14293
14630
|
if (!await fileExists(skillFilePath)) {
|
|
14294
14631
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
14295
14632
|
}
|
|
@@ -14313,7 +14650,7 @@ var ToolSkill = class extends AiDir {
|
|
|
14313
14650
|
}
|
|
14314
14651
|
requireMainFileFrontmatter() {
|
|
14315
14652
|
if (!this.mainFile?.frontmatter) {
|
|
14316
|
-
throw new Error(`Frontmatter is not defined in ${(0,
|
|
14653
|
+
throw new Error(`Frontmatter is not defined in ${(0, import_node_path88.join)(this.relativeDirPath, this.dirName)}`);
|
|
14317
14654
|
}
|
|
14318
14655
|
return this.mainFile.frontmatter;
|
|
14319
14656
|
}
|
|
@@ -14353,7 +14690,7 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
14353
14690
|
const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
|
|
14354
14691
|
if (!result.success) {
|
|
14355
14692
|
throw new Error(
|
|
14356
|
-
`Invalid frontmatter in ${(0,
|
|
14693
|
+
`Invalid frontmatter in ${(0, import_node_path89.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
|
|
14357
14694
|
);
|
|
14358
14695
|
}
|
|
14359
14696
|
}
|
|
@@ -14412,8 +14749,8 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
14412
14749
|
}) {
|
|
14413
14750
|
const settablePaths = this.getSettablePaths();
|
|
14414
14751
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
14415
|
-
const skillDirPath = (0,
|
|
14416
|
-
const skillFilePath = (0,
|
|
14752
|
+
const skillDirPath = (0, import_node_path89.join)(outputRoot, actualRelativeDirPath, dirName);
|
|
14753
|
+
const skillFilePath = (0, import_node_path89.join)(skillDirPath, SKILL_FILE_NAME);
|
|
14417
14754
|
if (!await fileExists(skillFilePath)) {
|
|
14418
14755
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
14419
14756
|
}
|
|
@@ -14490,7 +14827,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
14490
14827
|
throw new Error("AgentsmdSkill does not support global mode.");
|
|
14491
14828
|
}
|
|
14492
14829
|
return {
|
|
14493
|
-
relativeDirPath: (0,
|
|
14830
|
+
relativeDirPath: (0, import_node_path90.join)(".agents", "skills")
|
|
14494
14831
|
};
|
|
14495
14832
|
}
|
|
14496
14833
|
static async fromDir(params) {
|
|
@@ -14517,11 +14854,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
14517
14854
|
};
|
|
14518
14855
|
|
|
14519
14856
|
// src/features/skills/factorydroid-skill.ts
|
|
14520
|
-
var
|
|
14857
|
+
var import_node_path91 = require("path");
|
|
14521
14858
|
var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
14522
14859
|
static getSettablePaths(_options) {
|
|
14523
14860
|
return {
|
|
14524
|
-
relativeDirPath: (0,
|
|
14861
|
+
relativeDirPath: (0, import_node_path91.join)(".factory", "skills")
|
|
14525
14862
|
};
|
|
14526
14863
|
}
|
|
14527
14864
|
static async fromDir(params) {
|
|
@@ -14548,11 +14885,11 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
|
14548
14885
|
};
|
|
14549
14886
|
|
|
14550
14887
|
// src/features/skills/rovodev-skill.ts
|
|
14551
|
-
var
|
|
14888
|
+
var import_node_path93 = require("path");
|
|
14552
14889
|
var import_mini41 = require("zod/mini");
|
|
14553
14890
|
|
|
14554
14891
|
// src/features/skills/rulesync-skill.ts
|
|
14555
|
-
var
|
|
14892
|
+
var import_node_path92 = require("path");
|
|
14556
14893
|
var import_mini40 = require("zod/mini");
|
|
14557
14894
|
var RulesyncSkillFrontmatterSchemaInternal = import_mini40.z.looseObject({
|
|
14558
14895
|
name: import_mini40.z.string(),
|
|
@@ -14592,6 +14929,23 @@ var RulesyncSkillFrontmatterSchemaInternal = import_mini40.z.looseObject({
|
|
|
14592
14929
|
license: import_mini40.z.optional(import_mini40.z.string())
|
|
14593
14930
|
})
|
|
14594
14931
|
),
|
|
14932
|
+
pi: import_mini40.z.optional(
|
|
14933
|
+
import_mini40.z.looseObject({
|
|
14934
|
+
"allowed-tools": import_mini40.z.optional(import_mini40.z.array(import_mini40.z.string())),
|
|
14935
|
+
"disable-model-invocation": import_mini40.z.optional(import_mini40.z.boolean()),
|
|
14936
|
+
license: import_mini40.z.optional(import_mini40.z.string()),
|
|
14937
|
+
compatibility: import_mini40.z.optional(import_mini40.z.looseObject({})),
|
|
14938
|
+
metadata: import_mini40.z.optional(import_mini40.z.looseObject({}))
|
|
14939
|
+
})
|
|
14940
|
+
),
|
|
14941
|
+
replit: import_mini40.z.optional(
|
|
14942
|
+
import_mini40.z.looseObject({
|
|
14943
|
+
"allowed-tools": import_mini40.z.optional(import_mini40.z.array(import_mini40.z.string())),
|
|
14944
|
+
license: import_mini40.z.optional(import_mini40.z.string()),
|
|
14945
|
+
compatibility: import_mini40.z.optional(import_mini40.z.looseObject({})),
|
|
14946
|
+
metadata: import_mini40.z.optional(import_mini40.z.looseObject({}))
|
|
14947
|
+
})
|
|
14948
|
+
),
|
|
14595
14949
|
cline: import_mini40.z.optional(import_mini40.z.looseObject({})),
|
|
14596
14950
|
roo: import_mini40.z.optional(import_mini40.z.looseObject({})),
|
|
14597
14951
|
takt: import_mini40.z.optional(
|
|
@@ -14639,7 +14993,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
14639
14993
|
}
|
|
14640
14994
|
getFrontmatter() {
|
|
14641
14995
|
if (!this.mainFile?.frontmatter) {
|
|
14642
|
-
throw new Error(`Frontmatter is not defined in ${(0,
|
|
14996
|
+
throw new Error(`Frontmatter is not defined in ${(0, import_node_path92.join)(this.relativeDirPath, this.dirName)}`);
|
|
14643
14997
|
}
|
|
14644
14998
|
const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
|
|
14645
14999
|
return result;
|
|
@@ -14665,8 +15019,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
14665
15019
|
dirName,
|
|
14666
15020
|
global = false
|
|
14667
15021
|
}) {
|
|
14668
|
-
const skillDirPath = (0,
|
|
14669
|
-
const skillFilePath = (0,
|
|
15022
|
+
const skillDirPath = (0, import_node_path92.join)(outputRoot, relativeDirPath, dirName);
|
|
15023
|
+
const skillFilePath = (0, import_node_path92.join)(skillDirPath, SKILL_FILE_NAME);
|
|
14670
15024
|
if (!await fileExists(skillFilePath)) {
|
|
14671
15025
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
14672
15026
|
}
|
|
@@ -14703,7 +15057,7 @@ var RovodevSkillFrontmatterSchema = import_mini41.z.looseObject({
|
|
|
14703
15057
|
var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
14704
15058
|
constructor({
|
|
14705
15059
|
outputRoot = process.cwd(),
|
|
14706
|
-
relativeDirPath = (0,
|
|
15060
|
+
relativeDirPath = (0, import_node_path93.join)(".rovodev", "skills"),
|
|
14707
15061
|
dirName,
|
|
14708
15062
|
frontmatter,
|
|
14709
15063
|
body,
|
|
@@ -14732,8 +15086,8 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
14732
15086
|
}
|
|
14733
15087
|
static getSettablePaths(_options) {
|
|
14734
15088
|
return {
|
|
14735
|
-
relativeDirPath: (0,
|
|
14736
|
-
alternativeSkillRoots: [(0,
|
|
15089
|
+
relativeDirPath: (0, import_node_path93.join)(".rovodev", "skills"),
|
|
15090
|
+
alternativeSkillRoots: [(0, import_node_path93.join)(".agents", "skills")]
|
|
14737
15091
|
};
|
|
14738
15092
|
}
|
|
14739
15093
|
getFrontmatter() {
|
|
@@ -14821,13 +15175,13 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
14821
15175
|
});
|
|
14822
15176
|
const result = RovodevSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
14823
15177
|
if (!result.success) {
|
|
14824
|
-
const skillDirPath = (0,
|
|
15178
|
+
const skillDirPath = (0, import_node_path93.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
14825
15179
|
throw new Error(
|
|
14826
|
-
`Invalid frontmatter in ${(0,
|
|
15180
|
+
`Invalid frontmatter in ${(0, import_node_path93.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
14827
15181
|
);
|
|
14828
15182
|
}
|
|
14829
15183
|
if (result.data.name !== loaded.dirName) {
|
|
14830
|
-
const skillFilePath = (0,
|
|
15184
|
+
const skillFilePath = (0, import_node_path93.join)(
|
|
14831
15185
|
loaded.outputRoot,
|
|
14832
15186
|
loaded.relativeDirPath,
|
|
14833
15187
|
loaded.dirName,
|
|
@@ -14869,11 +15223,11 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
14869
15223
|
};
|
|
14870
15224
|
|
|
14871
15225
|
// src/features/skills/skills-processor.ts
|
|
14872
|
-
var
|
|
15226
|
+
var import_node_path116 = require("path");
|
|
14873
15227
|
var import_mini60 = require("zod/mini");
|
|
14874
15228
|
|
|
14875
15229
|
// src/types/dir-feature-processor.ts
|
|
14876
|
-
var
|
|
15230
|
+
var import_node_path94 = require("path");
|
|
14877
15231
|
var DirFeatureProcessor = class {
|
|
14878
15232
|
outputRoot;
|
|
14879
15233
|
inputRoot;
|
|
@@ -14916,7 +15270,7 @@ var DirFeatureProcessor = class {
|
|
|
14916
15270
|
const mainFile = aiDir.getMainFile();
|
|
14917
15271
|
let mainFileContent;
|
|
14918
15272
|
if (mainFile) {
|
|
14919
|
-
const mainFilePath = (0,
|
|
15273
|
+
const mainFilePath = (0, import_node_path94.join)(dirPath, mainFile.name);
|
|
14920
15274
|
const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter, {
|
|
14921
15275
|
avoidBlockScalars: this.avoidBlockScalars
|
|
14922
15276
|
});
|
|
@@ -14936,7 +15290,7 @@ var DirFeatureProcessor = class {
|
|
|
14936
15290
|
const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
|
|
14937
15291
|
otherFileContents.push(contentWithNewline);
|
|
14938
15292
|
if (!dirHasChanges) {
|
|
14939
|
-
const filePath = (0,
|
|
15293
|
+
const filePath = (0, import_node_path94.join)(dirPath, file.relativeFilePathToDirPath);
|
|
14940
15294
|
const existingContent = await readFileContentOrNull(filePath);
|
|
14941
15295
|
if (!fileContentsEquivalent({
|
|
14942
15296
|
filePath,
|
|
@@ -14954,24 +15308,24 @@ var DirFeatureProcessor = class {
|
|
|
14954
15308
|
if (this.dryRun) {
|
|
14955
15309
|
this.logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
|
|
14956
15310
|
if (mainFile) {
|
|
14957
|
-
this.logger.info(`[DRY RUN] Would write: ${(0,
|
|
14958
|
-
changedPaths.push((0,
|
|
15311
|
+
this.logger.info(`[DRY RUN] Would write: ${(0, import_node_path94.join)(dirPath, mainFile.name)}`);
|
|
15312
|
+
changedPaths.push((0, import_node_path94.join)(relativeDir, mainFile.name));
|
|
14959
15313
|
}
|
|
14960
15314
|
for (const file of otherFiles) {
|
|
14961
15315
|
this.logger.info(
|
|
14962
|
-
`[DRY RUN] Would write: ${(0,
|
|
15316
|
+
`[DRY RUN] Would write: ${(0, import_node_path94.join)(dirPath, file.relativeFilePathToDirPath)}`
|
|
14963
15317
|
);
|
|
14964
|
-
changedPaths.push((0,
|
|
15318
|
+
changedPaths.push((0, import_node_path94.join)(relativeDir, file.relativeFilePathToDirPath));
|
|
14965
15319
|
}
|
|
14966
15320
|
} else {
|
|
14967
15321
|
await ensureDir(dirPath);
|
|
14968
15322
|
if (mainFile && mainFileContent) {
|
|
14969
|
-
const mainFilePath = (0,
|
|
15323
|
+
const mainFilePath = (0, import_node_path94.join)(dirPath, mainFile.name);
|
|
14970
15324
|
await writeFileContent(mainFilePath, mainFileContent);
|
|
14971
|
-
changedPaths.push((0,
|
|
15325
|
+
changedPaths.push((0, import_node_path94.join)(relativeDir, mainFile.name));
|
|
14972
15326
|
}
|
|
14973
15327
|
for (const [i, file] of otherFiles.entries()) {
|
|
14974
|
-
const filePath = (0,
|
|
15328
|
+
const filePath = (0, import_node_path94.join)(dirPath, file.relativeFilePathToDirPath);
|
|
14975
15329
|
const content = otherFileContents[i];
|
|
14976
15330
|
if (content === void 0) {
|
|
14977
15331
|
throw new Error(
|
|
@@ -14979,7 +15333,7 @@ var DirFeatureProcessor = class {
|
|
|
14979
15333
|
);
|
|
14980
15334
|
}
|
|
14981
15335
|
await writeFileContent(filePath, content);
|
|
14982
|
-
changedPaths.push((0,
|
|
15336
|
+
changedPaths.push((0, import_node_path94.join)(relativeDir, file.relativeFilePathToDirPath));
|
|
14983
15337
|
}
|
|
14984
15338
|
}
|
|
14985
15339
|
changedCount++;
|
|
@@ -15011,7 +15365,7 @@ var DirFeatureProcessor = class {
|
|
|
15011
15365
|
};
|
|
15012
15366
|
|
|
15013
15367
|
// src/features/skills/agentsskills-skill.ts
|
|
15014
|
-
var
|
|
15368
|
+
var import_node_path95 = require("path");
|
|
15015
15369
|
var import_mini42 = require("zod/mini");
|
|
15016
15370
|
var AgentsSkillsSkillFrontmatterSchema = import_mini42.z.looseObject({
|
|
15017
15371
|
name: import_mini42.z.string(),
|
|
@@ -15020,7 +15374,7 @@ var AgentsSkillsSkillFrontmatterSchema = import_mini42.z.looseObject({
|
|
|
15020
15374
|
var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
15021
15375
|
constructor({
|
|
15022
15376
|
outputRoot = process.cwd(),
|
|
15023
|
-
relativeDirPath = (0,
|
|
15377
|
+
relativeDirPath = (0, import_node_path95.join)(".agents", "skills"),
|
|
15024
15378
|
dirName,
|
|
15025
15379
|
frontmatter,
|
|
15026
15380
|
body,
|
|
@@ -15052,7 +15406,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
15052
15406
|
throw new Error("AgentsSkillsSkill does not support global mode.");
|
|
15053
15407
|
}
|
|
15054
15408
|
return {
|
|
15055
|
-
relativeDirPath: (0,
|
|
15409
|
+
relativeDirPath: (0, import_node_path95.join)(".agents", "skills")
|
|
15056
15410
|
};
|
|
15057
15411
|
}
|
|
15058
15412
|
getFrontmatter() {
|
|
@@ -15132,9 +15486,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
15132
15486
|
});
|
|
15133
15487
|
const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
15134
15488
|
if (!result.success) {
|
|
15135
|
-
const skillDirPath = (0,
|
|
15489
|
+
const skillDirPath = (0, import_node_path95.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
15136
15490
|
throw new Error(
|
|
15137
|
-
`Invalid frontmatter in ${(0,
|
|
15491
|
+
`Invalid frontmatter in ${(0, import_node_path95.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
15138
15492
|
);
|
|
15139
15493
|
}
|
|
15140
15494
|
return new _AgentsSkillsSkill({
|
|
@@ -15169,10 +15523,10 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
15169
15523
|
};
|
|
15170
15524
|
|
|
15171
15525
|
// src/features/skills/antigravity-shared-skill.ts
|
|
15172
|
-
var
|
|
15526
|
+
var import_node_path97 = require("path");
|
|
15173
15527
|
|
|
15174
15528
|
// src/features/skills/antigravity-skill.ts
|
|
15175
|
-
var
|
|
15529
|
+
var import_node_path96 = require("path");
|
|
15176
15530
|
var import_mini43 = require("zod/mini");
|
|
15177
15531
|
var AntigravitySkillFrontmatterSchema = import_mini43.z.looseObject({
|
|
15178
15532
|
name: import_mini43.z.string(),
|
|
@@ -15181,7 +15535,7 @@ var AntigravitySkillFrontmatterSchema = import_mini43.z.looseObject({
|
|
|
15181
15535
|
var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
15182
15536
|
constructor({
|
|
15183
15537
|
outputRoot = process.cwd(),
|
|
15184
|
-
relativeDirPath = (0,
|
|
15538
|
+
relativeDirPath = (0, import_node_path96.join)(".agent", "skills"),
|
|
15185
15539
|
dirName,
|
|
15186
15540
|
frontmatter,
|
|
15187
15541
|
body,
|
|
@@ -15213,11 +15567,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
15213
15567
|
} = {}) {
|
|
15214
15568
|
if (global) {
|
|
15215
15569
|
return {
|
|
15216
|
-
relativeDirPath: (0,
|
|
15570
|
+
relativeDirPath: (0, import_node_path96.join)(".gemini", "antigravity", "skills")
|
|
15217
15571
|
};
|
|
15218
15572
|
}
|
|
15219
15573
|
return {
|
|
15220
|
-
relativeDirPath: (0,
|
|
15574
|
+
relativeDirPath: (0, import_node_path96.join)(".agent", "skills")
|
|
15221
15575
|
};
|
|
15222
15576
|
}
|
|
15223
15577
|
getFrontmatter() {
|
|
@@ -15297,9 +15651,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
15297
15651
|
});
|
|
15298
15652
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
15299
15653
|
if (!result.success) {
|
|
15300
|
-
const skillDirPath = (0,
|
|
15654
|
+
const skillDirPath = (0, import_node_path96.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
15301
15655
|
throw new Error(
|
|
15302
|
-
`Invalid frontmatter in ${(0,
|
|
15656
|
+
`Invalid frontmatter in ${(0, import_node_path96.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
15303
15657
|
);
|
|
15304
15658
|
}
|
|
15305
15659
|
return new _AntigravitySkill({
|
|
@@ -15336,7 +15690,7 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
15336
15690
|
var AntigravitySharedSkill = class extends ToolSkill {
|
|
15337
15691
|
constructor({
|
|
15338
15692
|
outputRoot = process.cwd(),
|
|
15339
|
-
relativeDirPath = (0,
|
|
15693
|
+
relativeDirPath = (0, import_node_path97.join)(".agents", "skills"),
|
|
15340
15694
|
dirName,
|
|
15341
15695
|
frontmatter,
|
|
15342
15696
|
body,
|
|
@@ -15376,11 +15730,11 @@ var AntigravitySharedSkill = class extends ToolSkill {
|
|
|
15376
15730
|
} = {}) {
|
|
15377
15731
|
if (global) {
|
|
15378
15732
|
return {
|
|
15379
|
-
relativeDirPath: (0,
|
|
15733
|
+
relativeDirPath: (0, import_node_path97.join)(".gemini", this.getGlobalSubdir(), "skills")
|
|
15380
15734
|
};
|
|
15381
15735
|
}
|
|
15382
15736
|
return {
|
|
15383
|
-
relativeDirPath: (0,
|
|
15737
|
+
relativeDirPath: (0, import_node_path97.join)(".agents", "skills")
|
|
15384
15738
|
};
|
|
15385
15739
|
}
|
|
15386
15740
|
getFrontmatter() {
|
|
@@ -15460,9 +15814,9 @@ var AntigravitySharedSkill = class extends ToolSkill {
|
|
|
15460
15814
|
});
|
|
15461
15815
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
15462
15816
|
if (!result.success) {
|
|
15463
|
-
const skillDirPath = (0,
|
|
15817
|
+
const skillDirPath = (0, import_node_path97.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
15464
15818
|
throw new Error(
|
|
15465
|
-
`Invalid frontmatter in ${(0,
|
|
15819
|
+
`Invalid frontmatter in ${(0, import_node_path97.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
15466
15820
|
);
|
|
15467
15821
|
}
|
|
15468
15822
|
return new this({
|
|
@@ -15516,10 +15870,10 @@ var AntigravityIdeSkill = class extends AntigravitySharedSkill {
|
|
|
15516
15870
|
};
|
|
15517
15871
|
|
|
15518
15872
|
// src/features/skills/claudecode-skill.ts
|
|
15519
|
-
var
|
|
15873
|
+
var import_node_path98 = require("path");
|
|
15520
15874
|
var import_mini44 = require("zod/mini");
|
|
15521
|
-
var CLAUDE_SKILLS_DIR_PATH = (0,
|
|
15522
|
-
var CLAUDE_SCHEDULED_TASKS_DIR_PATH = (0,
|
|
15875
|
+
var CLAUDE_SKILLS_DIR_PATH = (0, import_node_path98.join)(".claude", "skills");
|
|
15876
|
+
var CLAUDE_SCHEDULED_TASKS_DIR_PATH = (0, import_node_path98.join)(".claude", "scheduled-tasks");
|
|
15523
15877
|
var ClaudecodeSkillFrontmatterSchema = import_mini44.z.looseObject({
|
|
15524
15878
|
name: import_mini44.z.string(),
|
|
15525
15879
|
description: import_mini44.z.string(),
|
|
@@ -15531,7 +15885,7 @@ var ClaudecodeSkillFrontmatterSchema = import_mini44.z.looseObject({
|
|
|
15531
15885
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
15532
15886
|
constructor({
|
|
15533
15887
|
outputRoot = process.cwd(),
|
|
15534
|
-
relativeDirPath = (0,
|
|
15888
|
+
relativeDirPath = (0, import_node_path98.join)(".claude", "skills"),
|
|
15535
15889
|
dirName,
|
|
15536
15890
|
frontmatter,
|
|
15537
15891
|
body,
|
|
@@ -15670,9 +16024,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
15670
16024
|
});
|
|
15671
16025
|
const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
15672
16026
|
if (!result.success) {
|
|
15673
|
-
const skillDirPath = (0,
|
|
16027
|
+
const skillDirPath = (0, import_node_path98.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
15674
16028
|
throw new Error(
|
|
15675
|
-
`Invalid frontmatter in ${(0,
|
|
16029
|
+
`Invalid frontmatter in ${(0, import_node_path98.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
15676
16030
|
);
|
|
15677
16031
|
}
|
|
15678
16032
|
return new _ClaudecodeSkill({
|
|
@@ -15706,7 +16060,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
15706
16060
|
};
|
|
15707
16061
|
|
|
15708
16062
|
// src/features/skills/cline-skill.ts
|
|
15709
|
-
var
|
|
16063
|
+
var import_node_path99 = require("path");
|
|
15710
16064
|
var import_mini45 = require("zod/mini");
|
|
15711
16065
|
var ClineSkillFrontmatterSchema = import_mini45.z.looseObject({
|
|
15712
16066
|
name: import_mini45.z.string(),
|
|
@@ -15715,7 +16069,7 @@ var ClineSkillFrontmatterSchema = import_mini45.z.looseObject({
|
|
|
15715
16069
|
var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
15716
16070
|
constructor({
|
|
15717
16071
|
outputRoot = process.cwd(),
|
|
15718
|
-
relativeDirPath = (0,
|
|
16072
|
+
relativeDirPath = (0, import_node_path99.join)(".cline", "skills"),
|
|
15719
16073
|
dirName,
|
|
15720
16074
|
frontmatter,
|
|
15721
16075
|
body,
|
|
@@ -15744,7 +16098,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
15744
16098
|
}
|
|
15745
16099
|
static getSettablePaths(_options = {}) {
|
|
15746
16100
|
return {
|
|
15747
|
-
relativeDirPath: (0,
|
|
16101
|
+
relativeDirPath: (0, import_node_path99.join)(".cline", "skills")
|
|
15748
16102
|
};
|
|
15749
16103
|
}
|
|
15750
16104
|
getFrontmatter() {
|
|
@@ -15832,13 +16186,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
15832
16186
|
});
|
|
15833
16187
|
const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
15834
16188
|
if (!result.success) {
|
|
15835
|
-
const skillDirPath = (0,
|
|
16189
|
+
const skillDirPath = (0, import_node_path99.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
15836
16190
|
throw new Error(
|
|
15837
|
-
`Invalid frontmatter in ${(0,
|
|
16191
|
+
`Invalid frontmatter in ${(0, import_node_path99.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
15838
16192
|
);
|
|
15839
16193
|
}
|
|
15840
16194
|
if (result.data.name !== loaded.dirName) {
|
|
15841
|
-
const skillFilePath = (0,
|
|
16195
|
+
const skillFilePath = (0, import_node_path99.join)(
|
|
15842
16196
|
loaded.outputRoot,
|
|
15843
16197
|
loaded.relativeDirPath,
|
|
15844
16198
|
loaded.dirName,
|
|
@@ -15879,7 +16233,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
15879
16233
|
};
|
|
15880
16234
|
|
|
15881
16235
|
// src/features/skills/codexcli-skill.ts
|
|
15882
|
-
var
|
|
16236
|
+
var import_node_path100 = require("path");
|
|
15883
16237
|
var import_mini46 = require("zod/mini");
|
|
15884
16238
|
var CodexCliSkillFrontmatterSchema = import_mini46.z.looseObject({
|
|
15885
16239
|
name: import_mini46.z.string(),
|
|
@@ -15893,7 +16247,7 @@ var CodexCliSkillFrontmatterSchema = import_mini46.z.looseObject({
|
|
|
15893
16247
|
var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
15894
16248
|
constructor({
|
|
15895
16249
|
outputRoot = process.cwd(),
|
|
15896
|
-
relativeDirPath = (0,
|
|
16250
|
+
relativeDirPath = (0, import_node_path100.join)(".codex", "skills"),
|
|
15897
16251
|
dirName,
|
|
15898
16252
|
frontmatter,
|
|
15899
16253
|
body,
|
|
@@ -15924,7 +16278,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
15924
16278
|
global: _global = false
|
|
15925
16279
|
} = {}) {
|
|
15926
16280
|
return {
|
|
15927
|
-
relativeDirPath: (0,
|
|
16281
|
+
relativeDirPath: (0, import_node_path100.join)(".codex", "skills")
|
|
15928
16282
|
};
|
|
15929
16283
|
}
|
|
15930
16284
|
getFrontmatter() {
|
|
@@ -16014,9 +16368,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
16014
16368
|
});
|
|
16015
16369
|
const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
16016
16370
|
if (!result.success) {
|
|
16017
|
-
const skillDirPath = (0,
|
|
16371
|
+
const skillDirPath = (0, import_node_path100.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
16018
16372
|
throw new Error(
|
|
16019
|
-
`Invalid frontmatter in ${(0,
|
|
16373
|
+
`Invalid frontmatter in ${(0, import_node_path100.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
16020
16374
|
);
|
|
16021
16375
|
}
|
|
16022
16376
|
return new _CodexCliSkill({
|
|
@@ -16050,7 +16404,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
16050
16404
|
};
|
|
16051
16405
|
|
|
16052
16406
|
// src/features/skills/copilot-skill.ts
|
|
16053
|
-
var
|
|
16407
|
+
var import_node_path101 = require("path");
|
|
16054
16408
|
var import_mini47 = require("zod/mini");
|
|
16055
16409
|
var CopilotSkillFrontmatterSchema = import_mini47.z.looseObject({
|
|
16056
16410
|
name: import_mini47.z.string(),
|
|
@@ -16060,7 +16414,7 @@ var CopilotSkillFrontmatterSchema = import_mini47.z.looseObject({
|
|
|
16060
16414
|
var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
16061
16415
|
constructor({
|
|
16062
16416
|
outputRoot = process.cwd(),
|
|
16063
|
-
relativeDirPath = (0,
|
|
16417
|
+
relativeDirPath = (0, import_node_path101.join)(".github", "skills"),
|
|
16064
16418
|
dirName,
|
|
16065
16419
|
frontmatter,
|
|
16066
16420
|
body,
|
|
@@ -16092,7 +16446,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
16092
16446
|
throw new Error("CopilotSkill does not support global mode.");
|
|
16093
16447
|
}
|
|
16094
16448
|
return {
|
|
16095
|
-
relativeDirPath: (0,
|
|
16449
|
+
relativeDirPath: (0, import_node_path101.join)(".github", "skills")
|
|
16096
16450
|
};
|
|
16097
16451
|
}
|
|
16098
16452
|
getFrontmatter() {
|
|
@@ -16178,9 +16532,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
16178
16532
|
});
|
|
16179
16533
|
const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
16180
16534
|
if (!result.success) {
|
|
16181
|
-
const skillDirPath = (0,
|
|
16535
|
+
const skillDirPath = (0, import_node_path101.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
16182
16536
|
throw new Error(
|
|
16183
|
-
`Invalid frontmatter in ${(0,
|
|
16537
|
+
`Invalid frontmatter in ${(0, import_node_path101.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
16184
16538
|
);
|
|
16185
16539
|
}
|
|
16186
16540
|
return new _CopilotSkill({
|
|
@@ -16215,7 +16569,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
16215
16569
|
};
|
|
16216
16570
|
|
|
16217
16571
|
// src/features/skills/cursor-skill.ts
|
|
16218
|
-
var
|
|
16572
|
+
var import_node_path102 = require("path");
|
|
16219
16573
|
var import_mini48 = require("zod/mini");
|
|
16220
16574
|
var CursorSkillFrontmatterSchema = import_mini48.z.looseObject({
|
|
16221
16575
|
name: import_mini48.z.string(),
|
|
@@ -16224,7 +16578,7 @@ var CursorSkillFrontmatterSchema = import_mini48.z.looseObject({
|
|
|
16224
16578
|
var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
16225
16579
|
constructor({
|
|
16226
16580
|
outputRoot = process.cwd(),
|
|
16227
|
-
relativeDirPath = (0,
|
|
16581
|
+
relativeDirPath = (0, import_node_path102.join)(".cursor", "skills"),
|
|
16228
16582
|
dirName,
|
|
16229
16583
|
frontmatter,
|
|
16230
16584
|
body,
|
|
@@ -16253,7 +16607,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
16253
16607
|
}
|
|
16254
16608
|
static getSettablePaths(_options) {
|
|
16255
16609
|
return {
|
|
16256
|
-
relativeDirPath: (0,
|
|
16610
|
+
relativeDirPath: (0, import_node_path102.join)(".cursor", "skills")
|
|
16257
16611
|
};
|
|
16258
16612
|
}
|
|
16259
16613
|
getFrontmatter() {
|
|
@@ -16333,9 +16687,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
16333
16687
|
});
|
|
16334
16688
|
const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
16335
16689
|
if (!result.success) {
|
|
16336
|
-
const skillDirPath = (0,
|
|
16690
|
+
const skillDirPath = (0, import_node_path102.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
16337
16691
|
throw new Error(
|
|
16338
|
-
`Invalid frontmatter in ${(0,
|
|
16692
|
+
`Invalid frontmatter in ${(0, import_node_path102.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
16339
16693
|
);
|
|
16340
16694
|
}
|
|
16341
16695
|
return new _CursorSkill({
|
|
@@ -16370,7 +16724,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
16370
16724
|
};
|
|
16371
16725
|
|
|
16372
16726
|
// src/features/skills/deepagents-skill.ts
|
|
16373
|
-
var
|
|
16727
|
+
var import_node_path103 = require("path");
|
|
16374
16728
|
var import_mini49 = require("zod/mini");
|
|
16375
16729
|
var DeepagentsSkillFrontmatterSchema = import_mini49.z.looseObject({
|
|
16376
16730
|
name: import_mini49.z.string(),
|
|
@@ -16380,7 +16734,7 @@ var DeepagentsSkillFrontmatterSchema = import_mini49.z.looseObject({
|
|
|
16380
16734
|
var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
16381
16735
|
constructor({
|
|
16382
16736
|
outputRoot = process.cwd(),
|
|
16383
|
-
relativeDirPath = (0,
|
|
16737
|
+
relativeDirPath = (0, import_node_path103.join)(".deepagents", "skills"),
|
|
16384
16738
|
dirName,
|
|
16385
16739
|
frontmatter,
|
|
16386
16740
|
body,
|
|
@@ -16409,7 +16763,7 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
16409
16763
|
}
|
|
16410
16764
|
static getSettablePaths(_options) {
|
|
16411
16765
|
return {
|
|
16412
|
-
relativeDirPath: (0,
|
|
16766
|
+
relativeDirPath: (0, import_node_path103.join)(".deepagents", "skills")
|
|
16413
16767
|
};
|
|
16414
16768
|
}
|
|
16415
16769
|
getFrontmatter() {
|
|
@@ -16495,9 +16849,9 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
16495
16849
|
});
|
|
16496
16850
|
const result = DeepagentsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
16497
16851
|
if (!result.success) {
|
|
16498
|
-
const skillDirPath = (0,
|
|
16852
|
+
const skillDirPath = (0, import_node_path103.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
16499
16853
|
throw new Error(
|
|
16500
|
-
`Invalid frontmatter in ${(0,
|
|
16854
|
+
`Invalid frontmatter in ${(0, import_node_path103.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
16501
16855
|
);
|
|
16502
16856
|
}
|
|
16503
16857
|
return new _DeepagentsSkill({
|
|
@@ -16532,7 +16886,7 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
16532
16886
|
};
|
|
16533
16887
|
|
|
16534
16888
|
// src/features/skills/geminicli-skill.ts
|
|
16535
|
-
var
|
|
16889
|
+
var import_node_path104 = require("path");
|
|
16536
16890
|
var import_mini50 = require("zod/mini");
|
|
16537
16891
|
var GeminiCliSkillFrontmatterSchema = import_mini50.z.looseObject({
|
|
16538
16892
|
name: import_mini50.z.string(),
|
|
@@ -16572,7 +16926,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
16572
16926
|
global: _global = false
|
|
16573
16927
|
} = {}) {
|
|
16574
16928
|
return {
|
|
16575
|
-
relativeDirPath: (0,
|
|
16929
|
+
relativeDirPath: (0, import_node_path104.join)(".gemini", "skills")
|
|
16576
16930
|
};
|
|
16577
16931
|
}
|
|
16578
16932
|
getFrontmatter() {
|
|
@@ -16652,9 +17006,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
16652
17006
|
});
|
|
16653
17007
|
const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
16654
17008
|
if (!result.success) {
|
|
16655
|
-
const skillDirPath = (0,
|
|
17009
|
+
const skillDirPath = (0, import_node_path104.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
16656
17010
|
throw new Error(
|
|
16657
|
-
`Invalid frontmatter in ${(0,
|
|
17011
|
+
`Invalid frontmatter in ${(0, import_node_path104.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
16658
17012
|
);
|
|
16659
17013
|
}
|
|
16660
17014
|
return new _GeminiCliSkill({
|
|
@@ -16689,7 +17043,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
16689
17043
|
};
|
|
16690
17044
|
|
|
16691
17045
|
// src/features/skills/junie-skill.ts
|
|
16692
|
-
var
|
|
17046
|
+
var import_node_path105 = require("path");
|
|
16693
17047
|
var import_mini51 = require("zod/mini");
|
|
16694
17048
|
var JunieSkillFrontmatterSchema = import_mini51.z.looseObject({
|
|
16695
17049
|
name: import_mini51.z.string(),
|
|
@@ -16698,7 +17052,7 @@ var JunieSkillFrontmatterSchema = import_mini51.z.looseObject({
|
|
|
16698
17052
|
var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
16699
17053
|
constructor({
|
|
16700
17054
|
outputRoot = process.cwd(),
|
|
16701
|
-
relativeDirPath = (0,
|
|
17055
|
+
relativeDirPath = (0, import_node_path105.join)(".junie", "skills"),
|
|
16702
17056
|
dirName,
|
|
16703
17057
|
frontmatter,
|
|
16704
17058
|
body,
|
|
@@ -16730,7 +17084,7 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
16730
17084
|
throw new Error("JunieSkill does not support global mode.");
|
|
16731
17085
|
}
|
|
16732
17086
|
return {
|
|
16733
|
-
relativeDirPath: (0,
|
|
17087
|
+
relativeDirPath: (0, import_node_path105.join)(".junie", "skills")
|
|
16734
17088
|
};
|
|
16735
17089
|
}
|
|
16736
17090
|
getFrontmatter() {
|
|
@@ -16817,13 +17171,13 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
16817
17171
|
});
|
|
16818
17172
|
const result = JunieSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
16819
17173
|
if (!result.success) {
|
|
16820
|
-
const skillDirPath = (0,
|
|
17174
|
+
const skillDirPath = (0, import_node_path105.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
16821
17175
|
throw new Error(
|
|
16822
|
-
`Invalid frontmatter in ${(0,
|
|
17176
|
+
`Invalid frontmatter in ${(0, import_node_path105.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
16823
17177
|
);
|
|
16824
17178
|
}
|
|
16825
17179
|
if (result.data.name !== loaded.dirName) {
|
|
16826
|
-
const skillFilePath = (0,
|
|
17180
|
+
const skillFilePath = (0, import_node_path105.join)(
|
|
16827
17181
|
loaded.outputRoot,
|
|
16828
17182
|
loaded.relativeDirPath,
|
|
16829
17183
|
loaded.dirName,
|
|
@@ -16865,7 +17219,7 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
16865
17219
|
};
|
|
16866
17220
|
|
|
16867
17221
|
// src/features/skills/kilo-skill.ts
|
|
16868
|
-
var
|
|
17222
|
+
var import_node_path106 = require("path");
|
|
16869
17223
|
var import_mini52 = require("zod/mini");
|
|
16870
17224
|
var KiloSkillFrontmatterSchema = import_mini52.z.looseObject({
|
|
16871
17225
|
name: import_mini52.z.string(),
|
|
@@ -16875,7 +17229,7 @@ var KiloSkillFrontmatterSchema = import_mini52.z.looseObject({
|
|
|
16875
17229
|
var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
16876
17230
|
constructor({
|
|
16877
17231
|
outputRoot = process.cwd(),
|
|
16878
|
-
relativeDirPath = (0,
|
|
17232
|
+
relativeDirPath = (0, import_node_path106.join)(".kilo", "skills"),
|
|
16879
17233
|
dirName,
|
|
16880
17234
|
frontmatter,
|
|
16881
17235
|
body,
|
|
@@ -16904,7 +17258,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
16904
17258
|
}
|
|
16905
17259
|
static getSettablePaths({ global = false } = {}) {
|
|
16906
17260
|
return {
|
|
16907
|
-
relativeDirPath: global ? (0,
|
|
17261
|
+
relativeDirPath: global ? (0, import_node_path106.join)(".config", "kilo", "skills") : (0, import_node_path106.join)(".kilo", "skills")
|
|
16908
17262
|
};
|
|
16909
17263
|
}
|
|
16910
17264
|
getFrontmatter() {
|
|
@@ -16990,9 +17344,9 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
16990
17344
|
});
|
|
16991
17345
|
const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
16992
17346
|
if (!result.success) {
|
|
16993
|
-
const skillDirPath = (0,
|
|
17347
|
+
const skillDirPath = (0, import_node_path106.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
16994
17348
|
throw new Error(
|
|
16995
|
-
`Invalid frontmatter in ${(0,
|
|
17349
|
+
`Invalid frontmatter in ${(0, import_node_path106.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
16996
17350
|
);
|
|
16997
17351
|
}
|
|
16998
17352
|
return new _KiloSkill({
|
|
@@ -17026,7 +17380,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
17026
17380
|
};
|
|
17027
17381
|
|
|
17028
17382
|
// src/features/skills/kiro-skill.ts
|
|
17029
|
-
var
|
|
17383
|
+
var import_node_path107 = require("path");
|
|
17030
17384
|
var import_mini53 = require("zod/mini");
|
|
17031
17385
|
var KiroSkillFrontmatterSchema = import_mini53.z.looseObject({
|
|
17032
17386
|
name: import_mini53.z.string(),
|
|
@@ -17035,7 +17389,7 @@ var KiroSkillFrontmatterSchema = import_mini53.z.looseObject({
|
|
|
17035
17389
|
var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
17036
17390
|
constructor({
|
|
17037
17391
|
outputRoot = process.cwd(),
|
|
17038
|
-
relativeDirPath = (0,
|
|
17392
|
+
relativeDirPath = (0, import_node_path107.join)(".kiro", "skills"),
|
|
17039
17393
|
dirName,
|
|
17040
17394
|
frontmatter,
|
|
17041
17395
|
body,
|
|
@@ -17067,7 +17421,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
17067
17421
|
throw new Error("KiroSkill does not support global mode.");
|
|
17068
17422
|
}
|
|
17069
17423
|
return {
|
|
17070
|
-
relativeDirPath: (0,
|
|
17424
|
+
relativeDirPath: (0, import_node_path107.join)(".kiro", "skills")
|
|
17071
17425
|
};
|
|
17072
17426
|
}
|
|
17073
17427
|
getFrontmatter() {
|
|
@@ -17155,13 +17509,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
17155
17509
|
});
|
|
17156
17510
|
const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
17157
17511
|
if (!result.success) {
|
|
17158
|
-
const skillDirPath = (0,
|
|
17512
|
+
const skillDirPath = (0, import_node_path107.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
17159
17513
|
throw new Error(
|
|
17160
|
-
`Invalid frontmatter in ${(0,
|
|
17514
|
+
`Invalid frontmatter in ${(0, import_node_path107.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
17161
17515
|
);
|
|
17162
17516
|
}
|
|
17163
17517
|
if (result.data.name !== loaded.dirName) {
|
|
17164
|
-
const skillFilePath = (0,
|
|
17518
|
+
const skillFilePath = (0, import_node_path107.join)(
|
|
17165
17519
|
loaded.outputRoot,
|
|
17166
17520
|
loaded.relativeDirPath,
|
|
17167
17521
|
loaded.dirName,
|
|
@@ -17203,7 +17557,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
17203
17557
|
};
|
|
17204
17558
|
|
|
17205
17559
|
// src/features/skills/opencode-skill.ts
|
|
17206
|
-
var
|
|
17560
|
+
var import_node_path108 = require("path");
|
|
17207
17561
|
var import_mini54 = require("zod/mini");
|
|
17208
17562
|
var OpenCodeSkillFrontmatterSchema = import_mini54.z.looseObject({
|
|
17209
17563
|
name: import_mini54.z.string(),
|
|
@@ -17213,7 +17567,7 @@ var OpenCodeSkillFrontmatterSchema = import_mini54.z.looseObject({
|
|
|
17213
17567
|
var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
17214
17568
|
constructor({
|
|
17215
17569
|
outputRoot = process.cwd(),
|
|
17216
|
-
relativeDirPath = (0,
|
|
17570
|
+
relativeDirPath = (0, import_node_path108.join)(".opencode", "skill"),
|
|
17217
17571
|
dirName,
|
|
17218
17572
|
frontmatter,
|
|
17219
17573
|
body,
|
|
@@ -17242,7 +17596,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
17242
17596
|
}
|
|
17243
17597
|
static getSettablePaths({ global = false } = {}) {
|
|
17244
17598
|
return {
|
|
17245
|
-
relativeDirPath: global ? (0,
|
|
17599
|
+
relativeDirPath: global ? (0, import_node_path108.join)(".config", "opencode", "skill") : (0, import_node_path108.join)(".opencode", "skill")
|
|
17246
17600
|
};
|
|
17247
17601
|
}
|
|
17248
17602
|
getFrontmatter() {
|
|
@@ -17328,9 +17682,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
17328
17682
|
});
|
|
17329
17683
|
const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
17330
17684
|
if (!result.success) {
|
|
17331
|
-
const skillDirPath = (0,
|
|
17685
|
+
const skillDirPath = (0, import_node_path108.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
17332
17686
|
throw new Error(
|
|
17333
|
-
`Invalid frontmatter in ${(0,
|
|
17687
|
+
`Invalid frontmatter in ${(0, import_node_path108.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
17334
17688
|
);
|
|
17335
17689
|
}
|
|
17336
17690
|
return new _OpenCodeSkill({
|
|
@@ -17364,11 +17718,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
17364
17718
|
};
|
|
17365
17719
|
|
|
17366
17720
|
// src/features/skills/pi-skill.ts
|
|
17367
|
-
var
|
|
17721
|
+
var import_node_path109 = require("path");
|
|
17368
17722
|
var import_mini55 = require("zod/mini");
|
|
17369
17723
|
var PiSkillFrontmatterSchema = import_mini55.z.looseObject({
|
|
17370
17724
|
name: import_mini55.z.string(),
|
|
17371
|
-
description: import_mini55.z.string()
|
|
17725
|
+
description: import_mini55.z.string(),
|
|
17726
|
+
"allowed-tools": import_mini55.z.optional(import_mini55.z.array(import_mini55.z.string())),
|
|
17727
|
+
"disable-model-invocation": import_mini55.z.optional(import_mini55.z.boolean()),
|
|
17728
|
+
license: import_mini55.z.optional(import_mini55.z.string()),
|
|
17729
|
+
compatibility: import_mini55.z.optional(import_mini55.z.looseObject({})),
|
|
17730
|
+
metadata: import_mini55.z.optional(import_mini55.z.looseObject({}))
|
|
17372
17731
|
});
|
|
17373
17732
|
var PiSkill = class _PiSkill extends ToolSkill {
|
|
17374
17733
|
constructor({
|
|
@@ -17404,11 +17763,11 @@ var PiSkill = class _PiSkill extends ToolSkill {
|
|
|
17404
17763
|
static getSettablePaths({ global } = {}) {
|
|
17405
17764
|
if (global) {
|
|
17406
17765
|
return {
|
|
17407
|
-
relativeDirPath: (0,
|
|
17766
|
+
relativeDirPath: (0, import_node_path109.join)(".pi", "agent", "skills")
|
|
17408
17767
|
};
|
|
17409
17768
|
}
|
|
17410
17769
|
return {
|
|
17411
|
-
relativeDirPath: (0,
|
|
17770
|
+
relativeDirPath: (0, import_node_path109.join)(".pi", "skills")
|
|
17412
17771
|
};
|
|
17413
17772
|
}
|
|
17414
17773
|
getFrontmatter() {
|
|
@@ -17437,10 +17796,24 @@ var PiSkill = class _PiSkill extends ToolSkill {
|
|
|
17437
17796
|
}
|
|
17438
17797
|
toRulesyncSkill() {
|
|
17439
17798
|
const frontmatter = this.getFrontmatter();
|
|
17799
|
+
const piBlock = {
|
|
17800
|
+
...frontmatter["allowed-tools"] !== void 0 && {
|
|
17801
|
+
"allowed-tools": frontmatter["allowed-tools"]
|
|
17802
|
+
},
|
|
17803
|
+
...frontmatter["disable-model-invocation"] !== void 0 && {
|
|
17804
|
+
"disable-model-invocation": frontmatter["disable-model-invocation"]
|
|
17805
|
+
},
|
|
17806
|
+
...frontmatter.license !== void 0 && { license: frontmatter.license },
|
|
17807
|
+
...frontmatter.compatibility !== void 0 && {
|
|
17808
|
+
compatibility: frontmatter.compatibility
|
|
17809
|
+
},
|
|
17810
|
+
...frontmatter.metadata !== void 0 && { metadata: frontmatter.metadata }
|
|
17811
|
+
};
|
|
17440
17812
|
const rulesyncFrontmatter = {
|
|
17441
17813
|
name: frontmatter.name,
|
|
17442
17814
|
description: frontmatter.description,
|
|
17443
|
-
targets: ["*"]
|
|
17815
|
+
targets: ["*"],
|
|
17816
|
+
...Object.keys(piBlock).length > 0 && { pi: piBlock }
|
|
17444
17817
|
};
|
|
17445
17818
|
return new RulesyncSkill({
|
|
17446
17819
|
outputRoot: this.outputRoot,
|
|
@@ -17463,7 +17836,8 @@ var PiSkill = class _PiSkill extends ToolSkill {
|
|
|
17463
17836
|
const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
|
|
17464
17837
|
const piFrontmatter = {
|
|
17465
17838
|
name: rulesyncFrontmatter.name,
|
|
17466
|
-
description: rulesyncFrontmatter.description
|
|
17839
|
+
description: rulesyncFrontmatter.description,
|
|
17840
|
+
...rulesyncFrontmatter.pi
|
|
17467
17841
|
};
|
|
17468
17842
|
return new _PiSkill({
|
|
17469
17843
|
outputRoot,
|
|
@@ -17487,9 +17861,9 @@ var PiSkill = class _PiSkill extends ToolSkill {
|
|
|
17487
17861
|
});
|
|
17488
17862
|
const result = PiSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
17489
17863
|
if (!result.success) {
|
|
17490
|
-
const skillDirPath = (0,
|
|
17864
|
+
const skillDirPath = (0, import_node_path109.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
17491
17865
|
throw new Error(
|
|
17492
|
-
`Invalid frontmatter in ${(0,
|
|
17866
|
+
`Invalid frontmatter in ${(0, import_node_path109.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
17493
17867
|
);
|
|
17494
17868
|
}
|
|
17495
17869
|
return new _PiSkill({
|
|
@@ -17524,16 +17898,20 @@ var PiSkill = class _PiSkill extends ToolSkill {
|
|
|
17524
17898
|
};
|
|
17525
17899
|
|
|
17526
17900
|
// src/features/skills/replit-skill.ts
|
|
17527
|
-
var
|
|
17901
|
+
var import_node_path110 = require("path");
|
|
17528
17902
|
var import_mini56 = require("zod/mini");
|
|
17529
17903
|
var ReplitSkillFrontmatterSchema = import_mini56.z.looseObject({
|
|
17530
17904
|
name: import_mini56.z.string(),
|
|
17531
|
-
description: import_mini56.z.string()
|
|
17905
|
+
description: import_mini56.z.string(),
|
|
17906
|
+
"allowed-tools": import_mini56.z.optional(import_mini56.z.array(import_mini56.z.string())),
|
|
17907
|
+
license: import_mini56.z.optional(import_mini56.z.string()),
|
|
17908
|
+
compatibility: import_mini56.z.optional(import_mini56.z.looseObject({})),
|
|
17909
|
+
metadata: import_mini56.z.optional(import_mini56.z.looseObject({}))
|
|
17532
17910
|
});
|
|
17533
17911
|
var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
17534
17912
|
constructor({
|
|
17535
17913
|
outputRoot = process.cwd(),
|
|
17536
|
-
relativeDirPath = (0,
|
|
17914
|
+
relativeDirPath = (0, import_node_path110.join)(".agents", "skills"),
|
|
17537
17915
|
dirName,
|
|
17538
17916
|
frontmatter,
|
|
17539
17917
|
body,
|
|
@@ -17565,7 +17943,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
17565
17943
|
throw new Error("ReplitSkill does not support global mode.");
|
|
17566
17944
|
}
|
|
17567
17945
|
return {
|
|
17568
|
-
relativeDirPath: (0,
|
|
17946
|
+
relativeDirPath: (0, import_node_path110.join)(".agents", "skills")
|
|
17569
17947
|
};
|
|
17570
17948
|
}
|
|
17571
17949
|
getFrontmatter() {
|
|
@@ -17595,10 +17973,21 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
17595
17973
|
}
|
|
17596
17974
|
toRulesyncSkill() {
|
|
17597
17975
|
const frontmatter = this.getFrontmatter();
|
|
17976
|
+
const replitBlock = {
|
|
17977
|
+
...frontmatter["allowed-tools"] !== void 0 && {
|
|
17978
|
+
"allowed-tools": frontmatter["allowed-tools"]
|
|
17979
|
+
},
|
|
17980
|
+
...frontmatter.license !== void 0 && { license: frontmatter.license },
|
|
17981
|
+
...frontmatter.compatibility !== void 0 && {
|
|
17982
|
+
compatibility: frontmatter.compatibility
|
|
17983
|
+
},
|
|
17984
|
+
...frontmatter.metadata !== void 0 && { metadata: frontmatter.metadata }
|
|
17985
|
+
};
|
|
17598
17986
|
const rulesyncFrontmatter = {
|
|
17599
17987
|
name: frontmatter.name,
|
|
17600
17988
|
description: frontmatter.description,
|
|
17601
|
-
targets: ["*"]
|
|
17989
|
+
targets: ["*"],
|
|
17990
|
+
...Object.keys(replitBlock).length > 0 && { replit: replitBlock }
|
|
17602
17991
|
};
|
|
17603
17992
|
return new RulesyncSkill({
|
|
17604
17993
|
outputRoot: this.outputRoot,
|
|
@@ -17621,7 +18010,8 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
17621
18010
|
const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
|
|
17622
18011
|
const replitFrontmatter = {
|
|
17623
18012
|
name: rulesyncFrontmatter.name,
|
|
17624
|
-
description: rulesyncFrontmatter.description
|
|
18013
|
+
description: rulesyncFrontmatter.description,
|
|
18014
|
+
...rulesyncFrontmatter.replit
|
|
17625
18015
|
};
|
|
17626
18016
|
return new _ReplitSkill({
|
|
17627
18017
|
outputRoot,
|
|
@@ -17645,9 +18035,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
17645
18035
|
});
|
|
17646
18036
|
const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
17647
18037
|
if (!result.success) {
|
|
17648
|
-
const skillDirPath = (0,
|
|
18038
|
+
const skillDirPath = (0, import_node_path110.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
17649
18039
|
throw new Error(
|
|
17650
|
-
`Invalid frontmatter in ${(0,
|
|
18040
|
+
`Invalid frontmatter in ${(0, import_node_path110.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
17651
18041
|
);
|
|
17652
18042
|
}
|
|
17653
18043
|
return new _ReplitSkill({
|
|
@@ -17682,7 +18072,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
17682
18072
|
};
|
|
17683
18073
|
|
|
17684
18074
|
// src/features/skills/roo-skill.ts
|
|
17685
|
-
var
|
|
18075
|
+
var import_node_path111 = require("path");
|
|
17686
18076
|
var import_mini57 = require("zod/mini");
|
|
17687
18077
|
var RooSkillFrontmatterSchema = import_mini57.z.looseObject({
|
|
17688
18078
|
name: import_mini57.z.string(),
|
|
@@ -17691,7 +18081,7 @@ var RooSkillFrontmatterSchema = import_mini57.z.looseObject({
|
|
|
17691
18081
|
var RooSkill = class _RooSkill extends ToolSkill {
|
|
17692
18082
|
constructor({
|
|
17693
18083
|
outputRoot = process.cwd(),
|
|
17694
|
-
relativeDirPath = (0,
|
|
18084
|
+
relativeDirPath = (0, import_node_path111.join)(".roo", "skills"),
|
|
17695
18085
|
dirName,
|
|
17696
18086
|
frontmatter,
|
|
17697
18087
|
body,
|
|
@@ -17722,7 +18112,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
17722
18112
|
global: _global = false
|
|
17723
18113
|
} = {}) {
|
|
17724
18114
|
return {
|
|
17725
|
-
relativeDirPath: (0,
|
|
18115
|
+
relativeDirPath: (0, import_node_path111.join)(".roo", "skills")
|
|
17726
18116
|
};
|
|
17727
18117
|
}
|
|
17728
18118
|
getFrontmatter() {
|
|
@@ -17810,13 +18200,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
17810
18200
|
});
|
|
17811
18201
|
const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
17812
18202
|
if (!result.success) {
|
|
17813
|
-
const skillDirPath = (0,
|
|
18203
|
+
const skillDirPath = (0, import_node_path111.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
17814
18204
|
throw new Error(
|
|
17815
|
-
`Invalid frontmatter in ${(0,
|
|
18205
|
+
`Invalid frontmatter in ${(0, import_node_path111.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
17816
18206
|
);
|
|
17817
18207
|
}
|
|
17818
18208
|
if (result.data.name !== loaded.dirName) {
|
|
17819
|
-
const skillFilePath = (0,
|
|
18209
|
+
const skillFilePath = (0, import_node_path111.join)(
|
|
17820
18210
|
loaded.outputRoot,
|
|
17821
18211
|
loaded.relativeDirPath,
|
|
17822
18212
|
loaded.dirName,
|
|
@@ -17857,24 +18247,24 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
17857
18247
|
};
|
|
17858
18248
|
|
|
17859
18249
|
// src/features/skills/skills-utils.ts
|
|
17860
|
-
var
|
|
18250
|
+
var import_node_path112 = require("path");
|
|
17861
18251
|
async function getLocalSkillDirNames(outputRoot) {
|
|
17862
|
-
const skillsDir = (0,
|
|
18252
|
+
const skillsDir = (0, import_node_path112.join)(outputRoot, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
|
|
17863
18253
|
const names = /* @__PURE__ */ new Set();
|
|
17864
18254
|
if (!await directoryExists(skillsDir)) {
|
|
17865
18255
|
return names;
|
|
17866
18256
|
}
|
|
17867
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
18257
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path112.join)(skillsDir, "*"), { type: "dir" });
|
|
17868
18258
|
for (const dirPath of dirPaths) {
|
|
17869
|
-
const name = (0,
|
|
17870
|
-
if (name === (0,
|
|
18259
|
+
const name = (0, import_node_path112.basename)(dirPath);
|
|
18260
|
+
if (name === (0, import_node_path112.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
|
|
17871
18261
|
names.add(name);
|
|
17872
18262
|
}
|
|
17873
18263
|
return names;
|
|
17874
18264
|
}
|
|
17875
18265
|
|
|
17876
18266
|
// src/features/skills/takt-skill.ts
|
|
17877
|
-
var
|
|
18267
|
+
var import_node_path113 = __toESM(require("path"), 1);
|
|
17878
18268
|
var DEFAULT_TAKT_SKILL_DIR = "knowledge";
|
|
17879
18269
|
var TaktSkill = class _TaktSkill extends ToolSkill {
|
|
17880
18270
|
fileName;
|
|
@@ -17911,7 +18301,7 @@ var TaktSkill = class _TaktSkill extends ToolSkill {
|
|
|
17911
18301
|
}
|
|
17912
18302
|
static getSettablePaths(_options = {}) {
|
|
17913
18303
|
return {
|
|
17914
|
-
relativeDirPath: (0,
|
|
18304
|
+
relativeDirPath: (0, import_node_path113.join)(".takt", "facets", DEFAULT_TAKT_SKILL_DIR)
|
|
17915
18305
|
};
|
|
17916
18306
|
}
|
|
17917
18307
|
/**
|
|
@@ -17922,11 +18312,11 @@ var TaktSkill = class _TaktSkill extends ToolSkill {
|
|
|
17922
18312
|
* malicious `relativeDirPath` cannot escape `outputRoot`.
|
|
17923
18313
|
*/
|
|
17924
18314
|
getDirPath() {
|
|
17925
|
-
const fullPath = (0,
|
|
17926
|
-
const resolvedFull = (0,
|
|
17927
|
-
const resolvedBase = (0,
|
|
17928
|
-
const rel = (0,
|
|
17929
|
-
if (rel.startsWith("..") ||
|
|
18315
|
+
const fullPath = (0, import_node_path113.join)(this.outputRoot, this.relativeDirPath);
|
|
18316
|
+
const resolvedFull = (0, import_node_path113.resolve)(fullPath);
|
|
18317
|
+
const resolvedBase = (0, import_node_path113.resolve)(this.outputRoot);
|
|
18318
|
+
const rel = (0, import_node_path113.relative)(resolvedBase, resolvedFull);
|
|
18319
|
+
if (rel.startsWith("..") || import_node_path113.default.isAbsolute(rel)) {
|
|
17930
18320
|
throw new Error(
|
|
17931
18321
|
`Path traversal detected: Final path escapes outputRoot. outputRoot="${this.outputRoot}", relativeDirPath="${this.relativeDirPath}"`
|
|
17932
18322
|
);
|
|
@@ -17963,7 +18353,7 @@ var TaktSkill = class _TaktSkill extends ToolSkill {
|
|
|
17963
18353
|
const stem = overrideName ?? rulesyncSkill.getDirName();
|
|
17964
18354
|
assertSafeTaktName({ name: stem, featureLabel: "skill", sourceLabel });
|
|
17965
18355
|
const fileName = `${stem}.md`;
|
|
17966
|
-
const relativeDirPath = (0,
|
|
18356
|
+
const relativeDirPath = (0, import_node_path113.join)(".takt", "facets", DEFAULT_TAKT_SKILL_DIR);
|
|
17967
18357
|
return new _TaktSkill({
|
|
17968
18358
|
outputRoot,
|
|
17969
18359
|
relativeDirPath,
|
|
@@ -18013,7 +18403,7 @@ var TaktSkill = class _TaktSkill extends ToolSkill {
|
|
|
18013
18403
|
};
|
|
18014
18404
|
|
|
18015
18405
|
// src/features/skills/windsurf-skill.ts
|
|
18016
|
-
var
|
|
18406
|
+
var import_node_path114 = require("path");
|
|
18017
18407
|
var import_mini58 = require("zod/mini");
|
|
18018
18408
|
var WindsurfSkillFrontmatterSchema = import_mini58.z.looseObject({
|
|
18019
18409
|
name: import_mini58.z.string(),
|
|
@@ -18052,11 +18442,11 @@ var WindsurfSkill = class _WindsurfSkill extends ToolSkill {
|
|
|
18052
18442
|
static getSettablePaths({ global = false } = {}) {
|
|
18053
18443
|
if (global) {
|
|
18054
18444
|
return {
|
|
18055
|
-
relativeDirPath: (0,
|
|
18445
|
+
relativeDirPath: (0, import_node_path114.join)(".codeium", "windsurf", "skills")
|
|
18056
18446
|
};
|
|
18057
18447
|
}
|
|
18058
18448
|
return {
|
|
18059
|
-
relativeDirPath: (0,
|
|
18449
|
+
relativeDirPath: (0, import_node_path114.join)(".windsurf", "skills")
|
|
18060
18450
|
};
|
|
18061
18451
|
}
|
|
18062
18452
|
getFrontmatter() {
|
|
@@ -18136,9 +18526,9 @@ var WindsurfSkill = class _WindsurfSkill extends ToolSkill {
|
|
|
18136
18526
|
});
|
|
18137
18527
|
const result = WindsurfSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
18138
18528
|
if (!result.success) {
|
|
18139
|
-
const skillDirPath = (0,
|
|
18529
|
+
const skillDirPath = (0, import_node_path114.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
18140
18530
|
throw new Error(
|
|
18141
|
-
`Invalid frontmatter in ${(0,
|
|
18531
|
+
`Invalid frontmatter in ${(0, import_node_path114.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
18142
18532
|
);
|
|
18143
18533
|
}
|
|
18144
18534
|
return new _WindsurfSkill({
|
|
@@ -18173,7 +18563,7 @@ var WindsurfSkill = class _WindsurfSkill extends ToolSkill {
|
|
|
18173
18563
|
};
|
|
18174
18564
|
|
|
18175
18565
|
// src/features/skills/zed-skill.ts
|
|
18176
|
-
var
|
|
18566
|
+
var import_node_path115 = require("path");
|
|
18177
18567
|
var import_mini59 = require("zod/mini");
|
|
18178
18568
|
var ZedSkillFrontmatterSchema = import_mini59.z.looseObject({
|
|
18179
18569
|
name: import_mini59.z.string(),
|
|
@@ -18183,7 +18573,7 @@ var ZedSkillFrontmatterSchema = import_mini59.z.looseObject({
|
|
|
18183
18573
|
var ZedSkill = class _ZedSkill extends ToolSkill {
|
|
18184
18574
|
constructor({
|
|
18185
18575
|
outputRoot = process.cwd(),
|
|
18186
|
-
relativeDirPath = (0,
|
|
18576
|
+
relativeDirPath = (0, import_node_path115.join)(".agents", "skills"),
|
|
18187
18577
|
dirName,
|
|
18188
18578
|
frontmatter,
|
|
18189
18579
|
body,
|
|
@@ -18212,7 +18602,7 @@ var ZedSkill = class _ZedSkill extends ToolSkill {
|
|
|
18212
18602
|
}
|
|
18213
18603
|
static getSettablePaths(_options) {
|
|
18214
18604
|
return {
|
|
18215
|
-
relativeDirPath: (0,
|
|
18605
|
+
relativeDirPath: (0, import_node_path115.join)(".agents", "skills")
|
|
18216
18606
|
};
|
|
18217
18607
|
}
|
|
18218
18608
|
getFrontmatter() {
|
|
@@ -18291,9 +18681,9 @@ var ZedSkill = class _ZedSkill extends ToolSkill {
|
|
|
18291
18681
|
});
|
|
18292
18682
|
const result = ZedSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
18293
18683
|
if (!result.success) {
|
|
18294
|
-
const skillDirPath = (0,
|
|
18684
|
+
const skillDirPath = (0, import_node_path115.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
18295
18685
|
throw new Error(
|
|
18296
|
-
`Invalid frontmatter in ${(0,
|
|
18686
|
+
`Invalid frontmatter in ${(0, import_node_path115.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
18297
18687
|
);
|
|
18298
18688
|
}
|
|
18299
18689
|
return new _ZedSkill({
|
|
@@ -18627,11 +19017,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
18627
19017
|
)
|
|
18628
19018
|
);
|
|
18629
19019
|
const localSkillNames = new Set(localDirNames);
|
|
18630
|
-
const curatedDirPath = (0,
|
|
19020
|
+
const curatedDirPath = (0, import_node_path116.join)(this.inputRoot, RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
|
|
18631
19021
|
let curatedSkills = [];
|
|
18632
19022
|
if (await directoryExists(curatedDirPath)) {
|
|
18633
|
-
const curatedDirPaths = await findFilesByGlobs((0,
|
|
18634
|
-
const curatedDirNames = curatedDirPaths.map((path4) => (0,
|
|
19023
|
+
const curatedDirPaths = await findFilesByGlobs((0, import_node_path116.join)(curatedDirPath, "*"), { type: "dir" });
|
|
19024
|
+
const curatedDirNames = curatedDirPaths.map((path4) => (0, import_node_path116.basename)(path4));
|
|
18635
19025
|
const nonConflicting = curatedDirNames.filter((name) => {
|
|
18636
19026
|
if (localSkillNames.has(name)) {
|
|
18637
19027
|
this.logger.debug(`Skipping curated skill "${name}": local skill takes precedence.`);
|
|
@@ -18668,13 +19058,13 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
18668
19058
|
const seenDirNames = /* @__PURE__ */ new Set();
|
|
18669
19059
|
const loadEntries = [];
|
|
18670
19060
|
for (const root of roots) {
|
|
18671
|
-
const skillsDirPath = (0,
|
|
19061
|
+
const skillsDirPath = (0, import_node_path116.join)(this.outputRoot, root);
|
|
18672
19062
|
if (!await directoryExists(skillsDirPath)) {
|
|
18673
19063
|
continue;
|
|
18674
19064
|
}
|
|
18675
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
19065
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path116.join)(skillsDirPath, "*"), { type: "dir" });
|
|
18676
19066
|
for (const dirPath of dirPaths) {
|
|
18677
|
-
const dirName = (0,
|
|
19067
|
+
const dirName = (0, import_node_path116.basename)(dirPath);
|
|
18678
19068
|
if (seenDirNames.has(dirName)) {
|
|
18679
19069
|
continue;
|
|
18680
19070
|
}
|
|
@@ -18703,13 +19093,13 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
18703
19093
|
const roots = toolSkillSearchRoots(paths);
|
|
18704
19094
|
const toolSkills = [];
|
|
18705
19095
|
for (const root of roots) {
|
|
18706
|
-
const skillsDirPath = (0,
|
|
19096
|
+
const skillsDirPath = (0, import_node_path116.join)(this.outputRoot, root);
|
|
18707
19097
|
if (!await directoryExists(skillsDirPath)) {
|
|
18708
19098
|
continue;
|
|
18709
19099
|
}
|
|
18710
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
19100
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path116.join)(skillsDirPath, "*"), { type: "dir" });
|
|
18711
19101
|
for (const dirPath of dirPaths) {
|
|
18712
|
-
const dirName = (0,
|
|
19102
|
+
const dirName = (0, import_node_path116.basename)(dirPath);
|
|
18713
19103
|
const toolSkill = factory.class.forDeletion({
|
|
18714
19104
|
outputRoot: this.outputRoot,
|
|
18715
19105
|
relativeDirPath: root,
|
|
@@ -18771,10 +19161,10 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
18771
19161
|
};
|
|
18772
19162
|
|
|
18773
19163
|
// src/features/subagents/agentsmd-subagent.ts
|
|
18774
|
-
var
|
|
19164
|
+
var import_node_path118 = require("path");
|
|
18775
19165
|
|
|
18776
19166
|
// src/features/subagents/simulated-subagent.ts
|
|
18777
|
-
var
|
|
19167
|
+
var import_node_path117 = require("path");
|
|
18778
19168
|
var import_mini61 = require("zod/mini");
|
|
18779
19169
|
|
|
18780
19170
|
// src/features/subagents/tool-subagent.ts
|
|
@@ -18839,7 +19229,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
18839
19229
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
18840
19230
|
if (!result.success) {
|
|
18841
19231
|
throw new Error(
|
|
18842
|
-
`Invalid frontmatter in ${(0,
|
|
19232
|
+
`Invalid frontmatter in ${(0, import_node_path117.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
18843
19233
|
);
|
|
18844
19234
|
}
|
|
18845
19235
|
}
|
|
@@ -18890,7 +19280,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
18890
19280
|
return {
|
|
18891
19281
|
success: false,
|
|
18892
19282
|
error: new Error(
|
|
18893
|
-
`Invalid frontmatter in ${(0,
|
|
19283
|
+
`Invalid frontmatter in ${(0, import_node_path117.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
18894
19284
|
)
|
|
18895
19285
|
};
|
|
18896
19286
|
}
|
|
@@ -18900,7 +19290,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
18900
19290
|
relativeFilePath,
|
|
18901
19291
|
validate = true
|
|
18902
19292
|
}) {
|
|
18903
|
-
const filePath = (0,
|
|
19293
|
+
const filePath = (0, import_node_path117.join)(outputRoot, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
18904
19294
|
const fileContent = await readFileContent(filePath);
|
|
18905
19295
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
18906
19296
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -18910,7 +19300,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
18910
19300
|
return {
|
|
18911
19301
|
outputRoot,
|
|
18912
19302
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
18913
|
-
relativeFilePath: (0,
|
|
19303
|
+
relativeFilePath: (0, import_node_path117.basename)(relativeFilePath),
|
|
18914
19304
|
frontmatter: result.data,
|
|
18915
19305
|
body: content.trim(),
|
|
18916
19306
|
validate
|
|
@@ -18936,7 +19326,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
18936
19326
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
18937
19327
|
static getSettablePaths() {
|
|
18938
19328
|
return {
|
|
18939
|
-
relativeDirPath: (0,
|
|
19329
|
+
relativeDirPath: (0, import_node_path118.join)(".agents", "subagents")
|
|
18940
19330
|
};
|
|
18941
19331
|
}
|
|
18942
19332
|
static async fromFile(params) {
|
|
@@ -18959,11 +19349,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
18959
19349
|
};
|
|
18960
19350
|
|
|
18961
19351
|
// src/features/subagents/factorydroid-subagent.ts
|
|
18962
|
-
var
|
|
19352
|
+
var import_node_path119 = require("path");
|
|
18963
19353
|
var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
|
|
18964
19354
|
static getSettablePaths(_options) {
|
|
18965
19355
|
return {
|
|
18966
|
-
relativeDirPath: (0,
|
|
19356
|
+
relativeDirPath: (0, import_node_path119.join)(".factory", "droids")
|
|
18967
19357
|
};
|
|
18968
19358
|
}
|
|
18969
19359
|
static async fromFile(params) {
|
|
@@ -18986,11 +19376,11 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
|
|
|
18986
19376
|
};
|
|
18987
19377
|
|
|
18988
19378
|
// src/features/subagents/geminicli-subagent.ts
|
|
18989
|
-
var
|
|
19379
|
+
var import_node_path121 = require("path");
|
|
18990
19380
|
var import_mini63 = require("zod/mini");
|
|
18991
19381
|
|
|
18992
19382
|
// src/features/subagents/rulesync-subagent.ts
|
|
18993
|
-
var
|
|
19383
|
+
var import_node_path120 = require("path");
|
|
18994
19384
|
var import_mini62 = require("zod/mini");
|
|
18995
19385
|
var RulesyncSubagentFrontmatterSchema = import_mini62.z.looseObject({
|
|
18996
19386
|
targets: import_mini62.z._default(RulesyncTargetsSchema, ["*"]),
|
|
@@ -19009,7 +19399,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
19009
19399
|
const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
19010
19400
|
if (!parseResult.success && rest.validate !== false) {
|
|
19011
19401
|
throw new Error(
|
|
19012
|
-
`Invalid frontmatter in ${(0,
|
|
19402
|
+
`Invalid frontmatter in ${(0, import_node_path120.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
19013
19403
|
);
|
|
19014
19404
|
}
|
|
19015
19405
|
const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
|
|
@@ -19042,7 +19432,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
19042
19432
|
return {
|
|
19043
19433
|
success: false,
|
|
19044
19434
|
error: new Error(
|
|
19045
|
-
`Invalid frontmatter in ${(0,
|
|
19435
|
+
`Invalid frontmatter in ${(0, import_node_path120.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
19046
19436
|
)
|
|
19047
19437
|
};
|
|
19048
19438
|
}
|
|
@@ -19051,14 +19441,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
19051
19441
|
outputRoot = process.cwd(),
|
|
19052
19442
|
relativeFilePath
|
|
19053
19443
|
}) {
|
|
19054
|
-
const filePath = (0,
|
|
19444
|
+
const filePath = (0, import_node_path120.join)(outputRoot, RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
|
|
19055
19445
|
const fileContent = await readFileContent(filePath);
|
|
19056
19446
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
19057
19447
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
19058
19448
|
if (!result.success) {
|
|
19059
19449
|
throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
|
|
19060
19450
|
}
|
|
19061
|
-
const filename = (0,
|
|
19451
|
+
const filename = (0, import_node_path120.basename)(relativeFilePath);
|
|
19062
19452
|
return new _RulesyncSubagent({
|
|
19063
19453
|
outputRoot,
|
|
19064
19454
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
@@ -19082,7 +19472,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
19082
19472
|
const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
19083
19473
|
if (!result.success) {
|
|
19084
19474
|
throw new Error(
|
|
19085
|
-
`Invalid frontmatter in ${(0,
|
|
19475
|
+
`Invalid frontmatter in ${(0, import_node_path121.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
19086
19476
|
);
|
|
19087
19477
|
}
|
|
19088
19478
|
}
|
|
@@ -19095,7 +19485,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
19095
19485
|
}
|
|
19096
19486
|
static getSettablePaths(_options = {}) {
|
|
19097
19487
|
return {
|
|
19098
|
-
relativeDirPath: (0,
|
|
19488
|
+
relativeDirPath: (0, import_node_path121.join)(".gemini", "agents")
|
|
19099
19489
|
};
|
|
19100
19490
|
}
|
|
19101
19491
|
getFrontmatter() {
|
|
@@ -19163,7 +19553,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
19163
19553
|
return {
|
|
19164
19554
|
success: false,
|
|
19165
19555
|
error: new Error(
|
|
19166
|
-
`Invalid frontmatter in ${(0,
|
|
19556
|
+
`Invalid frontmatter in ${(0, import_node_path121.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
19167
19557
|
)
|
|
19168
19558
|
};
|
|
19169
19559
|
}
|
|
@@ -19181,7 +19571,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
19181
19571
|
global = false
|
|
19182
19572
|
}) {
|
|
19183
19573
|
const paths = this.getSettablePaths({ global });
|
|
19184
|
-
const filePath = (0,
|
|
19574
|
+
const filePath = (0, import_node_path121.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
19185
19575
|
const fileContent = await readFileContent(filePath);
|
|
19186
19576
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
19187
19577
|
const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -19217,11 +19607,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
19217
19607
|
};
|
|
19218
19608
|
|
|
19219
19609
|
// src/features/subagents/roo-subagent.ts
|
|
19220
|
-
var
|
|
19610
|
+
var import_node_path122 = require("path");
|
|
19221
19611
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
19222
19612
|
static getSettablePaths() {
|
|
19223
19613
|
return {
|
|
19224
|
-
relativeDirPath: (0,
|
|
19614
|
+
relativeDirPath: (0, import_node_path122.join)(".roo", "subagents")
|
|
19225
19615
|
};
|
|
19226
19616
|
}
|
|
19227
19617
|
static async fromFile(params) {
|
|
@@ -19244,7 +19634,7 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
19244
19634
|
};
|
|
19245
19635
|
|
|
19246
19636
|
// src/features/subagents/rovodev-subagent.ts
|
|
19247
|
-
var
|
|
19637
|
+
var import_node_path123 = require("path");
|
|
19248
19638
|
var import_mini64 = require("zod/mini");
|
|
19249
19639
|
var RovodevSubagentFrontmatterSchema = import_mini64.z.looseObject({
|
|
19250
19640
|
name: import_mini64.z.string(),
|
|
@@ -19258,7 +19648,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
19258
19648
|
const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
19259
19649
|
if (!result.success) {
|
|
19260
19650
|
throw new Error(
|
|
19261
|
-
`Invalid frontmatter in ${(0,
|
|
19651
|
+
`Invalid frontmatter in ${(0, import_node_path123.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
19262
19652
|
);
|
|
19263
19653
|
}
|
|
19264
19654
|
}
|
|
@@ -19270,7 +19660,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
19270
19660
|
}
|
|
19271
19661
|
static getSettablePaths(_options = {}) {
|
|
19272
19662
|
return {
|
|
19273
|
-
relativeDirPath: (0,
|
|
19663
|
+
relativeDirPath: (0, import_node_path123.join)(".rovodev", "subagents")
|
|
19274
19664
|
};
|
|
19275
19665
|
}
|
|
19276
19666
|
getFrontmatter() {
|
|
@@ -19333,7 +19723,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
19333
19723
|
return {
|
|
19334
19724
|
success: false,
|
|
19335
19725
|
error: new Error(
|
|
19336
|
-
`Invalid frontmatter in ${(0,
|
|
19726
|
+
`Invalid frontmatter in ${(0, import_node_path123.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
19337
19727
|
)
|
|
19338
19728
|
};
|
|
19339
19729
|
}
|
|
@@ -19350,7 +19740,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
19350
19740
|
global = false
|
|
19351
19741
|
}) {
|
|
19352
19742
|
const paths = this.getSettablePaths({ global });
|
|
19353
|
-
const filePath = (0,
|
|
19743
|
+
const filePath = (0, import_node_path123.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
19354
19744
|
const fileContent = await readFileContent(filePath);
|
|
19355
19745
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
19356
19746
|
const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -19389,11 +19779,11 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
19389
19779
|
};
|
|
19390
19780
|
|
|
19391
19781
|
// src/features/subagents/subagents-processor.ts
|
|
19392
|
-
var
|
|
19782
|
+
var import_node_path136 = require("path");
|
|
19393
19783
|
var import_mini75 = require("zod/mini");
|
|
19394
19784
|
|
|
19395
19785
|
// src/features/subagents/claudecode-subagent.ts
|
|
19396
|
-
var
|
|
19786
|
+
var import_node_path124 = require("path");
|
|
19397
19787
|
var import_mini65 = require("zod/mini");
|
|
19398
19788
|
var ClaudecodeSubagentFrontmatterSchema = import_mini65.z.looseObject({
|
|
19399
19789
|
name: import_mini65.z.string(),
|
|
@@ -19411,7 +19801,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
19411
19801
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
19412
19802
|
if (!result.success) {
|
|
19413
19803
|
throw new Error(
|
|
19414
|
-
`Invalid frontmatter in ${(0,
|
|
19804
|
+
`Invalid frontmatter in ${(0, import_node_path124.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
19415
19805
|
);
|
|
19416
19806
|
}
|
|
19417
19807
|
}
|
|
@@ -19423,7 +19813,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
19423
19813
|
}
|
|
19424
19814
|
static getSettablePaths(_options = {}) {
|
|
19425
19815
|
return {
|
|
19426
|
-
relativeDirPath: (0,
|
|
19816
|
+
relativeDirPath: (0, import_node_path124.join)(".claude", "agents")
|
|
19427
19817
|
};
|
|
19428
19818
|
}
|
|
19429
19819
|
getFrontmatter() {
|
|
@@ -19502,7 +19892,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
19502
19892
|
return {
|
|
19503
19893
|
success: false,
|
|
19504
19894
|
error: new Error(
|
|
19505
|
-
`Invalid frontmatter in ${(0,
|
|
19895
|
+
`Invalid frontmatter in ${(0, import_node_path124.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
19506
19896
|
)
|
|
19507
19897
|
};
|
|
19508
19898
|
}
|
|
@@ -19520,7 +19910,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
19520
19910
|
global = false
|
|
19521
19911
|
}) {
|
|
19522
19912
|
const paths = this.getSettablePaths({ global });
|
|
19523
|
-
const filePath = (0,
|
|
19913
|
+
const filePath = (0, import_node_path124.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
19524
19914
|
const fileContent = await readFileContent(filePath);
|
|
19525
19915
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
19526
19916
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -19555,7 +19945,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
19555
19945
|
};
|
|
19556
19946
|
|
|
19557
19947
|
// src/features/subagents/codexcli-subagent.ts
|
|
19558
|
-
var
|
|
19948
|
+
var import_node_path125 = require("path");
|
|
19559
19949
|
var smolToml6 = __toESM(require("smol-toml"), 1);
|
|
19560
19950
|
var import_mini66 = require("zod/mini");
|
|
19561
19951
|
var CodexCliSubagentTomlSchema = import_mini66.z.looseObject({
|
|
@@ -19586,7 +19976,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
19586
19976
|
CodexCliSubagentTomlSchema.parse(parsed);
|
|
19587
19977
|
} catch (error) {
|
|
19588
19978
|
throw new Error(
|
|
19589
|
-
`Invalid TOML in ${(0,
|
|
19979
|
+
`Invalid TOML in ${(0, import_node_path125.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
19590
19980
|
{ cause: error }
|
|
19591
19981
|
);
|
|
19592
19982
|
}
|
|
@@ -19598,7 +19988,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
19598
19988
|
}
|
|
19599
19989
|
static getSettablePaths(_options = {}) {
|
|
19600
19990
|
return {
|
|
19601
|
-
relativeDirPath: (0,
|
|
19991
|
+
relativeDirPath: (0, import_node_path125.join)(".codex", "agents")
|
|
19602
19992
|
};
|
|
19603
19993
|
}
|
|
19604
19994
|
getBody() {
|
|
@@ -19610,7 +20000,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
19610
20000
|
parsed = CodexCliSubagentTomlSchema.parse(smolToml6.parse(this.body));
|
|
19611
20001
|
} catch (error) {
|
|
19612
20002
|
throw new Error(
|
|
19613
|
-
`Failed to parse TOML in ${(0,
|
|
20003
|
+
`Failed to parse TOML in ${(0, import_node_path125.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
19614
20004
|
{ cause: error }
|
|
19615
20005
|
);
|
|
19616
20006
|
}
|
|
@@ -19691,7 +20081,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
19691
20081
|
global = false
|
|
19692
20082
|
}) {
|
|
19693
20083
|
const paths = this.getSettablePaths({ global });
|
|
19694
|
-
const filePath = (0,
|
|
20084
|
+
const filePath = (0, import_node_path125.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
19695
20085
|
const fileContent = await readFileContent(filePath);
|
|
19696
20086
|
const subagent = new _CodexCliSubagent({
|
|
19697
20087
|
outputRoot,
|
|
@@ -19729,7 +20119,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
19729
20119
|
};
|
|
19730
20120
|
|
|
19731
20121
|
// src/features/subagents/copilot-subagent.ts
|
|
19732
|
-
var
|
|
20122
|
+
var import_node_path126 = require("path");
|
|
19733
20123
|
var import_mini67 = require("zod/mini");
|
|
19734
20124
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
19735
20125
|
var CopilotSubagentFrontmatterSchema = import_mini67.z.looseObject({
|
|
@@ -19770,7 +20160,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
19770
20160
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
19771
20161
|
if (!result.success) {
|
|
19772
20162
|
throw new Error(
|
|
19773
|
-
`Invalid frontmatter in ${(0,
|
|
20163
|
+
`Invalid frontmatter in ${(0, import_node_path126.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
19774
20164
|
);
|
|
19775
20165
|
}
|
|
19776
20166
|
}
|
|
@@ -19782,7 +20172,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
19782
20172
|
}
|
|
19783
20173
|
static getSettablePaths(_options = {}) {
|
|
19784
20174
|
return {
|
|
19785
|
-
relativeDirPath: (0,
|
|
20175
|
+
relativeDirPath: (0, import_node_path126.join)(".github", "agents")
|
|
19786
20176
|
};
|
|
19787
20177
|
}
|
|
19788
20178
|
getFrontmatter() {
|
|
@@ -19856,7 +20246,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
19856
20246
|
return {
|
|
19857
20247
|
success: false,
|
|
19858
20248
|
error: new Error(
|
|
19859
|
-
`Invalid frontmatter in ${(0,
|
|
20249
|
+
`Invalid frontmatter in ${(0, import_node_path126.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
19860
20250
|
)
|
|
19861
20251
|
};
|
|
19862
20252
|
}
|
|
@@ -19874,7 +20264,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
19874
20264
|
global = false
|
|
19875
20265
|
}) {
|
|
19876
20266
|
const paths = this.getSettablePaths({ global });
|
|
19877
|
-
const filePath = (0,
|
|
20267
|
+
const filePath = (0, import_node_path126.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
19878
20268
|
const fileContent = await readFileContent(filePath);
|
|
19879
20269
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
19880
20270
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -19910,7 +20300,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
19910
20300
|
};
|
|
19911
20301
|
|
|
19912
20302
|
// src/features/subagents/copilotcli-subagent.ts
|
|
19913
|
-
var
|
|
20303
|
+
var import_node_path127 = require("path");
|
|
19914
20304
|
var import_mini68 = require("zod/mini");
|
|
19915
20305
|
var CopilotCliSubagentFrontmatterSchema = import_mini68.z.looseObject({
|
|
19916
20306
|
description: import_mini68.z.string(),
|
|
@@ -19946,7 +20336,7 @@ var CopilotcliSubagent = class _CopilotcliSubagent extends ToolSubagent {
|
|
|
19946
20336
|
const result = CopilotCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
19947
20337
|
if (!result.success) {
|
|
19948
20338
|
throw new Error(
|
|
19949
|
-
`Invalid frontmatter in ${(0,
|
|
20339
|
+
`Invalid frontmatter in ${(0, import_node_path127.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
19950
20340
|
);
|
|
19951
20341
|
}
|
|
19952
20342
|
}
|
|
@@ -19958,9 +20348,9 @@ var CopilotcliSubagent = class _CopilotcliSubagent extends ToolSubagent {
|
|
|
19958
20348
|
global = false
|
|
19959
20349
|
} = {}) {
|
|
19960
20350
|
if (global) {
|
|
19961
|
-
return { relativeDirPath: (0,
|
|
20351
|
+
return { relativeDirPath: (0, import_node_path127.join)(".copilot", "agents") };
|
|
19962
20352
|
}
|
|
19963
|
-
return { relativeDirPath: (0,
|
|
20353
|
+
return { relativeDirPath: (0, import_node_path127.join)(".github", "agents") };
|
|
19964
20354
|
}
|
|
19965
20355
|
getFrontmatter() {
|
|
19966
20356
|
return this.frontmatter;
|
|
@@ -20038,7 +20428,7 @@ var CopilotcliSubagent = class _CopilotcliSubagent extends ToolSubagent {
|
|
|
20038
20428
|
return {
|
|
20039
20429
|
success: false,
|
|
20040
20430
|
error: new Error(
|
|
20041
|
-
`Invalid frontmatter in ${(0,
|
|
20431
|
+
`Invalid frontmatter in ${(0, import_node_path127.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
20042
20432
|
)
|
|
20043
20433
|
};
|
|
20044
20434
|
}
|
|
@@ -20055,7 +20445,7 @@ var CopilotcliSubagent = class _CopilotcliSubagent extends ToolSubagent {
|
|
|
20055
20445
|
global = false
|
|
20056
20446
|
}) {
|
|
20057
20447
|
const paths = this.getSettablePaths({ global });
|
|
20058
|
-
const filePath = (0,
|
|
20448
|
+
const filePath = (0, import_node_path127.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
20059
20449
|
const fileContent = await readFileContent(filePath);
|
|
20060
20450
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
20061
20451
|
const result = CopilotCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -20091,7 +20481,7 @@ var CopilotcliSubagent = class _CopilotcliSubagent extends ToolSubagent {
|
|
|
20091
20481
|
};
|
|
20092
20482
|
|
|
20093
20483
|
// src/features/subagents/cursor-subagent.ts
|
|
20094
|
-
var
|
|
20484
|
+
var import_node_path128 = require("path");
|
|
20095
20485
|
var import_mini69 = require("zod/mini");
|
|
20096
20486
|
var CursorSubagentFrontmatterSchema = import_mini69.z.looseObject({
|
|
20097
20487
|
name: import_mini69.z.string(),
|
|
@@ -20105,7 +20495,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
20105
20495
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
20106
20496
|
if (!result.success) {
|
|
20107
20497
|
throw new Error(
|
|
20108
|
-
`Invalid frontmatter in ${(0,
|
|
20498
|
+
`Invalid frontmatter in ${(0, import_node_path128.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
20109
20499
|
);
|
|
20110
20500
|
}
|
|
20111
20501
|
}
|
|
@@ -20117,7 +20507,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
20117
20507
|
}
|
|
20118
20508
|
static getSettablePaths(_options = {}) {
|
|
20119
20509
|
return {
|
|
20120
|
-
relativeDirPath: (0,
|
|
20510
|
+
relativeDirPath: (0, import_node_path128.join)(".cursor", "agents")
|
|
20121
20511
|
};
|
|
20122
20512
|
}
|
|
20123
20513
|
getFrontmatter() {
|
|
@@ -20184,7 +20574,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
20184
20574
|
return {
|
|
20185
20575
|
success: false,
|
|
20186
20576
|
error: new Error(
|
|
20187
|
-
`Invalid frontmatter in ${(0,
|
|
20577
|
+
`Invalid frontmatter in ${(0, import_node_path128.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
20188
20578
|
)
|
|
20189
20579
|
};
|
|
20190
20580
|
}
|
|
@@ -20202,7 +20592,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
20202
20592
|
global = false
|
|
20203
20593
|
}) {
|
|
20204
20594
|
const paths = this.getSettablePaths({ global });
|
|
20205
|
-
const filePath = (0,
|
|
20595
|
+
const filePath = (0, import_node_path128.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
20206
20596
|
const fileContent = await readFileContent(filePath);
|
|
20207
20597
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
20208
20598
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -20238,7 +20628,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
20238
20628
|
};
|
|
20239
20629
|
|
|
20240
20630
|
// src/features/subagents/deepagents-subagent.ts
|
|
20241
|
-
var
|
|
20631
|
+
var import_node_path129 = require("path");
|
|
20242
20632
|
var import_mini70 = require("zod/mini");
|
|
20243
20633
|
var DeepagentsSubagentFrontmatterSchema = import_mini70.z.looseObject({
|
|
20244
20634
|
name: import_mini70.z.string(),
|
|
@@ -20253,7 +20643,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
20253
20643
|
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
20254
20644
|
if (!result.success) {
|
|
20255
20645
|
throw new Error(
|
|
20256
|
-
`Invalid frontmatter in ${(0,
|
|
20646
|
+
`Invalid frontmatter in ${(0, import_node_path129.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
20257
20647
|
);
|
|
20258
20648
|
}
|
|
20259
20649
|
}
|
|
@@ -20263,7 +20653,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
20263
20653
|
}
|
|
20264
20654
|
static getSettablePaths(_options = {}) {
|
|
20265
20655
|
return {
|
|
20266
|
-
relativeDirPath: (0,
|
|
20656
|
+
relativeDirPath: (0, import_node_path129.join)(".deepagents", "agents")
|
|
20267
20657
|
};
|
|
20268
20658
|
}
|
|
20269
20659
|
getFrontmatter() {
|
|
@@ -20338,7 +20728,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
20338
20728
|
return {
|
|
20339
20729
|
success: false,
|
|
20340
20730
|
error: new Error(
|
|
20341
|
-
`Invalid frontmatter in ${(0,
|
|
20731
|
+
`Invalid frontmatter in ${(0, import_node_path129.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
20342
20732
|
)
|
|
20343
20733
|
};
|
|
20344
20734
|
}
|
|
@@ -20356,7 +20746,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
20356
20746
|
global = false
|
|
20357
20747
|
}) {
|
|
20358
20748
|
const paths = this.getSettablePaths({ global });
|
|
20359
|
-
const filePath = (0,
|
|
20749
|
+
const filePath = (0, import_node_path129.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
20360
20750
|
const fileContent = await readFileContent(filePath);
|
|
20361
20751
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
20362
20752
|
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -20391,7 +20781,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
20391
20781
|
};
|
|
20392
20782
|
|
|
20393
20783
|
// src/features/subagents/junie-subagent.ts
|
|
20394
|
-
var
|
|
20784
|
+
var import_node_path130 = require("path");
|
|
20395
20785
|
var import_mini71 = require("zod/mini");
|
|
20396
20786
|
var JunieSubagentFrontmatterSchema = import_mini71.z.looseObject({
|
|
20397
20787
|
name: import_mini71.z.optional(import_mini71.z.string()),
|
|
@@ -20405,7 +20795,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
20405
20795
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
20406
20796
|
if (!result.success) {
|
|
20407
20797
|
throw new Error(
|
|
20408
|
-
`Invalid frontmatter in ${(0,
|
|
20798
|
+
`Invalid frontmatter in ${(0, import_node_path130.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
20409
20799
|
);
|
|
20410
20800
|
}
|
|
20411
20801
|
}
|
|
@@ -20420,7 +20810,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
20420
20810
|
throw new Error("JunieSubagent does not support global mode.");
|
|
20421
20811
|
}
|
|
20422
20812
|
return {
|
|
20423
|
-
relativeDirPath: (0,
|
|
20813
|
+
relativeDirPath: (0, import_node_path130.join)(".junie", "agents")
|
|
20424
20814
|
};
|
|
20425
20815
|
}
|
|
20426
20816
|
getFrontmatter() {
|
|
@@ -20496,7 +20886,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
20496
20886
|
return {
|
|
20497
20887
|
success: false,
|
|
20498
20888
|
error: new Error(
|
|
20499
|
-
`Invalid frontmatter in ${(0,
|
|
20889
|
+
`Invalid frontmatter in ${(0, import_node_path130.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
20500
20890
|
)
|
|
20501
20891
|
};
|
|
20502
20892
|
}
|
|
@@ -20514,7 +20904,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
20514
20904
|
global = false
|
|
20515
20905
|
}) {
|
|
20516
20906
|
const paths = this.getSettablePaths({ global });
|
|
20517
|
-
const filePath = (0,
|
|
20907
|
+
const filePath = (0, import_node_path130.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
20518
20908
|
const fileContent = await readFileContent(filePath);
|
|
20519
20909
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
20520
20910
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -20549,11 +20939,11 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
20549
20939
|
};
|
|
20550
20940
|
|
|
20551
20941
|
// src/features/subagents/kilo-subagent.ts
|
|
20552
|
-
var
|
|
20942
|
+
var import_node_path132 = require("path");
|
|
20553
20943
|
var import_mini73 = require("zod/mini");
|
|
20554
20944
|
|
|
20555
20945
|
// src/features/subagents/opencode-style-subagent.ts
|
|
20556
|
-
var
|
|
20946
|
+
var import_node_path131 = require("path");
|
|
20557
20947
|
var import_mini72 = require("zod/mini");
|
|
20558
20948
|
var OpenCodeStyleSubagentFrontmatterSchema = import_mini72.z.looseObject({
|
|
20559
20949
|
description: import_mini72.z.optional(import_mini72.z.string()),
|
|
@@ -20568,7 +20958,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
20568
20958
|
const result = OpenCodeStyleSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
20569
20959
|
if (!result.success) {
|
|
20570
20960
|
throw new Error(
|
|
20571
|
-
`Invalid frontmatter in ${(0,
|
|
20961
|
+
`Invalid frontmatter in ${(0, import_node_path131.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
20572
20962
|
);
|
|
20573
20963
|
}
|
|
20574
20964
|
}
|
|
@@ -20588,7 +20978,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
20588
20978
|
const { description, mode, name, ...toolSection } = this.frontmatter;
|
|
20589
20979
|
const rulesyncFrontmatter = {
|
|
20590
20980
|
targets: ["*"],
|
|
20591
|
-
name: name ?? (0,
|
|
20981
|
+
name: name ?? (0, import_node_path131.basename)(this.getRelativeFilePath(), ".md"),
|
|
20592
20982
|
description,
|
|
20593
20983
|
[this.getToolTarget()]: { mode, ...toolSection }
|
|
20594
20984
|
};
|
|
@@ -20610,7 +21000,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
20610
21000
|
return {
|
|
20611
21001
|
success: false,
|
|
20612
21002
|
error: new Error(
|
|
20613
|
-
`Invalid frontmatter in ${(0,
|
|
21003
|
+
`Invalid frontmatter in ${(0, import_node_path131.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
20614
21004
|
)
|
|
20615
21005
|
};
|
|
20616
21006
|
}
|
|
@@ -20661,7 +21051,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
20661
21051
|
return {
|
|
20662
21052
|
success: false,
|
|
20663
21053
|
error: new Error(
|
|
20664
|
-
`Invalid frontmatter in ${(0,
|
|
21054
|
+
`Invalid frontmatter in ${(0, import_node_path132.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
20665
21055
|
)
|
|
20666
21056
|
};
|
|
20667
21057
|
}
|
|
@@ -20669,7 +21059,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
20669
21059
|
global = false
|
|
20670
21060
|
} = {}) {
|
|
20671
21061
|
return {
|
|
20672
|
-
relativeDirPath: global ? (0,
|
|
21062
|
+
relativeDirPath: global ? (0, import_node_path132.join)(".config", "kilo", "agent") : (0, import_node_path132.join)(".kilo", "agent")
|
|
20673
21063
|
};
|
|
20674
21064
|
}
|
|
20675
21065
|
static fromRulesyncSubagent({
|
|
@@ -20718,7 +21108,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
20718
21108
|
global = false
|
|
20719
21109
|
}) {
|
|
20720
21110
|
const paths = this.getSettablePaths({ global });
|
|
20721
|
-
const filePath = (0,
|
|
21111
|
+
const filePath = (0, import_node_path132.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
20722
21112
|
const fileContent = await readFileContent(filePath);
|
|
20723
21113
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
20724
21114
|
const result = KiloSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -20756,7 +21146,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
20756
21146
|
};
|
|
20757
21147
|
|
|
20758
21148
|
// src/features/subagents/kiro-subagent.ts
|
|
20759
|
-
var
|
|
21149
|
+
var import_node_path133 = require("path");
|
|
20760
21150
|
var import_mini74 = require("zod/mini");
|
|
20761
21151
|
var KiroCliSubagentJsonSchema = import_mini74.z.looseObject({
|
|
20762
21152
|
name: import_mini74.z.string(),
|
|
@@ -20783,7 +21173,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
20783
21173
|
KiroCliSubagentJsonSchema.parse(parsed);
|
|
20784
21174
|
} catch (error) {
|
|
20785
21175
|
throw new Error(
|
|
20786
|
-
`Invalid JSON in ${(0,
|
|
21176
|
+
`Invalid JSON in ${(0, import_node_path133.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
20787
21177
|
{ cause: error }
|
|
20788
21178
|
);
|
|
20789
21179
|
}
|
|
@@ -20795,7 +21185,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
20795
21185
|
}
|
|
20796
21186
|
static getSettablePaths(_options = {}) {
|
|
20797
21187
|
return {
|
|
20798
|
-
relativeDirPath: (0,
|
|
21188
|
+
relativeDirPath: (0, import_node_path133.join)(".kiro", "agents")
|
|
20799
21189
|
};
|
|
20800
21190
|
}
|
|
20801
21191
|
getBody() {
|
|
@@ -20807,7 +21197,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
20807
21197
|
parsed = JSON.parse(this.body);
|
|
20808
21198
|
} catch (error) {
|
|
20809
21199
|
throw new Error(
|
|
20810
|
-
`Failed to parse JSON in ${(0,
|
|
21200
|
+
`Failed to parse JSON in ${(0, import_node_path133.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
20811
21201
|
{ cause: error }
|
|
20812
21202
|
);
|
|
20813
21203
|
}
|
|
@@ -20888,7 +21278,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
20888
21278
|
global = false
|
|
20889
21279
|
}) {
|
|
20890
21280
|
const paths = this.getSettablePaths({ global });
|
|
20891
|
-
const filePath = (0,
|
|
21281
|
+
const filePath = (0, import_node_path133.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
20892
21282
|
const fileContent = await readFileContent(filePath);
|
|
20893
21283
|
const subagent = new _KiroSubagent({
|
|
20894
21284
|
outputRoot,
|
|
@@ -20926,7 +21316,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
20926
21316
|
};
|
|
20927
21317
|
|
|
20928
21318
|
// src/features/subagents/opencode-subagent.ts
|
|
20929
|
-
var
|
|
21319
|
+
var import_node_path134 = require("path");
|
|
20930
21320
|
var OpenCodeSubagentFrontmatterSchema = OpenCodeStyleSubagentFrontmatterSchema;
|
|
20931
21321
|
var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
20932
21322
|
getToolTarget() {
|
|
@@ -20936,7 +21326,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
20936
21326
|
global = false
|
|
20937
21327
|
} = {}) {
|
|
20938
21328
|
return {
|
|
20939
|
-
relativeDirPath: global ? (0,
|
|
21329
|
+
relativeDirPath: global ? (0, import_node_path134.join)(".config", "opencode", "agent") : (0, import_node_path134.join)(".opencode", "agent")
|
|
20940
21330
|
};
|
|
20941
21331
|
}
|
|
20942
21332
|
static fromRulesyncSubagent({
|
|
@@ -20980,7 +21370,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
20980
21370
|
global = false
|
|
20981
21371
|
}) {
|
|
20982
21372
|
const paths = this.getSettablePaths({ global });
|
|
20983
|
-
const filePath = (0,
|
|
21373
|
+
const filePath = (0, import_node_path134.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
20984
21374
|
const fileContent = await readFileContent(filePath);
|
|
20985
21375
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
20986
21376
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -21018,7 +21408,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
21018
21408
|
};
|
|
21019
21409
|
|
|
21020
21410
|
// src/features/subagents/takt-subagent.ts
|
|
21021
|
-
var
|
|
21411
|
+
var import_node_path135 = require("path");
|
|
21022
21412
|
var DEFAULT_TAKT_SUBAGENT_DIR = "personas";
|
|
21023
21413
|
var TaktSubagent = class _TaktSubagent extends ToolSubagent {
|
|
21024
21414
|
body;
|
|
@@ -21030,7 +21420,7 @@ var TaktSubagent = class _TaktSubagent extends ToolSubagent {
|
|
|
21030
21420
|
}
|
|
21031
21421
|
static getSettablePaths(_options = {}) {
|
|
21032
21422
|
return {
|
|
21033
|
-
relativeDirPath: (0,
|
|
21423
|
+
relativeDirPath: (0, import_node_path135.join)(".takt", "facets", DEFAULT_TAKT_SUBAGENT_DIR)
|
|
21034
21424
|
};
|
|
21035
21425
|
}
|
|
21036
21426
|
getBody() {
|
|
@@ -21092,7 +21482,7 @@ var TaktSubagent = class _TaktSubagent extends ToolSubagent {
|
|
|
21092
21482
|
global = false
|
|
21093
21483
|
}) {
|
|
21094
21484
|
const paths = this.getSettablePaths({ global });
|
|
21095
|
-
const filePath = (0,
|
|
21485
|
+
const filePath = (0, import_node_path135.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
21096
21486
|
const fileContent = await readFileContent(filePath);
|
|
21097
21487
|
const { body } = parseFrontmatter(fileContent, filePath);
|
|
21098
21488
|
return new _TaktSubagent({
|
|
@@ -21349,7 +21739,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
21349
21739
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
21350
21740
|
*/
|
|
21351
21741
|
async loadRulesyncFiles() {
|
|
21352
|
-
const subagentsDir = (0,
|
|
21742
|
+
const subagentsDir = (0, import_node_path136.join)(this.inputRoot, RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
21353
21743
|
const dirExists = await directoryExists(subagentsDir);
|
|
21354
21744
|
if (!dirExists) {
|
|
21355
21745
|
this.logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -21364,7 +21754,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
21364
21754
|
this.logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
21365
21755
|
const rulesyncSubagents = [];
|
|
21366
21756
|
for (const mdFile of mdFiles) {
|
|
21367
|
-
const filepath = (0,
|
|
21757
|
+
const filepath = (0, import_node_path136.join)(subagentsDir, mdFile);
|
|
21368
21758
|
try {
|
|
21369
21759
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
21370
21760
|
outputRoot: this.inputRoot,
|
|
@@ -21395,14 +21785,14 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
21395
21785
|
const factory = this.getFactory(this.toolTarget);
|
|
21396
21786
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
21397
21787
|
const subagentFilePaths = await findFilesByGlobs(
|
|
21398
|
-
(0,
|
|
21788
|
+
(0, import_node_path136.join)(this.outputRoot, paths.relativeDirPath, factory.meta.filePattern)
|
|
21399
21789
|
);
|
|
21400
21790
|
if (forDeletion) {
|
|
21401
21791
|
const toolSubagents2 = subagentFilePaths.map(
|
|
21402
21792
|
(path4) => factory.class.forDeletion({
|
|
21403
21793
|
outputRoot: this.outputRoot,
|
|
21404
21794
|
relativeDirPath: paths.relativeDirPath,
|
|
21405
|
-
relativeFilePath: (0,
|
|
21795
|
+
relativeFilePath: (0, import_node_path136.basename)(path4),
|
|
21406
21796
|
global: this.global
|
|
21407
21797
|
})
|
|
21408
21798
|
).filter((subagent) => subagent.isDeletable());
|
|
@@ -21415,7 +21805,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
21415
21805
|
subagentFilePaths.map(
|
|
21416
21806
|
(path4) => factory.class.fromFile({
|
|
21417
21807
|
outputRoot: this.outputRoot,
|
|
21418
|
-
relativeFilePath: (0,
|
|
21808
|
+
relativeFilePath: (0, import_node_path136.basename)(path4),
|
|
21419
21809
|
global: this.global
|
|
21420
21810
|
})
|
|
21421
21811
|
)
|
|
@@ -21462,13 +21852,13 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
21462
21852
|
};
|
|
21463
21853
|
|
|
21464
21854
|
// src/features/rules/agentsmd-rule.ts
|
|
21465
|
-
var
|
|
21855
|
+
var import_node_path139 = require("path");
|
|
21466
21856
|
|
|
21467
21857
|
// src/features/rules/tool-rule.ts
|
|
21468
|
-
var
|
|
21858
|
+
var import_node_path138 = require("path");
|
|
21469
21859
|
|
|
21470
21860
|
// src/features/rules/rulesync-rule.ts
|
|
21471
|
-
var
|
|
21861
|
+
var import_node_path137 = require("path");
|
|
21472
21862
|
var import_mini76 = require("zod/mini");
|
|
21473
21863
|
var RulesyncRuleFrontmatterSchema = import_mini76.z.object({
|
|
21474
21864
|
root: import_mini76.z.optional(import_mini76.z.boolean()),
|
|
@@ -21521,7 +21911,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
21521
21911
|
const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
21522
21912
|
if (!parseResult.success && rest.validate !== false) {
|
|
21523
21913
|
throw new Error(
|
|
21524
|
-
`Invalid frontmatter in ${(0,
|
|
21914
|
+
`Invalid frontmatter in ${(0, import_node_path137.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
21525
21915
|
);
|
|
21526
21916
|
}
|
|
21527
21917
|
const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
|
|
@@ -21556,7 +21946,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
21556
21946
|
return {
|
|
21557
21947
|
success: false,
|
|
21558
21948
|
error: new Error(
|
|
21559
|
-
`Invalid frontmatter in ${(0,
|
|
21949
|
+
`Invalid frontmatter in ${(0, import_node_path137.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
21560
21950
|
)
|
|
21561
21951
|
};
|
|
21562
21952
|
}
|
|
@@ -21566,7 +21956,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
21566
21956
|
relativeFilePath,
|
|
21567
21957
|
validate = true
|
|
21568
21958
|
}) {
|
|
21569
|
-
const filePath = (0,
|
|
21959
|
+
const filePath = (0, import_node_path137.join)(
|
|
21570
21960
|
outputRoot,
|
|
21571
21961
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
21572
21962
|
relativeFilePath
|
|
@@ -21665,7 +22055,7 @@ var ToolRule = class extends ToolFile {
|
|
|
21665
22055
|
rulesyncRule,
|
|
21666
22056
|
validate = true,
|
|
21667
22057
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
21668
|
-
nonRootPath = { relativeDirPath: (0,
|
|
22058
|
+
nonRootPath = { relativeDirPath: (0, import_node_path138.join)(".agents", "memories") }
|
|
21669
22059
|
}) {
|
|
21670
22060
|
const params = this.buildToolRuleParamsDefault({
|
|
21671
22061
|
outputRoot,
|
|
@@ -21676,7 +22066,7 @@ var ToolRule = class extends ToolFile {
|
|
|
21676
22066
|
});
|
|
21677
22067
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
21678
22068
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
21679
|
-
params.relativeDirPath = (0,
|
|
22069
|
+
params.relativeDirPath = (0, import_node_path138.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
21680
22070
|
params.relativeFilePath = "AGENTS.md";
|
|
21681
22071
|
}
|
|
21682
22072
|
return params;
|
|
@@ -21725,7 +22115,7 @@ var ToolRule = class extends ToolFile {
|
|
|
21725
22115
|
}
|
|
21726
22116
|
};
|
|
21727
22117
|
function buildToolPath(toolDir, subDir, excludeToolDir) {
|
|
21728
|
-
return excludeToolDir ? subDir : (0,
|
|
22118
|
+
return excludeToolDir ? subDir : (0, import_node_path138.join)(toolDir, subDir);
|
|
21729
22119
|
}
|
|
21730
22120
|
|
|
21731
22121
|
// src/features/rules/agentsmd-rule.ts
|
|
@@ -21754,8 +22144,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
21754
22144
|
validate = true
|
|
21755
22145
|
}) {
|
|
21756
22146
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
21757
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
21758
|
-
const fileContent = await readFileContent((0,
|
|
22147
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path139.join)(".agents", "memories", relativeFilePath);
|
|
22148
|
+
const fileContent = await readFileContent((0, import_node_path139.join)(outputRoot, relativePath));
|
|
21759
22149
|
return new _AgentsMdRule({
|
|
21760
22150
|
outputRoot,
|
|
21761
22151
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -21810,7 +22200,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
21810
22200
|
};
|
|
21811
22201
|
|
|
21812
22202
|
// src/features/rules/antigravity-cli-rule.ts
|
|
21813
|
-
var
|
|
22203
|
+
var import_node_path140 = require("path");
|
|
21814
22204
|
var AntigravityCliRule = class _AntigravityCliRule extends ToolRule {
|
|
21815
22205
|
static getSettablePaths({
|
|
21816
22206
|
global,
|
|
@@ -21845,7 +22235,7 @@ var AntigravityCliRule = class _AntigravityCliRule extends ToolRule {
|
|
|
21845
22235
|
if (isRoot) {
|
|
21846
22236
|
const relativePath2 = paths.root.relativeFilePath;
|
|
21847
22237
|
const fileContent2 = await readFileContent(
|
|
21848
|
-
(0,
|
|
22238
|
+
(0, import_node_path140.join)(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
21849
22239
|
);
|
|
21850
22240
|
return new _AntigravityCliRule({
|
|
21851
22241
|
outputRoot,
|
|
@@ -21859,8 +22249,8 @@ var AntigravityCliRule = class _AntigravityCliRule extends ToolRule {
|
|
|
21859
22249
|
if (!paths.nonRoot) {
|
|
21860
22250
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
21861
22251
|
}
|
|
21862
|
-
const relativePath = (0,
|
|
21863
|
-
const fileContent = await readFileContent((0,
|
|
22252
|
+
const relativePath = (0, import_node_path140.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
22253
|
+
const fileContent = await readFileContent((0, import_node_path140.join)(outputRoot, relativePath));
|
|
21864
22254
|
return new _AntigravityCliRule({
|
|
21865
22255
|
outputRoot,
|
|
21866
22256
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -21919,10 +22309,10 @@ var AntigravityCliRule = class _AntigravityCliRule extends ToolRule {
|
|
|
21919
22309
|
};
|
|
21920
22310
|
|
|
21921
22311
|
// src/features/rules/antigravity-ide-rule.ts
|
|
21922
|
-
var
|
|
22312
|
+
var import_node_path142 = require("path");
|
|
21923
22313
|
|
|
21924
22314
|
// src/features/rules/antigravity-rule.ts
|
|
21925
|
-
var
|
|
22315
|
+
var import_node_path141 = require("path");
|
|
21926
22316
|
var import_mini77 = require("zod/mini");
|
|
21927
22317
|
var AntigravityRuleFrontmatterSchema = import_mini77.z.looseObject({
|
|
21928
22318
|
trigger: import_mini77.z.optional(
|
|
@@ -22081,7 +22471,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
22081
22471
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
22082
22472
|
if (!result.success) {
|
|
22083
22473
|
throw new Error(
|
|
22084
|
-
`Invalid frontmatter in ${(0,
|
|
22474
|
+
`Invalid frontmatter in ${(0, import_node_path141.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
22085
22475
|
);
|
|
22086
22476
|
}
|
|
22087
22477
|
}
|
|
@@ -22105,7 +22495,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
22105
22495
|
relativeFilePath,
|
|
22106
22496
|
validate = true
|
|
22107
22497
|
}) {
|
|
22108
|
-
const filePath = (0,
|
|
22498
|
+
const filePath = (0, import_node_path141.join)(
|
|
22109
22499
|
outputRoot,
|
|
22110
22500
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
22111
22501
|
relativeFilePath
|
|
@@ -22253,7 +22643,7 @@ var AntigravityIdeRule = class _AntigravityIdeRule extends ToolRule {
|
|
|
22253
22643
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
22254
22644
|
if (!result.success) {
|
|
22255
22645
|
throw new Error(
|
|
22256
|
-
`Invalid frontmatter in ${(0,
|
|
22646
|
+
`Invalid frontmatter in ${(0, import_node_path142.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
22257
22647
|
);
|
|
22258
22648
|
}
|
|
22259
22649
|
}
|
|
@@ -22296,7 +22686,7 @@ var AntigravityIdeRule = class _AntigravityIdeRule extends ToolRule {
|
|
|
22296
22686
|
if (global) {
|
|
22297
22687
|
const rootPath = _AntigravityIdeRule.getGlobalRootPath();
|
|
22298
22688
|
const fileContent2 = await readFileContent(
|
|
22299
|
-
(0,
|
|
22689
|
+
(0, import_node_path142.join)(outputRoot, rootPath.relativeDirPath, rootPath.relativeFilePath)
|
|
22300
22690
|
);
|
|
22301
22691
|
return new _AntigravityIdeRule({
|
|
22302
22692
|
outputRoot,
|
|
@@ -22309,7 +22699,7 @@ var AntigravityIdeRule = class _AntigravityIdeRule extends ToolRule {
|
|
|
22309
22699
|
});
|
|
22310
22700
|
}
|
|
22311
22701
|
const nonRootDirPath = buildToolPath(".agents", "rules");
|
|
22312
|
-
const filePath = (0,
|
|
22702
|
+
const filePath = (0, import_node_path142.join)(outputRoot, nonRootDirPath, relativeFilePath);
|
|
22313
22703
|
const fileContent = await readFileContent(filePath);
|
|
22314
22704
|
const { frontmatter, body } = parseFrontmatter(fileContent, filePath);
|
|
22315
22705
|
let parsedFrontmatter;
|
|
@@ -22438,7 +22828,7 @@ var AntigravityIdeRule = class _AntigravityIdeRule extends ToolRule {
|
|
|
22438
22828
|
};
|
|
22439
22829
|
|
|
22440
22830
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
22441
|
-
var
|
|
22831
|
+
var import_node_path143 = require("path");
|
|
22442
22832
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
22443
22833
|
toRulesyncRule() {
|
|
22444
22834
|
const rulesyncFrontmatter = {
|
|
@@ -22498,8 +22888,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
22498
22888
|
}) {
|
|
22499
22889
|
const settablePaths = this.getSettablePaths();
|
|
22500
22890
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
22501
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0,
|
|
22502
|
-
const fileContent = await readFileContent((0,
|
|
22891
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path143.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
22892
|
+
const fileContent = await readFileContent((0, import_node_path143.join)(outputRoot, relativePath));
|
|
22503
22893
|
return new _AugmentcodeLegacyRule({
|
|
22504
22894
|
outputRoot,
|
|
22505
22895
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -22528,7 +22918,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
22528
22918
|
};
|
|
22529
22919
|
|
|
22530
22920
|
// src/features/rules/augmentcode-rule.ts
|
|
22531
|
-
var
|
|
22921
|
+
var import_node_path144 = require("path");
|
|
22532
22922
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
22533
22923
|
toRulesyncRule() {
|
|
22534
22924
|
return this.toRulesyncRuleDefault();
|
|
@@ -22559,7 +22949,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
22559
22949
|
relativeFilePath,
|
|
22560
22950
|
validate = true
|
|
22561
22951
|
}) {
|
|
22562
|
-
const filePath = (0,
|
|
22952
|
+
const filePath = (0, import_node_path144.join)(
|
|
22563
22953
|
outputRoot,
|
|
22564
22954
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
22565
22955
|
relativeFilePath
|
|
@@ -22599,7 +22989,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
22599
22989
|
};
|
|
22600
22990
|
|
|
22601
22991
|
// src/features/rules/claudecode-legacy-rule.ts
|
|
22602
|
-
var
|
|
22992
|
+
var import_node_path145 = require("path");
|
|
22603
22993
|
var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
22604
22994
|
static getSettablePaths({
|
|
22605
22995
|
global,
|
|
@@ -22641,7 +23031,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
22641
23031
|
if (isRoot) {
|
|
22642
23032
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
22643
23033
|
const fileContent2 = await readFileContent(
|
|
22644
|
-
(0,
|
|
23034
|
+
(0, import_node_path145.join)(outputRoot, rootDirPath, paths.root.relativeFilePath)
|
|
22645
23035
|
);
|
|
22646
23036
|
return new _ClaudecodeLegacyRule({
|
|
22647
23037
|
outputRoot,
|
|
@@ -22655,8 +23045,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
22655
23045
|
if (!paths.nonRoot) {
|
|
22656
23046
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
22657
23047
|
}
|
|
22658
|
-
const relativePath = (0,
|
|
22659
|
-
const fileContent = await readFileContent((0,
|
|
23048
|
+
const relativePath = (0, import_node_path145.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
23049
|
+
const fileContent = await readFileContent((0, import_node_path145.join)(outputRoot, relativePath));
|
|
22660
23050
|
return new _ClaudecodeLegacyRule({
|
|
22661
23051
|
outputRoot,
|
|
22662
23052
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -22715,7 +23105,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
22715
23105
|
};
|
|
22716
23106
|
|
|
22717
23107
|
// src/features/rules/claudecode-rule.ts
|
|
22718
|
-
var
|
|
23108
|
+
var import_node_path146 = require("path");
|
|
22719
23109
|
var import_mini78 = require("zod/mini");
|
|
22720
23110
|
var ClaudecodeRuleFrontmatterSchema = import_mini78.z.object({
|
|
22721
23111
|
paths: import_mini78.z.optional(import_mini78.z.array(import_mini78.z.string()))
|
|
@@ -22756,7 +23146,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
22756
23146
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
22757
23147
|
if (!result.success) {
|
|
22758
23148
|
throw new Error(
|
|
22759
|
-
`Invalid frontmatter in ${(0,
|
|
23149
|
+
`Invalid frontmatter in ${(0, import_node_path146.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
22760
23150
|
);
|
|
22761
23151
|
}
|
|
22762
23152
|
}
|
|
@@ -22786,7 +23176,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
22786
23176
|
if (isRoot) {
|
|
22787
23177
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
22788
23178
|
const fileContent2 = await readFileContent(
|
|
22789
|
-
(0,
|
|
23179
|
+
(0, import_node_path146.join)(outputRoot, rootDirPath, paths.root.relativeFilePath)
|
|
22790
23180
|
);
|
|
22791
23181
|
return new _ClaudecodeRule({
|
|
22792
23182
|
outputRoot,
|
|
@@ -22801,8 +23191,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
22801
23191
|
if (!paths.nonRoot) {
|
|
22802
23192
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
22803
23193
|
}
|
|
22804
|
-
const relativePath = (0,
|
|
22805
|
-
const filePath = (0,
|
|
23194
|
+
const relativePath = (0, import_node_path146.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
23195
|
+
const filePath = (0, import_node_path146.join)(outputRoot, relativePath);
|
|
22806
23196
|
const fileContent = await readFileContent(filePath);
|
|
22807
23197
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
22808
23198
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -22913,7 +23303,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
22913
23303
|
return {
|
|
22914
23304
|
success: false,
|
|
22915
23305
|
error: new Error(
|
|
22916
|
-
`Invalid frontmatter in ${(0,
|
|
23306
|
+
`Invalid frontmatter in ${(0, import_node_path146.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
22917
23307
|
)
|
|
22918
23308
|
};
|
|
22919
23309
|
}
|
|
@@ -22933,7 +23323,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
22933
23323
|
};
|
|
22934
23324
|
|
|
22935
23325
|
// src/features/rules/cline-rule.ts
|
|
22936
|
-
var
|
|
23326
|
+
var import_node_path147 = require("path");
|
|
22937
23327
|
var import_mini79 = require("zod/mini");
|
|
22938
23328
|
var ClineRuleFrontmatterSchema = import_mini79.z.object({
|
|
22939
23329
|
description: import_mini79.z.string()
|
|
@@ -22979,7 +23369,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
22979
23369
|
validate = true
|
|
22980
23370
|
}) {
|
|
22981
23371
|
const fileContent = await readFileContent(
|
|
22982
|
-
(0,
|
|
23372
|
+
(0, import_node_path147.join)(outputRoot, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
22983
23373
|
);
|
|
22984
23374
|
return new _ClineRule({
|
|
22985
23375
|
outputRoot,
|
|
@@ -23005,7 +23395,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
23005
23395
|
};
|
|
23006
23396
|
|
|
23007
23397
|
// src/features/rules/codexcli-rule.ts
|
|
23008
|
-
var
|
|
23398
|
+
var import_node_path148 = require("path");
|
|
23009
23399
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
23010
23400
|
static getSettablePaths({
|
|
23011
23401
|
global,
|
|
@@ -23040,7 +23430,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
23040
23430
|
if (isRoot) {
|
|
23041
23431
|
const relativePath2 = paths.root.relativeFilePath;
|
|
23042
23432
|
const fileContent2 = await readFileContent(
|
|
23043
|
-
(0,
|
|
23433
|
+
(0, import_node_path148.join)(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
23044
23434
|
);
|
|
23045
23435
|
return new _CodexcliRule({
|
|
23046
23436
|
outputRoot,
|
|
@@ -23054,8 +23444,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
23054
23444
|
if (!paths.nonRoot) {
|
|
23055
23445
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
23056
23446
|
}
|
|
23057
|
-
const relativePath = (0,
|
|
23058
|
-
const fileContent = await readFileContent((0,
|
|
23447
|
+
const relativePath = (0, import_node_path148.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
23448
|
+
const fileContent = await readFileContent((0, import_node_path148.join)(outputRoot, relativePath));
|
|
23059
23449
|
return new _CodexcliRule({
|
|
23060
23450
|
outputRoot,
|
|
23061
23451
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -23114,7 +23504,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
23114
23504
|
};
|
|
23115
23505
|
|
|
23116
23506
|
// src/features/rules/copilot-rule.ts
|
|
23117
|
-
var
|
|
23507
|
+
var import_node_path149 = require("path");
|
|
23118
23508
|
var import_mini80 = require("zod/mini");
|
|
23119
23509
|
var CopilotRuleFrontmatterSchema = import_mini80.z.object({
|
|
23120
23510
|
description: import_mini80.z.optional(import_mini80.z.string()),
|
|
@@ -23122,7 +23512,7 @@ var CopilotRuleFrontmatterSchema = import_mini80.z.object({
|
|
|
23122
23512
|
excludeAgent: import_mini80.z.optional(import_mini80.z.union([import_mini80.z.literal("code-review"), import_mini80.z.literal("coding-agent")]))
|
|
23123
23513
|
});
|
|
23124
23514
|
var normalizeRelativePath = (p) => toPosixPath(p).replace(/\/+/g, "/");
|
|
23125
|
-
var sameRelativePath = (left, right) => normalizeRelativePath((0,
|
|
23515
|
+
var sameRelativePath = (left, right) => normalizeRelativePath((0, import_node_path149.join)(left.dir, left.file)) === normalizeRelativePath((0, import_node_path149.join)(right.dir, right.file));
|
|
23126
23516
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
23127
23517
|
frontmatter;
|
|
23128
23518
|
body;
|
|
@@ -23153,7 +23543,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
23153
23543
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
23154
23544
|
if (!result.success) {
|
|
23155
23545
|
throw new Error(
|
|
23156
|
-
`Invalid frontmatter in ${(0,
|
|
23546
|
+
`Invalid frontmatter in ${(0, import_node_path149.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
23157
23547
|
);
|
|
23158
23548
|
}
|
|
23159
23549
|
}
|
|
@@ -23246,8 +23636,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
23246
23636
|
) : relativeFilePath === paths.root.relativeFilePath;
|
|
23247
23637
|
const resolvedRelativeDirPath = relativeDirPath ?? (isRoot ? paths.root.relativeDirPath : paths.nonRoot?.relativeDirPath ?? paths.root.relativeDirPath);
|
|
23248
23638
|
if (isRoot) {
|
|
23249
|
-
const relativePath2 = (0,
|
|
23250
|
-
const filePath2 = (0,
|
|
23639
|
+
const relativePath2 = (0, import_node_path149.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
23640
|
+
const filePath2 = (0, import_node_path149.join)(outputRoot, relativePath2);
|
|
23251
23641
|
const fileContent2 = await readFileContent(filePath2);
|
|
23252
23642
|
return new _CopilotRule({
|
|
23253
23643
|
outputRoot,
|
|
@@ -23262,8 +23652,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
23262
23652
|
if (!paths.nonRoot) {
|
|
23263
23653
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
23264
23654
|
}
|
|
23265
|
-
const relativePath = (0,
|
|
23266
|
-
const filePath = (0,
|
|
23655
|
+
const relativePath = (0, import_node_path149.join)(resolvedRelativeDirPath, relativeFilePath);
|
|
23656
|
+
const filePath = (0, import_node_path149.join)(outputRoot, relativePath);
|
|
23267
23657
|
const fileContent = await readFileContent(filePath);
|
|
23268
23658
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
23269
23659
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -23312,7 +23702,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
23312
23702
|
return {
|
|
23313
23703
|
success: false,
|
|
23314
23704
|
error: new Error(
|
|
23315
|
-
`Invalid frontmatter in ${(0,
|
|
23705
|
+
`Invalid frontmatter in ${(0, import_node_path149.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
23316
23706
|
)
|
|
23317
23707
|
};
|
|
23318
23708
|
}
|
|
@@ -23368,7 +23758,7 @@ var CopilotcliRule = class _CopilotcliRule extends CopilotRule {
|
|
|
23368
23758
|
};
|
|
23369
23759
|
|
|
23370
23760
|
// src/features/rules/cursor-rule.ts
|
|
23371
|
-
var
|
|
23761
|
+
var import_node_path150 = require("path");
|
|
23372
23762
|
var import_mini81 = require("zod/mini");
|
|
23373
23763
|
var CursorRuleFrontmatterSchema = import_mini81.z.object({
|
|
23374
23764
|
description: import_mini81.z.optional(import_mini81.z.string()),
|
|
@@ -23390,7 +23780,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
23390
23780
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
23391
23781
|
if (!result.success) {
|
|
23392
23782
|
throw new Error(
|
|
23393
|
-
`Invalid frontmatter in ${(0,
|
|
23783
|
+
`Invalid frontmatter in ${(0, import_node_path150.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
23394
23784
|
);
|
|
23395
23785
|
}
|
|
23396
23786
|
}
|
|
@@ -23506,7 +23896,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
23506
23896
|
relativeFilePath,
|
|
23507
23897
|
validate = true
|
|
23508
23898
|
}) {
|
|
23509
|
-
const filePath = (0,
|
|
23899
|
+
const filePath = (0, import_node_path150.join)(
|
|
23510
23900
|
outputRoot,
|
|
23511
23901
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
23512
23902
|
relativeFilePath
|
|
@@ -23516,7 +23906,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
23516
23906
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
23517
23907
|
if (!result.success) {
|
|
23518
23908
|
throw new Error(
|
|
23519
|
-
`Invalid frontmatter in ${(0,
|
|
23909
|
+
`Invalid frontmatter in ${(0, import_node_path150.join)(outputRoot, relativeFilePath)}: ${formatError(result.error)}`
|
|
23520
23910
|
);
|
|
23521
23911
|
}
|
|
23522
23912
|
return new _CursorRule({
|
|
@@ -23553,7 +23943,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
23553
23943
|
return {
|
|
23554
23944
|
success: false,
|
|
23555
23945
|
error: new Error(
|
|
23556
|
-
`Invalid frontmatter in ${(0,
|
|
23946
|
+
`Invalid frontmatter in ${(0, import_node_path150.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
23557
23947
|
)
|
|
23558
23948
|
};
|
|
23559
23949
|
}
|
|
@@ -23573,7 +23963,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
23573
23963
|
};
|
|
23574
23964
|
|
|
23575
23965
|
// src/features/rules/deepagents-rule.ts
|
|
23576
|
-
var
|
|
23966
|
+
var import_node_path151 = require("path");
|
|
23577
23967
|
var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
23578
23968
|
constructor({ fileContent, root, ...rest }) {
|
|
23579
23969
|
super({
|
|
@@ -23600,8 +23990,8 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
23600
23990
|
}) {
|
|
23601
23991
|
const settablePaths = this.getSettablePaths();
|
|
23602
23992
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
23603
|
-
const relativePath = isRoot ? (0,
|
|
23604
|
-
const fileContent = await readFileContent((0,
|
|
23993
|
+
const relativePath = isRoot ? (0, import_node_path151.join)(".deepagents", "AGENTS.md") : (0, import_node_path151.join)(".deepagents", "memories", relativeFilePath);
|
|
23994
|
+
const fileContent = await readFileContent((0, import_node_path151.join)(outputRoot, relativePath));
|
|
23605
23995
|
return new _DeepagentsRule({
|
|
23606
23996
|
outputRoot,
|
|
23607
23997
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -23656,7 +24046,7 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
23656
24046
|
};
|
|
23657
24047
|
|
|
23658
24048
|
// src/features/rules/factorydroid-rule.ts
|
|
23659
|
-
var
|
|
24049
|
+
var import_node_path152 = require("path");
|
|
23660
24050
|
var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
23661
24051
|
constructor({ fileContent, root, ...rest }) {
|
|
23662
24052
|
super({
|
|
@@ -23696,8 +24086,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
23696
24086
|
const paths = this.getSettablePaths({ global });
|
|
23697
24087
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
23698
24088
|
if (isRoot) {
|
|
23699
|
-
const relativePath2 = (0,
|
|
23700
|
-
const fileContent2 = await readFileContent((0,
|
|
24089
|
+
const relativePath2 = (0, import_node_path152.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
24090
|
+
const fileContent2 = await readFileContent((0, import_node_path152.join)(outputRoot, relativePath2));
|
|
23701
24091
|
return new _FactorydroidRule({
|
|
23702
24092
|
outputRoot,
|
|
23703
24093
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -23710,8 +24100,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
23710
24100
|
if (!paths.nonRoot) {
|
|
23711
24101
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
23712
24102
|
}
|
|
23713
|
-
const relativePath = (0,
|
|
23714
|
-
const fileContent = await readFileContent((0,
|
|
24103
|
+
const relativePath = (0, import_node_path152.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24104
|
+
const fileContent = await readFileContent((0, import_node_path152.join)(outputRoot, relativePath));
|
|
23715
24105
|
return new _FactorydroidRule({
|
|
23716
24106
|
outputRoot,
|
|
23717
24107
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -23770,7 +24160,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
23770
24160
|
};
|
|
23771
24161
|
|
|
23772
24162
|
// src/features/rules/geminicli-rule.ts
|
|
23773
|
-
var
|
|
24163
|
+
var import_node_path153 = require("path");
|
|
23774
24164
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
23775
24165
|
static getSettablePaths({
|
|
23776
24166
|
global,
|
|
@@ -23805,7 +24195,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
23805
24195
|
if (isRoot) {
|
|
23806
24196
|
const relativePath2 = paths.root.relativeFilePath;
|
|
23807
24197
|
const fileContent2 = await readFileContent(
|
|
23808
|
-
(0,
|
|
24198
|
+
(0, import_node_path153.join)(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
23809
24199
|
);
|
|
23810
24200
|
return new _GeminiCliRule({
|
|
23811
24201
|
outputRoot,
|
|
@@ -23819,8 +24209,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
23819
24209
|
if (!paths.nonRoot) {
|
|
23820
24210
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
23821
24211
|
}
|
|
23822
|
-
const relativePath = (0,
|
|
23823
|
-
const fileContent = await readFileContent((0,
|
|
24212
|
+
const relativePath = (0, import_node_path153.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24213
|
+
const fileContent = await readFileContent((0, import_node_path153.join)(outputRoot, relativePath));
|
|
23824
24214
|
return new _GeminiCliRule({
|
|
23825
24215
|
outputRoot,
|
|
23826
24216
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -23879,7 +24269,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
23879
24269
|
};
|
|
23880
24270
|
|
|
23881
24271
|
// src/features/rules/goose-rule.ts
|
|
23882
|
-
var
|
|
24272
|
+
var import_node_path154 = require("path");
|
|
23883
24273
|
var GooseRule = class _GooseRule extends ToolRule {
|
|
23884
24274
|
static getSettablePaths({
|
|
23885
24275
|
global,
|
|
@@ -23914,7 +24304,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
23914
24304
|
if (isRoot) {
|
|
23915
24305
|
const relativePath2 = paths.root.relativeFilePath;
|
|
23916
24306
|
const fileContent2 = await readFileContent(
|
|
23917
|
-
(0,
|
|
24307
|
+
(0, import_node_path154.join)(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
23918
24308
|
);
|
|
23919
24309
|
return new _GooseRule({
|
|
23920
24310
|
outputRoot,
|
|
@@ -23928,8 +24318,8 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
23928
24318
|
if (!paths.nonRoot) {
|
|
23929
24319
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
23930
24320
|
}
|
|
23931
|
-
const relativePath = (0,
|
|
23932
|
-
const fileContent = await readFileContent((0,
|
|
24321
|
+
const relativePath = (0, import_node_path154.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24322
|
+
const fileContent = await readFileContent((0, import_node_path154.join)(outputRoot, relativePath));
|
|
23933
24323
|
return new _GooseRule({
|
|
23934
24324
|
outputRoot,
|
|
23935
24325
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -23988,7 +24378,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
23988
24378
|
};
|
|
23989
24379
|
|
|
23990
24380
|
// src/features/rules/junie-rule.ts
|
|
23991
|
-
var
|
|
24381
|
+
var import_node_path155 = require("path");
|
|
23992
24382
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
23993
24383
|
static getSettablePaths(_options = {}) {
|
|
23994
24384
|
return {
|
|
@@ -24017,8 +24407,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
24017
24407
|
}) {
|
|
24018
24408
|
const isRoot = _JunieRule.isRootRelativeFilePath(relativeFilePath);
|
|
24019
24409
|
const settablePaths = this.getSettablePaths();
|
|
24020
|
-
const relativePath = isRoot ? (0,
|
|
24021
|
-
const fileContent = await readFileContent((0,
|
|
24410
|
+
const relativePath = isRoot ? (0, import_node_path155.join)(settablePaths.root.relativeDirPath, settablePaths.root.relativeFilePath) : (0, import_node_path155.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24411
|
+
const fileContent = await readFileContent((0, import_node_path155.join)(outputRoot, relativePath));
|
|
24022
24412
|
return new _JunieRule({
|
|
24023
24413
|
outputRoot,
|
|
24024
24414
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -24073,7 +24463,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
24073
24463
|
};
|
|
24074
24464
|
|
|
24075
24465
|
// src/features/rules/kilo-rule.ts
|
|
24076
|
-
var
|
|
24466
|
+
var import_node_path156 = require("path");
|
|
24077
24467
|
var KiloRule = class _KiloRule extends ToolRule {
|
|
24078
24468
|
static getSettablePaths({
|
|
24079
24469
|
global,
|
|
@@ -24108,7 +24498,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
24108
24498
|
if (isRoot) {
|
|
24109
24499
|
const relativePath2 = paths.root.relativeFilePath;
|
|
24110
24500
|
const fileContent2 = await readFileContent(
|
|
24111
|
-
(0,
|
|
24501
|
+
(0, import_node_path156.join)(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
24112
24502
|
);
|
|
24113
24503
|
return new _KiloRule({
|
|
24114
24504
|
outputRoot,
|
|
@@ -24122,8 +24512,8 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
24122
24512
|
if (!paths.nonRoot) {
|
|
24123
24513
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
24124
24514
|
}
|
|
24125
|
-
const relativePath = (0,
|
|
24126
|
-
const fileContent = await readFileContent((0,
|
|
24515
|
+
const relativePath = (0, import_node_path156.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24516
|
+
const fileContent = await readFileContent((0, import_node_path156.join)(outputRoot, relativePath));
|
|
24127
24517
|
return new _KiloRule({
|
|
24128
24518
|
outputRoot,
|
|
24129
24519
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -24182,7 +24572,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
24182
24572
|
};
|
|
24183
24573
|
|
|
24184
24574
|
// src/features/rules/kiro-rule.ts
|
|
24185
|
-
var
|
|
24575
|
+
var import_node_path157 = require("path");
|
|
24186
24576
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
24187
24577
|
static getSettablePaths(_options = {}) {
|
|
24188
24578
|
return {
|
|
@@ -24197,7 +24587,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
24197
24587
|
validate = true
|
|
24198
24588
|
}) {
|
|
24199
24589
|
const fileContent = await readFileContent(
|
|
24200
|
-
(0,
|
|
24590
|
+
(0, import_node_path157.join)(outputRoot, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
24201
24591
|
);
|
|
24202
24592
|
return new _KiroRule({
|
|
24203
24593
|
outputRoot,
|
|
@@ -24251,7 +24641,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
24251
24641
|
};
|
|
24252
24642
|
|
|
24253
24643
|
// src/features/rules/opencode-rule.ts
|
|
24254
|
-
var
|
|
24644
|
+
var import_node_path158 = require("path");
|
|
24255
24645
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
24256
24646
|
static getSettablePaths({
|
|
24257
24647
|
global,
|
|
@@ -24286,7 +24676,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
24286
24676
|
if (isRoot) {
|
|
24287
24677
|
const relativePath2 = paths.root.relativeFilePath;
|
|
24288
24678
|
const fileContent2 = await readFileContent(
|
|
24289
|
-
(0,
|
|
24679
|
+
(0, import_node_path158.join)(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
24290
24680
|
);
|
|
24291
24681
|
return new _OpenCodeRule({
|
|
24292
24682
|
outputRoot,
|
|
@@ -24300,8 +24690,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
24300
24690
|
if (!paths.nonRoot) {
|
|
24301
24691
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
24302
24692
|
}
|
|
24303
|
-
const relativePath = (0,
|
|
24304
|
-
const fileContent = await readFileContent((0,
|
|
24693
|
+
const relativePath = (0, import_node_path158.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24694
|
+
const fileContent = await readFileContent((0, import_node_path158.join)(outputRoot, relativePath));
|
|
24305
24695
|
return new _OpenCodeRule({
|
|
24306
24696
|
outputRoot,
|
|
24307
24697
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -24360,7 +24750,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
24360
24750
|
};
|
|
24361
24751
|
|
|
24362
24752
|
// src/features/rules/pi-rule.ts
|
|
24363
|
-
var
|
|
24753
|
+
var import_node_path159 = require("path");
|
|
24364
24754
|
var PiRule = class _PiRule extends ToolRule {
|
|
24365
24755
|
static getSettablePaths({
|
|
24366
24756
|
global,
|
|
@@ -24394,7 +24784,7 @@ var PiRule = class _PiRule extends ToolRule {
|
|
|
24394
24784
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
24395
24785
|
if (isRoot) {
|
|
24396
24786
|
const fileContent2 = await readFileContent(
|
|
24397
|
-
(0,
|
|
24787
|
+
(0, import_node_path159.join)(outputRoot, paths.root.relativeDirPath, paths.root.relativeFilePath)
|
|
24398
24788
|
);
|
|
24399
24789
|
return new _PiRule({
|
|
24400
24790
|
outputRoot,
|
|
@@ -24410,8 +24800,8 @@ var PiRule = class _PiRule extends ToolRule {
|
|
|
24410
24800
|
`PiRule does not support non-root rules in global mode; expected '${paths.root.relativeFilePath}' but got '${relativeFilePath}'`
|
|
24411
24801
|
);
|
|
24412
24802
|
}
|
|
24413
|
-
const relativePath = (0,
|
|
24414
|
-
const fileContent = await readFileContent((0,
|
|
24803
|
+
const relativePath = (0, import_node_path159.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24804
|
+
const fileContent = await readFileContent((0, import_node_path159.join)(outputRoot, relativePath));
|
|
24415
24805
|
return new _PiRule({
|
|
24416
24806
|
outputRoot,
|
|
24417
24807
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -24475,7 +24865,7 @@ var PiRule = class _PiRule extends ToolRule {
|
|
|
24475
24865
|
};
|
|
24476
24866
|
|
|
24477
24867
|
// src/features/rules/qwencode-rule.ts
|
|
24478
|
-
var
|
|
24868
|
+
var import_node_path160 = require("path");
|
|
24479
24869
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
24480
24870
|
static getSettablePaths(_options = {}) {
|
|
24481
24871
|
return {
|
|
@@ -24494,8 +24884,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
24494
24884
|
validate = true
|
|
24495
24885
|
}) {
|
|
24496
24886
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
24497
|
-
const relativePath = isRoot ? "QWEN.md" : (0,
|
|
24498
|
-
const fileContent = await readFileContent((0,
|
|
24887
|
+
const relativePath = isRoot ? "QWEN.md" : (0, import_node_path160.join)(".qwen", "memories", relativeFilePath);
|
|
24888
|
+
const fileContent = await readFileContent((0, import_node_path160.join)(outputRoot, relativePath));
|
|
24499
24889
|
return new _QwencodeRule({
|
|
24500
24890
|
outputRoot,
|
|
24501
24891
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -24547,7 +24937,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
24547
24937
|
};
|
|
24548
24938
|
|
|
24549
24939
|
// src/features/rules/replit-rule.ts
|
|
24550
|
-
var
|
|
24940
|
+
var import_node_path161 = require("path");
|
|
24551
24941
|
var ReplitRule = class _ReplitRule extends ToolRule {
|
|
24552
24942
|
static getSettablePaths(_options = {}) {
|
|
24553
24943
|
return {
|
|
@@ -24569,7 +24959,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
24569
24959
|
}
|
|
24570
24960
|
const relativePath = paths.root.relativeFilePath;
|
|
24571
24961
|
const fileContent = await readFileContent(
|
|
24572
|
-
(0,
|
|
24962
|
+
(0, import_node_path161.join)(outputRoot, paths.root.relativeDirPath, relativePath)
|
|
24573
24963
|
);
|
|
24574
24964
|
return new _ReplitRule({
|
|
24575
24965
|
outputRoot,
|
|
@@ -24635,7 +25025,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
24635
25025
|
};
|
|
24636
25026
|
|
|
24637
25027
|
// src/features/rules/roo-rule.ts
|
|
24638
|
-
var
|
|
25028
|
+
var import_node_path162 = require("path");
|
|
24639
25029
|
var RooRule = class _RooRule extends ToolRule {
|
|
24640
25030
|
static getSettablePaths(_options = {}) {
|
|
24641
25031
|
return {
|
|
@@ -24650,7 +25040,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
24650
25040
|
validate = true
|
|
24651
25041
|
}) {
|
|
24652
25042
|
const fileContent = await readFileContent(
|
|
24653
|
-
(0,
|
|
25043
|
+
(0, import_node_path162.join)(outputRoot, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
24654
25044
|
);
|
|
24655
25045
|
return new _RooRule({
|
|
24656
25046
|
outputRoot,
|
|
@@ -24719,7 +25109,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
24719
25109
|
};
|
|
24720
25110
|
|
|
24721
25111
|
// src/features/rules/rovodev-rule.ts
|
|
24722
|
-
var
|
|
25112
|
+
var import_node_path163 = require("path");
|
|
24723
25113
|
var DISALLOWED_ROVODEV_MODULAR_RULE_BASENAMES = /* @__PURE__ */ new Set(["agents.md", "agents.local.md"]);
|
|
24724
25114
|
var RovodevRule = class _RovodevRule extends ToolRule {
|
|
24725
25115
|
/**
|
|
@@ -24763,7 +25153,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
24763
25153
|
root: rovodevAgents,
|
|
24764
25154
|
alternativeRoots: [{ relativeDirPath: ".", relativeFilePath: "AGENTS.md" }],
|
|
24765
25155
|
nonRoot: {
|
|
24766
|
-
relativeDirPath: (0,
|
|
25156
|
+
relativeDirPath: (0, import_node_path163.join)(".rovodev", ".rulesync", "modular-rules")
|
|
24767
25157
|
}
|
|
24768
25158
|
};
|
|
24769
25159
|
}
|
|
@@ -24802,10 +25192,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
24802
25192
|
}) {
|
|
24803
25193
|
if (!this.isAllowedModularRulesRelativePath(relativeFilePath)) {
|
|
24804
25194
|
throw new Error(
|
|
24805
|
-
`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${(0,
|
|
25195
|
+
`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${(0, import_node_path163.join)(relativeDirPath, relativeFilePath)}`
|
|
24806
25196
|
);
|
|
24807
25197
|
}
|
|
24808
|
-
const fileContent = await readFileContent((0,
|
|
25198
|
+
const fileContent = await readFileContent((0, import_node_path163.join)(outputRoot, relativeDirPath, relativeFilePath));
|
|
24809
25199
|
return new _RovodevRule({
|
|
24810
25200
|
outputRoot,
|
|
24811
25201
|
relativeDirPath,
|
|
@@ -24825,10 +25215,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
24825
25215
|
paths
|
|
24826
25216
|
}) {
|
|
24827
25217
|
const relativeDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
24828
|
-
const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${(0,
|
|
25218
|
+
const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${(0, import_node_path163.join)(paths.root.relativeDirPath, paths.root.relativeFilePath)} or project root` : (0, import_node_path163.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
24829
25219
|
if (relativeFilePath !== "AGENTS.md") {
|
|
24830
25220
|
throw new Error(
|
|
24831
|
-
`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${(0,
|
|
25221
|
+
`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${(0, import_node_path163.join)(relativeDirPath, relativeFilePath)}`
|
|
24832
25222
|
);
|
|
24833
25223
|
}
|
|
24834
25224
|
const allowed = relativeDirPath === paths.root.relativeDirPath || "alternativeRoots" in paths && paths.alternativeRoots?.some(
|
|
@@ -24836,10 +25226,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
24836
25226
|
);
|
|
24837
25227
|
if (!allowed) {
|
|
24838
25228
|
throw new Error(
|
|
24839
|
-
`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${(0,
|
|
25229
|
+
`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${(0, import_node_path163.join)(relativeDirPath, relativeFilePath)}`
|
|
24840
25230
|
);
|
|
24841
25231
|
}
|
|
24842
|
-
const fileContent = await readFileContent((0,
|
|
25232
|
+
const fileContent = await readFileContent((0, import_node_path163.join)(outputRoot, relativeDirPath, relativeFilePath));
|
|
24843
25233
|
return new _RovodevRule({
|
|
24844
25234
|
outputRoot,
|
|
24845
25235
|
relativeDirPath,
|
|
@@ -24953,7 +25343,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
24953
25343
|
};
|
|
24954
25344
|
|
|
24955
25345
|
// src/features/rules/takt-rule.ts
|
|
24956
|
-
var
|
|
25346
|
+
var import_node_path164 = require("path");
|
|
24957
25347
|
var DEFAULT_TAKT_RULE_DIR = "policies";
|
|
24958
25348
|
var TaktRule = class _TaktRule extends ToolRule {
|
|
24959
25349
|
static getSettablePaths({
|
|
@@ -24965,7 +25355,7 @@ var TaktRule = class _TaktRule extends ToolRule {
|
|
|
24965
25355
|
root: {
|
|
24966
25356
|
relativeDirPath: buildToolPath(
|
|
24967
25357
|
".takt",
|
|
24968
|
-
(0,
|
|
25358
|
+
(0, import_node_path164.join)("facets", DEFAULT_TAKT_RULE_DIR),
|
|
24969
25359
|
excludeToolDir
|
|
24970
25360
|
),
|
|
24971
25361
|
relativeFilePath: "overview.md"
|
|
@@ -24976,7 +25366,7 @@ var TaktRule = class _TaktRule extends ToolRule {
|
|
|
24976
25366
|
nonRoot: {
|
|
24977
25367
|
relativeDirPath: buildToolPath(
|
|
24978
25368
|
".takt",
|
|
24979
|
-
(0,
|
|
25369
|
+
(0, import_node_path164.join)("facets", DEFAULT_TAKT_RULE_DIR),
|
|
24980
25370
|
excludeToolDir
|
|
24981
25371
|
)
|
|
24982
25372
|
}
|
|
@@ -24994,8 +25384,8 @@ var TaktRule = class _TaktRule extends ToolRule {
|
|
|
24994
25384
|
validate = true,
|
|
24995
25385
|
relativeDirPath: overrideDirPath
|
|
24996
25386
|
}) {
|
|
24997
|
-
const dirPath = overrideDirPath ?? (0,
|
|
24998
|
-
const filePath = (0,
|
|
25387
|
+
const dirPath = overrideDirPath ?? (0, import_node_path164.join)(".takt", "facets", DEFAULT_TAKT_RULE_DIR);
|
|
25388
|
+
const filePath = (0, import_node_path164.join)(outputRoot, dirPath, relativeFilePath);
|
|
24999
25389
|
const fileContent = await readFileContent(filePath);
|
|
25000
25390
|
const { body } = parseFrontmatter(fileContent, filePath);
|
|
25001
25391
|
return new _TaktRule({
|
|
@@ -25034,7 +25424,7 @@ var TaktRule = class _TaktRule extends ToolRule {
|
|
|
25034
25424
|
const stem = overrideName ?? sourceStem;
|
|
25035
25425
|
assertSafeTaktName({ name: stem, featureLabel: "rule", sourceLabel });
|
|
25036
25426
|
const relativeFilePath = `${stem}.md`;
|
|
25037
|
-
const relativeDirPath = (0,
|
|
25427
|
+
const relativeDirPath = (0, import_node_path164.join)(".takt", "facets", DEFAULT_TAKT_RULE_DIR);
|
|
25038
25428
|
return new _TaktRule({
|
|
25039
25429
|
outputRoot,
|
|
25040
25430
|
relativeDirPath,
|
|
@@ -25059,7 +25449,7 @@ var TaktRule = class _TaktRule extends ToolRule {
|
|
|
25059
25449
|
};
|
|
25060
25450
|
|
|
25061
25451
|
// src/features/rules/warp-rule.ts
|
|
25062
|
-
var
|
|
25452
|
+
var import_node_path165 = require("path");
|
|
25063
25453
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
25064
25454
|
constructor({ fileContent, root, ...rest }) {
|
|
25065
25455
|
super({
|
|
@@ -25072,7 +25462,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
25072
25462
|
return {
|
|
25073
25463
|
root: {
|
|
25074
25464
|
relativeDirPath: ".",
|
|
25075
|
-
relativeFilePath: "
|
|
25465
|
+
relativeFilePath: "AGENTS.md"
|
|
25076
25466
|
},
|
|
25077
25467
|
nonRoot: {
|
|
25078
25468
|
relativeDirPath: buildToolPath(".warp", "memories", _options.excludeToolDir)
|
|
@@ -25085,8 +25475,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
25085
25475
|
validate = true
|
|
25086
25476
|
}) {
|
|
25087
25477
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
25088
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0,
|
|
25089
|
-
const fileContent = await readFileContent((0,
|
|
25478
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path165.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
25479
|
+
const fileContent = await readFileContent((0, import_node_path165.join)(outputRoot, relativePath));
|
|
25090
25480
|
return new _WarpRule({
|
|
25091
25481
|
outputRoot,
|
|
25092
25482
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -25102,7 +25492,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
25102
25492
|
validate = true
|
|
25103
25493
|
}) {
|
|
25104
25494
|
return new _WarpRule(
|
|
25105
|
-
this.
|
|
25495
|
+
this.buildToolRuleParamsAgentsmd({
|
|
25106
25496
|
outputRoot,
|
|
25107
25497
|
rulesyncRule,
|
|
25108
25498
|
validate,
|
|
@@ -25141,7 +25531,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
25141
25531
|
};
|
|
25142
25532
|
|
|
25143
25533
|
// src/features/rules/windsurf-rule.ts
|
|
25144
|
-
var
|
|
25534
|
+
var import_node_path166 = require("path");
|
|
25145
25535
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
25146
25536
|
static getSettablePaths(_options = {}) {
|
|
25147
25537
|
return {
|
|
@@ -25156,7 +25546,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
25156
25546
|
validate = true
|
|
25157
25547
|
}) {
|
|
25158
25548
|
const fileContent = await readFileContent(
|
|
25159
|
-
(0,
|
|
25549
|
+
(0, import_node_path166.join)(outputRoot, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
25160
25550
|
);
|
|
25161
25551
|
return new _WindsurfRule({
|
|
25162
25552
|
outputRoot,
|
|
@@ -25227,7 +25617,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
25227
25617
|
};
|
|
25228
25618
|
|
|
25229
25619
|
// src/features/rules/zed-rule.ts
|
|
25230
|
-
var
|
|
25620
|
+
var import_node_path167 = require("path");
|
|
25231
25621
|
var ZedRule = class _ZedRule extends ToolRule {
|
|
25232
25622
|
static getSettablePaths({
|
|
25233
25623
|
global,
|
|
@@ -25236,7 +25626,7 @@ var ZedRule = class _ZedRule extends ToolRule {
|
|
|
25236
25626
|
if (global) {
|
|
25237
25627
|
return {
|
|
25238
25628
|
root: {
|
|
25239
|
-
relativeDirPath: buildToolPath((0,
|
|
25629
|
+
relativeDirPath: buildToolPath((0, import_node_path167.join)(".config", "zed"), ".", excludeToolDir),
|
|
25240
25630
|
relativeFilePath: "AGENTS.md"
|
|
25241
25631
|
}
|
|
25242
25632
|
};
|
|
@@ -25260,7 +25650,7 @@ var ZedRule = class _ZedRule extends ToolRule {
|
|
|
25260
25650
|
throw new Error(`ZedRule only supports root rules: ${relativeFilePath}`);
|
|
25261
25651
|
}
|
|
25262
25652
|
const fileContent = await readFileContent(
|
|
25263
|
-
(0,
|
|
25653
|
+
(0, import_node_path167.join)(outputRoot, paths.root.relativeDirPath, paths.root.relativeFilePath)
|
|
25264
25654
|
);
|
|
25265
25655
|
return new _ZedRule({
|
|
25266
25656
|
outputRoot,
|
|
@@ -25361,7 +25751,7 @@ var rulesProcessorToolTargets = [
|
|
|
25361
25751
|
"zed"
|
|
25362
25752
|
];
|
|
25363
25753
|
var RulesProcessorToolTargetSchema = import_mini82.z.enum(rulesProcessorToolTargets);
|
|
25364
|
-
var formatRulePaths = (rules) => rules.map((r) => (0,
|
|
25754
|
+
var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path168.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
|
|
25365
25755
|
var RulesFeatureOptionsSchema = import_mini82.z.looseObject({
|
|
25366
25756
|
ruleDiscoveryMode: import_mini82.z.optional(import_mini82.z.enum(["none", "explicit"])),
|
|
25367
25757
|
includeLocalRoot: import_mini82.z.optional(import_mini82.z.boolean())
|
|
@@ -25897,7 +26287,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
25897
26287
|
}).relativeDirPath;
|
|
25898
26288
|
return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
|
|
25899
26289
|
const frontmatter = skill.getFrontmatter();
|
|
25900
|
-
const relativePath = (0,
|
|
26290
|
+
const relativePath = (0, import_node_path168.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
|
|
25901
26291
|
return {
|
|
25902
26292
|
name: frontmatter.name,
|
|
25903
26293
|
description: frontmatter.description,
|
|
@@ -26026,12 +26416,12 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26026
26416
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
26027
26417
|
*/
|
|
26028
26418
|
async loadRulesyncFiles() {
|
|
26029
|
-
const rulesyncOutputRoot = (0,
|
|
26030
|
-
const files = await findFilesByGlobs((0,
|
|
26419
|
+
const rulesyncOutputRoot = (0, import_node_path168.join)(this.inputRoot, RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
26420
|
+
const files = await findFilesByGlobs((0, import_node_path168.join)(rulesyncOutputRoot, "**", "*.md"));
|
|
26031
26421
|
this.logger.debug(`Found ${files.length} rulesync files`);
|
|
26032
26422
|
const rulesyncRules = await Promise.all(
|
|
26033
26423
|
files.map((file) => {
|
|
26034
|
-
const relativeFilePath = (0,
|
|
26424
|
+
const relativeFilePath = (0, import_node_path168.relative)(rulesyncOutputRoot, file);
|
|
26035
26425
|
checkPathTraversal({
|
|
26036
26426
|
relativePath: relativeFilePath,
|
|
26037
26427
|
intendedRootDir: rulesyncOutputRoot
|
|
@@ -26107,7 +26497,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26107
26497
|
global: this.global
|
|
26108
26498
|
});
|
|
26109
26499
|
const resolveRelativeDirPath = (filePath) => {
|
|
26110
|
-
const dirName = (0,
|
|
26500
|
+
const dirName = (0, import_node_path168.dirname)((0, import_node_path168.relative)(this.outputRoot, filePath));
|
|
26111
26501
|
return dirName === "" ? "." : dirName;
|
|
26112
26502
|
};
|
|
26113
26503
|
const buildDeletionRulesFromPaths = (filePaths, opts) => {
|
|
@@ -26115,7 +26505,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26115
26505
|
const effectiveOutputRoot = isNonRoot ? opts.outputRootOverride : this.outputRoot;
|
|
26116
26506
|
return filePaths.map((filePath) => {
|
|
26117
26507
|
const relativeDirPath = isNonRoot ? opts.relativeDirPathOverride : resolveRelativeDirPath(filePath);
|
|
26118
|
-
const relativeFilePath = isNonRoot ? (0,
|
|
26508
|
+
const relativeFilePath = isNonRoot ? (0, import_node_path168.relative)(effectiveOutputRoot, filePath) : (0, import_node_path168.basename)(filePath);
|
|
26119
26509
|
checkPathTraversal({
|
|
26120
26510
|
relativePath: isNonRoot ? relativeFilePath : relativeDirPath,
|
|
26121
26511
|
intendedRootDir: effectiveOutputRoot
|
|
@@ -26143,13 +26533,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26143
26533
|
return [];
|
|
26144
26534
|
}
|
|
26145
26535
|
const uniqueRootFilePaths = await findFilesWithFallback(
|
|
26146
|
-
(0,
|
|
26536
|
+
(0, import_node_path168.join)(
|
|
26147
26537
|
this.outputRoot,
|
|
26148
26538
|
settablePaths.root.relativeDirPath ?? ".",
|
|
26149
26539
|
settablePaths.root.relativeFilePath
|
|
26150
26540
|
),
|
|
26151
26541
|
settablePaths.alternativeRoots,
|
|
26152
|
-
(alt) => (0,
|
|
26542
|
+
(alt) => (0, import_node_path168.join)(this.outputRoot, alt.relativeDirPath, alt.relativeFilePath)
|
|
26153
26543
|
);
|
|
26154
26544
|
if (forDeletion) {
|
|
26155
26545
|
return buildDeletionRulesFromPaths(uniqueRootFilePaths);
|
|
@@ -26163,7 +26553,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26163
26553
|
});
|
|
26164
26554
|
return factory.class.fromFile({
|
|
26165
26555
|
outputRoot: this.outputRoot,
|
|
26166
|
-
relativeFilePath: (0,
|
|
26556
|
+
relativeFilePath: (0, import_node_path168.basename)(filePath),
|
|
26167
26557
|
relativeDirPath,
|
|
26168
26558
|
global: this.global
|
|
26169
26559
|
});
|
|
@@ -26180,7 +26570,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26180
26570
|
return [];
|
|
26181
26571
|
}
|
|
26182
26572
|
const uniqueLocalRootFilePaths2 = await findFilesByGlobs(
|
|
26183
|
-
(0,
|
|
26573
|
+
(0, import_node_path168.join)(this.outputRoot, "AGENTS.local.md")
|
|
26184
26574
|
);
|
|
26185
26575
|
return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths2);
|
|
26186
26576
|
}
|
|
@@ -26191,9 +26581,9 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26191
26581
|
return [];
|
|
26192
26582
|
}
|
|
26193
26583
|
const uniqueLocalRootFilePaths = await findFilesWithFallback(
|
|
26194
|
-
(0,
|
|
26584
|
+
(0, import_node_path168.join)(this.outputRoot, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
|
|
26195
26585
|
settablePaths.alternativeRoots,
|
|
26196
|
-
(alt) => (0,
|
|
26586
|
+
(alt) => (0, import_node_path168.join)(this.outputRoot, alt.relativeDirPath, "CLAUDE.local.md")
|
|
26197
26587
|
);
|
|
26198
26588
|
return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths);
|
|
26199
26589
|
})();
|
|
@@ -26204,20 +26594,20 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26204
26594
|
if (!forDeletion || this.toolTarget !== "rovodev" || this.global) {
|
|
26205
26595
|
return [];
|
|
26206
26596
|
}
|
|
26207
|
-
const primaryPaths = await findFilesByGlobs((0,
|
|
26597
|
+
const primaryPaths = await findFilesByGlobs((0, import_node_path168.join)(this.outputRoot, ".rovodev", "AGENTS.md"));
|
|
26208
26598
|
if (primaryPaths.length === 0) {
|
|
26209
26599
|
return [];
|
|
26210
26600
|
}
|
|
26211
|
-
const mirrorPaths = await findFilesByGlobs((0,
|
|
26601
|
+
const mirrorPaths = await findFilesByGlobs((0, import_node_path168.join)(this.outputRoot, "AGENTS.md"));
|
|
26212
26602
|
return buildDeletionRulesFromPaths(mirrorPaths);
|
|
26213
26603
|
})();
|
|
26214
26604
|
const nonRootToolRules = await (async () => {
|
|
26215
26605
|
if (!settablePaths.nonRoot) {
|
|
26216
26606
|
return [];
|
|
26217
26607
|
}
|
|
26218
|
-
const nonRootOutputRoot = (0,
|
|
26608
|
+
const nonRootOutputRoot = (0, import_node_path168.join)(this.outputRoot, settablePaths.nonRoot.relativeDirPath);
|
|
26219
26609
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
26220
|
-
(0,
|
|
26610
|
+
(0, import_node_path168.join)(nonRootOutputRoot, "**", `*.${factory.meta.extension}`)
|
|
26221
26611
|
);
|
|
26222
26612
|
if (forDeletion) {
|
|
26223
26613
|
return buildDeletionRulesFromPaths(nonRootFilePaths, {
|
|
@@ -26227,18 +26617,18 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26227
26617
|
}
|
|
26228
26618
|
const modularRootRelative = settablePaths.nonRoot.relativeDirPath;
|
|
26229
26619
|
const nonRootPathsForImport = this.toolTarget === "rovodev" ? nonRootFilePaths.filter((filePath) => {
|
|
26230
|
-
const relativeFilePath = (0,
|
|
26620
|
+
const relativeFilePath = (0, import_node_path168.relative)(nonRootOutputRoot, filePath);
|
|
26231
26621
|
const ok = RovodevRule.isAllowedModularRulesRelativePath(relativeFilePath);
|
|
26232
26622
|
if (!ok) {
|
|
26233
26623
|
this.logger.warn(
|
|
26234
|
-
`Skipping reserved Rovodev path under modular-rules (import): ${(0,
|
|
26624
|
+
`Skipping reserved Rovodev path under modular-rules (import): ${(0, import_node_path168.join)(modularRootRelative, relativeFilePath)}`
|
|
26235
26625
|
);
|
|
26236
26626
|
}
|
|
26237
26627
|
return ok;
|
|
26238
26628
|
}) : nonRootFilePaths;
|
|
26239
26629
|
return await Promise.all(
|
|
26240
26630
|
nonRootPathsForImport.map((filePath) => {
|
|
26241
|
-
const relativeFilePath = (0,
|
|
26631
|
+
const relativeFilePath = (0, import_node_path168.relative)(nonRootOutputRoot, filePath);
|
|
26242
26632
|
checkPathTraversal({
|
|
26243
26633
|
relativePath: relativeFilePath,
|
|
26244
26634
|
intendedRootDir: nonRootOutputRoot
|
|
@@ -26357,14 +26747,14 @@ s/<command> [arguments]
|
|
|
26357
26747
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
26358
26748
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
26359
26749
|
|
|
26360
|
-
When users call a custom slash command, you have to look for the markdown file, \`${(0,
|
|
26750
|
+
When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path168.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
26361
26751
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
26362
26752
|
|
|
26363
26753
|
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.
|
|
26364
26754
|
|
|
26365
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0,
|
|
26755
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path168.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
26366
26756
|
|
|
26367
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0,
|
|
26757
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path168.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
26368
26758
|
const skillsSection = skills ? this.generateSkillsSection(skills) : "";
|
|
26369
26759
|
const result = [
|
|
26370
26760
|
overview,
|
|
@@ -26622,7 +27012,7 @@ function buildPermissionsStrategy(ctx) {
|
|
|
26622
27012
|
}
|
|
26623
27013
|
|
|
26624
27014
|
// src/lib/generate.ts
|
|
26625
|
-
var
|
|
27015
|
+
var import_node_path169 = require("path");
|
|
26626
27016
|
var import_es_toolkit9 = require("es-toolkit");
|
|
26627
27017
|
async function processFeatureGeneration(params) {
|
|
26628
27018
|
const { config, processor, toolFiles } = params;
|
|
@@ -26696,7 +27086,7 @@ function warnUnsupportedTargets(params) {
|
|
|
26696
27086
|
}
|
|
26697
27087
|
}
|
|
26698
27088
|
async function checkRulesyncDirExists(params) {
|
|
26699
|
-
return fileExists((0,
|
|
27089
|
+
return fileExists((0, import_node_path169.join)(params.inputRoot, RULESYNC_RELATIVE_DIR_PATH));
|
|
26700
27090
|
}
|
|
26701
27091
|
async function generate(params) {
|
|
26702
27092
|
const { config, logger } = params;
|