rulesync 8.23.0 → 8.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -36
- package/dist/{chunk-G2YWSXTU.js → chunk-KWUW4DM2.js} +891 -515
- package/dist/cli/index.cjs +1087 -710
- package/dist/cli/index.js +5 -4
- package/dist/index.cjs +921 -545
- package/dist/index.d.cts +29 -1
- package/dist/index.d.ts +29 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -379,6 +379,7 @@ var import_mini2 = require("zod/mini");
|
|
|
379
379
|
var ALL_TOOL_TARGETS = [
|
|
380
380
|
"agentsmd",
|
|
381
381
|
"agentsskills",
|
|
382
|
+
"amp",
|
|
382
383
|
"antigravity",
|
|
383
384
|
"antigravity-cli",
|
|
384
385
|
"antigravity-ide",
|
|
@@ -8082,8 +8083,19 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
8082
8083
|
// src/features/mcp/mcp-processor.ts
|
|
8083
8084
|
var import_mini29 = require("zod/mini");
|
|
8084
8085
|
|
|
8085
|
-
// src/features/mcp/
|
|
8086
|
+
// src/features/mcp/amp-mcp.ts
|
|
8086
8087
|
var import_node_path56 = require("path");
|
|
8088
|
+
var import_jsonc_parser3 = require("jsonc-parser");
|
|
8089
|
+
|
|
8090
|
+
// src/utils/prototype-pollution.ts
|
|
8091
|
+
var PROTOTYPE_POLLUTION_KEYS = /* @__PURE__ */ new Set([
|
|
8092
|
+
"__proto__",
|
|
8093
|
+
"constructor",
|
|
8094
|
+
"prototype"
|
|
8095
|
+
]);
|
|
8096
|
+
function isPrototypePollutionKey(key) {
|
|
8097
|
+
return PROTOTYPE_POLLUTION_KEYS.has(key);
|
|
8098
|
+
}
|
|
8087
8099
|
|
|
8088
8100
|
// src/features/mcp/rulesync-mcp.ts
|
|
8089
8101
|
var import_node_path55 = require("path");
|
|
@@ -8312,7 +8324,200 @@ var ToolMcp = class extends ToolFile {
|
|
|
8312
8324
|
}
|
|
8313
8325
|
};
|
|
8314
8326
|
|
|
8327
|
+
// src/features/mcp/amp-mcp.ts
|
|
8328
|
+
var AMP_MCP_SERVERS_KEY = "amp.mcpServers";
|
|
8329
|
+
function parseAmpSettingsJsonc(fileContent) {
|
|
8330
|
+
const errors = [];
|
|
8331
|
+
const parsed = (0, import_jsonc_parser3.parse)(fileContent || "{}", errors);
|
|
8332
|
+
if (errors.length > 0) {
|
|
8333
|
+
const details = errors.map((error) => `${(0, import_jsonc_parser3.printParseErrorCode)(error.error)} at offset ${error.offset}`).join(", ");
|
|
8334
|
+
throw new Error(`Failed to parse Amp settings: ${details}`);
|
|
8335
|
+
}
|
|
8336
|
+
if (!isRecord(parsed)) {
|
|
8337
|
+
throw new Error("Amp settings must be a JSON object");
|
|
8338
|
+
}
|
|
8339
|
+
return parsed;
|
|
8340
|
+
}
|
|
8341
|
+
function filterMcpServers(mcpServers) {
|
|
8342
|
+
const filtered = {};
|
|
8343
|
+
if (!isRecord(mcpServers)) return filtered;
|
|
8344
|
+
for (const [name, config] of Object.entries(mcpServers)) {
|
|
8345
|
+
if (isPrototypePollutionKey(name) || !isRecord(config)) continue;
|
|
8346
|
+
const filteredConfig = {};
|
|
8347
|
+
for (const [key, value] of Object.entries(config)) {
|
|
8348
|
+
if (isPrototypePollutionKey(key)) continue;
|
|
8349
|
+
filteredConfig[key] = value;
|
|
8350
|
+
}
|
|
8351
|
+
filtered[name] = filteredConfig;
|
|
8352
|
+
}
|
|
8353
|
+
return filtered;
|
|
8354
|
+
}
|
|
8355
|
+
var AmpMcp = class _AmpMcp extends ToolMcp {
|
|
8356
|
+
json;
|
|
8357
|
+
constructor(params) {
|
|
8358
|
+
super(params);
|
|
8359
|
+
this.json = parseAmpSettingsJsonc(this.fileContent);
|
|
8360
|
+
}
|
|
8361
|
+
getJson() {
|
|
8362
|
+
return structuredClone(this.json);
|
|
8363
|
+
}
|
|
8364
|
+
static getSettablePaths({ global } = {}) {
|
|
8365
|
+
if (global) {
|
|
8366
|
+
return {
|
|
8367
|
+
relativeDirPath: (0, import_node_path56.join)(".config", "amp"),
|
|
8368
|
+
relativeFilePath: "settings.jsonc"
|
|
8369
|
+
};
|
|
8370
|
+
}
|
|
8371
|
+
return {
|
|
8372
|
+
relativeDirPath: ".amp",
|
|
8373
|
+
relativeFilePath: "settings.jsonc"
|
|
8374
|
+
};
|
|
8375
|
+
}
|
|
8376
|
+
/**
|
|
8377
|
+
* Probe `<jsonDir>/settings.jsonc` first, falling back to `settings.json`,
|
|
8378
|
+
* so existing user files are read-modified-written in place instead of a
|
|
8379
|
+
* fresh `.json` sibling being created next to a hand-authored `.jsonc`.
|
|
8380
|
+
* Defaults to `settings.jsonc` when neither file exists.
|
|
8381
|
+
*/
|
|
8382
|
+
static async resolveSettingsFile(jsonDir) {
|
|
8383
|
+
const jsoncContent = await readFileContentOrNull((0, import_node_path56.join)(jsonDir, "settings.jsonc"));
|
|
8384
|
+
if (jsoncContent !== null) {
|
|
8385
|
+
return { fileContent: jsoncContent, relativeFilePath: "settings.jsonc" };
|
|
8386
|
+
}
|
|
8387
|
+
const jsonContent = await readFileContentOrNull((0, import_node_path56.join)(jsonDir, "settings.json"));
|
|
8388
|
+
if (jsonContent !== null) {
|
|
8389
|
+
return { fileContent: jsonContent, relativeFilePath: "settings.json" };
|
|
8390
|
+
}
|
|
8391
|
+
return { fileContent: null, relativeFilePath: "settings.jsonc" };
|
|
8392
|
+
}
|
|
8393
|
+
static async fromFile({
|
|
8394
|
+
outputRoot = process.cwd(),
|
|
8395
|
+
validate = true,
|
|
8396
|
+
global = false
|
|
8397
|
+
}) {
|
|
8398
|
+
const basePaths = this.getSettablePaths({ global });
|
|
8399
|
+
const jsonDir = (0, import_node_path56.join)(outputRoot, basePaths.relativeDirPath);
|
|
8400
|
+
const { fileContent, relativeFilePath } = await this.resolveSettingsFile(jsonDir);
|
|
8401
|
+
const json = fileContent ? parseAmpSettingsJsonc(fileContent) : {};
|
|
8402
|
+
const mcpServers = json[AMP_MCP_SERVERS_KEY];
|
|
8403
|
+
const newJson = { ...json, [AMP_MCP_SERVERS_KEY]: mcpServers ?? {} };
|
|
8404
|
+
return new _AmpMcp({
|
|
8405
|
+
outputRoot,
|
|
8406
|
+
relativeDirPath: basePaths.relativeDirPath,
|
|
8407
|
+
relativeFilePath,
|
|
8408
|
+
fileContent: JSON.stringify(newJson, null, 2),
|
|
8409
|
+
validate,
|
|
8410
|
+
global
|
|
8411
|
+
});
|
|
8412
|
+
}
|
|
8413
|
+
static async fromRulesyncMcp({
|
|
8414
|
+
outputRoot = process.cwd(),
|
|
8415
|
+
rulesyncMcp,
|
|
8416
|
+
validate = true,
|
|
8417
|
+
global = false
|
|
8418
|
+
}) {
|
|
8419
|
+
const basePaths = this.getSettablePaths({ global });
|
|
8420
|
+
const jsonDir = (0, import_node_path56.join)(outputRoot, basePaths.relativeDirPath);
|
|
8421
|
+
const { fileContent, relativeFilePath } = await this.resolveSettingsFile(jsonDir);
|
|
8422
|
+
const json = fileContent ? parseAmpSettingsJsonc(fileContent) : { [AMP_MCP_SERVERS_KEY]: {} };
|
|
8423
|
+
const filteredMcpServers = filterMcpServers(rulesyncMcp.getMcpServers());
|
|
8424
|
+
const newJson = { ...json, [AMP_MCP_SERVERS_KEY]: filteredMcpServers };
|
|
8425
|
+
return new _AmpMcp({
|
|
8426
|
+
outputRoot,
|
|
8427
|
+
relativeDirPath: basePaths.relativeDirPath,
|
|
8428
|
+
relativeFilePath,
|
|
8429
|
+
fileContent: JSON.stringify(newJson, null, 2),
|
|
8430
|
+
validate,
|
|
8431
|
+
global
|
|
8432
|
+
});
|
|
8433
|
+
}
|
|
8434
|
+
toRulesyncMcp() {
|
|
8435
|
+
const filtered = filterMcpServers(this.json[AMP_MCP_SERVERS_KEY]);
|
|
8436
|
+
return this.toRulesyncMcpDefault({
|
|
8437
|
+
fileContent: JSON.stringify({ mcpServers: filtered }, null, 2)
|
|
8438
|
+
});
|
|
8439
|
+
}
|
|
8440
|
+
validate() {
|
|
8441
|
+
let json;
|
|
8442
|
+
try {
|
|
8443
|
+
json = parseAmpSettingsJsonc(this.fileContent);
|
|
8444
|
+
} catch (error) {
|
|
8445
|
+
return {
|
|
8446
|
+
success: false,
|
|
8447
|
+
error: error instanceof Error ? error : new Error(String(error))
|
|
8448
|
+
};
|
|
8449
|
+
}
|
|
8450
|
+
for (const key of Object.keys(json)) {
|
|
8451
|
+
if (isPrototypePollutionKey(key)) {
|
|
8452
|
+
return {
|
|
8453
|
+
success: false,
|
|
8454
|
+
error: new Error(`Prototype pollution key "${key}" is not allowed`)
|
|
8455
|
+
};
|
|
8456
|
+
}
|
|
8457
|
+
}
|
|
8458
|
+
const mcpServers = json[AMP_MCP_SERVERS_KEY];
|
|
8459
|
+
if (mcpServers === void 0) {
|
|
8460
|
+
return { success: true, error: null };
|
|
8461
|
+
}
|
|
8462
|
+
if (!isRecord(mcpServers)) {
|
|
8463
|
+
return {
|
|
8464
|
+
success: false,
|
|
8465
|
+
error: new Error(`${AMP_MCP_SERVERS_KEY} must be a JSON object`)
|
|
8466
|
+
};
|
|
8467
|
+
}
|
|
8468
|
+
for (const [serverName, serverConfig] of Object.entries(mcpServers)) {
|
|
8469
|
+
if (isPrototypePollutionKey(serverName)) {
|
|
8470
|
+
return {
|
|
8471
|
+
success: false,
|
|
8472
|
+
error: new Error(
|
|
8473
|
+
`Server name "${serverName}" is a prototype pollution key and is not allowed`
|
|
8474
|
+
)
|
|
8475
|
+
};
|
|
8476
|
+
}
|
|
8477
|
+
if (!isRecord(serverConfig)) {
|
|
8478
|
+
return {
|
|
8479
|
+
success: false,
|
|
8480
|
+
error: new Error(`MCP server "${serverName}" must be a JSON object`)
|
|
8481
|
+
};
|
|
8482
|
+
}
|
|
8483
|
+
for (const key of Object.keys(serverConfig)) {
|
|
8484
|
+
if (isPrototypePollutionKey(key)) {
|
|
8485
|
+
return {
|
|
8486
|
+
success: false,
|
|
8487
|
+
error: new Error(
|
|
8488
|
+
`Config key "${key}" in server "${serverName}" is a prototype pollution key and is not allowed`
|
|
8489
|
+
)
|
|
8490
|
+
};
|
|
8491
|
+
}
|
|
8492
|
+
}
|
|
8493
|
+
}
|
|
8494
|
+
return { success: true, error: null };
|
|
8495
|
+
}
|
|
8496
|
+
/**
|
|
8497
|
+
* settings.json may contain other Amp settings, so it should not be deleted.
|
|
8498
|
+
*/
|
|
8499
|
+
isDeletable() {
|
|
8500
|
+
return false;
|
|
8501
|
+
}
|
|
8502
|
+
static forDeletion({
|
|
8503
|
+
outputRoot = process.cwd(),
|
|
8504
|
+
relativeDirPath,
|
|
8505
|
+
relativeFilePath,
|
|
8506
|
+
global = false
|
|
8507
|
+
}) {
|
|
8508
|
+
return new _AmpMcp({
|
|
8509
|
+
outputRoot,
|
|
8510
|
+
relativeDirPath,
|
|
8511
|
+
relativeFilePath,
|
|
8512
|
+
fileContent: "{}",
|
|
8513
|
+
validate: false,
|
|
8514
|
+
global
|
|
8515
|
+
});
|
|
8516
|
+
}
|
|
8517
|
+
};
|
|
8518
|
+
|
|
8315
8519
|
// src/features/mcp/antigravity-mcp.ts
|
|
8520
|
+
var import_node_path57 = require("path");
|
|
8316
8521
|
function renameServerField(servers, from, to) {
|
|
8317
8522
|
if (servers === null || typeof servers !== "object" || Array.isArray(servers)) {
|
|
8318
8523
|
return {};
|
|
@@ -8351,7 +8556,7 @@ var AntigravityMcp = class extends ToolMcp {
|
|
|
8351
8556
|
static getSettablePaths({ global } = {}) {
|
|
8352
8557
|
if (global) {
|
|
8353
8558
|
return {
|
|
8354
|
-
relativeDirPath: (0,
|
|
8559
|
+
relativeDirPath: (0, import_node_path57.join)(".gemini", this.getGlobalSubdir()),
|
|
8355
8560
|
relativeFilePath: "mcp_config.json"
|
|
8356
8561
|
};
|
|
8357
8562
|
}
|
|
@@ -8367,7 +8572,7 @@ var AntigravityMcp = class extends ToolMcp {
|
|
|
8367
8572
|
}) {
|
|
8368
8573
|
const paths = this.getSettablePaths({ global });
|
|
8369
8574
|
const fileContent = await readFileContentOrNull(
|
|
8370
|
-
(0,
|
|
8575
|
+
(0, import_node_path57.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
8371
8576
|
) ?? '{"mcpServers":{}}';
|
|
8372
8577
|
const json = JSON.parse(fileContent);
|
|
8373
8578
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
@@ -8388,7 +8593,7 @@ var AntigravityMcp = class extends ToolMcp {
|
|
|
8388
8593
|
}) {
|
|
8389
8594
|
const paths = this.getSettablePaths({ global });
|
|
8390
8595
|
const fileContent = await readOrInitializeFileContent(
|
|
8391
|
-
(0,
|
|
8596
|
+
(0, import_node_path57.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
8392
8597
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
8393
8598
|
);
|
|
8394
8599
|
const json = JSON.parse(fileContent);
|
|
@@ -8446,7 +8651,7 @@ var AntigravityIdeMcp = class extends AntigravityMcp {
|
|
|
8446
8651
|
};
|
|
8447
8652
|
|
|
8448
8653
|
// src/features/mcp/claudecode-mcp.ts
|
|
8449
|
-
var
|
|
8654
|
+
var import_node_path58 = require("path");
|
|
8450
8655
|
var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
8451
8656
|
json;
|
|
8452
8657
|
constructor(params) {
|
|
@@ -8492,7 +8697,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
8492
8697
|
logger
|
|
8493
8698
|
}) {
|
|
8494
8699
|
const paths = this.getSettablePaths({ global });
|
|
8495
|
-
const recommendedPath = (0,
|
|
8700
|
+
const recommendedPath = (0, import_node_path58.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
8496
8701
|
if (await fileExists(recommendedPath)) {
|
|
8497
8702
|
const fileContent = await readFileContent(recommendedPath);
|
|
8498
8703
|
const json = JSON.parse(fileContent);
|
|
@@ -8507,7 +8712,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
8507
8712
|
});
|
|
8508
8713
|
}
|
|
8509
8714
|
if (global) {
|
|
8510
|
-
const legacyPath = (0,
|
|
8715
|
+
const legacyPath = (0, import_node_path58.join)(
|
|
8511
8716
|
outputRoot,
|
|
8512
8717
|
_ClaudecodeMcp.LEGACY_GLOBAL_DIR,
|
|
8513
8718
|
_ClaudecodeMcp.LEGACY_GLOBAL_FILE
|
|
@@ -8546,7 +8751,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
8546
8751
|
}) {
|
|
8547
8752
|
const paths = this.getSettablePaths({ global });
|
|
8548
8753
|
const fileContent = await readOrInitializeFileContent(
|
|
8549
|
-
(0,
|
|
8754
|
+
(0, import_node_path58.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
8550
8755
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
8551
8756
|
);
|
|
8552
8757
|
const json = JSON.parse(fileContent);
|
|
@@ -8586,7 +8791,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
8586
8791
|
};
|
|
8587
8792
|
|
|
8588
8793
|
// src/features/mcp/cline-mcp.ts
|
|
8589
|
-
var
|
|
8794
|
+
var import_node_path59 = require("path");
|
|
8590
8795
|
var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
8591
8796
|
json;
|
|
8592
8797
|
constructor(params) {
|
|
@@ -8607,7 +8812,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
8607
8812
|
validate = true
|
|
8608
8813
|
}) {
|
|
8609
8814
|
const fileContent = await readFileContent(
|
|
8610
|
-
(0,
|
|
8815
|
+
(0, import_node_path59.join)(
|
|
8611
8816
|
outputRoot,
|
|
8612
8817
|
this.getSettablePaths().relativeDirPath,
|
|
8613
8818
|
this.getSettablePaths().relativeFilePath
|
|
@@ -8662,7 +8867,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
8662
8867
|
};
|
|
8663
8868
|
|
|
8664
8869
|
// src/features/mcp/codexcli-mcp.ts
|
|
8665
|
-
var
|
|
8870
|
+
var import_node_path60 = require("path");
|
|
8666
8871
|
var smolToml3 = __toESM(require("smol-toml"), 1);
|
|
8667
8872
|
var CODEX_TO_RULESYNC_FIELD_MAP = {
|
|
8668
8873
|
enabled_tools: "enabledTools",
|
|
@@ -8675,7 +8880,6 @@ var RULESYNC_TO_CODEX_FIELD_MAP = {
|
|
|
8675
8880
|
envVars: "env_vars"
|
|
8676
8881
|
};
|
|
8677
8882
|
var MAX_REMOVE_EMPTY_ENTRIES_DEPTH = 32;
|
|
8678
|
-
var PROTOTYPE_POLLUTION_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
8679
8883
|
function convertFromCodexFormat(codexMcp) {
|
|
8680
8884
|
const result = {};
|
|
8681
8885
|
for (const [name, config] of Object.entries(codexMcp)) {
|
|
@@ -8773,7 +8977,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
8773
8977
|
}) {
|
|
8774
8978
|
const paths = this.getSettablePaths({ global });
|
|
8775
8979
|
const fileContent = await readFileContentOrNull(
|
|
8776
|
-
(0,
|
|
8980
|
+
(0, import_node_path60.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
8777
8981
|
) ?? smolToml3.stringify({});
|
|
8778
8982
|
return new _CodexcliMcp({
|
|
8779
8983
|
outputRoot,
|
|
@@ -8790,7 +8994,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
8790
8994
|
global = false
|
|
8791
8995
|
}) {
|
|
8792
8996
|
const paths = this.getSettablePaths({ global });
|
|
8793
|
-
const configTomlFilePath = (0,
|
|
8997
|
+
const configTomlFilePath = (0, import_node_path60.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
8794
8998
|
const configTomlFileContent = await readOrInitializeFileContent(
|
|
8795
8999
|
configTomlFilePath,
|
|
8796
9000
|
smolToml3.stringify({})
|
|
@@ -8880,7 +9084,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
8880
9084
|
};
|
|
8881
9085
|
|
|
8882
9086
|
// src/features/mcp/copilot-mcp.ts
|
|
8883
|
-
var
|
|
9087
|
+
var import_node_path61 = require("path");
|
|
8884
9088
|
function convertToCopilotFormat(mcpServers) {
|
|
8885
9089
|
return { servers: mcpServers };
|
|
8886
9090
|
}
|
|
@@ -8907,7 +9111,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
8907
9111
|
validate = true
|
|
8908
9112
|
}) {
|
|
8909
9113
|
const fileContent = await readFileContent(
|
|
8910
|
-
(0,
|
|
9114
|
+
(0, import_node_path61.join)(
|
|
8911
9115
|
outputRoot,
|
|
8912
9116
|
this.getSettablePaths().relativeDirPath,
|
|
8913
9117
|
this.getSettablePaths().relativeFilePath
|
|
@@ -8960,7 +9164,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
8960
9164
|
};
|
|
8961
9165
|
|
|
8962
9166
|
// src/features/mcp/copilotcli-mcp.ts
|
|
8963
|
-
var
|
|
9167
|
+
var import_node_path62 = require("path");
|
|
8964
9168
|
var isRemoteServerType = (type) => {
|
|
8965
9169
|
return type === "http" || type === "sse";
|
|
8966
9170
|
};
|
|
@@ -9059,7 +9263,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
|
|
|
9059
9263
|
}) {
|
|
9060
9264
|
const paths = this.getSettablePaths({ global });
|
|
9061
9265
|
const fileContent = await readFileContentOrNull(
|
|
9062
|
-
(0,
|
|
9266
|
+
(0, import_node_path62.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
9063
9267
|
) ?? '{"mcpServers":{}}';
|
|
9064
9268
|
const json = JSON.parse(fileContent);
|
|
9065
9269
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
@@ -9080,7 +9284,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
|
|
|
9080
9284
|
}) {
|
|
9081
9285
|
const paths = this.getSettablePaths({ global });
|
|
9082
9286
|
const fileContent = await readOrInitializeFileContent(
|
|
9083
|
-
(0,
|
|
9287
|
+
(0, import_node_path62.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
9084
9288
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
9085
9289
|
);
|
|
9086
9290
|
const json = JSON.parse(fileContent);
|
|
@@ -9122,7 +9326,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
|
|
|
9122
9326
|
};
|
|
9123
9327
|
|
|
9124
9328
|
// src/features/mcp/cursor-mcp.ts
|
|
9125
|
-
var
|
|
9329
|
+
var import_node_path63 = require("path");
|
|
9126
9330
|
|
|
9127
9331
|
// src/features/mcp/mcp-env-var-format.ts
|
|
9128
9332
|
var CANONICAL_ENV_VAR_PATTERN = /\$\{(?!env:)([^}:]+)\}/g;
|
|
@@ -9193,7 +9397,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
9193
9397
|
this.json = JSON.parse(this.fileContent);
|
|
9194
9398
|
} catch (error) {
|
|
9195
9399
|
throw new Error(
|
|
9196
|
-
`Failed to parse Cursor MCP config at ${(0,
|
|
9400
|
+
`Failed to parse Cursor MCP config at ${(0, import_node_path63.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(error)}`,
|
|
9197
9401
|
{ cause: error }
|
|
9198
9402
|
);
|
|
9199
9403
|
}
|
|
@@ -9219,14 +9423,14 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
9219
9423
|
global = false
|
|
9220
9424
|
}) {
|
|
9221
9425
|
const paths = this.getSettablePaths({ global });
|
|
9222
|
-
const filePath = (0,
|
|
9426
|
+
const filePath = (0, import_node_path63.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
9223
9427
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"mcpServers":{}}';
|
|
9224
9428
|
let json;
|
|
9225
9429
|
try {
|
|
9226
9430
|
json = JSON.parse(fileContent);
|
|
9227
9431
|
} catch (error) {
|
|
9228
9432
|
throw new Error(
|
|
9229
|
-
`Failed to parse Cursor MCP config at ${(0,
|
|
9433
|
+
`Failed to parse Cursor MCP config at ${(0, import_node_path63.join)(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
|
|
9230
9434
|
{ cause: error }
|
|
9231
9435
|
);
|
|
9232
9436
|
}
|
|
@@ -9248,7 +9452,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
9248
9452
|
}) {
|
|
9249
9453
|
const paths = this.getSettablePaths({ global });
|
|
9250
9454
|
const fileContent = await readOrInitializeFileContent(
|
|
9251
|
-
(0,
|
|
9455
|
+
(0, import_node_path63.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
9252
9456
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
9253
9457
|
);
|
|
9254
9458
|
let json;
|
|
@@ -9256,7 +9460,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
9256
9460
|
json = JSON.parse(fileContent);
|
|
9257
9461
|
} catch (error) {
|
|
9258
9462
|
throw new Error(
|
|
9259
|
-
`Failed to parse Cursor MCP config at ${(0,
|
|
9463
|
+
`Failed to parse Cursor MCP config at ${(0, import_node_path63.join)(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
|
|
9260
9464
|
{ cause: error }
|
|
9261
9465
|
);
|
|
9262
9466
|
}
|
|
@@ -9310,7 +9514,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
9310
9514
|
};
|
|
9311
9515
|
|
|
9312
9516
|
// src/features/mcp/deepagents-mcp.ts
|
|
9313
|
-
var
|
|
9517
|
+
var import_node_path64 = require("path");
|
|
9314
9518
|
var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
|
|
9315
9519
|
json;
|
|
9316
9520
|
constructor(params) {
|
|
@@ -9336,7 +9540,7 @@ var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
|
|
|
9336
9540
|
}) {
|
|
9337
9541
|
const paths = this.getSettablePaths({ global });
|
|
9338
9542
|
const fileContent = await readFileContentOrNull(
|
|
9339
|
-
(0,
|
|
9543
|
+
(0, import_node_path64.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
9340
9544
|
) ?? '{"mcpServers":{}}';
|
|
9341
9545
|
const json = JSON.parse(fileContent);
|
|
9342
9546
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
@@ -9356,7 +9560,7 @@ var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
|
|
|
9356
9560
|
}) {
|
|
9357
9561
|
const paths = this.getSettablePaths({ global });
|
|
9358
9562
|
const fileContent = await readOrInitializeFileContent(
|
|
9359
|
-
(0,
|
|
9563
|
+
(0, import_node_path64.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
9360
9564
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
9361
9565
|
);
|
|
9362
9566
|
const json = JSON.parse(fileContent);
|
|
@@ -9395,7 +9599,7 @@ var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
|
|
|
9395
9599
|
};
|
|
9396
9600
|
|
|
9397
9601
|
// src/features/mcp/factorydroid-mcp.ts
|
|
9398
|
-
var
|
|
9602
|
+
var import_node_path65 = require("path");
|
|
9399
9603
|
var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
9400
9604
|
json;
|
|
9401
9605
|
constructor(params) {
|
|
@@ -9416,7 +9620,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
9416
9620
|
validate = true
|
|
9417
9621
|
}) {
|
|
9418
9622
|
const fileContent = await readFileContent(
|
|
9419
|
-
(0,
|
|
9623
|
+
(0, import_node_path65.join)(
|
|
9420
9624
|
outputRoot,
|
|
9421
9625
|
this.getSettablePaths().relativeDirPath,
|
|
9422
9626
|
this.getSettablePaths().relativeFilePath
|
|
@@ -9470,7 +9674,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
9470
9674
|
};
|
|
9471
9675
|
|
|
9472
9676
|
// src/features/mcp/geminicli-mcp.ts
|
|
9473
|
-
var
|
|
9677
|
+
var import_node_path66 = require("path");
|
|
9474
9678
|
var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
9475
9679
|
json;
|
|
9476
9680
|
constructor(params) {
|
|
@@ -9499,7 +9703,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
9499
9703
|
}) {
|
|
9500
9704
|
const paths = this.getSettablePaths({ global });
|
|
9501
9705
|
const fileContent = await readFileContentOrNull(
|
|
9502
|
-
(0,
|
|
9706
|
+
(0, import_node_path66.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
9503
9707
|
) ?? '{"mcpServers":{}}';
|
|
9504
9708
|
const json = JSON.parse(fileContent);
|
|
9505
9709
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
@@ -9519,7 +9723,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
9519
9723
|
}) {
|
|
9520
9724
|
const paths = this.getSettablePaths({ global });
|
|
9521
9725
|
const fileContent = await readOrInitializeFileContent(
|
|
9522
|
-
(0,
|
|
9726
|
+
(0, import_node_path66.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
9523
9727
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
9524
9728
|
);
|
|
9525
9729
|
const json = JSON.parse(fileContent);
|
|
@@ -9564,7 +9768,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
9564
9768
|
};
|
|
9565
9769
|
|
|
9566
9770
|
// src/features/mcp/junie-mcp.ts
|
|
9567
|
-
var
|
|
9771
|
+
var import_node_path67 = require("path");
|
|
9568
9772
|
var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
9569
9773
|
json;
|
|
9570
9774
|
constructor(params) {
|
|
@@ -9576,7 +9780,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
9576
9780
|
}
|
|
9577
9781
|
static getSettablePaths() {
|
|
9578
9782
|
return {
|
|
9579
|
-
relativeDirPath: (0,
|
|
9783
|
+
relativeDirPath: (0, import_node_path67.join)(".junie", "mcp"),
|
|
9580
9784
|
relativeFilePath: "mcp.json"
|
|
9581
9785
|
};
|
|
9582
9786
|
}
|
|
@@ -9585,7 +9789,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
9585
9789
|
validate = true
|
|
9586
9790
|
}) {
|
|
9587
9791
|
const fileContent = await readFileContent(
|
|
9588
|
-
(0,
|
|
9792
|
+
(0, import_node_path67.join)(
|
|
9589
9793
|
outputRoot,
|
|
9590
9794
|
this.getSettablePaths().relativeDirPath,
|
|
9591
9795
|
this.getSettablePaths().relativeFilePath
|
|
@@ -9640,8 +9844,8 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
9640
9844
|
};
|
|
9641
9845
|
|
|
9642
9846
|
// src/features/mcp/kilo-mcp.ts
|
|
9643
|
-
var
|
|
9644
|
-
var
|
|
9847
|
+
var import_node_path68 = require("path");
|
|
9848
|
+
var import_jsonc_parser4 = require("jsonc-parser");
|
|
9645
9849
|
var import_mini27 = require("zod/mini");
|
|
9646
9850
|
var KiloMcpLocalServerSchema = import_mini27.z.object({
|
|
9647
9851
|
type: import_mini27.z.literal("local"),
|
|
@@ -9764,7 +9968,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9764
9968
|
json;
|
|
9765
9969
|
constructor(params) {
|
|
9766
9970
|
super(params);
|
|
9767
|
-
this.json = KiloConfigSchema.parse((0,
|
|
9971
|
+
this.json = KiloConfigSchema.parse((0, import_jsonc_parser4.parse)(this.fileContent || "{}"));
|
|
9768
9972
|
}
|
|
9769
9973
|
getJson() {
|
|
9770
9974
|
return this.json;
|
|
@@ -9778,7 +9982,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9778
9982
|
static getSettablePaths({ global } = {}) {
|
|
9779
9983
|
if (global) {
|
|
9780
9984
|
return {
|
|
9781
|
-
relativeDirPath: (0,
|
|
9985
|
+
relativeDirPath: (0, import_node_path68.join)(".config", "kilo"),
|
|
9782
9986
|
relativeFilePath: "kilo.json"
|
|
9783
9987
|
};
|
|
9784
9988
|
}
|
|
@@ -9793,11 +9997,11 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9793
9997
|
global = false
|
|
9794
9998
|
}) {
|
|
9795
9999
|
const basePaths = this.getSettablePaths({ global });
|
|
9796
|
-
const jsonDir = (0,
|
|
10000
|
+
const jsonDir = (0, import_node_path68.join)(outputRoot, basePaths.relativeDirPath);
|
|
9797
10001
|
let fileContent = null;
|
|
9798
10002
|
let relativeFilePath = "kilo.jsonc";
|
|
9799
|
-
const jsoncPath = (0,
|
|
9800
|
-
const jsonPath = (0,
|
|
10003
|
+
const jsoncPath = (0, import_node_path68.join)(jsonDir, "kilo.jsonc");
|
|
10004
|
+
const jsonPath = (0, import_node_path68.join)(jsonDir, "kilo.json");
|
|
9801
10005
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
9802
10006
|
if (!fileContent) {
|
|
9803
10007
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -9806,7 +10010,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9806
10010
|
}
|
|
9807
10011
|
}
|
|
9808
10012
|
const fileContentToUse = fileContent ?? '{"mcp":{}}';
|
|
9809
|
-
const json = (0,
|
|
10013
|
+
const json = (0, import_jsonc_parser4.parse)(fileContentToUse);
|
|
9810
10014
|
const newJson = { ...json, mcp: json.mcp ?? {} };
|
|
9811
10015
|
return new _KiloMcp({
|
|
9812
10016
|
outputRoot,
|
|
@@ -9823,11 +10027,11 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9823
10027
|
global = false
|
|
9824
10028
|
}) {
|
|
9825
10029
|
const basePaths = this.getSettablePaths({ global });
|
|
9826
|
-
const jsonDir = (0,
|
|
10030
|
+
const jsonDir = (0, import_node_path68.join)(outputRoot, basePaths.relativeDirPath);
|
|
9827
10031
|
let fileContent = null;
|
|
9828
10032
|
let relativeFilePath = "kilo.jsonc";
|
|
9829
|
-
const jsoncPath = (0,
|
|
9830
|
-
const jsonPath = (0,
|
|
10033
|
+
const jsoncPath = (0, import_node_path68.join)(jsonDir, "kilo.jsonc");
|
|
10034
|
+
const jsonPath = (0, import_node_path68.join)(jsonDir, "kilo.json");
|
|
9831
10035
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
9832
10036
|
if (!fileContent) {
|
|
9833
10037
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -9838,7 +10042,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9838
10042
|
if (!fileContent) {
|
|
9839
10043
|
fileContent = JSON.stringify({ mcp: {} }, null, 2);
|
|
9840
10044
|
}
|
|
9841
|
-
const json = (0,
|
|
10045
|
+
const json = (0, import_jsonc_parser4.parse)(fileContent);
|
|
9842
10046
|
const { mcp: convertedMcp, tools: mcpTools } = convertToKiloFormat(rulesyncMcp.getMcpServers());
|
|
9843
10047
|
const { tools: _existingTools, ...jsonWithoutTools } = json;
|
|
9844
10048
|
const newJson = {
|
|
@@ -9886,7 +10090,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9886
10090
|
};
|
|
9887
10091
|
|
|
9888
10092
|
// src/features/mcp/kiro-mcp.ts
|
|
9889
|
-
var
|
|
10093
|
+
var import_node_path69 = require("path");
|
|
9890
10094
|
var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
9891
10095
|
json;
|
|
9892
10096
|
constructor(params) {
|
|
@@ -9898,7 +10102,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
9898
10102
|
}
|
|
9899
10103
|
static getSettablePaths() {
|
|
9900
10104
|
return {
|
|
9901
|
-
relativeDirPath: (0,
|
|
10105
|
+
relativeDirPath: (0, import_node_path69.join)(".kiro", "settings"),
|
|
9902
10106
|
relativeFilePath: "mcp.json"
|
|
9903
10107
|
};
|
|
9904
10108
|
}
|
|
@@ -9908,7 +10112,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
9908
10112
|
}) {
|
|
9909
10113
|
const paths = this.getSettablePaths();
|
|
9910
10114
|
const fileContent = await readFileContentOrNull(
|
|
9911
|
-
(0,
|
|
10115
|
+
(0, import_node_path69.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
9912
10116
|
) ?? '{"mcpServers":{}}';
|
|
9913
10117
|
return new _KiroMcp({
|
|
9914
10118
|
outputRoot,
|
|
@@ -9957,8 +10161,8 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
9957
10161
|
};
|
|
9958
10162
|
|
|
9959
10163
|
// src/features/mcp/opencode-mcp.ts
|
|
9960
|
-
var
|
|
9961
|
-
var
|
|
10164
|
+
var import_node_path70 = require("path");
|
|
10165
|
+
var import_jsonc_parser5 = require("jsonc-parser");
|
|
9962
10166
|
var import_mini28 = require("zod/mini");
|
|
9963
10167
|
var OPENCODE_ENV_VAR_PATTERN = /(?<!\$)\{env:([^}:]+)\}/g;
|
|
9964
10168
|
var OpencodeMcpLocalServerSchema = import_mini28.z.object({
|
|
@@ -10085,7 +10289,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10085
10289
|
json;
|
|
10086
10290
|
constructor(params) {
|
|
10087
10291
|
super(params);
|
|
10088
|
-
this.json = OpencodeConfigSchema.parse((0,
|
|
10292
|
+
this.json = OpencodeConfigSchema.parse((0, import_jsonc_parser5.parse)(this.fileContent || "{}"));
|
|
10089
10293
|
}
|
|
10090
10294
|
getJson() {
|
|
10091
10295
|
return this.json;
|
|
@@ -10099,7 +10303,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10099
10303
|
static getSettablePaths({ global } = {}) {
|
|
10100
10304
|
if (global) {
|
|
10101
10305
|
return {
|
|
10102
|
-
relativeDirPath: (0,
|
|
10306
|
+
relativeDirPath: (0, import_node_path70.join)(".config", "opencode"),
|
|
10103
10307
|
relativeFilePath: "opencode.json"
|
|
10104
10308
|
};
|
|
10105
10309
|
}
|
|
@@ -10114,11 +10318,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10114
10318
|
global = false
|
|
10115
10319
|
}) {
|
|
10116
10320
|
const basePaths = this.getSettablePaths({ global });
|
|
10117
|
-
const jsonDir = (0,
|
|
10321
|
+
const jsonDir = (0, import_node_path70.join)(outputRoot, basePaths.relativeDirPath);
|
|
10118
10322
|
let fileContent = null;
|
|
10119
10323
|
let relativeFilePath = "opencode.jsonc";
|
|
10120
|
-
const jsoncPath = (0,
|
|
10121
|
-
const jsonPath = (0,
|
|
10324
|
+
const jsoncPath = (0, import_node_path70.join)(jsonDir, "opencode.jsonc");
|
|
10325
|
+
const jsonPath = (0, import_node_path70.join)(jsonDir, "opencode.json");
|
|
10122
10326
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
10123
10327
|
if (!fileContent) {
|
|
10124
10328
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -10127,7 +10331,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10127
10331
|
}
|
|
10128
10332
|
}
|
|
10129
10333
|
const fileContentToUse = fileContent ?? '{"mcp":{}}';
|
|
10130
|
-
const json = (0,
|
|
10334
|
+
const json = (0, import_jsonc_parser5.parse)(fileContentToUse);
|
|
10131
10335
|
const newJson = { ...json, mcp: json.mcp ?? {} };
|
|
10132
10336
|
return new _OpencodeMcp({
|
|
10133
10337
|
outputRoot,
|
|
@@ -10144,11 +10348,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10144
10348
|
global = false
|
|
10145
10349
|
}) {
|
|
10146
10350
|
const basePaths = this.getSettablePaths({ global });
|
|
10147
|
-
const jsonDir = (0,
|
|
10351
|
+
const jsonDir = (0, import_node_path70.join)(outputRoot, basePaths.relativeDirPath);
|
|
10148
10352
|
let fileContent = null;
|
|
10149
10353
|
let relativeFilePath = "opencode.jsonc";
|
|
10150
|
-
const jsoncPath = (0,
|
|
10151
|
-
const jsonPath = (0,
|
|
10354
|
+
const jsoncPath = (0, import_node_path70.join)(jsonDir, "opencode.jsonc");
|
|
10355
|
+
const jsonPath = (0, import_node_path70.join)(jsonDir, "opencode.json");
|
|
10152
10356
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
10153
10357
|
if (!fileContent) {
|
|
10154
10358
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -10159,7 +10363,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10159
10363
|
if (!fileContent) {
|
|
10160
10364
|
fileContent = JSON.stringify({ mcp: {} }, null, 2);
|
|
10161
10365
|
}
|
|
10162
|
-
const json = (0,
|
|
10366
|
+
const json = (0, import_jsonc_parser5.parse)(fileContent);
|
|
10163
10367
|
const mcpServers = rulesyncMcp.getMcpServers();
|
|
10164
10368
|
const transformedServers = convertEnvVarRefsToToolFormat({
|
|
10165
10369
|
mcpServers,
|
|
@@ -10216,7 +10420,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10216
10420
|
};
|
|
10217
10421
|
|
|
10218
10422
|
// src/features/mcp/roo-mcp.ts
|
|
10219
|
-
var
|
|
10423
|
+
var import_node_path71 = require("path");
|
|
10220
10424
|
function convertToRooFormat(mcpServers) {
|
|
10221
10425
|
return Object.fromEntries(
|
|
10222
10426
|
Object.entries(mcpServers).map(([serverName, serverConfig]) => {
|
|
@@ -10268,7 +10472,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
10268
10472
|
validate = true
|
|
10269
10473
|
}) {
|
|
10270
10474
|
const fileContent = await readFileContent(
|
|
10271
|
-
(0,
|
|
10475
|
+
(0, import_node_path71.join)(
|
|
10272
10476
|
outputRoot,
|
|
10273
10477
|
this.getSettablePaths().relativeDirPath,
|
|
10274
10478
|
this.getSettablePaths().relativeFilePath
|
|
@@ -10323,9 +10527,9 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
10323
10527
|
};
|
|
10324
10528
|
|
|
10325
10529
|
// src/features/mcp/rovodev-mcp.ts
|
|
10326
|
-
var
|
|
10530
|
+
var import_node_path72 = require("path");
|
|
10327
10531
|
function parseRovodevMcpJson(fileContent, relativeDirPath, relativeFilePath) {
|
|
10328
|
-
const configPath = (0,
|
|
10532
|
+
const configPath = (0, import_node_path72.join)(relativeDirPath, relativeFilePath);
|
|
10329
10533
|
let parsed;
|
|
10330
10534
|
try {
|
|
10331
10535
|
parsed = JSON.parse(fileContent);
|
|
@@ -10374,7 +10578,7 @@ var RovodevMcp = class _RovodevMcp extends ToolMcp {
|
|
|
10374
10578
|
throw new Error("Rovodev MCP is global-only; use --global to sync ~/.rovodev/mcp.json");
|
|
10375
10579
|
}
|
|
10376
10580
|
const paths = this.getSettablePaths({ global });
|
|
10377
|
-
const filePath = (0,
|
|
10581
|
+
const filePath = (0, import_node_path72.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
10378
10582
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"mcpServers":{}}';
|
|
10379
10583
|
const json = parseRovodevMcpJson(fileContent, paths.relativeDirPath, paths.relativeFilePath);
|
|
10380
10584
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
@@ -10398,7 +10602,7 @@ var RovodevMcp = class _RovodevMcp extends ToolMcp {
|
|
|
10398
10602
|
}
|
|
10399
10603
|
const paths = this.getSettablePaths({ global });
|
|
10400
10604
|
const fileContent = await readOrInitializeFileContent(
|
|
10401
|
-
(0,
|
|
10605
|
+
(0, import_node_path72.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
10402
10606
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
10403
10607
|
);
|
|
10404
10608
|
const json = parseRovodevMcpJson(fileContent, paths.relativeDirPath, paths.relativeFilePath);
|
|
@@ -10439,8 +10643,101 @@ var RovodevMcp = class _RovodevMcp extends ToolMcp {
|
|
|
10439
10643
|
}
|
|
10440
10644
|
};
|
|
10441
10645
|
|
|
10646
|
+
// src/features/mcp/warp-mcp.ts
|
|
10647
|
+
var import_node_path73 = require("path");
|
|
10648
|
+
var WarpMcp = class _WarpMcp extends ToolMcp {
|
|
10649
|
+
json;
|
|
10650
|
+
constructor(params) {
|
|
10651
|
+
super(params);
|
|
10652
|
+
this.json = this.fileContent !== void 0 ? _WarpMcp.parseJsonOrThrow(this.fileContent, this.relativeDirPath, this.relativeFilePath) : {};
|
|
10653
|
+
}
|
|
10654
|
+
getJson() {
|
|
10655
|
+
return this.json;
|
|
10656
|
+
}
|
|
10657
|
+
static parseJsonOrThrow(content, relativeDirPath, relativeFilePath) {
|
|
10658
|
+
try {
|
|
10659
|
+
return JSON.parse(content);
|
|
10660
|
+
} catch (error) {
|
|
10661
|
+
throw new Error(
|
|
10662
|
+
`Failed to parse Warp MCP config at ${(0, import_node_path73.join)(relativeDirPath, relativeFilePath)}: ${formatError(error)}`,
|
|
10663
|
+
{ cause: error }
|
|
10664
|
+
);
|
|
10665
|
+
}
|
|
10666
|
+
}
|
|
10667
|
+
static getSettablePaths(_options) {
|
|
10668
|
+
return {
|
|
10669
|
+
relativeDirPath: ".warp",
|
|
10670
|
+
relativeFilePath: ".mcp.json"
|
|
10671
|
+
};
|
|
10672
|
+
}
|
|
10673
|
+
static async fromFile({
|
|
10674
|
+
outputRoot = process.cwd(),
|
|
10675
|
+
validate = true,
|
|
10676
|
+
global = false
|
|
10677
|
+
}) {
|
|
10678
|
+
const paths = this.getSettablePaths({ global });
|
|
10679
|
+
const filePath = (0, import_node_path73.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
10680
|
+
const fileContent = await readFileContentOrNull(filePath) ?? '{"mcpServers":{}}';
|
|
10681
|
+
const json = this.parseJsonOrThrow(fileContent, paths.relativeDirPath, paths.relativeFilePath);
|
|
10682
|
+
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
10683
|
+
return new _WarpMcp({
|
|
10684
|
+
outputRoot,
|
|
10685
|
+
relativeDirPath: paths.relativeDirPath,
|
|
10686
|
+
relativeFilePath: paths.relativeFilePath,
|
|
10687
|
+
fileContent: JSON.stringify(newJson, null, 2),
|
|
10688
|
+
validate,
|
|
10689
|
+
global
|
|
10690
|
+
});
|
|
10691
|
+
}
|
|
10692
|
+
static async fromRulesyncMcp({
|
|
10693
|
+
outputRoot = process.cwd(),
|
|
10694
|
+
rulesyncMcp,
|
|
10695
|
+
validate = true,
|
|
10696
|
+
global = false
|
|
10697
|
+
}) {
|
|
10698
|
+
const paths = this.getSettablePaths({ global });
|
|
10699
|
+
const fileContent = await readOrInitializeFileContent(
|
|
10700
|
+
(0, import_node_path73.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
10701
|
+
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
10702
|
+
);
|
|
10703
|
+
const json = this.parseJsonOrThrow(fileContent, paths.relativeDirPath, paths.relativeFilePath);
|
|
10704
|
+
const warpConfig = { ...json, mcpServers: rulesyncMcp.getMcpServers() };
|
|
10705
|
+
return new _WarpMcp({
|
|
10706
|
+
outputRoot,
|
|
10707
|
+
relativeDirPath: paths.relativeDirPath,
|
|
10708
|
+
relativeFilePath: paths.relativeFilePath,
|
|
10709
|
+
fileContent: JSON.stringify(warpConfig, null, 2),
|
|
10710
|
+
validate,
|
|
10711
|
+
global
|
|
10712
|
+
});
|
|
10713
|
+
}
|
|
10714
|
+
toRulesyncMcp() {
|
|
10715
|
+
return this.toRulesyncMcpDefault({
|
|
10716
|
+
fileContent: JSON.stringify({ mcpServers: this.json.mcpServers ?? {} }, null, 2)
|
|
10717
|
+
});
|
|
10718
|
+
}
|
|
10719
|
+
validate() {
|
|
10720
|
+
return { success: true, error: null };
|
|
10721
|
+
}
|
|
10722
|
+
static forDeletion({
|
|
10723
|
+
outputRoot = process.cwd(),
|
|
10724
|
+
relativeDirPath,
|
|
10725
|
+
relativeFilePath,
|
|
10726
|
+
global = false
|
|
10727
|
+
}) {
|
|
10728
|
+
return new _WarpMcp({
|
|
10729
|
+
outputRoot,
|
|
10730
|
+
relativeDirPath,
|
|
10731
|
+
relativeFilePath,
|
|
10732
|
+
fileContent: "{}",
|
|
10733
|
+
validate: false,
|
|
10734
|
+
global
|
|
10735
|
+
});
|
|
10736
|
+
}
|
|
10737
|
+
};
|
|
10738
|
+
|
|
10442
10739
|
// src/features/mcp/zed-mcp.ts
|
|
10443
|
-
var
|
|
10740
|
+
var import_node_path74 = require("path");
|
|
10444
10741
|
var ZedMcp = class _ZedMcp extends ToolMcp {
|
|
10445
10742
|
json;
|
|
10446
10743
|
constructor(params) {
|
|
@@ -10453,7 +10750,7 @@ var ZedMcp = class _ZedMcp extends ToolMcp {
|
|
|
10453
10750
|
static getSettablePaths({ global } = {}) {
|
|
10454
10751
|
if (global) {
|
|
10455
10752
|
return {
|
|
10456
|
-
relativeDirPath: (0,
|
|
10753
|
+
relativeDirPath: (0, import_node_path74.join)(".config", "zed"),
|
|
10457
10754
|
relativeFilePath: "settings.json"
|
|
10458
10755
|
};
|
|
10459
10756
|
}
|
|
@@ -10469,7 +10766,7 @@ var ZedMcp = class _ZedMcp extends ToolMcp {
|
|
|
10469
10766
|
}) {
|
|
10470
10767
|
const paths = this.getSettablePaths({ global });
|
|
10471
10768
|
const fileContent = await readFileContentOrNull(
|
|
10472
|
-
(0,
|
|
10769
|
+
(0, import_node_path74.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
10473
10770
|
) ?? "{}";
|
|
10474
10771
|
const json = JSON.parse(fileContent);
|
|
10475
10772
|
const newJson = { ...json, context_servers: json.context_servers ?? {} };
|
|
@@ -10489,7 +10786,7 @@ var ZedMcp = class _ZedMcp extends ToolMcp {
|
|
|
10489
10786
|
}) {
|
|
10490
10787
|
const paths = this.getSettablePaths({ global });
|
|
10491
10788
|
const fileContent = await readOrInitializeFileContent(
|
|
10492
|
-
(0,
|
|
10789
|
+
(0, import_node_path74.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
10493
10790
|
"{}"
|
|
10494
10791
|
);
|
|
10495
10792
|
const json = JSON.parse(fileContent);
|
|
@@ -10536,6 +10833,7 @@ var ZedMcp = class _ZedMcp extends ToolMcp {
|
|
|
10536
10833
|
|
|
10537
10834
|
// src/features/mcp/mcp-processor.ts
|
|
10538
10835
|
var mcpProcessorToolTargetTuple = [
|
|
10836
|
+
"amp",
|
|
10539
10837
|
"antigravity-cli",
|
|
10540
10838
|
"antigravity-ide",
|
|
10541
10839
|
"claudecode",
|
|
@@ -10554,10 +10852,23 @@ var mcpProcessorToolTargetTuple = [
|
|
|
10554
10852
|
"opencode",
|
|
10555
10853
|
"roo",
|
|
10556
10854
|
"rovodev",
|
|
10855
|
+
"warp",
|
|
10557
10856
|
"zed"
|
|
10558
10857
|
];
|
|
10559
10858
|
var McpProcessorToolTargetSchema = import_mini29.z.enum(mcpProcessorToolTargetTuple);
|
|
10560
10859
|
var toolMcpFactories = /* @__PURE__ */ new Map([
|
|
10860
|
+
[
|
|
10861
|
+
"amp",
|
|
10862
|
+
{
|
|
10863
|
+
class: AmpMcp,
|
|
10864
|
+
meta: {
|
|
10865
|
+
supportsProject: true,
|
|
10866
|
+
supportsGlobal: true,
|
|
10867
|
+
supportsEnabledTools: false,
|
|
10868
|
+
supportsDisabledTools: false
|
|
10869
|
+
}
|
|
10870
|
+
}
|
|
10871
|
+
],
|
|
10561
10872
|
[
|
|
10562
10873
|
"antigravity-cli",
|
|
10563
10874
|
{
|
|
@@ -10780,6 +11091,18 @@ var toolMcpFactories = /* @__PURE__ */ new Map([
|
|
|
10780
11091
|
}
|
|
10781
11092
|
}
|
|
10782
11093
|
],
|
|
11094
|
+
[
|
|
11095
|
+
"warp",
|
|
11096
|
+
{
|
|
11097
|
+
class: WarpMcp,
|
|
11098
|
+
meta: {
|
|
11099
|
+
supportsProject: true,
|
|
11100
|
+
supportsGlobal: true,
|
|
11101
|
+
supportsEnabledTools: false,
|
|
11102
|
+
supportsDisabledTools: false
|
|
11103
|
+
}
|
|
11104
|
+
}
|
|
11105
|
+
],
|
|
10783
11106
|
[
|
|
10784
11107
|
"zed",
|
|
10785
11108
|
{
|
|
@@ -10942,11 +11265,11 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
10942
11265
|
var import_mini38 = require("zod/mini");
|
|
10943
11266
|
|
|
10944
11267
|
// src/features/permissions/antigravity-cli-permissions.ts
|
|
10945
|
-
var
|
|
11268
|
+
var import_node_path76 = require("path");
|
|
10946
11269
|
var import_es_toolkit4 = require("es-toolkit");
|
|
10947
11270
|
|
|
10948
11271
|
// src/features/permissions/rulesync-permissions.ts
|
|
10949
|
-
var
|
|
11272
|
+
var import_node_path75 = require("path");
|
|
10950
11273
|
|
|
10951
11274
|
// src/types/permissions.ts
|
|
10952
11275
|
var import_mini30 = require("zod/mini");
|
|
@@ -10991,7 +11314,7 @@ var RulesyncPermissions = class _RulesyncPermissions extends RulesyncFile {
|
|
|
10991
11314
|
validate = true
|
|
10992
11315
|
}) {
|
|
10993
11316
|
const paths = _RulesyncPermissions.getSettablePaths();
|
|
10994
|
-
const filePath = (0,
|
|
11317
|
+
const filePath = (0, import_node_path75.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
10995
11318
|
if (!await fileExists(filePath)) {
|
|
10996
11319
|
throw new Error(`No ${RULESYNC_PERMISSIONS_RELATIVE_FILE_PATH} found.`);
|
|
10997
11320
|
}
|
|
@@ -11081,7 +11404,7 @@ var AntigravityCliPermissions = class _AntigravityCliPermissions extends ToolPer
|
|
|
11081
11404
|
}
|
|
11082
11405
|
static getSettablePaths() {
|
|
11083
11406
|
return {
|
|
11084
|
-
relativeDirPath: (0,
|
|
11407
|
+
relativeDirPath: (0, import_node_path76.join)(".gemini", "antigravity-cli"),
|
|
11085
11408
|
relativeFilePath: "settings.json"
|
|
11086
11409
|
};
|
|
11087
11410
|
}
|
|
@@ -11090,7 +11413,7 @@ var AntigravityCliPermissions = class _AntigravityCliPermissions extends ToolPer
|
|
|
11090
11413
|
validate = true
|
|
11091
11414
|
}) {
|
|
11092
11415
|
const paths = _AntigravityCliPermissions.getSettablePaths();
|
|
11093
|
-
const filePath = (0,
|
|
11416
|
+
const filePath = (0, import_node_path76.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11094
11417
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"permissions":{}}';
|
|
11095
11418
|
return new _AntigravityCliPermissions({
|
|
11096
11419
|
outputRoot,
|
|
@@ -11106,7 +11429,7 @@ var AntigravityCliPermissions = class _AntigravityCliPermissions extends ToolPer
|
|
|
11106
11429
|
rulesyncPermissions
|
|
11107
11430
|
}) {
|
|
11108
11431
|
const paths = _AntigravityCliPermissions.getSettablePaths();
|
|
11109
|
-
const filePath = (0,
|
|
11432
|
+
const filePath = (0, import_node_path76.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11110
11433
|
const existingContent = await readOrInitializeFileContent(
|
|
11111
11434
|
filePath,
|
|
11112
11435
|
JSON.stringify({}, null, 2)
|
|
@@ -11173,7 +11496,7 @@ var AntigravityCliPermissions = class _AntigravityCliPermissions extends ToolPer
|
|
|
11173
11496
|
settings = JSON.parse(this.getFileContent());
|
|
11174
11497
|
} catch (error) {
|
|
11175
11498
|
throw new Error(
|
|
11176
|
-
`Failed to parse Antigravity CLI permissions content in ${(0,
|
|
11499
|
+
`Failed to parse Antigravity CLI permissions content in ${(0, import_node_path76.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
11177
11500
|
{ cause: error }
|
|
11178
11501
|
);
|
|
11179
11502
|
}
|
|
@@ -11247,7 +11570,7 @@ function convertAntigravityCliToRulesyncPermissions(params) {
|
|
|
11247
11570
|
}
|
|
11248
11571
|
|
|
11249
11572
|
// src/features/permissions/augmentcode-permissions.ts
|
|
11250
|
-
var
|
|
11573
|
+
var import_node_path77 = require("path");
|
|
11251
11574
|
var import_mini31 = require("zod/mini");
|
|
11252
11575
|
var moduleLogger = new ConsoleLogger();
|
|
11253
11576
|
var AugmentPermissionTypeSchema = import_mini31.z.enum(["allow", "deny", "ask-user"]);
|
|
@@ -11397,7 +11720,7 @@ var AugmentcodePermissions = class _AugmentcodePermissions extends ToolPermissio
|
|
|
11397
11720
|
global = false
|
|
11398
11721
|
}) {
|
|
11399
11722
|
const paths = _AugmentcodePermissions.getSettablePaths({ global });
|
|
11400
|
-
const filePath = (0,
|
|
11723
|
+
const filePath = (0, import_node_path77.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11401
11724
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"toolPermissions":[]}';
|
|
11402
11725
|
return new _AugmentcodePermissions({
|
|
11403
11726
|
outputRoot,
|
|
@@ -11414,7 +11737,7 @@ var AugmentcodePermissions = class _AugmentcodePermissions extends ToolPermissio
|
|
|
11414
11737
|
logger
|
|
11415
11738
|
}) {
|
|
11416
11739
|
const paths = _AugmentcodePermissions.getSettablePaths({ global });
|
|
11417
|
-
const filePath = (0,
|
|
11740
|
+
const filePath = (0, import_node_path77.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11418
11741
|
const existingContent = await readFileContentOrNull(filePath) ?? "{}";
|
|
11419
11742
|
let settings;
|
|
11420
11743
|
try {
|
|
@@ -11469,7 +11792,7 @@ var AugmentcodePermissions = class _AugmentcodePermissions extends ToolPermissio
|
|
|
11469
11792
|
settings = result.data;
|
|
11470
11793
|
} catch (error) {
|
|
11471
11794
|
throw new Error(
|
|
11472
|
-
`Failed to parse AugmentCode permissions content in ${(0,
|
|
11795
|
+
`Failed to parse AugmentCode permissions content in ${(0, import_node_path77.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
11473
11796
|
{ cause: error }
|
|
11474
11797
|
);
|
|
11475
11798
|
}
|
|
@@ -11637,7 +11960,7 @@ function convertAugmentToRulesyncPermissions({
|
|
|
11637
11960
|
}
|
|
11638
11961
|
|
|
11639
11962
|
// src/features/permissions/claudecode-permissions.ts
|
|
11640
|
-
var
|
|
11963
|
+
var import_node_path78 = require("path");
|
|
11641
11964
|
var import_es_toolkit5 = require("es-toolkit");
|
|
11642
11965
|
var CANONICAL_TO_CLAUDE_TOOL_NAMES = {
|
|
11643
11966
|
bash: "Bash",
|
|
@@ -11699,7 +12022,7 @@ var ClaudecodePermissions = class _ClaudecodePermissions extends ToolPermissions
|
|
|
11699
12022
|
validate = true
|
|
11700
12023
|
}) {
|
|
11701
12024
|
const paths = _ClaudecodePermissions.getSettablePaths();
|
|
11702
|
-
const filePath = (0,
|
|
12025
|
+
const filePath = (0, import_node_path78.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11703
12026
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"permissions":{}}';
|
|
11704
12027
|
return new _ClaudecodePermissions({
|
|
11705
12028
|
outputRoot,
|
|
@@ -11715,7 +12038,7 @@ var ClaudecodePermissions = class _ClaudecodePermissions extends ToolPermissions
|
|
|
11715
12038
|
logger
|
|
11716
12039
|
}) {
|
|
11717
12040
|
const paths = _ClaudecodePermissions.getSettablePaths();
|
|
11718
|
-
const filePath = (0,
|
|
12041
|
+
const filePath = (0, import_node_path78.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11719
12042
|
const existingContent = await readOrInitializeFileContent(
|
|
11720
12043
|
filePath,
|
|
11721
12044
|
JSON.stringify({}, null, 2)
|
|
@@ -11792,7 +12115,7 @@ var ClaudecodePermissions = class _ClaudecodePermissions extends ToolPermissions
|
|
|
11792
12115
|
settings = JSON.parse(this.getFileContent());
|
|
11793
12116
|
} catch (error) {
|
|
11794
12117
|
throw new Error(
|
|
11795
|
-
`Failed to parse Claude permissions content in ${(0,
|
|
12118
|
+
`Failed to parse Claude permissions content in ${(0, import_node_path78.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
11796
12119
|
{ cause: error }
|
|
11797
12120
|
);
|
|
11798
12121
|
}
|
|
@@ -11865,7 +12188,7 @@ function convertClaudeToRulesyncPermissions(params) {
|
|
|
11865
12188
|
}
|
|
11866
12189
|
|
|
11867
12190
|
// src/features/permissions/cline-permissions.ts
|
|
11868
|
-
var
|
|
12191
|
+
var import_node_path79 = require("path");
|
|
11869
12192
|
var import_es_toolkit6 = require("es-toolkit");
|
|
11870
12193
|
var import_mini32 = require("zod/mini");
|
|
11871
12194
|
var ClineCommandPermissionsSchema = import_mini32.z.looseObject({
|
|
@@ -11901,7 +12224,7 @@ var ClinePermissions = class _ClinePermissions extends ToolPermissions {
|
|
|
11901
12224
|
global = false
|
|
11902
12225
|
}) {
|
|
11903
12226
|
const paths = _ClinePermissions.getSettablePaths({ global });
|
|
11904
|
-
const filePath = (0,
|
|
12227
|
+
const filePath = (0, import_node_path79.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11905
12228
|
const fileContent = await readFileContentOrNull(filePath) ?? "{}";
|
|
11906
12229
|
return new _ClinePermissions({
|
|
11907
12230
|
outputRoot,
|
|
@@ -11918,7 +12241,7 @@ var ClinePermissions = class _ClinePermissions extends ToolPermissions {
|
|
|
11918
12241
|
logger
|
|
11919
12242
|
}) {
|
|
11920
12243
|
const paths = _ClinePermissions.getSettablePaths({ global });
|
|
11921
|
-
const filePath = (0,
|
|
12244
|
+
const filePath = (0, import_node_path79.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11922
12245
|
const existingContent = await readFileContentOrNull(filePath) ?? "{}";
|
|
11923
12246
|
let existing;
|
|
11924
12247
|
try {
|
|
@@ -12006,7 +12329,7 @@ var ClinePermissions = class _ClinePermissions extends ToolPermissions {
|
|
|
12006
12329
|
parsed = result.data;
|
|
12007
12330
|
} catch (error) {
|
|
12008
12331
|
throw new Error(
|
|
12009
|
-
`Failed to parse Cline permissions content in ${(0,
|
|
12332
|
+
`Failed to parse Cline permissions content in ${(0, import_node_path79.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
12010
12333
|
{ cause: error }
|
|
12011
12334
|
);
|
|
12012
12335
|
}
|
|
@@ -12053,7 +12376,7 @@ var ClinePermissions = class _ClinePermissions extends ToolPermissions {
|
|
|
12053
12376
|
};
|
|
12054
12377
|
|
|
12055
12378
|
// src/features/permissions/codexcli-permissions.ts
|
|
12056
|
-
var
|
|
12379
|
+
var import_node_path80 = require("path");
|
|
12057
12380
|
var smolToml4 = __toESM(require("smol-toml"), 1);
|
|
12058
12381
|
var RULESYNC_PROFILE_NAME = "rulesync";
|
|
12059
12382
|
var RULESYNC_BASH_RULES_FILE_NAME = "rulesync.rules";
|
|
@@ -12075,7 +12398,7 @@ var CodexcliPermissions = class _CodexcliPermissions extends ToolPermissions {
|
|
|
12075
12398
|
global = false
|
|
12076
12399
|
}) {
|
|
12077
12400
|
const paths = this.getSettablePaths({ global });
|
|
12078
|
-
const filePath = (0,
|
|
12401
|
+
const filePath = (0, import_node_path80.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
12079
12402
|
const fileContent = await readFileContentOrNull(filePath) ?? smolToml4.stringify({});
|
|
12080
12403
|
return new _CodexcliPermissions({
|
|
12081
12404
|
outputRoot,
|
|
@@ -12093,7 +12416,7 @@ var CodexcliPermissions = class _CodexcliPermissions extends ToolPermissions {
|
|
|
12093
12416
|
global = false
|
|
12094
12417
|
}) {
|
|
12095
12418
|
const paths = this.getSettablePaths({ global });
|
|
12096
|
-
const filePath = (0,
|
|
12419
|
+
const filePath = (0, import_node_path80.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
12097
12420
|
const existingContent = await readFileContentOrNull(filePath) ?? smolToml4.stringify({});
|
|
12098
12421
|
const parsed = toMutableTable(smolToml4.parse(existingContent));
|
|
12099
12422
|
const profile = convertRulesyncToCodexProfile({
|
|
@@ -12118,7 +12441,7 @@ var CodexcliPermissions = class _CodexcliPermissions extends ToolPermissions {
|
|
|
12118
12441
|
parsed = smolToml4.parse(this.getFileContent());
|
|
12119
12442
|
} catch (error) {
|
|
12120
12443
|
throw new Error(
|
|
12121
|
-
`Failed to parse Codex CLI permissions content in ${(0,
|
|
12444
|
+
`Failed to parse Codex CLI permissions content in ${(0, import_node_path80.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
12122
12445
|
{ cause: error }
|
|
12123
12446
|
);
|
|
12124
12447
|
}
|
|
@@ -12159,7 +12482,7 @@ function createCodexcliBashRulesFile({
|
|
|
12159
12482
|
}) {
|
|
12160
12483
|
return new CodexcliRulesFile({
|
|
12161
12484
|
outputRoot,
|
|
12162
|
-
relativeDirPath: (0,
|
|
12485
|
+
relativeDirPath: (0, import_node_path80.join)(".codex", "rules"),
|
|
12163
12486
|
relativeFilePath: RULESYNC_BASH_RULES_FILE_NAME,
|
|
12164
12487
|
fileContent: buildCodexBashRulesContent(config)
|
|
12165
12488
|
});
|
|
@@ -12282,7 +12605,7 @@ function addFilesystemRule({
|
|
|
12282
12605
|
workspaceRootFilesystem[pattern] = access;
|
|
12283
12606
|
}
|
|
12284
12607
|
function canBeCodexFilesystemRoot(pattern) {
|
|
12285
|
-
return (0,
|
|
12608
|
+
return (0, import_node_path80.isAbsolute)(pattern) || /^[A-Za-z]:[\\/]/.test(pattern) || pattern.startsWith("~/") || pattern === "~" || pattern.startsWith(":");
|
|
12286
12609
|
}
|
|
12287
12610
|
function addRulesyncFilesystemRule(permission, pattern, access) {
|
|
12288
12611
|
if (access === "deny" || access === "none") {
|
|
@@ -12398,7 +12721,7 @@ function mapBashActionToDecision(action) {
|
|
|
12398
12721
|
}
|
|
12399
12722
|
|
|
12400
12723
|
// src/features/permissions/cursor-permissions.ts
|
|
12401
|
-
var
|
|
12724
|
+
var import_node_path81 = require("path");
|
|
12402
12725
|
var import_es_toolkit7 = require("es-toolkit");
|
|
12403
12726
|
var CANONICAL_TO_CURSOR_TYPE = {
|
|
12404
12727
|
bash: "Shell",
|
|
@@ -12516,7 +12839,7 @@ var CursorPermissions = class _CursorPermissions extends ToolPermissions {
|
|
|
12516
12839
|
global = false
|
|
12517
12840
|
}) {
|
|
12518
12841
|
const paths = _CursorPermissions.getSettablePaths({ global });
|
|
12519
|
-
const filePath = (0,
|
|
12842
|
+
const filePath = (0, import_node_path81.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
12520
12843
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"permissions":{}}';
|
|
12521
12844
|
return new _CursorPermissions({
|
|
12522
12845
|
outputRoot,
|
|
@@ -12533,7 +12856,7 @@ var CursorPermissions = class _CursorPermissions extends ToolPermissions {
|
|
|
12533
12856
|
global = false
|
|
12534
12857
|
}) {
|
|
12535
12858
|
const paths = _CursorPermissions.getSettablePaths({ global });
|
|
12536
|
-
const filePath = (0,
|
|
12859
|
+
const filePath = (0, import_node_path81.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
12537
12860
|
const existingContent = await readOrInitializeFileContent(
|
|
12538
12861
|
filePath,
|
|
12539
12862
|
JSON.stringify({}, null, 2)
|
|
@@ -12609,7 +12932,7 @@ var CursorPermissions = class _CursorPermissions extends ToolPermissions {
|
|
|
12609
12932
|
settings = asCursorCliConfig(JSON.parse(this.getFileContent()));
|
|
12610
12933
|
} catch (error) {
|
|
12611
12934
|
throw new Error(
|
|
12612
|
-
`Failed to parse Cursor CLI permissions content in ${(0,
|
|
12935
|
+
`Failed to parse Cursor CLI permissions content in ${(0, import_node_path81.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
12613
12936
|
{ cause: error }
|
|
12614
12937
|
);
|
|
12615
12938
|
}
|
|
@@ -12684,10 +13007,10 @@ function convertCursorToRulesyncPermissions(params) {
|
|
|
12684
13007
|
}
|
|
12685
13008
|
|
|
12686
13009
|
// src/features/permissions/geminicli-permissions.ts
|
|
12687
|
-
var
|
|
13010
|
+
var import_node_path82 = require("path");
|
|
12688
13011
|
var smolToml5 = __toESM(require("smol-toml"), 1);
|
|
12689
13012
|
var import_mini33 = require("zod/mini");
|
|
12690
|
-
var GEMINICLI_POLICY_RELATIVE_DIR_PATH = (0,
|
|
13013
|
+
var GEMINICLI_POLICY_RELATIVE_DIR_PATH = (0, import_node_path82.join)(".gemini", "policies");
|
|
12691
13014
|
var GEMINICLI_POLICY_FILE_NAME = "rulesync.toml";
|
|
12692
13015
|
var RULESYNC_TO_GEMINICLI_TOOL_NAME = {
|
|
12693
13016
|
bash: "run_shell_command",
|
|
@@ -12728,7 +13051,7 @@ var GeminicliPermissions = class _GeminicliPermissions extends ToolPermissions {
|
|
|
12728
13051
|
global = false
|
|
12729
13052
|
}) {
|
|
12730
13053
|
const paths = this.getSettablePaths({ global });
|
|
12731
|
-
const filePath = (0,
|
|
13054
|
+
const filePath = (0, import_node_path82.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
12732
13055
|
const fileContent = await readFileContentOrNull(filePath) ?? "";
|
|
12733
13056
|
return new _GeminicliPermissions({
|
|
12734
13057
|
outputRoot,
|
|
@@ -12764,7 +13087,7 @@ var GeminicliPermissions = class _GeminicliPermissions extends ToolPermissions {
|
|
|
12764
13087
|
parsed = smolToml5.parse(fileContent);
|
|
12765
13088
|
} catch (error) {
|
|
12766
13089
|
throw new Error(
|
|
12767
|
-
`Failed to parse Gemini CLI policy TOML in ${(0,
|
|
13090
|
+
`Failed to parse Gemini CLI policy TOML in ${(0, import_node_path82.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
12768
13091
|
{ cause: error }
|
|
12769
13092
|
);
|
|
12770
13093
|
}
|
|
@@ -13056,8 +13379,8 @@ function extractPattern(rule) {
|
|
|
13056
13379
|
}
|
|
13057
13380
|
|
|
13058
13381
|
// src/features/permissions/kilo-permissions.ts
|
|
13059
|
-
var
|
|
13060
|
-
var
|
|
13382
|
+
var import_node_path83 = require("path");
|
|
13383
|
+
var import_jsonc_parser6 = require("jsonc-parser");
|
|
13061
13384
|
var import_mini34 = require("zod/mini");
|
|
13062
13385
|
var KiloPermissionSchema = import_mini34.z.union([
|
|
13063
13386
|
import_mini34.z.enum(["allow", "ask", "deny"]),
|
|
@@ -13069,11 +13392,11 @@ var KiloPermissionsConfigSchema = import_mini34.z.looseObject({
|
|
|
13069
13392
|
var KILO_FILE_NAME = "kilo.jsonc";
|
|
13070
13393
|
function parseKiloJsoncStrict(content, filePath) {
|
|
13071
13394
|
const errors = [];
|
|
13072
|
-
const parsed = (0,
|
|
13395
|
+
const parsed = (0, import_jsonc_parser6.parse)(content, errors, { allowTrailingComma: true });
|
|
13073
13396
|
const first = errors[0];
|
|
13074
13397
|
if (first) {
|
|
13075
13398
|
throw new Error(
|
|
13076
|
-
`Failed to parse Kilo Code config at ${filePath}: ${(0,
|
|
13399
|
+
`Failed to parse Kilo Code config at ${filePath}: ${(0, import_jsonc_parser6.printParseErrorCode)(first.error)} at offset ${first.offset}`
|
|
13077
13400
|
);
|
|
13078
13401
|
}
|
|
13079
13402
|
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
@@ -13100,7 +13423,7 @@ var KiloPermissions = class _KiloPermissions extends ToolPermissions {
|
|
|
13100
13423
|
json;
|
|
13101
13424
|
constructor(params) {
|
|
13102
13425
|
super(params);
|
|
13103
|
-
const parsed = (0,
|
|
13426
|
+
const parsed = (0, import_jsonc_parser6.parse)(this.fileContent || "{}");
|
|
13104
13427
|
if (params.validate !== false) {
|
|
13105
13428
|
this.json = KiloPermissionsConfigSchema.parse(parsed);
|
|
13106
13429
|
} else {
|
|
@@ -13117,7 +13440,7 @@ var KiloPermissions = class _KiloPermissions extends ToolPermissions {
|
|
|
13117
13440
|
static getSettablePaths({
|
|
13118
13441
|
global = false
|
|
13119
13442
|
} = {}) {
|
|
13120
|
-
return global ? { relativeDirPath: (0,
|
|
13443
|
+
return global ? { relativeDirPath: (0, import_node_path83.join)(".config", "kilo"), relativeFilePath: KILO_FILE_NAME } : { relativeDirPath: ".", relativeFilePath: KILO_FILE_NAME };
|
|
13121
13444
|
}
|
|
13122
13445
|
static async fromFile({
|
|
13123
13446
|
outputRoot = process.cwd(),
|
|
@@ -13125,7 +13448,7 @@ var KiloPermissions = class _KiloPermissions extends ToolPermissions {
|
|
|
13125
13448
|
global = false
|
|
13126
13449
|
}) {
|
|
13127
13450
|
const basePaths = _KiloPermissions.getSettablePaths({ global });
|
|
13128
|
-
const filePath = (0,
|
|
13451
|
+
const filePath = (0, import_node_path83.join)(outputRoot, basePaths.relativeDirPath, basePaths.relativeFilePath);
|
|
13129
13452
|
const fileContent = await readFileContentOrNull(filePath);
|
|
13130
13453
|
const parsed = parseKiloJsoncStrict(fileContent ?? "{}", filePath);
|
|
13131
13454
|
const nextJson = { ...parsed, permission: parsed.permission ?? {} };
|
|
@@ -13144,7 +13467,7 @@ var KiloPermissions = class _KiloPermissions extends ToolPermissions {
|
|
|
13144
13467
|
logger
|
|
13145
13468
|
}) {
|
|
13146
13469
|
const basePaths = _KiloPermissions.getSettablePaths({ global });
|
|
13147
|
-
const filePath = (0,
|
|
13470
|
+
const filePath = (0, import_node_path83.join)(outputRoot, basePaths.relativeDirPath, basePaths.relativeFilePath);
|
|
13148
13471
|
const fileContent = await readFileContentOrNull(filePath);
|
|
13149
13472
|
const parsed = parseKiloJsoncStrict(fileContent ?? "{}", filePath);
|
|
13150
13473
|
const parsedPermission = parsed.permission;
|
|
@@ -13190,7 +13513,7 @@ var KiloPermissions = class _KiloPermissions extends ToolPermissions {
|
|
|
13190
13513
|
}
|
|
13191
13514
|
validate() {
|
|
13192
13515
|
try {
|
|
13193
|
-
const json = (0,
|
|
13516
|
+
const json = (0, import_jsonc_parser6.parse)(this.fileContent || "{}");
|
|
13194
13517
|
const result = KiloPermissionsConfigSchema.safeParse(json);
|
|
13195
13518
|
if (!result.success) {
|
|
13196
13519
|
return { success: false, error: result.error };
|
|
@@ -13230,7 +13553,7 @@ var KiloPermissions = class _KiloPermissions extends ToolPermissions {
|
|
|
13230
13553
|
};
|
|
13231
13554
|
|
|
13232
13555
|
// src/features/permissions/kiro-permissions.ts
|
|
13233
|
-
var
|
|
13556
|
+
var import_node_path84 = require("path");
|
|
13234
13557
|
var import_mini35 = require("zod/mini");
|
|
13235
13558
|
var KiroAgentSchema = import_mini35.z.looseObject({
|
|
13236
13559
|
allowedTools: import_mini35.z.optional(import_mini35.z.array(import_mini35.z.string())),
|
|
@@ -13240,7 +13563,7 @@ var UnknownRecordSchema = import_mini35.z.record(import_mini35.z.string(), impor
|
|
|
13240
13563
|
var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
13241
13564
|
static getSettablePaths(_options = {}) {
|
|
13242
13565
|
return {
|
|
13243
|
-
relativeDirPath: (0,
|
|
13566
|
+
relativeDirPath: (0, import_node_path84.join)(".kiro", "agents"),
|
|
13244
13567
|
relativeFilePath: "default.json"
|
|
13245
13568
|
};
|
|
13246
13569
|
}
|
|
@@ -13252,7 +13575,7 @@ var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
|
13252
13575
|
validate = true
|
|
13253
13576
|
}) {
|
|
13254
13577
|
const paths = this.getSettablePaths();
|
|
13255
|
-
const filePath = (0,
|
|
13578
|
+
const filePath = (0, import_node_path84.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
13256
13579
|
const fileContent = await readFileContentOrNull(filePath) ?? JSON.stringify({}, null, 2);
|
|
13257
13580
|
return new _KiroPermissions({
|
|
13258
13581
|
outputRoot,
|
|
@@ -13269,7 +13592,7 @@ var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
|
13269
13592
|
logger
|
|
13270
13593
|
}) {
|
|
13271
13594
|
const paths = this.getSettablePaths();
|
|
13272
|
-
const filePath = (0,
|
|
13595
|
+
const filePath = (0, import_node_path84.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
13273
13596
|
const existingContent = await readFileContentOrNull(filePath) ?? JSON.stringify({}, null, 2);
|
|
13274
13597
|
const parsedResult = KiroAgentSchema.safeParse(JSON.parse(existingContent));
|
|
13275
13598
|
if (!parsedResult.success) {
|
|
@@ -13293,7 +13616,7 @@ var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
|
13293
13616
|
parsed = KiroAgentSchema.parse(JSON.parse(this.getFileContent()));
|
|
13294
13617
|
} catch (error) {
|
|
13295
13618
|
throw new Error(
|
|
13296
|
-
`Failed to parse Kiro permissions content in ${(0,
|
|
13619
|
+
`Failed to parse Kiro permissions content in ${(0, import_node_path84.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
13297
13620
|
{ cause: error }
|
|
13298
13621
|
);
|
|
13299
13622
|
}
|
|
@@ -13418,8 +13741,8 @@ function asStringArray(value) {
|
|
|
13418
13741
|
}
|
|
13419
13742
|
|
|
13420
13743
|
// src/features/permissions/opencode-permissions.ts
|
|
13421
|
-
var
|
|
13422
|
-
var
|
|
13744
|
+
var import_node_path85 = require("path");
|
|
13745
|
+
var import_jsonc_parser7 = require("jsonc-parser");
|
|
13423
13746
|
var import_mini36 = require("zod/mini");
|
|
13424
13747
|
var OpencodePermissionSchema = import_mini36.z.union([
|
|
13425
13748
|
import_mini36.z.enum(["allow", "ask", "deny"]),
|
|
@@ -13432,7 +13755,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13432
13755
|
json;
|
|
13433
13756
|
constructor(params) {
|
|
13434
13757
|
super(params);
|
|
13435
|
-
this.json = OpencodePermissionsConfigSchema.parse((0,
|
|
13758
|
+
this.json = OpencodePermissionsConfigSchema.parse((0, import_jsonc_parser7.parse)(this.fileContent || "{}"));
|
|
13436
13759
|
}
|
|
13437
13760
|
getJson() {
|
|
13438
13761
|
return this.json;
|
|
@@ -13443,7 +13766,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13443
13766
|
static getSettablePaths({
|
|
13444
13767
|
global = false
|
|
13445
13768
|
} = {}) {
|
|
13446
|
-
return global ? { relativeDirPath: (0,
|
|
13769
|
+
return global ? { relativeDirPath: (0, import_node_path85.join)(".config", "opencode"), relativeFilePath: "opencode.json" } : { relativeDirPath: ".", relativeFilePath: "opencode.json" };
|
|
13447
13770
|
}
|
|
13448
13771
|
static async fromFile({
|
|
13449
13772
|
outputRoot = process.cwd(),
|
|
@@ -13451,9 +13774,9 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13451
13774
|
global = false
|
|
13452
13775
|
}) {
|
|
13453
13776
|
const basePaths = _OpencodePermissions.getSettablePaths({ global });
|
|
13454
|
-
const jsonDir = (0,
|
|
13455
|
-
const jsoncPath = (0,
|
|
13456
|
-
const jsonPath = (0,
|
|
13777
|
+
const jsonDir = (0, import_node_path85.join)(outputRoot, basePaths.relativeDirPath);
|
|
13778
|
+
const jsoncPath = (0, import_node_path85.join)(jsonDir, "opencode.jsonc");
|
|
13779
|
+
const jsonPath = (0, import_node_path85.join)(jsonDir, "opencode.json");
|
|
13457
13780
|
let fileContent = await readFileContentOrNull(jsoncPath);
|
|
13458
13781
|
let relativeFilePath = "opencode.jsonc";
|
|
13459
13782
|
if (!fileContent) {
|
|
@@ -13462,7 +13785,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13462
13785
|
relativeFilePath = "opencode.json";
|
|
13463
13786
|
}
|
|
13464
13787
|
}
|
|
13465
|
-
const parsed = (0,
|
|
13788
|
+
const parsed = (0, import_jsonc_parser7.parse)(fileContent ?? "{}");
|
|
13466
13789
|
const nextJson = { ...parsed, permission: parsed.permission ?? {} };
|
|
13467
13790
|
return new _OpencodePermissions({
|
|
13468
13791
|
outputRoot,
|
|
@@ -13478,9 +13801,9 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13478
13801
|
global = false
|
|
13479
13802
|
}) {
|
|
13480
13803
|
const basePaths = _OpencodePermissions.getSettablePaths({ global });
|
|
13481
|
-
const jsonDir = (0,
|
|
13482
|
-
const jsoncPath = (0,
|
|
13483
|
-
const jsonPath = (0,
|
|
13804
|
+
const jsonDir = (0, import_node_path85.join)(outputRoot, basePaths.relativeDirPath);
|
|
13805
|
+
const jsoncPath = (0, import_node_path85.join)(jsonDir, "opencode.jsonc");
|
|
13806
|
+
const jsonPath = (0, import_node_path85.join)(jsonDir, "opencode.json");
|
|
13484
13807
|
let fileContent = await readFileContentOrNull(jsoncPath);
|
|
13485
13808
|
let relativeFilePath = "opencode.jsonc";
|
|
13486
13809
|
if (!fileContent) {
|
|
@@ -13489,7 +13812,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13489
13812
|
relativeFilePath = "opencode.json";
|
|
13490
13813
|
}
|
|
13491
13814
|
}
|
|
13492
|
-
const parsed = (0,
|
|
13815
|
+
const parsed = (0, import_jsonc_parser7.parse)(fileContent ?? "{}");
|
|
13493
13816
|
const nextJson = {
|
|
13494
13817
|
...parsed,
|
|
13495
13818
|
permission: rulesyncPermissions.getJson().permission
|
|
@@ -13550,7 +13873,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13550
13873
|
};
|
|
13551
13874
|
|
|
13552
13875
|
// src/features/permissions/qwencode-permissions.ts
|
|
13553
|
-
var
|
|
13876
|
+
var import_node_path86 = require("path");
|
|
13554
13877
|
var import_es_toolkit8 = require("es-toolkit");
|
|
13555
13878
|
var import_mini37 = require("zod/mini");
|
|
13556
13879
|
var QwenSettingsPermissionsSchema = import_mini37.z.looseObject({
|
|
@@ -13638,7 +13961,7 @@ var QwencodePermissions = class _QwencodePermissions extends ToolPermissions {
|
|
|
13638
13961
|
global = false
|
|
13639
13962
|
}) {
|
|
13640
13963
|
const paths = _QwencodePermissions.getSettablePaths({ global });
|
|
13641
|
-
const filePath = (0,
|
|
13964
|
+
const filePath = (0, import_node_path86.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
13642
13965
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"permissions":{}}';
|
|
13643
13966
|
return new _QwencodePermissions({
|
|
13644
13967
|
outputRoot,
|
|
@@ -13655,7 +13978,7 @@ var QwencodePermissions = class _QwencodePermissions extends ToolPermissions {
|
|
|
13655
13978
|
logger
|
|
13656
13979
|
}) {
|
|
13657
13980
|
const paths = _QwencodePermissions.getSettablePaths({ global });
|
|
13658
|
-
const filePath = (0,
|
|
13981
|
+
const filePath = (0, import_node_path86.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
13659
13982
|
const existingContent = await readFileContentOrNull(filePath) ?? "{}";
|
|
13660
13983
|
let settings;
|
|
13661
13984
|
try {
|
|
@@ -13728,7 +14051,7 @@ var QwencodePermissions = class _QwencodePermissions extends ToolPermissions {
|
|
|
13728
14051
|
settings = result.data;
|
|
13729
14052
|
} catch (error) {
|
|
13730
14053
|
throw new Error(
|
|
13731
|
-
`Failed to parse Qwen permissions content in ${(0,
|
|
14054
|
+
`Failed to parse Qwen permissions content in ${(0, import_node_path86.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
13732
14055
|
{ cause: error }
|
|
13733
14056
|
);
|
|
13734
14057
|
}
|
|
@@ -14071,7 +14394,7 @@ var PermissionsProcessor = class extends FeatureProcessor {
|
|
|
14071
14394
|
};
|
|
14072
14395
|
|
|
14073
14396
|
// src/features/rules/rules-processor.ts
|
|
14074
|
-
var
|
|
14397
|
+
var import_node_path168 = require("path");
|
|
14075
14398
|
var import_toon = require("@toon-format/toon");
|
|
14076
14399
|
var import_mini82 = require("zod/mini");
|
|
14077
14400
|
|
|
@@ -14079,17 +14402,17 @@ var import_mini82 = require("zod/mini");
|
|
|
14079
14402
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
14080
14403
|
|
|
14081
14404
|
// src/features/skills/agentsmd-skill.ts
|
|
14082
|
-
var
|
|
14405
|
+
var import_node_path90 = require("path");
|
|
14083
14406
|
|
|
14084
14407
|
// src/features/skills/simulated-skill.ts
|
|
14085
|
-
var
|
|
14408
|
+
var import_node_path89 = require("path");
|
|
14086
14409
|
var import_mini39 = require("zod/mini");
|
|
14087
14410
|
|
|
14088
14411
|
// src/features/skills/tool-skill.ts
|
|
14089
|
-
var
|
|
14412
|
+
var import_node_path88 = require("path");
|
|
14090
14413
|
|
|
14091
14414
|
// src/types/ai-dir.ts
|
|
14092
|
-
var
|
|
14415
|
+
var import_node_path87 = __toESM(require("path"), 1);
|
|
14093
14416
|
var AiDir = class {
|
|
14094
14417
|
/**
|
|
14095
14418
|
* @example "."
|
|
@@ -14123,7 +14446,7 @@ var AiDir = class {
|
|
|
14123
14446
|
otherFiles = [],
|
|
14124
14447
|
global = false
|
|
14125
14448
|
}) {
|
|
14126
|
-
if (dirName.includes(
|
|
14449
|
+
if (dirName.includes(import_node_path87.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
|
|
14127
14450
|
throw new Error(`Directory name cannot contain path separators: dirName="${dirName}"`);
|
|
14128
14451
|
}
|
|
14129
14452
|
this.outputRoot = outputRoot;
|
|
@@ -14146,11 +14469,11 @@ var AiDir = class {
|
|
|
14146
14469
|
return this.dirName;
|
|
14147
14470
|
}
|
|
14148
14471
|
getDirPath() {
|
|
14149
|
-
const fullPath =
|
|
14150
|
-
const resolvedFull = (0,
|
|
14151
|
-
const resolvedBase = (0,
|
|
14152
|
-
const rel = (0,
|
|
14153
|
-
if (rel.startsWith("..") ||
|
|
14472
|
+
const fullPath = import_node_path87.default.join(this.outputRoot, this.relativeDirPath, this.dirName);
|
|
14473
|
+
const resolvedFull = (0, import_node_path87.resolve)(fullPath);
|
|
14474
|
+
const resolvedBase = (0, import_node_path87.resolve)(this.outputRoot);
|
|
14475
|
+
const rel = (0, import_node_path87.relative)(resolvedBase, resolvedFull);
|
|
14476
|
+
if (rel.startsWith("..") || import_node_path87.default.isAbsolute(rel)) {
|
|
14154
14477
|
throw new Error(
|
|
14155
14478
|
`Path traversal detected: Final path escapes outputRoot. outputRoot="${this.outputRoot}", relativeDirPath="${this.relativeDirPath}", dirName="${this.dirName}"`
|
|
14156
14479
|
);
|
|
@@ -14167,7 +14490,7 @@ var AiDir = class {
|
|
|
14167
14490
|
* Returns the relative path from CWD with POSIX separators for consistent cross-platform output.
|
|
14168
14491
|
*/
|
|
14169
14492
|
getRelativePathFromCwd() {
|
|
14170
|
-
return toPosixPath(
|
|
14493
|
+
return toPosixPath(import_node_path87.default.join(this.relativeDirPath, this.dirName));
|
|
14171
14494
|
}
|
|
14172
14495
|
getGlobal() {
|
|
14173
14496
|
return this.global;
|
|
@@ -14186,15 +14509,15 @@ var AiDir = class {
|
|
|
14186
14509
|
* @returns Array of files with their relative paths and buffers
|
|
14187
14510
|
*/
|
|
14188
14511
|
static async collectOtherFiles(outputRoot, relativeDirPath, dirName, excludeFileName) {
|
|
14189
|
-
const dirPath = (0,
|
|
14190
|
-
const glob = (0,
|
|
14512
|
+
const dirPath = (0, import_node_path87.join)(outputRoot, relativeDirPath, dirName);
|
|
14513
|
+
const glob = (0, import_node_path87.join)(dirPath, "**", "*");
|
|
14191
14514
|
const filePaths = await findFilesByGlobs(glob, { type: "file" });
|
|
14192
|
-
const filteredPaths = filePaths.filter((filePath) => (0,
|
|
14515
|
+
const filteredPaths = filePaths.filter((filePath) => (0, import_node_path87.basename)(filePath) !== excludeFileName);
|
|
14193
14516
|
const files = await Promise.all(
|
|
14194
14517
|
filteredPaths.map(async (filePath) => {
|
|
14195
14518
|
const fileBuffer = await readFileBuffer(filePath);
|
|
14196
14519
|
return {
|
|
14197
|
-
relativeFilePathToDirPath: (0,
|
|
14520
|
+
relativeFilePathToDirPath: (0, import_node_path87.relative)(dirPath, filePath),
|
|
14198
14521
|
fileBuffer
|
|
14199
14522
|
};
|
|
14200
14523
|
})
|
|
@@ -14288,8 +14611,8 @@ var ToolSkill = class extends AiDir {
|
|
|
14288
14611
|
}) {
|
|
14289
14612
|
const settablePaths = getSettablePaths({ global });
|
|
14290
14613
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
14291
|
-
const skillDirPath = (0,
|
|
14292
|
-
const skillFilePath = (0,
|
|
14614
|
+
const skillDirPath = (0, import_node_path88.join)(outputRoot, actualRelativeDirPath, dirName);
|
|
14615
|
+
const skillFilePath = (0, import_node_path88.join)(skillDirPath, SKILL_FILE_NAME);
|
|
14293
14616
|
if (!await fileExists(skillFilePath)) {
|
|
14294
14617
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
14295
14618
|
}
|
|
@@ -14313,7 +14636,7 @@ var ToolSkill = class extends AiDir {
|
|
|
14313
14636
|
}
|
|
14314
14637
|
requireMainFileFrontmatter() {
|
|
14315
14638
|
if (!this.mainFile?.frontmatter) {
|
|
14316
|
-
throw new Error(`Frontmatter is not defined in ${(0,
|
|
14639
|
+
throw new Error(`Frontmatter is not defined in ${(0, import_node_path88.join)(this.relativeDirPath, this.dirName)}`);
|
|
14317
14640
|
}
|
|
14318
14641
|
return this.mainFile.frontmatter;
|
|
14319
14642
|
}
|
|
@@ -14353,7 +14676,7 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
14353
14676
|
const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
|
|
14354
14677
|
if (!result.success) {
|
|
14355
14678
|
throw new Error(
|
|
14356
|
-
`Invalid frontmatter in ${(0,
|
|
14679
|
+
`Invalid frontmatter in ${(0, import_node_path89.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
|
|
14357
14680
|
);
|
|
14358
14681
|
}
|
|
14359
14682
|
}
|
|
@@ -14412,8 +14735,8 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
14412
14735
|
}) {
|
|
14413
14736
|
const settablePaths = this.getSettablePaths();
|
|
14414
14737
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
14415
|
-
const skillDirPath = (0,
|
|
14416
|
-
const skillFilePath = (0,
|
|
14738
|
+
const skillDirPath = (0, import_node_path89.join)(outputRoot, actualRelativeDirPath, dirName);
|
|
14739
|
+
const skillFilePath = (0, import_node_path89.join)(skillDirPath, SKILL_FILE_NAME);
|
|
14417
14740
|
if (!await fileExists(skillFilePath)) {
|
|
14418
14741
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
14419
14742
|
}
|
|
@@ -14490,7 +14813,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
14490
14813
|
throw new Error("AgentsmdSkill does not support global mode.");
|
|
14491
14814
|
}
|
|
14492
14815
|
return {
|
|
14493
|
-
relativeDirPath: (0,
|
|
14816
|
+
relativeDirPath: (0, import_node_path90.join)(".agents", "skills")
|
|
14494
14817
|
};
|
|
14495
14818
|
}
|
|
14496
14819
|
static async fromDir(params) {
|
|
@@ -14517,11 +14840,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
14517
14840
|
};
|
|
14518
14841
|
|
|
14519
14842
|
// src/features/skills/factorydroid-skill.ts
|
|
14520
|
-
var
|
|
14843
|
+
var import_node_path91 = require("path");
|
|
14521
14844
|
var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
14522
14845
|
static getSettablePaths(_options) {
|
|
14523
14846
|
return {
|
|
14524
|
-
relativeDirPath: (0,
|
|
14847
|
+
relativeDirPath: (0, import_node_path91.join)(".factory", "skills")
|
|
14525
14848
|
};
|
|
14526
14849
|
}
|
|
14527
14850
|
static async fromDir(params) {
|
|
@@ -14548,11 +14871,11 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
|
14548
14871
|
};
|
|
14549
14872
|
|
|
14550
14873
|
// src/features/skills/rovodev-skill.ts
|
|
14551
|
-
var
|
|
14874
|
+
var import_node_path93 = require("path");
|
|
14552
14875
|
var import_mini41 = require("zod/mini");
|
|
14553
14876
|
|
|
14554
14877
|
// src/features/skills/rulesync-skill.ts
|
|
14555
|
-
var
|
|
14878
|
+
var import_node_path92 = require("path");
|
|
14556
14879
|
var import_mini40 = require("zod/mini");
|
|
14557
14880
|
var RulesyncSkillFrontmatterSchemaInternal = import_mini40.z.looseObject({
|
|
14558
14881
|
name: import_mini40.z.string(),
|
|
@@ -14592,6 +14915,23 @@ var RulesyncSkillFrontmatterSchemaInternal = import_mini40.z.looseObject({
|
|
|
14592
14915
|
license: import_mini40.z.optional(import_mini40.z.string())
|
|
14593
14916
|
})
|
|
14594
14917
|
),
|
|
14918
|
+
pi: import_mini40.z.optional(
|
|
14919
|
+
import_mini40.z.looseObject({
|
|
14920
|
+
"allowed-tools": import_mini40.z.optional(import_mini40.z.array(import_mini40.z.string())),
|
|
14921
|
+
"disable-model-invocation": import_mini40.z.optional(import_mini40.z.boolean()),
|
|
14922
|
+
license: import_mini40.z.optional(import_mini40.z.string()),
|
|
14923
|
+
compatibility: import_mini40.z.optional(import_mini40.z.looseObject({})),
|
|
14924
|
+
metadata: import_mini40.z.optional(import_mini40.z.looseObject({}))
|
|
14925
|
+
})
|
|
14926
|
+
),
|
|
14927
|
+
replit: import_mini40.z.optional(
|
|
14928
|
+
import_mini40.z.looseObject({
|
|
14929
|
+
"allowed-tools": import_mini40.z.optional(import_mini40.z.array(import_mini40.z.string())),
|
|
14930
|
+
license: import_mini40.z.optional(import_mini40.z.string()),
|
|
14931
|
+
compatibility: import_mini40.z.optional(import_mini40.z.looseObject({})),
|
|
14932
|
+
metadata: import_mini40.z.optional(import_mini40.z.looseObject({}))
|
|
14933
|
+
})
|
|
14934
|
+
),
|
|
14595
14935
|
cline: import_mini40.z.optional(import_mini40.z.looseObject({})),
|
|
14596
14936
|
roo: import_mini40.z.optional(import_mini40.z.looseObject({})),
|
|
14597
14937
|
takt: import_mini40.z.optional(
|
|
@@ -14639,7 +14979,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
14639
14979
|
}
|
|
14640
14980
|
getFrontmatter() {
|
|
14641
14981
|
if (!this.mainFile?.frontmatter) {
|
|
14642
|
-
throw new Error(`Frontmatter is not defined in ${(0,
|
|
14982
|
+
throw new Error(`Frontmatter is not defined in ${(0, import_node_path92.join)(this.relativeDirPath, this.dirName)}`);
|
|
14643
14983
|
}
|
|
14644
14984
|
const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
|
|
14645
14985
|
return result;
|
|
@@ -14665,8 +15005,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
14665
15005
|
dirName,
|
|
14666
15006
|
global = false
|
|
14667
15007
|
}) {
|
|
14668
|
-
const skillDirPath = (0,
|
|
14669
|
-
const skillFilePath = (0,
|
|
15008
|
+
const skillDirPath = (0, import_node_path92.join)(outputRoot, relativeDirPath, dirName);
|
|
15009
|
+
const skillFilePath = (0, import_node_path92.join)(skillDirPath, SKILL_FILE_NAME);
|
|
14670
15010
|
if (!await fileExists(skillFilePath)) {
|
|
14671
15011
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
14672
15012
|
}
|
|
@@ -14703,7 +15043,7 @@ var RovodevSkillFrontmatterSchema = import_mini41.z.looseObject({
|
|
|
14703
15043
|
var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
14704
15044
|
constructor({
|
|
14705
15045
|
outputRoot = process.cwd(),
|
|
14706
|
-
relativeDirPath = (0,
|
|
15046
|
+
relativeDirPath = (0, import_node_path93.join)(".rovodev", "skills"),
|
|
14707
15047
|
dirName,
|
|
14708
15048
|
frontmatter,
|
|
14709
15049
|
body,
|
|
@@ -14732,8 +15072,8 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
14732
15072
|
}
|
|
14733
15073
|
static getSettablePaths(_options) {
|
|
14734
15074
|
return {
|
|
14735
|
-
relativeDirPath: (0,
|
|
14736
|
-
alternativeSkillRoots: [(0,
|
|
15075
|
+
relativeDirPath: (0, import_node_path93.join)(".rovodev", "skills"),
|
|
15076
|
+
alternativeSkillRoots: [(0, import_node_path93.join)(".agents", "skills")]
|
|
14737
15077
|
};
|
|
14738
15078
|
}
|
|
14739
15079
|
getFrontmatter() {
|
|
@@ -14821,13 +15161,13 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
14821
15161
|
});
|
|
14822
15162
|
const result = RovodevSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
14823
15163
|
if (!result.success) {
|
|
14824
|
-
const skillDirPath = (0,
|
|
15164
|
+
const skillDirPath = (0, import_node_path93.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
14825
15165
|
throw new Error(
|
|
14826
|
-
`Invalid frontmatter in ${(0,
|
|
15166
|
+
`Invalid frontmatter in ${(0, import_node_path93.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
14827
15167
|
);
|
|
14828
15168
|
}
|
|
14829
15169
|
if (result.data.name !== loaded.dirName) {
|
|
14830
|
-
const skillFilePath = (0,
|
|
15170
|
+
const skillFilePath = (0, import_node_path93.join)(
|
|
14831
15171
|
loaded.outputRoot,
|
|
14832
15172
|
loaded.relativeDirPath,
|
|
14833
15173
|
loaded.dirName,
|
|
@@ -14869,11 +15209,11 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
14869
15209
|
};
|
|
14870
15210
|
|
|
14871
15211
|
// src/features/skills/skills-processor.ts
|
|
14872
|
-
var
|
|
15212
|
+
var import_node_path116 = require("path");
|
|
14873
15213
|
var import_mini60 = require("zod/mini");
|
|
14874
15214
|
|
|
14875
15215
|
// src/types/dir-feature-processor.ts
|
|
14876
|
-
var
|
|
15216
|
+
var import_node_path94 = require("path");
|
|
14877
15217
|
var DirFeatureProcessor = class {
|
|
14878
15218
|
outputRoot;
|
|
14879
15219
|
inputRoot;
|
|
@@ -14916,7 +15256,7 @@ var DirFeatureProcessor = class {
|
|
|
14916
15256
|
const mainFile = aiDir.getMainFile();
|
|
14917
15257
|
let mainFileContent;
|
|
14918
15258
|
if (mainFile) {
|
|
14919
|
-
const mainFilePath = (0,
|
|
15259
|
+
const mainFilePath = (0, import_node_path94.join)(dirPath, mainFile.name);
|
|
14920
15260
|
const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter, {
|
|
14921
15261
|
avoidBlockScalars: this.avoidBlockScalars
|
|
14922
15262
|
});
|
|
@@ -14936,7 +15276,7 @@ var DirFeatureProcessor = class {
|
|
|
14936
15276
|
const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
|
|
14937
15277
|
otherFileContents.push(contentWithNewline);
|
|
14938
15278
|
if (!dirHasChanges) {
|
|
14939
|
-
const filePath = (0,
|
|
15279
|
+
const filePath = (0, import_node_path94.join)(dirPath, file.relativeFilePathToDirPath);
|
|
14940
15280
|
const existingContent = await readFileContentOrNull(filePath);
|
|
14941
15281
|
if (!fileContentsEquivalent({
|
|
14942
15282
|
filePath,
|
|
@@ -14954,24 +15294,24 @@ var DirFeatureProcessor = class {
|
|
|
14954
15294
|
if (this.dryRun) {
|
|
14955
15295
|
this.logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
|
|
14956
15296
|
if (mainFile) {
|
|
14957
|
-
this.logger.info(`[DRY RUN] Would write: ${(0,
|
|
14958
|
-
changedPaths.push((0,
|
|
15297
|
+
this.logger.info(`[DRY RUN] Would write: ${(0, import_node_path94.join)(dirPath, mainFile.name)}`);
|
|
15298
|
+
changedPaths.push((0, import_node_path94.join)(relativeDir, mainFile.name));
|
|
14959
15299
|
}
|
|
14960
15300
|
for (const file of otherFiles) {
|
|
14961
15301
|
this.logger.info(
|
|
14962
|
-
`[DRY RUN] Would write: ${(0,
|
|
15302
|
+
`[DRY RUN] Would write: ${(0, import_node_path94.join)(dirPath, file.relativeFilePathToDirPath)}`
|
|
14963
15303
|
);
|
|
14964
|
-
changedPaths.push((0,
|
|
15304
|
+
changedPaths.push((0, import_node_path94.join)(relativeDir, file.relativeFilePathToDirPath));
|
|
14965
15305
|
}
|
|
14966
15306
|
} else {
|
|
14967
15307
|
await ensureDir(dirPath);
|
|
14968
15308
|
if (mainFile && mainFileContent) {
|
|
14969
|
-
const mainFilePath = (0,
|
|
15309
|
+
const mainFilePath = (0, import_node_path94.join)(dirPath, mainFile.name);
|
|
14970
15310
|
await writeFileContent(mainFilePath, mainFileContent);
|
|
14971
|
-
changedPaths.push((0,
|
|
15311
|
+
changedPaths.push((0, import_node_path94.join)(relativeDir, mainFile.name));
|
|
14972
15312
|
}
|
|
14973
15313
|
for (const [i, file] of otherFiles.entries()) {
|
|
14974
|
-
const filePath = (0,
|
|
15314
|
+
const filePath = (0, import_node_path94.join)(dirPath, file.relativeFilePathToDirPath);
|
|
14975
15315
|
const content = otherFileContents[i];
|
|
14976
15316
|
if (content === void 0) {
|
|
14977
15317
|
throw new Error(
|
|
@@ -14979,7 +15319,7 @@ var DirFeatureProcessor = class {
|
|
|
14979
15319
|
);
|
|
14980
15320
|
}
|
|
14981
15321
|
await writeFileContent(filePath, content);
|
|
14982
|
-
changedPaths.push((0,
|
|
15322
|
+
changedPaths.push((0, import_node_path94.join)(relativeDir, file.relativeFilePathToDirPath));
|
|
14983
15323
|
}
|
|
14984
15324
|
}
|
|
14985
15325
|
changedCount++;
|
|
@@ -15011,7 +15351,7 @@ var DirFeatureProcessor = class {
|
|
|
15011
15351
|
};
|
|
15012
15352
|
|
|
15013
15353
|
// src/features/skills/agentsskills-skill.ts
|
|
15014
|
-
var
|
|
15354
|
+
var import_node_path95 = require("path");
|
|
15015
15355
|
var import_mini42 = require("zod/mini");
|
|
15016
15356
|
var AgentsSkillsSkillFrontmatterSchema = import_mini42.z.looseObject({
|
|
15017
15357
|
name: import_mini42.z.string(),
|
|
@@ -15020,7 +15360,7 @@ var AgentsSkillsSkillFrontmatterSchema = import_mini42.z.looseObject({
|
|
|
15020
15360
|
var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
15021
15361
|
constructor({
|
|
15022
15362
|
outputRoot = process.cwd(),
|
|
15023
|
-
relativeDirPath = (0,
|
|
15363
|
+
relativeDirPath = (0, import_node_path95.join)(".agents", "skills"),
|
|
15024
15364
|
dirName,
|
|
15025
15365
|
frontmatter,
|
|
15026
15366
|
body,
|
|
@@ -15052,7 +15392,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
15052
15392
|
throw new Error("AgentsSkillsSkill does not support global mode.");
|
|
15053
15393
|
}
|
|
15054
15394
|
return {
|
|
15055
|
-
relativeDirPath: (0,
|
|
15395
|
+
relativeDirPath: (0, import_node_path95.join)(".agents", "skills")
|
|
15056
15396
|
};
|
|
15057
15397
|
}
|
|
15058
15398
|
getFrontmatter() {
|
|
@@ -15132,9 +15472,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
15132
15472
|
});
|
|
15133
15473
|
const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
15134
15474
|
if (!result.success) {
|
|
15135
|
-
const skillDirPath = (0,
|
|
15475
|
+
const skillDirPath = (0, import_node_path95.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
15136
15476
|
throw new Error(
|
|
15137
|
-
`Invalid frontmatter in ${(0,
|
|
15477
|
+
`Invalid frontmatter in ${(0, import_node_path95.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
15138
15478
|
);
|
|
15139
15479
|
}
|
|
15140
15480
|
return new _AgentsSkillsSkill({
|
|
@@ -15169,10 +15509,10 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
15169
15509
|
};
|
|
15170
15510
|
|
|
15171
15511
|
// src/features/skills/antigravity-shared-skill.ts
|
|
15172
|
-
var
|
|
15512
|
+
var import_node_path97 = require("path");
|
|
15173
15513
|
|
|
15174
15514
|
// src/features/skills/antigravity-skill.ts
|
|
15175
|
-
var
|
|
15515
|
+
var import_node_path96 = require("path");
|
|
15176
15516
|
var import_mini43 = require("zod/mini");
|
|
15177
15517
|
var AntigravitySkillFrontmatterSchema = import_mini43.z.looseObject({
|
|
15178
15518
|
name: import_mini43.z.string(),
|
|
@@ -15181,7 +15521,7 @@ var AntigravitySkillFrontmatterSchema = import_mini43.z.looseObject({
|
|
|
15181
15521
|
var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
15182
15522
|
constructor({
|
|
15183
15523
|
outputRoot = process.cwd(),
|
|
15184
|
-
relativeDirPath = (0,
|
|
15524
|
+
relativeDirPath = (0, import_node_path96.join)(".agent", "skills"),
|
|
15185
15525
|
dirName,
|
|
15186
15526
|
frontmatter,
|
|
15187
15527
|
body,
|
|
@@ -15213,11 +15553,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
15213
15553
|
} = {}) {
|
|
15214
15554
|
if (global) {
|
|
15215
15555
|
return {
|
|
15216
|
-
relativeDirPath: (0,
|
|
15556
|
+
relativeDirPath: (0, import_node_path96.join)(".gemini", "antigravity", "skills")
|
|
15217
15557
|
};
|
|
15218
15558
|
}
|
|
15219
15559
|
return {
|
|
15220
|
-
relativeDirPath: (0,
|
|
15560
|
+
relativeDirPath: (0, import_node_path96.join)(".agent", "skills")
|
|
15221
15561
|
};
|
|
15222
15562
|
}
|
|
15223
15563
|
getFrontmatter() {
|
|
@@ -15297,9 +15637,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
15297
15637
|
});
|
|
15298
15638
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
15299
15639
|
if (!result.success) {
|
|
15300
|
-
const skillDirPath = (0,
|
|
15640
|
+
const skillDirPath = (0, import_node_path96.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
15301
15641
|
throw new Error(
|
|
15302
|
-
`Invalid frontmatter in ${(0,
|
|
15642
|
+
`Invalid frontmatter in ${(0, import_node_path96.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
15303
15643
|
);
|
|
15304
15644
|
}
|
|
15305
15645
|
return new _AntigravitySkill({
|
|
@@ -15336,7 +15676,7 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
15336
15676
|
var AntigravitySharedSkill = class extends ToolSkill {
|
|
15337
15677
|
constructor({
|
|
15338
15678
|
outputRoot = process.cwd(),
|
|
15339
|
-
relativeDirPath = (0,
|
|
15679
|
+
relativeDirPath = (0, import_node_path97.join)(".agents", "skills"),
|
|
15340
15680
|
dirName,
|
|
15341
15681
|
frontmatter,
|
|
15342
15682
|
body,
|
|
@@ -15376,11 +15716,11 @@ var AntigravitySharedSkill = class extends ToolSkill {
|
|
|
15376
15716
|
} = {}) {
|
|
15377
15717
|
if (global) {
|
|
15378
15718
|
return {
|
|
15379
|
-
relativeDirPath: (0,
|
|
15719
|
+
relativeDirPath: (0, import_node_path97.join)(".gemini", this.getGlobalSubdir(), "skills")
|
|
15380
15720
|
};
|
|
15381
15721
|
}
|
|
15382
15722
|
return {
|
|
15383
|
-
relativeDirPath: (0,
|
|
15723
|
+
relativeDirPath: (0, import_node_path97.join)(".agents", "skills")
|
|
15384
15724
|
};
|
|
15385
15725
|
}
|
|
15386
15726
|
getFrontmatter() {
|
|
@@ -15460,9 +15800,9 @@ var AntigravitySharedSkill = class extends ToolSkill {
|
|
|
15460
15800
|
});
|
|
15461
15801
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
15462
15802
|
if (!result.success) {
|
|
15463
|
-
const skillDirPath = (0,
|
|
15803
|
+
const skillDirPath = (0, import_node_path97.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
15464
15804
|
throw new Error(
|
|
15465
|
-
`Invalid frontmatter in ${(0,
|
|
15805
|
+
`Invalid frontmatter in ${(0, import_node_path97.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
15466
15806
|
);
|
|
15467
15807
|
}
|
|
15468
15808
|
return new this({
|
|
@@ -15516,10 +15856,10 @@ var AntigravityIdeSkill = class extends AntigravitySharedSkill {
|
|
|
15516
15856
|
};
|
|
15517
15857
|
|
|
15518
15858
|
// src/features/skills/claudecode-skill.ts
|
|
15519
|
-
var
|
|
15859
|
+
var import_node_path98 = require("path");
|
|
15520
15860
|
var import_mini44 = require("zod/mini");
|
|
15521
|
-
var CLAUDE_SKILLS_DIR_PATH = (0,
|
|
15522
|
-
var CLAUDE_SCHEDULED_TASKS_DIR_PATH = (0,
|
|
15861
|
+
var CLAUDE_SKILLS_DIR_PATH = (0, import_node_path98.join)(".claude", "skills");
|
|
15862
|
+
var CLAUDE_SCHEDULED_TASKS_DIR_PATH = (0, import_node_path98.join)(".claude", "scheduled-tasks");
|
|
15523
15863
|
var ClaudecodeSkillFrontmatterSchema = import_mini44.z.looseObject({
|
|
15524
15864
|
name: import_mini44.z.string(),
|
|
15525
15865
|
description: import_mini44.z.string(),
|
|
@@ -15531,7 +15871,7 @@ var ClaudecodeSkillFrontmatterSchema = import_mini44.z.looseObject({
|
|
|
15531
15871
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
15532
15872
|
constructor({
|
|
15533
15873
|
outputRoot = process.cwd(),
|
|
15534
|
-
relativeDirPath = (0,
|
|
15874
|
+
relativeDirPath = (0, import_node_path98.join)(".claude", "skills"),
|
|
15535
15875
|
dirName,
|
|
15536
15876
|
frontmatter,
|
|
15537
15877
|
body,
|
|
@@ -15670,9 +16010,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
15670
16010
|
});
|
|
15671
16011
|
const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
15672
16012
|
if (!result.success) {
|
|
15673
|
-
const skillDirPath = (0,
|
|
16013
|
+
const skillDirPath = (0, import_node_path98.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
15674
16014
|
throw new Error(
|
|
15675
|
-
`Invalid frontmatter in ${(0,
|
|
16015
|
+
`Invalid frontmatter in ${(0, import_node_path98.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
15676
16016
|
);
|
|
15677
16017
|
}
|
|
15678
16018
|
return new _ClaudecodeSkill({
|
|
@@ -15706,7 +16046,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
15706
16046
|
};
|
|
15707
16047
|
|
|
15708
16048
|
// src/features/skills/cline-skill.ts
|
|
15709
|
-
var
|
|
16049
|
+
var import_node_path99 = require("path");
|
|
15710
16050
|
var import_mini45 = require("zod/mini");
|
|
15711
16051
|
var ClineSkillFrontmatterSchema = import_mini45.z.looseObject({
|
|
15712
16052
|
name: import_mini45.z.string(),
|
|
@@ -15715,7 +16055,7 @@ var ClineSkillFrontmatterSchema = import_mini45.z.looseObject({
|
|
|
15715
16055
|
var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
15716
16056
|
constructor({
|
|
15717
16057
|
outputRoot = process.cwd(),
|
|
15718
|
-
relativeDirPath = (0,
|
|
16058
|
+
relativeDirPath = (0, import_node_path99.join)(".cline", "skills"),
|
|
15719
16059
|
dirName,
|
|
15720
16060
|
frontmatter,
|
|
15721
16061
|
body,
|
|
@@ -15744,7 +16084,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
15744
16084
|
}
|
|
15745
16085
|
static getSettablePaths(_options = {}) {
|
|
15746
16086
|
return {
|
|
15747
|
-
relativeDirPath: (0,
|
|
16087
|
+
relativeDirPath: (0, import_node_path99.join)(".cline", "skills")
|
|
15748
16088
|
};
|
|
15749
16089
|
}
|
|
15750
16090
|
getFrontmatter() {
|
|
@@ -15832,13 +16172,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
15832
16172
|
});
|
|
15833
16173
|
const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
15834
16174
|
if (!result.success) {
|
|
15835
|
-
const skillDirPath = (0,
|
|
16175
|
+
const skillDirPath = (0, import_node_path99.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
15836
16176
|
throw new Error(
|
|
15837
|
-
`Invalid frontmatter in ${(0,
|
|
16177
|
+
`Invalid frontmatter in ${(0, import_node_path99.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
15838
16178
|
);
|
|
15839
16179
|
}
|
|
15840
16180
|
if (result.data.name !== loaded.dirName) {
|
|
15841
|
-
const skillFilePath = (0,
|
|
16181
|
+
const skillFilePath = (0, import_node_path99.join)(
|
|
15842
16182
|
loaded.outputRoot,
|
|
15843
16183
|
loaded.relativeDirPath,
|
|
15844
16184
|
loaded.dirName,
|
|
@@ -15879,7 +16219,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
15879
16219
|
};
|
|
15880
16220
|
|
|
15881
16221
|
// src/features/skills/codexcli-skill.ts
|
|
15882
|
-
var
|
|
16222
|
+
var import_node_path100 = require("path");
|
|
15883
16223
|
var import_mini46 = require("zod/mini");
|
|
15884
16224
|
var CodexCliSkillFrontmatterSchema = import_mini46.z.looseObject({
|
|
15885
16225
|
name: import_mini46.z.string(),
|
|
@@ -15893,7 +16233,7 @@ var CodexCliSkillFrontmatterSchema = import_mini46.z.looseObject({
|
|
|
15893
16233
|
var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
15894
16234
|
constructor({
|
|
15895
16235
|
outputRoot = process.cwd(),
|
|
15896
|
-
relativeDirPath = (0,
|
|
16236
|
+
relativeDirPath = (0, import_node_path100.join)(".codex", "skills"),
|
|
15897
16237
|
dirName,
|
|
15898
16238
|
frontmatter,
|
|
15899
16239
|
body,
|
|
@@ -15924,7 +16264,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
15924
16264
|
global: _global = false
|
|
15925
16265
|
} = {}) {
|
|
15926
16266
|
return {
|
|
15927
|
-
relativeDirPath: (0,
|
|
16267
|
+
relativeDirPath: (0, import_node_path100.join)(".codex", "skills")
|
|
15928
16268
|
};
|
|
15929
16269
|
}
|
|
15930
16270
|
getFrontmatter() {
|
|
@@ -16014,9 +16354,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
16014
16354
|
});
|
|
16015
16355
|
const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
16016
16356
|
if (!result.success) {
|
|
16017
|
-
const skillDirPath = (0,
|
|
16357
|
+
const skillDirPath = (0, import_node_path100.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
16018
16358
|
throw new Error(
|
|
16019
|
-
`Invalid frontmatter in ${(0,
|
|
16359
|
+
`Invalid frontmatter in ${(0, import_node_path100.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
16020
16360
|
);
|
|
16021
16361
|
}
|
|
16022
16362
|
return new _CodexCliSkill({
|
|
@@ -16050,7 +16390,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
16050
16390
|
};
|
|
16051
16391
|
|
|
16052
16392
|
// src/features/skills/copilot-skill.ts
|
|
16053
|
-
var
|
|
16393
|
+
var import_node_path101 = require("path");
|
|
16054
16394
|
var import_mini47 = require("zod/mini");
|
|
16055
16395
|
var CopilotSkillFrontmatterSchema = import_mini47.z.looseObject({
|
|
16056
16396
|
name: import_mini47.z.string(),
|
|
@@ -16060,7 +16400,7 @@ var CopilotSkillFrontmatterSchema = import_mini47.z.looseObject({
|
|
|
16060
16400
|
var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
16061
16401
|
constructor({
|
|
16062
16402
|
outputRoot = process.cwd(),
|
|
16063
|
-
relativeDirPath = (0,
|
|
16403
|
+
relativeDirPath = (0, import_node_path101.join)(".github", "skills"),
|
|
16064
16404
|
dirName,
|
|
16065
16405
|
frontmatter,
|
|
16066
16406
|
body,
|
|
@@ -16092,7 +16432,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
16092
16432
|
throw new Error("CopilotSkill does not support global mode.");
|
|
16093
16433
|
}
|
|
16094
16434
|
return {
|
|
16095
|
-
relativeDirPath: (0,
|
|
16435
|
+
relativeDirPath: (0, import_node_path101.join)(".github", "skills")
|
|
16096
16436
|
};
|
|
16097
16437
|
}
|
|
16098
16438
|
getFrontmatter() {
|
|
@@ -16178,9 +16518,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
16178
16518
|
});
|
|
16179
16519
|
const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
16180
16520
|
if (!result.success) {
|
|
16181
|
-
const skillDirPath = (0,
|
|
16521
|
+
const skillDirPath = (0, import_node_path101.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
16182
16522
|
throw new Error(
|
|
16183
|
-
`Invalid frontmatter in ${(0,
|
|
16523
|
+
`Invalid frontmatter in ${(0, import_node_path101.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
16184
16524
|
);
|
|
16185
16525
|
}
|
|
16186
16526
|
return new _CopilotSkill({
|
|
@@ -16215,7 +16555,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
16215
16555
|
};
|
|
16216
16556
|
|
|
16217
16557
|
// src/features/skills/cursor-skill.ts
|
|
16218
|
-
var
|
|
16558
|
+
var import_node_path102 = require("path");
|
|
16219
16559
|
var import_mini48 = require("zod/mini");
|
|
16220
16560
|
var CursorSkillFrontmatterSchema = import_mini48.z.looseObject({
|
|
16221
16561
|
name: import_mini48.z.string(),
|
|
@@ -16224,7 +16564,7 @@ var CursorSkillFrontmatterSchema = import_mini48.z.looseObject({
|
|
|
16224
16564
|
var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
16225
16565
|
constructor({
|
|
16226
16566
|
outputRoot = process.cwd(),
|
|
16227
|
-
relativeDirPath = (0,
|
|
16567
|
+
relativeDirPath = (0, import_node_path102.join)(".cursor", "skills"),
|
|
16228
16568
|
dirName,
|
|
16229
16569
|
frontmatter,
|
|
16230
16570
|
body,
|
|
@@ -16253,7 +16593,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
16253
16593
|
}
|
|
16254
16594
|
static getSettablePaths(_options) {
|
|
16255
16595
|
return {
|
|
16256
|
-
relativeDirPath: (0,
|
|
16596
|
+
relativeDirPath: (0, import_node_path102.join)(".cursor", "skills")
|
|
16257
16597
|
};
|
|
16258
16598
|
}
|
|
16259
16599
|
getFrontmatter() {
|
|
@@ -16333,9 +16673,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
16333
16673
|
});
|
|
16334
16674
|
const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
16335
16675
|
if (!result.success) {
|
|
16336
|
-
const skillDirPath = (0,
|
|
16676
|
+
const skillDirPath = (0, import_node_path102.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
16337
16677
|
throw new Error(
|
|
16338
|
-
`Invalid frontmatter in ${(0,
|
|
16678
|
+
`Invalid frontmatter in ${(0, import_node_path102.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
16339
16679
|
);
|
|
16340
16680
|
}
|
|
16341
16681
|
return new _CursorSkill({
|
|
@@ -16370,7 +16710,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
16370
16710
|
};
|
|
16371
16711
|
|
|
16372
16712
|
// src/features/skills/deepagents-skill.ts
|
|
16373
|
-
var
|
|
16713
|
+
var import_node_path103 = require("path");
|
|
16374
16714
|
var import_mini49 = require("zod/mini");
|
|
16375
16715
|
var DeepagentsSkillFrontmatterSchema = import_mini49.z.looseObject({
|
|
16376
16716
|
name: import_mini49.z.string(),
|
|
@@ -16380,7 +16720,7 @@ var DeepagentsSkillFrontmatterSchema = import_mini49.z.looseObject({
|
|
|
16380
16720
|
var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
16381
16721
|
constructor({
|
|
16382
16722
|
outputRoot = process.cwd(),
|
|
16383
|
-
relativeDirPath = (0,
|
|
16723
|
+
relativeDirPath = (0, import_node_path103.join)(".deepagents", "skills"),
|
|
16384
16724
|
dirName,
|
|
16385
16725
|
frontmatter,
|
|
16386
16726
|
body,
|
|
@@ -16409,7 +16749,7 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
16409
16749
|
}
|
|
16410
16750
|
static getSettablePaths(_options) {
|
|
16411
16751
|
return {
|
|
16412
|
-
relativeDirPath: (0,
|
|
16752
|
+
relativeDirPath: (0, import_node_path103.join)(".deepagents", "skills")
|
|
16413
16753
|
};
|
|
16414
16754
|
}
|
|
16415
16755
|
getFrontmatter() {
|
|
@@ -16495,9 +16835,9 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
16495
16835
|
});
|
|
16496
16836
|
const result = DeepagentsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
16497
16837
|
if (!result.success) {
|
|
16498
|
-
const skillDirPath = (0,
|
|
16838
|
+
const skillDirPath = (0, import_node_path103.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
16499
16839
|
throw new Error(
|
|
16500
|
-
`Invalid frontmatter in ${(0,
|
|
16840
|
+
`Invalid frontmatter in ${(0, import_node_path103.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
16501
16841
|
);
|
|
16502
16842
|
}
|
|
16503
16843
|
return new _DeepagentsSkill({
|
|
@@ -16532,7 +16872,7 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
16532
16872
|
};
|
|
16533
16873
|
|
|
16534
16874
|
// src/features/skills/geminicli-skill.ts
|
|
16535
|
-
var
|
|
16875
|
+
var import_node_path104 = require("path");
|
|
16536
16876
|
var import_mini50 = require("zod/mini");
|
|
16537
16877
|
var GeminiCliSkillFrontmatterSchema = import_mini50.z.looseObject({
|
|
16538
16878
|
name: import_mini50.z.string(),
|
|
@@ -16572,7 +16912,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
16572
16912
|
global: _global = false
|
|
16573
16913
|
} = {}) {
|
|
16574
16914
|
return {
|
|
16575
|
-
relativeDirPath: (0,
|
|
16915
|
+
relativeDirPath: (0, import_node_path104.join)(".gemini", "skills")
|
|
16576
16916
|
};
|
|
16577
16917
|
}
|
|
16578
16918
|
getFrontmatter() {
|
|
@@ -16652,9 +16992,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
16652
16992
|
});
|
|
16653
16993
|
const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
16654
16994
|
if (!result.success) {
|
|
16655
|
-
const skillDirPath = (0,
|
|
16995
|
+
const skillDirPath = (0, import_node_path104.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
16656
16996
|
throw new Error(
|
|
16657
|
-
`Invalid frontmatter in ${(0,
|
|
16997
|
+
`Invalid frontmatter in ${(0, import_node_path104.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
16658
16998
|
);
|
|
16659
16999
|
}
|
|
16660
17000
|
return new _GeminiCliSkill({
|
|
@@ -16689,7 +17029,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
16689
17029
|
};
|
|
16690
17030
|
|
|
16691
17031
|
// src/features/skills/junie-skill.ts
|
|
16692
|
-
var
|
|
17032
|
+
var import_node_path105 = require("path");
|
|
16693
17033
|
var import_mini51 = require("zod/mini");
|
|
16694
17034
|
var JunieSkillFrontmatterSchema = import_mini51.z.looseObject({
|
|
16695
17035
|
name: import_mini51.z.string(),
|
|
@@ -16698,7 +17038,7 @@ var JunieSkillFrontmatterSchema = import_mini51.z.looseObject({
|
|
|
16698
17038
|
var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
16699
17039
|
constructor({
|
|
16700
17040
|
outputRoot = process.cwd(),
|
|
16701
|
-
relativeDirPath = (0,
|
|
17041
|
+
relativeDirPath = (0, import_node_path105.join)(".junie", "skills"),
|
|
16702
17042
|
dirName,
|
|
16703
17043
|
frontmatter,
|
|
16704
17044
|
body,
|
|
@@ -16730,7 +17070,7 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
16730
17070
|
throw new Error("JunieSkill does not support global mode.");
|
|
16731
17071
|
}
|
|
16732
17072
|
return {
|
|
16733
|
-
relativeDirPath: (0,
|
|
17073
|
+
relativeDirPath: (0, import_node_path105.join)(".junie", "skills")
|
|
16734
17074
|
};
|
|
16735
17075
|
}
|
|
16736
17076
|
getFrontmatter() {
|
|
@@ -16817,13 +17157,13 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
16817
17157
|
});
|
|
16818
17158
|
const result = JunieSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
16819
17159
|
if (!result.success) {
|
|
16820
|
-
const skillDirPath = (0,
|
|
17160
|
+
const skillDirPath = (0, import_node_path105.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
16821
17161
|
throw new Error(
|
|
16822
|
-
`Invalid frontmatter in ${(0,
|
|
17162
|
+
`Invalid frontmatter in ${(0, import_node_path105.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
16823
17163
|
);
|
|
16824
17164
|
}
|
|
16825
17165
|
if (result.data.name !== loaded.dirName) {
|
|
16826
|
-
const skillFilePath = (0,
|
|
17166
|
+
const skillFilePath = (0, import_node_path105.join)(
|
|
16827
17167
|
loaded.outputRoot,
|
|
16828
17168
|
loaded.relativeDirPath,
|
|
16829
17169
|
loaded.dirName,
|
|
@@ -16865,7 +17205,7 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
16865
17205
|
};
|
|
16866
17206
|
|
|
16867
17207
|
// src/features/skills/kilo-skill.ts
|
|
16868
|
-
var
|
|
17208
|
+
var import_node_path106 = require("path");
|
|
16869
17209
|
var import_mini52 = require("zod/mini");
|
|
16870
17210
|
var KiloSkillFrontmatterSchema = import_mini52.z.looseObject({
|
|
16871
17211
|
name: import_mini52.z.string(),
|
|
@@ -16875,7 +17215,7 @@ var KiloSkillFrontmatterSchema = import_mini52.z.looseObject({
|
|
|
16875
17215
|
var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
16876
17216
|
constructor({
|
|
16877
17217
|
outputRoot = process.cwd(),
|
|
16878
|
-
relativeDirPath = (0,
|
|
17218
|
+
relativeDirPath = (0, import_node_path106.join)(".kilo", "skills"),
|
|
16879
17219
|
dirName,
|
|
16880
17220
|
frontmatter,
|
|
16881
17221
|
body,
|
|
@@ -16904,7 +17244,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
16904
17244
|
}
|
|
16905
17245
|
static getSettablePaths({ global = false } = {}) {
|
|
16906
17246
|
return {
|
|
16907
|
-
relativeDirPath: global ? (0,
|
|
17247
|
+
relativeDirPath: global ? (0, import_node_path106.join)(".config", "kilo", "skills") : (0, import_node_path106.join)(".kilo", "skills")
|
|
16908
17248
|
};
|
|
16909
17249
|
}
|
|
16910
17250
|
getFrontmatter() {
|
|
@@ -16990,9 +17330,9 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
16990
17330
|
});
|
|
16991
17331
|
const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
16992
17332
|
if (!result.success) {
|
|
16993
|
-
const skillDirPath = (0,
|
|
17333
|
+
const skillDirPath = (0, import_node_path106.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
16994
17334
|
throw new Error(
|
|
16995
|
-
`Invalid frontmatter in ${(0,
|
|
17335
|
+
`Invalid frontmatter in ${(0, import_node_path106.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
16996
17336
|
);
|
|
16997
17337
|
}
|
|
16998
17338
|
return new _KiloSkill({
|
|
@@ -17026,7 +17366,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
17026
17366
|
};
|
|
17027
17367
|
|
|
17028
17368
|
// src/features/skills/kiro-skill.ts
|
|
17029
|
-
var
|
|
17369
|
+
var import_node_path107 = require("path");
|
|
17030
17370
|
var import_mini53 = require("zod/mini");
|
|
17031
17371
|
var KiroSkillFrontmatterSchema = import_mini53.z.looseObject({
|
|
17032
17372
|
name: import_mini53.z.string(),
|
|
@@ -17035,7 +17375,7 @@ var KiroSkillFrontmatterSchema = import_mini53.z.looseObject({
|
|
|
17035
17375
|
var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
17036
17376
|
constructor({
|
|
17037
17377
|
outputRoot = process.cwd(),
|
|
17038
|
-
relativeDirPath = (0,
|
|
17378
|
+
relativeDirPath = (0, import_node_path107.join)(".kiro", "skills"),
|
|
17039
17379
|
dirName,
|
|
17040
17380
|
frontmatter,
|
|
17041
17381
|
body,
|
|
@@ -17067,7 +17407,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
17067
17407
|
throw new Error("KiroSkill does not support global mode.");
|
|
17068
17408
|
}
|
|
17069
17409
|
return {
|
|
17070
|
-
relativeDirPath: (0,
|
|
17410
|
+
relativeDirPath: (0, import_node_path107.join)(".kiro", "skills")
|
|
17071
17411
|
};
|
|
17072
17412
|
}
|
|
17073
17413
|
getFrontmatter() {
|
|
@@ -17155,13 +17495,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
17155
17495
|
});
|
|
17156
17496
|
const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
17157
17497
|
if (!result.success) {
|
|
17158
|
-
const skillDirPath = (0,
|
|
17498
|
+
const skillDirPath = (0, import_node_path107.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
17159
17499
|
throw new Error(
|
|
17160
|
-
`Invalid frontmatter in ${(0,
|
|
17500
|
+
`Invalid frontmatter in ${(0, import_node_path107.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
17161
17501
|
);
|
|
17162
17502
|
}
|
|
17163
17503
|
if (result.data.name !== loaded.dirName) {
|
|
17164
|
-
const skillFilePath = (0,
|
|
17504
|
+
const skillFilePath = (0, import_node_path107.join)(
|
|
17165
17505
|
loaded.outputRoot,
|
|
17166
17506
|
loaded.relativeDirPath,
|
|
17167
17507
|
loaded.dirName,
|
|
@@ -17203,7 +17543,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
17203
17543
|
};
|
|
17204
17544
|
|
|
17205
17545
|
// src/features/skills/opencode-skill.ts
|
|
17206
|
-
var
|
|
17546
|
+
var import_node_path108 = require("path");
|
|
17207
17547
|
var import_mini54 = require("zod/mini");
|
|
17208
17548
|
var OpenCodeSkillFrontmatterSchema = import_mini54.z.looseObject({
|
|
17209
17549
|
name: import_mini54.z.string(),
|
|
@@ -17213,7 +17553,7 @@ var OpenCodeSkillFrontmatterSchema = import_mini54.z.looseObject({
|
|
|
17213
17553
|
var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
17214
17554
|
constructor({
|
|
17215
17555
|
outputRoot = process.cwd(),
|
|
17216
|
-
relativeDirPath = (0,
|
|
17556
|
+
relativeDirPath = (0, import_node_path108.join)(".opencode", "skill"),
|
|
17217
17557
|
dirName,
|
|
17218
17558
|
frontmatter,
|
|
17219
17559
|
body,
|
|
@@ -17242,7 +17582,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
17242
17582
|
}
|
|
17243
17583
|
static getSettablePaths({ global = false } = {}) {
|
|
17244
17584
|
return {
|
|
17245
|
-
relativeDirPath: global ? (0,
|
|
17585
|
+
relativeDirPath: global ? (0, import_node_path108.join)(".config", "opencode", "skill") : (0, import_node_path108.join)(".opencode", "skill")
|
|
17246
17586
|
};
|
|
17247
17587
|
}
|
|
17248
17588
|
getFrontmatter() {
|
|
@@ -17328,9 +17668,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
17328
17668
|
});
|
|
17329
17669
|
const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
17330
17670
|
if (!result.success) {
|
|
17331
|
-
const skillDirPath = (0,
|
|
17671
|
+
const skillDirPath = (0, import_node_path108.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
17332
17672
|
throw new Error(
|
|
17333
|
-
`Invalid frontmatter in ${(0,
|
|
17673
|
+
`Invalid frontmatter in ${(0, import_node_path108.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
17334
17674
|
);
|
|
17335
17675
|
}
|
|
17336
17676
|
return new _OpenCodeSkill({
|
|
@@ -17364,11 +17704,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
17364
17704
|
};
|
|
17365
17705
|
|
|
17366
17706
|
// src/features/skills/pi-skill.ts
|
|
17367
|
-
var
|
|
17707
|
+
var import_node_path109 = require("path");
|
|
17368
17708
|
var import_mini55 = require("zod/mini");
|
|
17369
17709
|
var PiSkillFrontmatterSchema = import_mini55.z.looseObject({
|
|
17370
17710
|
name: import_mini55.z.string(),
|
|
17371
|
-
description: import_mini55.z.string()
|
|
17711
|
+
description: import_mini55.z.string(),
|
|
17712
|
+
"allowed-tools": import_mini55.z.optional(import_mini55.z.array(import_mini55.z.string())),
|
|
17713
|
+
"disable-model-invocation": import_mini55.z.optional(import_mini55.z.boolean()),
|
|
17714
|
+
license: import_mini55.z.optional(import_mini55.z.string()),
|
|
17715
|
+
compatibility: import_mini55.z.optional(import_mini55.z.looseObject({})),
|
|
17716
|
+
metadata: import_mini55.z.optional(import_mini55.z.looseObject({}))
|
|
17372
17717
|
});
|
|
17373
17718
|
var PiSkill = class _PiSkill extends ToolSkill {
|
|
17374
17719
|
constructor({
|
|
@@ -17404,11 +17749,11 @@ var PiSkill = class _PiSkill extends ToolSkill {
|
|
|
17404
17749
|
static getSettablePaths({ global } = {}) {
|
|
17405
17750
|
if (global) {
|
|
17406
17751
|
return {
|
|
17407
|
-
relativeDirPath: (0,
|
|
17752
|
+
relativeDirPath: (0, import_node_path109.join)(".pi", "agent", "skills")
|
|
17408
17753
|
};
|
|
17409
17754
|
}
|
|
17410
17755
|
return {
|
|
17411
|
-
relativeDirPath: (0,
|
|
17756
|
+
relativeDirPath: (0, import_node_path109.join)(".pi", "skills")
|
|
17412
17757
|
};
|
|
17413
17758
|
}
|
|
17414
17759
|
getFrontmatter() {
|
|
@@ -17437,10 +17782,24 @@ var PiSkill = class _PiSkill extends ToolSkill {
|
|
|
17437
17782
|
}
|
|
17438
17783
|
toRulesyncSkill() {
|
|
17439
17784
|
const frontmatter = this.getFrontmatter();
|
|
17785
|
+
const piBlock = {
|
|
17786
|
+
...frontmatter["allowed-tools"] !== void 0 && {
|
|
17787
|
+
"allowed-tools": frontmatter["allowed-tools"]
|
|
17788
|
+
},
|
|
17789
|
+
...frontmatter["disable-model-invocation"] !== void 0 && {
|
|
17790
|
+
"disable-model-invocation": frontmatter["disable-model-invocation"]
|
|
17791
|
+
},
|
|
17792
|
+
...frontmatter.license !== void 0 && { license: frontmatter.license },
|
|
17793
|
+
...frontmatter.compatibility !== void 0 && {
|
|
17794
|
+
compatibility: frontmatter.compatibility
|
|
17795
|
+
},
|
|
17796
|
+
...frontmatter.metadata !== void 0 && { metadata: frontmatter.metadata }
|
|
17797
|
+
};
|
|
17440
17798
|
const rulesyncFrontmatter = {
|
|
17441
17799
|
name: frontmatter.name,
|
|
17442
17800
|
description: frontmatter.description,
|
|
17443
|
-
targets: ["*"]
|
|
17801
|
+
targets: ["*"],
|
|
17802
|
+
...Object.keys(piBlock).length > 0 && { pi: piBlock }
|
|
17444
17803
|
};
|
|
17445
17804
|
return new RulesyncSkill({
|
|
17446
17805
|
outputRoot: this.outputRoot,
|
|
@@ -17463,7 +17822,8 @@ var PiSkill = class _PiSkill extends ToolSkill {
|
|
|
17463
17822
|
const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
|
|
17464
17823
|
const piFrontmatter = {
|
|
17465
17824
|
name: rulesyncFrontmatter.name,
|
|
17466
|
-
description: rulesyncFrontmatter.description
|
|
17825
|
+
description: rulesyncFrontmatter.description,
|
|
17826
|
+
...rulesyncFrontmatter.pi
|
|
17467
17827
|
};
|
|
17468
17828
|
return new _PiSkill({
|
|
17469
17829
|
outputRoot,
|
|
@@ -17487,9 +17847,9 @@ var PiSkill = class _PiSkill extends ToolSkill {
|
|
|
17487
17847
|
});
|
|
17488
17848
|
const result = PiSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
17489
17849
|
if (!result.success) {
|
|
17490
|
-
const skillDirPath = (0,
|
|
17850
|
+
const skillDirPath = (0, import_node_path109.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
17491
17851
|
throw new Error(
|
|
17492
|
-
`Invalid frontmatter in ${(0,
|
|
17852
|
+
`Invalid frontmatter in ${(0, import_node_path109.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
17493
17853
|
);
|
|
17494
17854
|
}
|
|
17495
17855
|
return new _PiSkill({
|
|
@@ -17524,16 +17884,20 @@ var PiSkill = class _PiSkill extends ToolSkill {
|
|
|
17524
17884
|
};
|
|
17525
17885
|
|
|
17526
17886
|
// src/features/skills/replit-skill.ts
|
|
17527
|
-
var
|
|
17887
|
+
var import_node_path110 = require("path");
|
|
17528
17888
|
var import_mini56 = require("zod/mini");
|
|
17529
17889
|
var ReplitSkillFrontmatterSchema = import_mini56.z.looseObject({
|
|
17530
17890
|
name: import_mini56.z.string(),
|
|
17531
|
-
description: import_mini56.z.string()
|
|
17891
|
+
description: import_mini56.z.string(),
|
|
17892
|
+
"allowed-tools": import_mini56.z.optional(import_mini56.z.array(import_mini56.z.string())),
|
|
17893
|
+
license: import_mini56.z.optional(import_mini56.z.string()),
|
|
17894
|
+
compatibility: import_mini56.z.optional(import_mini56.z.looseObject({})),
|
|
17895
|
+
metadata: import_mini56.z.optional(import_mini56.z.looseObject({}))
|
|
17532
17896
|
});
|
|
17533
17897
|
var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
17534
17898
|
constructor({
|
|
17535
17899
|
outputRoot = process.cwd(),
|
|
17536
|
-
relativeDirPath = (0,
|
|
17900
|
+
relativeDirPath = (0, import_node_path110.join)(".agents", "skills"),
|
|
17537
17901
|
dirName,
|
|
17538
17902
|
frontmatter,
|
|
17539
17903
|
body,
|
|
@@ -17565,7 +17929,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
17565
17929
|
throw new Error("ReplitSkill does not support global mode.");
|
|
17566
17930
|
}
|
|
17567
17931
|
return {
|
|
17568
|
-
relativeDirPath: (0,
|
|
17932
|
+
relativeDirPath: (0, import_node_path110.join)(".agents", "skills")
|
|
17569
17933
|
};
|
|
17570
17934
|
}
|
|
17571
17935
|
getFrontmatter() {
|
|
@@ -17595,10 +17959,21 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
17595
17959
|
}
|
|
17596
17960
|
toRulesyncSkill() {
|
|
17597
17961
|
const frontmatter = this.getFrontmatter();
|
|
17962
|
+
const replitBlock = {
|
|
17963
|
+
...frontmatter["allowed-tools"] !== void 0 && {
|
|
17964
|
+
"allowed-tools": frontmatter["allowed-tools"]
|
|
17965
|
+
},
|
|
17966
|
+
...frontmatter.license !== void 0 && { license: frontmatter.license },
|
|
17967
|
+
...frontmatter.compatibility !== void 0 && {
|
|
17968
|
+
compatibility: frontmatter.compatibility
|
|
17969
|
+
},
|
|
17970
|
+
...frontmatter.metadata !== void 0 && { metadata: frontmatter.metadata }
|
|
17971
|
+
};
|
|
17598
17972
|
const rulesyncFrontmatter = {
|
|
17599
17973
|
name: frontmatter.name,
|
|
17600
17974
|
description: frontmatter.description,
|
|
17601
|
-
targets: ["*"]
|
|
17975
|
+
targets: ["*"],
|
|
17976
|
+
...Object.keys(replitBlock).length > 0 && { replit: replitBlock }
|
|
17602
17977
|
};
|
|
17603
17978
|
return new RulesyncSkill({
|
|
17604
17979
|
outputRoot: this.outputRoot,
|
|
@@ -17621,7 +17996,8 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
17621
17996
|
const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
|
|
17622
17997
|
const replitFrontmatter = {
|
|
17623
17998
|
name: rulesyncFrontmatter.name,
|
|
17624
|
-
description: rulesyncFrontmatter.description
|
|
17999
|
+
description: rulesyncFrontmatter.description,
|
|
18000
|
+
...rulesyncFrontmatter.replit
|
|
17625
18001
|
};
|
|
17626
18002
|
return new _ReplitSkill({
|
|
17627
18003
|
outputRoot,
|
|
@@ -17645,9 +18021,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
17645
18021
|
});
|
|
17646
18022
|
const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
17647
18023
|
if (!result.success) {
|
|
17648
|
-
const skillDirPath = (0,
|
|
18024
|
+
const skillDirPath = (0, import_node_path110.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
17649
18025
|
throw new Error(
|
|
17650
|
-
`Invalid frontmatter in ${(0,
|
|
18026
|
+
`Invalid frontmatter in ${(0, import_node_path110.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
17651
18027
|
);
|
|
17652
18028
|
}
|
|
17653
18029
|
return new _ReplitSkill({
|
|
@@ -17682,7 +18058,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
17682
18058
|
};
|
|
17683
18059
|
|
|
17684
18060
|
// src/features/skills/roo-skill.ts
|
|
17685
|
-
var
|
|
18061
|
+
var import_node_path111 = require("path");
|
|
17686
18062
|
var import_mini57 = require("zod/mini");
|
|
17687
18063
|
var RooSkillFrontmatterSchema = import_mini57.z.looseObject({
|
|
17688
18064
|
name: import_mini57.z.string(),
|
|
@@ -17691,7 +18067,7 @@ var RooSkillFrontmatterSchema = import_mini57.z.looseObject({
|
|
|
17691
18067
|
var RooSkill = class _RooSkill extends ToolSkill {
|
|
17692
18068
|
constructor({
|
|
17693
18069
|
outputRoot = process.cwd(),
|
|
17694
|
-
relativeDirPath = (0,
|
|
18070
|
+
relativeDirPath = (0, import_node_path111.join)(".roo", "skills"),
|
|
17695
18071
|
dirName,
|
|
17696
18072
|
frontmatter,
|
|
17697
18073
|
body,
|
|
@@ -17722,7 +18098,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
17722
18098
|
global: _global = false
|
|
17723
18099
|
} = {}) {
|
|
17724
18100
|
return {
|
|
17725
|
-
relativeDirPath: (0,
|
|
18101
|
+
relativeDirPath: (0, import_node_path111.join)(".roo", "skills")
|
|
17726
18102
|
};
|
|
17727
18103
|
}
|
|
17728
18104
|
getFrontmatter() {
|
|
@@ -17810,13 +18186,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
17810
18186
|
});
|
|
17811
18187
|
const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
17812
18188
|
if (!result.success) {
|
|
17813
|
-
const skillDirPath = (0,
|
|
18189
|
+
const skillDirPath = (0, import_node_path111.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
17814
18190
|
throw new Error(
|
|
17815
|
-
`Invalid frontmatter in ${(0,
|
|
18191
|
+
`Invalid frontmatter in ${(0, import_node_path111.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
17816
18192
|
);
|
|
17817
18193
|
}
|
|
17818
18194
|
if (result.data.name !== loaded.dirName) {
|
|
17819
|
-
const skillFilePath = (0,
|
|
18195
|
+
const skillFilePath = (0, import_node_path111.join)(
|
|
17820
18196
|
loaded.outputRoot,
|
|
17821
18197
|
loaded.relativeDirPath,
|
|
17822
18198
|
loaded.dirName,
|
|
@@ -17857,24 +18233,24 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
17857
18233
|
};
|
|
17858
18234
|
|
|
17859
18235
|
// src/features/skills/skills-utils.ts
|
|
17860
|
-
var
|
|
18236
|
+
var import_node_path112 = require("path");
|
|
17861
18237
|
async function getLocalSkillDirNames(outputRoot) {
|
|
17862
|
-
const skillsDir = (0,
|
|
18238
|
+
const skillsDir = (0, import_node_path112.join)(outputRoot, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
|
|
17863
18239
|
const names = /* @__PURE__ */ new Set();
|
|
17864
18240
|
if (!await directoryExists(skillsDir)) {
|
|
17865
18241
|
return names;
|
|
17866
18242
|
}
|
|
17867
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
18243
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path112.join)(skillsDir, "*"), { type: "dir" });
|
|
17868
18244
|
for (const dirPath of dirPaths) {
|
|
17869
|
-
const name = (0,
|
|
17870
|
-
if (name === (0,
|
|
18245
|
+
const name = (0, import_node_path112.basename)(dirPath);
|
|
18246
|
+
if (name === (0, import_node_path112.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
|
|
17871
18247
|
names.add(name);
|
|
17872
18248
|
}
|
|
17873
18249
|
return names;
|
|
17874
18250
|
}
|
|
17875
18251
|
|
|
17876
18252
|
// src/features/skills/takt-skill.ts
|
|
17877
|
-
var
|
|
18253
|
+
var import_node_path113 = __toESM(require("path"), 1);
|
|
17878
18254
|
var DEFAULT_TAKT_SKILL_DIR = "knowledge";
|
|
17879
18255
|
var TaktSkill = class _TaktSkill extends ToolSkill {
|
|
17880
18256
|
fileName;
|
|
@@ -17911,7 +18287,7 @@ var TaktSkill = class _TaktSkill extends ToolSkill {
|
|
|
17911
18287
|
}
|
|
17912
18288
|
static getSettablePaths(_options = {}) {
|
|
17913
18289
|
return {
|
|
17914
|
-
relativeDirPath: (0,
|
|
18290
|
+
relativeDirPath: (0, import_node_path113.join)(".takt", "facets", DEFAULT_TAKT_SKILL_DIR)
|
|
17915
18291
|
};
|
|
17916
18292
|
}
|
|
17917
18293
|
/**
|
|
@@ -17922,11 +18298,11 @@ var TaktSkill = class _TaktSkill extends ToolSkill {
|
|
|
17922
18298
|
* malicious `relativeDirPath` cannot escape `outputRoot`.
|
|
17923
18299
|
*/
|
|
17924
18300
|
getDirPath() {
|
|
17925
|
-
const fullPath = (0,
|
|
17926
|
-
const resolvedFull = (0,
|
|
17927
|
-
const resolvedBase = (0,
|
|
17928
|
-
const rel = (0,
|
|
17929
|
-
if (rel.startsWith("..") ||
|
|
18301
|
+
const fullPath = (0, import_node_path113.join)(this.outputRoot, this.relativeDirPath);
|
|
18302
|
+
const resolvedFull = (0, import_node_path113.resolve)(fullPath);
|
|
18303
|
+
const resolvedBase = (0, import_node_path113.resolve)(this.outputRoot);
|
|
18304
|
+
const rel = (0, import_node_path113.relative)(resolvedBase, resolvedFull);
|
|
18305
|
+
if (rel.startsWith("..") || import_node_path113.default.isAbsolute(rel)) {
|
|
17930
18306
|
throw new Error(
|
|
17931
18307
|
`Path traversal detected: Final path escapes outputRoot. outputRoot="${this.outputRoot}", relativeDirPath="${this.relativeDirPath}"`
|
|
17932
18308
|
);
|
|
@@ -17963,7 +18339,7 @@ var TaktSkill = class _TaktSkill extends ToolSkill {
|
|
|
17963
18339
|
const stem = overrideName ?? rulesyncSkill.getDirName();
|
|
17964
18340
|
assertSafeTaktName({ name: stem, featureLabel: "skill", sourceLabel });
|
|
17965
18341
|
const fileName = `${stem}.md`;
|
|
17966
|
-
const relativeDirPath = (0,
|
|
18342
|
+
const relativeDirPath = (0, import_node_path113.join)(".takt", "facets", DEFAULT_TAKT_SKILL_DIR);
|
|
17967
18343
|
return new _TaktSkill({
|
|
17968
18344
|
outputRoot,
|
|
17969
18345
|
relativeDirPath,
|
|
@@ -18013,7 +18389,7 @@ var TaktSkill = class _TaktSkill extends ToolSkill {
|
|
|
18013
18389
|
};
|
|
18014
18390
|
|
|
18015
18391
|
// src/features/skills/windsurf-skill.ts
|
|
18016
|
-
var
|
|
18392
|
+
var import_node_path114 = require("path");
|
|
18017
18393
|
var import_mini58 = require("zod/mini");
|
|
18018
18394
|
var WindsurfSkillFrontmatterSchema = import_mini58.z.looseObject({
|
|
18019
18395
|
name: import_mini58.z.string(),
|
|
@@ -18052,11 +18428,11 @@ var WindsurfSkill = class _WindsurfSkill extends ToolSkill {
|
|
|
18052
18428
|
static getSettablePaths({ global = false } = {}) {
|
|
18053
18429
|
if (global) {
|
|
18054
18430
|
return {
|
|
18055
|
-
relativeDirPath: (0,
|
|
18431
|
+
relativeDirPath: (0, import_node_path114.join)(".codeium", "windsurf", "skills")
|
|
18056
18432
|
};
|
|
18057
18433
|
}
|
|
18058
18434
|
return {
|
|
18059
|
-
relativeDirPath: (0,
|
|
18435
|
+
relativeDirPath: (0, import_node_path114.join)(".windsurf", "skills")
|
|
18060
18436
|
};
|
|
18061
18437
|
}
|
|
18062
18438
|
getFrontmatter() {
|
|
@@ -18136,9 +18512,9 @@ var WindsurfSkill = class _WindsurfSkill extends ToolSkill {
|
|
|
18136
18512
|
});
|
|
18137
18513
|
const result = WindsurfSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
18138
18514
|
if (!result.success) {
|
|
18139
|
-
const skillDirPath = (0,
|
|
18515
|
+
const skillDirPath = (0, import_node_path114.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
18140
18516
|
throw new Error(
|
|
18141
|
-
`Invalid frontmatter in ${(0,
|
|
18517
|
+
`Invalid frontmatter in ${(0, import_node_path114.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
18142
18518
|
);
|
|
18143
18519
|
}
|
|
18144
18520
|
return new _WindsurfSkill({
|
|
@@ -18173,7 +18549,7 @@ var WindsurfSkill = class _WindsurfSkill extends ToolSkill {
|
|
|
18173
18549
|
};
|
|
18174
18550
|
|
|
18175
18551
|
// src/features/skills/zed-skill.ts
|
|
18176
|
-
var
|
|
18552
|
+
var import_node_path115 = require("path");
|
|
18177
18553
|
var import_mini59 = require("zod/mini");
|
|
18178
18554
|
var ZedSkillFrontmatterSchema = import_mini59.z.looseObject({
|
|
18179
18555
|
name: import_mini59.z.string(),
|
|
@@ -18183,7 +18559,7 @@ var ZedSkillFrontmatterSchema = import_mini59.z.looseObject({
|
|
|
18183
18559
|
var ZedSkill = class _ZedSkill extends ToolSkill {
|
|
18184
18560
|
constructor({
|
|
18185
18561
|
outputRoot = process.cwd(),
|
|
18186
|
-
relativeDirPath = (0,
|
|
18562
|
+
relativeDirPath = (0, import_node_path115.join)(".agents", "skills"),
|
|
18187
18563
|
dirName,
|
|
18188
18564
|
frontmatter,
|
|
18189
18565
|
body,
|
|
@@ -18212,7 +18588,7 @@ var ZedSkill = class _ZedSkill extends ToolSkill {
|
|
|
18212
18588
|
}
|
|
18213
18589
|
static getSettablePaths(_options) {
|
|
18214
18590
|
return {
|
|
18215
|
-
relativeDirPath: (0,
|
|
18591
|
+
relativeDirPath: (0, import_node_path115.join)(".agents", "skills")
|
|
18216
18592
|
};
|
|
18217
18593
|
}
|
|
18218
18594
|
getFrontmatter() {
|
|
@@ -18291,9 +18667,9 @@ var ZedSkill = class _ZedSkill extends ToolSkill {
|
|
|
18291
18667
|
});
|
|
18292
18668
|
const result = ZedSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
18293
18669
|
if (!result.success) {
|
|
18294
|
-
const skillDirPath = (0,
|
|
18670
|
+
const skillDirPath = (0, import_node_path115.join)(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
18295
18671
|
throw new Error(
|
|
18296
|
-
`Invalid frontmatter in ${(0,
|
|
18672
|
+
`Invalid frontmatter in ${(0, import_node_path115.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
18297
18673
|
);
|
|
18298
18674
|
}
|
|
18299
18675
|
return new _ZedSkill({
|
|
@@ -18627,11 +19003,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
18627
19003
|
)
|
|
18628
19004
|
);
|
|
18629
19005
|
const localSkillNames = new Set(localDirNames);
|
|
18630
|
-
const curatedDirPath = (0,
|
|
19006
|
+
const curatedDirPath = (0, import_node_path116.join)(this.inputRoot, RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
|
|
18631
19007
|
let curatedSkills = [];
|
|
18632
19008
|
if (await directoryExists(curatedDirPath)) {
|
|
18633
|
-
const curatedDirPaths = await findFilesByGlobs((0,
|
|
18634
|
-
const curatedDirNames = curatedDirPaths.map((path4) => (0,
|
|
19009
|
+
const curatedDirPaths = await findFilesByGlobs((0, import_node_path116.join)(curatedDirPath, "*"), { type: "dir" });
|
|
19010
|
+
const curatedDirNames = curatedDirPaths.map((path4) => (0, import_node_path116.basename)(path4));
|
|
18635
19011
|
const nonConflicting = curatedDirNames.filter((name) => {
|
|
18636
19012
|
if (localSkillNames.has(name)) {
|
|
18637
19013
|
this.logger.debug(`Skipping curated skill "${name}": local skill takes precedence.`);
|
|
@@ -18668,13 +19044,13 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
18668
19044
|
const seenDirNames = /* @__PURE__ */ new Set();
|
|
18669
19045
|
const loadEntries = [];
|
|
18670
19046
|
for (const root of roots) {
|
|
18671
|
-
const skillsDirPath = (0,
|
|
19047
|
+
const skillsDirPath = (0, import_node_path116.join)(this.outputRoot, root);
|
|
18672
19048
|
if (!await directoryExists(skillsDirPath)) {
|
|
18673
19049
|
continue;
|
|
18674
19050
|
}
|
|
18675
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
19051
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path116.join)(skillsDirPath, "*"), { type: "dir" });
|
|
18676
19052
|
for (const dirPath of dirPaths) {
|
|
18677
|
-
const dirName = (0,
|
|
19053
|
+
const dirName = (0, import_node_path116.basename)(dirPath);
|
|
18678
19054
|
if (seenDirNames.has(dirName)) {
|
|
18679
19055
|
continue;
|
|
18680
19056
|
}
|
|
@@ -18703,13 +19079,13 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
18703
19079
|
const roots = toolSkillSearchRoots(paths);
|
|
18704
19080
|
const toolSkills = [];
|
|
18705
19081
|
for (const root of roots) {
|
|
18706
|
-
const skillsDirPath = (0,
|
|
19082
|
+
const skillsDirPath = (0, import_node_path116.join)(this.outputRoot, root);
|
|
18707
19083
|
if (!await directoryExists(skillsDirPath)) {
|
|
18708
19084
|
continue;
|
|
18709
19085
|
}
|
|
18710
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
19086
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path116.join)(skillsDirPath, "*"), { type: "dir" });
|
|
18711
19087
|
for (const dirPath of dirPaths) {
|
|
18712
|
-
const dirName = (0,
|
|
19088
|
+
const dirName = (0, import_node_path116.basename)(dirPath);
|
|
18713
19089
|
const toolSkill = factory.class.forDeletion({
|
|
18714
19090
|
outputRoot: this.outputRoot,
|
|
18715
19091
|
relativeDirPath: root,
|
|
@@ -18771,10 +19147,10 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
18771
19147
|
};
|
|
18772
19148
|
|
|
18773
19149
|
// src/features/subagents/agentsmd-subagent.ts
|
|
18774
|
-
var
|
|
19150
|
+
var import_node_path118 = require("path");
|
|
18775
19151
|
|
|
18776
19152
|
// src/features/subagents/simulated-subagent.ts
|
|
18777
|
-
var
|
|
19153
|
+
var import_node_path117 = require("path");
|
|
18778
19154
|
var import_mini61 = require("zod/mini");
|
|
18779
19155
|
|
|
18780
19156
|
// src/features/subagents/tool-subagent.ts
|
|
@@ -18839,7 +19215,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
18839
19215
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
18840
19216
|
if (!result.success) {
|
|
18841
19217
|
throw new Error(
|
|
18842
|
-
`Invalid frontmatter in ${(0,
|
|
19218
|
+
`Invalid frontmatter in ${(0, import_node_path117.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
18843
19219
|
);
|
|
18844
19220
|
}
|
|
18845
19221
|
}
|
|
@@ -18890,7 +19266,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
18890
19266
|
return {
|
|
18891
19267
|
success: false,
|
|
18892
19268
|
error: new Error(
|
|
18893
|
-
`Invalid frontmatter in ${(0,
|
|
19269
|
+
`Invalid frontmatter in ${(0, import_node_path117.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
18894
19270
|
)
|
|
18895
19271
|
};
|
|
18896
19272
|
}
|
|
@@ -18900,7 +19276,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
18900
19276
|
relativeFilePath,
|
|
18901
19277
|
validate = true
|
|
18902
19278
|
}) {
|
|
18903
|
-
const filePath = (0,
|
|
19279
|
+
const filePath = (0, import_node_path117.join)(outputRoot, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
18904
19280
|
const fileContent = await readFileContent(filePath);
|
|
18905
19281
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
18906
19282
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -18910,7 +19286,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
18910
19286
|
return {
|
|
18911
19287
|
outputRoot,
|
|
18912
19288
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
18913
|
-
relativeFilePath: (0,
|
|
19289
|
+
relativeFilePath: (0, import_node_path117.basename)(relativeFilePath),
|
|
18914
19290
|
frontmatter: result.data,
|
|
18915
19291
|
body: content.trim(),
|
|
18916
19292
|
validate
|
|
@@ -18936,7 +19312,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
18936
19312
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
18937
19313
|
static getSettablePaths() {
|
|
18938
19314
|
return {
|
|
18939
|
-
relativeDirPath: (0,
|
|
19315
|
+
relativeDirPath: (0, import_node_path118.join)(".agents", "subagents")
|
|
18940
19316
|
};
|
|
18941
19317
|
}
|
|
18942
19318
|
static async fromFile(params) {
|
|
@@ -18959,11 +19335,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
18959
19335
|
};
|
|
18960
19336
|
|
|
18961
19337
|
// src/features/subagents/factorydroid-subagent.ts
|
|
18962
|
-
var
|
|
19338
|
+
var import_node_path119 = require("path");
|
|
18963
19339
|
var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
|
|
18964
19340
|
static getSettablePaths(_options) {
|
|
18965
19341
|
return {
|
|
18966
|
-
relativeDirPath: (0,
|
|
19342
|
+
relativeDirPath: (0, import_node_path119.join)(".factory", "droids")
|
|
18967
19343
|
};
|
|
18968
19344
|
}
|
|
18969
19345
|
static async fromFile(params) {
|
|
@@ -18986,11 +19362,11 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
|
|
|
18986
19362
|
};
|
|
18987
19363
|
|
|
18988
19364
|
// src/features/subagents/geminicli-subagent.ts
|
|
18989
|
-
var
|
|
19365
|
+
var import_node_path121 = require("path");
|
|
18990
19366
|
var import_mini63 = require("zod/mini");
|
|
18991
19367
|
|
|
18992
19368
|
// src/features/subagents/rulesync-subagent.ts
|
|
18993
|
-
var
|
|
19369
|
+
var import_node_path120 = require("path");
|
|
18994
19370
|
var import_mini62 = require("zod/mini");
|
|
18995
19371
|
var RulesyncSubagentFrontmatterSchema = import_mini62.z.looseObject({
|
|
18996
19372
|
targets: import_mini62.z._default(RulesyncTargetsSchema, ["*"]),
|
|
@@ -19009,7 +19385,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
19009
19385
|
const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
19010
19386
|
if (!parseResult.success && rest.validate !== false) {
|
|
19011
19387
|
throw new Error(
|
|
19012
|
-
`Invalid frontmatter in ${(0,
|
|
19388
|
+
`Invalid frontmatter in ${(0, import_node_path120.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
19013
19389
|
);
|
|
19014
19390
|
}
|
|
19015
19391
|
const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
|
|
@@ -19042,7 +19418,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
19042
19418
|
return {
|
|
19043
19419
|
success: false,
|
|
19044
19420
|
error: new Error(
|
|
19045
|
-
`Invalid frontmatter in ${(0,
|
|
19421
|
+
`Invalid frontmatter in ${(0, import_node_path120.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
19046
19422
|
)
|
|
19047
19423
|
};
|
|
19048
19424
|
}
|
|
@@ -19051,14 +19427,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
19051
19427
|
outputRoot = process.cwd(),
|
|
19052
19428
|
relativeFilePath
|
|
19053
19429
|
}) {
|
|
19054
|
-
const filePath = (0,
|
|
19430
|
+
const filePath = (0, import_node_path120.join)(outputRoot, RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
|
|
19055
19431
|
const fileContent = await readFileContent(filePath);
|
|
19056
19432
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
19057
19433
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
19058
19434
|
if (!result.success) {
|
|
19059
19435
|
throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
|
|
19060
19436
|
}
|
|
19061
|
-
const filename = (0,
|
|
19437
|
+
const filename = (0, import_node_path120.basename)(relativeFilePath);
|
|
19062
19438
|
return new _RulesyncSubagent({
|
|
19063
19439
|
outputRoot,
|
|
19064
19440
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
@@ -19082,7 +19458,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
19082
19458
|
const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
19083
19459
|
if (!result.success) {
|
|
19084
19460
|
throw new Error(
|
|
19085
|
-
`Invalid frontmatter in ${(0,
|
|
19461
|
+
`Invalid frontmatter in ${(0, import_node_path121.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
19086
19462
|
);
|
|
19087
19463
|
}
|
|
19088
19464
|
}
|
|
@@ -19095,7 +19471,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
19095
19471
|
}
|
|
19096
19472
|
static getSettablePaths(_options = {}) {
|
|
19097
19473
|
return {
|
|
19098
|
-
relativeDirPath: (0,
|
|
19474
|
+
relativeDirPath: (0, import_node_path121.join)(".gemini", "agents")
|
|
19099
19475
|
};
|
|
19100
19476
|
}
|
|
19101
19477
|
getFrontmatter() {
|
|
@@ -19163,7 +19539,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
19163
19539
|
return {
|
|
19164
19540
|
success: false,
|
|
19165
19541
|
error: new Error(
|
|
19166
|
-
`Invalid frontmatter in ${(0,
|
|
19542
|
+
`Invalid frontmatter in ${(0, import_node_path121.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
19167
19543
|
)
|
|
19168
19544
|
};
|
|
19169
19545
|
}
|
|
@@ -19181,7 +19557,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
19181
19557
|
global = false
|
|
19182
19558
|
}) {
|
|
19183
19559
|
const paths = this.getSettablePaths({ global });
|
|
19184
|
-
const filePath = (0,
|
|
19560
|
+
const filePath = (0, import_node_path121.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
19185
19561
|
const fileContent = await readFileContent(filePath);
|
|
19186
19562
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
19187
19563
|
const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -19217,11 +19593,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
19217
19593
|
};
|
|
19218
19594
|
|
|
19219
19595
|
// src/features/subagents/roo-subagent.ts
|
|
19220
|
-
var
|
|
19596
|
+
var import_node_path122 = require("path");
|
|
19221
19597
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
19222
19598
|
static getSettablePaths() {
|
|
19223
19599
|
return {
|
|
19224
|
-
relativeDirPath: (0,
|
|
19600
|
+
relativeDirPath: (0, import_node_path122.join)(".roo", "subagents")
|
|
19225
19601
|
};
|
|
19226
19602
|
}
|
|
19227
19603
|
static async fromFile(params) {
|
|
@@ -19244,7 +19620,7 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
19244
19620
|
};
|
|
19245
19621
|
|
|
19246
19622
|
// src/features/subagents/rovodev-subagent.ts
|
|
19247
|
-
var
|
|
19623
|
+
var import_node_path123 = require("path");
|
|
19248
19624
|
var import_mini64 = require("zod/mini");
|
|
19249
19625
|
var RovodevSubagentFrontmatterSchema = import_mini64.z.looseObject({
|
|
19250
19626
|
name: import_mini64.z.string(),
|
|
@@ -19258,7 +19634,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
19258
19634
|
const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
19259
19635
|
if (!result.success) {
|
|
19260
19636
|
throw new Error(
|
|
19261
|
-
`Invalid frontmatter in ${(0,
|
|
19637
|
+
`Invalid frontmatter in ${(0, import_node_path123.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
19262
19638
|
);
|
|
19263
19639
|
}
|
|
19264
19640
|
}
|
|
@@ -19270,7 +19646,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
19270
19646
|
}
|
|
19271
19647
|
static getSettablePaths(_options = {}) {
|
|
19272
19648
|
return {
|
|
19273
|
-
relativeDirPath: (0,
|
|
19649
|
+
relativeDirPath: (0, import_node_path123.join)(".rovodev", "subagents")
|
|
19274
19650
|
};
|
|
19275
19651
|
}
|
|
19276
19652
|
getFrontmatter() {
|
|
@@ -19333,7 +19709,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
19333
19709
|
return {
|
|
19334
19710
|
success: false,
|
|
19335
19711
|
error: new Error(
|
|
19336
|
-
`Invalid frontmatter in ${(0,
|
|
19712
|
+
`Invalid frontmatter in ${(0, import_node_path123.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
19337
19713
|
)
|
|
19338
19714
|
};
|
|
19339
19715
|
}
|
|
@@ -19350,7 +19726,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
19350
19726
|
global = false
|
|
19351
19727
|
}) {
|
|
19352
19728
|
const paths = this.getSettablePaths({ global });
|
|
19353
|
-
const filePath = (0,
|
|
19729
|
+
const filePath = (0, import_node_path123.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
19354
19730
|
const fileContent = await readFileContent(filePath);
|
|
19355
19731
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
19356
19732
|
const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -19389,11 +19765,11 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
19389
19765
|
};
|
|
19390
19766
|
|
|
19391
19767
|
// src/features/subagents/subagents-processor.ts
|
|
19392
|
-
var
|
|
19768
|
+
var import_node_path136 = require("path");
|
|
19393
19769
|
var import_mini75 = require("zod/mini");
|
|
19394
19770
|
|
|
19395
19771
|
// src/features/subagents/claudecode-subagent.ts
|
|
19396
|
-
var
|
|
19772
|
+
var import_node_path124 = require("path");
|
|
19397
19773
|
var import_mini65 = require("zod/mini");
|
|
19398
19774
|
var ClaudecodeSubagentFrontmatterSchema = import_mini65.z.looseObject({
|
|
19399
19775
|
name: import_mini65.z.string(),
|
|
@@ -19411,7 +19787,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
19411
19787
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
19412
19788
|
if (!result.success) {
|
|
19413
19789
|
throw new Error(
|
|
19414
|
-
`Invalid frontmatter in ${(0,
|
|
19790
|
+
`Invalid frontmatter in ${(0, import_node_path124.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
19415
19791
|
);
|
|
19416
19792
|
}
|
|
19417
19793
|
}
|
|
@@ -19423,7 +19799,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
19423
19799
|
}
|
|
19424
19800
|
static getSettablePaths(_options = {}) {
|
|
19425
19801
|
return {
|
|
19426
|
-
relativeDirPath: (0,
|
|
19802
|
+
relativeDirPath: (0, import_node_path124.join)(".claude", "agents")
|
|
19427
19803
|
};
|
|
19428
19804
|
}
|
|
19429
19805
|
getFrontmatter() {
|
|
@@ -19502,7 +19878,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
19502
19878
|
return {
|
|
19503
19879
|
success: false,
|
|
19504
19880
|
error: new Error(
|
|
19505
|
-
`Invalid frontmatter in ${(0,
|
|
19881
|
+
`Invalid frontmatter in ${(0, import_node_path124.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
19506
19882
|
)
|
|
19507
19883
|
};
|
|
19508
19884
|
}
|
|
@@ -19520,7 +19896,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
19520
19896
|
global = false
|
|
19521
19897
|
}) {
|
|
19522
19898
|
const paths = this.getSettablePaths({ global });
|
|
19523
|
-
const filePath = (0,
|
|
19899
|
+
const filePath = (0, import_node_path124.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
19524
19900
|
const fileContent = await readFileContent(filePath);
|
|
19525
19901
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
19526
19902
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -19555,7 +19931,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
19555
19931
|
};
|
|
19556
19932
|
|
|
19557
19933
|
// src/features/subagents/codexcli-subagent.ts
|
|
19558
|
-
var
|
|
19934
|
+
var import_node_path125 = require("path");
|
|
19559
19935
|
var smolToml6 = __toESM(require("smol-toml"), 1);
|
|
19560
19936
|
var import_mini66 = require("zod/mini");
|
|
19561
19937
|
var CodexCliSubagentTomlSchema = import_mini66.z.looseObject({
|
|
@@ -19586,7 +19962,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
19586
19962
|
CodexCliSubagentTomlSchema.parse(parsed);
|
|
19587
19963
|
} catch (error) {
|
|
19588
19964
|
throw new Error(
|
|
19589
|
-
`Invalid TOML in ${(0,
|
|
19965
|
+
`Invalid TOML in ${(0, import_node_path125.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
19590
19966
|
{ cause: error }
|
|
19591
19967
|
);
|
|
19592
19968
|
}
|
|
@@ -19598,7 +19974,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
19598
19974
|
}
|
|
19599
19975
|
static getSettablePaths(_options = {}) {
|
|
19600
19976
|
return {
|
|
19601
|
-
relativeDirPath: (0,
|
|
19977
|
+
relativeDirPath: (0, import_node_path125.join)(".codex", "agents")
|
|
19602
19978
|
};
|
|
19603
19979
|
}
|
|
19604
19980
|
getBody() {
|
|
@@ -19610,7 +19986,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
19610
19986
|
parsed = CodexCliSubagentTomlSchema.parse(smolToml6.parse(this.body));
|
|
19611
19987
|
} catch (error) {
|
|
19612
19988
|
throw new Error(
|
|
19613
|
-
`Failed to parse TOML in ${(0,
|
|
19989
|
+
`Failed to parse TOML in ${(0, import_node_path125.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
19614
19990
|
{ cause: error }
|
|
19615
19991
|
);
|
|
19616
19992
|
}
|
|
@@ -19691,7 +20067,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
19691
20067
|
global = false
|
|
19692
20068
|
}) {
|
|
19693
20069
|
const paths = this.getSettablePaths({ global });
|
|
19694
|
-
const filePath = (0,
|
|
20070
|
+
const filePath = (0, import_node_path125.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
19695
20071
|
const fileContent = await readFileContent(filePath);
|
|
19696
20072
|
const subagent = new _CodexCliSubagent({
|
|
19697
20073
|
outputRoot,
|
|
@@ -19729,7 +20105,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
19729
20105
|
};
|
|
19730
20106
|
|
|
19731
20107
|
// src/features/subagents/copilot-subagent.ts
|
|
19732
|
-
var
|
|
20108
|
+
var import_node_path126 = require("path");
|
|
19733
20109
|
var import_mini67 = require("zod/mini");
|
|
19734
20110
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
19735
20111
|
var CopilotSubagentFrontmatterSchema = import_mini67.z.looseObject({
|
|
@@ -19770,7 +20146,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
19770
20146
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
19771
20147
|
if (!result.success) {
|
|
19772
20148
|
throw new Error(
|
|
19773
|
-
`Invalid frontmatter in ${(0,
|
|
20149
|
+
`Invalid frontmatter in ${(0, import_node_path126.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
19774
20150
|
);
|
|
19775
20151
|
}
|
|
19776
20152
|
}
|
|
@@ -19782,7 +20158,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
19782
20158
|
}
|
|
19783
20159
|
static getSettablePaths(_options = {}) {
|
|
19784
20160
|
return {
|
|
19785
|
-
relativeDirPath: (0,
|
|
20161
|
+
relativeDirPath: (0, import_node_path126.join)(".github", "agents")
|
|
19786
20162
|
};
|
|
19787
20163
|
}
|
|
19788
20164
|
getFrontmatter() {
|
|
@@ -19856,7 +20232,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
19856
20232
|
return {
|
|
19857
20233
|
success: false,
|
|
19858
20234
|
error: new Error(
|
|
19859
|
-
`Invalid frontmatter in ${(0,
|
|
20235
|
+
`Invalid frontmatter in ${(0, import_node_path126.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
19860
20236
|
)
|
|
19861
20237
|
};
|
|
19862
20238
|
}
|
|
@@ -19874,7 +20250,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
19874
20250
|
global = false
|
|
19875
20251
|
}) {
|
|
19876
20252
|
const paths = this.getSettablePaths({ global });
|
|
19877
|
-
const filePath = (0,
|
|
20253
|
+
const filePath = (0, import_node_path126.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
19878
20254
|
const fileContent = await readFileContent(filePath);
|
|
19879
20255
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
19880
20256
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -19910,7 +20286,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
19910
20286
|
};
|
|
19911
20287
|
|
|
19912
20288
|
// src/features/subagents/copilotcli-subagent.ts
|
|
19913
|
-
var
|
|
20289
|
+
var import_node_path127 = require("path");
|
|
19914
20290
|
var import_mini68 = require("zod/mini");
|
|
19915
20291
|
var CopilotCliSubagentFrontmatterSchema = import_mini68.z.looseObject({
|
|
19916
20292
|
description: import_mini68.z.string(),
|
|
@@ -19946,7 +20322,7 @@ var CopilotcliSubagent = class _CopilotcliSubagent extends ToolSubagent {
|
|
|
19946
20322
|
const result = CopilotCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
19947
20323
|
if (!result.success) {
|
|
19948
20324
|
throw new Error(
|
|
19949
|
-
`Invalid frontmatter in ${(0,
|
|
20325
|
+
`Invalid frontmatter in ${(0, import_node_path127.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
19950
20326
|
);
|
|
19951
20327
|
}
|
|
19952
20328
|
}
|
|
@@ -19958,9 +20334,9 @@ var CopilotcliSubagent = class _CopilotcliSubagent extends ToolSubagent {
|
|
|
19958
20334
|
global = false
|
|
19959
20335
|
} = {}) {
|
|
19960
20336
|
if (global) {
|
|
19961
|
-
return { relativeDirPath: (0,
|
|
20337
|
+
return { relativeDirPath: (0, import_node_path127.join)(".copilot", "agents") };
|
|
19962
20338
|
}
|
|
19963
|
-
return { relativeDirPath: (0,
|
|
20339
|
+
return { relativeDirPath: (0, import_node_path127.join)(".github", "agents") };
|
|
19964
20340
|
}
|
|
19965
20341
|
getFrontmatter() {
|
|
19966
20342
|
return this.frontmatter;
|
|
@@ -20038,7 +20414,7 @@ var CopilotcliSubagent = class _CopilotcliSubagent extends ToolSubagent {
|
|
|
20038
20414
|
return {
|
|
20039
20415
|
success: false,
|
|
20040
20416
|
error: new Error(
|
|
20041
|
-
`Invalid frontmatter in ${(0,
|
|
20417
|
+
`Invalid frontmatter in ${(0, import_node_path127.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
20042
20418
|
)
|
|
20043
20419
|
};
|
|
20044
20420
|
}
|
|
@@ -20055,7 +20431,7 @@ var CopilotcliSubagent = class _CopilotcliSubagent extends ToolSubagent {
|
|
|
20055
20431
|
global = false
|
|
20056
20432
|
}) {
|
|
20057
20433
|
const paths = this.getSettablePaths({ global });
|
|
20058
|
-
const filePath = (0,
|
|
20434
|
+
const filePath = (0, import_node_path127.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
20059
20435
|
const fileContent = await readFileContent(filePath);
|
|
20060
20436
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
20061
20437
|
const result = CopilotCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -20091,7 +20467,7 @@ var CopilotcliSubagent = class _CopilotcliSubagent extends ToolSubagent {
|
|
|
20091
20467
|
};
|
|
20092
20468
|
|
|
20093
20469
|
// src/features/subagents/cursor-subagent.ts
|
|
20094
|
-
var
|
|
20470
|
+
var import_node_path128 = require("path");
|
|
20095
20471
|
var import_mini69 = require("zod/mini");
|
|
20096
20472
|
var CursorSubagentFrontmatterSchema = import_mini69.z.looseObject({
|
|
20097
20473
|
name: import_mini69.z.string(),
|
|
@@ -20105,7 +20481,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
20105
20481
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
20106
20482
|
if (!result.success) {
|
|
20107
20483
|
throw new Error(
|
|
20108
|
-
`Invalid frontmatter in ${(0,
|
|
20484
|
+
`Invalid frontmatter in ${(0, import_node_path128.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
20109
20485
|
);
|
|
20110
20486
|
}
|
|
20111
20487
|
}
|
|
@@ -20117,7 +20493,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
20117
20493
|
}
|
|
20118
20494
|
static getSettablePaths(_options = {}) {
|
|
20119
20495
|
return {
|
|
20120
|
-
relativeDirPath: (0,
|
|
20496
|
+
relativeDirPath: (0, import_node_path128.join)(".cursor", "agents")
|
|
20121
20497
|
};
|
|
20122
20498
|
}
|
|
20123
20499
|
getFrontmatter() {
|
|
@@ -20184,7 +20560,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
20184
20560
|
return {
|
|
20185
20561
|
success: false,
|
|
20186
20562
|
error: new Error(
|
|
20187
|
-
`Invalid frontmatter in ${(0,
|
|
20563
|
+
`Invalid frontmatter in ${(0, import_node_path128.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
20188
20564
|
)
|
|
20189
20565
|
};
|
|
20190
20566
|
}
|
|
@@ -20202,7 +20578,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
20202
20578
|
global = false
|
|
20203
20579
|
}) {
|
|
20204
20580
|
const paths = this.getSettablePaths({ global });
|
|
20205
|
-
const filePath = (0,
|
|
20581
|
+
const filePath = (0, import_node_path128.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
20206
20582
|
const fileContent = await readFileContent(filePath);
|
|
20207
20583
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
20208
20584
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -20238,7 +20614,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
20238
20614
|
};
|
|
20239
20615
|
|
|
20240
20616
|
// src/features/subagents/deepagents-subagent.ts
|
|
20241
|
-
var
|
|
20617
|
+
var import_node_path129 = require("path");
|
|
20242
20618
|
var import_mini70 = require("zod/mini");
|
|
20243
20619
|
var DeepagentsSubagentFrontmatterSchema = import_mini70.z.looseObject({
|
|
20244
20620
|
name: import_mini70.z.string(),
|
|
@@ -20253,7 +20629,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
20253
20629
|
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
20254
20630
|
if (!result.success) {
|
|
20255
20631
|
throw new Error(
|
|
20256
|
-
`Invalid frontmatter in ${(0,
|
|
20632
|
+
`Invalid frontmatter in ${(0, import_node_path129.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
20257
20633
|
);
|
|
20258
20634
|
}
|
|
20259
20635
|
}
|
|
@@ -20263,7 +20639,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
20263
20639
|
}
|
|
20264
20640
|
static getSettablePaths(_options = {}) {
|
|
20265
20641
|
return {
|
|
20266
|
-
relativeDirPath: (0,
|
|
20642
|
+
relativeDirPath: (0, import_node_path129.join)(".deepagents", "agents")
|
|
20267
20643
|
};
|
|
20268
20644
|
}
|
|
20269
20645
|
getFrontmatter() {
|
|
@@ -20338,7 +20714,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
20338
20714
|
return {
|
|
20339
20715
|
success: false,
|
|
20340
20716
|
error: new Error(
|
|
20341
|
-
`Invalid frontmatter in ${(0,
|
|
20717
|
+
`Invalid frontmatter in ${(0, import_node_path129.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
20342
20718
|
)
|
|
20343
20719
|
};
|
|
20344
20720
|
}
|
|
@@ -20356,7 +20732,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
20356
20732
|
global = false
|
|
20357
20733
|
}) {
|
|
20358
20734
|
const paths = this.getSettablePaths({ global });
|
|
20359
|
-
const filePath = (0,
|
|
20735
|
+
const filePath = (0, import_node_path129.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
20360
20736
|
const fileContent = await readFileContent(filePath);
|
|
20361
20737
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
20362
20738
|
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -20391,7 +20767,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
20391
20767
|
};
|
|
20392
20768
|
|
|
20393
20769
|
// src/features/subagents/junie-subagent.ts
|
|
20394
|
-
var
|
|
20770
|
+
var import_node_path130 = require("path");
|
|
20395
20771
|
var import_mini71 = require("zod/mini");
|
|
20396
20772
|
var JunieSubagentFrontmatterSchema = import_mini71.z.looseObject({
|
|
20397
20773
|
name: import_mini71.z.optional(import_mini71.z.string()),
|
|
@@ -20405,7 +20781,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
20405
20781
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
20406
20782
|
if (!result.success) {
|
|
20407
20783
|
throw new Error(
|
|
20408
|
-
`Invalid frontmatter in ${(0,
|
|
20784
|
+
`Invalid frontmatter in ${(0, import_node_path130.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
20409
20785
|
);
|
|
20410
20786
|
}
|
|
20411
20787
|
}
|
|
@@ -20420,7 +20796,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
20420
20796
|
throw new Error("JunieSubagent does not support global mode.");
|
|
20421
20797
|
}
|
|
20422
20798
|
return {
|
|
20423
|
-
relativeDirPath: (0,
|
|
20799
|
+
relativeDirPath: (0, import_node_path130.join)(".junie", "agents")
|
|
20424
20800
|
};
|
|
20425
20801
|
}
|
|
20426
20802
|
getFrontmatter() {
|
|
@@ -20496,7 +20872,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
20496
20872
|
return {
|
|
20497
20873
|
success: false,
|
|
20498
20874
|
error: new Error(
|
|
20499
|
-
`Invalid frontmatter in ${(0,
|
|
20875
|
+
`Invalid frontmatter in ${(0, import_node_path130.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
20500
20876
|
)
|
|
20501
20877
|
};
|
|
20502
20878
|
}
|
|
@@ -20514,7 +20890,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
20514
20890
|
global = false
|
|
20515
20891
|
}) {
|
|
20516
20892
|
const paths = this.getSettablePaths({ global });
|
|
20517
|
-
const filePath = (0,
|
|
20893
|
+
const filePath = (0, import_node_path130.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
20518
20894
|
const fileContent = await readFileContent(filePath);
|
|
20519
20895
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
20520
20896
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -20549,11 +20925,11 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
20549
20925
|
};
|
|
20550
20926
|
|
|
20551
20927
|
// src/features/subagents/kilo-subagent.ts
|
|
20552
|
-
var
|
|
20928
|
+
var import_node_path132 = require("path");
|
|
20553
20929
|
var import_mini73 = require("zod/mini");
|
|
20554
20930
|
|
|
20555
20931
|
// src/features/subagents/opencode-style-subagent.ts
|
|
20556
|
-
var
|
|
20932
|
+
var import_node_path131 = require("path");
|
|
20557
20933
|
var import_mini72 = require("zod/mini");
|
|
20558
20934
|
var OpenCodeStyleSubagentFrontmatterSchema = import_mini72.z.looseObject({
|
|
20559
20935
|
description: import_mini72.z.optional(import_mini72.z.string()),
|
|
@@ -20568,7 +20944,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
20568
20944
|
const result = OpenCodeStyleSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
20569
20945
|
if (!result.success) {
|
|
20570
20946
|
throw new Error(
|
|
20571
|
-
`Invalid frontmatter in ${(0,
|
|
20947
|
+
`Invalid frontmatter in ${(0, import_node_path131.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
20572
20948
|
);
|
|
20573
20949
|
}
|
|
20574
20950
|
}
|
|
@@ -20588,7 +20964,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
20588
20964
|
const { description, mode, name, ...toolSection } = this.frontmatter;
|
|
20589
20965
|
const rulesyncFrontmatter = {
|
|
20590
20966
|
targets: ["*"],
|
|
20591
|
-
name: name ?? (0,
|
|
20967
|
+
name: name ?? (0, import_node_path131.basename)(this.getRelativeFilePath(), ".md"),
|
|
20592
20968
|
description,
|
|
20593
20969
|
[this.getToolTarget()]: { mode, ...toolSection }
|
|
20594
20970
|
};
|
|
@@ -20610,7 +20986,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
20610
20986
|
return {
|
|
20611
20987
|
success: false,
|
|
20612
20988
|
error: new Error(
|
|
20613
|
-
`Invalid frontmatter in ${(0,
|
|
20989
|
+
`Invalid frontmatter in ${(0, import_node_path131.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
20614
20990
|
)
|
|
20615
20991
|
};
|
|
20616
20992
|
}
|
|
@@ -20661,7 +21037,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
20661
21037
|
return {
|
|
20662
21038
|
success: false,
|
|
20663
21039
|
error: new Error(
|
|
20664
|
-
`Invalid frontmatter in ${(0,
|
|
21040
|
+
`Invalid frontmatter in ${(0, import_node_path132.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
20665
21041
|
)
|
|
20666
21042
|
};
|
|
20667
21043
|
}
|
|
@@ -20669,7 +21045,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
20669
21045
|
global = false
|
|
20670
21046
|
} = {}) {
|
|
20671
21047
|
return {
|
|
20672
|
-
relativeDirPath: global ? (0,
|
|
21048
|
+
relativeDirPath: global ? (0, import_node_path132.join)(".config", "kilo", "agent") : (0, import_node_path132.join)(".kilo", "agent")
|
|
20673
21049
|
};
|
|
20674
21050
|
}
|
|
20675
21051
|
static fromRulesyncSubagent({
|
|
@@ -20718,7 +21094,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
20718
21094
|
global = false
|
|
20719
21095
|
}) {
|
|
20720
21096
|
const paths = this.getSettablePaths({ global });
|
|
20721
|
-
const filePath = (0,
|
|
21097
|
+
const filePath = (0, import_node_path132.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
20722
21098
|
const fileContent = await readFileContent(filePath);
|
|
20723
21099
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
20724
21100
|
const result = KiloSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -20756,7 +21132,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
20756
21132
|
};
|
|
20757
21133
|
|
|
20758
21134
|
// src/features/subagents/kiro-subagent.ts
|
|
20759
|
-
var
|
|
21135
|
+
var import_node_path133 = require("path");
|
|
20760
21136
|
var import_mini74 = require("zod/mini");
|
|
20761
21137
|
var KiroCliSubagentJsonSchema = import_mini74.z.looseObject({
|
|
20762
21138
|
name: import_mini74.z.string(),
|
|
@@ -20783,7 +21159,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
20783
21159
|
KiroCliSubagentJsonSchema.parse(parsed);
|
|
20784
21160
|
} catch (error) {
|
|
20785
21161
|
throw new Error(
|
|
20786
|
-
`Invalid JSON in ${(0,
|
|
21162
|
+
`Invalid JSON in ${(0, import_node_path133.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
20787
21163
|
{ cause: error }
|
|
20788
21164
|
);
|
|
20789
21165
|
}
|
|
@@ -20795,7 +21171,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
20795
21171
|
}
|
|
20796
21172
|
static getSettablePaths(_options = {}) {
|
|
20797
21173
|
return {
|
|
20798
|
-
relativeDirPath: (0,
|
|
21174
|
+
relativeDirPath: (0, import_node_path133.join)(".kiro", "agents")
|
|
20799
21175
|
};
|
|
20800
21176
|
}
|
|
20801
21177
|
getBody() {
|
|
@@ -20807,7 +21183,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
20807
21183
|
parsed = JSON.parse(this.body);
|
|
20808
21184
|
} catch (error) {
|
|
20809
21185
|
throw new Error(
|
|
20810
|
-
`Failed to parse JSON in ${(0,
|
|
21186
|
+
`Failed to parse JSON in ${(0, import_node_path133.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
20811
21187
|
{ cause: error }
|
|
20812
21188
|
);
|
|
20813
21189
|
}
|
|
@@ -20888,7 +21264,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
20888
21264
|
global = false
|
|
20889
21265
|
}) {
|
|
20890
21266
|
const paths = this.getSettablePaths({ global });
|
|
20891
|
-
const filePath = (0,
|
|
21267
|
+
const filePath = (0, import_node_path133.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
20892
21268
|
const fileContent = await readFileContent(filePath);
|
|
20893
21269
|
const subagent = new _KiroSubagent({
|
|
20894
21270
|
outputRoot,
|
|
@@ -20926,7 +21302,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
20926
21302
|
};
|
|
20927
21303
|
|
|
20928
21304
|
// src/features/subagents/opencode-subagent.ts
|
|
20929
|
-
var
|
|
21305
|
+
var import_node_path134 = require("path");
|
|
20930
21306
|
var OpenCodeSubagentFrontmatterSchema = OpenCodeStyleSubagentFrontmatterSchema;
|
|
20931
21307
|
var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
20932
21308
|
getToolTarget() {
|
|
@@ -20936,7 +21312,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
20936
21312
|
global = false
|
|
20937
21313
|
} = {}) {
|
|
20938
21314
|
return {
|
|
20939
|
-
relativeDirPath: global ? (0,
|
|
21315
|
+
relativeDirPath: global ? (0, import_node_path134.join)(".config", "opencode", "agent") : (0, import_node_path134.join)(".opencode", "agent")
|
|
20940
21316
|
};
|
|
20941
21317
|
}
|
|
20942
21318
|
static fromRulesyncSubagent({
|
|
@@ -20980,7 +21356,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
20980
21356
|
global = false
|
|
20981
21357
|
}) {
|
|
20982
21358
|
const paths = this.getSettablePaths({ global });
|
|
20983
|
-
const filePath = (0,
|
|
21359
|
+
const filePath = (0, import_node_path134.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
20984
21360
|
const fileContent = await readFileContent(filePath);
|
|
20985
21361
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
20986
21362
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -21018,7 +21394,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
21018
21394
|
};
|
|
21019
21395
|
|
|
21020
21396
|
// src/features/subagents/takt-subagent.ts
|
|
21021
|
-
var
|
|
21397
|
+
var import_node_path135 = require("path");
|
|
21022
21398
|
var DEFAULT_TAKT_SUBAGENT_DIR = "personas";
|
|
21023
21399
|
var TaktSubagent = class _TaktSubagent extends ToolSubagent {
|
|
21024
21400
|
body;
|
|
@@ -21030,7 +21406,7 @@ var TaktSubagent = class _TaktSubagent extends ToolSubagent {
|
|
|
21030
21406
|
}
|
|
21031
21407
|
static getSettablePaths(_options = {}) {
|
|
21032
21408
|
return {
|
|
21033
|
-
relativeDirPath: (0,
|
|
21409
|
+
relativeDirPath: (0, import_node_path135.join)(".takt", "facets", DEFAULT_TAKT_SUBAGENT_DIR)
|
|
21034
21410
|
};
|
|
21035
21411
|
}
|
|
21036
21412
|
getBody() {
|
|
@@ -21092,7 +21468,7 @@ var TaktSubagent = class _TaktSubagent extends ToolSubagent {
|
|
|
21092
21468
|
global = false
|
|
21093
21469
|
}) {
|
|
21094
21470
|
const paths = this.getSettablePaths({ global });
|
|
21095
|
-
const filePath = (0,
|
|
21471
|
+
const filePath = (0, import_node_path135.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
21096
21472
|
const fileContent = await readFileContent(filePath);
|
|
21097
21473
|
const { body } = parseFrontmatter(fileContent, filePath);
|
|
21098
21474
|
return new _TaktSubagent({
|
|
@@ -21349,7 +21725,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
21349
21725
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
21350
21726
|
*/
|
|
21351
21727
|
async loadRulesyncFiles() {
|
|
21352
|
-
const subagentsDir = (0,
|
|
21728
|
+
const subagentsDir = (0, import_node_path136.join)(this.inputRoot, RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
21353
21729
|
const dirExists = await directoryExists(subagentsDir);
|
|
21354
21730
|
if (!dirExists) {
|
|
21355
21731
|
this.logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -21364,7 +21740,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
21364
21740
|
this.logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
21365
21741
|
const rulesyncSubagents = [];
|
|
21366
21742
|
for (const mdFile of mdFiles) {
|
|
21367
|
-
const filepath = (0,
|
|
21743
|
+
const filepath = (0, import_node_path136.join)(subagentsDir, mdFile);
|
|
21368
21744
|
try {
|
|
21369
21745
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
21370
21746
|
outputRoot: this.inputRoot,
|
|
@@ -21395,14 +21771,14 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
21395
21771
|
const factory = this.getFactory(this.toolTarget);
|
|
21396
21772
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
21397
21773
|
const subagentFilePaths = await findFilesByGlobs(
|
|
21398
|
-
(0,
|
|
21774
|
+
(0, import_node_path136.join)(this.outputRoot, paths.relativeDirPath, factory.meta.filePattern)
|
|
21399
21775
|
);
|
|
21400
21776
|
if (forDeletion) {
|
|
21401
21777
|
const toolSubagents2 = subagentFilePaths.map(
|
|
21402
21778
|
(path4) => factory.class.forDeletion({
|
|
21403
21779
|
outputRoot: this.outputRoot,
|
|
21404
21780
|
relativeDirPath: paths.relativeDirPath,
|
|
21405
|
-
relativeFilePath: (0,
|
|
21781
|
+
relativeFilePath: (0, import_node_path136.basename)(path4),
|
|
21406
21782
|
global: this.global
|
|
21407
21783
|
})
|
|
21408
21784
|
).filter((subagent) => subagent.isDeletable());
|
|
@@ -21415,7 +21791,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
21415
21791
|
subagentFilePaths.map(
|
|
21416
21792
|
(path4) => factory.class.fromFile({
|
|
21417
21793
|
outputRoot: this.outputRoot,
|
|
21418
|
-
relativeFilePath: (0,
|
|
21794
|
+
relativeFilePath: (0, import_node_path136.basename)(path4),
|
|
21419
21795
|
global: this.global
|
|
21420
21796
|
})
|
|
21421
21797
|
)
|
|
@@ -21462,13 +21838,13 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
21462
21838
|
};
|
|
21463
21839
|
|
|
21464
21840
|
// src/features/rules/agentsmd-rule.ts
|
|
21465
|
-
var
|
|
21841
|
+
var import_node_path139 = require("path");
|
|
21466
21842
|
|
|
21467
21843
|
// src/features/rules/tool-rule.ts
|
|
21468
|
-
var
|
|
21844
|
+
var import_node_path138 = require("path");
|
|
21469
21845
|
|
|
21470
21846
|
// src/features/rules/rulesync-rule.ts
|
|
21471
|
-
var
|
|
21847
|
+
var import_node_path137 = require("path");
|
|
21472
21848
|
var import_mini76 = require("zod/mini");
|
|
21473
21849
|
var RulesyncRuleFrontmatterSchema = import_mini76.z.object({
|
|
21474
21850
|
root: import_mini76.z.optional(import_mini76.z.boolean()),
|
|
@@ -21521,7 +21897,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
21521
21897
|
const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
21522
21898
|
if (!parseResult.success && rest.validate !== false) {
|
|
21523
21899
|
throw new Error(
|
|
21524
|
-
`Invalid frontmatter in ${(0,
|
|
21900
|
+
`Invalid frontmatter in ${(0, import_node_path137.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
21525
21901
|
);
|
|
21526
21902
|
}
|
|
21527
21903
|
const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
|
|
@@ -21556,7 +21932,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
21556
21932
|
return {
|
|
21557
21933
|
success: false,
|
|
21558
21934
|
error: new Error(
|
|
21559
|
-
`Invalid frontmatter in ${(0,
|
|
21935
|
+
`Invalid frontmatter in ${(0, import_node_path137.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
21560
21936
|
)
|
|
21561
21937
|
};
|
|
21562
21938
|
}
|
|
@@ -21566,7 +21942,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
21566
21942
|
relativeFilePath,
|
|
21567
21943
|
validate = true
|
|
21568
21944
|
}) {
|
|
21569
|
-
const filePath = (0,
|
|
21945
|
+
const filePath = (0, import_node_path137.join)(
|
|
21570
21946
|
outputRoot,
|
|
21571
21947
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
21572
21948
|
relativeFilePath
|
|
@@ -21665,7 +22041,7 @@ var ToolRule = class extends ToolFile {
|
|
|
21665
22041
|
rulesyncRule,
|
|
21666
22042
|
validate = true,
|
|
21667
22043
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
21668
|
-
nonRootPath = { relativeDirPath: (0,
|
|
22044
|
+
nonRootPath = { relativeDirPath: (0, import_node_path138.join)(".agents", "memories") }
|
|
21669
22045
|
}) {
|
|
21670
22046
|
const params = this.buildToolRuleParamsDefault({
|
|
21671
22047
|
outputRoot,
|
|
@@ -21676,7 +22052,7 @@ var ToolRule = class extends ToolFile {
|
|
|
21676
22052
|
});
|
|
21677
22053
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
21678
22054
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
21679
|
-
params.relativeDirPath = (0,
|
|
22055
|
+
params.relativeDirPath = (0, import_node_path138.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
21680
22056
|
params.relativeFilePath = "AGENTS.md";
|
|
21681
22057
|
}
|
|
21682
22058
|
return params;
|
|
@@ -21725,7 +22101,7 @@ var ToolRule = class extends ToolFile {
|
|
|
21725
22101
|
}
|
|
21726
22102
|
};
|
|
21727
22103
|
function buildToolPath(toolDir, subDir, excludeToolDir) {
|
|
21728
|
-
return excludeToolDir ? subDir : (0,
|
|
22104
|
+
return excludeToolDir ? subDir : (0, import_node_path138.join)(toolDir, subDir);
|
|
21729
22105
|
}
|
|
21730
22106
|
|
|
21731
22107
|
// src/features/rules/agentsmd-rule.ts
|
|
@@ -21754,8 +22130,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
21754
22130
|
validate = true
|
|
21755
22131
|
}) {
|
|
21756
22132
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
21757
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
21758
|
-
const fileContent = await readFileContent((0,
|
|
22133
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path139.join)(".agents", "memories", relativeFilePath);
|
|
22134
|
+
const fileContent = await readFileContent((0, import_node_path139.join)(outputRoot, relativePath));
|
|
21759
22135
|
return new _AgentsMdRule({
|
|
21760
22136
|
outputRoot,
|
|
21761
22137
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -21810,7 +22186,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
21810
22186
|
};
|
|
21811
22187
|
|
|
21812
22188
|
// src/features/rules/antigravity-cli-rule.ts
|
|
21813
|
-
var
|
|
22189
|
+
var import_node_path140 = require("path");
|
|
21814
22190
|
var AntigravityCliRule = class _AntigravityCliRule extends ToolRule {
|
|
21815
22191
|
static getSettablePaths({
|
|
21816
22192
|
global,
|
|
@@ -21845,7 +22221,7 @@ var AntigravityCliRule = class _AntigravityCliRule extends ToolRule {
|
|
|
21845
22221
|
if (isRoot) {
|
|
21846
22222
|
const relativePath2 = paths.root.relativeFilePath;
|
|
21847
22223
|
const fileContent2 = await readFileContent(
|
|
21848
|
-
(0,
|
|
22224
|
+
(0, import_node_path140.join)(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
21849
22225
|
);
|
|
21850
22226
|
return new _AntigravityCliRule({
|
|
21851
22227
|
outputRoot,
|
|
@@ -21859,8 +22235,8 @@ var AntigravityCliRule = class _AntigravityCliRule extends ToolRule {
|
|
|
21859
22235
|
if (!paths.nonRoot) {
|
|
21860
22236
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
21861
22237
|
}
|
|
21862
|
-
const relativePath = (0,
|
|
21863
|
-
const fileContent = await readFileContent((0,
|
|
22238
|
+
const relativePath = (0, import_node_path140.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
22239
|
+
const fileContent = await readFileContent((0, import_node_path140.join)(outputRoot, relativePath));
|
|
21864
22240
|
return new _AntigravityCliRule({
|
|
21865
22241
|
outputRoot,
|
|
21866
22242
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -21919,10 +22295,10 @@ var AntigravityCliRule = class _AntigravityCliRule extends ToolRule {
|
|
|
21919
22295
|
};
|
|
21920
22296
|
|
|
21921
22297
|
// src/features/rules/antigravity-ide-rule.ts
|
|
21922
|
-
var
|
|
22298
|
+
var import_node_path142 = require("path");
|
|
21923
22299
|
|
|
21924
22300
|
// src/features/rules/antigravity-rule.ts
|
|
21925
|
-
var
|
|
22301
|
+
var import_node_path141 = require("path");
|
|
21926
22302
|
var import_mini77 = require("zod/mini");
|
|
21927
22303
|
var AntigravityRuleFrontmatterSchema = import_mini77.z.looseObject({
|
|
21928
22304
|
trigger: import_mini77.z.optional(
|
|
@@ -22081,7 +22457,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
22081
22457
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
22082
22458
|
if (!result.success) {
|
|
22083
22459
|
throw new Error(
|
|
22084
|
-
`Invalid frontmatter in ${(0,
|
|
22460
|
+
`Invalid frontmatter in ${(0, import_node_path141.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
22085
22461
|
);
|
|
22086
22462
|
}
|
|
22087
22463
|
}
|
|
@@ -22105,7 +22481,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
22105
22481
|
relativeFilePath,
|
|
22106
22482
|
validate = true
|
|
22107
22483
|
}) {
|
|
22108
|
-
const filePath = (0,
|
|
22484
|
+
const filePath = (0, import_node_path141.join)(
|
|
22109
22485
|
outputRoot,
|
|
22110
22486
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
22111
22487
|
relativeFilePath
|
|
@@ -22253,7 +22629,7 @@ var AntigravityIdeRule = class _AntigravityIdeRule extends ToolRule {
|
|
|
22253
22629
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
22254
22630
|
if (!result.success) {
|
|
22255
22631
|
throw new Error(
|
|
22256
|
-
`Invalid frontmatter in ${(0,
|
|
22632
|
+
`Invalid frontmatter in ${(0, import_node_path142.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
22257
22633
|
);
|
|
22258
22634
|
}
|
|
22259
22635
|
}
|
|
@@ -22296,7 +22672,7 @@ var AntigravityIdeRule = class _AntigravityIdeRule extends ToolRule {
|
|
|
22296
22672
|
if (global) {
|
|
22297
22673
|
const rootPath = _AntigravityIdeRule.getGlobalRootPath();
|
|
22298
22674
|
const fileContent2 = await readFileContent(
|
|
22299
|
-
(0,
|
|
22675
|
+
(0, import_node_path142.join)(outputRoot, rootPath.relativeDirPath, rootPath.relativeFilePath)
|
|
22300
22676
|
);
|
|
22301
22677
|
return new _AntigravityIdeRule({
|
|
22302
22678
|
outputRoot,
|
|
@@ -22309,7 +22685,7 @@ var AntigravityIdeRule = class _AntigravityIdeRule extends ToolRule {
|
|
|
22309
22685
|
});
|
|
22310
22686
|
}
|
|
22311
22687
|
const nonRootDirPath = buildToolPath(".agents", "rules");
|
|
22312
|
-
const filePath = (0,
|
|
22688
|
+
const filePath = (0, import_node_path142.join)(outputRoot, nonRootDirPath, relativeFilePath);
|
|
22313
22689
|
const fileContent = await readFileContent(filePath);
|
|
22314
22690
|
const { frontmatter, body } = parseFrontmatter(fileContent, filePath);
|
|
22315
22691
|
let parsedFrontmatter;
|
|
@@ -22438,7 +22814,7 @@ var AntigravityIdeRule = class _AntigravityIdeRule extends ToolRule {
|
|
|
22438
22814
|
};
|
|
22439
22815
|
|
|
22440
22816
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
22441
|
-
var
|
|
22817
|
+
var import_node_path143 = require("path");
|
|
22442
22818
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
22443
22819
|
toRulesyncRule() {
|
|
22444
22820
|
const rulesyncFrontmatter = {
|
|
@@ -22498,8 +22874,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
22498
22874
|
}) {
|
|
22499
22875
|
const settablePaths = this.getSettablePaths();
|
|
22500
22876
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
22501
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0,
|
|
22502
|
-
const fileContent = await readFileContent((0,
|
|
22877
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path143.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
22878
|
+
const fileContent = await readFileContent((0, import_node_path143.join)(outputRoot, relativePath));
|
|
22503
22879
|
return new _AugmentcodeLegacyRule({
|
|
22504
22880
|
outputRoot,
|
|
22505
22881
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -22528,7 +22904,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
22528
22904
|
};
|
|
22529
22905
|
|
|
22530
22906
|
// src/features/rules/augmentcode-rule.ts
|
|
22531
|
-
var
|
|
22907
|
+
var import_node_path144 = require("path");
|
|
22532
22908
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
22533
22909
|
toRulesyncRule() {
|
|
22534
22910
|
return this.toRulesyncRuleDefault();
|
|
@@ -22559,7 +22935,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
22559
22935
|
relativeFilePath,
|
|
22560
22936
|
validate = true
|
|
22561
22937
|
}) {
|
|
22562
|
-
const filePath = (0,
|
|
22938
|
+
const filePath = (0, import_node_path144.join)(
|
|
22563
22939
|
outputRoot,
|
|
22564
22940
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
22565
22941
|
relativeFilePath
|
|
@@ -22599,7 +22975,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
22599
22975
|
};
|
|
22600
22976
|
|
|
22601
22977
|
// src/features/rules/claudecode-legacy-rule.ts
|
|
22602
|
-
var
|
|
22978
|
+
var import_node_path145 = require("path");
|
|
22603
22979
|
var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
22604
22980
|
static getSettablePaths({
|
|
22605
22981
|
global,
|
|
@@ -22641,7 +23017,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
22641
23017
|
if (isRoot) {
|
|
22642
23018
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
22643
23019
|
const fileContent2 = await readFileContent(
|
|
22644
|
-
(0,
|
|
23020
|
+
(0, import_node_path145.join)(outputRoot, rootDirPath, paths.root.relativeFilePath)
|
|
22645
23021
|
);
|
|
22646
23022
|
return new _ClaudecodeLegacyRule({
|
|
22647
23023
|
outputRoot,
|
|
@@ -22655,8 +23031,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
22655
23031
|
if (!paths.nonRoot) {
|
|
22656
23032
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
22657
23033
|
}
|
|
22658
|
-
const relativePath = (0,
|
|
22659
|
-
const fileContent = await readFileContent((0,
|
|
23034
|
+
const relativePath = (0, import_node_path145.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
23035
|
+
const fileContent = await readFileContent((0, import_node_path145.join)(outputRoot, relativePath));
|
|
22660
23036
|
return new _ClaudecodeLegacyRule({
|
|
22661
23037
|
outputRoot,
|
|
22662
23038
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -22715,7 +23091,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
22715
23091
|
};
|
|
22716
23092
|
|
|
22717
23093
|
// src/features/rules/claudecode-rule.ts
|
|
22718
|
-
var
|
|
23094
|
+
var import_node_path146 = require("path");
|
|
22719
23095
|
var import_mini78 = require("zod/mini");
|
|
22720
23096
|
var ClaudecodeRuleFrontmatterSchema = import_mini78.z.object({
|
|
22721
23097
|
paths: import_mini78.z.optional(import_mini78.z.array(import_mini78.z.string()))
|
|
@@ -22756,7 +23132,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
22756
23132
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
22757
23133
|
if (!result.success) {
|
|
22758
23134
|
throw new Error(
|
|
22759
|
-
`Invalid frontmatter in ${(0,
|
|
23135
|
+
`Invalid frontmatter in ${(0, import_node_path146.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
22760
23136
|
);
|
|
22761
23137
|
}
|
|
22762
23138
|
}
|
|
@@ -22786,7 +23162,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
22786
23162
|
if (isRoot) {
|
|
22787
23163
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
22788
23164
|
const fileContent2 = await readFileContent(
|
|
22789
|
-
(0,
|
|
23165
|
+
(0, import_node_path146.join)(outputRoot, rootDirPath, paths.root.relativeFilePath)
|
|
22790
23166
|
);
|
|
22791
23167
|
return new _ClaudecodeRule({
|
|
22792
23168
|
outputRoot,
|
|
@@ -22801,8 +23177,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
22801
23177
|
if (!paths.nonRoot) {
|
|
22802
23178
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
22803
23179
|
}
|
|
22804
|
-
const relativePath = (0,
|
|
22805
|
-
const filePath = (0,
|
|
23180
|
+
const relativePath = (0, import_node_path146.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
23181
|
+
const filePath = (0, import_node_path146.join)(outputRoot, relativePath);
|
|
22806
23182
|
const fileContent = await readFileContent(filePath);
|
|
22807
23183
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
22808
23184
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -22913,7 +23289,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
22913
23289
|
return {
|
|
22914
23290
|
success: false,
|
|
22915
23291
|
error: new Error(
|
|
22916
|
-
`Invalid frontmatter in ${(0,
|
|
23292
|
+
`Invalid frontmatter in ${(0, import_node_path146.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
22917
23293
|
)
|
|
22918
23294
|
};
|
|
22919
23295
|
}
|
|
@@ -22933,7 +23309,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
22933
23309
|
};
|
|
22934
23310
|
|
|
22935
23311
|
// src/features/rules/cline-rule.ts
|
|
22936
|
-
var
|
|
23312
|
+
var import_node_path147 = require("path");
|
|
22937
23313
|
var import_mini79 = require("zod/mini");
|
|
22938
23314
|
var ClineRuleFrontmatterSchema = import_mini79.z.object({
|
|
22939
23315
|
description: import_mini79.z.string()
|
|
@@ -22979,7 +23355,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
22979
23355
|
validate = true
|
|
22980
23356
|
}) {
|
|
22981
23357
|
const fileContent = await readFileContent(
|
|
22982
|
-
(0,
|
|
23358
|
+
(0, import_node_path147.join)(outputRoot, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
22983
23359
|
);
|
|
22984
23360
|
return new _ClineRule({
|
|
22985
23361
|
outputRoot,
|
|
@@ -23005,7 +23381,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
23005
23381
|
};
|
|
23006
23382
|
|
|
23007
23383
|
// src/features/rules/codexcli-rule.ts
|
|
23008
|
-
var
|
|
23384
|
+
var import_node_path148 = require("path");
|
|
23009
23385
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
23010
23386
|
static getSettablePaths({
|
|
23011
23387
|
global,
|
|
@@ -23040,7 +23416,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
23040
23416
|
if (isRoot) {
|
|
23041
23417
|
const relativePath2 = paths.root.relativeFilePath;
|
|
23042
23418
|
const fileContent2 = await readFileContent(
|
|
23043
|
-
(0,
|
|
23419
|
+
(0, import_node_path148.join)(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
23044
23420
|
);
|
|
23045
23421
|
return new _CodexcliRule({
|
|
23046
23422
|
outputRoot,
|
|
@@ -23054,8 +23430,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
23054
23430
|
if (!paths.nonRoot) {
|
|
23055
23431
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
23056
23432
|
}
|
|
23057
|
-
const relativePath = (0,
|
|
23058
|
-
const fileContent = await readFileContent((0,
|
|
23433
|
+
const relativePath = (0, import_node_path148.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
23434
|
+
const fileContent = await readFileContent((0, import_node_path148.join)(outputRoot, relativePath));
|
|
23059
23435
|
return new _CodexcliRule({
|
|
23060
23436
|
outputRoot,
|
|
23061
23437
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -23114,7 +23490,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
23114
23490
|
};
|
|
23115
23491
|
|
|
23116
23492
|
// src/features/rules/copilot-rule.ts
|
|
23117
|
-
var
|
|
23493
|
+
var import_node_path149 = require("path");
|
|
23118
23494
|
var import_mini80 = require("zod/mini");
|
|
23119
23495
|
var CopilotRuleFrontmatterSchema = import_mini80.z.object({
|
|
23120
23496
|
description: import_mini80.z.optional(import_mini80.z.string()),
|
|
@@ -23122,7 +23498,7 @@ var CopilotRuleFrontmatterSchema = import_mini80.z.object({
|
|
|
23122
23498
|
excludeAgent: import_mini80.z.optional(import_mini80.z.union([import_mini80.z.literal("code-review"), import_mini80.z.literal("coding-agent")]))
|
|
23123
23499
|
});
|
|
23124
23500
|
var normalizeRelativePath = (p) => toPosixPath(p).replace(/\/+/g, "/");
|
|
23125
|
-
var sameRelativePath = (left, right) => normalizeRelativePath((0,
|
|
23501
|
+
var sameRelativePath = (left, right) => normalizeRelativePath((0, import_node_path149.join)(left.dir, left.file)) === normalizeRelativePath((0, import_node_path149.join)(right.dir, right.file));
|
|
23126
23502
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
23127
23503
|
frontmatter;
|
|
23128
23504
|
body;
|
|
@@ -23153,7 +23529,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
23153
23529
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
23154
23530
|
if (!result.success) {
|
|
23155
23531
|
throw new Error(
|
|
23156
|
-
`Invalid frontmatter in ${(0,
|
|
23532
|
+
`Invalid frontmatter in ${(0, import_node_path149.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
23157
23533
|
);
|
|
23158
23534
|
}
|
|
23159
23535
|
}
|
|
@@ -23246,8 +23622,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
23246
23622
|
) : relativeFilePath === paths.root.relativeFilePath;
|
|
23247
23623
|
const resolvedRelativeDirPath = relativeDirPath ?? (isRoot ? paths.root.relativeDirPath : paths.nonRoot?.relativeDirPath ?? paths.root.relativeDirPath);
|
|
23248
23624
|
if (isRoot) {
|
|
23249
|
-
const relativePath2 = (0,
|
|
23250
|
-
const filePath2 = (0,
|
|
23625
|
+
const relativePath2 = (0, import_node_path149.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
23626
|
+
const filePath2 = (0, import_node_path149.join)(outputRoot, relativePath2);
|
|
23251
23627
|
const fileContent2 = await readFileContent(filePath2);
|
|
23252
23628
|
return new _CopilotRule({
|
|
23253
23629
|
outputRoot,
|
|
@@ -23262,8 +23638,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
23262
23638
|
if (!paths.nonRoot) {
|
|
23263
23639
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
23264
23640
|
}
|
|
23265
|
-
const relativePath = (0,
|
|
23266
|
-
const filePath = (0,
|
|
23641
|
+
const relativePath = (0, import_node_path149.join)(resolvedRelativeDirPath, relativeFilePath);
|
|
23642
|
+
const filePath = (0, import_node_path149.join)(outputRoot, relativePath);
|
|
23267
23643
|
const fileContent = await readFileContent(filePath);
|
|
23268
23644
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
23269
23645
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -23312,7 +23688,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
23312
23688
|
return {
|
|
23313
23689
|
success: false,
|
|
23314
23690
|
error: new Error(
|
|
23315
|
-
`Invalid frontmatter in ${(0,
|
|
23691
|
+
`Invalid frontmatter in ${(0, import_node_path149.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
23316
23692
|
)
|
|
23317
23693
|
};
|
|
23318
23694
|
}
|
|
@@ -23368,7 +23744,7 @@ var CopilotcliRule = class _CopilotcliRule extends CopilotRule {
|
|
|
23368
23744
|
};
|
|
23369
23745
|
|
|
23370
23746
|
// src/features/rules/cursor-rule.ts
|
|
23371
|
-
var
|
|
23747
|
+
var import_node_path150 = require("path");
|
|
23372
23748
|
var import_mini81 = require("zod/mini");
|
|
23373
23749
|
var CursorRuleFrontmatterSchema = import_mini81.z.object({
|
|
23374
23750
|
description: import_mini81.z.optional(import_mini81.z.string()),
|
|
@@ -23390,7 +23766,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
23390
23766
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
23391
23767
|
if (!result.success) {
|
|
23392
23768
|
throw new Error(
|
|
23393
|
-
`Invalid frontmatter in ${(0,
|
|
23769
|
+
`Invalid frontmatter in ${(0, import_node_path150.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
23394
23770
|
);
|
|
23395
23771
|
}
|
|
23396
23772
|
}
|
|
@@ -23506,7 +23882,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
23506
23882
|
relativeFilePath,
|
|
23507
23883
|
validate = true
|
|
23508
23884
|
}) {
|
|
23509
|
-
const filePath = (0,
|
|
23885
|
+
const filePath = (0, import_node_path150.join)(
|
|
23510
23886
|
outputRoot,
|
|
23511
23887
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
23512
23888
|
relativeFilePath
|
|
@@ -23516,7 +23892,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
23516
23892
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
23517
23893
|
if (!result.success) {
|
|
23518
23894
|
throw new Error(
|
|
23519
|
-
`Invalid frontmatter in ${(0,
|
|
23895
|
+
`Invalid frontmatter in ${(0, import_node_path150.join)(outputRoot, relativeFilePath)}: ${formatError(result.error)}`
|
|
23520
23896
|
);
|
|
23521
23897
|
}
|
|
23522
23898
|
return new _CursorRule({
|
|
@@ -23553,7 +23929,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
23553
23929
|
return {
|
|
23554
23930
|
success: false,
|
|
23555
23931
|
error: new Error(
|
|
23556
|
-
`Invalid frontmatter in ${(0,
|
|
23932
|
+
`Invalid frontmatter in ${(0, import_node_path150.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
23557
23933
|
)
|
|
23558
23934
|
};
|
|
23559
23935
|
}
|
|
@@ -23573,7 +23949,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
23573
23949
|
};
|
|
23574
23950
|
|
|
23575
23951
|
// src/features/rules/deepagents-rule.ts
|
|
23576
|
-
var
|
|
23952
|
+
var import_node_path151 = require("path");
|
|
23577
23953
|
var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
23578
23954
|
constructor({ fileContent, root, ...rest }) {
|
|
23579
23955
|
super({
|
|
@@ -23600,8 +23976,8 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
23600
23976
|
}) {
|
|
23601
23977
|
const settablePaths = this.getSettablePaths();
|
|
23602
23978
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
23603
|
-
const relativePath = isRoot ? (0,
|
|
23604
|
-
const fileContent = await readFileContent((0,
|
|
23979
|
+
const relativePath = isRoot ? (0, import_node_path151.join)(".deepagents", "AGENTS.md") : (0, import_node_path151.join)(".deepagents", "memories", relativeFilePath);
|
|
23980
|
+
const fileContent = await readFileContent((0, import_node_path151.join)(outputRoot, relativePath));
|
|
23605
23981
|
return new _DeepagentsRule({
|
|
23606
23982
|
outputRoot,
|
|
23607
23983
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -23656,7 +24032,7 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
23656
24032
|
};
|
|
23657
24033
|
|
|
23658
24034
|
// src/features/rules/factorydroid-rule.ts
|
|
23659
|
-
var
|
|
24035
|
+
var import_node_path152 = require("path");
|
|
23660
24036
|
var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
23661
24037
|
constructor({ fileContent, root, ...rest }) {
|
|
23662
24038
|
super({
|
|
@@ -23696,8 +24072,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
23696
24072
|
const paths = this.getSettablePaths({ global });
|
|
23697
24073
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
23698
24074
|
if (isRoot) {
|
|
23699
|
-
const relativePath2 = (0,
|
|
23700
|
-
const fileContent2 = await readFileContent((0,
|
|
24075
|
+
const relativePath2 = (0, import_node_path152.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
24076
|
+
const fileContent2 = await readFileContent((0, import_node_path152.join)(outputRoot, relativePath2));
|
|
23701
24077
|
return new _FactorydroidRule({
|
|
23702
24078
|
outputRoot,
|
|
23703
24079
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -23710,8 +24086,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
23710
24086
|
if (!paths.nonRoot) {
|
|
23711
24087
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
23712
24088
|
}
|
|
23713
|
-
const relativePath = (0,
|
|
23714
|
-
const fileContent = await readFileContent((0,
|
|
24089
|
+
const relativePath = (0, import_node_path152.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24090
|
+
const fileContent = await readFileContent((0, import_node_path152.join)(outputRoot, relativePath));
|
|
23715
24091
|
return new _FactorydroidRule({
|
|
23716
24092
|
outputRoot,
|
|
23717
24093
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -23770,7 +24146,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
23770
24146
|
};
|
|
23771
24147
|
|
|
23772
24148
|
// src/features/rules/geminicli-rule.ts
|
|
23773
|
-
var
|
|
24149
|
+
var import_node_path153 = require("path");
|
|
23774
24150
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
23775
24151
|
static getSettablePaths({
|
|
23776
24152
|
global,
|
|
@@ -23805,7 +24181,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
23805
24181
|
if (isRoot) {
|
|
23806
24182
|
const relativePath2 = paths.root.relativeFilePath;
|
|
23807
24183
|
const fileContent2 = await readFileContent(
|
|
23808
|
-
(0,
|
|
24184
|
+
(0, import_node_path153.join)(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
23809
24185
|
);
|
|
23810
24186
|
return new _GeminiCliRule({
|
|
23811
24187
|
outputRoot,
|
|
@@ -23819,8 +24195,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
23819
24195
|
if (!paths.nonRoot) {
|
|
23820
24196
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
23821
24197
|
}
|
|
23822
|
-
const relativePath = (0,
|
|
23823
|
-
const fileContent = await readFileContent((0,
|
|
24198
|
+
const relativePath = (0, import_node_path153.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24199
|
+
const fileContent = await readFileContent((0, import_node_path153.join)(outputRoot, relativePath));
|
|
23824
24200
|
return new _GeminiCliRule({
|
|
23825
24201
|
outputRoot,
|
|
23826
24202
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -23879,7 +24255,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
23879
24255
|
};
|
|
23880
24256
|
|
|
23881
24257
|
// src/features/rules/goose-rule.ts
|
|
23882
|
-
var
|
|
24258
|
+
var import_node_path154 = require("path");
|
|
23883
24259
|
var GooseRule = class _GooseRule extends ToolRule {
|
|
23884
24260
|
static getSettablePaths({
|
|
23885
24261
|
global,
|
|
@@ -23914,7 +24290,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
23914
24290
|
if (isRoot) {
|
|
23915
24291
|
const relativePath2 = paths.root.relativeFilePath;
|
|
23916
24292
|
const fileContent2 = await readFileContent(
|
|
23917
|
-
(0,
|
|
24293
|
+
(0, import_node_path154.join)(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
23918
24294
|
);
|
|
23919
24295
|
return new _GooseRule({
|
|
23920
24296
|
outputRoot,
|
|
@@ -23928,8 +24304,8 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
23928
24304
|
if (!paths.nonRoot) {
|
|
23929
24305
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
23930
24306
|
}
|
|
23931
|
-
const relativePath = (0,
|
|
23932
|
-
const fileContent = await readFileContent((0,
|
|
24307
|
+
const relativePath = (0, import_node_path154.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24308
|
+
const fileContent = await readFileContent((0, import_node_path154.join)(outputRoot, relativePath));
|
|
23933
24309
|
return new _GooseRule({
|
|
23934
24310
|
outputRoot,
|
|
23935
24311
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -23988,7 +24364,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
23988
24364
|
};
|
|
23989
24365
|
|
|
23990
24366
|
// src/features/rules/junie-rule.ts
|
|
23991
|
-
var
|
|
24367
|
+
var import_node_path155 = require("path");
|
|
23992
24368
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
23993
24369
|
static getSettablePaths(_options = {}) {
|
|
23994
24370
|
return {
|
|
@@ -24017,8 +24393,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
24017
24393
|
}) {
|
|
24018
24394
|
const isRoot = _JunieRule.isRootRelativeFilePath(relativeFilePath);
|
|
24019
24395
|
const settablePaths = this.getSettablePaths();
|
|
24020
|
-
const relativePath = isRoot ? (0,
|
|
24021
|
-
const fileContent = await readFileContent((0,
|
|
24396
|
+
const relativePath = isRoot ? (0, import_node_path155.join)(settablePaths.root.relativeDirPath, settablePaths.root.relativeFilePath) : (0, import_node_path155.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24397
|
+
const fileContent = await readFileContent((0, import_node_path155.join)(outputRoot, relativePath));
|
|
24022
24398
|
return new _JunieRule({
|
|
24023
24399
|
outputRoot,
|
|
24024
24400
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -24073,7 +24449,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
24073
24449
|
};
|
|
24074
24450
|
|
|
24075
24451
|
// src/features/rules/kilo-rule.ts
|
|
24076
|
-
var
|
|
24452
|
+
var import_node_path156 = require("path");
|
|
24077
24453
|
var KiloRule = class _KiloRule extends ToolRule {
|
|
24078
24454
|
static getSettablePaths({
|
|
24079
24455
|
global,
|
|
@@ -24108,7 +24484,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
24108
24484
|
if (isRoot) {
|
|
24109
24485
|
const relativePath2 = paths.root.relativeFilePath;
|
|
24110
24486
|
const fileContent2 = await readFileContent(
|
|
24111
|
-
(0,
|
|
24487
|
+
(0, import_node_path156.join)(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
24112
24488
|
);
|
|
24113
24489
|
return new _KiloRule({
|
|
24114
24490
|
outputRoot,
|
|
@@ -24122,8 +24498,8 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
24122
24498
|
if (!paths.nonRoot) {
|
|
24123
24499
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
24124
24500
|
}
|
|
24125
|
-
const relativePath = (0,
|
|
24126
|
-
const fileContent = await readFileContent((0,
|
|
24501
|
+
const relativePath = (0, import_node_path156.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24502
|
+
const fileContent = await readFileContent((0, import_node_path156.join)(outputRoot, relativePath));
|
|
24127
24503
|
return new _KiloRule({
|
|
24128
24504
|
outputRoot,
|
|
24129
24505
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -24182,7 +24558,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
24182
24558
|
};
|
|
24183
24559
|
|
|
24184
24560
|
// src/features/rules/kiro-rule.ts
|
|
24185
|
-
var
|
|
24561
|
+
var import_node_path157 = require("path");
|
|
24186
24562
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
24187
24563
|
static getSettablePaths(_options = {}) {
|
|
24188
24564
|
return {
|
|
@@ -24197,7 +24573,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
24197
24573
|
validate = true
|
|
24198
24574
|
}) {
|
|
24199
24575
|
const fileContent = await readFileContent(
|
|
24200
|
-
(0,
|
|
24576
|
+
(0, import_node_path157.join)(outputRoot, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
24201
24577
|
);
|
|
24202
24578
|
return new _KiroRule({
|
|
24203
24579
|
outputRoot,
|
|
@@ -24251,7 +24627,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
24251
24627
|
};
|
|
24252
24628
|
|
|
24253
24629
|
// src/features/rules/opencode-rule.ts
|
|
24254
|
-
var
|
|
24630
|
+
var import_node_path158 = require("path");
|
|
24255
24631
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
24256
24632
|
static getSettablePaths({
|
|
24257
24633
|
global,
|
|
@@ -24286,7 +24662,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
24286
24662
|
if (isRoot) {
|
|
24287
24663
|
const relativePath2 = paths.root.relativeFilePath;
|
|
24288
24664
|
const fileContent2 = await readFileContent(
|
|
24289
|
-
(0,
|
|
24665
|
+
(0, import_node_path158.join)(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
24290
24666
|
);
|
|
24291
24667
|
return new _OpenCodeRule({
|
|
24292
24668
|
outputRoot,
|
|
@@ -24300,8 +24676,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
24300
24676
|
if (!paths.nonRoot) {
|
|
24301
24677
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
24302
24678
|
}
|
|
24303
|
-
const relativePath = (0,
|
|
24304
|
-
const fileContent = await readFileContent((0,
|
|
24679
|
+
const relativePath = (0, import_node_path158.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24680
|
+
const fileContent = await readFileContent((0, import_node_path158.join)(outputRoot, relativePath));
|
|
24305
24681
|
return new _OpenCodeRule({
|
|
24306
24682
|
outputRoot,
|
|
24307
24683
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -24360,7 +24736,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
24360
24736
|
};
|
|
24361
24737
|
|
|
24362
24738
|
// src/features/rules/pi-rule.ts
|
|
24363
|
-
var
|
|
24739
|
+
var import_node_path159 = require("path");
|
|
24364
24740
|
var PiRule = class _PiRule extends ToolRule {
|
|
24365
24741
|
static getSettablePaths({
|
|
24366
24742
|
global,
|
|
@@ -24394,7 +24770,7 @@ var PiRule = class _PiRule extends ToolRule {
|
|
|
24394
24770
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
24395
24771
|
if (isRoot) {
|
|
24396
24772
|
const fileContent2 = await readFileContent(
|
|
24397
|
-
(0,
|
|
24773
|
+
(0, import_node_path159.join)(outputRoot, paths.root.relativeDirPath, paths.root.relativeFilePath)
|
|
24398
24774
|
);
|
|
24399
24775
|
return new _PiRule({
|
|
24400
24776
|
outputRoot,
|
|
@@ -24410,8 +24786,8 @@ var PiRule = class _PiRule extends ToolRule {
|
|
|
24410
24786
|
`PiRule does not support non-root rules in global mode; expected '${paths.root.relativeFilePath}' but got '${relativeFilePath}'`
|
|
24411
24787
|
);
|
|
24412
24788
|
}
|
|
24413
|
-
const relativePath = (0,
|
|
24414
|
-
const fileContent = await readFileContent((0,
|
|
24789
|
+
const relativePath = (0, import_node_path159.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24790
|
+
const fileContent = await readFileContent((0, import_node_path159.join)(outputRoot, relativePath));
|
|
24415
24791
|
return new _PiRule({
|
|
24416
24792
|
outputRoot,
|
|
24417
24793
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -24475,7 +24851,7 @@ var PiRule = class _PiRule extends ToolRule {
|
|
|
24475
24851
|
};
|
|
24476
24852
|
|
|
24477
24853
|
// src/features/rules/qwencode-rule.ts
|
|
24478
|
-
var
|
|
24854
|
+
var import_node_path160 = require("path");
|
|
24479
24855
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
24480
24856
|
static getSettablePaths(_options = {}) {
|
|
24481
24857
|
return {
|
|
@@ -24494,8 +24870,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
24494
24870
|
validate = true
|
|
24495
24871
|
}) {
|
|
24496
24872
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
24497
|
-
const relativePath = isRoot ? "QWEN.md" : (0,
|
|
24498
|
-
const fileContent = await readFileContent((0,
|
|
24873
|
+
const relativePath = isRoot ? "QWEN.md" : (0, import_node_path160.join)(".qwen", "memories", relativeFilePath);
|
|
24874
|
+
const fileContent = await readFileContent((0, import_node_path160.join)(outputRoot, relativePath));
|
|
24499
24875
|
return new _QwencodeRule({
|
|
24500
24876
|
outputRoot,
|
|
24501
24877
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -24547,7 +24923,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
24547
24923
|
};
|
|
24548
24924
|
|
|
24549
24925
|
// src/features/rules/replit-rule.ts
|
|
24550
|
-
var
|
|
24926
|
+
var import_node_path161 = require("path");
|
|
24551
24927
|
var ReplitRule = class _ReplitRule extends ToolRule {
|
|
24552
24928
|
static getSettablePaths(_options = {}) {
|
|
24553
24929
|
return {
|
|
@@ -24569,7 +24945,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
24569
24945
|
}
|
|
24570
24946
|
const relativePath = paths.root.relativeFilePath;
|
|
24571
24947
|
const fileContent = await readFileContent(
|
|
24572
|
-
(0,
|
|
24948
|
+
(0, import_node_path161.join)(outputRoot, paths.root.relativeDirPath, relativePath)
|
|
24573
24949
|
);
|
|
24574
24950
|
return new _ReplitRule({
|
|
24575
24951
|
outputRoot,
|
|
@@ -24635,7 +25011,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
24635
25011
|
};
|
|
24636
25012
|
|
|
24637
25013
|
// src/features/rules/roo-rule.ts
|
|
24638
|
-
var
|
|
25014
|
+
var import_node_path162 = require("path");
|
|
24639
25015
|
var RooRule = class _RooRule extends ToolRule {
|
|
24640
25016
|
static getSettablePaths(_options = {}) {
|
|
24641
25017
|
return {
|
|
@@ -24650,7 +25026,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
24650
25026
|
validate = true
|
|
24651
25027
|
}) {
|
|
24652
25028
|
const fileContent = await readFileContent(
|
|
24653
|
-
(0,
|
|
25029
|
+
(0, import_node_path162.join)(outputRoot, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
24654
25030
|
);
|
|
24655
25031
|
return new _RooRule({
|
|
24656
25032
|
outputRoot,
|
|
@@ -24719,7 +25095,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
24719
25095
|
};
|
|
24720
25096
|
|
|
24721
25097
|
// src/features/rules/rovodev-rule.ts
|
|
24722
|
-
var
|
|
25098
|
+
var import_node_path163 = require("path");
|
|
24723
25099
|
var DISALLOWED_ROVODEV_MODULAR_RULE_BASENAMES = /* @__PURE__ */ new Set(["agents.md", "agents.local.md"]);
|
|
24724
25100
|
var RovodevRule = class _RovodevRule extends ToolRule {
|
|
24725
25101
|
/**
|
|
@@ -24763,7 +25139,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
24763
25139
|
root: rovodevAgents,
|
|
24764
25140
|
alternativeRoots: [{ relativeDirPath: ".", relativeFilePath: "AGENTS.md" }],
|
|
24765
25141
|
nonRoot: {
|
|
24766
|
-
relativeDirPath: (0,
|
|
25142
|
+
relativeDirPath: (0, import_node_path163.join)(".rovodev", ".rulesync", "modular-rules")
|
|
24767
25143
|
}
|
|
24768
25144
|
};
|
|
24769
25145
|
}
|
|
@@ -24802,10 +25178,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
24802
25178
|
}) {
|
|
24803
25179
|
if (!this.isAllowedModularRulesRelativePath(relativeFilePath)) {
|
|
24804
25180
|
throw new Error(
|
|
24805
|
-
`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${(0,
|
|
25181
|
+
`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${(0, import_node_path163.join)(relativeDirPath, relativeFilePath)}`
|
|
24806
25182
|
);
|
|
24807
25183
|
}
|
|
24808
|
-
const fileContent = await readFileContent((0,
|
|
25184
|
+
const fileContent = await readFileContent((0, import_node_path163.join)(outputRoot, relativeDirPath, relativeFilePath));
|
|
24809
25185
|
return new _RovodevRule({
|
|
24810
25186
|
outputRoot,
|
|
24811
25187
|
relativeDirPath,
|
|
@@ -24825,10 +25201,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
24825
25201
|
paths
|
|
24826
25202
|
}) {
|
|
24827
25203
|
const relativeDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
24828
|
-
const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${(0,
|
|
25204
|
+
const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${(0, import_node_path163.join)(paths.root.relativeDirPath, paths.root.relativeFilePath)} or project root` : (0, import_node_path163.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
24829
25205
|
if (relativeFilePath !== "AGENTS.md") {
|
|
24830
25206
|
throw new Error(
|
|
24831
|
-
`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${(0,
|
|
25207
|
+
`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${(0, import_node_path163.join)(relativeDirPath, relativeFilePath)}`
|
|
24832
25208
|
);
|
|
24833
25209
|
}
|
|
24834
25210
|
const allowed = relativeDirPath === paths.root.relativeDirPath || "alternativeRoots" in paths && paths.alternativeRoots?.some(
|
|
@@ -24836,10 +25212,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
24836
25212
|
);
|
|
24837
25213
|
if (!allowed) {
|
|
24838
25214
|
throw new Error(
|
|
24839
|
-
`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${(0,
|
|
25215
|
+
`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${(0, import_node_path163.join)(relativeDirPath, relativeFilePath)}`
|
|
24840
25216
|
);
|
|
24841
25217
|
}
|
|
24842
|
-
const fileContent = await readFileContent((0,
|
|
25218
|
+
const fileContent = await readFileContent((0, import_node_path163.join)(outputRoot, relativeDirPath, relativeFilePath));
|
|
24843
25219
|
return new _RovodevRule({
|
|
24844
25220
|
outputRoot,
|
|
24845
25221
|
relativeDirPath,
|
|
@@ -24953,7 +25329,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
24953
25329
|
};
|
|
24954
25330
|
|
|
24955
25331
|
// src/features/rules/takt-rule.ts
|
|
24956
|
-
var
|
|
25332
|
+
var import_node_path164 = require("path");
|
|
24957
25333
|
var DEFAULT_TAKT_RULE_DIR = "policies";
|
|
24958
25334
|
var TaktRule = class _TaktRule extends ToolRule {
|
|
24959
25335
|
static getSettablePaths({
|
|
@@ -24965,7 +25341,7 @@ var TaktRule = class _TaktRule extends ToolRule {
|
|
|
24965
25341
|
root: {
|
|
24966
25342
|
relativeDirPath: buildToolPath(
|
|
24967
25343
|
".takt",
|
|
24968
|
-
(0,
|
|
25344
|
+
(0, import_node_path164.join)("facets", DEFAULT_TAKT_RULE_DIR),
|
|
24969
25345
|
excludeToolDir
|
|
24970
25346
|
),
|
|
24971
25347
|
relativeFilePath: "overview.md"
|
|
@@ -24976,7 +25352,7 @@ var TaktRule = class _TaktRule extends ToolRule {
|
|
|
24976
25352
|
nonRoot: {
|
|
24977
25353
|
relativeDirPath: buildToolPath(
|
|
24978
25354
|
".takt",
|
|
24979
|
-
(0,
|
|
25355
|
+
(0, import_node_path164.join)("facets", DEFAULT_TAKT_RULE_DIR),
|
|
24980
25356
|
excludeToolDir
|
|
24981
25357
|
)
|
|
24982
25358
|
}
|
|
@@ -24994,8 +25370,8 @@ var TaktRule = class _TaktRule extends ToolRule {
|
|
|
24994
25370
|
validate = true,
|
|
24995
25371
|
relativeDirPath: overrideDirPath
|
|
24996
25372
|
}) {
|
|
24997
|
-
const dirPath = overrideDirPath ?? (0,
|
|
24998
|
-
const filePath = (0,
|
|
25373
|
+
const dirPath = overrideDirPath ?? (0, import_node_path164.join)(".takt", "facets", DEFAULT_TAKT_RULE_DIR);
|
|
25374
|
+
const filePath = (0, import_node_path164.join)(outputRoot, dirPath, relativeFilePath);
|
|
24999
25375
|
const fileContent = await readFileContent(filePath);
|
|
25000
25376
|
const { body } = parseFrontmatter(fileContent, filePath);
|
|
25001
25377
|
return new _TaktRule({
|
|
@@ -25034,7 +25410,7 @@ var TaktRule = class _TaktRule extends ToolRule {
|
|
|
25034
25410
|
const stem = overrideName ?? sourceStem;
|
|
25035
25411
|
assertSafeTaktName({ name: stem, featureLabel: "rule", sourceLabel });
|
|
25036
25412
|
const relativeFilePath = `${stem}.md`;
|
|
25037
|
-
const relativeDirPath = (0,
|
|
25413
|
+
const relativeDirPath = (0, import_node_path164.join)(".takt", "facets", DEFAULT_TAKT_RULE_DIR);
|
|
25038
25414
|
return new _TaktRule({
|
|
25039
25415
|
outputRoot,
|
|
25040
25416
|
relativeDirPath,
|
|
@@ -25059,7 +25435,7 @@ var TaktRule = class _TaktRule extends ToolRule {
|
|
|
25059
25435
|
};
|
|
25060
25436
|
|
|
25061
25437
|
// src/features/rules/warp-rule.ts
|
|
25062
|
-
var
|
|
25438
|
+
var import_node_path165 = require("path");
|
|
25063
25439
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
25064
25440
|
constructor({ fileContent, root, ...rest }) {
|
|
25065
25441
|
super({
|
|
@@ -25072,7 +25448,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
25072
25448
|
return {
|
|
25073
25449
|
root: {
|
|
25074
25450
|
relativeDirPath: ".",
|
|
25075
|
-
relativeFilePath: "
|
|
25451
|
+
relativeFilePath: "AGENTS.md"
|
|
25076
25452
|
},
|
|
25077
25453
|
nonRoot: {
|
|
25078
25454
|
relativeDirPath: buildToolPath(".warp", "memories", _options.excludeToolDir)
|
|
@@ -25085,8 +25461,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
25085
25461
|
validate = true
|
|
25086
25462
|
}) {
|
|
25087
25463
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
25088
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0,
|
|
25089
|
-
const fileContent = await readFileContent((0,
|
|
25464
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path165.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
25465
|
+
const fileContent = await readFileContent((0, import_node_path165.join)(outputRoot, relativePath));
|
|
25090
25466
|
return new _WarpRule({
|
|
25091
25467
|
outputRoot,
|
|
25092
25468
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -25102,7 +25478,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
25102
25478
|
validate = true
|
|
25103
25479
|
}) {
|
|
25104
25480
|
return new _WarpRule(
|
|
25105
|
-
this.
|
|
25481
|
+
this.buildToolRuleParamsAgentsmd({
|
|
25106
25482
|
outputRoot,
|
|
25107
25483
|
rulesyncRule,
|
|
25108
25484
|
validate,
|
|
@@ -25141,7 +25517,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
25141
25517
|
};
|
|
25142
25518
|
|
|
25143
25519
|
// src/features/rules/windsurf-rule.ts
|
|
25144
|
-
var
|
|
25520
|
+
var import_node_path166 = require("path");
|
|
25145
25521
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
25146
25522
|
static getSettablePaths(_options = {}) {
|
|
25147
25523
|
return {
|
|
@@ -25156,7 +25532,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
25156
25532
|
validate = true
|
|
25157
25533
|
}) {
|
|
25158
25534
|
const fileContent = await readFileContent(
|
|
25159
|
-
(0,
|
|
25535
|
+
(0, import_node_path166.join)(outputRoot, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
25160
25536
|
);
|
|
25161
25537
|
return new _WindsurfRule({
|
|
25162
25538
|
outputRoot,
|
|
@@ -25227,7 +25603,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
25227
25603
|
};
|
|
25228
25604
|
|
|
25229
25605
|
// src/features/rules/zed-rule.ts
|
|
25230
|
-
var
|
|
25606
|
+
var import_node_path167 = require("path");
|
|
25231
25607
|
var ZedRule = class _ZedRule extends ToolRule {
|
|
25232
25608
|
static getSettablePaths({
|
|
25233
25609
|
global,
|
|
@@ -25236,7 +25612,7 @@ var ZedRule = class _ZedRule extends ToolRule {
|
|
|
25236
25612
|
if (global) {
|
|
25237
25613
|
return {
|
|
25238
25614
|
root: {
|
|
25239
|
-
relativeDirPath: buildToolPath((0,
|
|
25615
|
+
relativeDirPath: buildToolPath((0, import_node_path167.join)(".config", "zed"), ".", excludeToolDir),
|
|
25240
25616
|
relativeFilePath: "AGENTS.md"
|
|
25241
25617
|
}
|
|
25242
25618
|
};
|
|
@@ -25260,7 +25636,7 @@ var ZedRule = class _ZedRule extends ToolRule {
|
|
|
25260
25636
|
throw new Error(`ZedRule only supports root rules: ${relativeFilePath}`);
|
|
25261
25637
|
}
|
|
25262
25638
|
const fileContent = await readFileContent(
|
|
25263
|
-
(0,
|
|
25639
|
+
(0, import_node_path167.join)(outputRoot, paths.root.relativeDirPath, paths.root.relativeFilePath)
|
|
25264
25640
|
);
|
|
25265
25641
|
return new _ZedRule({
|
|
25266
25642
|
outputRoot,
|
|
@@ -25361,7 +25737,7 @@ var rulesProcessorToolTargets = [
|
|
|
25361
25737
|
"zed"
|
|
25362
25738
|
];
|
|
25363
25739
|
var RulesProcessorToolTargetSchema = import_mini82.z.enum(rulesProcessorToolTargets);
|
|
25364
|
-
var formatRulePaths = (rules) => rules.map((r) => (0,
|
|
25740
|
+
var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path168.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
|
|
25365
25741
|
var RulesFeatureOptionsSchema = import_mini82.z.looseObject({
|
|
25366
25742
|
ruleDiscoveryMode: import_mini82.z.optional(import_mini82.z.enum(["none", "explicit"])),
|
|
25367
25743
|
includeLocalRoot: import_mini82.z.optional(import_mini82.z.boolean())
|
|
@@ -25897,7 +26273,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
25897
26273
|
}).relativeDirPath;
|
|
25898
26274
|
return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
|
|
25899
26275
|
const frontmatter = skill.getFrontmatter();
|
|
25900
|
-
const relativePath = (0,
|
|
26276
|
+
const relativePath = (0, import_node_path168.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
|
|
25901
26277
|
return {
|
|
25902
26278
|
name: frontmatter.name,
|
|
25903
26279
|
description: frontmatter.description,
|
|
@@ -26026,12 +26402,12 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26026
26402
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
26027
26403
|
*/
|
|
26028
26404
|
async loadRulesyncFiles() {
|
|
26029
|
-
const rulesyncOutputRoot = (0,
|
|
26030
|
-
const files = await findFilesByGlobs((0,
|
|
26405
|
+
const rulesyncOutputRoot = (0, import_node_path168.join)(this.inputRoot, RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
26406
|
+
const files = await findFilesByGlobs((0, import_node_path168.join)(rulesyncOutputRoot, "**", "*.md"));
|
|
26031
26407
|
this.logger.debug(`Found ${files.length} rulesync files`);
|
|
26032
26408
|
const rulesyncRules = await Promise.all(
|
|
26033
26409
|
files.map((file) => {
|
|
26034
|
-
const relativeFilePath = (0,
|
|
26410
|
+
const relativeFilePath = (0, import_node_path168.relative)(rulesyncOutputRoot, file);
|
|
26035
26411
|
checkPathTraversal({
|
|
26036
26412
|
relativePath: relativeFilePath,
|
|
26037
26413
|
intendedRootDir: rulesyncOutputRoot
|
|
@@ -26107,7 +26483,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26107
26483
|
global: this.global
|
|
26108
26484
|
});
|
|
26109
26485
|
const resolveRelativeDirPath = (filePath) => {
|
|
26110
|
-
const dirName = (0,
|
|
26486
|
+
const dirName = (0, import_node_path168.dirname)((0, import_node_path168.relative)(this.outputRoot, filePath));
|
|
26111
26487
|
return dirName === "" ? "." : dirName;
|
|
26112
26488
|
};
|
|
26113
26489
|
const buildDeletionRulesFromPaths = (filePaths, opts) => {
|
|
@@ -26115,7 +26491,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26115
26491
|
const effectiveOutputRoot = isNonRoot ? opts.outputRootOverride : this.outputRoot;
|
|
26116
26492
|
return filePaths.map((filePath) => {
|
|
26117
26493
|
const relativeDirPath = isNonRoot ? opts.relativeDirPathOverride : resolveRelativeDirPath(filePath);
|
|
26118
|
-
const relativeFilePath = isNonRoot ? (0,
|
|
26494
|
+
const relativeFilePath = isNonRoot ? (0, import_node_path168.relative)(effectiveOutputRoot, filePath) : (0, import_node_path168.basename)(filePath);
|
|
26119
26495
|
checkPathTraversal({
|
|
26120
26496
|
relativePath: isNonRoot ? relativeFilePath : relativeDirPath,
|
|
26121
26497
|
intendedRootDir: effectiveOutputRoot
|
|
@@ -26143,13 +26519,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26143
26519
|
return [];
|
|
26144
26520
|
}
|
|
26145
26521
|
const uniqueRootFilePaths = await findFilesWithFallback(
|
|
26146
|
-
(0,
|
|
26522
|
+
(0, import_node_path168.join)(
|
|
26147
26523
|
this.outputRoot,
|
|
26148
26524
|
settablePaths.root.relativeDirPath ?? ".",
|
|
26149
26525
|
settablePaths.root.relativeFilePath
|
|
26150
26526
|
),
|
|
26151
26527
|
settablePaths.alternativeRoots,
|
|
26152
|
-
(alt) => (0,
|
|
26528
|
+
(alt) => (0, import_node_path168.join)(this.outputRoot, alt.relativeDirPath, alt.relativeFilePath)
|
|
26153
26529
|
);
|
|
26154
26530
|
if (forDeletion) {
|
|
26155
26531
|
return buildDeletionRulesFromPaths(uniqueRootFilePaths);
|
|
@@ -26163,7 +26539,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26163
26539
|
});
|
|
26164
26540
|
return factory.class.fromFile({
|
|
26165
26541
|
outputRoot: this.outputRoot,
|
|
26166
|
-
relativeFilePath: (0,
|
|
26542
|
+
relativeFilePath: (0, import_node_path168.basename)(filePath),
|
|
26167
26543
|
relativeDirPath,
|
|
26168
26544
|
global: this.global
|
|
26169
26545
|
});
|
|
@@ -26180,7 +26556,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26180
26556
|
return [];
|
|
26181
26557
|
}
|
|
26182
26558
|
const uniqueLocalRootFilePaths2 = await findFilesByGlobs(
|
|
26183
|
-
(0,
|
|
26559
|
+
(0, import_node_path168.join)(this.outputRoot, "AGENTS.local.md")
|
|
26184
26560
|
);
|
|
26185
26561
|
return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths2);
|
|
26186
26562
|
}
|
|
@@ -26191,9 +26567,9 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26191
26567
|
return [];
|
|
26192
26568
|
}
|
|
26193
26569
|
const uniqueLocalRootFilePaths = await findFilesWithFallback(
|
|
26194
|
-
(0,
|
|
26570
|
+
(0, import_node_path168.join)(this.outputRoot, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
|
|
26195
26571
|
settablePaths.alternativeRoots,
|
|
26196
|
-
(alt) => (0,
|
|
26572
|
+
(alt) => (0, import_node_path168.join)(this.outputRoot, alt.relativeDirPath, "CLAUDE.local.md")
|
|
26197
26573
|
);
|
|
26198
26574
|
return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths);
|
|
26199
26575
|
})();
|
|
@@ -26204,20 +26580,20 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26204
26580
|
if (!forDeletion || this.toolTarget !== "rovodev" || this.global) {
|
|
26205
26581
|
return [];
|
|
26206
26582
|
}
|
|
26207
|
-
const primaryPaths = await findFilesByGlobs((0,
|
|
26583
|
+
const primaryPaths = await findFilesByGlobs((0, import_node_path168.join)(this.outputRoot, ".rovodev", "AGENTS.md"));
|
|
26208
26584
|
if (primaryPaths.length === 0) {
|
|
26209
26585
|
return [];
|
|
26210
26586
|
}
|
|
26211
|
-
const mirrorPaths = await findFilesByGlobs((0,
|
|
26587
|
+
const mirrorPaths = await findFilesByGlobs((0, import_node_path168.join)(this.outputRoot, "AGENTS.md"));
|
|
26212
26588
|
return buildDeletionRulesFromPaths(mirrorPaths);
|
|
26213
26589
|
})();
|
|
26214
26590
|
const nonRootToolRules = await (async () => {
|
|
26215
26591
|
if (!settablePaths.nonRoot) {
|
|
26216
26592
|
return [];
|
|
26217
26593
|
}
|
|
26218
|
-
const nonRootOutputRoot = (0,
|
|
26594
|
+
const nonRootOutputRoot = (0, import_node_path168.join)(this.outputRoot, settablePaths.nonRoot.relativeDirPath);
|
|
26219
26595
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
26220
|
-
(0,
|
|
26596
|
+
(0, import_node_path168.join)(nonRootOutputRoot, "**", `*.${factory.meta.extension}`)
|
|
26221
26597
|
);
|
|
26222
26598
|
if (forDeletion) {
|
|
26223
26599
|
return buildDeletionRulesFromPaths(nonRootFilePaths, {
|
|
@@ -26227,18 +26603,18 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26227
26603
|
}
|
|
26228
26604
|
const modularRootRelative = settablePaths.nonRoot.relativeDirPath;
|
|
26229
26605
|
const nonRootPathsForImport = this.toolTarget === "rovodev" ? nonRootFilePaths.filter((filePath) => {
|
|
26230
|
-
const relativeFilePath = (0,
|
|
26606
|
+
const relativeFilePath = (0, import_node_path168.relative)(nonRootOutputRoot, filePath);
|
|
26231
26607
|
const ok = RovodevRule.isAllowedModularRulesRelativePath(relativeFilePath);
|
|
26232
26608
|
if (!ok) {
|
|
26233
26609
|
this.logger.warn(
|
|
26234
|
-
`Skipping reserved Rovodev path under modular-rules (import): ${(0,
|
|
26610
|
+
`Skipping reserved Rovodev path under modular-rules (import): ${(0, import_node_path168.join)(modularRootRelative, relativeFilePath)}`
|
|
26235
26611
|
);
|
|
26236
26612
|
}
|
|
26237
26613
|
return ok;
|
|
26238
26614
|
}) : nonRootFilePaths;
|
|
26239
26615
|
return await Promise.all(
|
|
26240
26616
|
nonRootPathsForImport.map((filePath) => {
|
|
26241
|
-
const relativeFilePath = (0,
|
|
26617
|
+
const relativeFilePath = (0, import_node_path168.relative)(nonRootOutputRoot, filePath);
|
|
26242
26618
|
checkPathTraversal({
|
|
26243
26619
|
relativePath: relativeFilePath,
|
|
26244
26620
|
intendedRootDir: nonRootOutputRoot
|
|
@@ -26357,14 +26733,14 @@ s/<command> [arguments]
|
|
|
26357
26733
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
26358
26734
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
26359
26735
|
|
|
26360
|
-
When users call a custom slash command, you have to look for the markdown file, \`${(0,
|
|
26736
|
+
When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path168.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
26361
26737
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
26362
26738
|
|
|
26363
26739
|
Simulated subagents are specialized AI assistants that can be invoked to handle specific types of tasks. In this case, it can be appear something like custom slash commands simply. Simulated subagents can be called by custom slash commands.
|
|
26364
26740
|
|
|
26365
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0,
|
|
26741
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path168.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
26366
26742
|
|
|
26367
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0,
|
|
26743
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path168.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
26368
26744
|
const skillsSection = skills ? this.generateSkillsSection(skills) : "";
|
|
26369
26745
|
const result = [
|
|
26370
26746
|
overview,
|
|
@@ -26622,7 +26998,7 @@ function buildPermissionsStrategy(ctx) {
|
|
|
26622
26998
|
}
|
|
26623
26999
|
|
|
26624
27000
|
// src/lib/generate.ts
|
|
26625
|
-
var
|
|
27001
|
+
var import_node_path169 = require("path");
|
|
26626
27002
|
var import_es_toolkit9 = require("es-toolkit");
|
|
26627
27003
|
async function processFeatureGeneration(params) {
|
|
26628
27004
|
const { config, processor, toolFiles } = params;
|
|
@@ -26696,7 +27072,7 @@ function warnUnsupportedTargets(params) {
|
|
|
26696
27072
|
}
|
|
26697
27073
|
}
|
|
26698
27074
|
async function checkRulesyncDirExists(params) {
|
|
26699
|
-
return fileExists((0,
|
|
27075
|
+
return fileExists((0, import_node_path169.join)(params.inputRoot, RULESYNC_RELATIVE_DIR_PATH));
|
|
26700
27076
|
}
|
|
26701
27077
|
async function generate(params) {
|
|
26702
27078
|
const { config, logger } = params;
|