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
|
@@ -240,6 +240,7 @@ import { z as z2 } from "zod/mini";
|
|
|
240
240
|
var ALL_TOOL_TARGETS = [
|
|
241
241
|
"agentsmd",
|
|
242
242
|
"agentsskills",
|
|
243
|
+
"amp",
|
|
243
244
|
"antigravity",
|
|
244
245
|
"antigravity-cli",
|
|
245
246
|
"antigravity-ide",
|
|
@@ -6293,9 +6294,11 @@ function generateOpencodeStylePluginCode(config, supportedEvents, toolConfigKey,
|
|
|
6293
6294
|
const escapedCommand = escapeForTemplateLiteral(handler.command);
|
|
6294
6295
|
if (handler.matcher) {
|
|
6295
6296
|
const safeMatcher = validateAndSanitizeMatcher(handler.matcher);
|
|
6296
|
-
lines.push(
|
|
6297
|
-
lines.push(`
|
|
6298
|
-
lines.push(`
|
|
6297
|
+
lines.push(" {");
|
|
6298
|
+
lines.push(` const __re = new RegExp("${safeMatcher}");`);
|
|
6299
|
+
lines.push(` if (__re.test(input.tool)) {`);
|
|
6300
|
+
lines.push(` await $\`${escapedCommand}\`;`);
|
|
6301
|
+
lines.push(" }");
|
|
6299
6302
|
lines.push(" }");
|
|
6300
6303
|
} else {
|
|
6301
6304
|
lines.push(` await $\`${escapedCommand}\`;`);
|
|
@@ -8176,8 +8179,19 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
8176
8179
|
// src/features/mcp/mcp-processor.ts
|
|
8177
8180
|
import { z as z29 } from "zod/mini";
|
|
8178
8181
|
|
|
8179
|
-
// src/features/mcp/
|
|
8182
|
+
// src/features/mcp/amp-mcp.ts
|
|
8180
8183
|
import { join as join53 } from "path";
|
|
8184
|
+
import { parse as parseJsonc3, printParseErrorCode } from "jsonc-parser";
|
|
8185
|
+
|
|
8186
|
+
// src/utils/prototype-pollution.ts
|
|
8187
|
+
var PROTOTYPE_POLLUTION_KEYS = /* @__PURE__ */ new Set([
|
|
8188
|
+
"__proto__",
|
|
8189
|
+
"constructor",
|
|
8190
|
+
"prototype"
|
|
8191
|
+
]);
|
|
8192
|
+
function isPrototypePollutionKey(key) {
|
|
8193
|
+
return PROTOTYPE_POLLUTION_KEYS.has(key);
|
|
8194
|
+
}
|
|
8181
8195
|
|
|
8182
8196
|
// src/features/mcp/rulesync-mcp.ts
|
|
8183
8197
|
import { join as join52 } from "path";
|
|
@@ -8406,7 +8420,200 @@ var ToolMcp = class extends ToolFile {
|
|
|
8406
8420
|
}
|
|
8407
8421
|
};
|
|
8408
8422
|
|
|
8423
|
+
// src/features/mcp/amp-mcp.ts
|
|
8424
|
+
var AMP_MCP_SERVERS_KEY = "amp.mcpServers";
|
|
8425
|
+
function parseAmpSettingsJsonc(fileContent) {
|
|
8426
|
+
const errors = [];
|
|
8427
|
+
const parsed = parseJsonc3(fileContent || "{}", errors, { allowTrailingComma: true });
|
|
8428
|
+
if (errors.length > 0) {
|
|
8429
|
+
const details = errors.map((error) => `${printParseErrorCode(error.error)} at offset ${error.offset}`).join(", ");
|
|
8430
|
+
throw new Error(`Failed to parse Amp settings: ${details}`);
|
|
8431
|
+
}
|
|
8432
|
+
if (!isRecord(parsed)) {
|
|
8433
|
+
throw new Error("Amp settings must be a JSON object");
|
|
8434
|
+
}
|
|
8435
|
+
return parsed;
|
|
8436
|
+
}
|
|
8437
|
+
function filterMcpServers(mcpServers) {
|
|
8438
|
+
const filtered = {};
|
|
8439
|
+
if (!isRecord(mcpServers)) return filtered;
|
|
8440
|
+
for (const [name, config] of Object.entries(mcpServers)) {
|
|
8441
|
+
if (isPrototypePollutionKey(name) || !isRecord(config)) continue;
|
|
8442
|
+
const filteredConfig = {};
|
|
8443
|
+
for (const [key, value] of Object.entries(config)) {
|
|
8444
|
+
if (isPrototypePollutionKey(key)) continue;
|
|
8445
|
+
filteredConfig[key] = value;
|
|
8446
|
+
}
|
|
8447
|
+
filtered[name] = filteredConfig;
|
|
8448
|
+
}
|
|
8449
|
+
return filtered;
|
|
8450
|
+
}
|
|
8451
|
+
var AmpMcp = class _AmpMcp extends ToolMcp {
|
|
8452
|
+
json;
|
|
8453
|
+
constructor(params) {
|
|
8454
|
+
super(params);
|
|
8455
|
+
this.json = parseAmpSettingsJsonc(this.fileContent);
|
|
8456
|
+
}
|
|
8457
|
+
getJson() {
|
|
8458
|
+
return structuredClone(this.json);
|
|
8459
|
+
}
|
|
8460
|
+
static getSettablePaths({ global } = {}) {
|
|
8461
|
+
if (global) {
|
|
8462
|
+
return {
|
|
8463
|
+
relativeDirPath: join53(".config", "amp"),
|
|
8464
|
+
relativeFilePath: "settings.jsonc"
|
|
8465
|
+
};
|
|
8466
|
+
}
|
|
8467
|
+
return {
|
|
8468
|
+
relativeDirPath: ".amp",
|
|
8469
|
+
relativeFilePath: "settings.jsonc"
|
|
8470
|
+
};
|
|
8471
|
+
}
|
|
8472
|
+
/**
|
|
8473
|
+
* Probe `<jsonDir>/settings.jsonc` first, falling back to `settings.json`,
|
|
8474
|
+
* so existing user files are read-modified-written in place instead of a
|
|
8475
|
+
* fresh `.json` sibling being created next to a hand-authored `.jsonc`.
|
|
8476
|
+
* Defaults to `settings.jsonc` when neither file exists.
|
|
8477
|
+
*/
|
|
8478
|
+
static async resolveSettingsFile(jsonDir) {
|
|
8479
|
+
const jsoncContent = await readFileContentOrNull(join53(jsonDir, "settings.jsonc"));
|
|
8480
|
+
if (jsoncContent !== null) {
|
|
8481
|
+
return { fileContent: jsoncContent, relativeFilePath: "settings.jsonc" };
|
|
8482
|
+
}
|
|
8483
|
+
const jsonContent = await readFileContentOrNull(join53(jsonDir, "settings.json"));
|
|
8484
|
+
if (jsonContent !== null) {
|
|
8485
|
+
return { fileContent: jsonContent, relativeFilePath: "settings.json" };
|
|
8486
|
+
}
|
|
8487
|
+
return { fileContent: null, relativeFilePath: "settings.jsonc" };
|
|
8488
|
+
}
|
|
8489
|
+
static async fromFile({
|
|
8490
|
+
outputRoot = process.cwd(),
|
|
8491
|
+
validate = true,
|
|
8492
|
+
global = false
|
|
8493
|
+
}) {
|
|
8494
|
+
const basePaths = this.getSettablePaths({ global });
|
|
8495
|
+
const jsonDir = join53(outputRoot, basePaths.relativeDirPath);
|
|
8496
|
+
const { fileContent, relativeFilePath } = await this.resolveSettingsFile(jsonDir);
|
|
8497
|
+
const json = fileContent ? parseAmpSettingsJsonc(fileContent) : {};
|
|
8498
|
+
const mcpServers = json[AMP_MCP_SERVERS_KEY];
|
|
8499
|
+
const newJson = { ...json, [AMP_MCP_SERVERS_KEY]: mcpServers ?? {} };
|
|
8500
|
+
return new _AmpMcp({
|
|
8501
|
+
outputRoot,
|
|
8502
|
+
relativeDirPath: basePaths.relativeDirPath,
|
|
8503
|
+
relativeFilePath,
|
|
8504
|
+
fileContent: JSON.stringify(newJson, null, 2),
|
|
8505
|
+
validate,
|
|
8506
|
+
global
|
|
8507
|
+
});
|
|
8508
|
+
}
|
|
8509
|
+
static async fromRulesyncMcp({
|
|
8510
|
+
outputRoot = process.cwd(),
|
|
8511
|
+
rulesyncMcp,
|
|
8512
|
+
validate = true,
|
|
8513
|
+
global = false
|
|
8514
|
+
}) {
|
|
8515
|
+
const basePaths = this.getSettablePaths({ global });
|
|
8516
|
+
const jsonDir = join53(outputRoot, basePaths.relativeDirPath);
|
|
8517
|
+
const { fileContent, relativeFilePath } = await this.resolveSettingsFile(jsonDir);
|
|
8518
|
+
const json = fileContent ? parseAmpSettingsJsonc(fileContent) : { [AMP_MCP_SERVERS_KEY]: {} };
|
|
8519
|
+
const filteredMcpServers = filterMcpServers(rulesyncMcp.getMcpServers());
|
|
8520
|
+
const newJson = { ...json, [AMP_MCP_SERVERS_KEY]: filteredMcpServers };
|
|
8521
|
+
return new _AmpMcp({
|
|
8522
|
+
outputRoot,
|
|
8523
|
+
relativeDirPath: basePaths.relativeDirPath,
|
|
8524
|
+
relativeFilePath,
|
|
8525
|
+
fileContent: JSON.stringify(newJson, null, 2),
|
|
8526
|
+
validate,
|
|
8527
|
+
global
|
|
8528
|
+
});
|
|
8529
|
+
}
|
|
8530
|
+
toRulesyncMcp() {
|
|
8531
|
+
const filtered = filterMcpServers(this.json[AMP_MCP_SERVERS_KEY]);
|
|
8532
|
+
return this.toRulesyncMcpDefault({
|
|
8533
|
+
fileContent: JSON.stringify({ mcpServers: filtered }, null, 2)
|
|
8534
|
+
});
|
|
8535
|
+
}
|
|
8536
|
+
validate() {
|
|
8537
|
+
let json;
|
|
8538
|
+
try {
|
|
8539
|
+
json = parseAmpSettingsJsonc(this.fileContent);
|
|
8540
|
+
} catch (error) {
|
|
8541
|
+
return {
|
|
8542
|
+
success: false,
|
|
8543
|
+
error: error instanceof Error ? error : new Error(String(error))
|
|
8544
|
+
};
|
|
8545
|
+
}
|
|
8546
|
+
for (const key of Object.keys(json)) {
|
|
8547
|
+
if (isPrototypePollutionKey(key)) {
|
|
8548
|
+
return {
|
|
8549
|
+
success: false,
|
|
8550
|
+
error: new Error(`Prototype pollution key "${key}" is not allowed`)
|
|
8551
|
+
};
|
|
8552
|
+
}
|
|
8553
|
+
}
|
|
8554
|
+
const mcpServers = json[AMP_MCP_SERVERS_KEY];
|
|
8555
|
+
if (mcpServers === void 0) {
|
|
8556
|
+
return { success: true, error: null };
|
|
8557
|
+
}
|
|
8558
|
+
if (!isRecord(mcpServers)) {
|
|
8559
|
+
return {
|
|
8560
|
+
success: false,
|
|
8561
|
+
error: new Error(`${AMP_MCP_SERVERS_KEY} must be a JSON object`)
|
|
8562
|
+
};
|
|
8563
|
+
}
|
|
8564
|
+
for (const [serverName, serverConfig] of Object.entries(mcpServers)) {
|
|
8565
|
+
if (isPrototypePollutionKey(serverName)) {
|
|
8566
|
+
return {
|
|
8567
|
+
success: false,
|
|
8568
|
+
error: new Error(
|
|
8569
|
+
`Server name "${serverName}" is a prototype pollution key and is not allowed`
|
|
8570
|
+
)
|
|
8571
|
+
};
|
|
8572
|
+
}
|
|
8573
|
+
if (!isRecord(serverConfig)) {
|
|
8574
|
+
return {
|
|
8575
|
+
success: false,
|
|
8576
|
+
error: new Error(`MCP server "${serverName}" must be a JSON object`)
|
|
8577
|
+
};
|
|
8578
|
+
}
|
|
8579
|
+
for (const key of Object.keys(serverConfig)) {
|
|
8580
|
+
if (isPrototypePollutionKey(key)) {
|
|
8581
|
+
return {
|
|
8582
|
+
success: false,
|
|
8583
|
+
error: new Error(
|
|
8584
|
+
`Config key "${key}" in server "${serverName}" is a prototype pollution key and is not allowed`
|
|
8585
|
+
)
|
|
8586
|
+
};
|
|
8587
|
+
}
|
|
8588
|
+
}
|
|
8589
|
+
}
|
|
8590
|
+
return { success: true, error: null };
|
|
8591
|
+
}
|
|
8592
|
+
/**
|
|
8593
|
+
* settings.json may contain other Amp settings, so it should not be deleted.
|
|
8594
|
+
*/
|
|
8595
|
+
isDeletable() {
|
|
8596
|
+
return false;
|
|
8597
|
+
}
|
|
8598
|
+
static forDeletion({
|
|
8599
|
+
outputRoot = process.cwd(),
|
|
8600
|
+
relativeDirPath,
|
|
8601
|
+
relativeFilePath,
|
|
8602
|
+
global = false
|
|
8603
|
+
}) {
|
|
8604
|
+
return new _AmpMcp({
|
|
8605
|
+
outputRoot,
|
|
8606
|
+
relativeDirPath,
|
|
8607
|
+
relativeFilePath,
|
|
8608
|
+
fileContent: "{}",
|
|
8609
|
+
validate: false,
|
|
8610
|
+
global
|
|
8611
|
+
});
|
|
8612
|
+
}
|
|
8613
|
+
};
|
|
8614
|
+
|
|
8409
8615
|
// src/features/mcp/antigravity-mcp.ts
|
|
8616
|
+
import { join as join54 } from "path";
|
|
8410
8617
|
function renameServerField(servers, from, to) {
|
|
8411
8618
|
if (servers === null || typeof servers !== "object" || Array.isArray(servers)) {
|
|
8412
8619
|
return {};
|
|
@@ -8445,7 +8652,7 @@ var AntigravityMcp = class extends ToolMcp {
|
|
|
8445
8652
|
static getSettablePaths({ global } = {}) {
|
|
8446
8653
|
if (global) {
|
|
8447
8654
|
return {
|
|
8448
|
-
relativeDirPath:
|
|
8655
|
+
relativeDirPath: join54(".gemini", this.getGlobalSubdir()),
|
|
8449
8656
|
relativeFilePath: "mcp_config.json"
|
|
8450
8657
|
};
|
|
8451
8658
|
}
|
|
@@ -8461,7 +8668,7 @@ var AntigravityMcp = class extends ToolMcp {
|
|
|
8461
8668
|
}) {
|
|
8462
8669
|
const paths = this.getSettablePaths({ global });
|
|
8463
8670
|
const fileContent = await readFileContentOrNull(
|
|
8464
|
-
|
|
8671
|
+
join54(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
8465
8672
|
) ?? '{"mcpServers":{}}';
|
|
8466
8673
|
const json = JSON.parse(fileContent);
|
|
8467
8674
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
@@ -8482,7 +8689,7 @@ var AntigravityMcp = class extends ToolMcp {
|
|
|
8482
8689
|
}) {
|
|
8483
8690
|
const paths = this.getSettablePaths({ global });
|
|
8484
8691
|
const fileContent = await readOrInitializeFileContent(
|
|
8485
|
-
|
|
8692
|
+
join54(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
8486
8693
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
8487
8694
|
);
|
|
8488
8695
|
const json = JSON.parse(fileContent);
|
|
@@ -8540,7 +8747,7 @@ var AntigravityIdeMcp = class extends AntigravityMcp {
|
|
|
8540
8747
|
};
|
|
8541
8748
|
|
|
8542
8749
|
// src/features/mcp/claudecode-mcp.ts
|
|
8543
|
-
import { join as
|
|
8750
|
+
import { join as join55 } from "path";
|
|
8544
8751
|
var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
8545
8752
|
json;
|
|
8546
8753
|
constructor(params) {
|
|
@@ -8586,7 +8793,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
8586
8793
|
logger
|
|
8587
8794
|
}) {
|
|
8588
8795
|
const paths = this.getSettablePaths({ global });
|
|
8589
|
-
const recommendedPath =
|
|
8796
|
+
const recommendedPath = join55(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
8590
8797
|
if (await fileExists(recommendedPath)) {
|
|
8591
8798
|
const fileContent = await readFileContent(recommendedPath);
|
|
8592
8799
|
const json = JSON.parse(fileContent);
|
|
@@ -8601,7 +8808,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
8601
8808
|
});
|
|
8602
8809
|
}
|
|
8603
8810
|
if (global) {
|
|
8604
|
-
const legacyPath =
|
|
8811
|
+
const legacyPath = join55(
|
|
8605
8812
|
outputRoot,
|
|
8606
8813
|
_ClaudecodeMcp.LEGACY_GLOBAL_DIR,
|
|
8607
8814
|
_ClaudecodeMcp.LEGACY_GLOBAL_FILE
|
|
@@ -8640,7 +8847,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
8640
8847
|
}) {
|
|
8641
8848
|
const paths = this.getSettablePaths({ global });
|
|
8642
8849
|
const fileContent = await readOrInitializeFileContent(
|
|
8643
|
-
|
|
8850
|
+
join55(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
8644
8851
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
8645
8852
|
);
|
|
8646
8853
|
const json = JSON.parse(fileContent);
|
|
@@ -8680,7 +8887,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
8680
8887
|
};
|
|
8681
8888
|
|
|
8682
8889
|
// src/features/mcp/cline-mcp.ts
|
|
8683
|
-
import { join as
|
|
8890
|
+
import { join as join56 } from "path";
|
|
8684
8891
|
var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
8685
8892
|
json;
|
|
8686
8893
|
constructor(params) {
|
|
@@ -8701,7 +8908,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
8701
8908
|
validate = true
|
|
8702
8909
|
}) {
|
|
8703
8910
|
const fileContent = await readFileContent(
|
|
8704
|
-
|
|
8911
|
+
join56(
|
|
8705
8912
|
outputRoot,
|
|
8706
8913
|
this.getSettablePaths().relativeDirPath,
|
|
8707
8914
|
this.getSettablePaths().relativeFilePath
|
|
@@ -8756,7 +8963,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
8756
8963
|
};
|
|
8757
8964
|
|
|
8758
8965
|
// src/features/mcp/codexcli-mcp.ts
|
|
8759
|
-
import { join as
|
|
8966
|
+
import { join as join57 } from "path";
|
|
8760
8967
|
import * as smolToml3 from "smol-toml";
|
|
8761
8968
|
var CODEX_TO_RULESYNC_FIELD_MAP = {
|
|
8762
8969
|
enabled_tools: "enabledTools",
|
|
@@ -8769,7 +8976,6 @@ var RULESYNC_TO_CODEX_FIELD_MAP = {
|
|
|
8769
8976
|
envVars: "env_vars"
|
|
8770
8977
|
};
|
|
8771
8978
|
var MAX_REMOVE_EMPTY_ENTRIES_DEPTH = 32;
|
|
8772
|
-
var PROTOTYPE_POLLUTION_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
8773
8979
|
function convertFromCodexFormat(codexMcp) {
|
|
8774
8980
|
const result = {};
|
|
8775
8981
|
for (const [name, config] of Object.entries(codexMcp)) {
|
|
@@ -8867,7 +9073,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
8867
9073
|
}) {
|
|
8868
9074
|
const paths = this.getSettablePaths({ global });
|
|
8869
9075
|
const fileContent = await readFileContentOrNull(
|
|
8870
|
-
|
|
9076
|
+
join57(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
8871
9077
|
) ?? smolToml3.stringify({});
|
|
8872
9078
|
return new _CodexcliMcp({
|
|
8873
9079
|
outputRoot,
|
|
@@ -8884,7 +9090,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
8884
9090
|
global = false
|
|
8885
9091
|
}) {
|
|
8886
9092
|
const paths = this.getSettablePaths({ global });
|
|
8887
|
-
const configTomlFilePath =
|
|
9093
|
+
const configTomlFilePath = join57(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
8888
9094
|
const configTomlFileContent = await readOrInitializeFileContent(
|
|
8889
9095
|
configTomlFilePath,
|
|
8890
9096
|
smolToml3.stringify({})
|
|
@@ -8974,7 +9180,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
8974
9180
|
};
|
|
8975
9181
|
|
|
8976
9182
|
// src/features/mcp/copilot-mcp.ts
|
|
8977
|
-
import { join as
|
|
9183
|
+
import { join as join58 } from "path";
|
|
8978
9184
|
function convertToCopilotFormat(mcpServers) {
|
|
8979
9185
|
return { servers: mcpServers };
|
|
8980
9186
|
}
|
|
@@ -9001,7 +9207,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
9001
9207
|
validate = true
|
|
9002
9208
|
}) {
|
|
9003
9209
|
const fileContent = await readFileContent(
|
|
9004
|
-
|
|
9210
|
+
join58(
|
|
9005
9211
|
outputRoot,
|
|
9006
9212
|
this.getSettablePaths().relativeDirPath,
|
|
9007
9213
|
this.getSettablePaths().relativeFilePath
|
|
@@ -9054,7 +9260,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
9054
9260
|
};
|
|
9055
9261
|
|
|
9056
9262
|
// src/features/mcp/copilotcli-mcp.ts
|
|
9057
|
-
import { join as
|
|
9263
|
+
import { join as join59 } from "path";
|
|
9058
9264
|
var isRemoteServerType = (type) => {
|
|
9059
9265
|
return type === "http" || type === "sse";
|
|
9060
9266
|
};
|
|
@@ -9153,7 +9359,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
|
|
|
9153
9359
|
}) {
|
|
9154
9360
|
const paths = this.getSettablePaths({ global });
|
|
9155
9361
|
const fileContent = await readFileContentOrNull(
|
|
9156
|
-
|
|
9362
|
+
join59(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
9157
9363
|
) ?? '{"mcpServers":{}}';
|
|
9158
9364
|
const json = JSON.parse(fileContent);
|
|
9159
9365
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
@@ -9174,7 +9380,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
|
|
|
9174
9380
|
}) {
|
|
9175
9381
|
const paths = this.getSettablePaths({ global });
|
|
9176
9382
|
const fileContent = await readOrInitializeFileContent(
|
|
9177
|
-
|
|
9383
|
+
join59(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
9178
9384
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
9179
9385
|
);
|
|
9180
9386
|
const json = JSON.parse(fileContent);
|
|
@@ -9216,7 +9422,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
|
|
|
9216
9422
|
};
|
|
9217
9423
|
|
|
9218
9424
|
// src/features/mcp/cursor-mcp.ts
|
|
9219
|
-
import { join as
|
|
9425
|
+
import { join as join60 } from "path";
|
|
9220
9426
|
|
|
9221
9427
|
// src/features/mcp/mcp-env-var-format.ts
|
|
9222
9428
|
var CANONICAL_ENV_VAR_PATTERN = /\$\{(?!env:)([^}:]+)\}/g;
|
|
@@ -9287,7 +9493,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
9287
9493
|
this.json = JSON.parse(this.fileContent);
|
|
9288
9494
|
} catch (error) {
|
|
9289
9495
|
throw new Error(
|
|
9290
|
-
`Failed to parse Cursor MCP config at ${
|
|
9496
|
+
`Failed to parse Cursor MCP config at ${join60(this.relativeDirPath, this.relativeFilePath)}: ${formatError(error)}`,
|
|
9291
9497
|
{ cause: error }
|
|
9292
9498
|
);
|
|
9293
9499
|
}
|
|
@@ -9313,14 +9519,14 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
9313
9519
|
global = false
|
|
9314
9520
|
}) {
|
|
9315
9521
|
const paths = this.getSettablePaths({ global });
|
|
9316
|
-
const filePath =
|
|
9522
|
+
const filePath = join60(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
9317
9523
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"mcpServers":{}}';
|
|
9318
9524
|
let json;
|
|
9319
9525
|
try {
|
|
9320
9526
|
json = JSON.parse(fileContent);
|
|
9321
9527
|
} catch (error) {
|
|
9322
9528
|
throw new Error(
|
|
9323
|
-
`Failed to parse Cursor MCP config at ${
|
|
9529
|
+
`Failed to parse Cursor MCP config at ${join60(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
|
|
9324
9530
|
{ cause: error }
|
|
9325
9531
|
);
|
|
9326
9532
|
}
|
|
@@ -9342,7 +9548,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
9342
9548
|
}) {
|
|
9343
9549
|
const paths = this.getSettablePaths({ global });
|
|
9344
9550
|
const fileContent = await readOrInitializeFileContent(
|
|
9345
|
-
|
|
9551
|
+
join60(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
9346
9552
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
9347
9553
|
);
|
|
9348
9554
|
let json;
|
|
@@ -9350,7 +9556,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
9350
9556
|
json = JSON.parse(fileContent);
|
|
9351
9557
|
} catch (error) {
|
|
9352
9558
|
throw new Error(
|
|
9353
|
-
`Failed to parse Cursor MCP config at ${
|
|
9559
|
+
`Failed to parse Cursor MCP config at ${join60(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
|
|
9354
9560
|
{ cause: error }
|
|
9355
9561
|
);
|
|
9356
9562
|
}
|
|
@@ -9404,7 +9610,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
9404
9610
|
};
|
|
9405
9611
|
|
|
9406
9612
|
// src/features/mcp/deepagents-mcp.ts
|
|
9407
|
-
import { join as
|
|
9613
|
+
import { join as join61 } from "path";
|
|
9408
9614
|
var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
|
|
9409
9615
|
json;
|
|
9410
9616
|
constructor(params) {
|
|
@@ -9430,7 +9636,7 @@ var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
|
|
|
9430
9636
|
}) {
|
|
9431
9637
|
const paths = this.getSettablePaths({ global });
|
|
9432
9638
|
const fileContent = await readFileContentOrNull(
|
|
9433
|
-
|
|
9639
|
+
join61(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
9434
9640
|
) ?? '{"mcpServers":{}}';
|
|
9435
9641
|
const json = JSON.parse(fileContent);
|
|
9436
9642
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
@@ -9450,7 +9656,7 @@ var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
|
|
|
9450
9656
|
}) {
|
|
9451
9657
|
const paths = this.getSettablePaths({ global });
|
|
9452
9658
|
const fileContent = await readOrInitializeFileContent(
|
|
9453
|
-
|
|
9659
|
+
join61(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
9454
9660
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
9455
9661
|
);
|
|
9456
9662
|
const json = JSON.parse(fileContent);
|
|
@@ -9489,7 +9695,7 @@ var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
|
|
|
9489
9695
|
};
|
|
9490
9696
|
|
|
9491
9697
|
// src/features/mcp/factorydroid-mcp.ts
|
|
9492
|
-
import { join as
|
|
9698
|
+
import { join as join62 } from "path";
|
|
9493
9699
|
var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
9494
9700
|
json;
|
|
9495
9701
|
constructor(params) {
|
|
@@ -9510,7 +9716,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
9510
9716
|
validate = true
|
|
9511
9717
|
}) {
|
|
9512
9718
|
const fileContent = await readFileContent(
|
|
9513
|
-
|
|
9719
|
+
join62(
|
|
9514
9720
|
outputRoot,
|
|
9515
9721
|
this.getSettablePaths().relativeDirPath,
|
|
9516
9722
|
this.getSettablePaths().relativeFilePath
|
|
@@ -9564,7 +9770,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
9564
9770
|
};
|
|
9565
9771
|
|
|
9566
9772
|
// src/features/mcp/geminicli-mcp.ts
|
|
9567
|
-
import { join as
|
|
9773
|
+
import { join as join63 } from "path";
|
|
9568
9774
|
var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
9569
9775
|
json;
|
|
9570
9776
|
constructor(params) {
|
|
@@ -9593,7 +9799,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
9593
9799
|
}) {
|
|
9594
9800
|
const paths = this.getSettablePaths({ global });
|
|
9595
9801
|
const fileContent = await readFileContentOrNull(
|
|
9596
|
-
|
|
9802
|
+
join63(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
9597
9803
|
) ?? '{"mcpServers":{}}';
|
|
9598
9804
|
const json = JSON.parse(fileContent);
|
|
9599
9805
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
@@ -9613,7 +9819,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
9613
9819
|
}) {
|
|
9614
9820
|
const paths = this.getSettablePaths({ global });
|
|
9615
9821
|
const fileContent = await readOrInitializeFileContent(
|
|
9616
|
-
|
|
9822
|
+
join63(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
9617
9823
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
9618
9824
|
);
|
|
9619
9825
|
const json = JSON.parse(fileContent);
|
|
@@ -9658,7 +9864,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
9658
9864
|
};
|
|
9659
9865
|
|
|
9660
9866
|
// src/features/mcp/junie-mcp.ts
|
|
9661
|
-
import { join as
|
|
9867
|
+
import { join as join64 } from "path";
|
|
9662
9868
|
var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
9663
9869
|
json;
|
|
9664
9870
|
constructor(params) {
|
|
@@ -9670,7 +9876,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
9670
9876
|
}
|
|
9671
9877
|
static getSettablePaths() {
|
|
9672
9878
|
return {
|
|
9673
|
-
relativeDirPath:
|
|
9879
|
+
relativeDirPath: join64(".junie", "mcp"),
|
|
9674
9880
|
relativeFilePath: "mcp.json"
|
|
9675
9881
|
};
|
|
9676
9882
|
}
|
|
@@ -9679,7 +9885,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
9679
9885
|
validate = true
|
|
9680
9886
|
}) {
|
|
9681
9887
|
const fileContent = await readFileContent(
|
|
9682
|
-
|
|
9888
|
+
join64(
|
|
9683
9889
|
outputRoot,
|
|
9684
9890
|
this.getSettablePaths().relativeDirPath,
|
|
9685
9891
|
this.getSettablePaths().relativeFilePath
|
|
@@ -9734,8 +9940,8 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
9734
9940
|
};
|
|
9735
9941
|
|
|
9736
9942
|
// src/features/mcp/kilo-mcp.ts
|
|
9737
|
-
import { join as
|
|
9738
|
-
import { parse as
|
|
9943
|
+
import { join as join65 } from "path";
|
|
9944
|
+
import { parse as parseJsonc4 } from "jsonc-parser";
|
|
9739
9945
|
import { z as z27 } from "zod/mini";
|
|
9740
9946
|
var KiloMcpLocalServerSchema = z27.object({
|
|
9741
9947
|
type: z27.literal("local"),
|
|
@@ -9858,7 +10064,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9858
10064
|
json;
|
|
9859
10065
|
constructor(params) {
|
|
9860
10066
|
super(params);
|
|
9861
|
-
this.json = KiloConfigSchema.parse(
|
|
10067
|
+
this.json = KiloConfigSchema.parse(parseJsonc4(this.fileContent || "{}"));
|
|
9862
10068
|
}
|
|
9863
10069
|
getJson() {
|
|
9864
10070
|
return this.json;
|
|
@@ -9872,7 +10078,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9872
10078
|
static getSettablePaths({ global } = {}) {
|
|
9873
10079
|
if (global) {
|
|
9874
10080
|
return {
|
|
9875
|
-
relativeDirPath:
|
|
10081
|
+
relativeDirPath: join65(".config", "kilo"),
|
|
9876
10082
|
relativeFilePath: "kilo.json"
|
|
9877
10083
|
};
|
|
9878
10084
|
}
|
|
@@ -9887,11 +10093,11 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9887
10093
|
global = false
|
|
9888
10094
|
}) {
|
|
9889
10095
|
const basePaths = this.getSettablePaths({ global });
|
|
9890
|
-
const jsonDir =
|
|
10096
|
+
const jsonDir = join65(outputRoot, basePaths.relativeDirPath);
|
|
9891
10097
|
let fileContent = null;
|
|
9892
10098
|
let relativeFilePath = "kilo.jsonc";
|
|
9893
|
-
const jsoncPath =
|
|
9894
|
-
const jsonPath =
|
|
10099
|
+
const jsoncPath = join65(jsonDir, "kilo.jsonc");
|
|
10100
|
+
const jsonPath = join65(jsonDir, "kilo.json");
|
|
9895
10101
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
9896
10102
|
if (!fileContent) {
|
|
9897
10103
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -9900,7 +10106,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9900
10106
|
}
|
|
9901
10107
|
}
|
|
9902
10108
|
const fileContentToUse = fileContent ?? '{"mcp":{}}';
|
|
9903
|
-
const json =
|
|
10109
|
+
const json = parseJsonc4(fileContentToUse);
|
|
9904
10110
|
const newJson = { ...json, mcp: json.mcp ?? {} };
|
|
9905
10111
|
return new _KiloMcp({
|
|
9906
10112
|
outputRoot,
|
|
@@ -9917,11 +10123,11 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9917
10123
|
global = false
|
|
9918
10124
|
}) {
|
|
9919
10125
|
const basePaths = this.getSettablePaths({ global });
|
|
9920
|
-
const jsonDir =
|
|
10126
|
+
const jsonDir = join65(outputRoot, basePaths.relativeDirPath);
|
|
9921
10127
|
let fileContent = null;
|
|
9922
10128
|
let relativeFilePath = "kilo.jsonc";
|
|
9923
|
-
const jsoncPath =
|
|
9924
|
-
const jsonPath =
|
|
10129
|
+
const jsoncPath = join65(jsonDir, "kilo.jsonc");
|
|
10130
|
+
const jsonPath = join65(jsonDir, "kilo.json");
|
|
9925
10131
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
9926
10132
|
if (!fileContent) {
|
|
9927
10133
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -9932,7 +10138,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9932
10138
|
if (!fileContent) {
|
|
9933
10139
|
fileContent = JSON.stringify({ mcp: {} }, null, 2);
|
|
9934
10140
|
}
|
|
9935
|
-
const json =
|
|
10141
|
+
const json = parseJsonc4(fileContent);
|
|
9936
10142
|
const { mcp: convertedMcp, tools: mcpTools } = convertToKiloFormat(rulesyncMcp.getMcpServers());
|
|
9937
10143
|
const { tools: _existingTools, ...jsonWithoutTools } = json;
|
|
9938
10144
|
const newJson = {
|
|
@@ -9980,7 +10186,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9980
10186
|
};
|
|
9981
10187
|
|
|
9982
10188
|
// src/features/mcp/kiro-mcp.ts
|
|
9983
|
-
import { join as
|
|
10189
|
+
import { join as join66 } from "path";
|
|
9984
10190
|
var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
9985
10191
|
json;
|
|
9986
10192
|
constructor(params) {
|
|
@@ -9992,7 +10198,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
9992
10198
|
}
|
|
9993
10199
|
static getSettablePaths() {
|
|
9994
10200
|
return {
|
|
9995
|
-
relativeDirPath:
|
|
10201
|
+
relativeDirPath: join66(".kiro", "settings"),
|
|
9996
10202
|
relativeFilePath: "mcp.json"
|
|
9997
10203
|
};
|
|
9998
10204
|
}
|
|
@@ -10002,7 +10208,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
10002
10208
|
}) {
|
|
10003
10209
|
const paths = this.getSettablePaths();
|
|
10004
10210
|
const fileContent = await readFileContentOrNull(
|
|
10005
|
-
|
|
10211
|
+
join66(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
10006
10212
|
) ?? '{"mcpServers":{}}';
|
|
10007
10213
|
return new _KiroMcp({
|
|
10008
10214
|
outputRoot,
|
|
@@ -10051,8 +10257,8 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
10051
10257
|
};
|
|
10052
10258
|
|
|
10053
10259
|
// src/features/mcp/opencode-mcp.ts
|
|
10054
|
-
import { join as
|
|
10055
|
-
import { parse as
|
|
10260
|
+
import { join as join67 } from "path";
|
|
10261
|
+
import { parse as parseJsonc5 } from "jsonc-parser";
|
|
10056
10262
|
import { z as z28 } from "zod/mini";
|
|
10057
10263
|
var OPENCODE_ENV_VAR_PATTERN = /(?<!\$)\{env:([^}:]+)\}/g;
|
|
10058
10264
|
var OpencodeMcpLocalServerSchema = z28.object({
|
|
@@ -10179,7 +10385,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10179
10385
|
json;
|
|
10180
10386
|
constructor(params) {
|
|
10181
10387
|
super(params);
|
|
10182
|
-
this.json = OpencodeConfigSchema.parse(
|
|
10388
|
+
this.json = OpencodeConfigSchema.parse(parseJsonc5(this.fileContent || "{}"));
|
|
10183
10389
|
}
|
|
10184
10390
|
getJson() {
|
|
10185
10391
|
return this.json;
|
|
@@ -10193,7 +10399,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10193
10399
|
static getSettablePaths({ global } = {}) {
|
|
10194
10400
|
if (global) {
|
|
10195
10401
|
return {
|
|
10196
|
-
relativeDirPath:
|
|
10402
|
+
relativeDirPath: join67(".config", "opencode"),
|
|
10197
10403
|
relativeFilePath: "opencode.json"
|
|
10198
10404
|
};
|
|
10199
10405
|
}
|
|
@@ -10208,11 +10414,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10208
10414
|
global = false
|
|
10209
10415
|
}) {
|
|
10210
10416
|
const basePaths = this.getSettablePaths({ global });
|
|
10211
|
-
const jsonDir =
|
|
10417
|
+
const jsonDir = join67(outputRoot, basePaths.relativeDirPath);
|
|
10212
10418
|
let fileContent = null;
|
|
10213
10419
|
let relativeFilePath = "opencode.jsonc";
|
|
10214
|
-
const jsoncPath =
|
|
10215
|
-
const jsonPath =
|
|
10420
|
+
const jsoncPath = join67(jsonDir, "opencode.jsonc");
|
|
10421
|
+
const jsonPath = join67(jsonDir, "opencode.json");
|
|
10216
10422
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
10217
10423
|
if (!fileContent) {
|
|
10218
10424
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -10221,7 +10427,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10221
10427
|
}
|
|
10222
10428
|
}
|
|
10223
10429
|
const fileContentToUse = fileContent ?? '{"mcp":{}}';
|
|
10224
|
-
const json =
|
|
10430
|
+
const json = parseJsonc5(fileContentToUse);
|
|
10225
10431
|
const newJson = { ...json, mcp: json.mcp ?? {} };
|
|
10226
10432
|
return new _OpencodeMcp({
|
|
10227
10433
|
outputRoot,
|
|
@@ -10238,11 +10444,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10238
10444
|
global = false
|
|
10239
10445
|
}) {
|
|
10240
10446
|
const basePaths = this.getSettablePaths({ global });
|
|
10241
|
-
const jsonDir =
|
|
10447
|
+
const jsonDir = join67(outputRoot, basePaths.relativeDirPath);
|
|
10242
10448
|
let fileContent = null;
|
|
10243
10449
|
let relativeFilePath = "opencode.jsonc";
|
|
10244
|
-
const jsoncPath =
|
|
10245
|
-
const jsonPath =
|
|
10450
|
+
const jsoncPath = join67(jsonDir, "opencode.jsonc");
|
|
10451
|
+
const jsonPath = join67(jsonDir, "opencode.json");
|
|
10246
10452
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
10247
10453
|
if (!fileContent) {
|
|
10248
10454
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -10253,7 +10459,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10253
10459
|
if (!fileContent) {
|
|
10254
10460
|
fileContent = JSON.stringify({ mcp: {} }, null, 2);
|
|
10255
10461
|
}
|
|
10256
|
-
const json =
|
|
10462
|
+
const json = parseJsonc5(fileContent);
|
|
10257
10463
|
const mcpServers = rulesyncMcp.getMcpServers();
|
|
10258
10464
|
const transformedServers = convertEnvVarRefsToToolFormat({
|
|
10259
10465
|
mcpServers,
|
|
@@ -10310,7 +10516,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10310
10516
|
};
|
|
10311
10517
|
|
|
10312
10518
|
// src/features/mcp/roo-mcp.ts
|
|
10313
|
-
import { join as
|
|
10519
|
+
import { join as join68 } from "path";
|
|
10314
10520
|
function convertToRooFormat(mcpServers) {
|
|
10315
10521
|
return Object.fromEntries(
|
|
10316
10522
|
Object.entries(mcpServers).map(([serverName, serverConfig]) => {
|
|
@@ -10362,7 +10568,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
10362
10568
|
validate = true
|
|
10363
10569
|
}) {
|
|
10364
10570
|
const fileContent = await readFileContent(
|
|
10365
|
-
|
|
10571
|
+
join68(
|
|
10366
10572
|
outputRoot,
|
|
10367
10573
|
this.getSettablePaths().relativeDirPath,
|
|
10368
10574
|
this.getSettablePaths().relativeFilePath
|
|
@@ -10417,9 +10623,9 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
10417
10623
|
};
|
|
10418
10624
|
|
|
10419
10625
|
// src/features/mcp/rovodev-mcp.ts
|
|
10420
|
-
import { join as
|
|
10626
|
+
import { join as join69 } from "path";
|
|
10421
10627
|
function parseRovodevMcpJson(fileContent, relativeDirPath, relativeFilePath) {
|
|
10422
|
-
const configPath =
|
|
10628
|
+
const configPath = join69(relativeDirPath, relativeFilePath);
|
|
10423
10629
|
let parsed;
|
|
10424
10630
|
try {
|
|
10425
10631
|
parsed = JSON.parse(fileContent);
|
|
@@ -10468,7 +10674,7 @@ var RovodevMcp = class _RovodevMcp extends ToolMcp {
|
|
|
10468
10674
|
throw new Error("Rovodev MCP is global-only; use --global to sync ~/.rovodev/mcp.json");
|
|
10469
10675
|
}
|
|
10470
10676
|
const paths = this.getSettablePaths({ global });
|
|
10471
|
-
const filePath =
|
|
10677
|
+
const filePath = join69(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
10472
10678
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"mcpServers":{}}';
|
|
10473
10679
|
const json = parseRovodevMcpJson(fileContent, paths.relativeDirPath, paths.relativeFilePath);
|
|
10474
10680
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
@@ -10492,7 +10698,7 @@ var RovodevMcp = class _RovodevMcp extends ToolMcp {
|
|
|
10492
10698
|
}
|
|
10493
10699
|
const paths = this.getSettablePaths({ global });
|
|
10494
10700
|
const fileContent = await readOrInitializeFileContent(
|
|
10495
|
-
|
|
10701
|
+
join69(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
10496
10702
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
10497
10703
|
);
|
|
10498
10704
|
const json = parseRovodevMcpJson(fileContent, paths.relativeDirPath, paths.relativeFilePath);
|
|
@@ -10533,8 +10739,101 @@ var RovodevMcp = class _RovodevMcp extends ToolMcp {
|
|
|
10533
10739
|
}
|
|
10534
10740
|
};
|
|
10535
10741
|
|
|
10742
|
+
// src/features/mcp/warp-mcp.ts
|
|
10743
|
+
import { join as join70 } from "path";
|
|
10744
|
+
var WarpMcp = class _WarpMcp extends ToolMcp {
|
|
10745
|
+
json;
|
|
10746
|
+
constructor(params) {
|
|
10747
|
+
super(params);
|
|
10748
|
+
this.json = this.fileContent !== void 0 ? _WarpMcp.parseJsonOrThrow(this.fileContent, this.relativeDirPath, this.relativeFilePath) : {};
|
|
10749
|
+
}
|
|
10750
|
+
getJson() {
|
|
10751
|
+
return this.json;
|
|
10752
|
+
}
|
|
10753
|
+
static parseJsonOrThrow(content, relativeDirPath, relativeFilePath) {
|
|
10754
|
+
try {
|
|
10755
|
+
return JSON.parse(content);
|
|
10756
|
+
} catch (error) {
|
|
10757
|
+
throw new Error(
|
|
10758
|
+
`Failed to parse Warp MCP config at ${join70(relativeDirPath, relativeFilePath)}: ${formatError(error)}`,
|
|
10759
|
+
{ cause: error }
|
|
10760
|
+
);
|
|
10761
|
+
}
|
|
10762
|
+
}
|
|
10763
|
+
static getSettablePaths(_options) {
|
|
10764
|
+
return {
|
|
10765
|
+
relativeDirPath: ".warp",
|
|
10766
|
+
relativeFilePath: ".mcp.json"
|
|
10767
|
+
};
|
|
10768
|
+
}
|
|
10769
|
+
static async fromFile({
|
|
10770
|
+
outputRoot = process.cwd(),
|
|
10771
|
+
validate = true,
|
|
10772
|
+
global = false
|
|
10773
|
+
}) {
|
|
10774
|
+
const paths = this.getSettablePaths({ global });
|
|
10775
|
+
const filePath = join70(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
10776
|
+
const fileContent = await readFileContentOrNull(filePath) ?? '{"mcpServers":{}}';
|
|
10777
|
+
const json = this.parseJsonOrThrow(fileContent, paths.relativeDirPath, paths.relativeFilePath);
|
|
10778
|
+
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
10779
|
+
return new _WarpMcp({
|
|
10780
|
+
outputRoot,
|
|
10781
|
+
relativeDirPath: paths.relativeDirPath,
|
|
10782
|
+
relativeFilePath: paths.relativeFilePath,
|
|
10783
|
+
fileContent: JSON.stringify(newJson, null, 2),
|
|
10784
|
+
validate,
|
|
10785
|
+
global
|
|
10786
|
+
});
|
|
10787
|
+
}
|
|
10788
|
+
static async fromRulesyncMcp({
|
|
10789
|
+
outputRoot = process.cwd(),
|
|
10790
|
+
rulesyncMcp,
|
|
10791
|
+
validate = true,
|
|
10792
|
+
global = false
|
|
10793
|
+
}) {
|
|
10794
|
+
const paths = this.getSettablePaths({ global });
|
|
10795
|
+
const fileContent = await readOrInitializeFileContent(
|
|
10796
|
+
join70(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
10797
|
+
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
10798
|
+
);
|
|
10799
|
+
const json = this.parseJsonOrThrow(fileContent, paths.relativeDirPath, paths.relativeFilePath);
|
|
10800
|
+
const warpConfig = { ...json, mcpServers: rulesyncMcp.getMcpServers() };
|
|
10801
|
+
return new _WarpMcp({
|
|
10802
|
+
outputRoot,
|
|
10803
|
+
relativeDirPath: paths.relativeDirPath,
|
|
10804
|
+
relativeFilePath: paths.relativeFilePath,
|
|
10805
|
+
fileContent: JSON.stringify(warpConfig, null, 2),
|
|
10806
|
+
validate,
|
|
10807
|
+
global
|
|
10808
|
+
});
|
|
10809
|
+
}
|
|
10810
|
+
toRulesyncMcp() {
|
|
10811
|
+
return this.toRulesyncMcpDefault({
|
|
10812
|
+
fileContent: JSON.stringify({ mcpServers: this.json.mcpServers ?? {} }, null, 2)
|
|
10813
|
+
});
|
|
10814
|
+
}
|
|
10815
|
+
validate() {
|
|
10816
|
+
return { success: true, error: null };
|
|
10817
|
+
}
|
|
10818
|
+
static forDeletion({
|
|
10819
|
+
outputRoot = process.cwd(),
|
|
10820
|
+
relativeDirPath,
|
|
10821
|
+
relativeFilePath,
|
|
10822
|
+
global = false
|
|
10823
|
+
}) {
|
|
10824
|
+
return new _WarpMcp({
|
|
10825
|
+
outputRoot,
|
|
10826
|
+
relativeDirPath,
|
|
10827
|
+
relativeFilePath,
|
|
10828
|
+
fileContent: "{}",
|
|
10829
|
+
validate: false,
|
|
10830
|
+
global
|
|
10831
|
+
});
|
|
10832
|
+
}
|
|
10833
|
+
};
|
|
10834
|
+
|
|
10536
10835
|
// src/features/mcp/zed-mcp.ts
|
|
10537
|
-
import { join as
|
|
10836
|
+
import { join as join71 } from "path";
|
|
10538
10837
|
var ZedMcp = class _ZedMcp extends ToolMcp {
|
|
10539
10838
|
json;
|
|
10540
10839
|
constructor(params) {
|
|
@@ -10547,7 +10846,7 @@ var ZedMcp = class _ZedMcp extends ToolMcp {
|
|
|
10547
10846
|
static getSettablePaths({ global } = {}) {
|
|
10548
10847
|
if (global) {
|
|
10549
10848
|
return {
|
|
10550
|
-
relativeDirPath:
|
|
10849
|
+
relativeDirPath: join71(".config", "zed"),
|
|
10551
10850
|
relativeFilePath: "settings.json"
|
|
10552
10851
|
};
|
|
10553
10852
|
}
|
|
@@ -10563,7 +10862,7 @@ var ZedMcp = class _ZedMcp extends ToolMcp {
|
|
|
10563
10862
|
}) {
|
|
10564
10863
|
const paths = this.getSettablePaths({ global });
|
|
10565
10864
|
const fileContent = await readFileContentOrNull(
|
|
10566
|
-
|
|
10865
|
+
join71(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
10567
10866
|
) ?? "{}";
|
|
10568
10867
|
const json = JSON.parse(fileContent);
|
|
10569
10868
|
const newJson = { ...json, context_servers: json.context_servers ?? {} };
|
|
@@ -10583,7 +10882,7 @@ var ZedMcp = class _ZedMcp extends ToolMcp {
|
|
|
10583
10882
|
}) {
|
|
10584
10883
|
const paths = this.getSettablePaths({ global });
|
|
10585
10884
|
const fileContent = await readOrInitializeFileContent(
|
|
10586
|
-
|
|
10885
|
+
join71(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
10587
10886
|
"{}"
|
|
10588
10887
|
);
|
|
10589
10888
|
const json = JSON.parse(fileContent);
|
|
@@ -10630,6 +10929,7 @@ var ZedMcp = class _ZedMcp extends ToolMcp {
|
|
|
10630
10929
|
|
|
10631
10930
|
// src/features/mcp/mcp-processor.ts
|
|
10632
10931
|
var mcpProcessorToolTargetTuple = [
|
|
10932
|
+
"amp",
|
|
10633
10933
|
"antigravity-cli",
|
|
10634
10934
|
"antigravity-ide",
|
|
10635
10935
|
"claudecode",
|
|
@@ -10648,10 +10948,23 @@ var mcpProcessorToolTargetTuple = [
|
|
|
10648
10948
|
"opencode",
|
|
10649
10949
|
"roo",
|
|
10650
10950
|
"rovodev",
|
|
10951
|
+
"warp",
|
|
10651
10952
|
"zed"
|
|
10652
10953
|
];
|
|
10653
10954
|
var McpProcessorToolTargetSchema = z29.enum(mcpProcessorToolTargetTuple);
|
|
10654
10955
|
var toolMcpFactories = /* @__PURE__ */ new Map([
|
|
10956
|
+
[
|
|
10957
|
+
"amp",
|
|
10958
|
+
{
|
|
10959
|
+
class: AmpMcp,
|
|
10960
|
+
meta: {
|
|
10961
|
+
supportsProject: true,
|
|
10962
|
+
supportsGlobal: true,
|
|
10963
|
+
supportsEnabledTools: false,
|
|
10964
|
+
supportsDisabledTools: false
|
|
10965
|
+
}
|
|
10966
|
+
}
|
|
10967
|
+
],
|
|
10655
10968
|
[
|
|
10656
10969
|
"antigravity-cli",
|
|
10657
10970
|
{
|
|
@@ -10874,6 +11187,18 @@ var toolMcpFactories = /* @__PURE__ */ new Map([
|
|
|
10874
11187
|
}
|
|
10875
11188
|
}
|
|
10876
11189
|
],
|
|
11190
|
+
[
|
|
11191
|
+
"warp",
|
|
11192
|
+
{
|
|
11193
|
+
class: WarpMcp,
|
|
11194
|
+
meta: {
|
|
11195
|
+
supportsProject: true,
|
|
11196
|
+
supportsGlobal: true,
|
|
11197
|
+
supportsEnabledTools: false,
|
|
11198
|
+
supportsDisabledTools: false
|
|
11199
|
+
}
|
|
11200
|
+
}
|
|
11201
|
+
],
|
|
10877
11202
|
[
|
|
10878
11203
|
"zed",
|
|
10879
11204
|
{
|
|
@@ -11036,11 +11361,11 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
11036
11361
|
import { z as z38 } from "zod/mini";
|
|
11037
11362
|
|
|
11038
11363
|
// src/features/permissions/antigravity-cli-permissions.ts
|
|
11039
|
-
import { join as
|
|
11364
|
+
import { join as join73 } from "path";
|
|
11040
11365
|
import { uniq as uniq3 } from "es-toolkit";
|
|
11041
11366
|
|
|
11042
11367
|
// src/features/permissions/rulesync-permissions.ts
|
|
11043
|
-
import { join as
|
|
11368
|
+
import { join as join72 } from "path";
|
|
11044
11369
|
|
|
11045
11370
|
// src/types/permissions.ts
|
|
11046
11371
|
import { z as z30 } from "zod/mini";
|
|
@@ -11085,7 +11410,7 @@ var RulesyncPermissions = class _RulesyncPermissions extends RulesyncFile {
|
|
|
11085
11410
|
validate = true
|
|
11086
11411
|
}) {
|
|
11087
11412
|
const paths = _RulesyncPermissions.getSettablePaths();
|
|
11088
|
-
const filePath =
|
|
11413
|
+
const filePath = join72(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11089
11414
|
if (!await fileExists(filePath)) {
|
|
11090
11415
|
throw new Error(`No ${RULESYNC_PERMISSIONS_RELATIVE_FILE_PATH} found.`);
|
|
11091
11416
|
}
|
|
@@ -11175,7 +11500,7 @@ var AntigravityCliPermissions = class _AntigravityCliPermissions extends ToolPer
|
|
|
11175
11500
|
}
|
|
11176
11501
|
static getSettablePaths() {
|
|
11177
11502
|
return {
|
|
11178
|
-
relativeDirPath:
|
|
11503
|
+
relativeDirPath: join73(".gemini", "antigravity-cli"),
|
|
11179
11504
|
relativeFilePath: "settings.json"
|
|
11180
11505
|
};
|
|
11181
11506
|
}
|
|
@@ -11184,7 +11509,7 @@ var AntigravityCliPermissions = class _AntigravityCliPermissions extends ToolPer
|
|
|
11184
11509
|
validate = true
|
|
11185
11510
|
}) {
|
|
11186
11511
|
const paths = _AntigravityCliPermissions.getSettablePaths();
|
|
11187
|
-
const filePath =
|
|
11512
|
+
const filePath = join73(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11188
11513
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"permissions":{}}';
|
|
11189
11514
|
return new _AntigravityCliPermissions({
|
|
11190
11515
|
outputRoot,
|
|
@@ -11200,7 +11525,7 @@ var AntigravityCliPermissions = class _AntigravityCliPermissions extends ToolPer
|
|
|
11200
11525
|
rulesyncPermissions
|
|
11201
11526
|
}) {
|
|
11202
11527
|
const paths = _AntigravityCliPermissions.getSettablePaths();
|
|
11203
|
-
const filePath =
|
|
11528
|
+
const filePath = join73(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11204
11529
|
const existingContent = await readOrInitializeFileContent(
|
|
11205
11530
|
filePath,
|
|
11206
11531
|
JSON.stringify({}, null, 2)
|
|
@@ -11267,7 +11592,7 @@ var AntigravityCliPermissions = class _AntigravityCliPermissions extends ToolPer
|
|
|
11267
11592
|
settings = JSON.parse(this.getFileContent());
|
|
11268
11593
|
} catch (error) {
|
|
11269
11594
|
throw new Error(
|
|
11270
|
-
`Failed to parse Antigravity CLI permissions content in ${
|
|
11595
|
+
`Failed to parse Antigravity CLI permissions content in ${join73(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
11271
11596
|
{ cause: error }
|
|
11272
11597
|
);
|
|
11273
11598
|
}
|
|
@@ -11341,7 +11666,7 @@ function convertAntigravityCliToRulesyncPermissions(params) {
|
|
|
11341
11666
|
}
|
|
11342
11667
|
|
|
11343
11668
|
// src/features/permissions/augmentcode-permissions.ts
|
|
11344
|
-
import { join as
|
|
11669
|
+
import { join as join74 } from "path";
|
|
11345
11670
|
import { z as z31 } from "zod/mini";
|
|
11346
11671
|
var moduleLogger = new ConsoleLogger();
|
|
11347
11672
|
var AugmentPermissionTypeSchema = z31.enum(["allow", "deny", "ask-user"]);
|
|
@@ -11491,7 +11816,7 @@ var AugmentcodePermissions = class _AugmentcodePermissions extends ToolPermissio
|
|
|
11491
11816
|
global = false
|
|
11492
11817
|
}) {
|
|
11493
11818
|
const paths = _AugmentcodePermissions.getSettablePaths({ global });
|
|
11494
|
-
const filePath =
|
|
11819
|
+
const filePath = join74(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11495
11820
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"toolPermissions":[]}';
|
|
11496
11821
|
return new _AugmentcodePermissions({
|
|
11497
11822
|
outputRoot,
|
|
@@ -11508,7 +11833,7 @@ var AugmentcodePermissions = class _AugmentcodePermissions extends ToolPermissio
|
|
|
11508
11833
|
logger
|
|
11509
11834
|
}) {
|
|
11510
11835
|
const paths = _AugmentcodePermissions.getSettablePaths({ global });
|
|
11511
|
-
const filePath =
|
|
11836
|
+
const filePath = join74(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11512
11837
|
const existingContent = await readFileContentOrNull(filePath) ?? "{}";
|
|
11513
11838
|
let settings;
|
|
11514
11839
|
try {
|
|
@@ -11563,7 +11888,7 @@ var AugmentcodePermissions = class _AugmentcodePermissions extends ToolPermissio
|
|
|
11563
11888
|
settings = result.data;
|
|
11564
11889
|
} catch (error) {
|
|
11565
11890
|
throw new Error(
|
|
11566
|
-
`Failed to parse AugmentCode permissions content in ${
|
|
11891
|
+
`Failed to parse AugmentCode permissions content in ${join74(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
11567
11892
|
{ cause: error }
|
|
11568
11893
|
);
|
|
11569
11894
|
}
|
|
@@ -11731,7 +12056,7 @@ function convertAugmentToRulesyncPermissions({
|
|
|
11731
12056
|
}
|
|
11732
12057
|
|
|
11733
12058
|
// src/features/permissions/claudecode-permissions.ts
|
|
11734
|
-
import { join as
|
|
12059
|
+
import { join as join75 } from "path";
|
|
11735
12060
|
import { uniq as uniq4 } from "es-toolkit";
|
|
11736
12061
|
var CANONICAL_TO_CLAUDE_TOOL_NAMES = {
|
|
11737
12062
|
bash: "Bash",
|
|
@@ -11793,7 +12118,7 @@ var ClaudecodePermissions = class _ClaudecodePermissions extends ToolPermissions
|
|
|
11793
12118
|
validate = true
|
|
11794
12119
|
}) {
|
|
11795
12120
|
const paths = _ClaudecodePermissions.getSettablePaths();
|
|
11796
|
-
const filePath =
|
|
12121
|
+
const filePath = join75(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11797
12122
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"permissions":{}}';
|
|
11798
12123
|
return new _ClaudecodePermissions({
|
|
11799
12124
|
outputRoot,
|
|
@@ -11809,7 +12134,7 @@ var ClaudecodePermissions = class _ClaudecodePermissions extends ToolPermissions
|
|
|
11809
12134
|
logger
|
|
11810
12135
|
}) {
|
|
11811
12136
|
const paths = _ClaudecodePermissions.getSettablePaths();
|
|
11812
|
-
const filePath =
|
|
12137
|
+
const filePath = join75(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11813
12138
|
const existingContent = await readOrInitializeFileContent(
|
|
11814
12139
|
filePath,
|
|
11815
12140
|
JSON.stringify({}, null, 2)
|
|
@@ -11886,7 +12211,7 @@ var ClaudecodePermissions = class _ClaudecodePermissions extends ToolPermissions
|
|
|
11886
12211
|
settings = JSON.parse(this.getFileContent());
|
|
11887
12212
|
} catch (error) {
|
|
11888
12213
|
throw new Error(
|
|
11889
|
-
`Failed to parse Claude permissions content in ${
|
|
12214
|
+
`Failed to parse Claude permissions content in ${join75(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
11890
12215
|
{ cause: error }
|
|
11891
12216
|
);
|
|
11892
12217
|
}
|
|
@@ -11959,7 +12284,7 @@ function convertClaudeToRulesyncPermissions(params) {
|
|
|
11959
12284
|
}
|
|
11960
12285
|
|
|
11961
12286
|
// src/features/permissions/cline-permissions.ts
|
|
11962
|
-
import { join as
|
|
12287
|
+
import { join as join76 } from "path";
|
|
11963
12288
|
import { uniq as uniq5 } from "es-toolkit";
|
|
11964
12289
|
import { z as z32 } from "zod/mini";
|
|
11965
12290
|
var ClineCommandPermissionsSchema = z32.looseObject({
|
|
@@ -11995,7 +12320,7 @@ var ClinePermissions = class _ClinePermissions extends ToolPermissions {
|
|
|
11995
12320
|
global = false
|
|
11996
12321
|
}) {
|
|
11997
12322
|
const paths = _ClinePermissions.getSettablePaths({ global });
|
|
11998
|
-
const filePath =
|
|
12323
|
+
const filePath = join76(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11999
12324
|
const fileContent = await readFileContentOrNull(filePath) ?? "{}";
|
|
12000
12325
|
return new _ClinePermissions({
|
|
12001
12326
|
outputRoot,
|
|
@@ -12012,7 +12337,7 @@ var ClinePermissions = class _ClinePermissions extends ToolPermissions {
|
|
|
12012
12337
|
logger
|
|
12013
12338
|
}) {
|
|
12014
12339
|
const paths = _ClinePermissions.getSettablePaths({ global });
|
|
12015
|
-
const filePath =
|
|
12340
|
+
const filePath = join76(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
12016
12341
|
const existingContent = await readFileContentOrNull(filePath) ?? "{}";
|
|
12017
12342
|
let existing;
|
|
12018
12343
|
try {
|
|
@@ -12100,7 +12425,7 @@ var ClinePermissions = class _ClinePermissions extends ToolPermissions {
|
|
|
12100
12425
|
parsed = result.data;
|
|
12101
12426
|
} catch (error) {
|
|
12102
12427
|
throw new Error(
|
|
12103
|
-
`Failed to parse Cline permissions content in ${
|
|
12428
|
+
`Failed to parse Cline permissions content in ${join76(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
12104
12429
|
{ cause: error }
|
|
12105
12430
|
);
|
|
12106
12431
|
}
|
|
@@ -12147,7 +12472,7 @@ var ClinePermissions = class _ClinePermissions extends ToolPermissions {
|
|
|
12147
12472
|
};
|
|
12148
12473
|
|
|
12149
12474
|
// src/features/permissions/codexcli-permissions.ts
|
|
12150
|
-
import { isAbsolute as isAbsolute3, join as
|
|
12475
|
+
import { isAbsolute as isAbsolute3, join as join77 } from "path";
|
|
12151
12476
|
import * as smolToml4 from "smol-toml";
|
|
12152
12477
|
var RULESYNC_PROFILE_NAME = "rulesync";
|
|
12153
12478
|
var RULESYNC_BASH_RULES_FILE_NAME = "rulesync.rules";
|
|
@@ -12169,7 +12494,7 @@ var CodexcliPermissions = class _CodexcliPermissions extends ToolPermissions {
|
|
|
12169
12494
|
global = false
|
|
12170
12495
|
}) {
|
|
12171
12496
|
const paths = this.getSettablePaths({ global });
|
|
12172
|
-
const filePath =
|
|
12497
|
+
const filePath = join77(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
12173
12498
|
const fileContent = await readFileContentOrNull(filePath) ?? smolToml4.stringify({});
|
|
12174
12499
|
return new _CodexcliPermissions({
|
|
12175
12500
|
outputRoot,
|
|
@@ -12187,7 +12512,7 @@ var CodexcliPermissions = class _CodexcliPermissions extends ToolPermissions {
|
|
|
12187
12512
|
global = false
|
|
12188
12513
|
}) {
|
|
12189
12514
|
const paths = this.getSettablePaths({ global });
|
|
12190
|
-
const filePath =
|
|
12515
|
+
const filePath = join77(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
12191
12516
|
const existingContent = await readFileContentOrNull(filePath) ?? smolToml4.stringify({});
|
|
12192
12517
|
const parsed = toMutableTable(smolToml4.parse(existingContent));
|
|
12193
12518
|
const profile = convertRulesyncToCodexProfile({
|
|
@@ -12212,7 +12537,7 @@ var CodexcliPermissions = class _CodexcliPermissions extends ToolPermissions {
|
|
|
12212
12537
|
parsed = smolToml4.parse(this.getFileContent());
|
|
12213
12538
|
} catch (error) {
|
|
12214
12539
|
throw new Error(
|
|
12215
|
-
`Failed to parse Codex CLI permissions content in ${
|
|
12540
|
+
`Failed to parse Codex CLI permissions content in ${join77(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
12216
12541
|
{ cause: error }
|
|
12217
12542
|
);
|
|
12218
12543
|
}
|
|
@@ -12253,7 +12578,7 @@ function createCodexcliBashRulesFile({
|
|
|
12253
12578
|
}) {
|
|
12254
12579
|
return new CodexcliRulesFile({
|
|
12255
12580
|
outputRoot,
|
|
12256
|
-
relativeDirPath:
|
|
12581
|
+
relativeDirPath: join77(".codex", "rules"),
|
|
12257
12582
|
relativeFilePath: RULESYNC_BASH_RULES_FILE_NAME,
|
|
12258
12583
|
fileContent: buildCodexBashRulesContent(config)
|
|
12259
12584
|
});
|
|
@@ -12492,7 +12817,7 @@ function mapBashActionToDecision(action) {
|
|
|
12492
12817
|
}
|
|
12493
12818
|
|
|
12494
12819
|
// src/features/permissions/cursor-permissions.ts
|
|
12495
|
-
import { join as
|
|
12820
|
+
import { join as join78 } from "path";
|
|
12496
12821
|
import { uniq as uniq6 } from "es-toolkit";
|
|
12497
12822
|
var CANONICAL_TO_CURSOR_TYPE = {
|
|
12498
12823
|
bash: "Shell",
|
|
@@ -12610,7 +12935,7 @@ var CursorPermissions = class _CursorPermissions extends ToolPermissions {
|
|
|
12610
12935
|
global = false
|
|
12611
12936
|
}) {
|
|
12612
12937
|
const paths = _CursorPermissions.getSettablePaths({ global });
|
|
12613
|
-
const filePath =
|
|
12938
|
+
const filePath = join78(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
12614
12939
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"permissions":{}}';
|
|
12615
12940
|
return new _CursorPermissions({
|
|
12616
12941
|
outputRoot,
|
|
@@ -12627,7 +12952,7 @@ var CursorPermissions = class _CursorPermissions extends ToolPermissions {
|
|
|
12627
12952
|
global = false
|
|
12628
12953
|
}) {
|
|
12629
12954
|
const paths = _CursorPermissions.getSettablePaths({ global });
|
|
12630
|
-
const filePath =
|
|
12955
|
+
const filePath = join78(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
12631
12956
|
const existingContent = await readOrInitializeFileContent(
|
|
12632
12957
|
filePath,
|
|
12633
12958
|
JSON.stringify({}, null, 2)
|
|
@@ -12646,6 +12971,18 @@ var CursorPermissions = class _CursorPermissions extends ToolPermissions {
|
|
|
12646
12971
|
const managedTypes = new Set(
|
|
12647
12972
|
Object.keys(config.permission).map((category) => toCursorType(category))
|
|
12648
12973
|
);
|
|
12974
|
+
const existingEditorRaw = settings.editor;
|
|
12975
|
+
let existingEditor;
|
|
12976
|
+
if (existingEditorRaw === void 0) {
|
|
12977
|
+
existingEditor = {};
|
|
12978
|
+
} else if (existingEditorRaw !== null && typeof existingEditorRaw === "object" && !Array.isArray(existingEditorRaw)) {
|
|
12979
|
+
existingEditor = existingEditorRaw;
|
|
12980
|
+
} else {
|
|
12981
|
+
logger?.warn(
|
|
12982
|
+
`Cursor CLI config at ${filePath} has a non-object \`editor\` field; ignoring existing editor settings.`
|
|
12983
|
+
);
|
|
12984
|
+
existingEditor = {};
|
|
12985
|
+
}
|
|
12649
12986
|
const existingPermissionsRaw = settings.permissions;
|
|
12650
12987
|
let existingPermissions;
|
|
12651
12988
|
if (existingPermissionsRaw === void 0) {
|
|
@@ -12673,11 +13010,7 @@ var CursorPermissions = class _CursorPermissions extends ToolPermissions {
|
|
|
12673
13010
|
};
|
|
12674
13011
|
const mergedAllow = uniq6([...preservedAllow, ...allow].toSorted());
|
|
12675
13012
|
const mergedDeny = uniq6([...preservedDeny, ...deny].toSorted());
|
|
12676
|
-
|
|
12677
|
-
mergedPermissions.allow = mergedAllow;
|
|
12678
|
-
} else {
|
|
12679
|
-
delete mergedPermissions.allow;
|
|
12680
|
-
}
|
|
13013
|
+
mergedPermissions.allow = mergedAllow;
|
|
12681
13014
|
if (mergedDeny.length > 0) {
|
|
12682
13015
|
mergedPermissions.deny = mergedDeny;
|
|
12683
13016
|
} else {
|
|
@@ -12686,6 +13019,10 @@ var CursorPermissions = class _CursorPermissions extends ToolPermissions {
|
|
|
12686
13019
|
const merged = {
|
|
12687
13020
|
...settings,
|
|
12688
13021
|
version: settings.version ?? 1,
|
|
13022
|
+
editor: {
|
|
13023
|
+
...existingEditor,
|
|
13024
|
+
vimMode: existingEditor.vimMode ?? false
|
|
13025
|
+
},
|
|
12689
13026
|
permissions: mergedPermissions
|
|
12690
13027
|
};
|
|
12691
13028
|
const fileContent = JSON.stringify(merged, null, 2);
|
|
@@ -12703,7 +13040,7 @@ var CursorPermissions = class _CursorPermissions extends ToolPermissions {
|
|
|
12703
13040
|
settings = asCursorCliConfig(JSON.parse(this.getFileContent()));
|
|
12704
13041
|
} catch (error) {
|
|
12705
13042
|
throw new Error(
|
|
12706
|
-
`Failed to parse Cursor CLI permissions content in ${
|
|
13043
|
+
`Failed to parse Cursor CLI permissions content in ${join78(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
12707
13044
|
{ cause: error }
|
|
12708
13045
|
);
|
|
12709
13046
|
}
|
|
@@ -12778,10 +13115,10 @@ function convertCursorToRulesyncPermissions(params) {
|
|
|
12778
13115
|
}
|
|
12779
13116
|
|
|
12780
13117
|
// src/features/permissions/geminicli-permissions.ts
|
|
12781
|
-
import { join as
|
|
13118
|
+
import { join as join79 } from "path";
|
|
12782
13119
|
import * as smolToml5 from "smol-toml";
|
|
12783
13120
|
import { z as z33 } from "zod/mini";
|
|
12784
|
-
var GEMINICLI_POLICY_RELATIVE_DIR_PATH =
|
|
13121
|
+
var GEMINICLI_POLICY_RELATIVE_DIR_PATH = join79(".gemini", "policies");
|
|
12785
13122
|
var GEMINICLI_POLICY_FILE_NAME = "rulesync.toml";
|
|
12786
13123
|
var RULESYNC_TO_GEMINICLI_TOOL_NAME = {
|
|
12787
13124
|
bash: "run_shell_command",
|
|
@@ -12822,7 +13159,7 @@ var GeminicliPermissions = class _GeminicliPermissions extends ToolPermissions {
|
|
|
12822
13159
|
global = false
|
|
12823
13160
|
}) {
|
|
12824
13161
|
const paths = this.getSettablePaths({ global });
|
|
12825
|
-
const filePath =
|
|
13162
|
+
const filePath = join79(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
12826
13163
|
const fileContent = await readFileContentOrNull(filePath) ?? "";
|
|
12827
13164
|
return new _GeminicliPermissions({
|
|
12828
13165
|
outputRoot,
|
|
@@ -12858,7 +13195,7 @@ var GeminicliPermissions = class _GeminicliPermissions extends ToolPermissions {
|
|
|
12858
13195
|
parsed = smolToml5.parse(fileContent);
|
|
12859
13196
|
} catch (error) {
|
|
12860
13197
|
throw new Error(
|
|
12861
|
-
`Failed to parse Gemini CLI policy TOML in ${
|
|
13198
|
+
`Failed to parse Gemini CLI policy TOML in ${join79(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
12862
13199
|
{ cause: error }
|
|
12863
13200
|
);
|
|
12864
13201
|
}
|
|
@@ -13150,8 +13487,8 @@ function extractPattern(rule) {
|
|
|
13150
13487
|
}
|
|
13151
13488
|
|
|
13152
13489
|
// src/features/permissions/kilo-permissions.ts
|
|
13153
|
-
import { join as
|
|
13154
|
-
import { parse as
|
|
13490
|
+
import { join as join80 } from "path";
|
|
13491
|
+
import { parse as parseJsonc6, printParseErrorCode as printParseErrorCode2 } from "jsonc-parser";
|
|
13155
13492
|
import { z as z34 } from "zod/mini";
|
|
13156
13493
|
var KiloPermissionSchema = z34.union([
|
|
13157
13494
|
z34.enum(["allow", "ask", "deny"]),
|
|
@@ -13163,11 +13500,11 @@ var KiloPermissionsConfigSchema = z34.looseObject({
|
|
|
13163
13500
|
var KILO_FILE_NAME = "kilo.jsonc";
|
|
13164
13501
|
function parseKiloJsoncStrict(content, filePath) {
|
|
13165
13502
|
const errors = [];
|
|
13166
|
-
const parsed =
|
|
13503
|
+
const parsed = parseJsonc6(content, errors, { allowTrailingComma: true });
|
|
13167
13504
|
const first = errors[0];
|
|
13168
13505
|
if (first) {
|
|
13169
13506
|
throw new Error(
|
|
13170
|
-
`Failed to parse Kilo Code config at ${filePath}: ${
|
|
13507
|
+
`Failed to parse Kilo Code config at ${filePath}: ${printParseErrorCode2(first.error)} at offset ${first.offset}`
|
|
13171
13508
|
);
|
|
13172
13509
|
}
|
|
13173
13510
|
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
@@ -13194,7 +13531,7 @@ var KiloPermissions = class _KiloPermissions extends ToolPermissions {
|
|
|
13194
13531
|
json;
|
|
13195
13532
|
constructor(params) {
|
|
13196
13533
|
super(params);
|
|
13197
|
-
const parsed =
|
|
13534
|
+
const parsed = parseJsonc6(this.fileContent || "{}");
|
|
13198
13535
|
if (params.validate !== false) {
|
|
13199
13536
|
this.json = KiloPermissionsConfigSchema.parse(parsed);
|
|
13200
13537
|
} else {
|
|
@@ -13211,7 +13548,7 @@ var KiloPermissions = class _KiloPermissions extends ToolPermissions {
|
|
|
13211
13548
|
static getSettablePaths({
|
|
13212
13549
|
global = false
|
|
13213
13550
|
} = {}) {
|
|
13214
|
-
return global ? { relativeDirPath:
|
|
13551
|
+
return global ? { relativeDirPath: join80(".config", "kilo"), relativeFilePath: KILO_FILE_NAME } : { relativeDirPath: ".", relativeFilePath: KILO_FILE_NAME };
|
|
13215
13552
|
}
|
|
13216
13553
|
static async fromFile({
|
|
13217
13554
|
outputRoot = process.cwd(),
|
|
@@ -13219,7 +13556,7 @@ var KiloPermissions = class _KiloPermissions extends ToolPermissions {
|
|
|
13219
13556
|
global = false
|
|
13220
13557
|
}) {
|
|
13221
13558
|
const basePaths = _KiloPermissions.getSettablePaths({ global });
|
|
13222
|
-
const filePath =
|
|
13559
|
+
const filePath = join80(outputRoot, basePaths.relativeDirPath, basePaths.relativeFilePath);
|
|
13223
13560
|
const fileContent = await readFileContentOrNull(filePath);
|
|
13224
13561
|
const parsed = parseKiloJsoncStrict(fileContent ?? "{}", filePath);
|
|
13225
13562
|
const nextJson = { ...parsed, permission: parsed.permission ?? {} };
|
|
@@ -13238,7 +13575,7 @@ var KiloPermissions = class _KiloPermissions extends ToolPermissions {
|
|
|
13238
13575
|
logger
|
|
13239
13576
|
}) {
|
|
13240
13577
|
const basePaths = _KiloPermissions.getSettablePaths({ global });
|
|
13241
|
-
const filePath =
|
|
13578
|
+
const filePath = join80(outputRoot, basePaths.relativeDirPath, basePaths.relativeFilePath);
|
|
13242
13579
|
const fileContent = await readFileContentOrNull(filePath);
|
|
13243
13580
|
const parsed = parseKiloJsoncStrict(fileContent ?? "{}", filePath);
|
|
13244
13581
|
const parsedPermission = parsed.permission;
|
|
@@ -13284,7 +13621,7 @@ var KiloPermissions = class _KiloPermissions extends ToolPermissions {
|
|
|
13284
13621
|
}
|
|
13285
13622
|
validate() {
|
|
13286
13623
|
try {
|
|
13287
|
-
const json =
|
|
13624
|
+
const json = parseJsonc6(this.fileContent || "{}");
|
|
13288
13625
|
const result = KiloPermissionsConfigSchema.safeParse(json);
|
|
13289
13626
|
if (!result.success) {
|
|
13290
13627
|
return { success: false, error: result.error };
|
|
@@ -13324,7 +13661,7 @@ var KiloPermissions = class _KiloPermissions extends ToolPermissions {
|
|
|
13324
13661
|
};
|
|
13325
13662
|
|
|
13326
13663
|
// src/features/permissions/kiro-permissions.ts
|
|
13327
|
-
import { join as
|
|
13664
|
+
import { join as join81 } from "path";
|
|
13328
13665
|
import { z as z35 } from "zod/mini";
|
|
13329
13666
|
var KiroAgentSchema = z35.looseObject({
|
|
13330
13667
|
allowedTools: z35.optional(z35.array(z35.string())),
|
|
@@ -13334,7 +13671,7 @@ var UnknownRecordSchema = z35.record(z35.string(), z35.unknown());
|
|
|
13334
13671
|
var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
13335
13672
|
static getSettablePaths(_options = {}) {
|
|
13336
13673
|
return {
|
|
13337
|
-
relativeDirPath:
|
|
13674
|
+
relativeDirPath: join81(".kiro", "agents"),
|
|
13338
13675
|
relativeFilePath: "default.json"
|
|
13339
13676
|
};
|
|
13340
13677
|
}
|
|
@@ -13346,7 +13683,7 @@ var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
|
13346
13683
|
validate = true
|
|
13347
13684
|
}) {
|
|
13348
13685
|
const paths = this.getSettablePaths();
|
|
13349
|
-
const filePath =
|
|
13686
|
+
const filePath = join81(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
13350
13687
|
const fileContent = await readFileContentOrNull(filePath) ?? JSON.stringify({}, null, 2);
|
|
13351
13688
|
return new _KiroPermissions({
|
|
13352
13689
|
outputRoot,
|
|
@@ -13363,7 +13700,7 @@ var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
|
13363
13700
|
logger
|
|
13364
13701
|
}) {
|
|
13365
13702
|
const paths = this.getSettablePaths();
|
|
13366
|
-
const filePath =
|
|
13703
|
+
const filePath = join81(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
13367
13704
|
const existingContent = await readFileContentOrNull(filePath) ?? JSON.stringify({}, null, 2);
|
|
13368
13705
|
const parsedResult = KiroAgentSchema.safeParse(JSON.parse(existingContent));
|
|
13369
13706
|
if (!parsedResult.success) {
|
|
@@ -13387,7 +13724,7 @@ var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
|
13387
13724
|
parsed = KiroAgentSchema.parse(JSON.parse(this.getFileContent()));
|
|
13388
13725
|
} catch (error) {
|
|
13389
13726
|
throw new Error(
|
|
13390
|
-
`Failed to parse Kiro permissions content in ${
|
|
13727
|
+
`Failed to parse Kiro permissions content in ${join81(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
13391
13728
|
{ cause: error }
|
|
13392
13729
|
);
|
|
13393
13730
|
}
|
|
@@ -13512,8 +13849,8 @@ function asStringArray(value) {
|
|
|
13512
13849
|
}
|
|
13513
13850
|
|
|
13514
13851
|
// src/features/permissions/opencode-permissions.ts
|
|
13515
|
-
import { join as
|
|
13516
|
-
import { parse as
|
|
13852
|
+
import { join as join82 } from "path";
|
|
13853
|
+
import { parse as parseJsonc7 } from "jsonc-parser";
|
|
13517
13854
|
import { z as z36 } from "zod/mini";
|
|
13518
13855
|
var OpencodePermissionSchema = z36.union([
|
|
13519
13856
|
z36.enum(["allow", "ask", "deny"]),
|
|
@@ -13526,7 +13863,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13526
13863
|
json;
|
|
13527
13864
|
constructor(params) {
|
|
13528
13865
|
super(params);
|
|
13529
|
-
this.json = OpencodePermissionsConfigSchema.parse(
|
|
13866
|
+
this.json = OpencodePermissionsConfigSchema.parse(parseJsonc7(this.fileContent || "{}"));
|
|
13530
13867
|
}
|
|
13531
13868
|
getJson() {
|
|
13532
13869
|
return this.json;
|
|
@@ -13537,7 +13874,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13537
13874
|
static getSettablePaths({
|
|
13538
13875
|
global = false
|
|
13539
13876
|
} = {}) {
|
|
13540
|
-
return global ? { relativeDirPath:
|
|
13877
|
+
return global ? { relativeDirPath: join82(".config", "opencode"), relativeFilePath: "opencode.json" } : { relativeDirPath: ".", relativeFilePath: "opencode.json" };
|
|
13541
13878
|
}
|
|
13542
13879
|
static async fromFile({
|
|
13543
13880
|
outputRoot = process.cwd(),
|
|
@@ -13545,9 +13882,9 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13545
13882
|
global = false
|
|
13546
13883
|
}) {
|
|
13547
13884
|
const basePaths = _OpencodePermissions.getSettablePaths({ global });
|
|
13548
|
-
const jsonDir =
|
|
13549
|
-
const jsoncPath =
|
|
13550
|
-
const jsonPath =
|
|
13885
|
+
const jsonDir = join82(outputRoot, basePaths.relativeDirPath);
|
|
13886
|
+
const jsoncPath = join82(jsonDir, "opencode.jsonc");
|
|
13887
|
+
const jsonPath = join82(jsonDir, "opencode.json");
|
|
13551
13888
|
let fileContent = await readFileContentOrNull(jsoncPath);
|
|
13552
13889
|
let relativeFilePath = "opencode.jsonc";
|
|
13553
13890
|
if (!fileContent) {
|
|
@@ -13556,7 +13893,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13556
13893
|
relativeFilePath = "opencode.json";
|
|
13557
13894
|
}
|
|
13558
13895
|
}
|
|
13559
|
-
const parsed =
|
|
13896
|
+
const parsed = parseJsonc7(fileContent ?? "{}");
|
|
13560
13897
|
const nextJson = { ...parsed, permission: parsed.permission ?? {} };
|
|
13561
13898
|
return new _OpencodePermissions({
|
|
13562
13899
|
outputRoot,
|
|
@@ -13572,9 +13909,9 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13572
13909
|
global = false
|
|
13573
13910
|
}) {
|
|
13574
13911
|
const basePaths = _OpencodePermissions.getSettablePaths({ global });
|
|
13575
|
-
const jsonDir =
|
|
13576
|
-
const jsoncPath =
|
|
13577
|
-
const jsonPath =
|
|
13912
|
+
const jsonDir = join82(outputRoot, basePaths.relativeDirPath);
|
|
13913
|
+
const jsoncPath = join82(jsonDir, "opencode.jsonc");
|
|
13914
|
+
const jsonPath = join82(jsonDir, "opencode.json");
|
|
13578
13915
|
let fileContent = await readFileContentOrNull(jsoncPath);
|
|
13579
13916
|
let relativeFilePath = "opencode.jsonc";
|
|
13580
13917
|
if (!fileContent) {
|
|
@@ -13583,7 +13920,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13583
13920
|
relativeFilePath = "opencode.json";
|
|
13584
13921
|
}
|
|
13585
13922
|
}
|
|
13586
|
-
const parsed =
|
|
13923
|
+
const parsed = parseJsonc7(fileContent ?? "{}");
|
|
13587
13924
|
const nextJson = {
|
|
13588
13925
|
...parsed,
|
|
13589
13926
|
permission: rulesyncPermissions.getJson().permission
|
|
@@ -13644,7 +13981,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13644
13981
|
};
|
|
13645
13982
|
|
|
13646
13983
|
// src/features/permissions/qwencode-permissions.ts
|
|
13647
|
-
import { join as
|
|
13984
|
+
import { join as join83 } from "path";
|
|
13648
13985
|
import { uniq as uniq7 } from "es-toolkit";
|
|
13649
13986
|
import { z as z37 } from "zod/mini";
|
|
13650
13987
|
var QwenSettingsPermissionsSchema = z37.looseObject({
|
|
@@ -13732,7 +14069,7 @@ var QwencodePermissions = class _QwencodePermissions extends ToolPermissions {
|
|
|
13732
14069
|
global = false
|
|
13733
14070
|
}) {
|
|
13734
14071
|
const paths = _QwencodePermissions.getSettablePaths({ global });
|
|
13735
|
-
const filePath =
|
|
14072
|
+
const filePath = join83(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
13736
14073
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"permissions":{}}';
|
|
13737
14074
|
return new _QwencodePermissions({
|
|
13738
14075
|
outputRoot,
|
|
@@ -13749,7 +14086,7 @@ var QwencodePermissions = class _QwencodePermissions extends ToolPermissions {
|
|
|
13749
14086
|
logger
|
|
13750
14087
|
}) {
|
|
13751
14088
|
const paths = _QwencodePermissions.getSettablePaths({ global });
|
|
13752
|
-
const filePath =
|
|
14089
|
+
const filePath = join83(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
13753
14090
|
const existingContent = await readFileContentOrNull(filePath) ?? "{}";
|
|
13754
14091
|
let settings;
|
|
13755
14092
|
try {
|
|
@@ -13822,7 +14159,7 @@ var QwencodePermissions = class _QwencodePermissions extends ToolPermissions {
|
|
|
13822
14159
|
settings = result.data;
|
|
13823
14160
|
} catch (error) {
|
|
13824
14161
|
throw new Error(
|
|
13825
|
-
`Failed to parse Qwen permissions content in ${
|
|
14162
|
+
`Failed to parse Qwen permissions content in ${join83(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
13826
14163
|
{ cause: error }
|
|
13827
14164
|
);
|
|
13828
14165
|
}
|
|
@@ -14165,7 +14502,7 @@ var PermissionsProcessor = class extends FeatureProcessor {
|
|
|
14165
14502
|
};
|
|
14166
14503
|
|
|
14167
14504
|
// src/features/rules/rules-processor.ts
|
|
14168
|
-
import { basename as basename11, dirname as dirname3, join as
|
|
14505
|
+
import { basename as basename11, dirname as dirname3, join as join165, relative as relative6 } from "path";
|
|
14169
14506
|
import { encode } from "@toon-format/toon";
|
|
14170
14507
|
import { z as z82 } from "zod/mini";
|
|
14171
14508
|
|
|
@@ -14173,17 +14510,17 @@ import { z as z82 } from "zod/mini";
|
|
|
14173
14510
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
14174
14511
|
|
|
14175
14512
|
// src/features/skills/agentsmd-skill.ts
|
|
14176
|
-
import { join as
|
|
14513
|
+
import { join as join87 } from "path";
|
|
14177
14514
|
|
|
14178
14515
|
// src/features/skills/simulated-skill.ts
|
|
14179
|
-
import { join as
|
|
14516
|
+
import { join as join86 } from "path";
|
|
14180
14517
|
import { z as z39 } from "zod/mini";
|
|
14181
14518
|
|
|
14182
14519
|
// src/features/skills/tool-skill.ts
|
|
14183
|
-
import { join as
|
|
14520
|
+
import { join as join85 } from "path";
|
|
14184
14521
|
|
|
14185
14522
|
// src/types/ai-dir.ts
|
|
14186
|
-
import path2, { basename as basename4, join as
|
|
14523
|
+
import path2, { basename as basename4, join as join84, relative as relative4, resolve as resolve5 } from "path";
|
|
14187
14524
|
var AiDir = class {
|
|
14188
14525
|
/**
|
|
14189
14526
|
* @example "."
|
|
@@ -14280,8 +14617,8 @@ var AiDir = class {
|
|
|
14280
14617
|
* @returns Array of files with their relative paths and buffers
|
|
14281
14618
|
*/
|
|
14282
14619
|
static async collectOtherFiles(outputRoot, relativeDirPath, dirName, excludeFileName) {
|
|
14283
|
-
const dirPath =
|
|
14284
|
-
const glob =
|
|
14620
|
+
const dirPath = join84(outputRoot, relativeDirPath, dirName);
|
|
14621
|
+
const glob = join84(dirPath, "**", "*");
|
|
14285
14622
|
const filePaths = await findFilesByGlobs(glob, { type: "file" });
|
|
14286
14623
|
const filteredPaths = filePaths.filter((filePath) => basename4(filePath) !== excludeFileName);
|
|
14287
14624
|
const files = await Promise.all(
|
|
@@ -14382,8 +14719,8 @@ var ToolSkill = class extends AiDir {
|
|
|
14382
14719
|
}) {
|
|
14383
14720
|
const settablePaths = getSettablePaths({ global });
|
|
14384
14721
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
14385
|
-
const skillDirPath =
|
|
14386
|
-
const skillFilePath =
|
|
14722
|
+
const skillDirPath = join85(outputRoot, actualRelativeDirPath, dirName);
|
|
14723
|
+
const skillFilePath = join85(skillDirPath, SKILL_FILE_NAME);
|
|
14387
14724
|
if (!await fileExists(skillFilePath)) {
|
|
14388
14725
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
14389
14726
|
}
|
|
@@ -14407,7 +14744,7 @@ var ToolSkill = class extends AiDir {
|
|
|
14407
14744
|
}
|
|
14408
14745
|
requireMainFileFrontmatter() {
|
|
14409
14746
|
if (!this.mainFile?.frontmatter) {
|
|
14410
|
-
throw new Error(`Frontmatter is not defined in ${
|
|
14747
|
+
throw new Error(`Frontmatter is not defined in ${join85(this.relativeDirPath, this.dirName)}`);
|
|
14411
14748
|
}
|
|
14412
14749
|
return this.mainFile.frontmatter;
|
|
14413
14750
|
}
|
|
@@ -14447,7 +14784,7 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
14447
14784
|
const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
|
|
14448
14785
|
if (!result.success) {
|
|
14449
14786
|
throw new Error(
|
|
14450
|
-
`Invalid frontmatter in ${
|
|
14787
|
+
`Invalid frontmatter in ${join86(relativeDirPath, dirName)}: ${formatError(result.error)}`
|
|
14451
14788
|
);
|
|
14452
14789
|
}
|
|
14453
14790
|
}
|
|
@@ -14506,8 +14843,8 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
14506
14843
|
}) {
|
|
14507
14844
|
const settablePaths = this.getSettablePaths();
|
|
14508
14845
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
14509
|
-
const skillDirPath =
|
|
14510
|
-
const skillFilePath =
|
|
14846
|
+
const skillDirPath = join86(outputRoot, actualRelativeDirPath, dirName);
|
|
14847
|
+
const skillFilePath = join86(skillDirPath, SKILL_FILE_NAME);
|
|
14511
14848
|
if (!await fileExists(skillFilePath)) {
|
|
14512
14849
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
14513
14850
|
}
|
|
@@ -14584,7 +14921,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
14584
14921
|
throw new Error("AgentsmdSkill does not support global mode.");
|
|
14585
14922
|
}
|
|
14586
14923
|
return {
|
|
14587
|
-
relativeDirPath:
|
|
14924
|
+
relativeDirPath: join87(".agents", "skills")
|
|
14588
14925
|
};
|
|
14589
14926
|
}
|
|
14590
14927
|
static async fromDir(params) {
|
|
@@ -14611,11 +14948,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
14611
14948
|
};
|
|
14612
14949
|
|
|
14613
14950
|
// src/features/skills/factorydroid-skill.ts
|
|
14614
|
-
import { join as
|
|
14951
|
+
import { join as join88 } from "path";
|
|
14615
14952
|
var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
14616
14953
|
static getSettablePaths(_options) {
|
|
14617
14954
|
return {
|
|
14618
|
-
relativeDirPath:
|
|
14955
|
+
relativeDirPath: join88(".factory", "skills")
|
|
14619
14956
|
};
|
|
14620
14957
|
}
|
|
14621
14958
|
static async fromDir(params) {
|
|
@@ -14642,11 +14979,11 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
|
14642
14979
|
};
|
|
14643
14980
|
|
|
14644
14981
|
// src/features/skills/rovodev-skill.ts
|
|
14645
|
-
import { join as
|
|
14982
|
+
import { join as join90 } from "path";
|
|
14646
14983
|
import { z as z41 } from "zod/mini";
|
|
14647
14984
|
|
|
14648
14985
|
// src/features/skills/rulesync-skill.ts
|
|
14649
|
-
import { join as
|
|
14986
|
+
import { join as join89 } from "path";
|
|
14650
14987
|
import { z as z40 } from "zod/mini";
|
|
14651
14988
|
var RulesyncSkillFrontmatterSchemaInternal = z40.looseObject({
|
|
14652
14989
|
name: z40.string(),
|
|
@@ -14686,6 +15023,23 @@ var RulesyncSkillFrontmatterSchemaInternal = z40.looseObject({
|
|
|
14686
15023
|
license: z40.optional(z40.string())
|
|
14687
15024
|
})
|
|
14688
15025
|
),
|
|
15026
|
+
pi: z40.optional(
|
|
15027
|
+
z40.looseObject({
|
|
15028
|
+
"allowed-tools": z40.optional(z40.array(z40.string())),
|
|
15029
|
+
"disable-model-invocation": z40.optional(z40.boolean()),
|
|
15030
|
+
license: z40.optional(z40.string()),
|
|
15031
|
+
compatibility: z40.optional(z40.looseObject({})),
|
|
15032
|
+
metadata: z40.optional(z40.looseObject({}))
|
|
15033
|
+
})
|
|
15034
|
+
),
|
|
15035
|
+
replit: z40.optional(
|
|
15036
|
+
z40.looseObject({
|
|
15037
|
+
"allowed-tools": z40.optional(z40.array(z40.string())),
|
|
15038
|
+
license: z40.optional(z40.string()),
|
|
15039
|
+
compatibility: z40.optional(z40.looseObject({})),
|
|
15040
|
+
metadata: z40.optional(z40.looseObject({}))
|
|
15041
|
+
})
|
|
15042
|
+
),
|
|
14689
15043
|
cline: z40.optional(z40.looseObject({})),
|
|
14690
15044
|
roo: z40.optional(z40.looseObject({})),
|
|
14691
15045
|
takt: z40.optional(
|
|
@@ -14733,7 +15087,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
14733
15087
|
}
|
|
14734
15088
|
getFrontmatter() {
|
|
14735
15089
|
if (!this.mainFile?.frontmatter) {
|
|
14736
|
-
throw new Error(`Frontmatter is not defined in ${
|
|
15090
|
+
throw new Error(`Frontmatter is not defined in ${join89(this.relativeDirPath, this.dirName)}`);
|
|
14737
15091
|
}
|
|
14738
15092
|
const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
|
|
14739
15093
|
return result;
|
|
@@ -14759,8 +15113,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
14759
15113
|
dirName,
|
|
14760
15114
|
global = false
|
|
14761
15115
|
}) {
|
|
14762
|
-
const skillDirPath =
|
|
14763
|
-
const skillFilePath =
|
|
15116
|
+
const skillDirPath = join89(outputRoot, relativeDirPath, dirName);
|
|
15117
|
+
const skillFilePath = join89(skillDirPath, SKILL_FILE_NAME);
|
|
14764
15118
|
if (!await fileExists(skillFilePath)) {
|
|
14765
15119
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
14766
15120
|
}
|
|
@@ -14797,7 +15151,7 @@ var RovodevSkillFrontmatterSchema = z41.looseObject({
|
|
|
14797
15151
|
var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
14798
15152
|
constructor({
|
|
14799
15153
|
outputRoot = process.cwd(),
|
|
14800
|
-
relativeDirPath =
|
|
15154
|
+
relativeDirPath = join90(".rovodev", "skills"),
|
|
14801
15155
|
dirName,
|
|
14802
15156
|
frontmatter,
|
|
14803
15157
|
body,
|
|
@@ -14826,8 +15180,8 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
14826
15180
|
}
|
|
14827
15181
|
static getSettablePaths(_options) {
|
|
14828
15182
|
return {
|
|
14829
|
-
relativeDirPath:
|
|
14830
|
-
alternativeSkillRoots: [
|
|
15183
|
+
relativeDirPath: join90(".rovodev", "skills"),
|
|
15184
|
+
alternativeSkillRoots: [join90(".agents", "skills")]
|
|
14831
15185
|
};
|
|
14832
15186
|
}
|
|
14833
15187
|
getFrontmatter() {
|
|
@@ -14915,13 +15269,13 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
14915
15269
|
});
|
|
14916
15270
|
const result = RovodevSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
14917
15271
|
if (!result.success) {
|
|
14918
|
-
const skillDirPath =
|
|
15272
|
+
const skillDirPath = join90(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
14919
15273
|
throw new Error(
|
|
14920
|
-
`Invalid frontmatter in ${
|
|
15274
|
+
`Invalid frontmatter in ${join90(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
14921
15275
|
);
|
|
14922
15276
|
}
|
|
14923
15277
|
if (result.data.name !== loaded.dirName) {
|
|
14924
|
-
const skillFilePath =
|
|
15278
|
+
const skillFilePath = join90(
|
|
14925
15279
|
loaded.outputRoot,
|
|
14926
15280
|
loaded.relativeDirPath,
|
|
14927
15281
|
loaded.dirName,
|
|
@@ -14963,11 +15317,11 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
14963
15317
|
};
|
|
14964
15318
|
|
|
14965
15319
|
// src/features/skills/skills-processor.ts
|
|
14966
|
-
import { basename as basename6, join as
|
|
15320
|
+
import { basename as basename6, join as join113 } from "path";
|
|
14967
15321
|
import { z as z60 } from "zod/mini";
|
|
14968
15322
|
|
|
14969
15323
|
// src/types/dir-feature-processor.ts
|
|
14970
|
-
import { join as
|
|
15324
|
+
import { join as join91 } from "path";
|
|
14971
15325
|
var DirFeatureProcessor = class {
|
|
14972
15326
|
outputRoot;
|
|
14973
15327
|
inputRoot;
|
|
@@ -15010,7 +15364,7 @@ var DirFeatureProcessor = class {
|
|
|
15010
15364
|
const mainFile = aiDir.getMainFile();
|
|
15011
15365
|
let mainFileContent;
|
|
15012
15366
|
if (mainFile) {
|
|
15013
|
-
const mainFilePath =
|
|
15367
|
+
const mainFilePath = join91(dirPath, mainFile.name);
|
|
15014
15368
|
const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter, {
|
|
15015
15369
|
avoidBlockScalars: this.avoidBlockScalars
|
|
15016
15370
|
});
|
|
@@ -15030,7 +15384,7 @@ var DirFeatureProcessor = class {
|
|
|
15030
15384
|
const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
|
|
15031
15385
|
otherFileContents.push(contentWithNewline);
|
|
15032
15386
|
if (!dirHasChanges) {
|
|
15033
|
-
const filePath =
|
|
15387
|
+
const filePath = join91(dirPath, file.relativeFilePathToDirPath);
|
|
15034
15388
|
const existingContent = await readFileContentOrNull(filePath);
|
|
15035
15389
|
if (!fileContentsEquivalent({
|
|
15036
15390
|
filePath,
|
|
@@ -15048,24 +15402,24 @@ var DirFeatureProcessor = class {
|
|
|
15048
15402
|
if (this.dryRun) {
|
|
15049
15403
|
this.logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
|
|
15050
15404
|
if (mainFile) {
|
|
15051
|
-
this.logger.info(`[DRY RUN] Would write: ${
|
|
15052
|
-
changedPaths.push(
|
|
15405
|
+
this.logger.info(`[DRY RUN] Would write: ${join91(dirPath, mainFile.name)}`);
|
|
15406
|
+
changedPaths.push(join91(relativeDir, mainFile.name));
|
|
15053
15407
|
}
|
|
15054
15408
|
for (const file of otherFiles) {
|
|
15055
15409
|
this.logger.info(
|
|
15056
|
-
`[DRY RUN] Would write: ${
|
|
15410
|
+
`[DRY RUN] Would write: ${join91(dirPath, file.relativeFilePathToDirPath)}`
|
|
15057
15411
|
);
|
|
15058
|
-
changedPaths.push(
|
|
15412
|
+
changedPaths.push(join91(relativeDir, file.relativeFilePathToDirPath));
|
|
15059
15413
|
}
|
|
15060
15414
|
} else {
|
|
15061
15415
|
await ensureDir(dirPath);
|
|
15062
15416
|
if (mainFile && mainFileContent) {
|
|
15063
|
-
const mainFilePath =
|
|
15417
|
+
const mainFilePath = join91(dirPath, mainFile.name);
|
|
15064
15418
|
await writeFileContent(mainFilePath, mainFileContent);
|
|
15065
|
-
changedPaths.push(
|
|
15419
|
+
changedPaths.push(join91(relativeDir, mainFile.name));
|
|
15066
15420
|
}
|
|
15067
15421
|
for (const [i, file] of otherFiles.entries()) {
|
|
15068
|
-
const filePath =
|
|
15422
|
+
const filePath = join91(dirPath, file.relativeFilePathToDirPath);
|
|
15069
15423
|
const content = otherFileContents[i];
|
|
15070
15424
|
if (content === void 0) {
|
|
15071
15425
|
throw new Error(
|
|
@@ -15073,7 +15427,7 @@ var DirFeatureProcessor = class {
|
|
|
15073
15427
|
);
|
|
15074
15428
|
}
|
|
15075
15429
|
await writeFileContent(filePath, content);
|
|
15076
|
-
changedPaths.push(
|
|
15430
|
+
changedPaths.push(join91(relativeDir, file.relativeFilePathToDirPath));
|
|
15077
15431
|
}
|
|
15078
15432
|
}
|
|
15079
15433
|
changedCount++;
|
|
@@ -15105,7 +15459,7 @@ var DirFeatureProcessor = class {
|
|
|
15105
15459
|
};
|
|
15106
15460
|
|
|
15107
15461
|
// src/features/skills/agentsskills-skill.ts
|
|
15108
|
-
import { join as
|
|
15462
|
+
import { join as join92 } from "path";
|
|
15109
15463
|
import { z as z42 } from "zod/mini";
|
|
15110
15464
|
var AgentsSkillsSkillFrontmatterSchema = z42.looseObject({
|
|
15111
15465
|
name: z42.string(),
|
|
@@ -15114,7 +15468,7 @@ var AgentsSkillsSkillFrontmatterSchema = z42.looseObject({
|
|
|
15114
15468
|
var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
15115
15469
|
constructor({
|
|
15116
15470
|
outputRoot = process.cwd(),
|
|
15117
|
-
relativeDirPath =
|
|
15471
|
+
relativeDirPath = join92(".agents", "skills"),
|
|
15118
15472
|
dirName,
|
|
15119
15473
|
frontmatter,
|
|
15120
15474
|
body,
|
|
@@ -15146,7 +15500,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
15146
15500
|
throw new Error("AgentsSkillsSkill does not support global mode.");
|
|
15147
15501
|
}
|
|
15148
15502
|
return {
|
|
15149
|
-
relativeDirPath:
|
|
15503
|
+
relativeDirPath: join92(".agents", "skills")
|
|
15150
15504
|
};
|
|
15151
15505
|
}
|
|
15152
15506
|
getFrontmatter() {
|
|
@@ -15226,9 +15580,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
15226
15580
|
});
|
|
15227
15581
|
const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
15228
15582
|
if (!result.success) {
|
|
15229
|
-
const skillDirPath =
|
|
15583
|
+
const skillDirPath = join92(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
15230
15584
|
throw new Error(
|
|
15231
|
-
`Invalid frontmatter in ${
|
|
15585
|
+
`Invalid frontmatter in ${join92(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
15232
15586
|
);
|
|
15233
15587
|
}
|
|
15234
15588
|
return new _AgentsSkillsSkill({
|
|
@@ -15263,10 +15617,10 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
15263
15617
|
};
|
|
15264
15618
|
|
|
15265
15619
|
// src/features/skills/antigravity-shared-skill.ts
|
|
15266
|
-
import { join as
|
|
15620
|
+
import { join as join94 } from "path";
|
|
15267
15621
|
|
|
15268
15622
|
// src/features/skills/antigravity-skill.ts
|
|
15269
|
-
import { join as
|
|
15623
|
+
import { join as join93 } from "path";
|
|
15270
15624
|
import { z as z43 } from "zod/mini";
|
|
15271
15625
|
var AntigravitySkillFrontmatterSchema = z43.looseObject({
|
|
15272
15626
|
name: z43.string(),
|
|
@@ -15275,7 +15629,7 @@ var AntigravitySkillFrontmatterSchema = z43.looseObject({
|
|
|
15275
15629
|
var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
15276
15630
|
constructor({
|
|
15277
15631
|
outputRoot = process.cwd(),
|
|
15278
|
-
relativeDirPath =
|
|
15632
|
+
relativeDirPath = join93(".agent", "skills"),
|
|
15279
15633
|
dirName,
|
|
15280
15634
|
frontmatter,
|
|
15281
15635
|
body,
|
|
@@ -15307,11 +15661,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
15307
15661
|
} = {}) {
|
|
15308
15662
|
if (global) {
|
|
15309
15663
|
return {
|
|
15310
|
-
relativeDirPath:
|
|
15664
|
+
relativeDirPath: join93(".gemini", "antigravity", "skills")
|
|
15311
15665
|
};
|
|
15312
15666
|
}
|
|
15313
15667
|
return {
|
|
15314
|
-
relativeDirPath:
|
|
15668
|
+
relativeDirPath: join93(".agent", "skills")
|
|
15315
15669
|
};
|
|
15316
15670
|
}
|
|
15317
15671
|
getFrontmatter() {
|
|
@@ -15391,9 +15745,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
15391
15745
|
});
|
|
15392
15746
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
15393
15747
|
if (!result.success) {
|
|
15394
|
-
const skillDirPath =
|
|
15748
|
+
const skillDirPath = join93(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
15395
15749
|
throw new Error(
|
|
15396
|
-
`Invalid frontmatter in ${
|
|
15750
|
+
`Invalid frontmatter in ${join93(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
15397
15751
|
);
|
|
15398
15752
|
}
|
|
15399
15753
|
return new _AntigravitySkill({
|
|
@@ -15430,7 +15784,7 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
15430
15784
|
var AntigravitySharedSkill = class extends ToolSkill {
|
|
15431
15785
|
constructor({
|
|
15432
15786
|
outputRoot = process.cwd(),
|
|
15433
|
-
relativeDirPath =
|
|
15787
|
+
relativeDirPath = join94(".agents", "skills"),
|
|
15434
15788
|
dirName,
|
|
15435
15789
|
frontmatter,
|
|
15436
15790
|
body,
|
|
@@ -15470,11 +15824,11 @@ var AntigravitySharedSkill = class extends ToolSkill {
|
|
|
15470
15824
|
} = {}) {
|
|
15471
15825
|
if (global) {
|
|
15472
15826
|
return {
|
|
15473
|
-
relativeDirPath:
|
|
15827
|
+
relativeDirPath: join94(".gemini", this.getGlobalSubdir(), "skills")
|
|
15474
15828
|
};
|
|
15475
15829
|
}
|
|
15476
15830
|
return {
|
|
15477
|
-
relativeDirPath:
|
|
15831
|
+
relativeDirPath: join94(".agents", "skills")
|
|
15478
15832
|
};
|
|
15479
15833
|
}
|
|
15480
15834
|
getFrontmatter() {
|
|
@@ -15554,9 +15908,9 @@ var AntigravitySharedSkill = class extends ToolSkill {
|
|
|
15554
15908
|
});
|
|
15555
15909
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
15556
15910
|
if (!result.success) {
|
|
15557
|
-
const skillDirPath =
|
|
15911
|
+
const skillDirPath = join94(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
15558
15912
|
throw new Error(
|
|
15559
|
-
`Invalid frontmatter in ${
|
|
15913
|
+
`Invalid frontmatter in ${join94(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
15560
15914
|
);
|
|
15561
15915
|
}
|
|
15562
15916
|
return new this({
|
|
@@ -15610,10 +15964,10 @@ var AntigravityIdeSkill = class extends AntigravitySharedSkill {
|
|
|
15610
15964
|
};
|
|
15611
15965
|
|
|
15612
15966
|
// src/features/skills/claudecode-skill.ts
|
|
15613
|
-
import { join as
|
|
15967
|
+
import { join as join95 } from "path";
|
|
15614
15968
|
import { z as z44 } from "zod/mini";
|
|
15615
|
-
var CLAUDE_SKILLS_DIR_PATH =
|
|
15616
|
-
var CLAUDE_SCHEDULED_TASKS_DIR_PATH =
|
|
15969
|
+
var CLAUDE_SKILLS_DIR_PATH = join95(".claude", "skills");
|
|
15970
|
+
var CLAUDE_SCHEDULED_TASKS_DIR_PATH = join95(".claude", "scheduled-tasks");
|
|
15617
15971
|
var ClaudecodeSkillFrontmatterSchema = z44.looseObject({
|
|
15618
15972
|
name: z44.string(),
|
|
15619
15973
|
description: z44.string(),
|
|
@@ -15625,7 +15979,7 @@ var ClaudecodeSkillFrontmatterSchema = z44.looseObject({
|
|
|
15625
15979
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
15626
15980
|
constructor({
|
|
15627
15981
|
outputRoot = process.cwd(),
|
|
15628
|
-
relativeDirPath =
|
|
15982
|
+
relativeDirPath = join95(".claude", "skills"),
|
|
15629
15983
|
dirName,
|
|
15630
15984
|
frontmatter,
|
|
15631
15985
|
body,
|
|
@@ -15764,9 +16118,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
15764
16118
|
});
|
|
15765
16119
|
const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
15766
16120
|
if (!result.success) {
|
|
15767
|
-
const skillDirPath =
|
|
16121
|
+
const skillDirPath = join95(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
15768
16122
|
throw new Error(
|
|
15769
|
-
`Invalid frontmatter in ${
|
|
16123
|
+
`Invalid frontmatter in ${join95(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
15770
16124
|
);
|
|
15771
16125
|
}
|
|
15772
16126
|
return new _ClaudecodeSkill({
|
|
@@ -15800,7 +16154,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
15800
16154
|
};
|
|
15801
16155
|
|
|
15802
16156
|
// src/features/skills/cline-skill.ts
|
|
15803
|
-
import { join as
|
|
16157
|
+
import { join as join96 } from "path";
|
|
15804
16158
|
import { z as z45 } from "zod/mini";
|
|
15805
16159
|
var ClineSkillFrontmatterSchema = z45.looseObject({
|
|
15806
16160
|
name: z45.string(),
|
|
@@ -15809,7 +16163,7 @@ var ClineSkillFrontmatterSchema = z45.looseObject({
|
|
|
15809
16163
|
var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
15810
16164
|
constructor({
|
|
15811
16165
|
outputRoot = process.cwd(),
|
|
15812
|
-
relativeDirPath =
|
|
16166
|
+
relativeDirPath = join96(".cline", "skills"),
|
|
15813
16167
|
dirName,
|
|
15814
16168
|
frontmatter,
|
|
15815
16169
|
body,
|
|
@@ -15838,7 +16192,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
15838
16192
|
}
|
|
15839
16193
|
static getSettablePaths(_options = {}) {
|
|
15840
16194
|
return {
|
|
15841
|
-
relativeDirPath:
|
|
16195
|
+
relativeDirPath: join96(".cline", "skills")
|
|
15842
16196
|
};
|
|
15843
16197
|
}
|
|
15844
16198
|
getFrontmatter() {
|
|
@@ -15926,13 +16280,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
15926
16280
|
});
|
|
15927
16281
|
const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
15928
16282
|
if (!result.success) {
|
|
15929
|
-
const skillDirPath =
|
|
16283
|
+
const skillDirPath = join96(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
15930
16284
|
throw new Error(
|
|
15931
|
-
`Invalid frontmatter in ${
|
|
16285
|
+
`Invalid frontmatter in ${join96(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
15932
16286
|
);
|
|
15933
16287
|
}
|
|
15934
16288
|
if (result.data.name !== loaded.dirName) {
|
|
15935
|
-
const skillFilePath =
|
|
16289
|
+
const skillFilePath = join96(
|
|
15936
16290
|
loaded.outputRoot,
|
|
15937
16291
|
loaded.relativeDirPath,
|
|
15938
16292
|
loaded.dirName,
|
|
@@ -15973,7 +16327,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
15973
16327
|
};
|
|
15974
16328
|
|
|
15975
16329
|
// src/features/skills/codexcli-skill.ts
|
|
15976
|
-
import { join as
|
|
16330
|
+
import { join as join97 } from "path";
|
|
15977
16331
|
import { z as z46 } from "zod/mini";
|
|
15978
16332
|
var CodexCliSkillFrontmatterSchema = z46.looseObject({
|
|
15979
16333
|
name: z46.string(),
|
|
@@ -15987,7 +16341,7 @@ var CodexCliSkillFrontmatterSchema = z46.looseObject({
|
|
|
15987
16341
|
var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
15988
16342
|
constructor({
|
|
15989
16343
|
outputRoot = process.cwd(),
|
|
15990
|
-
relativeDirPath =
|
|
16344
|
+
relativeDirPath = join97(".codex", "skills"),
|
|
15991
16345
|
dirName,
|
|
15992
16346
|
frontmatter,
|
|
15993
16347
|
body,
|
|
@@ -16018,7 +16372,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
16018
16372
|
global: _global = false
|
|
16019
16373
|
} = {}) {
|
|
16020
16374
|
return {
|
|
16021
|
-
relativeDirPath:
|
|
16375
|
+
relativeDirPath: join97(".codex", "skills")
|
|
16022
16376
|
};
|
|
16023
16377
|
}
|
|
16024
16378
|
getFrontmatter() {
|
|
@@ -16108,9 +16462,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
16108
16462
|
});
|
|
16109
16463
|
const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
16110
16464
|
if (!result.success) {
|
|
16111
|
-
const skillDirPath =
|
|
16465
|
+
const skillDirPath = join97(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
16112
16466
|
throw new Error(
|
|
16113
|
-
`Invalid frontmatter in ${
|
|
16467
|
+
`Invalid frontmatter in ${join97(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
16114
16468
|
);
|
|
16115
16469
|
}
|
|
16116
16470
|
return new _CodexCliSkill({
|
|
@@ -16144,7 +16498,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
16144
16498
|
};
|
|
16145
16499
|
|
|
16146
16500
|
// src/features/skills/copilot-skill.ts
|
|
16147
|
-
import { join as
|
|
16501
|
+
import { join as join98 } from "path";
|
|
16148
16502
|
import { z as z47 } from "zod/mini";
|
|
16149
16503
|
var CopilotSkillFrontmatterSchema = z47.looseObject({
|
|
16150
16504
|
name: z47.string(),
|
|
@@ -16154,7 +16508,7 @@ var CopilotSkillFrontmatterSchema = z47.looseObject({
|
|
|
16154
16508
|
var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
16155
16509
|
constructor({
|
|
16156
16510
|
outputRoot = process.cwd(),
|
|
16157
|
-
relativeDirPath =
|
|
16511
|
+
relativeDirPath = join98(".github", "skills"),
|
|
16158
16512
|
dirName,
|
|
16159
16513
|
frontmatter,
|
|
16160
16514
|
body,
|
|
@@ -16186,7 +16540,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
16186
16540
|
throw new Error("CopilotSkill does not support global mode.");
|
|
16187
16541
|
}
|
|
16188
16542
|
return {
|
|
16189
|
-
relativeDirPath:
|
|
16543
|
+
relativeDirPath: join98(".github", "skills")
|
|
16190
16544
|
};
|
|
16191
16545
|
}
|
|
16192
16546
|
getFrontmatter() {
|
|
@@ -16272,9 +16626,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
16272
16626
|
});
|
|
16273
16627
|
const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
16274
16628
|
if (!result.success) {
|
|
16275
|
-
const skillDirPath =
|
|
16629
|
+
const skillDirPath = join98(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
16276
16630
|
throw new Error(
|
|
16277
|
-
`Invalid frontmatter in ${
|
|
16631
|
+
`Invalid frontmatter in ${join98(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
16278
16632
|
);
|
|
16279
16633
|
}
|
|
16280
16634
|
return new _CopilotSkill({
|
|
@@ -16309,7 +16663,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
16309
16663
|
};
|
|
16310
16664
|
|
|
16311
16665
|
// src/features/skills/cursor-skill.ts
|
|
16312
|
-
import { join as
|
|
16666
|
+
import { join as join99 } from "path";
|
|
16313
16667
|
import { z as z48 } from "zod/mini";
|
|
16314
16668
|
var CursorSkillFrontmatterSchema = z48.looseObject({
|
|
16315
16669
|
name: z48.string(),
|
|
@@ -16318,7 +16672,7 @@ var CursorSkillFrontmatterSchema = z48.looseObject({
|
|
|
16318
16672
|
var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
16319
16673
|
constructor({
|
|
16320
16674
|
outputRoot = process.cwd(),
|
|
16321
|
-
relativeDirPath =
|
|
16675
|
+
relativeDirPath = join99(".cursor", "skills"),
|
|
16322
16676
|
dirName,
|
|
16323
16677
|
frontmatter,
|
|
16324
16678
|
body,
|
|
@@ -16347,7 +16701,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
16347
16701
|
}
|
|
16348
16702
|
static getSettablePaths(_options) {
|
|
16349
16703
|
return {
|
|
16350
|
-
relativeDirPath:
|
|
16704
|
+
relativeDirPath: join99(".cursor", "skills")
|
|
16351
16705
|
};
|
|
16352
16706
|
}
|
|
16353
16707
|
getFrontmatter() {
|
|
@@ -16427,9 +16781,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
16427
16781
|
});
|
|
16428
16782
|
const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
16429
16783
|
if (!result.success) {
|
|
16430
|
-
const skillDirPath =
|
|
16784
|
+
const skillDirPath = join99(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
16431
16785
|
throw new Error(
|
|
16432
|
-
`Invalid frontmatter in ${
|
|
16786
|
+
`Invalid frontmatter in ${join99(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
16433
16787
|
);
|
|
16434
16788
|
}
|
|
16435
16789
|
return new _CursorSkill({
|
|
@@ -16464,7 +16818,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
16464
16818
|
};
|
|
16465
16819
|
|
|
16466
16820
|
// src/features/skills/deepagents-skill.ts
|
|
16467
|
-
import { join as
|
|
16821
|
+
import { join as join100 } from "path";
|
|
16468
16822
|
import { z as z49 } from "zod/mini";
|
|
16469
16823
|
var DeepagentsSkillFrontmatterSchema = z49.looseObject({
|
|
16470
16824
|
name: z49.string(),
|
|
@@ -16474,7 +16828,7 @@ var DeepagentsSkillFrontmatterSchema = z49.looseObject({
|
|
|
16474
16828
|
var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
16475
16829
|
constructor({
|
|
16476
16830
|
outputRoot = process.cwd(),
|
|
16477
|
-
relativeDirPath =
|
|
16831
|
+
relativeDirPath = join100(".deepagents", "skills"),
|
|
16478
16832
|
dirName,
|
|
16479
16833
|
frontmatter,
|
|
16480
16834
|
body,
|
|
@@ -16503,7 +16857,7 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
16503
16857
|
}
|
|
16504
16858
|
static getSettablePaths(_options) {
|
|
16505
16859
|
return {
|
|
16506
|
-
relativeDirPath:
|
|
16860
|
+
relativeDirPath: join100(".deepagents", "skills")
|
|
16507
16861
|
};
|
|
16508
16862
|
}
|
|
16509
16863
|
getFrontmatter() {
|
|
@@ -16589,9 +16943,9 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
16589
16943
|
});
|
|
16590
16944
|
const result = DeepagentsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
16591
16945
|
if (!result.success) {
|
|
16592
|
-
const skillDirPath =
|
|
16946
|
+
const skillDirPath = join100(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
16593
16947
|
throw new Error(
|
|
16594
|
-
`Invalid frontmatter in ${
|
|
16948
|
+
`Invalid frontmatter in ${join100(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
16595
16949
|
);
|
|
16596
16950
|
}
|
|
16597
16951
|
return new _DeepagentsSkill({
|
|
@@ -16626,7 +16980,7 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
16626
16980
|
};
|
|
16627
16981
|
|
|
16628
16982
|
// src/features/skills/geminicli-skill.ts
|
|
16629
|
-
import { join as
|
|
16983
|
+
import { join as join101 } from "path";
|
|
16630
16984
|
import { z as z50 } from "zod/mini";
|
|
16631
16985
|
var GeminiCliSkillFrontmatterSchema = z50.looseObject({
|
|
16632
16986
|
name: z50.string(),
|
|
@@ -16666,7 +17020,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
16666
17020
|
global: _global = false
|
|
16667
17021
|
} = {}) {
|
|
16668
17022
|
return {
|
|
16669
|
-
relativeDirPath:
|
|
17023
|
+
relativeDirPath: join101(".gemini", "skills")
|
|
16670
17024
|
};
|
|
16671
17025
|
}
|
|
16672
17026
|
getFrontmatter() {
|
|
@@ -16746,9 +17100,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
16746
17100
|
});
|
|
16747
17101
|
const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
16748
17102
|
if (!result.success) {
|
|
16749
|
-
const skillDirPath =
|
|
17103
|
+
const skillDirPath = join101(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
16750
17104
|
throw new Error(
|
|
16751
|
-
`Invalid frontmatter in ${
|
|
17105
|
+
`Invalid frontmatter in ${join101(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
16752
17106
|
);
|
|
16753
17107
|
}
|
|
16754
17108
|
return new _GeminiCliSkill({
|
|
@@ -16783,7 +17137,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
16783
17137
|
};
|
|
16784
17138
|
|
|
16785
17139
|
// src/features/skills/junie-skill.ts
|
|
16786
|
-
import { join as
|
|
17140
|
+
import { join as join102 } from "path";
|
|
16787
17141
|
import { z as z51 } from "zod/mini";
|
|
16788
17142
|
var JunieSkillFrontmatterSchema = z51.looseObject({
|
|
16789
17143
|
name: z51.string(),
|
|
@@ -16792,7 +17146,7 @@ var JunieSkillFrontmatterSchema = z51.looseObject({
|
|
|
16792
17146
|
var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
16793
17147
|
constructor({
|
|
16794
17148
|
outputRoot = process.cwd(),
|
|
16795
|
-
relativeDirPath =
|
|
17149
|
+
relativeDirPath = join102(".junie", "skills"),
|
|
16796
17150
|
dirName,
|
|
16797
17151
|
frontmatter,
|
|
16798
17152
|
body,
|
|
@@ -16824,7 +17178,7 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
16824
17178
|
throw new Error("JunieSkill does not support global mode.");
|
|
16825
17179
|
}
|
|
16826
17180
|
return {
|
|
16827
|
-
relativeDirPath:
|
|
17181
|
+
relativeDirPath: join102(".junie", "skills")
|
|
16828
17182
|
};
|
|
16829
17183
|
}
|
|
16830
17184
|
getFrontmatter() {
|
|
@@ -16911,13 +17265,13 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
16911
17265
|
});
|
|
16912
17266
|
const result = JunieSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
16913
17267
|
if (!result.success) {
|
|
16914
|
-
const skillDirPath =
|
|
17268
|
+
const skillDirPath = join102(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
16915
17269
|
throw new Error(
|
|
16916
|
-
`Invalid frontmatter in ${
|
|
17270
|
+
`Invalid frontmatter in ${join102(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
16917
17271
|
);
|
|
16918
17272
|
}
|
|
16919
17273
|
if (result.data.name !== loaded.dirName) {
|
|
16920
|
-
const skillFilePath =
|
|
17274
|
+
const skillFilePath = join102(
|
|
16921
17275
|
loaded.outputRoot,
|
|
16922
17276
|
loaded.relativeDirPath,
|
|
16923
17277
|
loaded.dirName,
|
|
@@ -16959,7 +17313,7 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
16959
17313
|
};
|
|
16960
17314
|
|
|
16961
17315
|
// src/features/skills/kilo-skill.ts
|
|
16962
|
-
import { join as
|
|
17316
|
+
import { join as join103 } from "path";
|
|
16963
17317
|
import { z as z52 } from "zod/mini";
|
|
16964
17318
|
var KiloSkillFrontmatterSchema = z52.looseObject({
|
|
16965
17319
|
name: z52.string(),
|
|
@@ -16969,7 +17323,7 @@ var KiloSkillFrontmatterSchema = z52.looseObject({
|
|
|
16969
17323
|
var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
16970
17324
|
constructor({
|
|
16971
17325
|
outputRoot = process.cwd(),
|
|
16972
|
-
relativeDirPath =
|
|
17326
|
+
relativeDirPath = join103(".kilo", "skills"),
|
|
16973
17327
|
dirName,
|
|
16974
17328
|
frontmatter,
|
|
16975
17329
|
body,
|
|
@@ -16998,7 +17352,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
16998
17352
|
}
|
|
16999
17353
|
static getSettablePaths({ global = false } = {}) {
|
|
17000
17354
|
return {
|
|
17001
|
-
relativeDirPath: global ?
|
|
17355
|
+
relativeDirPath: global ? join103(".config", "kilo", "skills") : join103(".kilo", "skills")
|
|
17002
17356
|
};
|
|
17003
17357
|
}
|
|
17004
17358
|
getFrontmatter() {
|
|
@@ -17084,9 +17438,9 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
17084
17438
|
});
|
|
17085
17439
|
const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
17086
17440
|
if (!result.success) {
|
|
17087
|
-
const skillDirPath =
|
|
17441
|
+
const skillDirPath = join103(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
17088
17442
|
throw new Error(
|
|
17089
|
-
`Invalid frontmatter in ${
|
|
17443
|
+
`Invalid frontmatter in ${join103(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
17090
17444
|
);
|
|
17091
17445
|
}
|
|
17092
17446
|
return new _KiloSkill({
|
|
@@ -17120,7 +17474,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
17120
17474
|
};
|
|
17121
17475
|
|
|
17122
17476
|
// src/features/skills/kiro-skill.ts
|
|
17123
|
-
import { join as
|
|
17477
|
+
import { join as join104 } from "path";
|
|
17124
17478
|
import { z as z53 } from "zod/mini";
|
|
17125
17479
|
var KiroSkillFrontmatterSchema = z53.looseObject({
|
|
17126
17480
|
name: z53.string(),
|
|
@@ -17129,7 +17483,7 @@ var KiroSkillFrontmatterSchema = z53.looseObject({
|
|
|
17129
17483
|
var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
17130
17484
|
constructor({
|
|
17131
17485
|
outputRoot = process.cwd(),
|
|
17132
|
-
relativeDirPath =
|
|
17486
|
+
relativeDirPath = join104(".kiro", "skills"),
|
|
17133
17487
|
dirName,
|
|
17134
17488
|
frontmatter,
|
|
17135
17489
|
body,
|
|
@@ -17161,7 +17515,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
17161
17515
|
throw new Error("KiroSkill does not support global mode.");
|
|
17162
17516
|
}
|
|
17163
17517
|
return {
|
|
17164
|
-
relativeDirPath:
|
|
17518
|
+
relativeDirPath: join104(".kiro", "skills")
|
|
17165
17519
|
};
|
|
17166
17520
|
}
|
|
17167
17521
|
getFrontmatter() {
|
|
@@ -17249,13 +17603,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
17249
17603
|
});
|
|
17250
17604
|
const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
17251
17605
|
if (!result.success) {
|
|
17252
|
-
const skillDirPath =
|
|
17606
|
+
const skillDirPath = join104(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
17253
17607
|
throw new Error(
|
|
17254
|
-
`Invalid frontmatter in ${
|
|
17608
|
+
`Invalid frontmatter in ${join104(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
17255
17609
|
);
|
|
17256
17610
|
}
|
|
17257
17611
|
if (result.data.name !== loaded.dirName) {
|
|
17258
|
-
const skillFilePath =
|
|
17612
|
+
const skillFilePath = join104(
|
|
17259
17613
|
loaded.outputRoot,
|
|
17260
17614
|
loaded.relativeDirPath,
|
|
17261
17615
|
loaded.dirName,
|
|
@@ -17297,7 +17651,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
17297
17651
|
};
|
|
17298
17652
|
|
|
17299
17653
|
// src/features/skills/opencode-skill.ts
|
|
17300
|
-
import { join as
|
|
17654
|
+
import { join as join105 } from "path";
|
|
17301
17655
|
import { z as z54 } from "zod/mini";
|
|
17302
17656
|
var OpenCodeSkillFrontmatterSchema = z54.looseObject({
|
|
17303
17657
|
name: z54.string(),
|
|
@@ -17307,7 +17661,7 @@ var OpenCodeSkillFrontmatterSchema = z54.looseObject({
|
|
|
17307
17661
|
var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
17308
17662
|
constructor({
|
|
17309
17663
|
outputRoot = process.cwd(),
|
|
17310
|
-
relativeDirPath =
|
|
17664
|
+
relativeDirPath = join105(".opencode", "skill"),
|
|
17311
17665
|
dirName,
|
|
17312
17666
|
frontmatter,
|
|
17313
17667
|
body,
|
|
@@ -17336,7 +17690,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
17336
17690
|
}
|
|
17337
17691
|
static getSettablePaths({ global = false } = {}) {
|
|
17338
17692
|
return {
|
|
17339
|
-
relativeDirPath: global ?
|
|
17693
|
+
relativeDirPath: global ? join105(".config", "opencode", "skill") : join105(".opencode", "skill")
|
|
17340
17694
|
};
|
|
17341
17695
|
}
|
|
17342
17696
|
getFrontmatter() {
|
|
@@ -17422,9 +17776,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
17422
17776
|
});
|
|
17423
17777
|
const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
17424
17778
|
if (!result.success) {
|
|
17425
|
-
const skillDirPath =
|
|
17779
|
+
const skillDirPath = join105(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
17426
17780
|
throw new Error(
|
|
17427
|
-
`Invalid frontmatter in ${
|
|
17781
|
+
`Invalid frontmatter in ${join105(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
17428
17782
|
);
|
|
17429
17783
|
}
|
|
17430
17784
|
return new _OpenCodeSkill({
|
|
@@ -17458,11 +17812,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
17458
17812
|
};
|
|
17459
17813
|
|
|
17460
17814
|
// src/features/skills/pi-skill.ts
|
|
17461
|
-
import { join as
|
|
17815
|
+
import { join as join106 } from "path";
|
|
17462
17816
|
import { z as z55 } from "zod/mini";
|
|
17463
17817
|
var PiSkillFrontmatterSchema = z55.looseObject({
|
|
17464
17818
|
name: z55.string(),
|
|
17465
|
-
description: z55.string()
|
|
17819
|
+
description: z55.string(),
|
|
17820
|
+
"allowed-tools": z55.optional(z55.array(z55.string())),
|
|
17821
|
+
"disable-model-invocation": z55.optional(z55.boolean()),
|
|
17822
|
+
license: z55.optional(z55.string()),
|
|
17823
|
+
compatibility: z55.optional(z55.looseObject({})),
|
|
17824
|
+
metadata: z55.optional(z55.looseObject({}))
|
|
17466
17825
|
});
|
|
17467
17826
|
var PiSkill = class _PiSkill extends ToolSkill {
|
|
17468
17827
|
constructor({
|
|
@@ -17498,11 +17857,11 @@ var PiSkill = class _PiSkill extends ToolSkill {
|
|
|
17498
17857
|
static getSettablePaths({ global } = {}) {
|
|
17499
17858
|
if (global) {
|
|
17500
17859
|
return {
|
|
17501
|
-
relativeDirPath:
|
|
17860
|
+
relativeDirPath: join106(".pi", "agent", "skills")
|
|
17502
17861
|
};
|
|
17503
17862
|
}
|
|
17504
17863
|
return {
|
|
17505
|
-
relativeDirPath:
|
|
17864
|
+
relativeDirPath: join106(".pi", "skills")
|
|
17506
17865
|
};
|
|
17507
17866
|
}
|
|
17508
17867
|
getFrontmatter() {
|
|
@@ -17531,10 +17890,24 @@ var PiSkill = class _PiSkill extends ToolSkill {
|
|
|
17531
17890
|
}
|
|
17532
17891
|
toRulesyncSkill() {
|
|
17533
17892
|
const frontmatter = this.getFrontmatter();
|
|
17893
|
+
const piBlock = {
|
|
17894
|
+
...frontmatter["allowed-tools"] !== void 0 && {
|
|
17895
|
+
"allowed-tools": frontmatter["allowed-tools"]
|
|
17896
|
+
},
|
|
17897
|
+
...frontmatter["disable-model-invocation"] !== void 0 && {
|
|
17898
|
+
"disable-model-invocation": frontmatter["disable-model-invocation"]
|
|
17899
|
+
},
|
|
17900
|
+
...frontmatter.license !== void 0 && { license: frontmatter.license },
|
|
17901
|
+
...frontmatter.compatibility !== void 0 && {
|
|
17902
|
+
compatibility: frontmatter.compatibility
|
|
17903
|
+
},
|
|
17904
|
+
...frontmatter.metadata !== void 0 && { metadata: frontmatter.metadata }
|
|
17905
|
+
};
|
|
17534
17906
|
const rulesyncFrontmatter = {
|
|
17535
17907
|
name: frontmatter.name,
|
|
17536
17908
|
description: frontmatter.description,
|
|
17537
|
-
targets: ["*"]
|
|
17909
|
+
targets: ["*"],
|
|
17910
|
+
...Object.keys(piBlock).length > 0 && { pi: piBlock }
|
|
17538
17911
|
};
|
|
17539
17912
|
return new RulesyncSkill({
|
|
17540
17913
|
outputRoot: this.outputRoot,
|
|
@@ -17557,7 +17930,8 @@ var PiSkill = class _PiSkill extends ToolSkill {
|
|
|
17557
17930
|
const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
|
|
17558
17931
|
const piFrontmatter = {
|
|
17559
17932
|
name: rulesyncFrontmatter.name,
|
|
17560
|
-
description: rulesyncFrontmatter.description
|
|
17933
|
+
description: rulesyncFrontmatter.description,
|
|
17934
|
+
...rulesyncFrontmatter.pi
|
|
17561
17935
|
};
|
|
17562
17936
|
return new _PiSkill({
|
|
17563
17937
|
outputRoot,
|
|
@@ -17581,9 +17955,9 @@ var PiSkill = class _PiSkill extends ToolSkill {
|
|
|
17581
17955
|
});
|
|
17582
17956
|
const result = PiSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
17583
17957
|
if (!result.success) {
|
|
17584
|
-
const skillDirPath =
|
|
17958
|
+
const skillDirPath = join106(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
17585
17959
|
throw new Error(
|
|
17586
|
-
`Invalid frontmatter in ${
|
|
17960
|
+
`Invalid frontmatter in ${join106(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
17587
17961
|
);
|
|
17588
17962
|
}
|
|
17589
17963
|
return new _PiSkill({
|
|
@@ -17618,16 +17992,20 @@ var PiSkill = class _PiSkill extends ToolSkill {
|
|
|
17618
17992
|
};
|
|
17619
17993
|
|
|
17620
17994
|
// src/features/skills/replit-skill.ts
|
|
17621
|
-
import { join as
|
|
17995
|
+
import { join as join107 } from "path";
|
|
17622
17996
|
import { z as z56 } from "zod/mini";
|
|
17623
17997
|
var ReplitSkillFrontmatterSchema = z56.looseObject({
|
|
17624
17998
|
name: z56.string(),
|
|
17625
|
-
description: z56.string()
|
|
17999
|
+
description: z56.string(),
|
|
18000
|
+
"allowed-tools": z56.optional(z56.array(z56.string())),
|
|
18001
|
+
license: z56.optional(z56.string()),
|
|
18002
|
+
compatibility: z56.optional(z56.looseObject({})),
|
|
18003
|
+
metadata: z56.optional(z56.looseObject({}))
|
|
17626
18004
|
});
|
|
17627
18005
|
var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
17628
18006
|
constructor({
|
|
17629
18007
|
outputRoot = process.cwd(),
|
|
17630
|
-
relativeDirPath =
|
|
18008
|
+
relativeDirPath = join107(".agents", "skills"),
|
|
17631
18009
|
dirName,
|
|
17632
18010
|
frontmatter,
|
|
17633
18011
|
body,
|
|
@@ -17659,7 +18037,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
17659
18037
|
throw new Error("ReplitSkill does not support global mode.");
|
|
17660
18038
|
}
|
|
17661
18039
|
return {
|
|
17662
|
-
relativeDirPath:
|
|
18040
|
+
relativeDirPath: join107(".agents", "skills")
|
|
17663
18041
|
};
|
|
17664
18042
|
}
|
|
17665
18043
|
getFrontmatter() {
|
|
@@ -17689,10 +18067,21 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
17689
18067
|
}
|
|
17690
18068
|
toRulesyncSkill() {
|
|
17691
18069
|
const frontmatter = this.getFrontmatter();
|
|
18070
|
+
const replitBlock = {
|
|
18071
|
+
...frontmatter["allowed-tools"] !== void 0 && {
|
|
18072
|
+
"allowed-tools": frontmatter["allowed-tools"]
|
|
18073
|
+
},
|
|
18074
|
+
...frontmatter.license !== void 0 && { license: frontmatter.license },
|
|
18075
|
+
...frontmatter.compatibility !== void 0 && {
|
|
18076
|
+
compatibility: frontmatter.compatibility
|
|
18077
|
+
},
|
|
18078
|
+
...frontmatter.metadata !== void 0 && { metadata: frontmatter.metadata }
|
|
18079
|
+
};
|
|
17692
18080
|
const rulesyncFrontmatter = {
|
|
17693
18081
|
name: frontmatter.name,
|
|
17694
18082
|
description: frontmatter.description,
|
|
17695
|
-
targets: ["*"]
|
|
18083
|
+
targets: ["*"],
|
|
18084
|
+
...Object.keys(replitBlock).length > 0 && { replit: replitBlock }
|
|
17696
18085
|
};
|
|
17697
18086
|
return new RulesyncSkill({
|
|
17698
18087
|
outputRoot: this.outputRoot,
|
|
@@ -17715,7 +18104,8 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
17715
18104
|
const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
|
|
17716
18105
|
const replitFrontmatter = {
|
|
17717
18106
|
name: rulesyncFrontmatter.name,
|
|
17718
|
-
description: rulesyncFrontmatter.description
|
|
18107
|
+
description: rulesyncFrontmatter.description,
|
|
18108
|
+
...rulesyncFrontmatter.replit
|
|
17719
18109
|
};
|
|
17720
18110
|
return new _ReplitSkill({
|
|
17721
18111
|
outputRoot,
|
|
@@ -17739,9 +18129,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
17739
18129
|
});
|
|
17740
18130
|
const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
17741
18131
|
if (!result.success) {
|
|
17742
|
-
const skillDirPath =
|
|
18132
|
+
const skillDirPath = join107(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
17743
18133
|
throw new Error(
|
|
17744
|
-
`Invalid frontmatter in ${
|
|
18134
|
+
`Invalid frontmatter in ${join107(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
17745
18135
|
);
|
|
17746
18136
|
}
|
|
17747
18137
|
return new _ReplitSkill({
|
|
@@ -17776,7 +18166,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
17776
18166
|
};
|
|
17777
18167
|
|
|
17778
18168
|
// src/features/skills/roo-skill.ts
|
|
17779
|
-
import { join as
|
|
18169
|
+
import { join as join108 } from "path";
|
|
17780
18170
|
import { z as z57 } from "zod/mini";
|
|
17781
18171
|
var RooSkillFrontmatterSchema = z57.looseObject({
|
|
17782
18172
|
name: z57.string(),
|
|
@@ -17785,7 +18175,7 @@ var RooSkillFrontmatterSchema = z57.looseObject({
|
|
|
17785
18175
|
var RooSkill = class _RooSkill extends ToolSkill {
|
|
17786
18176
|
constructor({
|
|
17787
18177
|
outputRoot = process.cwd(),
|
|
17788
|
-
relativeDirPath =
|
|
18178
|
+
relativeDirPath = join108(".roo", "skills"),
|
|
17789
18179
|
dirName,
|
|
17790
18180
|
frontmatter,
|
|
17791
18181
|
body,
|
|
@@ -17816,7 +18206,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
17816
18206
|
global: _global = false
|
|
17817
18207
|
} = {}) {
|
|
17818
18208
|
return {
|
|
17819
|
-
relativeDirPath:
|
|
18209
|
+
relativeDirPath: join108(".roo", "skills")
|
|
17820
18210
|
};
|
|
17821
18211
|
}
|
|
17822
18212
|
getFrontmatter() {
|
|
@@ -17904,13 +18294,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
17904
18294
|
});
|
|
17905
18295
|
const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
17906
18296
|
if (!result.success) {
|
|
17907
|
-
const skillDirPath =
|
|
18297
|
+
const skillDirPath = join108(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
17908
18298
|
throw new Error(
|
|
17909
|
-
`Invalid frontmatter in ${
|
|
18299
|
+
`Invalid frontmatter in ${join108(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
17910
18300
|
);
|
|
17911
18301
|
}
|
|
17912
18302
|
if (result.data.name !== loaded.dirName) {
|
|
17913
|
-
const skillFilePath =
|
|
18303
|
+
const skillFilePath = join108(
|
|
17914
18304
|
loaded.outputRoot,
|
|
17915
18305
|
loaded.relativeDirPath,
|
|
17916
18306
|
loaded.dirName,
|
|
@@ -17951,14 +18341,14 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
17951
18341
|
};
|
|
17952
18342
|
|
|
17953
18343
|
// src/features/skills/skills-utils.ts
|
|
17954
|
-
import { basename as basename5, join as
|
|
18344
|
+
import { basename as basename5, join as join109 } from "path";
|
|
17955
18345
|
async function getLocalSkillDirNames(outputRoot) {
|
|
17956
|
-
const skillsDir =
|
|
18346
|
+
const skillsDir = join109(outputRoot, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
|
|
17957
18347
|
const names = /* @__PURE__ */ new Set();
|
|
17958
18348
|
if (!await directoryExists(skillsDir)) {
|
|
17959
18349
|
return names;
|
|
17960
18350
|
}
|
|
17961
|
-
const dirPaths = await findFilesByGlobs(
|
|
18351
|
+
const dirPaths = await findFilesByGlobs(join109(skillsDir, "*"), { type: "dir" });
|
|
17962
18352
|
for (const dirPath of dirPaths) {
|
|
17963
18353
|
const name = basename5(dirPath);
|
|
17964
18354
|
if (name === basename5(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
|
|
@@ -17968,7 +18358,7 @@ async function getLocalSkillDirNames(outputRoot) {
|
|
|
17968
18358
|
}
|
|
17969
18359
|
|
|
17970
18360
|
// src/features/skills/takt-skill.ts
|
|
17971
|
-
import path3, { join as
|
|
18361
|
+
import path3, { join as join110, relative as relative5, resolve as resolve6 } from "path";
|
|
17972
18362
|
var DEFAULT_TAKT_SKILL_DIR = "knowledge";
|
|
17973
18363
|
var TaktSkill = class _TaktSkill extends ToolSkill {
|
|
17974
18364
|
fileName;
|
|
@@ -18005,7 +18395,7 @@ var TaktSkill = class _TaktSkill extends ToolSkill {
|
|
|
18005
18395
|
}
|
|
18006
18396
|
static getSettablePaths(_options = {}) {
|
|
18007
18397
|
return {
|
|
18008
|
-
relativeDirPath:
|
|
18398
|
+
relativeDirPath: join110(".takt", "facets", DEFAULT_TAKT_SKILL_DIR)
|
|
18009
18399
|
};
|
|
18010
18400
|
}
|
|
18011
18401
|
/**
|
|
@@ -18016,7 +18406,7 @@ var TaktSkill = class _TaktSkill extends ToolSkill {
|
|
|
18016
18406
|
* malicious `relativeDirPath` cannot escape `outputRoot`.
|
|
18017
18407
|
*/
|
|
18018
18408
|
getDirPath() {
|
|
18019
|
-
const fullPath =
|
|
18409
|
+
const fullPath = join110(this.outputRoot, this.relativeDirPath);
|
|
18020
18410
|
const resolvedFull = resolve6(fullPath);
|
|
18021
18411
|
const resolvedBase = resolve6(this.outputRoot);
|
|
18022
18412
|
const rel = relative5(resolvedBase, resolvedFull);
|
|
@@ -18057,7 +18447,7 @@ var TaktSkill = class _TaktSkill extends ToolSkill {
|
|
|
18057
18447
|
const stem = overrideName ?? rulesyncSkill.getDirName();
|
|
18058
18448
|
assertSafeTaktName({ name: stem, featureLabel: "skill", sourceLabel });
|
|
18059
18449
|
const fileName = `${stem}.md`;
|
|
18060
|
-
const relativeDirPath =
|
|
18450
|
+
const relativeDirPath = join110(".takt", "facets", DEFAULT_TAKT_SKILL_DIR);
|
|
18061
18451
|
return new _TaktSkill({
|
|
18062
18452
|
outputRoot,
|
|
18063
18453
|
relativeDirPath,
|
|
@@ -18107,7 +18497,7 @@ var TaktSkill = class _TaktSkill extends ToolSkill {
|
|
|
18107
18497
|
};
|
|
18108
18498
|
|
|
18109
18499
|
// src/features/skills/windsurf-skill.ts
|
|
18110
|
-
import { join as
|
|
18500
|
+
import { join as join111 } from "path";
|
|
18111
18501
|
import { z as z58 } from "zod/mini";
|
|
18112
18502
|
var WindsurfSkillFrontmatterSchema = z58.looseObject({
|
|
18113
18503
|
name: z58.string(),
|
|
@@ -18146,11 +18536,11 @@ var WindsurfSkill = class _WindsurfSkill extends ToolSkill {
|
|
|
18146
18536
|
static getSettablePaths({ global = false } = {}) {
|
|
18147
18537
|
if (global) {
|
|
18148
18538
|
return {
|
|
18149
|
-
relativeDirPath:
|
|
18539
|
+
relativeDirPath: join111(".codeium", "windsurf", "skills")
|
|
18150
18540
|
};
|
|
18151
18541
|
}
|
|
18152
18542
|
return {
|
|
18153
|
-
relativeDirPath:
|
|
18543
|
+
relativeDirPath: join111(".windsurf", "skills")
|
|
18154
18544
|
};
|
|
18155
18545
|
}
|
|
18156
18546
|
getFrontmatter() {
|
|
@@ -18230,9 +18620,9 @@ var WindsurfSkill = class _WindsurfSkill extends ToolSkill {
|
|
|
18230
18620
|
});
|
|
18231
18621
|
const result = WindsurfSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
18232
18622
|
if (!result.success) {
|
|
18233
|
-
const skillDirPath =
|
|
18623
|
+
const skillDirPath = join111(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
18234
18624
|
throw new Error(
|
|
18235
|
-
`Invalid frontmatter in ${
|
|
18625
|
+
`Invalid frontmatter in ${join111(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
18236
18626
|
);
|
|
18237
18627
|
}
|
|
18238
18628
|
return new _WindsurfSkill({
|
|
@@ -18267,7 +18657,7 @@ var WindsurfSkill = class _WindsurfSkill extends ToolSkill {
|
|
|
18267
18657
|
};
|
|
18268
18658
|
|
|
18269
18659
|
// src/features/skills/zed-skill.ts
|
|
18270
|
-
import { join as
|
|
18660
|
+
import { join as join112 } from "path";
|
|
18271
18661
|
import { z as z59 } from "zod/mini";
|
|
18272
18662
|
var ZedSkillFrontmatterSchema = z59.looseObject({
|
|
18273
18663
|
name: z59.string(),
|
|
@@ -18277,7 +18667,7 @@ var ZedSkillFrontmatterSchema = z59.looseObject({
|
|
|
18277
18667
|
var ZedSkill = class _ZedSkill extends ToolSkill {
|
|
18278
18668
|
constructor({
|
|
18279
18669
|
outputRoot = process.cwd(),
|
|
18280
|
-
relativeDirPath =
|
|
18670
|
+
relativeDirPath = join112(".agents", "skills"),
|
|
18281
18671
|
dirName,
|
|
18282
18672
|
frontmatter,
|
|
18283
18673
|
body,
|
|
@@ -18306,7 +18696,7 @@ var ZedSkill = class _ZedSkill extends ToolSkill {
|
|
|
18306
18696
|
}
|
|
18307
18697
|
static getSettablePaths(_options) {
|
|
18308
18698
|
return {
|
|
18309
|
-
relativeDirPath:
|
|
18699
|
+
relativeDirPath: join112(".agents", "skills")
|
|
18310
18700
|
};
|
|
18311
18701
|
}
|
|
18312
18702
|
getFrontmatter() {
|
|
@@ -18385,9 +18775,9 @@ var ZedSkill = class _ZedSkill extends ToolSkill {
|
|
|
18385
18775
|
});
|
|
18386
18776
|
const result = ZedSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
18387
18777
|
if (!result.success) {
|
|
18388
|
-
const skillDirPath =
|
|
18778
|
+
const skillDirPath = join112(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
18389
18779
|
throw new Error(
|
|
18390
|
-
`Invalid frontmatter in ${
|
|
18780
|
+
`Invalid frontmatter in ${join112(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
18391
18781
|
);
|
|
18392
18782
|
}
|
|
18393
18783
|
return new _ZedSkill({
|
|
@@ -18721,10 +19111,10 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
18721
19111
|
)
|
|
18722
19112
|
);
|
|
18723
19113
|
const localSkillNames = new Set(localDirNames);
|
|
18724
|
-
const curatedDirPath =
|
|
19114
|
+
const curatedDirPath = join113(this.inputRoot, RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
|
|
18725
19115
|
let curatedSkills = [];
|
|
18726
19116
|
if (await directoryExists(curatedDirPath)) {
|
|
18727
|
-
const curatedDirPaths = await findFilesByGlobs(
|
|
19117
|
+
const curatedDirPaths = await findFilesByGlobs(join113(curatedDirPath, "*"), { type: "dir" });
|
|
18728
19118
|
const curatedDirNames = curatedDirPaths.map((path4) => basename6(path4));
|
|
18729
19119
|
const nonConflicting = curatedDirNames.filter((name) => {
|
|
18730
19120
|
if (localSkillNames.has(name)) {
|
|
@@ -18762,11 +19152,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
18762
19152
|
const seenDirNames = /* @__PURE__ */ new Set();
|
|
18763
19153
|
const loadEntries = [];
|
|
18764
19154
|
for (const root of roots) {
|
|
18765
|
-
const skillsDirPath =
|
|
19155
|
+
const skillsDirPath = join113(this.outputRoot, root);
|
|
18766
19156
|
if (!await directoryExists(skillsDirPath)) {
|
|
18767
19157
|
continue;
|
|
18768
19158
|
}
|
|
18769
|
-
const dirPaths = await findFilesByGlobs(
|
|
19159
|
+
const dirPaths = await findFilesByGlobs(join113(skillsDirPath, "*"), { type: "dir" });
|
|
18770
19160
|
for (const dirPath of dirPaths) {
|
|
18771
19161
|
const dirName = basename6(dirPath);
|
|
18772
19162
|
if (seenDirNames.has(dirName)) {
|
|
@@ -18797,11 +19187,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
18797
19187
|
const roots = toolSkillSearchRoots(paths);
|
|
18798
19188
|
const toolSkills = [];
|
|
18799
19189
|
for (const root of roots) {
|
|
18800
|
-
const skillsDirPath =
|
|
19190
|
+
const skillsDirPath = join113(this.outputRoot, root);
|
|
18801
19191
|
if (!await directoryExists(skillsDirPath)) {
|
|
18802
19192
|
continue;
|
|
18803
19193
|
}
|
|
18804
|
-
const dirPaths = await findFilesByGlobs(
|
|
19194
|
+
const dirPaths = await findFilesByGlobs(join113(skillsDirPath, "*"), { type: "dir" });
|
|
18805
19195
|
for (const dirPath of dirPaths) {
|
|
18806
19196
|
const dirName = basename6(dirPath);
|
|
18807
19197
|
const toolSkill = factory.class.forDeletion({
|
|
@@ -18865,10 +19255,10 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
18865
19255
|
};
|
|
18866
19256
|
|
|
18867
19257
|
// src/features/subagents/agentsmd-subagent.ts
|
|
18868
|
-
import { join as
|
|
19258
|
+
import { join as join115 } from "path";
|
|
18869
19259
|
|
|
18870
19260
|
// src/features/subagents/simulated-subagent.ts
|
|
18871
|
-
import { basename as basename7, join as
|
|
19261
|
+
import { basename as basename7, join as join114 } from "path";
|
|
18872
19262
|
import { z as z61 } from "zod/mini";
|
|
18873
19263
|
|
|
18874
19264
|
// src/features/subagents/tool-subagent.ts
|
|
@@ -18933,7 +19323,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
18933
19323
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
18934
19324
|
if (!result.success) {
|
|
18935
19325
|
throw new Error(
|
|
18936
|
-
`Invalid frontmatter in ${
|
|
19326
|
+
`Invalid frontmatter in ${join114(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
18937
19327
|
);
|
|
18938
19328
|
}
|
|
18939
19329
|
}
|
|
@@ -18984,7 +19374,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
18984
19374
|
return {
|
|
18985
19375
|
success: false,
|
|
18986
19376
|
error: new Error(
|
|
18987
|
-
`Invalid frontmatter in ${
|
|
19377
|
+
`Invalid frontmatter in ${join114(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
18988
19378
|
)
|
|
18989
19379
|
};
|
|
18990
19380
|
}
|
|
@@ -18994,7 +19384,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
18994
19384
|
relativeFilePath,
|
|
18995
19385
|
validate = true
|
|
18996
19386
|
}) {
|
|
18997
|
-
const filePath =
|
|
19387
|
+
const filePath = join114(outputRoot, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
18998
19388
|
const fileContent = await readFileContent(filePath);
|
|
18999
19389
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
19000
19390
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -19030,7 +19420,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
19030
19420
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
19031
19421
|
static getSettablePaths() {
|
|
19032
19422
|
return {
|
|
19033
|
-
relativeDirPath:
|
|
19423
|
+
relativeDirPath: join115(".agents", "subagents")
|
|
19034
19424
|
};
|
|
19035
19425
|
}
|
|
19036
19426
|
static async fromFile(params) {
|
|
@@ -19053,11 +19443,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
19053
19443
|
};
|
|
19054
19444
|
|
|
19055
19445
|
// src/features/subagents/factorydroid-subagent.ts
|
|
19056
|
-
import { join as
|
|
19446
|
+
import { join as join116 } from "path";
|
|
19057
19447
|
var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
|
|
19058
19448
|
static getSettablePaths(_options) {
|
|
19059
19449
|
return {
|
|
19060
|
-
relativeDirPath:
|
|
19450
|
+
relativeDirPath: join116(".factory", "droids")
|
|
19061
19451
|
};
|
|
19062
19452
|
}
|
|
19063
19453
|
static async fromFile(params) {
|
|
@@ -19080,11 +19470,11 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
|
|
|
19080
19470
|
};
|
|
19081
19471
|
|
|
19082
19472
|
// src/features/subagents/geminicli-subagent.ts
|
|
19083
|
-
import { join as
|
|
19473
|
+
import { join as join118 } from "path";
|
|
19084
19474
|
import { z as z63 } from "zod/mini";
|
|
19085
19475
|
|
|
19086
19476
|
// src/features/subagents/rulesync-subagent.ts
|
|
19087
|
-
import { basename as basename8, join as
|
|
19477
|
+
import { basename as basename8, join as join117 } from "path";
|
|
19088
19478
|
import { z as z62 } from "zod/mini";
|
|
19089
19479
|
var RulesyncSubagentFrontmatterSchema = z62.looseObject({
|
|
19090
19480
|
targets: z62._default(RulesyncTargetsSchema, ["*"]),
|
|
@@ -19103,7 +19493,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
19103
19493
|
const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
19104
19494
|
if (!parseResult.success && rest.validate !== false) {
|
|
19105
19495
|
throw new Error(
|
|
19106
|
-
`Invalid frontmatter in ${
|
|
19496
|
+
`Invalid frontmatter in ${join117(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
19107
19497
|
);
|
|
19108
19498
|
}
|
|
19109
19499
|
const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
|
|
@@ -19136,7 +19526,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
19136
19526
|
return {
|
|
19137
19527
|
success: false,
|
|
19138
19528
|
error: new Error(
|
|
19139
|
-
`Invalid frontmatter in ${
|
|
19529
|
+
`Invalid frontmatter in ${join117(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
19140
19530
|
)
|
|
19141
19531
|
};
|
|
19142
19532
|
}
|
|
@@ -19145,7 +19535,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
19145
19535
|
outputRoot = process.cwd(),
|
|
19146
19536
|
relativeFilePath
|
|
19147
19537
|
}) {
|
|
19148
|
-
const filePath =
|
|
19538
|
+
const filePath = join117(outputRoot, RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
|
|
19149
19539
|
const fileContent = await readFileContent(filePath);
|
|
19150
19540
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
19151
19541
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -19176,7 +19566,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
19176
19566
|
const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
19177
19567
|
if (!result.success) {
|
|
19178
19568
|
throw new Error(
|
|
19179
|
-
`Invalid frontmatter in ${
|
|
19569
|
+
`Invalid frontmatter in ${join118(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
19180
19570
|
);
|
|
19181
19571
|
}
|
|
19182
19572
|
}
|
|
@@ -19189,7 +19579,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
19189
19579
|
}
|
|
19190
19580
|
static getSettablePaths(_options = {}) {
|
|
19191
19581
|
return {
|
|
19192
|
-
relativeDirPath:
|
|
19582
|
+
relativeDirPath: join118(".gemini", "agents")
|
|
19193
19583
|
};
|
|
19194
19584
|
}
|
|
19195
19585
|
getFrontmatter() {
|
|
@@ -19257,7 +19647,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
19257
19647
|
return {
|
|
19258
19648
|
success: false,
|
|
19259
19649
|
error: new Error(
|
|
19260
|
-
`Invalid frontmatter in ${
|
|
19650
|
+
`Invalid frontmatter in ${join118(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
19261
19651
|
)
|
|
19262
19652
|
};
|
|
19263
19653
|
}
|
|
@@ -19275,7 +19665,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
19275
19665
|
global = false
|
|
19276
19666
|
}) {
|
|
19277
19667
|
const paths = this.getSettablePaths({ global });
|
|
19278
|
-
const filePath =
|
|
19668
|
+
const filePath = join118(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
19279
19669
|
const fileContent = await readFileContent(filePath);
|
|
19280
19670
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
19281
19671
|
const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -19311,11 +19701,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
19311
19701
|
};
|
|
19312
19702
|
|
|
19313
19703
|
// src/features/subagents/roo-subagent.ts
|
|
19314
|
-
import { join as
|
|
19704
|
+
import { join as join119 } from "path";
|
|
19315
19705
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
19316
19706
|
static getSettablePaths() {
|
|
19317
19707
|
return {
|
|
19318
|
-
relativeDirPath:
|
|
19708
|
+
relativeDirPath: join119(".roo", "subagents")
|
|
19319
19709
|
};
|
|
19320
19710
|
}
|
|
19321
19711
|
static async fromFile(params) {
|
|
@@ -19338,7 +19728,7 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
19338
19728
|
};
|
|
19339
19729
|
|
|
19340
19730
|
// src/features/subagents/rovodev-subagent.ts
|
|
19341
|
-
import { join as
|
|
19731
|
+
import { join as join120 } from "path";
|
|
19342
19732
|
import { z as z64 } from "zod/mini";
|
|
19343
19733
|
var RovodevSubagentFrontmatterSchema = z64.looseObject({
|
|
19344
19734
|
name: z64.string(),
|
|
@@ -19352,7 +19742,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
19352
19742
|
const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
19353
19743
|
if (!result.success) {
|
|
19354
19744
|
throw new Error(
|
|
19355
|
-
`Invalid frontmatter in ${
|
|
19745
|
+
`Invalid frontmatter in ${join120(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
19356
19746
|
);
|
|
19357
19747
|
}
|
|
19358
19748
|
}
|
|
@@ -19364,7 +19754,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
19364
19754
|
}
|
|
19365
19755
|
static getSettablePaths(_options = {}) {
|
|
19366
19756
|
return {
|
|
19367
|
-
relativeDirPath:
|
|
19757
|
+
relativeDirPath: join120(".rovodev", "subagents")
|
|
19368
19758
|
};
|
|
19369
19759
|
}
|
|
19370
19760
|
getFrontmatter() {
|
|
@@ -19427,7 +19817,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
19427
19817
|
return {
|
|
19428
19818
|
success: false,
|
|
19429
19819
|
error: new Error(
|
|
19430
|
-
`Invalid frontmatter in ${
|
|
19820
|
+
`Invalid frontmatter in ${join120(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
19431
19821
|
)
|
|
19432
19822
|
};
|
|
19433
19823
|
}
|
|
@@ -19444,7 +19834,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
19444
19834
|
global = false
|
|
19445
19835
|
}) {
|
|
19446
19836
|
const paths = this.getSettablePaths({ global });
|
|
19447
|
-
const filePath =
|
|
19837
|
+
const filePath = join120(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
19448
19838
|
const fileContent = await readFileContent(filePath);
|
|
19449
19839
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
19450
19840
|
const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -19483,11 +19873,11 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
19483
19873
|
};
|
|
19484
19874
|
|
|
19485
19875
|
// src/features/subagents/subagents-processor.ts
|
|
19486
|
-
import { basename as basename10, join as
|
|
19876
|
+
import { basename as basename10, join as join133 } from "path";
|
|
19487
19877
|
import { z as z75 } from "zod/mini";
|
|
19488
19878
|
|
|
19489
19879
|
// src/features/subagents/claudecode-subagent.ts
|
|
19490
|
-
import { join as
|
|
19880
|
+
import { join as join121 } from "path";
|
|
19491
19881
|
import { z as z65 } from "zod/mini";
|
|
19492
19882
|
var ClaudecodeSubagentFrontmatterSchema = z65.looseObject({
|
|
19493
19883
|
name: z65.string(),
|
|
@@ -19505,7 +19895,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
19505
19895
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
19506
19896
|
if (!result.success) {
|
|
19507
19897
|
throw new Error(
|
|
19508
|
-
`Invalid frontmatter in ${
|
|
19898
|
+
`Invalid frontmatter in ${join121(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
19509
19899
|
);
|
|
19510
19900
|
}
|
|
19511
19901
|
}
|
|
@@ -19517,7 +19907,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
19517
19907
|
}
|
|
19518
19908
|
static getSettablePaths(_options = {}) {
|
|
19519
19909
|
return {
|
|
19520
|
-
relativeDirPath:
|
|
19910
|
+
relativeDirPath: join121(".claude", "agents")
|
|
19521
19911
|
};
|
|
19522
19912
|
}
|
|
19523
19913
|
getFrontmatter() {
|
|
@@ -19596,7 +19986,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
19596
19986
|
return {
|
|
19597
19987
|
success: false,
|
|
19598
19988
|
error: new Error(
|
|
19599
|
-
`Invalid frontmatter in ${
|
|
19989
|
+
`Invalid frontmatter in ${join121(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
19600
19990
|
)
|
|
19601
19991
|
};
|
|
19602
19992
|
}
|
|
@@ -19614,7 +20004,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
19614
20004
|
global = false
|
|
19615
20005
|
}) {
|
|
19616
20006
|
const paths = this.getSettablePaths({ global });
|
|
19617
|
-
const filePath =
|
|
20007
|
+
const filePath = join121(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
19618
20008
|
const fileContent = await readFileContent(filePath);
|
|
19619
20009
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
19620
20010
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -19649,7 +20039,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
19649
20039
|
};
|
|
19650
20040
|
|
|
19651
20041
|
// src/features/subagents/codexcli-subagent.ts
|
|
19652
|
-
import { join as
|
|
20042
|
+
import { join as join122 } from "path";
|
|
19653
20043
|
import * as smolToml6 from "smol-toml";
|
|
19654
20044
|
import { z as z66 } from "zod/mini";
|
|
19655
20045
|
var CodexCliSubagentTomlSchema = z66.looseObject({
|
|
@@ -19680,7 +20070,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
19680
20070
|
CodexCliSubagentTomlSchema.parse(parsed);
|
|
19681
20071
|
} catch (error) {
|
|
19682
20072
|
throw new Error(
|
|
19683
|
-
`Invalid TOML in ${
|
|
20073
|
+
`Invalid TOML in ${join122(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
19684
20074
|
{ cause: error }
|
|
19685
20075
|
);
|
|
19686
20076
|
}
|
|
@@ -19692,7 +20082,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
19692
20082
|
}
|
|
19693
20083
|
static getSettablePaths(_options = {}) {
|
|
19694
20084
|
return {
|
|
19695
|
-
relativeDirPath:
|
|
20085
|
+
relativeDirPath: join122(".codex", "agents")
|
|
19696
20086
|
};
|
|
19697
20087
|
}
|
|
19698
20088
|
getBody() {
|
|
@@ -19704,7 +20094,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
19704
20094
|
parsed = CodexCliSubagentTomlSchema.parse(smolToml6.parse(this.body));
|
|
19705
20095
|
} catch (error) {
|
|
19706
20096
|
throw new Error(
|
|
19707
|
-
`Failed to parse TOML in ${
|
|
20097
|
+
`Failed to parse TOML in ${join122(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
19708
20098
|
{ cause: error }
|
|
19709
20099
|
);
|
|
19710
20100
|
}
|
|
@@ -19785,7 +20175,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
19785
20175
|
global = false
|
|
19786
20176
|
}) {
|
|
19787
20177
|
const paths = this.getSettablePaths({ global });
|
|
19788
|
-
const filePath =
|
|
20178
|
+
const filePath = join122(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
19789
20179
|
const fileContent = await readFileContent(filePath);
|
|
19790
20180
|
const subagent = new _CodexCliSubagent({
|
|
19791
20181
|
outputRoot,
|
|
@@ -19823,7 +20213,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
19823
20213
|
};
|
|
19824
20214
|
|
|
19825
20215
|
// src/features/subagents/copilot-subagent.ts
|
|
19826
|
-
import { join as
|
|
20216
|
+
import { join as join123 } from "path";
|
|
19827
20217
|
import { z as z67 } from "zod/mini";
|
|
19828
20218
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
19829
20219
|
var CopilotSubagentFrontmatterSchema = z67.looseObject({
|
|
@@ -19864,7 +20254,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
19864
20254
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
19865
20255
|
if (!result.success) {
|
|
19866
20256
|
throw new Error(
|
|
19867
|
-
`Invalid frontmatter in ${
|
|
20257
|
+
`Invalid frontmatter in ${join123(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
19868
20258
|
);
|
|
19869
20259
|
}
|
|
19870
20260
|
}
|
|
@@ -19876,7 +20266,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
19876
20266
|
}
|
|
19877
20267
|
static getSettablePaths(_options = {}) {
|
|
19878
20268
|
return {
|
|
19879
|
-
relativeDirPath:
|
|
20269
|
+
relativeDirPath: join123(".github", "agents")
|
|
19880
20270
|
};
|
|
19881
20271
|
}
|
|
19882
20272
|
getFrontmatter() {
|
|
@@ -19950,7 +20340,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
19950
20340
|
return {
|
|
19951
20341
|
success: false,
|
|
19952
20342
|
error: new Error(
|
|
19953
|
-
`Invalid frontmatter in ${
|
|
20343
|
+
`Invalid frontmatter in ${join123(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
19954
20344
|
)
|
|
19955
20345
|
};
|
|
19956
20346
|
}
|
|
@@ -19968,7 +20358,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
19968
20358
|
global = false
|
|
19969
20359
|
}) {
|
|
19970
20360
|
const paths = this.getSettablePaths({ global });
|
|
19971
|
-
const filePath =
|
|
20361
|
+
const filePath = join123(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
19972
20362
|
const fileContent = await readFileContent(filePath);
|
|
19973
20363
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
19974
20364
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -20004,7 +20394,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
20004
20394
|
};
|
|
20005
20395
|
|
|
20006
20396
|
// src/features/subagents/copilotcli-subagent.ts
|
|
20007
|
-
import { join as
|
|
20397
|
+
import { join as join124 } from "path";
|
|
20008
20398
|
import { z as z68 } from "zod/mini";
|
|
20009
20399
|
var CopilotCliSubagentFrontmatterSchema = z68.looseObject({
|
|
20010
20400
|
description: z68.string(),
|
|
@@ -20040,7 +20430,7 @@ var CopilotcliSubagent = class _CopilotcliSubagent extends ToolSubagent {
|
|
|
20040
20430
|
const result = CopilotCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
20041
20431
|
if (!result.success) {
|
|
20042
20432
|
throw new Error(
|
|
20043
|
-
`Invalid frontmatter in ${
|
|
20433
|
+
`Invalid frontmatter in ${join124(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
20044
20434
|
);
|
|
20045
20435
|
}
|
|
20046
20436
|
}
|
|
@@ -20052,9 +20442,9 @@ var CopilotcliSubagent = class _CopilotcliSubagent extends ToolSubagent {
|
|
|
20052
20442
|
global = false
|
|
20053
20443
|
} = {}) {
|
|
20054
20444
|
if (global) {
|
|
20055
|
-
return { relativeDirPath:
|
|
20445
|
+
return { relativeDirPath: join124(".copilot", "agents") };
|
|
20056
20446
|
}
|
|
20057
|
-
return { relativeDirPath:
|
|
20447
|
+
return { relativeDirPath: join124(".github", "agents") };
|
|
20058
20448
|
}
|
|
20059
20449
|
getFrontmatter() {
|
|
20060
20450
|
return this.frontmatter;
|
|
@@ -20132,7 +20522,7 @@ var CopilotcliSubagent = class _CopilotcliSubagent extends ToolSubagent {
|
|
|
20132
20522
|
return {
|
|
20133
20523
|
success: false,
|
|
20134
20524
|
error: new Error(
|
|
20135
|
-
`Invalid frontmatter in ${
|
|
20525
|
+
`Invalid frontmatter in ${join124(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
20136
20526
|
)
|
|
20137
20527
|
};
|
|
20138
20528
|
}
|
|
@@ -20149,7 +20539,7 @@ var CopilotcliSubagent = class _CopilotcliSubagent extends ToolSubagent {
|
|
|
20149
20539
|
global = false
|
|
20150
20540
|
}) {
|
|
20151
20541
|
const paths = this.getSettablePaths({ global });
|
|
20152
|
-
const filePath =
|
|
20542
|
+
const filePath = join124(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
20153
20543
|
const fileContent = await readFileContent(filePath);
|
|
20154
20544
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
20155
20545
|
const result = CopilotCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -20185,7 +20575,7 @@ var CopilotcliSubagent = class _CopilotcliSubagent extends ToolSubagent {
|
|
|
20185
20575
|
};
|
|
20186
20576
|
|
|
20187
20577
|
// src/features/subagents/cursor-subagent.ts
|
|
20188
|
-
import { join as
|
|
20578
|
+
import { join as join125 } from "path";
|
|
20189
20579
|
import { z as z69 } from "zod/mini";
|
|
20190
20580
|
var CursorSubagentFrontmatterSchema = z69.looseObject({
|
|
20191
20581
|
name: z69.string(),
|
|
@@ -20199,7 +20589,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
20199
20589
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
20200
20590
|
if (!result.success) {
|
|
20201
20591
|
throw new Error(
|
|
20202
|
-
`Invalid frontmatter in ${
|
|
20592
|
+
`Invalid frontmatter in ${join125(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
20203
20593
|
);
|
|
20204
20594
|
}
|
|
20205
20595
|
}
|
|
@@ -20211,7 +20601,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
20211
20601
|
}
|
|
20212
20602
|
static getSettablePaths(_options = {}) {
|
|
20213
20603
|
return {
|
|
20214
|
-
relativeDirPath:
|
|
20604
|
+
relativeDirPath: join125(".cursor", "agents")
|
|
20215
20605
|
};
|
|
20216
20606
|
}
|
|
20217
20607
|
getFrontmatter() {
|
|
@@ -20278,7 +20668,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
20278
20668
|
return {
|
|
20279
20669
|
success: false,
|
|
20280
20670
|
error: new Error(
|
|
20281
|
-
`Invalid frontmatter in ${
|
|
20671
|
+
`Invalid frontmatter in ${join125(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
20282
20672
|
)
|
|
20283
20673
|
};
|
|
20284
20674
|
}
|
|
@@ -20296,7 +20686,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
20296
20686
|
global = false
|
|
20297
20687
|
}) {
|
|
20298
20688
|
const paths = this.getSettablePaths({ global });
|
|
20299
|
-
const filePath =
|
|
20689
|
+
const filePath = join125(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
20300
20690
|
const fileContent = await readFileContent(filePath);
|
|
20301
20691
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
20302
20692
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -20332,7 +20722,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
20332
20722
|
};
|
|
20333
20723
|
|
|
20334
20724
|
// src/features/subagents/deepagents-subagent.ts
|
|
20335
|
-
import { join as
|
|
20725
|
+
import { join as join126 } from "path";
|
|
20336
20726
|
import { z as z70 } from "zod/mini";
|
|
20337
20727
|
var DeepagentsSubagentFrontmatterSchema = z70.looseObject({
|
|
20338
20728
|
name: z70.string(),
|
|
@@ -20347,7 +20737,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
20347
20737
|
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
20348
20738
|
if (!result.success) {
|
|
20349
20739
|
throw new Error(
|
|
20350
|
-
`Invalid frontmatter in ${
|
|
20740
|
+
`Invalid frontmatter in ${join126(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
20351
20741
|
);
|
|
20352
20742
|
}
|
|
20353
20743
|
}
|
|
@@ -20357,7 +20747,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
20357
20747
|
}
|
|
20358
20748
|
static getSettablePaths(_options = {}) {
|
|
20359
20749
|
return {
|
|
20360
|
-
relativeDirPath:
|
|
20750
|
+
relativeDirPath: join126(".deepagents", "agents")
|
|
20361
20751
|
};
|
|
20362
20752
|
}
|
|
20363
20753
|
getFrontmatter() {
|
|
@@ -20432,7 +20822,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
20432
20822
|
return {
|
|
20433
20823
|
success: false,
|
|
20434
20824
|
error: new Error(
|
|
20435
|
-
`Invalid frontmatter in ${
|
|
20825
|
+
`Invalid frontmatter in ${join126(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
20436
20826
|
)
|
|
20437
20827
|
};
|
|
20438
20828
|
}
|
|
@@ -20450,7 +20840,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
20450
20840
|
global = false
|
|
20451
20841
|
}) {
|
|
20452
20842
|
const paths = this.getSettablePaths({ global });
|
|
20453
|
-
const filePath =
|
|
20843
|
+
const filePath = join126(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
20454
20844
|
const fileContent = await readFileContent(filePath);
|
|
20455
20845
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
20456
20846
|
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -20485,7 +20875,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
20485
20875
|
};
|
|
20486
20876
|
|
|
20487
20877
|
// src/features/subagents/junie-subagent.ts
|
|
20488
|
-
import { join as
|
|
20878
|
+
import { join as join127 } from "path";
|
|
20489
20879
|
import { z as z71 } from "zod/mini";
|
|
20490
20880
|
var JunieSubagentFrontmatterSchema = z71.looseObject({
|
|
20491
20881
|
name: z71.optional(z71.string()),
|
|
@@ -20499,7 +20889,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
20499
20889
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
20500
20890
|
if (!result.success) {
|
|
20501
20891
|
throw new Error(
|
|
20502
|
-
`Invalid frontmatter in ${
|
|
20892
|
+
`Invalid frontmatter in ${join127(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
20503
20893
|
);
|
|
20504
20894
|
}
|
|
20505
20895
|
}
|
|
@@ -20514,7 +20904,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
20514
20904
|
throw new Error("JunieSubagent does not support global mode.");
|
|
20515
20905
|
}
|
|
20516
20906
|
return {
|
|
20517
|
-
relativeDirPath:
|
|
20907
|
+
relativeDirPath: join127(".junie", "agents")
|
|
20518
20908
|
};
|
|
20519
20909
|
}
|
|
20520
20910
|
getFrontmatter() {
|
|
@@ -20590,7 +20980,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
20590
20980
|
return {
|
|
20591
20981
|
success: false,
|
|
20592
20982
|
error: new Error(
|
|
20593
|
-
`Invalid frontmatter in ${
|
|
20983
|
+
`Invalid frontmatter in ${join127(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
20594
20984
|
)
|
|
20595
20985
|
};
|
|
20596
20986
|
}
|
|
@@ -20608,7 +20998,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
20608
20998
|
global = false
|
|
20609
20999
|
}) {
|
|
20610
21000
|
const paths = this.getSettablePaths({ global });
|
|
20611
|
-
const filePath =
|
|
21001
|
+
const filePath = join127(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
20612
21002
|
const fileContent = await readFileContent(filePath);
|
|
20613
21003
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
20614
21004
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -20643,11 +21033,11 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
20643
21033
|
};
|
|
20644
21034
|
|
|
20645
21035
|
// src/features/subagents/kilo-subagent.ts
|
|
20646
|
-
import { join as
|
|
21036
|
+
import { join as join129 } from "path";
|
|
20647
21037
|
import { z as z73 } from "zod/mini";
|
|
20648
21038
|
|
|
20649
21039
|
// src/features/subagents/opencode-style-subagent.ts
|
|
20650
|
-
import { basename as basename9, join as
|
|
21040
|
+
import { basename as basename9, join as join128 } from "path";
|
|
20651
21041
|
import { z as z72 } from "zod/mini";
|
|
20652
21042
|
var OpenCodeStyleSubagentFrontmatterSchema = z72.looseObject({
|
|
20653
21043
|
description: z72.optional(z72.string()),
|
|
@@ -20662,7 +21052,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
20662
21052
|
const result = OpenCodeStyleSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
20663
21053
|
if (!result.success) {
|
|
20664
21054
|
throw new Error(
|
|
20665
|
-
`Invalid frontmatter in ${
|
|
21055
|
+
`Invalid frontmatter in ${join128(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
20666
21056
|
);
|
|
20667
21057
|
}
|
|
20668
21058
|
}
|
|
@@ -20704,7 +21094,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
20704
21094
|
return {
|
|
20705
21095
|
success: false,
|
|
20706
21096
|
error: new Error(
|
|
20707
|
-
`Invalid frontmatter in ${
|
|
21097
|
+
`Invalid frontmatter in ${join128(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
20708
21098
|
)
|
|
20709
21099
|
};
|
|
20710
21100
|
}
|
|
@@ -20755,7 +21145,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
20755
21145
|
return {
|
|
20756
21146
|
success: false,
|
|
20757
21147
|
error: new Error(
|
|
20758
|
-
`Invalid frontmatter in ${
|
|
21148
|
+
`Invalid frontmatter in ${join129(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
20759
21149
|
)
|
|
20760
21150
|
};
|
|
20761
21151
|
}
|
|
@@ -20763,7 +21153,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
20763
21153
|
global = false
|
|
20764
21154
|
} = {}) {
|
|
20765
21155
|
return {
|
|
20766
|
-
relativeDirPath: global ?
|
|
21156
|
+
relativeDirPath: global ? join129(".config", "kilo", "agent") : join129(".kilo", "agent")
|
|
20767
21157
|
};
|
|
20768
21158
|
}
|
|
20769
21159
|
static fromRulesyncSubagent({
|
|
@@ -20812,7 +21202,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
20812
21202
|
global = false
|
|
20813
21203
|
}) {
|
|
20814
21204
|
const paths = this.getSettablePaths({ global });
|
|
20815
|
-
const filePath =
|
|
21205
|
+
const filePath = join129(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
20816
21206
|
const fileContent = await readFileContent(filePath);
|
|
20817
21207
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
20818
21208
|
const result = KiloSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -20850,7 +21240,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
20850
21240
|
};
|
|
20851
21241
|
|
|
20852
21242
|
// src/features/subagents/kiro-subagent.ts
|
|
20853
|
-
import { join as
|
|
21243
|
+
import { join as join130 } from "path";
|
|
20854
21244
|
import { z as z74 } from "zod/mini";
|
|
20855
21245
|
var KiroCliSubagentJsonSchema = z74.looseObject({
|
|
20856
21246
|
name: z74.string(),
|
|
@@ -20877,7 +21267,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
20877
21267
|
KiroCliSubagentJsonSchema.parse(parsed);
|
|
20878
21268
|
} catch (error) {
|
|
20879
21269
|
throw new Error(
|
|
20880
|
-
`Invalid JSON in ${
|
|
21270
|
+
`Invalid JSON in ${join130(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
20881
21271
|
{ cause: error }
|
|
20882
21272
|
);
|
|
20883
21273
|
}
|
|
@@ -20889,7 +21279,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
20889
21279
|
}
|
|
20890
21280
|
static getSettablePaths(_options = {}) {
|
|
20891
21281
|
return {
|
|
20892
|
-
relativeDirPath:
|
|
21282
|
+
relativeDirPath: join130(".kiro", "agents")
|
|
20893
21283
|
};
|
|
20894
21284
|
}
|
|
20895
21285
|
getBody() {
|
|
@@ -20901,7 +21291,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
20901
21291
|
parsed = JSON.parse(this.body);
|
|
20902
21292
|
} catch (error) {
|
|
20903
21293
|
throw new Error(
|
|
20904
|
-
`Failed to parse JSON in ${
|
|
21294
|
+
`Failed to parse JSON in ${join130(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
20905
21295
|
{ cause: error }
|
|
20906
21296
|
);
|
|
20907
21297
|
}
|
|
@@ -20982,7 +21372,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
20982
21372
|
global = false
|
|
20983
21373
|
}) {
|
|
20984
21374
|
const paths = this.getSettablePaths({ global });
|
|
20985
|
-
const filePath =
|
|
21375
|
+
const filePath = join130(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
20986
21376
|
const fileContent = await readFileContent(filePath);
|
|
20987
21377
|
const subagent = new _KiroSubagent({
|
|
20988
21378
|
outputRoot,
|
|
@@ -21020,7 +21410,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
21020
21410
|
};
|
|
21021
21411
|
|
|
21022
21412
|
// src/features/subagents/opencode-subagent.ts
|
|
21023
|
-
import { join as
|
|
21413
|
+
import { join as join131 } from "path";
|
|
21024
21414
|
var OpenCodeSubagentFrontmatterSchema = OpenCodeStyleSubagentFrontmatterSchema;
|
|
21025
21415
|
var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
21026
21416
|
getToolTarget() {
|
|
@@ -21030,7 +21420,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
21030
21420
|
global = false
|
|
21031
21421
|
} = {}) {
|
|
21032
21422
|
return {
|
|
21033
|
-
relativeDirPath: global ?
|
|
21423
|
+
relativeDirPath: global ? join131(".config", "opencode", "agent") : join131(".opencode", "agent")
|
|
21034
21424
|
};
|
|
21035
21425
|
}
|
|
21036
21426
|
static fromRulesyncSubagent({
|
|
@@ -21074,7 +21464,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
21074
21464
|
global = false
|
|
21075
21465
|
}) {
|
|
21076
21466
|
const paths = this.getSettablePaths({ global });
|
|
21077
|
-
const filePath =
|
|
21467
|
+
const filePath = join131(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
21078
21468
|
const fileContent = await readFileContent(filePath);
|
|
21079
21469
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
21080
21470
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -21112,7 +21502,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
21112
21502
|
};
|
|
21113
21503
|
|
|
21114
21504
|
// src/features/subagents/takt-subagent.ts
|
|
21115
|
-
import { join as
|
|
21505
|
+
import { join as join132 } from "path";
|
|
21116
21506
|
var DEFAULT_TAKT_SUBAGENT_DIR = "personas";
|
|
21117
21507
|
var TaktSubagent = class _TaktSubagent extends ToolSubagent {
|
|
21118
21508
|
body;
|
|
@@ -21124,7 +21514,7 @@ var TaktSubagent = class _TaktSubagent extends ToolSubagent {
|
|
|
21124
21514
|
}
|
|
21125
21515
|
static getSettablePaths(_options = {}) {
|
|
21126
21516
|
return {
|
|
21127
|
-
relativeDirPath:
|
|
21517
|
+
relativeDirPath: join132(".takt", "facets", DEFAULT_TAKT_SUBAGENT_DIR)
|
|
21128
21518
|
};
|
|
21129
21519
|
}
|
|
21130
21520
|
getBody() {
|
|
@@ -21186,7 +21576,7 @@ var TaktSubagent = class _TaktSubagent extends ToolSubagent {
|
|
|
21186
21576
|
global = false
|
|
21187
21577
|
}) {
|
|
21188
21578
|
const paths = this.getSettablePaths({ global });
|
|
21189
|
-
const filePath =
|
|
21579
|
+
const filePath = join132(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
21190
21580
|
const fileContent = await readFileContent(filePath);
|
|
21191
21581
|
const { body } = parseFrontmatter(fileContent, filePath);
|
|
21192
21582
|
return new _TaktSubagent({
|
|
@@ -21443,7 +21833,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
21443
21833
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
21444
21834
|
*/
|
|
21445
21835
|
async loadRulesyncFiles() {
|
|
21446
|
-
const subagentsDir =
|
|
21836
|
+
const subagentsDir = join133(this.inputRoot, RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
21447
21837
|
const dirExists = await directoryExists(subagentsDir);
|
|
21448
21838
|
if (!dirExists) {
|
|
21449
21839
|
this.logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -21458,7 +21848,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
21458
21848
|
this.logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
21459
21849
|
const rulesyncSubagents = [];
|
|
21460
21850
|
for (const mdFile of mdFiles) {
|
|
21461
|
-
const filepath =
|
|
21851
|
+
const filepath = join133(subagentsDir, mdFile);
|
|
21462
21852
|
try {
|
|
21463
21853
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
21464
21854
|
outputRoot: this.inputRoot,
|
|
@@ -21489,7 +21879,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
21489
21879
|
const factory = this.getFactory(this.toolTarget);
|
|
21490
21880
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
21491
21881
|
const subagentFilePaths = await findFilesByGlobs(
|
|
21492
|
-
|
|
21882
|
+
join133(this.outputRoot, paths.relativeDirPath, factory.meta.filePattern)
|
|
21493
21883
|
);
|
|
21494
21884
|
if (forDeletion) {
|
|
21495
21885
|
const toolSubagents2 = subagentFilePaths.map(
|
|
@@ -21556,13 +21946,13 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
21556
21946
|
};
|
|
21557
21947
|
|
|
21558
21948
|
// src/features/rules/agentsmd-rule.ts
|
|
21559
|
-
import { join as
|
|
21949
|
+
import { join as join136 } from "path";
|
|
21560
21950
|
|
|
21561
21951
|
// src/features/rules/tool-rule.ts
|
|
21562
|
-
import { join as
|
|
21952
|
+
import { join as join135 } from "path";
|
|
21563
21953
|
|
|
21564
21954
|
// src/features/rules/rulesync-rule.ts
|
|
21565
|
-
import { join as
|
|
21955
|
+
import { join as join134 } from "path";
|
|
21566
21956
|
import { z as z76 } from "zod/mini";
|
|
21567
21957
|
var RulesyncRuleFrontmatterSchema = z76.object({
|
|
21568
21958
|
root: z76.optional(z76.boolean()),
|
|
@@ -21615,7 +22005,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
21615
22005
|
const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
21616
22006
|
if (!parseResult.success && rest.validate !== false) {
|
|
21617
22007
|
throw new Error(
|
|
21618
|
-
`Invalid frontmatter in ${
|
|
22008
|
+
`Invalid frontmatter in ${join134(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
21619
22009
|
);
|
|
21620
22010
|
}
|
|
21621
22011
|
const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
|
|
@@ -21650,7 +22040,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
21650
22040
|
return {
|
|
21651
22041
|
success: false,
|
|
21652
22042
|
error: new Error(
|
|
21653
|
-
`Invalid frontmatter in ${
|
|
22043
|
+
`Invalid frontmatter in ${join134(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
21654
22044
|
)
|
|
21655
22045
|
};
|
|
21656
22046
|
}
|
|
@@ -21660,7 +22050,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
21660
22050
|
relativeFilePath,
|
|
21661
22051
|
validate = true
|
|
21662
22052
|
}) {
|
|
21663
|
-
const filePath =
|
|
22053
|
+
const filePath = join134(
|
|
21664
22054
|
outputRoot,
|
|
21665
22055
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
21666
22056
|
relativeFilePath
|
|
@@ -21759,7 +22149,7 @@ var ToolRule = class extends ToolFile {
|
|
|
21759
22149
|
rulesyncRule,
|
|
21760
22150
|
validate = true,
|
|
21761
22151
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
21762
|
-
nonRootPath = { relativeDirPath:
|
|
22152
|
+
nonRootPath = { relativeDirPath: join135(".agents", "memories") }
|
|
21763
22153
|
}) {
|
|
21764
22154
|
const params = this.buildToolRuleParamsDefault({
|
|
21765
22155
|
outputRoot,
|
|
@@ -21770,7 +22160,7 @@ var ToolRule = class extends ToolFile {
|
|
|
21770
22160
|
});
|
|
21771
22161
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
21772
22162
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
21773
|
-
params.relativeDirPath =
|
|
22163
|
+
params.relativeDirPath = join135(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
21774
22164
|
params.relativeFilePath = "AGENTS.md";
|
|
21775
22165
|
}
|
|
21776
22166
|
return params;
|
|
@@ -21819,7 +22209,7 @@ var ToolRule = class extends ToolFile {
|
|
|
21819
22209
|
}
|
|
21820
22210
|
};
|
|
21821
22211
|
function buildToolPath(toolDir, subDir, excludeToolDir) {
|
|
21822
|
-
return excludeToolDir ? subDir :
|
|
22212
|
+
return excludeToolDir ? subDir : join135(toolDir, subDir);
|
|
21823
22213
|
}
|
|
21824
22214
|
|
|
21825
22215
|
// src/features/rules/agentsmd-rule.ts
|
|
@@ -21848,8 +22238,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
21848
22238
|
validate = true
|
|
21849
22239
|
}) {
|
|
21850
22240
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
21851
|
-
const relativePath = isRoot ? "AGENTS.md" :
|
|
21852
|
-
const fileContent = await readFileContent(
|
|
22241
|
+
const relativePath = isRoot ? "AGENTS.md" : join136(".agents", "memories", relativeFilePath);
|
|
22242
|
+
const fileContent = await readFileContent(join136(outputRoot, relativePath));
|
|
21853
22243
|
return new _AgentsMdRule({
|
|
21854
22244
|
outputRoot,
|
|
21855
22245
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -21904,7 +22294,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
21904
22294
|
};
|
|
21905
22295
|
|
|
21906
22296
|
// src/features/rules/antigravity-cli-rule.ts
|
|
21907
|
-
import { join as
|
|
22297
|
+
import { join as join137 } from "path";
|
|
21908
22298
|
var AntigravityCliRule = class _AntigravityCliRule extends ToolRule {
|
|
21909
22299
|
static getSettablePaths({
|
|
21910
22300
|
global,
|
|
@@ -21939,7 +22329,7 @@ var AntigravityCliRule = class _AntigravityCliRule extends ToolRule {
|
|
|
21939
22329
|
if (isRoot) {
|
|
21940
22330
|
const relativePath2 = paths.root.relativeFilePath;
|
|
21941
22331
|
const fileContent2 = await readFileContent(
|
|
21942
|
-
|
|
22332
|
+
join137(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
21943
22333
|
);
|
|
21944
22334
|
return new _AntigravityCliRule({
|
|
21945
22335
|
outputRoot,
|
|
@@ -21953,8 +22343,8 @@ var AntigravityCliRule = class _AntigravityCliRule extends ToolRule {
|
|
|
21953
22343
|
if (!paths.nonRoot) {
|
|
21954
22344
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
21955
22345
|
}
|
|
21956
|
-
const relativePath =
|
|
21957
|
-
const fileContent = await readFileContent(
|
|
22346
|
+
const relativePath = join137(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
22347
|
+
const fileContent = await readFileContent(join137(outputRoot, relativePath));
|
|
21958
22348
|
return new _AntigravityCliRule({
|
|
21959
22349
|
outputRoot,
|
|
21960
22350
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -22013,10 +22403,10 @@ var AntigravityCliRule = class _AntigravityCliRule extends ToolRule {
|
|
|
22013
22403
|
};
|
|
22014
22404
|
|
|
22015
22405
|
// src/features/rules/antigravity-ide-rule.ts
|
|
22016
|
-
import { join as
|
|
22406
|
+
import { join as join139 } from "path";
|
|
22017
22407
|
|
|
22018
22408
|
// src/features/rules/antigravity-rule.ts
|
|
22019
|
-
import { join as
|
|
22409
|
+
import { join as join138 } from "path";
|
|
22020
22410
|
import { z as z77 } from "zod/mini";
|
|
22021
22411
|
var AntigravityRuleFrontmatterSchema = z77.looseObject({
|
|
22022
22412
|
trigger: z77.optional(
|
|
@@ -22175,7 +22565,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
22175
22565
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
22176
22566
|
if (!result.success) {
|
|
22177
22567
|
throw new Error(
|
|
22178
|
-
`Invalid frontmatter in ${
|
|
22568
|
+
`Invalid frontmatter in ${join138(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
22179
22569
|
);
|
|
22180
22570
|
}
|
|
22181
22571
|
}
|
|
@@ -22199,7 +22589,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
22199
22589
|
relativeFilePath,
|
|
22200
22590
|
validate = true
|
|
22201
22591
|
}) {
|
|
22202
|
-
const filePath =
|
|
22592
|
+
const filePath = join138(
|
|
22203
22593
|
outputRoot,
|
|
22204
22594
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
22205
22595
|
relativeFilePath
|
|
@@ -22347,7 +22737,7 @@ var AntigravityIdeRule = class _AntigravityIdeRule extends ToolRule {
|
|
|
22347
22737
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
22348
22738
|
if (!result.success) {
|
|
22349
22739
|
throw new Error(
|
|
22350
|
-
`Invalid frontmatter in ${
|
|
22740
|
+
`Invalid frontmatter in ${join139(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
22351
22741
|
);
|
|
22352
22742
|
}
|
|
22353
22743
|
}
|
|
@@ -22390,7 +22780,7 @@ var AntigravityIdeRule = class _AntigravityIdeRule extends ToolRule {
|
|
|
22390
22780
|
if (global) {
|
|
22391
22781
|
const rootPath = _AntigravityIdeRule.getGlobalRootPath();
|
|
22392
22782
|
const fileContent2 = await readFileContent(
|
|
22393
|
-
|
|
22783
|
+
join139(outputRoot, rootPath.relativeDirPath, rootPath.relativeFilePath)
|
|
22394
22784
|
);
|
|
22395
22785
|
return new _AntigravityIdeRule({
|
|
22396
22786
|
outputRoot,
|
|
@@ -22403,7 +22793,7 @@ var AntigravityIdeRule = class _AntigravityIdeRule extends ToolRule {
|
|
|
22403
22793
|
});
|
|
22404
22794
|
}
|
|
22405
22795
|
const nonRootDirPath = buildToolPath(".agents", "rules");
|
|
22406
|
-
const filePath =
|
|
22796
|
+
const filePath = join139(outputRoot, nonRootDirPath, relativeFilePath);
|
|
22407
22797
|
const fileContent = await readFileContent(filePath);
|
|
22408
22798
|
const { frontmatter, body } = parseFrontmatter(fileContent, filePath);
|
|
22409
22799
|
let parsedFrontmatter;
|
|
@@ -22532,7 +22922,7 @@ var AntigravityIdeRule = class _AntigravityIdeRule extends ToolRule {
|
|
|
22532
22922
|
};
|
|
22533
22923
|
|
|
22534
22924
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
22535
|
-
import { join as
|
|
22925
|
+
import { join as join140 } from "path";
|
|
22536
22926
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
22537
22927
|
toRulesyncRule() {
|
|
22538
22928
|
const rulesyncFrontmatter = {
|
|
@@ -22592,8 +22982,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
22592
22982
|
}) {
|
|
22593
22983
|
const settablePaths = this.getSettablePaths();
|
|
22594
22984
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
22595
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath :
|
|
22596
|
-
const fileContent = await readFileContent(
|
|
22985
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : join140(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
22986
|
+
const fileContent = await readFileContent(join140(outputRoot, relativePath));
|
|
22597
22987
|
return new _AugmentcodeLegacyRule({
|
|
22598
22988
|
outputRoot,
|
|
22599
22989
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -22622,7 +23012,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
22622
23012
|
};
|
|
22623
23013
|
|
|
22624
23014
|
// src/features/rules/augmentcode-rule.ts
|
|
22625
|
-
import { join as
|
|
23015
|
+
import { join as join141 } from "path";
|
|
22626
23016
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
22627
23017
|
toRulesyncRule() {
|
|
22628
23018
|
return this.toRulesyncRuleDefault();
|
|
@@ -22653,7 +23043,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
22653
23043
|
relativeFilePath,
|
|
22654
23044
|
validate = true
|
|
22655
23045
|
}) {
|
|
22656
|
-
const filePath =
|
|
23046
|
+
const filePath = join141(
|
|
22657
23047
|
outputRoot,
|
|
22658
23048
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
22659
23049
|
relativeFilePath
|
|
@@ -22693,7 +23083,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
22693
23083
|
};
|
|
22694
23084
|
|
|
22695
23085
|
// src/features/rules/claudecode-legacy-rule.ts
|
|
22696
|
-
import { join as
|
|
23086
|
+
import { join as join142 } from "path";
|
|
22697
23087
|
var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
22698
23088
|
static getSettablePaths({
|
|
22699
23089
|
global,
|
|
@@ -22735,7 +23125,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
22735
23125
|
if (isRoot) {
|
|
22736
23126
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
22737
23127
|
const fileContent2 = await readFileContent(
|
|
22738
|
-
|
|
23128
|
+
join142(outputRoot, rootDirPath, paths.root.relativeFilePath)
|
|
22739
23129
|
);
|
|
22740
23130
|
return new _ClaudecodeLegacyRule({
|
|
22741
23131
|
outputRoot,
|
|
@@ -22749,8 +23139,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
22749
23139
|
if (!paths.nonRoot) {
|
|
22750
23140
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
22751
23141
|
}
|
|
22752
|
-
const relativePath =
|
|
22753
|
-
const fileContent = await readFileContent(
|
|
23142
|
+
const relativePath = join142(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
23143
|
+
const fileContent = await readFileContent(join142(outputRoot, relativePath));
|
|
22754
23144
|
return new _ClaudecodeLegacyRule({
|
|
22755
23145
|
outputRoot,
|
|
22756
23146
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -22809,7 +23199,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
22809
23199
|
};
|
|
22810
23200
|
|
|
22811
23201
|
// src/features/rules/claudecode-rule.ts
|
|
22812
|
-
import { join as
|
|
23202
|
+
import { join as join143 } from "path";
|
|
22813
23203
|
import { z as z78 } from "zod/mini";
|
|
22814
23204
|
var ClaudecodeRuleFrontmatterSchema = z78.object({
|
|
22815
23205
|
paths: z78.optional(z78.array(z78.string()))
|
|
@@ -22850,7 +23240,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
22850
23240
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
22851
23241
|
if (!result.success) {
|
|
22852
23242
|
throw new Error(
|
|
22853
|
-
`Invalid frontmatter in ${
|
|
23243
|
+
`Invalid frontmatter in ${join143(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
22854
23244
|
);
|
|
22855
23245
|
}
|
|
22856
23246
|
}
|
|
@@ -22880,7 +23270,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
22880
23270
|
if (isRoot) {
|
|
22881
23271
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
22882
23272
|
const fileContent2 = await readFileContent(
|
|
22883
|
-
|
|
23273
|
+
join143(outputRoot, rootDirPath, paths.root.relativeFilePath)
|
|
22884
23274
|
);
|
|
22885
23275
|
return new _ClaudecodeRule({
|
|
22886
23276
|
outputRoot,
|
|
@@ -22895,8 +23285,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
22895
23285
|
if (!paths.nonRoot) {
|
|
22896
23286
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
22897
23287
|
}
|
|
22898
|
-
const relativePath =
|
|
22899
|
-
const filePath =
|
|
23288
|
+
const relativePath = join143(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
23289
|
+
const filePath = join143(outputRoot, relativePath);
|
|
22900
23290
|
const fileContent = await readFileContent(filePath);
|
|
22901
23291
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
22902
23292
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -23007,7 +23397,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
23007
23397
|
return {
|
|
23008
23398
|
success: false,
|
|
23009
23399
|
error: new Error(
|
|
23010
|
-
`Invalid frontmatter in ${
|
|
23400
|
+
`Invalid frontmatter in ${join143(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
23011
23401
|
)
|
|
23012
23402
|
};
|
|
23013
23403
|
}
|
|
@@ -23027,7 +23417,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
23027
23417
|
};
|
|
23028
23418
|
|
|
23029
23419
|
// src/features/rules/cline-rule.ts
|
|
23030
|
-
import { join as
|
|
23420
|
+
import { join as join144 } from "path";
|
|
23031
23421
|
import { z as z79 } from "zod/mini";
|
|
23032
23422
|
var ClineRuleFrontmatterSchema = z79.object({
|
|
23033
23423
|
description: z79.string()
|
|
@@ -23073,7 +23463,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
23073
23463
|
validate = true
|
|
23074
23464
|
}) {
|
|
23075
23465
|
const fileContent = await readFileContent(
|
|
23076
|
-
|
|
23466
|
+
join144(outputRoot, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
23077
23467
|
);
|
|
23078
23468
|
return new _ClineRule({
|
|
23079
23469
|
outputRoot,
|
|
@@ -23099,7 +23489,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
23099
23489
|
};
|
|
23100
23490
|
|
|
23101
23491
|
// src/features/rules/codexcli-rule.ts
|
|
23102
|
-
import { join as
|
|
23492
|
+
import { join as join145 } from "path";
|
|
23103
23493
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
23104
23494
|
static getSettablePaths({
|
|
23105
23495
|
global,
|
|
@@ -23134,7 +23524,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
23134
23524
|
if (isRoot) {
|
|
23135
23525
|
const relativePath2 = paths.root.relativeFilePath;
|
|
23136
23526
|
const fileContent2 = await readFileContent(
|
|
23137
|
-
|
|
23527
|
+
join145(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
23138
23528
|
);
|
|
23139
23529
|
return new _CodexcliRule({
|
|
23140
23530
|
outputRoot,
|
|
@@ -23148,8 +23538,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
23148
23538
|
if (!paths.nonRoot) {
|
|
23149
23539
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
23150
23540
|
}
|
|
23151
|
-
const relativePath =
|
|
23152
|
-
const fileContent = await readFileContent(
|
|
23541
|
+
const relativePath = join145(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
23542
|
+
const fileContent = await readFileContent(join145(outputRoot, relativePath));
|
|
23153
23543
|
return new _CodexcliRule({
|
|
23154
23544
|
outputRoot,
|
|
23155
23545
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -23208,7 +23598,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
23208
23598
|
};
|
|
23209
23599
|
|
|
23210
23600
|
// src/features/rules/copilot-rule.ts
|
|
23211
|
-
import { join as
|
|
23601
|
+
import { join as join146 } from "path";
|
|
23212
23602
|
import { z as z80 } from "zod/mini";
|
|
23213
23603
|
var CopilotRuleFrontmatterSchema = z80.object({
|
|
23214
23604
|
description: z80.optional(z80.string()),
|
|
@@ -23216,7 +23606,7 @@ var CopilotRuleFrontmatterSchema = z80.object({
|
|
|
23216
23606
|
excludeAgent: z80.optional(z80.union([z80.literal("code-review"), z80.literal("coding-agent")]))
|
|
23217
23607
|
});
|
|
23218
23608
|
var normalizeRelativePath = (p) => toPosixPath(p).replace(/\/+/g, "/");
|
|
23219
|
-
var sameRelativePath = (left, right) => normalizeRelativePath(
|
|
23609
|
+
var sameRelativePath = (left, right) => normalizeRelativePath(join146(left.dir, left.file)) === normalizeRelativePath(join146(right.dir, right.file));
|
|
23220
23610
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
23221
23611
|
frontmatter;
|
|
23222
23612
|
body;
|
|
@@ -23247,7 +23637,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
23247
23637
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
23248
23638
|
if (!result.success) {
|
|
23249
23639
|
throw new Error(
|
|
23250
|
-
`Invalid frontmatter in ${
|
|
23640
|
+
`Invalid frontmatter in ${join146(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
23251
23641
|
);
|
|
23252
23642
|
}
|
|
23253
23643
|
}
|
|
@@ -23340,8 +23730,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
23340
23730
|
) : relativeFilePath === paths.root.relativeFilePath;
|
|
23341
23731
|
const resolvedRelativeDirPath = relativeDirPath ?? (isRoot ? paths.root.relativeDirPath : paths.nonRoot?.relativeDirPath ?? paths.root.relativeDirPath);
|
|
23342
23732
|
if (isRoot) {
|
|
23343
|
-
const relativePath2 =
|
|
23344
|
-
const filePath2 =
|
|
23733
|
+
const relativePath2 = join146(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
23734
|
+
const filePath2 = join146(outputRoot, relativePath2);
|
|
23345
23735
|
const fileContent2 = await readFileContent(filePath2);
|
|
23346
23736
|
return new _CopilotRule({
|
|
23347
23737
|
outputRoot,
|
|
@@ -23356,8 +23746,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
23356
23746
|
if (!paths.nonRoot) {
|
|
23357
23747
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
23358
23748
|
}
|
|
23359
|
-
const relativePath =
|
|
23360
|
-
const filePath =
|
|
23749
|
+
const relativePath = join146(resolvedRelativeDirPath, relativeFilePath);
|
|
23750
|
+
const filePath = join146(outputRoot, relativePath);
|
|
23361
23751
|
const fileContent = await readFileContent(filePath);
|
|
23362
23752
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
23363
23753
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -23406,7 +23796,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
23406
23796
|
return {
|
|
23407
23797
|
success: false,
|
|
23408
23798
|
error: new Error(
|
|
23409
|
-
`Invalid frontmatter in ${
|
|
23799
|
+
`Invalid frontmatter in ${join146(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
23410
23800
|
)
|
|
23411
23801
|
};
|
|
23412
23802
|
}
|
|
@@ -23462,7 +23852,7 @@ var CopilotcliRule = class _CopilotcliRule extends CopilotRule {
|
|
|
23462
23852
|
};
|
|
23463
23853
|
|
|
23464
23854
|
// src/features/rules/cursor-rule.ts
|
|
23465
|
-
import { join as
|
|
23855
|
+
import { join as join147 } from "path";
|
|
23466
23856
|
import { z as z81 } from "zod/mini";
|
|
23467
23857
|
var CursorRuleFrontmatterSchema = z81.object({
|
|
23468
23858
|
description: z81.optional(z81.string()),
|
|
@@ -23484,7 +23874,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
23484
23874
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
23485
23875
|
if (!result.success) {
|
|
23486
23876
|
throw new Error(
|
|
23487
|
-
`Invalid frontmatter in ${
|
|
23877
|
+
`Invalid frontmatter in ${join147(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
23488
23878
|
);
|
|
23489
23879
|
}
|
|
23490
23880
|
}
|
|
@@ -23600,7 +23990,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
23600
23990
|
relativeFilePath,
|
|
23601
23991
|
validate = true
|
|
23602
23992
|
}) {
|
|
23603
|
-
const filePath =
|
|
23993
|
+
const filePath = join147(
|
|
23604
23994
|
outputRoot,
|
|
23605
23995
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
23606
23996
|
relativeFilePath
|
|
@@ -23610,7 +24000,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
23610
24000
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
23611
24001
|
if (!result.success) {
|
|
23612
24002
|
throw new Error(
|
|
23613
|
-
`Invalid frontmatter in ${
|
|
24003
|
+
`Invalid frontmatter in ${join147(outputRoot, relativeFilePath)}: ${formatError(result.error)}`
|
|
23614
24004
|
);
|
|
23615
24005
|
}
|
|
23616
24006
|
return new _CursorRule({
|
|
@@ -23647,7 +24037,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
23647
24037
|
return {
|
|
23648
24038
|
success: false,
|
|
23649
24039
|
error: new Error(
|
|
23650
|
-
`Invalid frontmatter in ${
|
|
24040
|
+
`Invalid frontmatter in ${join147(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
23651
24041
|
)
|
|
23652
24042
|
};
|
|
23653
24043
|
}
|
|
@@ -23667,7 +24057,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
23667
24057
|
};
|
|
23668
24058
|
|
|
23669
24059
|
// src/features/rules/deepagents-rule.ts
|
|
23670
|
-
import { join as
|
|
24060
|
+
import { join as join148 } from "path";
|
|
23671
24061
|
var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
23672
24062
|
constructor({ fileContent, root, ...rest }) {
|
|
23673
24063
|
super({
|
|
@@ -23694,8 +24084,8 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
23694
24084
|
}) {
|
|
23695
24085
|
const settablePaths = this.getSettablePaths();
|
|
23696
24086
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
23697
|
-
const relativePath = isRoot ?
|
|
23698
|
-
const fileContent = await readFileContent(
|
|
24087
|
+
const relativePath = isRoot ? join148(".deepagents", "AGENTS.md") : join148(".deepagents", "memories", relativeFilePath);
|
|
24088
|
+
const fileContent = await readFileContent(join148(outputRoot, relativePath));
|
|
23699
24089
|
return new _DeepagentsRule({
|
|
23700
24090
|
outputRoot,
|
|
23701
24091
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -23750,7 +24140,7 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
23750
24140
|
};
|
|
23751
24141
|
|
|
23752
24142
|
// src/features/rules/factorydroid-rule.ts
|
|
23753
|
-
import { join as
|
|
24143
|
+
import { join as join149 } from "path";
|
|
23754
24144
|
var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
23755
24145
|
constructor({ fileContent, root, ...rest }) {
|
|
23756
24146
|
super({
|
|
@@ -23790,8 +24180,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
23790
24180
|
const paths = this.getSettablePaths({ global });
|
|
23791
24181
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
23792
24182
|
if (isRoot) {
|
|
23793
|
-
const relativePath2 =
|
|
23794
|
-
const fileContent2 = await readFileContent(
|
|
24183
|
+
const relativePath2 = join149(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
24184
|
+
const fileContent2 = await readFileContent(join149(outputRoot, relativePath2));
|
|
23795
24185
|
return new _FactorydroidRule({
|
|
23796
24186
|
outputRoot,
|
|
23797
24187
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -23804,8 +24194,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
23804
24194
|
if (!paths.nonRoot) {
|
|
23805
24195
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
23806
24196
|
}
|
|
23807
|
-
const relativePath =
|
|
23808
|
-
const fileContent = await readFileContent(
|
|
24197
|
+
const relativePath = join149(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24198
|
+
const fileContent = await readFileContent(join149(outputRoot, relativePath));
|
|
23809
24199
|
return new _FactorydroidRule({
|
|
23810
24200
|
outputRoot,
|
|
23811
24201
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -23864,7 +24254,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
23864
24254
|
};
|
|
23865
24255
|
|
|
23866
24256
|
// src/features/rules/geminicli-rule.ts
|
|
23867
|
-
import { join as
|
|
24257
|
+
import { join as join150 } from "path";
|
|
23868
24258
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
23869
24259
|
static getSettablePaths({
|
|
23870
24260
|
global,
|
|
@@ -23899,7 +24289,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
23899
24289
|
if (isRoot) {
|
|
23900
24290
|
const relativePath2 = paths.root.relativeFilePath;
|
|
23901
24291
|
const fileContent2 = await readFileContent(
|
|
23902
|
-
|
|
24292
|
+
join150(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
23903
24293
|
);
|
|
23904
24294
|
return new _GeminiCliRule({
|
|
23905
24295
|
outputRoot,
|
|
@@ -23913,8 +24303,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
23913
24303
|
if (!paths.nonRoot) {
|
|
23914
24304
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
23915
24305
|
}
|
|
23916
|
-
const relativePath =
|
|
23917
|
-
const fileContent = await readFileContent(
|
|
24306
|
+
const relativePath = join150(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24307
|
+
const fileContent = await readFileContent(join150(outputRoot, relativePath));
|
|
23918
24308
|
return new _GeminiCliRule({
|
|
23919
24309
|
outputRoot,
|
|
23920
24310
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -23973,7 +24363,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
23973
24363
|
};
|
|
23974
24364
|
|
|
23975
24365
|
// src/features/rules/goose-rule.ts
|
|
23976
|
-
import { join as
|
|
24366
|
+
import { join as join151 } from "path";
|
|
23977
24367
|
var GooseRule = class _GooseRule extends ToolRule {
|
|
23978
24368
|
static getSettablePaths({
|
|
23979
24369
|
global,
|
|
@@ -24008,7 +24398,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
24008
24398
|
if (isRoot) {
|
|
24009
24399
|
const relativePath2 = paths.root.relativeFilePath;
|
|
24010
24400
|
const fileContent2 = await readFileContent(
|
|
24011
|
-
|
|
24401
|
+
join151(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
24012
24402
|
);
|
|
24013
24403
|
return new _GooseRule({
|
|
24014
24404
|
outputRoot,
|
|
@@ -24022,8 +24412,8 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
24022
24412
|
if (!paths.nonRoot) {
|
|
24023
24413
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
24024
24414
|
}
|
|
24025
|
-
const relativePath =
|
|
24026
|
-
const fileContent = await readFileContent(
|
|
24415
|
+
const relativePath = join151(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24416
|
+
const fileContent = await readFileContent(join151(outputRoot, relativePath));
|
|
24027
24417
|
return new _GooseRule({
|
|
24028
24418
|
outputRoot,
|
|
24029
24419
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -24082,7 +24472,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
24082
24472
|
};
|
|
24083
24473
|
|
|
24084
24474
|
// src/features/rules/junie-rule.ts
|
|
24085
|
-
import { join as
|
|
24475
|
+
import { join as join152 } from "path";
|
|
24086
24476
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
24087
24477
|
static getSettablePaths(_options = {}) {
|
|
24088
24478
|
return {
|
|
@@ -24111,8 +24501,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
24111
24501
|
}) {
|
|
24112
24502
|
const isRoot = _JunieRule.isRootRelativeFilePath(relativeFilePath);
|
|
24113
24503
|
const settablePaths = this.getSettablePaths();
|
|
24114
|
-
const relativePath = isRoot ?
|
|
24115
|
-
const fileContent = await readFileContent(
|
|
24504
|
+
const relativePath = isRoot ? join152(settablePaths.root.relativeDirPath, settablePaths.root.relativeFilePath) : join152(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24505
|
+
const fileContent = await readFileContent(join152(outputRoot, relativePath));
|
|
24116
24506
|
return new _JunieRule({
|
|
24117
24507
|
outputRoot,
|
|
24118
24508
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -24167,7 +24557,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
24167
24557
|
};
|
|
24168
24558
|
|
|
24169
24559
|
// src/features/rules/kilo-rule.ts
|
|
24170
|
-
import { join as
|
|
24560
|
+
import { join as join153 } from "path";
|
|
24171
24561
|
var KiloRule = class _KiloRule extends ToolRule {
|
|
24172
24562
|
static getSettablePaths({
|
|
24173
24563
|
global,
|
|
@@ -24202,7 +24592,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
24202
24592
|
if (isRoot) {
|
|
24203
24593
|
const relativePath2 = paths.root.relativeFilePath;
|
|
24204
24594
|
const fileContent2 = await readFileContent(
|
|
24205
|
-
|
|
24595
|
+
join153(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
24206
24596
|
);
|
|
24207
24597
|
return new _KiloRule({
|
|
24208
24598
|
outputRoot,
|
|
@@ -24216,8 +24606,8 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
24216
24606
|
if (!paths.nonRoot) {
|
|
24217
24607
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
24218
24608
|
}
|
|
24219
|
-
const relativePath =
|
|
24220
|
-
const fileContent = await readFileContent(
|
|
24609
|
+
const relativePath = join153(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24610
|
+
const fileContent = await readFileContent(join153(outputRoot, relativePath));
|
|
24221
24611
|
return new _KiloRule({
|
|
24222
24612
|
outputRoot,
|
|
24223
24613
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -24276,7 +24666,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
24276
24666
|
};
|
|
24277
24667
|
|
|
24278
24668
|
// src/features/rules/kiro-rule.ts
|
|
24279
|
-
import { join as
|
|
24669
|
+
import { join as join154 } from "path";
|
|
24280
24670
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
24281
24671
|
static getSettablePaths(_options = {}) {
|
|
24282
24672
|
return {
|
|
@@ -24291,7 +24681,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
24291
24681
|
validate = true
|
|
24292
24682
|
}) {
|
|
24293
24683
|
const fileContent = await readFileContent(
|
|
24294
|
-
|
|
24684
|
+
join154(outputRoot, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
24295
24685
|
);
|
|
24296
24686
|
return new _KiroRule({
|
|
24297
24687
|
outputRoot,
|
|
@@ -24345,7 +24735,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
24345
24735
|
};
|
|
24346
24736
|
|
|
24347
24737
|
// src/features/rules/opencode-rule.ts
|
|
24348
|
-
import { join as
|
|
24738
|
+
import { join as join155 } from "path";
|
|
24349
24739
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
24350
24740
|
static getSettablePaths({
|
|
24351
24741
|
global,
|
|
@@ -24380,7 +24770,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
24380
24770
|
if (isRoot) {
|
|
24381
24771
|
const relativePath2 = paths.root.relativeFilePath;
|
|
24382
24772
|
const fileContent2 = await readFileContent(
|
|
24383
|
-
|
|
24773
|
+
join155(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
24384
24774
|
);
|
|
24385
24775
|
return new _OpenCodeRule({
|
|
24386
24776
|
outputRoot,
|
|
@@ -24394,8 +24784,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
24394
24784
|
if (!paths.nonRoot) {
|
|
24395
24785
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
24396
24786
|
}
|
|
24397
|
-
const relativePath =
|
|
24398
|
-
const fileContent = await readFileContent(
|
|
24787
|
+
const relativePath = join155(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24788
|
+
const fileContent = await readFileContent(join155(outputRoot, relativePath));
|
|
24399
24789
|
return new _OpenCodeRule({
|
|
24400
24790
|
outputRoot,
|
|
24401
24791
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -24454,7 +24844,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
24454
24844
|
};
|
|
24455
24845
|
|
|
24456
24846
|
// src/features/rules/pi-rule.ts
|
|
24457
|
-
import { join as
|
|
24847
|
+
import { join as join156 } from "path";
|
|
24458
24848
|
var PiRule = class _PiRule extends ToolRule {
|
|
24459
24849
|
static getSettablePaths({
|
|
24460
24850
|
global,
|
|
@@ -24488,7 +24878,7 @@ var PiRule = class _PiRule extends ToolRule {
|
|
|
24488
24878
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
24489
24879
|
if (isRoot) {
|
|
24490
24880
|
const fileContent2 = await readFileContent(
|
|
24491
|
-
|
|
24881
|
+
join156(outputRoot, paths.root.relativeDirPath, paths.root.relativeFilePath)
|
|
24492
24882
|
);
|
|
24493
24883
|
return new _PiRule({
|
|
24494
24884
|
outputRoot,
|
|
@@ -24504,8 +24894,8 @@ var PiRule = class _PiRule extends ToolRule {
|
|
|
24504
24894
|
`PiRule does not support non-root rules in global mode; expected '${paths.root.relativeFilePath}' but got '${relativeFilePath}'`
|
|
24505
24895
|
);
|
|
24506
24896
|
}
|
|
24507
|
-
const relativePath =
|
|
24508
|
-
const fileContent = await readFileContent(
|
|
24897
|
+
const relativePath = join156(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24898
|
+
const fileContent = await readFileContent(join156(outputRoot, relativePath));
|
|
24509
24899
|
return new _PiRule({
|
|
24510
24900
|
outputRoot,
|
|
24511
24901
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -24569,7 +24959,7 @@ var PiRule = class _PiRule extends ToolRule {
|
|
|
24569
24959
|
};
|
|
24570
24960
|
|
|
24571
24961
|
// src/features/rules/qwencode-rule.ts
|
|
24572
|
-
import { join as
|
|
24962
|
+
import { join as join157 } from "path";
|
|
24573
24963
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
24574
24964
|
static getSettablePaths(_options = {}) {
|
|
24575
24965
|
return {
|
|
@@ -24588,8 +24978,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
24588
24978
|
validate = true
|
|
24589
24979
|
}) {
|
|
24590
24980
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
24591
|
-
const relativePath = isRoot ? "QWEN.md" :
|
|
24592
|
-
const fileContent = await readFileContent(
|
|
24981
|
+
const relativePath = isRoot ? "QWEN.md" : join157(".qwen", "memories", relativeFilePath);
|
|
24982
|
+
const fileContent = await readFileContent(join157(outputRoot, relativePath));
|
|
24593
24983
|
return new _QwencodeRule({
|
|
24594
24984
|
outputRoot,
|
|
24595
24985
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -24641,7 +25031,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
24641
25031
|
};
|
|
24642
25032
|
|
|
24643
25033
|
// src/features/rules/replit-rule.ts
|
|
24644
|
-
import { join as
|
|
25034
|
+
import { join as join158 } from "path";
|
|
24645
25035
|
var ReplitRule = class _ReplitRule extends ToolRule {
|
|
24646
25036
|
static getSettablePaths(_options = {}) {
|
|
24647
25037
|
return {
|
|
@@ -24663,7 +25053,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
24663
25053
|
}
|
|
24664
25054
|
const relativePath = paths.root.relativeFilePath;
|
|
24665
25055
|
const fileContent = await readFileContent(
|
|
24666
|
-
|
|
25056
|
+
join158(outputRoot, paths.root.relativeDirPath, relativePath)
|
|
24667
25057
|
);
|
|
24668
25058
|
return new _ReplitRule({
|
|
24669
25059
|
outputRoot,
|
|
@@ -24729,7 +25119,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
24729
25119
|
};
|
|
24730
25120
|
|
|
24731
25121
|
// src/features/rules/roo-rule.ts
|
|
24732
|
-
import { join as
|
|
25122
|
+
import { join as join159 } from "path";
|
|
24733
25123
|
var RooRule = class _RooRule extends ToolRule {
|
|
24734
25124
|
static getSettablePaths(_options = {}) {
|
|
24735
25125
|
return {
|
|
@@ -24744,7 +25134,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
24744
25134
|
validate = true
|
|
24745
25135
|
}) {
|
|
24746
25136
|
const fileContent = await readFileContent(
|
|
24747
|
-
|
|
25137
|
+
join159(outputRoot, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
24748
25138
|
);
|
|
24749
25139
|
return new _RooRule({
|
|
24750
25140
|
outputRoot,
|
|
@@ -24813,7 +25203,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
24813
25203
|
};
|
|
24814
25204
|
|
|
24815
25205
|
// src/features/rules/rovodev-rule.ts
|
|
24816
|
-
import { join as
|
|
25206
|
+
import { join as join160 } from "path";
|
|
24817
25207
|
var DISALLOWED_ROVODEV_MODULAR_RULE_BASENAMES = /* @__PURE__ */ new Set(["agents.md", "agents.local.md"]);
|
|
24818
25208
|
var RovodevRule = class _RovodevRule extends ToolRule {
|
|
24819
25209
|
/**
|
|
@@ -24857,7 +25247,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
24857
25247
|
root: rovodevAgents,
|
|
24858
25248
|
alternativeRoots: [{ relativeDirPath: ".", relativeFilePath: "AGENTS.md" }],
|
|
24859
25249
|
nonRoot: {
|
|
24860
|
-
relativeDirPath:
|
|
25250
|
+
relativeDirPath: join160(".rovodev", ".rulesync", "modular-rules")
|
|
24861
25251
|
}
|
|
24862
25252
|
};
|
|
24863
25253
|
}
|
|
@@ -24896,10 +25286,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
24896
25286
|
}) {
|
|
24897
25287
|
if (!this.isAllowedModularRulesRelativePath(relativeFilePath)) {
|
|
24898
25288
|
throw new Error(
|
|
24899
|
-
`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${
|
|
25289
|
+
`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${join160(relativeDirPath, relativeFilePath)}`
|
|
24900
25290
|
);
|
|
24901
25291
|
}
|
|
24902
|
-
const fileContent = await readFileContent(
|
|
25292
|
+
const fileContent = await readFileContent(join160(outputRoot, relativeDirPath, relativeFilePath));
|
|
24903
25293
|
return new _RovodevRule({
|
|
24904
25294
|
outputRoot,
|
|
24905
25295
|
relativeDirPath,
|
|
@@ -24919,10 +25309,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
24919
25309
|
paths
|
|
24920
25310
|
}) {
|
|
24921
25311
|
const relativeDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
24922
|
-
const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${
|
|
25312
|
+
const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${join160(paths.root.relativeDirPath, paths.root.relativeFilePath)} or project root` : join160(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
24923
25313
|
if (relativeFilePath !== "AGENTS.md") {
|
|
24924
25314
|
throw new Error(
|
|
24925
|
-
`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${
|
|
25315
|
+
`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${join160(relativeDirPath, relativeFilePath)}`
|
|
24926
25316
|
);
|
|
24927
25317
|
}
|
|
24928
25318
|
const allowed = relativeDirPath === paths.root.relativeDirPath || "alternativeRoots" in paths && paths.alternativeRoots?.some(
|
|
@@ -24930,10 +25320,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
24930
25320
|
);
|
|
24931
25321
|
if (!allowed) {
|
|
24932
25322
|
throw new Error(
|
|
24933
|
-
`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${
|
|
25323
|
+
`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${join160(relativeDirPath, relativeFilePath)}`
|
|
24934
25324
|
);
|
|
24935
25325
|
}
|
|
24936
|
-
const fileContent = await readFileContent(
|
|
25326
|
+
const fileContent = await readFileContent(join160(outputRoot, relativeDirPath, relativeFilePath));
|
|
24937
25327
|
return new _RovodevRule({
|
|
24938
25328
|
outputRoot,
|
|
24939
25329
|
relativeDirPath,
|
|
@@ -25047,7 +25437,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
25047
25437
|
};
|
|
25048
25438
|
|
|
25049
25439
|
// src/features/rules/takt-rule.ts
|
|
25050
|
-
import { join as
|
|
25440
|
+
import { join as join161 } from "path";
|
|
25051
25441
|
var DEFAULT_TAKT_RULE_DIR = "policies";
|
|
25052
25442
|
var TaktRule = class _TaktRule extends ToolRule {
|
|
25053
25443
|
static getSettablePaths({
|
|
@@ -25059,7 +25449,7 @@ var TaktRule = class _TaktRule extends ToolRule {
|
|
|
25059
25449
|
root: {
|
|
25060
25450
|
relativeDirPath: buildToolPath(
|
|
25061
25451
|
".takt",
|
|
25062
|
-
|
|
25452
|
+
join161("facets", DEFAULT_TAKT_RULE_DIR),
|
|
25063
25453
|
excludeToolDir
|
|
25064
25454
|
),
|
|
25065
25455
|
relativeFilePath: "overview.md"
|
|
@@ -25070,7 +25460,7 @@ var TaktRule = class _TaktRule extends ToolRule {
|
|
|
25070
25460
|
nonRoot: {
|
|
25071
25461
|
relativeDirPath: buildToolPath(
|
|
25072
25462
|
".takt",
|
|
25073
|
-
|
|
25463
|
+
join161("facets", DEFAULT_TAKT_RULE_DIR),
|
|
25074
25464
|
excludeToolDir
|
|
25075
25465
|
)
|
|
25076
25466
|
}
|
|
@@ -25088,8 +25478,8 @@ var TaktRule = class _TaktRule extends ToolRule {
|
|
|
25088
25478
|
validate = true,
|
|
25089
25479
|
relativeDirPath: overrideDirPath
|
|
25090
25480
|
}) {
|
|
25091
|
-
const dirPath = overrideDirPath ??
|
|
25092
|
-
const filePath =
|
|
25481
|
+
const dirPath = overrideDirPath ?? join161(".takt", "facets", DEFAULT_TAKT_RULE_DIR);
|
|
25482
|
+
const filePath = join161(outputRoot, dirPath, relativeFilePath);
|
|
25093
25483
|
const fileContent = await readFileContent(filePath);
|
|
25094
25484
|
const { body } = parseFrontmatter(fileContent, filePath);
|
|
25095
25485
|
return new _TaktRule({
|
|
@@ -25128,7 +25518,7 @@ var TaktRule = class _TaktRule extends ToolRule {
|
|
|
25128
25518
|
const stem = overrideName ?? sourceStem;
|
|
25129
25519
|
assertSafeTaktName({ name: stem, featureLabel: "rule", sourceLabel });
|
|
25130
25520
|
const relativeFilePath = `${stem}.md`;
|
|
25131
|
-
const relativeDirPath =
|
|
25521
|
+
const relativeDirPath = join161(".takt", "facets", DEFAULT_TAKT_RULE_DIR);
|
|
25132
25522
|
return new _TaktRule({
|
|
25133
25523
|
outputRoot,
|
|
25134
25524
|
relativeDirPath,
|
|
@@ -25153,7 +25543,7 @@ var TaktRule = class _TaktRule extends ToolRule {
|
|
|
25153
25543
|
};
|
|
25154
25544
|
|
|
25155
25545
|
// src/features/rules/warp-rule.ts
|
|
25156
|
-
import { join as
|
|
25546
|
+
import { join as join162 } from "path";
|
|
25157
25547
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
25158
25548
|
constructor({ fileContent, root, ...rest }) {
|
|
25159
25549
|
super({
|
|
@@ -25166,7 +25556,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
25166
25556
|
return {
|
|
25167
25557
|
root: {
|
|
25168
25558
|
relativeDirPath: ".",
|
|
25169
|
-
relativeFilePath: "
|
|
25559
|
+
relativeFilePath: "AGENTS.md"
|
|
25170
25560
|
},
|
|
25171
25561
|
nonRoot: {
|
|
25172
25562
|
relativeDirPath: buildToolPath(".warp", "memories", _options.excludeToolDir)
|
|
@@ -25179,8 +25569,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
25179
25569
|
validate = true
|
|
25180
25570
|
}) {
|
|
25181
25571
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
25182
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath :
|
|
25183
|
-
const fileContent = await readFileContent(
|
|
25572
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : join162(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
25573
|
+
const fileContent = await readFileContent(join162(outputRoot, relativePath));
|
|
25184
25574
|
return new _WarpRule({
|
|
25185
25575
|
outputRoot,
|
|
25186
25576
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -25196,7 +25586,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
25196
25586
|
validate = true
|
|
25197
25587
|
}) {
|
|
25198
25588
|
return new _WarpRule(
|
|
25199
|
-
this.
|
|
25589
|
+
this.buildToolRuleParamsAgentsmd({
|
|
25200
25590
|
outputRoot,
|
|
25201
25591
|
rulesyncRule,
|
|
25202
25592
|
validate,
|
|
@@ -25235,7 +25625,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
25235
25625
|
};
|
|
25236
25626
|
|
|
25237
25627
|
// src/features/rules/windsurf-rule.ts
|
|
25238
|
-
import { join as
|
|
25628
|
+
import { join as join163 } from "path";
|
|
25239
25629
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
25240
25630
|
static getSettablePaths(_options = {}) {
|
|
25241
25631
|
return {
|
|
@@ -25250,7 +25640,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
25250
25640
|
validate = true
|
|
25251
25641
|
}) {
|
|
25252
25642
|
const fileContent = await readFileContent(
|
|
25253
|
-
|
|
25643
|
+
join163(outputRoot, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
25254
25644
|
);
|
|
25255
25645
|
return new _WindsurfRule({
|
|
25256
25646
|
outputRoot,
|
|
@@ -25321,7 +25711,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
25321
25711
|
};
|
|
25322
25712
|
|
|
25323
25713
|
// src/features/rules/zed-rule.ts
|
|
25324
|
-
import { join as
|
|
25714
|
+
import { join as join164 } from "path";
|
|
25325
25715
|
var ZedRule = class _ZedRule extends ToolRule {
|
|
25326
25716
|
static getSettablePaths({
|
|
25327
25717
|
global,
|
|
@@ -25330,7 +25720,7 @@ var ZedRule = class _ZedRule extends ToolRule {
|
|
|
25330
25720
|
if (global) {
|
|
25331
25721
|
return {
|
|
25332
25722
|
root: {
|
|
25333
|
-
relativeDirPath: buildToolPath(
|
|
25723
|
+
relativeDirPath: buildToolPath(join164(".config", "zed"), ".", excludeToolDir),
|
|
25334
25724
|
relativeFilePath: "AGENTS.md"
|
|
25335
25725
|
}
|
|
25336
25726
|
};
|
|
@@ -25354,7 +25744,7 @@ var ZedRule = class _ZedRule extends ToolRule {
|
|
|
25354
25744
|
throw new Error(`ZedRule only supports root rules: ${relativeFilePath}`);
|
|
25355
25745
|
}
|
|
25356
25746
|
const fileContent = await readFileContent(
|
|
25357
|
-
|
|
25747
|
+
join164(outputRoot, paths.root.relativeDirPath, paths.root.relativeFilePath)
|
|
25358
25748
|
);
|
|
25359
25749
|
return new _ZedRule({
|
|
25360
25750
|
outputRoot,
|
|
@@ -25455,7 +25845,7 @@ var rulesProcessorToolTargets = [
|
|
|
25455
25845
|
"zed"
|
|
25456
25846
|
];
|
|
25457
25847
|
var RulesProcessorToolTargetSchema = z82.enum(rulesProcessorToolTargets);
|
|
25458
|
-
var formatRulePaths = (rules) => rules.map((r) =>
|
|
25848
|
+
var formatRulePaths = (rules) => rules.map((r) => join165(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
|
|
25459
25849
|
var RulesFeatureOptionsSchema = z82.looseObject({
|
|
25460
25850
|
ruleDiscoveryMode: z82.optional(z82.enum(["none", "explicit"])),
|
|
25461
25851
|
includeLocalRoot: z82.optional(z82.boolean())
|
|
@@ -25991,7 +26381,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
25991
26381
|
}).relativeDirPath;
|
|
25992
26382
|
return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
|
|
25993
26383
|
const frontmatter = skill.getFrontmatter();
|
|
25994
|
-
const relativePath =
|
|
26384
|
+
const relativePath = join165(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
|
|
25995
26385
|
return {
|
|
25996
26386
|
name: frontmatter.name,
|
|
25997
26387
|
description: frontmatter.description,
|
|
@@ -26120,8 +26510,8 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26120
26510
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
26121
26511
|
*/
|
|
26122
26512
|
async loadRulesyncFiles() {
|
|
26123
|
-
const rulesyncOutputRoot =
|
|
26124
|
-
const files = await findFilesByGlobs(
|
|
26513
|
+
const rulesyncOutputRoot = join165(this.inputRoot, RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
26514
|
+
const files = await findFilesByGlobs(join165(rulesyncOutputRoot, "**", "*.md"));
|
|
26125
26515
|
this.logger.debug(`Found ${files.length} rulesync files`);
|
|
26126
26516
|
const rulesyncRules = await Promise.all(
|
|
26127
26517
|
files.map((file) => {
|
|
@@ -26237,13 +26627,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26237
26627
|
return [];
|
|
26238
26628
|
}
|
|
26239
26629
|
const uniqueRootFilePaths = await findFilesWithFallback(
|
|
26240
|
-
|
|
26630
|
+
join165(
|
|
26241
26631
|
this.outputRoot,
|
|
26242
26632
|
settablePaths.root.relativeDirPath ?? ".",
|
|
26243
26633
|
settablePaths.root.relativeFilePath
|
|
26244
26634
|
),
|
|
26245
26635
|
settablePaths.alternativeRoots,
|
|
26246
|
-
(alt) =>
|
|
26636
|
+
(alt) => join165(this.outputRoot, alt.relativeDirPath, alt.relativeFilePath)
|
|
26247
26637
|
);
|
|
26248
26638
|
if (forDeletion) {
|
|
26249
26639
|
return buildDeletionRulesFromPaths(uniqueRootFilePaths);
|
|
@@ -26274,7 +26664,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26274
26664
|
return [];
|
|
26275
26665
|
}
|
|
26276
26666
|
const uniqueLocalRootFilePaths2 = await findFilesByGlobs(
|
|
26277
|
-
|
|
26667
|
+
join165(this.outputRoot, "AGENTS.local.md")
|
|
26278
26668
|
);
|
|
26279
26669
|
return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths2);
|
|
26280
26670
|
}
|
|
@@ -26285,9 +26675,9 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26285
26675
|
return [];
|
|
26286
26676
|
}
|
|
26287
26677
|
const uniqueLocalRootFilePaths = await findFilesWithFallback(
|
|
26288
|
-
|
|
26678
|
+
join165(this.outputRoot, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
|
|
26289
26679
|
settablePaths.alternativeRoots,
|
|
26290
|
-
(alt) =>
|
|
26680
|
+
(alt) => join165(this.outputRoot, alt.relativeDirPath, "CLAUDE.local.md")
|
|
26291
26681
|
);
|
|
26292
26682
|
return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths);
|
|
26293
26683
|
})();
|
|
@@ -26298,20 +26688,20 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26298
26688
|
if (!forDeletion || this.toolTarget !== "rovodev" || this.global) {
|
|
26299
26689
|
return [];
|
|
26300
26690
|
}
|
|
26301
|
-
const primaryPaths = await findFilesByGlobs(
|
|
26691
|
+
const primaryPaths = await findFilesByGlobs(join165(this.outputRoot, ".rovodev", "AGENTS.md"));
|
|
26302
26692
|
if (primaryPaths.length === 0) {
|
|
26303
26693
|
return [];
|
|
26304
26694
|
}
|
|
26305
|
-
const mirrorPaths = await findFilesByGlobs(
|
|
26695
|
+
const mirrorPaths = await findFilesByGlobs(join165(this.outputRoot, "AGENTS.md"));
|
|
26306
26696
|
return buildDeletionRulesFromPaths(mirrorPaths);
|
|
26307
26697
|
})();
|
|
26308
26698
|
const nonRootToolRules = await (async () => {
|
|
26309
26699
|
if (!settablePaths.nonRoot) {
|
|
26310
26700
|
return [];
|
|
26311
26701
|
}
|
|
26312
|
-
const nonRootOutputRoot =
|
|
26702
|
+
const nonRootOutputRoot = join165(this.outputRoot, settablePaths.nonRoot.relativeDirPath);
|
|
26313
26703
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
26314
|
-
|
|
26704
|
+
join165(nonRootOutputRoot, "**", `*.${factory.meta.extension}`)
|
|
26315
26705
|
);
|
|
26316
26706
|
if (forDeletion) {
|
|
26317
26707
|
return buildDeletionRulesFromPaths(nonRootFilePaths, {
|
|
@@ -26325,7 +26715,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26325
26715
|
const ok = RovodevRule.isAllowedModularRulesRelativePath(relativeFilePath);
|
|
26326
26716
|
if (!ok) {
|
|
26327
26717
|
this.logger.warn(
|
|
26328
|
-
`Skipping reserved Rovodev path under modular-rules (import): ${
|
|
26718
|
+
`Skipping reserved Rovodev path under modular-rules (import): ${join165(modularRootRelative, relativeFilePath)}`
|
|
26329
26719
|
);
|
|
26330
26720
|
}
|
|
26331
26721
|
return ok;
|
|
@@ -26451,14 +26841,14 @@ s/<command> [arguments]
|
|
|
26451
26841
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
26452
26842
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
26453
26843
|
|
|
26454
|
-
When users call a custom slash command, you have to look for the markdown file, \`${
|
|
26844
|
+
When users call a custom slash command, you have to look for the markdown file, \`${join165(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
26455
26845
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
26456
26846
|
|
|
26457
26847
|
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.
|
|
26458
26848
|
|
|
26459
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${
|
|
26849
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${join165(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
26460
26850
|
|
|
26461
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${
|
|
26851
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${join165(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
26462
26852
|
const skillsSection = skills ? this.generateSkillsSection(skills) : "";
|
|
26463
26853
|
const result = [
|
|
26464
26854
|
overview,
|
|
@@ -26716,7 +27106,7 @@ function buildPermissionsStrategy(ctx) {
|
|
|
26716
27106
|
}
|
|
26717
27107
|
|
|
26718
27108
|
// src/lib/generate.ts
|
|
26719
|
-
import { join as
|
|
27109
|
+
import { join as join166 } from "path";
|
|
26720
27110
|
import { intersection } from "es-toolkit";
|
|
26721
27111
|
async function processFeatureGeneration(params) {
|
|
26722
27112
|
const { config, processor, toolFiles } = params;
|
|
@@ -26790,7 +27180,7 @@ function warnUnsupportedTargets(params) {
|
|
|
26790
27180
|
}
|
|
26791
27181
|
}
|
|
26792
27182
|
async function checkRulesyncDirExists(params) {
|
|
26793
|
-
return fileExists(
|
|
27183
|
+
return fileExists(join166(params.inputRoot, RULESYNC_RELATIVE_DIR_PATH));
|
|
26794
27184
|
}
|
|
26795
27185
|
async function generate(params) {
|
|
26796
27186
|
const { config, logger } = params;
|