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
|
@@ -240,6 +240,7 @@ import { z as z2 } from "zod/mini";
|
|
|
240
240
|
var ALL_TOOL_TARGETS = [
|
|
241
241
|
"agentsmd",
|
|
242
242
|
"agentsskills",
|
|
243
|
+
"amp",
|
|
243
244
|
"antigravity",
|
|
244
245
|
"antigravity-cli",
|
|
245
246
|
"antigravity-ide",
|
|
@@ -8176,8 +8177,19 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
8176
8177
|
// src/features/mcp/mcp-processor.ts
|
|
8177
8178
|
import { z as z29 } from "zod/mini";
|
|
8178
8179
|
|
|
8179
|
-
// src/features/mcp/
|
|
8180
|
+
// src/features/mcp/amp-mcp.ts
|
|
8180
8181
|
import { join as join53 } from "path";
|
|
8182
|
+
import { parse as parseJsonc3, printParseErrorCode } from "jsonc-parser";
|
|
8183
|
+
|
|
8184
|
+
// src/utils/prototype-pollution.ts
|
|
8185
|
+
var PROTOTYPE_POLLUTION_KEYS = /* @__PURE__ */ new Set([
|
|
8186
|
+
"__proto__",
|
|
8187
|
+
"constructor",
|
|
8188
|
+
"prototype"
|
|
8189
|
+
]);
|
|
8190
|
+
function isPrototypePollutionKey(key) {
|
|
8191
|
+
return PROTOTYPE_POLLUTION_KEYS.has(key);
|
|
8192
|
+
}
|
|
8181
8193
|
|
|
8182
8194
|
// src/features/mcp/rulesync-mcp.ts
|
|
8183
8195
|
import { join as join52 } from "path";
|
|
@@ -8406,7 +8418,200 @@ var ToolMcp = class extends ToolFile {
|
|
|
8406
8418
|
}
|
|
8407
8419
|
};
|
|
8408
8420
|
|
|
8421
|
+
// src/features/mcp/amp-mcp.ts
|
|
8422
|
+
var AMP_MCP_SERVERS_KEY = "amp.mcpServers";
|
|
8423
|
+
function parseAmpSettingsJsonc(fileContent) {
|
|
8424
|
+
const errors = [];
|
|
8425
|
+
const parsed = parseJsonc3(fileContent || "{}", errors);
|
|
8426
|
+
if (errors.length > 0) {
|
|
8427
|
+
const details = errors.map((error) => `${printParseErrorCode(error.error)} at offset ${error.offset}`).join(", ");
|
|
8428
|
+
throw new Error(`Failed to parse Amp settings: ${details}`);
|
|
8429
|
+
}
|
|
8430
|
+
if (!isRecord(parsed)) {
|
|
8431
|
+
throw new Error("Amp settings must be a JSON object");
|
|
8432
|
+
}
|
|
8433
|
+
return parsed;
|
|
8434
|
+
}
|
|
8435
|
+
function filterMcpServers(mcpServers) {
|
|
8436
|
+
const filtered = {};
|
|
8437
|
+
if (!isRecord(mcpServers)) return filtered;
|
|
8438
|
+
for (const [name, config] of Object.entries(mcpServers)) {
|
|
8439
|
+
if (isPrototypePollutionKey(name) || !isRecord(config)) continue;
|
|
8440
|
+
const filteredConfig = {};
|
|
8441
|
+
for (const [key, value] of Object.entries(config)) {
|
|
8442
|
+
if (isPrototypePollutionKey(key)) continue;
|
|
8443
|
+
filteredConfig[key] = value;
|
|
8444
|
+
}
|
|
8445
|
+
filtered[name] = filteredConfig;
|
|
8446
|
+
}
|
|
8447
|
+
return filtered;
|
|
8448
|
+
}
|
|
8449
|
+
var AmpMcp = class _AmpMcp extends ToolMcp {
|
|
8450
|
+
json;
|
|
8451
|
+
constructor(params) {
|
|
8452
|
+
super(params);
|
|
8453
|
+
this.json = parseAmpSettingsJsonc(this.fileContent);
|
|
8454
|
+
}
|
|
8455
|
+
getJson() {
|
|
8456
|
+
return structuredClone(this.json);
|
|
8457
|
+
}
|
|
8458
|
+
static getSettablePaths({ global } = {}) {
|
|
8459
|
+
if (global) {
|
|
8460
|
+
return {
|
|
8461
|
+
relativeDirPath: join53(".config", "amp"),
|
|
8462
|
+
relativeFilePath: "settings.jsonc"
|
|
8463
|
+
};
|
|
8464
|
+
}
|
|
8465
|
+
return {
|
|
8466
|
+
relativeDirPath: ".amp",
|
|
8467
|
+
relativeFilePath: "settings.jsonc"
|
|
8468
|
+
};
|
|
8469
|
+
}
|
|
8470
|
+
/**
|
|
8471
|
+
* Probe `<jsonDir>/settings.jsonc` first, falling back to `settings.json`,
|
|
8472
|
+
* so existing user files are read-modified-written in place instead of a
|
|
8473
|
+
* fresh `.json` sibling being created next to a hand-authored `.jsonc`.
|
|
8474
|
+
* Defaults to `settings.jsonc` when neither file exists.
|
|
8475
|
+
*/
|
|
8476
|
+
static async resolveSettingsFile(jsonDir) {
|
|
8477
|
+
const jsoncContent = await readFileContentOrNull(join53(jsonDir, "settings.jsonc"));
|
|
8478
|
+
if (jsoncContent !== null) {
|
|
8479
|
+
return { fileContent: jsoncContent, relativeFilePath: "settings.jsonc" };
|
|
8480
|
+
}
|
|
8481
|
+
const jsonContent = await readFileContentOrNull(join53(jsonDir, "settings.json"));
|
|
8482
|
+
if (jsonContent !== null) {
|
|
8483
|
+
return { fileContent: jsonContent, relativeFilePath: "settings.json" };
|
|
8484
|
+
}
|
|
8485
|
+
return { fileContent: null, relativeFilePath: "settings.jsonc" };
|
|
8486
|
+
}
|
|
8487
|
+
static async fromFile({
|
|
8488
|
+
outputRoot = process.cwd(),
|
|
8489
|
+
validate = true,
|
|
8490
|
+
global = false
|
|
8491
|
+
}) {
|
|
8492
|
+
const basePaths = this.getSettablePaths({ global });
|
|
8493
|
+
const jsonDir = join53(outputRoot, basePaths.relativeDirPath);
|
|
8494
|
+
const { fileContent, relativeFilePath } = await this.resolveSettingsFile(jsonDir);
|
|
8495
|
+
const json = fileContent ? parseAmpSettingsJsonc(fileContent) : {};
|
|
8496
|
+
const mcpServers = json[AMP_MCP_SERVERS_KEY];
|
|
8497
|
+
const newJson = { ...json, [AMP_MCP_SERVERS_KEY]: mcpServers ?? {} };
|
|
8498
|
+
return new _AmpMcp({
|
|
8499
|
+
outputRoot,
|
|
8500
|
+
relativeDirPath: basePaths.relativeDirPath,
|
|
8501
|
+
relativeFilePath,
|
|
8502
|
+
fileContent: JSON.stringify(newJson, null, 2),
|
|
8503
|
+
validate,
|
|
8504
|
+
global
|
|
8505
|
+
});
|
|
8506
|
+
}
|
|
8507
|
+
static async fromRulesyncMcp({
|
|
8508
|
+
outputRoot = process.cwd(),
|
|
8509
|
+
rulesyncMcp,
|
|
8510
|
+
validate = true,
|
|
8511
|
+
global = false
|
|
8512
|
+
}) {
|
|
8513
|
+
const basePaths = this.getSettablePaths({ global });
|
|
8514
|
+
const jsonDir = join53(outputRoot, basePaths.relativeDirPath);
|
|
8515
|
+
const { fileContent, relativeFilePath } = await this.resolveSettingsFile(jsonDir);
|
|
8516
|
+
const json = fileContent ? parseAmpSettingsJsonc(fileContent) : { [AMP_MCP_SERVERS_KEY]: {} };
|
|
8517
|
+
const filteredMcpServers = filterMcpServers(rulesyncMcp.getMcpServers());
|
|
8518
|
+
const newJson = { ...json, [AMP_MCP_SERVERS_KEY]: filteredMcpServers };
|
|
8519
|
+
return new _AmpMcp({
|
|
8520
|
+
outputRoot,
|
|
8521
|
+
relativeDirPath: basePaths.relativeDirPath,
|
|
8522
|
+
relativeFilePath,
|
|
8523
|
+
fileContent: JSON.stringify(newJson, null, 2),
|
|
8524
|
+
validate,
|
|
8525
|
+
global
|
|
8526
|
+
});
|
|
8527
|
+
}
|
|
8528
|
+
toRulesyncMcp() {
|
|
8529
|
+
const filtered = filterMcpServers(this.json[AMP_MCP_SERVERS_KEY]);
|
|
8530
|
+
return this.toRulesyncMcpDefault({
|
|
8531
|
+
fileContent: JSON.stringify({ mcpServers: filtered }, null, 2)
|
|
8532
|
+
});
|
|
8533
|
+
}
|
|
8534
|
+
validate() {
|
|
8535
|
+
let json;
|
|
8536
|
+
try {
|
|
8537
|
+
json = parseAmpSettingsJsonc(this.fileContent);
|
|
8538
|
+
} catch (error) {
|
|
8539
|
+
return {
|
|
8540
|
+
success: false,
|
|
8541
|
+
error: error instanceof Error ? error : new Error(String(error))
|
|
8542
|
+
};
|
|
8543
|
+
}
|
|
8544
|
+
for (const key of Object.keys(json)) {
|
|
8545
|
+
if (isPrototypePollutionKey(key)) {
|
|
8546
|
+
return {
|
|
8547
|
+
success: false,
|
|
8548
|
+
error: new Error(`Prototype pollution key "${key}" is not allowed`)
|
|
8549
|
+
};
|
|
8550
|
+
}
|
|
8551
|
+
}
|
|
8552
|
+
const mcpServers = json[AMP_MCP_SERVERS_KEY];
|
|
8553
|
+
if (mcpServers === void 0) {
|
|
8554
|
+
return { success: true, error: null };
|
|
8555
|
+
}
|
|
8556
|
+
if (!isRecord(mcpServers)) {
|
|
8557
|
+
return {
|
|
8558
|
+
success: false,
|
|
8559
|
+
error: new Error(`${AMP_MCP_SERVERS_KEY} must be a JSON object`)
|
|
8560
|
+
};
|
|
8561
|
+
}
|
|
8562
|
+
for (const [serverName, serverConfig] of Object.entries(mcpServers)) {
|
|
8563
|
+
if (isPrototypePollutionKey(serverName)) {
|
|
8564
|
+
return {
|
|
8565
|
+
success: false,
|
|
8566
|
+
error: new Error(
|
|
8567
|
+
`Server name "${serverName}" is a prototype pollution key and is not allowed`
|
|
8568
|
+
)
|
|
8569
|
+
};
|
|
8570
|
+
}
|
|
8571
|
+
if (!isRecord(serverConfig)) {
|
|
8572
|
+
return {
|
|
8573
|
+
success: false,
|
|
8574
|
+
error: new Error(`MCP server "${serverName}" must be a JSON object`)
|
|
8575
|
+
};
|
|
8576
|
+
}
|
|
8577
|
+
for (const key of Object.keys(serverConfig)) {
|
|
8578
|
+
if (isPrototypePollutionKey(key)) {
|
|
8579
|
+
return {
|
|
8580
|
+
success: false,
|
|
8581
|
+
error: new Error(
|
|
8582
|
+
`Config key "${key}" in server "${serverName}" is a prototype pollution key and is not allowed`
|
|
8583
|
+
)
|
|
8584
|
+
};
|
|
8585
|
+
}
|
|
8586
|
+
}
|
|
8587
|
+
}
|
|
8588
|
+
return { success: true, error: null };
|
|
8589
|
+
}
|
|
8590
|
+
/**
|
|
8591
|
+
* settings.json may contain other Amp settings, so it should not be deleted.
|
|
8592
|
+
*/
|
|
8593
|
+
isDeletable() {
|
|
8594
|
+
return false;
|
|
8595
|
+
}
|
|
8596
|
+
static forDeletion({
|
|
8597
|
+
outputRoot = process.cwd(),
|
|
8598
|
+
relativeDirPath,
|
|
8599
|
+
relativeFilePath,
|
|
8600
|
+
global = false
|
|
8601
|
+
}) {
|
|
8602
|
+
return new _AmpMcp({
|
|
8603
|
+
outputRoot,
|
|
8604
|
+
relativeDirPath,
|
|
8605
|
+
relativeFilePath,
|
|
8606
|
+
fileContent: "{}",
|
|
8607
|
+
validate: false,
|
|
8608
|
+
global
|
|
8609
|
+
});
|
|
8610
|
+
}
|
|
8611
|
+
};
|
|
8612
|
+
|
|
8409
8613
|
// src/features/mcp/antigravity-mcp.ts
|
|
8614
|
+
import { join as join54 } from "path";
|
|
8410
8615
|
function renameServerField(servers, from, to) {
|
|
8411
8616
|
if (servers === null || typeof servers !== "object" || Array.isArray(servers)) {
|
|
8412
8617
|
return {};
|
|
@@ -8445,7 +8650,7 @@ var AntigravityMcp = class extends ToolMcp {
|
|
|
8445
8650
|
static getSettablePaths({ global } = {}) {
|
|
8446
8651
|
if (global) {
|
|
8447
8652
|
return {
|
|
8448
|
-
relativeDirPath:
|
|
8653
|
+
relativeDirPath: join54(".gemini", this.getGlobalSubdir()),
|
|
8449
8654
|
relativeFilePath: "mcp_config.json"
|
|
8450
8655
|
};
|
|
8451
8656
|
}
|
|
@@ -8461,7 +8666,7 @@ var AntigravityMcp = class extends ToolMcp {
|
|
|
8461
8666
|
}) {
|
|
8462
8667
|
const paths = this.getSettablePaths({ global });
|
|
8463
8668
|
const fileContent = await readFileContentOrNull(
|
|
8464
|
-
|
|
8669
|
+
join54(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
8465
8670
|
) ?? '{"mcpServers":{}}';
|
|
8466
8671
|
const json = JSON.parse(fileContent);
|
|
8467
8672
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
@@ -8482,7 +8687,7 @@ var AntigravityMcp = class extends ToolMcp {
|
|
|
8482
8687
|
}) {
|
|
8483
8688
|
const paths = this.getSettablePaths({ global });
|
|
8484
8689
|
const fileContent = await readOrInitializeFileContent(
|
|
8485
|
-
|
|
8690
|
+
join54(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
8486
8691
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
8487
8692
|
);
|
|
8488
8693
|
const json = JSON.parse(fileContent);
|
|
@@ -8540,7 +8745,7 @@ var AntigravityIdeMcp = class extends AntigravityMcp {
|
|
|
8540
8745
|
};
|
|
8541
8746
|
|
|
8542
8747
|
// src/features/mcp/claudecode-mcp.ts
|
|
8543
|
-
import { join as
|
|
8748
|
+
import { join as join55 } from "path";
|
|
8544
8749
|
var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
8545
8750
|
json;
|
|
8546
8751
|
constructor(params) {
|
|
@@ -8586,7 +8791,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
8586
8791
|
logger
|
|
8587
8792
|
}) {
|
|
8588
8793
|
const paths = this.getSettablePaths({ global });
|
|
8589
|
-
const recommendedPath =
|
|
8794
|
+
const recommendedPath = join55(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
8590
8795
|
if (await fileExists(recommendedPath)) {
|
|
8591
8796
|
const fileContent = await readFileContent(recommendedPath);
|
|
8592
8797
|
const json = JSON.parse(fileContent);
|
|
@@ -8601,7 +8806,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
8601
8806
|
});
|
|
8602
8807
|
}
|
|
8603
8808
|
if (global) {
|
|
8604
|
-
const legacyPath =
|
|
8809
|
+
const legacyPath = join55(
|
|
8605
8810
|
outputRoot,
|
|
8606
8811
|
_ClaudecodeMcp.LEGACY_GLOBAL_DIR,
|
|
8607
8812
|
_ClaudecodeMcp.LEGACY_GLOBAL_FILE
|
|
@@ -8640,7 +8845,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
8640
8845
|
}) {
|
|
8641
8846
|
const paths = this.getSettablePaths({ global });
|
|
8642
8847
|
const fileContent = await readOrInitializeFileContent(
|
|
8643
|
-
|
|
8848
|
+
join55(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
8644
8849
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
8645
8850
|
);
|
|
8646
8851
|
const json = JSON.parse(fileContent);
|
|
@@ -8680,7 +8885,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
8680
8885
|
};
|
|
8681
8886
|
|
|
8682
8887
|
// src/features/mcp/cline-mcp.ts
|
|
8683
|
-
import { join as
|
|
8888
|
+
import { join as join56 } from "path";
|
|
8684
8889
|
var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
8685
8890
|
json;
|
|
8686
8891
|
constructor(params) {
|
|
@@ -8701,7 +8906,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
8701
8906
|
validate = true
|
|
8702
8907
|
}) {
|
|
8703
8908
|
const fileContent = await readFileContent(
|
|
8704
|
-
|
|
8909
|
+
join56(
|
|
8705
8910
|
outputRoot,
|
|
8706
8911
|
this.getSettablePaths().relativeDirPath,
|
|
8707
8912
|
this.getSettablePaths().relativeFilePath
|
|
@@ -8756,7 +8961,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
8756
8961
|
};
|
|
8757
8962
|
|
|
8758
8963
|
// src/features/mcp/codexcli-mcp.ts
|
|
8759
|
-
import { join as
|
|
8964
|
+
import { join as join57 } from "path";
|
|
8760
8965
|
import * as smolToml3 from "smol-toml";
|
|
8761
8966
|
var CODEX_TO_RULESYNC_FIELD_MAP = {
|
|
8762
8967
|
enabled_tools: "enabledTools",
|
|
@@ -8769,7 +8974,6 @@ var RULESYNC_TO_CODEX_FIELD_MAP = {
|
|
|
8769
8974
|
envVars: "env_vars"
|
|
8770
8975
|
};
|
|
8771
8976
|
var MAX_REMOVE_EMPTY_ENTRIES_DEPTH = 32;
|
|
8772
|
-
var PROTOTYPE_POLLUTION_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
8773
8977
|
function convertFromCodexFormat(codexMcp) {
|
|
8774
8978
|
const result = {};
|
|
8775
8979
|
for (const [name, config] of Object.entries(codexMcp)) {
|
|
@@ -8867,7 +9071,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
8867
9071
|
}) {
|
|
8868
9072
|
const paths = this.getSettablePaths({ global });
|
|
8869
9073
|
const fileContent = await readFileContentOrNull(
|
|
8870
|
-
|
|
9074
|
+
join57(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
8871
9075
|
) ?? smolToml3.stringify({});
|
|
8872
9076
|
return new _CodexcliMcp({
|
|
8873
9077
|
outputRoot,
|
|
@@ -8884,7 +9088,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
8884
9088
|
global = false
|
|
8885
9089
|
}) {
|
|
8886
9090
|
const paths = this.getSettablePaths({ global });
|
|
8887
|
-
const configTomlFilePath =
|
|
9091
|
+
const configTomlFilePath = join57(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
8888
9092
|
const configTomlFileContent = await readOrInitializeFileContent(
|
|
8889
9093
|
configTomlFilePath,
|
|
8890
9094
|
smolToml3.stringify({})
|
|
@@ -8974,7 +9178,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
8974
9178
|
};
|
|
8975
9179
|
|
|
8976
9180
|
// src/features/mcp/copilot-mcp.ts
|
|
8977
|
-
import { join as
|
|
9181
|
+
import { join as join58 } from "path";
|
|
8978
9182
|
function convertToCopilotFormat(mcpServers) {
|
|
8979
9183
|
return { servers: mcpServers };
|
|
8980
9184
|
}
|
|
@@ -9001,7 +9205,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
9001
9205
|
validate = true
|
|
9002
9206
|
}) {
|
|
9003
9207
|
const fileContent = await readFileContent(
|
|
9004
|
-
|
|
9208
|
+
join58(
|
|
9005
9209
|
outputRoot,
|
|
9006
9210
|
this.getSettablePaths().relativeDirPath,
|
|
9007
9211
|
this.getSettablePaths().relativeFilePath
|
|
@@ -9054,7 +9258,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
9054
9258
|
};
|
|
9055
9259
|
|
|
9056
9260
|
// src/features/mcp/copilotcli-mcp.ts
|
|
9057
|
-
import { join as
|
|
9261
|
+
import { join as join59 } from "path";
|
|
9058
9262
|
var isRemoteServerType = (type) => {
|
|
9059
9263
|
return type === "http" || type === "sse";
|
|
9060
9264
|
};
|
|
@@ -9153,7 +9357,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
|
|
|
9153
9357
|
}) {
|
|
9154
9358
|
const paths = this.getSettablePaths({ global });
|
|
9155
9359
|
const fileContent = await readFileContentOrNull(
|
|
9156
|
-
|
|
9360
|
+
join59(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
9157
9361
|
) ?? '{"mcpServers":{}}';
|
|
9158
9362
|
const json = JSON.parse(fileContent);
|
|
9159
9363
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
@@ -9174,7 +9378,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
|
|
|
9174
9378
|
}) {
|
|
9175
9379
|
const paths = this.getSettablePaths({ global });
|
|
9176
9380
|
const fileContent = await readOrInitializeFileContent(
|
|
9177
|
-
|
|
9381
|
+
join59(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
9178
9382
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
9179
9383
|
);
|
|
9180
9384
|
const json = JSON.parse(fileContent);
|
|
@@ -9216,7 +9420,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
|
|
|
9216
9420
|
};
|
|
9217
9421
|
|
|
9218
9422
|
// src/features/mcp/cursor-mcp.ts
|
|
9219
|
-
import { join as
|
|
9423
|
+
import { join as join60 } from "path";
|
|
9220
9424
|
|
|
9221
9425
|
// src/features/mcp/mcp-env-var-format.ts
|
|
9222
9426
|
var CANONICAL_ENV_VAR_PATTERN = /\$\{(?!env:)([^}:]+)\}/g;
|
|
@@ -9287,7 +9491,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
9287
9491
|
this.json = JSON.parse(this.fileContent);
|
|
9288
9492
|
} catch (error) {
|
|
9289
9493
|
throw new Error(
|
|
9290
|
-
`Failed to parse Cursor MCP config at ${
|
|
9494
|
+
`Failed to parse Cursor MCP config at ${join60(this.relativeDirPath, this.relativeFilePath)}: ${formatError(error)}`,
|
|
9291
9495
|
{ cause: error }
|
|
9292
9496
|
);
|
|
9293
9497
|
}
|
|
@@ -9313,14 +9517,14 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
9313
9517
|
global = false
|
|
9314
9518
|
}) {
|
|
9315
9519
|
const paths = this.getSettablePaths({ global });
|
|
9316
|
-
const filePath =
|
|
9520
|
+
const filePath = join60(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
9317
9521
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"mcpServers":{}}';
|
|
9318
9522
|
let json;
|
|
9319
9523
|
try {
|
|
9320
9524
|
json = JSON.parse(fileContent);
|
|
9321
9525
|
} catch (error) {
|
|
9322
9526
|
throw new Error(
|
|
9323
|
-
`Failed to parse Cursor MCP config at ${
|
|
9527
|
+
`Failed to parse Cursor MCP config at ${join60(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
|
|
9324
9528
|
{ cause: error }
|
|
9325
9529
|
);
|
|
9326
9530
|
}
|
|
@@ -9342,7 +9546,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
9342
9546
|
}) {
|
|
9343
9547
|
const paths = this.getSettablePaths({ global });
|
|
9344
9548
|
const fileContent = await readOrInitializeFileContent(
|
|
9345
|
-
|
|
9549
|
+
join60(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
9346
9550
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
9347
9551
|
);
|
|
9348
9552
|
let json;
|
|
@@ -9350,7 +9554,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
9350
9554
|
json = JSON.parse(fileContent);
|
|
9351
9555
|
} catch (error) {
|
|
9352
9556
|
throw new Error(
|
|
9353
|
-
`Failed to parse Cursor MCP config at ${
|
|
9557
|
+
`Failed to parse Cursor MCP config at ${join60(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
|
|
9354
9558
|
{ cause: error }
|
|
9355
9559
|
);
|
|
9356
9560
|
}
|
|
@@ -9404,7 +9608,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
9404
9608
|
};
|
|
9405
9609
|
|
|
9406
9610
|
// src/features/mcp/deepagents-mcp.ts
|
|
9407
|
-
import { join as
|
|
9611
|
+
import { join as join61 } from "path";
|
|
9408
9612
|
var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
|
|
9409
9613
|
json;
|
|
9410
9614
|
constructor(params) {
|
|
@@ -9430,7 +9634,7 @@ var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
|
|
|
9430
9634
|
}) {
|
|
9431
9635
|
const paths = this.getSettablePaths({ global });
|
|
9432
9636
|
const fileContent = await readFileContentOrNull(
|
|
9433
|
-
|
|
9637
|
+
join61(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
9434
9638
|
) ?? '{"mcpServers":{}}';
|
|
9435
9639
|
const json = JSON.parse(fileContent);
|
|
9436
9640
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
@@ -9450,7 +9654,7 @@ var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
|
|
|
9450
9654
|
}) {
|
|
9451
9655
|
const paths = this.getSettablePaths({ global });
|
|
9452
9656
|
const fileContent = await readOrInitializeFileContent(
|
|
9453
|
-
|
|
9657
|
+
join61(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
9454
9658
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
9455
9659
|
);
|
|
9456
9660
|
const json = JSON.parse(fileContent);
|
|
@@ -9489,7 +9693,7 @@ var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
|
|
|
9489
9693
|
};
|
|
9490
9694
|
|
|
9491
9695
|
// src/features/mcp/factorydroid-mcp.ts
|
|
9492
|
-
import { join as
|
|
9696
|
+
import { join as join62 } from "path";
|
|
9493
9697
|
var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
9494
9698
|
json;
|
|
9495
9699
|
constructor(params) {
|
|
@@ -9510,7 +9714,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
9510
9714
|
validate = true
|
|
9511
9715
|
}) {
|
|
9512
9716
|
const fileContent = await readFileContent(
|
|
9513
|
-
|
|
9717
|
+
join62(
|
|
9514
9718
|
outputRoot,
|
|
9515
9719
|
this.getSettablePaths().relativeDirPath,
|
|
9516
9720
|
this.getSettablePaths().relativeFilePath
|
|
@@ -9564,7 +9768,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
9564
9768
|
};
|
|
9565
9769
|
|
|
9566
9770
|
// src/features/mcp/geminicli-mcp.ts
|
|
9567
|
-
import { join as
|
|
9771
|
+
import { join as join63 } from "path";
|
|
9568
9772
|
var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
9569
9773
|
json;
|
|
9570
9774
|
constructor(params) {
|
|
@@ -9593,7 +9797,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
9593
9797
|
}) {
|
|
9594
9798
|
const paths = this.getSettablePaths({ global });
|
|
9595
9799
|
const fileContent = await readFileContentOrNull(
|
|
9596
|
-
|
|
9800
|
+
join63(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
9597
9801
|
) ?? '{"mcpServers":{}}';
|
|
9598
9802
|
const json = JSON.parse(fileContent);
|
|
9599
9803
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
@@ -9613,7 +9817,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
9613
9817
|
}) {
|
|
9614
9818
|
const paths = this.getSettablePaths({ global });
|
|
9615
9819
|
const fileContent = await readOrInitializeFileContent(
|
|
9616
|
-
|
|
9820
|
+
join63(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
9617
9821
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
9618
9822
|
);
|
|
9619
9823
|
const json = JSON.parse(fileContent);
|
|
@@ -9658,7 +9862,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
9658
9862
|
};
|
|
9659
9863
|
|
|
9660
9864
|
// src/features/mcp/junie-mcp.ts
|
|
9661
|
-
import { join as
|
|
9865
|
+
import { join as join64 } from "path";
|
|
9662
9866
|
var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
9663
9867
|
json;
|
|
9664
9868
|
constructor(params) {
|
|
@@ -9670,7 +9874,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
9670
9874
|
}
|
|
9671
9875
|
static getSettablePaths() {
|
|
9672
9876
|
return {
|
|
9673
|
-
relativeDirPath:
|
|
9877
|
+
relativeDirPath: join64(".junie", "mcp"),
|
|
9674
9878
|
relativeFilePath: "mcp.json"
|
|
9675
9879
|
};
|
|
9676
9880
|
}
|
|
@@ -9679,7 +9883,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
9679
9883
|
validate = true
|
|
9680
9884
|
}) {
|
|
9681
9885
|
const fileContent = await readFileContent(
|
|
9682
|
-
|
|
9886
|
+
join64(
|
|
9683
9887
|
outputRoot,
|
|
9684
9888
|
this.getSettablePaths().relativeDirPath,
|
|
9685
9889
|
this.getSettablePaths().relativeFilePath
|
|
@@ -9734,8 +9938,8 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
9734
9938
|
};
|
|
9735
9939
|
|
|
9736
9940
|
// src/features/mcp/kilo-mcp.ts
|
|
9737
|
-
import { join as
|
|
9738
|
-
import { parse as
|
|
9941
|
+
import { join as join65 } from "path";
|
|
9942
|
+
import { parse as parseJsonc4 } from "jsonc-parser";
|
|
9739
9943
|
import { z as z27 } from "zod/mini";
|
|
9740
9944
|
var KiloMcpLocalServerSchema = z27.object({
|
|
9741
9945
|
type: z27.literal("local"),
|
|
@@ -9858,7 +10062,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9858
10062
|
json;
|
|
9859
10063
|
constructor(params) {
|
|
9860
10064
|
super(params);
|
|
9861
|
-
this.json = KiloConfigSchema.parse(
|
|
10065
|
+
this.json = KiloConfigSchema.parse(parseJsonc4(this.fileContent || "{}"));
|
|
9862
10066
|
}
|
|
9863
10067
|
getJson() {
|
|
9864
10068
|
return this.json;
|
|
@@ -9872,7 +10076,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9872
10076
|
static getSettablePaths({ global } = {}) {
|
|
9873
10077
|
if (global) {
|
|
9874
10078
|
return {
|
|
9875
|
-
relativeDirPath:
|
|
10079
|
+
relativeDirPath: join65(".config", "kilo"),
|
|
9876
10080
|
relativeFilePath: "kilo.json"
|
|
9877
10081
|
};
|
|
9878
10082
|
}
|
|
@@ -9887,11 +10091,11 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9887
10091
|
global = false
|
|
9888
10092
|
}) {
|
|
9889
10093
|
const basePaths = this.getSettablePaths({ global });
|
|
9890
|
-
const jsonDir =
|
|
10094
|
+
const jsonDir = join65(outputRoot, basePaths.relativeDirPath);
|
|
9891
10095
|
let fileContent = null;
|
|
9892
10096
|
let relativeFilePath = "kilo.jsonc";
|
|
9893
|
-
const jsoncPath =
|
|
9894
|
-
const jsonPath =
|
|
10097
|
+
const jsoncPath = join65(jsonDir, "kilo.jsonc");
|
|
10098
|
+
const jsonPath = join65(jsonDir, "kilo.json");
|
|
9895
10099
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
9896
10100
|
if (!fileContent) {
|
|
9897
10101
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -9900,7 +10104,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9900
10104
|
}
|
|
9901
10105
|
}
|
|
9902
10106
|
const fileContentToUse = fileContent ?? '{"mcp":{}}';
|
|
9903
|
-
const json =
|
|
10107
|
+
const json = parseJsonc4(fileContentToUse);
|
|
9904
10108
|
const newJson = { ...json, mcp: json.mcp ?? {} };
|
|
9905
10109
|
return new _KiloMcp({
|
|
9906
10110
|
outputRoot,
|
|
@@ -9917,11 +10121,11 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9917
10121
|
global = false
|
|
9918
10122
|
}) {
|
|
9919
10123
|
const basePaths = this.getSettablePaths({ global });
|
|
9920
|
-
const jsonDir =
|
|
10124
|
+
const jsonDir = join65(outputRoot, basePaths.relativeDirPath);
|
|
9921
10125
|
let fileContent = null;
|
|
9922
10126
|
let relativeFilePath = "kilo.jsonc";
|
|
9923
|
-
const jsoncPath =
|
|
9924
|
-
const jsonPath =
|
|
10127
|
+
const jsoncPath = join65(jsonDir, "kilo.jsonc");
|
|
10128
|
+
const jsonPath = join65(jsonDir, "kilo.json");
|
|
9925
10129
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
9926
10130
|
if (!fileContent) {
|
|
9927
10131
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -9932,7 +10136,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9932
10136
|
if (!fileContent) {
|
|
9933
10137
|
fileContent = JSON.stringify({ mcp: {} }, null, 2);
|
|
9934
10138
|
}
|
|
9935
|
-
const json =
|
|
10139
|
+
const json = parseJsonc4(fileContent);
|
|
9936
10140
|
const { mcp: convertedMcp, tools: mcpTools } = convertToKiloFormat(rulesyncMcp.getMcpServers());
|
|
9937
10141
|
const { tools: _existingTools, ...jsonWithoutTools } = json;
|
|
9938
10142
|
const newJson = {
|
|
@@ -9980,7 +10184,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
9980
10184
|
};
|
|
9981
10185
|
|
|
9982
10186
|
// src/features/mcp/kiro-mcp.ts
|
|
9983
|
-
import { join as
|
|
10187
|
+
import { join as join66 } from "path";
|
|
9984
10188
|
var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
9985
10189
|
json;
|
|
9986
10190
|
constructor(params) {
|
|
@@ -9992,7 +10196,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
9992
10196
|
}
|
|
9993
10197
|
static getSettablePaths() {
|
|
9994
10198
|
return {
|
|
9995
|
-
relativeDirPath:
|
|
10199
|
+
relativeDirPath: join66(".kiro", "settings"),
|
|
9996
10200
|
relativeFilePath: "mcp.json"
|
|
9997
10201
|
};
|
|
9998
10202
|
}
|
|
@@ -10002,7 +10206,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
10002
10206
|
}) {
|
|
10003
10207
|
const paths = this.getSettablePaths();
|
|
10004
10208
|
const fileContent = await readFileContentOrNull(
|
|
10005
|
-
|
|
10209
|
+
join66(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
10006
10210
|
) ?? '{"mcpServers":{}}';
|
|
10007
10211
|
return new _KiroMcp({
|
|
10008
10212
|
outputRoot,
|
|
@@ -10051,8 +10255,8 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
10051
10255
|
};
|
|
10052
10256
|
|
|
10053
10257
|
// src/features/mcp/opencode-mcp.ts
|
|
10054
|
-
import { join as
|
|
10055
|
-
import { parse as
|
|
10258
|
+
import { join as join67 } from "path";
|
|
10259
|
+
import { parse as parseJsonc5 } from "jsonc-parser";
|
|
10056
10260
|
import { z as z28 } from "zod/mini";
|
|
10057
10261
|
var OPENCODE_ENV_VAR_PATTERN = /(?<!\$)\{env:([^}:]+)\}/g;
|
|
10058
10262
|
var OpencodeMcpLocalServerSchema = z28.object({
|
|
@@ -10179,7 +10383,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10179
10383
|
json;
|
|
10180
10384
|
constructor(params) {
|
|
10181
10385
|
super(params);
|
|
10182
|
-
this.json = OpencodeConfigSchema.parse(
|
|
10386
|
+
this.json = OpencodeConfigSchema.parse(parseJsonc5(this.fileContent || "{}"));
|
|
10183
10387
|
}
|
|
10184
10388
|
getJson() {
|
|
10185
10389
|
return this.json;
|
|
@@ -10193,7 +10397,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10193
10397
|
static getSettablePaths({ global } = {}) {
|
|
10194
10398
|
if (global) {
|
|
10195
10399
|
return {
|
|
10196
|
-
relativeDirPath:
|
|
10400
|
+
relativeDirPath: join67(".config", "opencode"),
|
|
10197
10401
|
relativeFilePath: "opencode.json"
|
|
10198
10402
|
};
|
|
10199
10403
|
}
|
|
@@ -10208,11 +10412,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10208
10412
|
global = false
|
|
10209
10413
|
}) {
|
|
10210
10414
|
const basePaths = this.getSettablePaths({ global });
|
|
10211
|
-
const jsonDir =
|
|
10415
|
+
const jsonDir = join67(outputRoot, basePaths.relativeDirPath);
|
|
10212
10416
|
let fileContent = null;
|
|
10213
10417
|
let relativeFilePath = "opencode.jsonc";
|
|
10214
|
-
const jsoncPath =
|
|
10215
|
-
const jsonPath =
|
|
10418
|
+
const jsoncPath = join67(jsonDir, "opencode.jsonc");
|
|
10419
|
+
const jsonPath = join67(jsonDir, "opencode.json");
|
|
10216
10420
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
10217
10421
|
if (!fileContent) {
|
|
10218
10422
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -10221,7 +10425,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10221
10425
|
}
|
|
10222
10426
|
}
|
|
10223
10427
|
const fileContentToUse = fileContent ?? '{"mcp":{}}';
|
|
10224
|
-
const json =
|
|
10428
|
+
const json = parseJsonc5(fileContentToUse);
|
|
10225
10429
|
const newJson = { ...json, mcp: json.mcp ?? {} };
|
|
10226
10430
|
return new _OpencodeMcp({
|
|
10227
10431
|
outputRoot,
|
|
@@ -10238,11 +10442,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10238
10442
|
global = false
|
|
10239
10443
|
}) {
|
|
10240
10444
|
const basePaths = this.getSettablePaths({ global });
|
|
10241
|
-
const jsonDir =
|
|
10445
|
+
const jsonDir = join67(outputRoot, basePaths.relativeDirPath);
|
|
10242
10446
|
let fileContent = null;
|
|
10243
10447
|
let relativeFilePath = "opencode.jsonc";
|
|
10244
|
-
const jsoncPath =
|
|
10245
|
-
const jsonPath =
|
|
10448
|
+
const jsoncPath = join67(jsonDir, "opencode.jsonc");
|
|
10449
|
+
const jsonPath = join67(jsonDir, "opencode.json");
|
|
10246
10450
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
10247
10451
|
if (!fileContent) {
|
|
10248
10452
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -10253,7 +10457,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10253
10457
|
if (!fileContent) {
|
|
10254
10458
|
fileContent = JSON.stringify({ mcp: {} }, null, 2);
|
|
10255
10459
|
}
|
|
10256
|
-
const json =
|
|
10460
|
+
const json = parseJsonc5(fileContent);
|
|
10257
10461
|
const mcpServers = rulesyncMcp.getMcpServers();
|
|
10258
10462
|
const transformedServers = convertEnvVarRefsToToolFormat({
|
|
10259
10463
|
mcpServers,
|
|
@@ -10310,7 +10514,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
10310
10514
|
};
|
|
10311
10515
|
|
|
10312
10516
|
// src/features/mcp/roo-mcp.ts
|
|
10313
|
-
import { join as
|
|
10517
|
+
import { join as join68 } from "path";
|
|
10314
10518
|
function convertToRooFormat(mcpServers) {
|
|
10315
10519
|
return Object.fromEntries(
|
|
10316
10520
|
Object.entries(mcpServers).map(([serverName, serverConfig]) => {
|
|
@@ -10362,7 +10566,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
10362
10566
|
validate = true
|
|
10363
10567
|
}) {
|
|
10364
10568
|
const fileContent = await readFileContent(
|
|
10365
|
-
|
|
10569
|
+
join68(
|
|
10366
10570
|
outputRoot,
|
|
10367
10571
|
this.getSettablePaths().relativeDirPath,
|
|
10368
10572
|
this.getSettablePaths().relativeFilePath
|
|
@@ -10417,9 +10621,9 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
10417
10621
|
};
|
|
10418
10622
|
|
|
10419
10623
|
// src/features/mcp/rovodev-mcp.ts
|
|
10420
|
-
import { join as
|
|
10624
|
+
import { join as join69 } from "path";
|
|
10421
10625
|
function parseRovodevMcpJson(fileContent, relativeDirPath, relativeFilePath) {
|
|
10422
|
-
const configPath =
|
|
10626
|
+
const configPath = join69(relativeDirPath, relativeFilePath);
|
|
10423
10627
|
let parsed;
|
|
10424
10628
|
try {
|
|
10425
10629
|
parsed = JSON.parse(fileContent);
|
|
@@ -10468,7 +10672,7 @@ var RovodevMcp = class _RovodevMcp extends ToolMcp {
|
|
|
10468
10672
|
throw new Error("Rovodev MCP is global-only; use --global to sync ~/.rovodev/mcp.json");
|
|
10469
10673
|
}
|
|
10470
10674
|
const paths = this.getSettablePaths({ global });
|
|
10471
|
-
const filePath =
|
|
10675
|
+
const filePath = join69(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
10472
10676
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"mcpServers":{}}';
|
|
10473
10677
|
const json = parseRovodevMcpJson(fileContent, paths.relativeDirPath, paths.relativeFilePath);
|
|
10474
10678
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
@@ -10492,7 +10696,7 @@ var RovodevMcp = class _RovodevMcp extends ToolMcp {
|
|
|
10492
10696
|
}
|
|
10493
10697
|
const paths = this.getSettablePaths({ global });
|
|
10494
10698
|
const fileContent = await readOrInitializeFileContent(
|
|
10495
|
-
|
|
10699
|
+
join69(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
10496
10700
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
10497
10701
|
);
|
|
10498
10702
|
const json = parseRovodevMcpJson(fileContent, paths.relativeDirPath, paths.relativeFilePath);
|
|
@@ -10533,8 +10737,101 @@ var RovodevMcp = class _RovodevMcp extends ToolMcp {
|
|
|
10533
10737
|
}
|
|
10534
10738
|
};
|
|
10535
10739
|
|
|
10740
|
+
// src/features/mcp/warp-mcp.ts
|
|
10741
|
+
import { join as join70 } from "path";
|
|
10742
|
+
var WarpMcp = class _WarpMcp extends ToolMcp {
|
|
10743
|
+
json;
|
|
10744
|
+
constructor(params) {
|
|
10745
|
+
super(params);
|
|
10746
|
+
this.json = this.fileContent !== void 0 ? _WarpMcp.parseJsonOrThrow(this.fileContent, this.relativeDirPath, this.relativeFilePath) : {};
|
|
10747
|
+
}
|
|
10748
|
+
getJson() {
|
|
10749
|
+
return this.json;
|
|
10750
|
+
}
|
|
10751
|
+
static parseJsonOrThrow(content, relativeDirPath, relativeFilePath) {
|
|
10752
|
+
try {
|
|
10753
|
+
return JSON.parse(content);
|
|
10754
|
+
} catch (error) {
|
|
10755
|
+
throw new Error(
|
|
10756
|
+
`Failed to parse Warp MCP config at ${join70(relativeDirPath, relativeFilePath)}: ${formatError(error)}`,
|
|
10757
|
+
{ cause: error }
|
|
10758
|
+
);
|
|
10759
|
+
}
|
|
10760
|
+
}
|
|
10761
|
+
static getSettablePaths(_options) {
|
|
10762
|
+
return {
|
|
10763
|
+
relativeDirPath: ".warp",
|
|
10764
|
+
relativeFilePath: ".mcp.json"
|
|
10765
|
+
};
|
|
10766
|
+
}
|
|
10767
|
+
static async fromFile({
|
|
10768
|
+
outputRoot = process.cwd(),
|
|
10769
|
+
validate = true,
|
|
10770
|
+
global = false
|
|
10771
|
+
}) {
|
|
10772
|
+
const paths = this.getSettablePaths({ global });
|
|
10773
|
+
const filePath = join70(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
10774
|
+
const fileContent = await readFileContentOrNull(filePath) ?? '{"mcpServers":{}}';
|
|
10775
|
+
const json = this.parseJsonOrThrow(fileContent, paths.relativeDirPath, paths.relativeFilePath);
|
|
10776
|
+
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
10777
|
+
return new _WarpMcp({
|
|
10778
|
+
outputRoot,
|
|
10779
|
+
relativeDirPath: paths.relativeDirPath,
|
|
10780
|
+
relativeFilePath: paths.relativeFilePath,
|
|
10781
|
+
fileContent: JSON.stringify(newJson, null, 2),
|
|
10782
|
+
validate,
|
|
10783
|
+
global
|
|
10784
|
+
});
|
|
10785
|
+
}
|
|
10786
|
+
static async fromRulesyncMcp({
|
|
10787
|
+
outputRoot = process.cwd(),
|
|
10788
|
+
rulesyncMcp,
|
|
10789
|
+
validate = true,
|
|
10790
|
+
global = false
|
|
10791
|
+
}) {
|
|
10792
|
+
const paths = this.getSettablePaths({ global });
|
|
10793
|
+
const fileContent = await readOrInitializeFileContent(
|
|
10794
|
+
join70(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
10795
|
+
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
10796
|
+
);
|
|
10797
|
+
const json = this.parseJsonOrThrow(fileContent, paths.relativeDirPath, paths.relativeFilePath);
|
|
10798
|
+
const warpConfig = { ...json, mcpServers: rulesyncMcp.getMcpServers() };
|
|
10799
|
+
return new _WarpMcp({
|
|
10800
|
+
outputRoot,
|
|
10801
|
+
relativeDirPath: paths.relativeDirPath,
|
|
10802
|
+
relativeFilePath: paths.relativeFilePath,
|
|
10803
|
+
fileContent: JSON.stringify(warpConfig, null, 2),
|
|
10804
|
+
validate,
|
|
10805
|
+
global
|
|
10806
|
+
});
|
|
10807
|
+
}
|
|
10808
|
+
toRulesyncMcp() {
|
|
10809
|
+
return this.toRulesyncMcpDefault({
|
|
10810
|
+
fileContent: JSON.stringify({ mcpServers: this.json.mcpServers ?? {} }, null, 2)
|
|
10811
|
+
});
|
|
10812
|
+
}
|
|
10813
|
+
validate() {
|
|
10814
|
+
return { success: true, error: null };
|
|
10815
|
+
}
|
|
10816
|
+
static forDeletion({
|
|
10817
|
+
outputRoot = process.cwd(),
|
|
10818
|
+
relativeDirPath,
|
|
10819
|
+
relativeFilePath,
|
|
10820
|
+
global = false
|
|
10821
|
+
}) {
|
|
10822
|
+
return new _WarpMcp({
|
|
10823
|
+
outputRoot,
|
|
10824
|
+
relativeDirPath,
|
|
10825
|
+
relativeFilePath,
|
|
10826
|
+
fileContent: "{}",
|
|
10827
|
+
validate: false,
|
|
10828
|
+
global
|
|
10829
|
+
});
|
|
10830
|
+
}
|
|
10831
|
+
};
|
|
10832
|
+
|
|
10536
10833
|
// src/features/mcp/zed-mcp.ts
|
|
10537
|
-
import { join as
|
|
10834
|
+
import { join as join71 } from "path";
|
|
10538
10835
|
var ZedMcp = class _ZedMcp extends ToolMcp {
|
|
10539
10836
|
json;
|
|
10540
10837
|
constructor(params) {
|
|
@@ -10547,7 +10844,7 @@ var ZedMcp = class _ZedMcp extends ToolMcp {
|
|
|
10547
10844
|
static getSettablePaths({ global } = {}) {
|
|
10548
10845
|
if (global) {
|
|
10549
10846
|
return {
|
|
10550
|
-
relativeDirPath:
|
|
10847
|
+
relativeDirPath: join71(".config", "zed"),
|
|
10551
10848
|
relativeFilePath: "settings.json"
|
|
10552
10849
|
};
|
|
10553
10850
|
}
|
|
@@ -10563,7 +10860,7 @@ var ZedMcp = class _ZedMcp extends ToolMcp {
|
|
|
10563
10860
|
}) {
|
|
10564
10861
|
const paths = this.getSettablePaths({ global });
|
|
10565
10862
|
const fileContent = await readFileContentOrNull(
|
|
10566
|
-
|
|
10863
|
+
join71(outputRoot, paths.relativeDirPath, paths.relativeFilePath)
|
|
10567
10864
|
) ?? "{}";
|
|
10568
10865
|
const json = JSON.parse(fileContent);
|
|
10569
10866
|
const newJson = { ...json, context_servers: json.context_servers ?? {} };
|
|
@@ -10583,7 +10880,7 @@ var ZedMcp = class _ZedMcp extends ToolMcp {
|
|
|
10583
10880
|
}) {
|
|
10584
10881
|
const paths = this.getSettablePaths({ global });
|
|
10585
10882
|
const fileContent = await readOrInitializeFileContent(
|
|
10586
|
-
|
|
10883
|
+
join71(outputRoot, paths.relativeDirPath, paths.relativeFilePath),
|
|
10587
10884
|
"{}"
|
|
10588
10885
|
);
|
|
10589
10886
|
const json = JSON.parse(fileContent);
|
|
@@ -10630,6 +10927,7 @@ var ZedMcp = class _ZedMcp extends ToolMcp {
|
|
|
10630
10927
|
|
|
10631
10928
|
// src/features/mcp/mcp-processor.ts
|
|
10632
10929
|
var mcpProcessorToolTargetTuple = [
|
|
10930
|
+
"amp",
|
|
10633
10931
|
"antigravity-cli",
|
|
10634
10932
|
"antigravity-ide",
|
|
10635
10933
|
"claudecode",
|
|
@@ -10648,10 +10946,23 @@ var mcpProcessorToolTargetTuple = [
|
|
|
10648
10946
|
"opencode",
|
|
10649
10947
|
"roo",
|
|
10650
10948
|
"rovodev",
|
|
10949
|
+
"warp",
|
|
10651
10950
|
"zed"
|
|
10652
10951
|
];
|
|
10653
10952
|
var McpProcessorToolTargetSchema = z29.enum(mcpProcessorToolTargetTuple);
|
|
10654
10953
|
var toolMcpFactories = /* @__PURE__ */ new Map([
|
|
10954
|
+
[
|
|
10955
|
+
"amp",
|
|
10956
|
+
{
|
|
10957
|
+
class: AmpMcp,
|
|
10958
|
+
meta: {
|
|
10959
|
+
supportsProject: true,
|
|
10960
|
+
supportsGlobal: true,
|
|
10961
|
+
supportsEnabledTools: false,
|
|
10962
|
+
supportsDisabledTools: false
|
|
10963
|
+
}
|
|
10964
|
+
}
|
|
10965
|
+
],
|
|
10655
10966
|
[
|
|
10656
10967
|
"antigravity-cli",
|
|
10657
10968
|
{
|
|
@@ -10874,6 +11185,18 @@ var toolMcpFactories = /* @__PURE__ */ new Map([
|
|
|
10874
11185
|
}
|
|
10875
11186
|
}
|
|
10876
11187
|
],
|
|
11188
|
+
[
|
|
11189
|
+
"warp",
|
|
11190
|
+
{
|
|
11191
|
+
class: WarpMcp,
|
|
11192
|
+
meta: {
|
|
11193
|
+
supportsProject: true,
|
|
11194
|
+
supportsGlobal: true,
|
|
11195
|
+
supportsEnabledTools: false,
|
|
11196
|
+
supportsDisabledTools: false
|
|
11197
|
+
}
|
|
11198
|
+
}
|
|
11199
|
+
],
|
|
10877
11200
|
[
|
|
10878
11201
|
"zed",
|
|
10879
11202
|
{
|
|
@@ -11036,11 +11359,11 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
11036
11359
|
import { z as z38 } from "zod/mini";
|
|
11037
11360
|
|
|
11038
11361
|
// src/features/permissions/antigravity-cli-permissions.ts
|
|
11039
|
-
import { join as
|
|
11362
|
+
import { join as join73 } from "path";
|
|
11040
11363
|
import { uniq as uniq3 } from "es-toolkit";
|
|
11041
11364
|
|
|
11042
11365
|
// src/features/permissions/rulesync-permissions.ts
|
|
11043
|
-
import { join as
|
|
11366
|
+
import { join as join72 } from "path";
|
|
11044
11367
|
|
|
11045
11368
|
// src/types/permissions.ts
|
|
11046
11369
|
import { z as z30 } from "zod/mini";
|
|
@@ -11085,7 +11408,7 @@ var RulesyncPermissions = class _RulesyncPermissions extends RulesyncFile {
|
|
|
11085
11408
|
validate = true
|
|
11086
11409
|
}) {
|
|
11087
11410
|
const paths = _RulesyncPermissions.getSettablePaths();
|
|
11088
|
-
const filePath =
|
|
11411
|
+
const filePath = join72(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11089
11412
|
if (!await fileExists(filePath)) {
|
|
11090
11413
|
throw new Error(`No ${RULESYNC_PERMISSIONS_RELATIVE_FILE_PATH} found.`);
|
|
11091
11414
|
}
|
|
@@ -11175,7 +11498,7 @@ var AntigravityCliPermissions = class _AntigravityCliPermissions extends ToolPer
|
|
|
11175
11498
|
}
|
|
11176
11499
|
static getSettablePaths() {
|
|
11177
11500
|
return {
|
|
11178
|
-
relativeDirPath:
|
|
11501
|
+
relativeDirPath: join73(".gemini", "antigravity-cli"),
|
|
11179
11502
|
relativeFilePath: "settings.json"
|
|
11180
11503
|
};
|
|
11181
11504
|
}
|
|
@@ -11184,7 +11507,7 @@ var AntigravityCliPermissions = class _AntigravityCliPermissions extends ToolPer
|
|
|
11184
11507
|
validate = true
|
|
11185
11508
|
}) {
|
|
11186
11509
|
const paths = _AntigravityCliPermissions.getSettablePaths();
|
|
11187
|
-
const filePath =
|
|
11510
|
+
const filePath = join73(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11188
11511
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"permissions":{}}';
|
|
11189
11512
|
return new _AntigravityCliPermissions({
|
|
11190
11513
|
outputRoot,
|
|
@@ -11200,7 +11523,7 @@ var AntigravityCliPermissions = class _AntigravityCliPermissions extends ToolPer
|
|
|
11200
11523
|
rulesyncPermissions
|
|
11201
11524
|
}) {
|
|
11202
11525
|
const paths = _AntigravityCliPermissions.getSettablePaths();
|
|
11203
|
-
const filePath =
|
|
11526
|
+
const filePath = join73(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11204
11527
|
const existingContent = await readOrInitializeFileContent(
|
|
11205
11528
|
filePath,
|
|
11206
11529
|
JSON.stringify({}, null, 2)
|
|
@@ -11267,7 +11590,7 @@ var AntigravityCliPermissions = class _AntigravityCliPermissions extends ToolPer
|
|
|
11267
11590
|
settings = JSON.parse(this.getFileContent());
|
|
11268
11591
|
} catch (error) {
|
|
11269
11592
|
throw new Error(
|
|
11270
|
-
`Failed to parse Antigravity CLI permissions content in ${
|
|
11593
|
+
`Failed to parse Antigravity CLI permissions content in ${join73(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
11271
11594
|
{ cause: error }
|
|
11272
11595
|
);
|
|
11273
11596
|
}
|
|
@@ -11341,7 +11664,7 @@ function convertAntigravityCliToRulesyncPermissions(params) {
|
|
|
11341
11664
|
}
|
|
11342
11665
|
|
|
11343
11666
|
// src/features/permissions/augmentcode-permissions.ts
|
|
11344
|
-
import { join as
|
|
11667
|
+
import { join as join74 } from "path";
|
|
11345
11668
|
import { z as z31 } from "zod/mini";
|
|
11346
11669
|
var moduleLogger = new ConsoleLogger();
|
|
11347
11670
|
var AugmentPermissionTypeSchema = z31.enum(["allow", "deny", "ask-user"]);
|
|
@@ -11491,7 +11814,7 @@ var AugmentcodePermissions = class _AugmentcodePermissions extends ToolPermissio
|
|
|
11491
11814
|
global = false
|
|
11492
11815
|
}) {
|
|
11493
11816
|
const paths = _AugmentcodePermissions.getSettablePaths({ global });
|
|
11494
|
-
const filePath =
|
|
11817
|
+
const filePath = join74(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11495
11818
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"toolPermissions":[]}';
|
|
11496
11819
|
return new _AugmentcodePermissions({
|
|
11497
11820
|
outputRoot,
|
|
@@ -11508,7 +11831,7 @@ var AugmentcodePermissions = class _AugmentcodePermissions extends ToolPermissio
|
|
|
11508
11831
|
logger
|
|
11509
11832
|
}) {
|
|
11510
11833
|
const paths = _AugmentcodePermissions.getSettablePaths({ global });
|
|
11511
|
-
const filePath =
|
|
11834
|
+
const filePath = join74(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11512
11835
|
const existingContent = await readFileContentOrNull(filePath) ?? "{}";
|
|
11513
11836
|
let settings;
|
|
11514
11837
|
try {
|
|
@@ -11563,7 +11886,7 @@ var AugmentcodePermissions = class _AugmentcodePermissions extends ToolPermissio
|
|
|
11563
11886
|
settings = result.data;
|
|
11564
11887
|
} catch (error) {
|
|
11565
11888
|
throw new Error(
|
|
11566
|
-
`Failed to parse AugmentCode permissions content in ${
|
|
11889
|
+
`Failed to parse AugmentCode permissions content in ${join74(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
11567
11890
|
{ cause: error }
|
|
11568
11891
|
);
|
|
11569
11892
|
}
|
|
@@ -11731,7 +12054,7 @@ function convertAugmentToRulesyncPermissions({
|
|
|
11731
12054
|
}
|
|
11732
12055
|
|
|
11733
12056
|
// src/features/permissions/claudecode-permissions.ts
|
|
11734
|
-
import { join as
|
|
12057
|
+
import { join as join75 } from "path";
|
|
11735
12058
|
import { uniq as uniq4 } from "es-toolkit";
|
|
11736
12059
|
var CANONICAL_TO_CLAUDE_TOOL_NAMES = {
|
|
11737
12060
|
bash: "Bash",
|
|
@@ -11793,7 +12116,7 @@ var ClaudecodePermissions = class _ClaudecodePermissions extends ToolPermissions
|
|
|
11793
12116
|
validate = true
|
|
11794
12117
|
}) {
|
|
11795
12118
|
const paths = _ClaudecodePermissions.getSettablePaths();
|
|
11796
|
-
const filePath =
|
|
12119
|
+
const filePath = join75(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11797
12120
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"permissions":{}}';
|
|
11798
12121
|
return new _ClaudecodePermissions({
|
|
11799
12122
|
outputRoot,
|
|
@@ -11809,7 +12132,7 @@ var ClaudecodePermissions = class _ClaudecodePermissions extends ToolPermissions
|
|
|
11809
12132
|
logger
|
|
11810
12133
|
}) {
|
|
11811
12134
|
const paths = _ClaudecodePermissions.getSettablePaths();
|
|
11812
|
-
const filePath =
|
|
12135
|
+
const filePath = join75(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11813
12136
|
const existingContent = await readOrInitializeFileContent(
|
|
11814
12137
|
filePath,
|
|
11815
12138
|
JSON.stringify({}, null, 2)
|
|
@@ -11886,7 +12209,7 @@ var ClaudecodePermissions = class _ClaudecodePermissions extends ToolPermissions
|
|
|
11886
12209
|
settings = JSON.parse(this.getFileContent());
|
|
11887
12210
|
} catch (error) {
|
|
11888
12211
|
throw new Error(
|
|
11889
|
-
`Failed to parse Claude permissions content in ${
|
|
12212
|
+
`Failed to parse Claude permissions content in ${join75(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
11890
12213
|
{ cause: error }
|
|
11891
12214
|
);
|
|
11892
12215
|
}
|
|
@@ -11959,7 +12282,7 @@ function convertClaudeToRulesyncPermissions(params) {
|
|
|
11959
12282
|
}
|
|
11960
12283
|
|
|
11961
12284
|
// src/features/permissions/cline-permissions.ts
|
|
11962
|
-
import { join as
|
|
12285
|
+
import { join as join76 } from "path";
|
|
11963
12286
|
import { uniq as uniq5 } from "es-toolkit";
|
|
11964
12287
|
import { z as z32 } from "zod/mini";
|
|
11965
12288
|
var ClineCommandPermissionsSchema = z32.looseObject({
|
|
@@ -11995,7 +12318,7 @@ var ClinePermissions = class _ClinePermissions extends ToolPermissions {
|
|
|
11995
12318
|
global = false
|
|
11996
12319
|
}) {
|
|
11997
12320
|
const paths = _ClinePermissions.getSettablePaths({ global });
|
|
11998
|
-
const filePath =
|
|
12321
|
+
const filePath = join76(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
11999
12322
|
const fileContent = await readFileContentOrNull(filePath) ?? "{}";
|
|
12000
12323
|
return new _ClinePermissions({
|
|
12001
12324
|
outputRoot,
|
|
@@ -12012,7 +12335,7 @@ var ClinePermissions = class _ClinePermissions extends ToolPermissions {
|
|
|
12012
12335
|
logger
|
|
12013
12336
|
}) {
|
|
12014
12337
|
const paths = _ClinePermissions.getSettablePaths({ global });
|
|
12015
|
-
const filePath =
|
|
12338
|
+
const filePath = join76(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
12016
12339
|
const existingContent = await readFileContentOrNull(filePath) ?? "{}";
|
|
12017
12340
|
let existing;
|
|
12018
12341
|
try {
|
|
@@ -12100,7 +12423,7 @@ var ClinePermissions = class _ClinePermissions extends ToolPermissions {
|
|
|
12100
12423
|
parsed = result.data;
|
|
12101
12424
|
} catch (error) {
|
|
12102
12425
|
throw new Error(
|
|
12103
|
-
`Failed to parse Cline permissions content in ${
|
|
12426
|
+
`Failed to parse Cline permissions content in ${join76(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
12104
12427
|
{ cause: error }
|
|
12105
12428
|
);
|
|
12106
12429
|
}
|
|
@@ -12147,7 +12470,7 @@ var ClinePermissions = class _ClinePermissions extends ToolPermissions {
|
|
|
12147
12470
|
};
|
|
12148
12471
|
|
|
12149
12472
|
// src/features/permissions/codexcli-permissions.ts
|
|
12150
|
-
import { isAbsolute as isAbsolute3, join as
|
|
12473
|
+
import { isAbsolute as isAbsolute3, join as join77 } from "path";
|
|
12151
12474
|
import * as smolToml4 from "smol-toml";
|
|
12152
12475
|
var RULESYNC_PROFILE_NAME = "rulesync";
|
|
12153
12476
|
var RULESYNC_BASH_RULES_FILE_NAME = "rulesync.rules";
|
|
@@ -12169,7 +12492,7 @@ var CodexcliPermissions = class _CodexcliPermissions extends ToolPermissions {
|
|
|
12169
12492
|
global = false
|
|
12170
12493
|
}) {
|
|
12171
12494
|
const paths = this.getSettablePaths({ global });
|
|
12172
|
-
const filePath =
|
|
12495
|
+
const filePath = join77(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
12173
12496
|
const fileContent = await readFileContentOrNull(filePath) ?? smolToml4.stringify({});
|
|
12174
12497
|
return new _CodexcliPermissions({
|
|
12175
12498
|
outputRoot,
|
|
@@ -12187,7 +12510,7 @@ var CodexcliPermissions = class _CodexcliPermissions extends ToolPermissions {
|
|
|
12187
12510
|
global = false
|
|
12188
12511
|
}) {
|
|
12189
12512
|
const paths = this.getSettablePaths({ global });
|
|
12190
|
-
const filePath =
|
|
12513
|
+
const filePath = join77(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
12191
12514
|
const existingContent = await readFileContentOrNull(filePath) ?? smolToml4.stringify({});
|
|
12192
12515
|
const parsed = toMutableTable(smolToml4.parse(existingContent));
|
|
12193
12516
|
const profile = convertRulesyncToCodexProfile({
|
|
@@ -12212,7 +12535,7 @@ var CodexcliPermissions = class _CodexcliPermissions extends ToolPermissions {
|
|
|
12212
12535
|
parsed = smolToml4.parse(this.getFileContent());
|
|
12213
12536
|
} catch (error) {
|
|
12214
12537
|
throw new Error(
|
|
12215
|
-
`Failed to parse Codex CLI permissions content in ${
|
|
12538
|
+
`Failed to parse Codex CLI permissions content in ${join77(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
12216
12539
|
{ cause: error }
|
|
12217
12540
|
);
|
|
12218
12541
|
}
|
|
@@ -12253,7 +12576,7 @@ function createCodexcliBashRulesFile({
|
|
|
12253
12576
|
}) {
|
|
12254
12577
|
return new CodexcliRulesFile({
|
|
12255
12578
|
outputRoot,
|
|
12256
|
-
relativeDirPath:
|
|
12579
|
+
relativeDirPath: join77(".codex", "rules"),
|
|
12257
12580
|
relativeFilePath: RULESYNC_BASH_RULES_FILE_NAME,
|
|
12258
12581
|
fileContent: buildCodexBashRulesContent(config)
|
|
12259
12582
|
});
|
|
@@ -12492,7 +12815,7 @@ function mapBashActionToDecision(action) {
|
|
|
12492
12815
|
}
|
|
12493
12816
|
|
|
12494
12817
|
// src/features/permissions/cursor-permissions.ts
|
|
12495
|
-
import { join as
|
|
12818
|
+
import { join as join78 } from "path";
|
|
12496
12819
|
import { uniq as uniq6 } from "es-toolkit";
|
|
12497
12820
|
var CANONICAL_TO_CURSOR_TYPE = {
|
|
12498
12821
|
bash: "Shell",
|
|
@@ -12610,7 +12933,7 @@ var CursorPermissions = class _CursorPermissions extends ToolPermissions {
|
|
|
12610
12933
|
global = false
|
|
12611
12934
|
}) {
|
|
12612
12935
|
const paths = _CursorPermissions.getSettablePaths({ global });
|
|
12613
|
-
const filePath =
|
|
12936
|
+
const filePath = join78(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
12614
12937
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"permissions":{}}';
|
|
12615
12938
|
return new _CursorPermissions({
|
|
12616
12939
|
outputRoot,
|
|
@@ -12627,7 +12950,7 @@ var CursorPermissions = class _CursorPermissions extends ToolPermissions {
|
|
|
12627
12950
|
global = false
|
|
12628
12951
|
}) {
|
|
12629
12952
|
const paths = _CursorPermissions.getSettablePaths({ global });
|
|
12630
|
-
const filePath =
|
|
12953
|
+
const filePath = join78(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
12631
12954
|
const existingContent = await readOrInitializeFileContent(
|
|
12632
12955
|
filePath,
|
|
12633
12956
|
JSON.stringify({}, null, 2)
|
|
@@ -12703,7 +13026,7 @@ var CursorPermissions = class _CursorPermissions extends ToolPermissions {
|
|
|
12703
13026
|
settings = asCursorCliConfig(JSON.parse(this.getFileContent()));
|
|
12704
13027
|
} catch (error) {
|
|
12705
13028
|
throw new Error(
|
|
12706
|
-
`Failed to parse Cursor CLI permissions content in ${
|
|
13029
|
+
`Failed to parse Cursor CLI permissions content in ${join78(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
12707
13030
|
{ cause: error }
|
|
12708
13031
|
);
|
|
12709
13032
|
}
|
|
@@ -12778,10 +13101,10 @@ function convertCursorToRulesyncPermissions(params) {
|
|
|
12778
13101
|
}
|
|
12779
13102
|
|
|
12780
13103
|
// src/features/permissions/geminicli-permissions.ts
|
|
12781
|
-
import { join as
|
|
13104
|
+
import { join as join79 } from "path";
|
|
12782
13105
|
import * as smolToml5 from "smol-toml";
|
|
12783
13106
|
import { z as z33 } from "zod/mini";
|
|
12784
|
-
var GEMINICLI_POLICY_RELATIVE_DIR_PATH =
|
|
13107
|
+
var GEMINICLI_POLICY_RELATIVE_DIR_PATH = join79(".gemini", "policies");
|
|
12785
13108
|
var GEMINICLI_POLICY_FILE_NAME = "rulesync.toml";
|
|
12786
13109
|
var RULESYNC_TO_GEMINICLI_TOOL_NAME = {
|
|
12787
13110
|
bash: "run_shell_command",
|
|
@@ -12822,7 +13145,7 @@ var GeminicliPermissions = class _GeminicliPermissions extends ToolPermissions {
|
|
|
12822
13145
|
global = false
|
|
12823
13146
|
}) {
|
|
12824
13147
|
const paths = this.getSettablePaths({ global });
|
|
12825
|
-
const filePath =
|
|
13148
|
+
const filePath = join79(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
12826
13149
|
const fileContent = await readFileContentOrNull(filePath) ?? "";
|
|
12827
13150
|
return new _GeminicliPermissions({
|
|
12828
13151
|
outputRoot,
|
|
@@ -12858,7 +13181,7 @@ var GeminicliPermissions = class _GeminicliPermissions extends ToolPermissions {
|
|
|
12858
13181
|
parsed = smolToml5.parse(fileContent);
|
|
12859
13182
|
} catch (error) {
|
|
12860
13183
|
throw new Error(
|
|
12861
|
-
`Failed to parse Gemini CLI policy TOML in ${
|
|
13184
|
+
`Failed to parse Gemini CLI policy TOML in ${join79(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
12862
13185
|
{ cause: error }
|
|
12863
13186
|
);
|
|
12864
13187
|
}
|
|
@@ -13150,8 +13473,8 @@ function extractPattern(rule) {
|
|
|
13150
13473
|
}
|
|
13151
13474
|
|
|
13152
13475
|
// src/features/permissions/kilo-permissions.ts
|
|
13153
|
-
import { join as
|
|
13154
|
-
import { parse as
|
|
13476
|
+
import { join as join80 } from "path";
|
|
13477
|
+
import { parse as parseJsonc6, printParseErrorCode as printParseErrorCode2 } from "jsonc-parser";
|
|
13155
13478
|
import { z as z34 } from "zod/mini";
|
|
13156
13479
|
var KiloPermissionSchema = z34.union([
|
|
13157
13480
|
z34.enum(["allow", "ask", "deny"]),
|
|
@@ -13163,11 +13486,11 @@ var KiloPermissionsConfigSchema = z34.looseObject({
|
|
|
13163
13486
|
var KILO_FILE_NAME = "kilo.jsonc";
|
|
13164
13487
|
function parseKiloJsoncStrict(content, filePath) {
|
|
13165
13488
|
const errors = [];
|
|
13166
|
-
const parsed =
|
|
13489
|
+
const parsed = parseJsonc6(content, errors, { allowTrailingComma: true });
|
|
13167
13490
|
const first = errors[0];
|
|
13168
13491
|
if (first) {
|
|
13169
13492
|
throw new Error(
|
|
13170
|
-
`Failed to parse Kilo Code config at ${filePath}: ${
|
|
13493
|
+
`Failed to parse Kilo Code config at ${filePath}: ${printParseErrorCode2(first.error)} at offset ${first.offset}`
|
|
13171
13494
|
);
|
|
13172
13495
|
}
|
|
13173
13496
|
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
@@ -13194,7 +13517,7 @@ var KiloPermissions = class _KiloPermissions extends ToolPermissions {
|
|
|
13194
13517
|
json;
|
|
13195
13518
|
constructor(params) {
|
|
13196
13519
|
super(params);
|
|
13197
|
-
const parsed =
|
|
13520
|
+
const parsed = parseJsonc6(this.fileContent || "{}");
|
|
13198
13521
|
if (params.validate !== false) {
|
|
13199
13522
|
this.json = KiloPermissionsConfigSchema.parse(parsed);
|
|
13200
13523
|
} else {
|
|
@@ -13211,7 +13534,7 @@ var KiloPermissions = class _KiloPermissions extends ToolPermissions {
|
|
|
13211
13534
|
static getSettablePaths({
|
|
13212
13535
|
global = false
|
|
13213
13536
|
} = {}) {
|
|
13214
|
-
return global ? { relativeDirPath:
|
|
13537
|
+
return global ? { relativeDirPath: join80(".config", "kilo"), relativeFilePath: KILO_FILE_NAME } : { relativeDirPath: ".", relativeFilePath: KILO_FILE_NAME };
|
|
13215
13538
|
}
|
|
13216
13539
|
static async fromFile({
|
|
13217
13540
|
outputRoot = process.cwd(),
|
|
@@ -13219,7 +13542,7 @@ var KiloPermissions = class _KiloPermissions extends ToolPermissions {
|
|
|
13219
13542
|
global = false
|
|
13220
13543
|
}) {
|
|
13221
13544
|
const basePaths = _KiloPermissions.getSettablePaths({ global });
|
|
13222
|
-
const filePath =
|
|
13545
|
+
const filePath = join80(outputRoot, basePaths.relativeDirPath, basePaths.relativeFilePath);
|
|
13223
13546
|
const fileContent = await readFileContentOrNull(filePath);
|
|
13224
13547
|
const parsed = parseKiloJsoncStrict(fileContent ?? "{}", filePath);
|
|
13225
13548
|
const nextJson = { ...parsed, permission: parsed.permission ?? {} };
|
|
@@ -13238,7 +13561,7 @@ var KiloPermissions = class _KiloPermissions extends ToolPermissions {
|
|
|
13238
13561
|
logger
|
|
13239
13562
|
}) {
|
|
13240
13563
|
const basePaths = _KiloPermissions.getSettablePaths({ global });
|
|
13241
|
-
const filePath =
|
|
13564
|
+
const filePath = join80(outputRoot, basePaths.relativeDirPath, basePaths.relativeFilePath);
|
|
13242
13565
|
const fileContent = await readFileContentOrNull(filePath);
|
|
13243
13566
|
const parsed = parseKiloJsoncStrict(fileContent ?? "{}", filePath);
|
|
13244
13567
|
const parsedPermission = parsed.permission;
|
|
@@ -13284,7 +13607,7 @@ var KiloPermissions = class _KiloPermissions extends ToolPermissions {
|
|
|
13284
13607
|
}
|
|
13285
13608
|
validate() {
|
|
13286
13609
|
try {
|
|
13287
|
-
const json =
|
|
13610
|
+
const json = parseJsonc6(this.fileContent || "{}");
|
|
13288
13611
|
const result = KiloPermissionsConfigSchema.safeParse(json);
|
|
13289
13612
|
if (!result.success) {
|
|
13290
13613
|
return { success: false, error: result.error };
|
|
@@ -13324,7 +13647,7 @@ var KiloPermissions = class _KiloPermissions extends ToolPermissions {
|
|
|
13324
13647
|
};
|
|
13325
13648
|
|
|
13326
13649
|
// src/features/permissions/kiro-permissions.ts
|
|
13327
|
-
import { join as
|
|
13650
|
+
import { join as join81 } from "path";
|
|
13328
13651
|
import { z as z35 } from "zod/mini";
|
|
13329
13652
|
var KiroAgentSchema = z35.looseObject({
|
|
13330
13653
|
allowedTools: z35.optional(z35.array(z35.string())),
|
|
@@ -13334,7 +13657,7 @@ var UnknownRecordSchema = z35.record(z35.string(), z35.unknown());
|
|
|
13334
13657
|
var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
13335
13658
|
static getSettablePaths(_options = {}) {
|
|
13336
13659
|
return {
|
|
13337
|
-
relativeDirPath:
|
|
13660
|
+
relativeDirPath: join81(".kiro", "agents"),
|
|
13338
13661
|
relativeFilePath: "default.json"
|
|
13339
13662
|
};
|
|
13340
13663
|
}
|
|
@@ -13346,7 +13669,7 @@ var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
|
13346
13669
|
validate = true
|
|
13347
13670
|
}) {
|
|
13348
13671
|
const paths = this.getSettablePaths();
|
|
13349
|
-
const filePath =
|
|
13672
|
+
const filePath = join81(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
13350
13673
|
const fileContent = await readFileContentOrNull(filePath) ?? JSON.stringify({}, null, 2);
|
|
13351
13674
|
return new _KiroPermissions({
|
|
13352
13675
|
outputRoot,
|
|
@@ -13363,7 +13686,7 @@ var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
|
13363
13686
|
logger
|
|
13364
13687
|
}) {
|
|
13365
13688
|
const paths = this.getSettablePaths();
|
|
13366
|
-
const filePath =
|
|
13689
|
+
const filePath = join81(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
13367
13690
|
const existingContent = await readFileContentOrNull(filePath) ?? JSON.stringify({}, null, 2);
|
|
13368
13691
|
const parsedResult = KiroAgentSchema.safeParse(JSON.parse(existingContent));
|
|
13369
13692
|
if (!parsedResult.success) {
|
|
@@ -13387,7 +13710,7 @@ var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
|
13387
13710
|
parsed = KiroAgentSchema.parse(JSON.parse(this.getFileContent()));
|
|
13388
13711
|
} catch (error) {
|
|
13389
13712
|
throw new Error(
|
|
13390
|
-
`Failed to parse Kiro permissions content in ${
|
|
13713
|
+
`Failed to parse Kiro permissions content in ${join81(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
13391
13714
|
{ cause: error }
|
|
13392
13715
|
);
|
|
13393
13716
|
}
|
|
@@ -13512,8 +13835,8 @@ function asStringArray(value) {
|
|
|
13512
13835
|
}
|
|
13513
13836
|
|
|
13514
13837
|
// src/features/permissions/opencode-permissions.ts
|
|
13515
|
-
import { join as
|
|
13516
|
-
import { parse as
|
|
13838
|
+
import { join as join82 } from "path";
|
|
13839
|
+
import { parse as parseJsonc7 } from "jsonc-parser";
|
|
13517
13840
|
import { z as z36 } from "zod/mini";
|
|
13518
13841
|
var OpencodePermissionSchema = z36.union([
|
|
13519
13842
|
z36.enum(["allow", "ask", "deny"]),
|
|
@@ -13526,7 +13849,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13526
13849
|
json;
|
|
13527
13850
|
constructor(params) {
|
|
13528
13851
|
super(params);
|
|
13529
|
-
this.json = OpencodePermissionsConfigSchema.parse(
|
|
13852
|
+
this.json = OpencodePermissionsConfigSchema.parse(parseJsonc7(this.fileContent || "{}"));
|
|
13530
13853
|
}
|
|
13531
13854
|
getJson() {
|
|
13532
13855
|
return this.json;
|
|
@@ -13537,7 +13860,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13537
13860
|
static getSettablePaths({
|
|
13538
13861
|
global = false
|
|
13539
13862
|
} = {}) {
|
|
13540
|
-
return global ? { relativeDirPath:
|
|
13863
|
+
return global ? { relativeDirPath: join82(".config", "opencode"), relativeFilePath: "opencode.json" } : { relativeDirPath: ".", relativeFilePath: "opencode.json" };
|
|
13541
13864
|
}
|
|
13542
13865
|
static async fromFile({
|
|
13543
13866
|
outputRoot = process.cwd(),
|
|
@@ -13545,9 +13868,9 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13545
13868
|
global = false
|
|
13546
13869
|
}) {
|
|
13547
13870
|
const basePaths = _OpencodePermissions.getSettablePaths({ global });
|
|
13548
|
-
const jsonDir =
|
|
13549
|
-
const jsoncPath =
|
|
13550
|
-
const jsonPath =
|
|
13871
|
+
const jsonDir = join82(outputRoot, basePaths.relativeDirPath);
|
|
13872
|
+
const jsoncPath = join82(jsonDir, "opencode.jsonc");
|
|
13873
|
+
const jsonPath = join82(jsonDir, "opencode.json");
|
|
13551
13874
|
let fileContent = await readFileContentOrNull(jsoncPath);
|
|
13552
13875
|
let relativeFilePath = "opencode.jsonc";
|
|
13553
13876
|
if (!fileContent) {
|
|
@@ -13556,7 +13879,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13556
13879
|
relativeFilePath = "opencode.json";
|
|
13557
13880
|
}
|
|
13558
13881
|
}
|
|
13559
|
-
const parsed =
|
|
13882
|
+
const parsed = parseJsonc7(fileContent ?? "{}");
|
|
13560
13883
|
const nextJson = { ...parsed, permission: parsed.permission ?? {} };
|
|
13561
13884
|
return new _OpencodePermissions({
|
|
13562
13885
|
outputRoot,
|
|
@@ -13572,9 +13895,9 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13572
13895
|
global = false
|
|
13573
13896
|
}) {
|
|
13574
13897
|
const basePaths = _OpencodePermissions.getSettablePaths({ global });
|
|
13575
|
-
const jsonDir =
|
|
13576
|
-
const jsoncPath =
|
|
13577
|
-
const jsonPath =
|
|
13898
|
+
const jsonDir = join82(outputRoot, basePaths.relativeDirPath);
|
|
13899
|
+
const jsoncPath = join82(jsonDir, "opencode.jsonc");
|
|
13900
|
+
const jsonPath = join82(jsonDir, "opencode.json");
|
|
13578
13901
|
let fileContent = await readFileContentOrNull(jsoncPath);
|
|
13579
13902
|
let relativeFilePath = "opencode.jsonc";
|
|
13580
13903
|
if (!fileContent) {
|
|
@@ -13583,7 +13906,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13583
13906
|
relativeFilePath = "opencode.json";
|
|
13584
13907
|
}
|
|
13585
13908
|
}
|
|
13586
|
-
const parsed =
|
|
13909
|
+
const parsed = parseJsonc7(fileContent ?? "{}");
|
|
13587
13910
|
const nextJson = {
|
|
13588
13911
|
...parsed,
|
|
13589
13912
|
permission: rulesyncPermissions.getJson().permission
|
|
@@ -13644,7 +13967,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
13644
13967
|
};
|
|
13645
13968
|
|
|
13646
13969
|
// src/features/permissions/qwencode-permissions.ts
|
|
13647
|
-
import { join as
|
|
13970
|
+
import { join as join83 } from "path";
|
|
13648
13971
|
import { uniq as uniq7 } from "es-toolkit";
|
|
13649
13972
|
import { z as z37 } from "zod/mini";
|
|
13650
13973
|
var QwenSettingsPermissionsSchema = z37.looseObject({
|
|
@@ -13732,7 +14055,7 @@ var QwencodePermissions = class _QwencodePermissions extends ToolPermissions {
|
|
|
13732
14055
|
global = false
|
|
13733
14056
|
}) {
|
|
13734
14057
|
const paths = _QwencodePermissions.getSettablePaths({ global });
|
|
13735
|
-
const filePath =
|
|
14058
|
+
const filePath = join83(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
13736
14059
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"permissions":{}}';
|
|
13737
14060
|
return new _QwencodePermissions({
|
|
13738
14061
|
outputRoot,
|
|
@@ -13749,7 +14072,7 @@ var QwencodePermissions = class _QwencodePermissions extends ToolPermissions {
|
|
|
13749
14072
|
logger
|
|
13750
14073
|
}) {
|
|
13751
14074
|
const paths = _QwencodePermissions.getSettablePaths({ global });
|
|
13752
|
-
const filePath =
|
|
14075
|
+
const filePath = join83(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
13753
14076
|
const existingContent = await readFileContentOrNull(filePath) ?? "{}";
|
|
13754
14077
|
let settings;
|
|
13755
14078
|
try {
|
|
@@ -13822,7 +14145,7 @@ var QwencodePermissions = class _QwencodePermissions extends ToolPermissions {
|
|
|
13822
14145
|
settings = result.data;
|
|
13823
14146
|
} catch (error) {
|
|
13824
14147
|
throw new Error(
|
|
13825
|
-
`Failed to parse Qwen permissions content in ${
|
|
14148
|
+
`Failed to parse Qwen permissions content in ${join83(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
13826
14149
|
{ cause: error }
|
|
13827
14150
|
);
|
|
13828
14151
|
}
|
|
@@ -14165,7 +14488,7 @@ var PermissionsProcessor = class extends FeatureProcessor {
|
|
|
14165
14488
|
};
|
|
14166
14489
|
|
|
14167
14490
|
// src/features/rules/rules-processor.ts
|
|
14168
|
-
import { basename as basename11, dirname as dirname3, join as
|
|
14491
|
+
import { basename as basename11, dirname as dirname3, join as join165, relative as relative6 } from "path";
|
|
14169
14492
|
import { encode } from "@toon-format/toon";
|
|
14170
14493
|
import { z as z82 } from "zod/mini";
|
|
14171
14494
|
|
|
@@ -14173,17 +14496,17 @@ import { z as z82 } from "zod/mini";
|
|
|
14173
14496
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
14174
14497
|
|
|
14175
14498
|
// src/features/skills/agentsmd-skill.ts
|
|
14176
|
-
import { join as
|
|
14499
|
+
import { join as join87 } from "path";
|
|
14177
14500
|
|
|
14178
14501
|
// src/features/skills/simulated-skill.ts
|
|
14179
|
-
import { join as
|
|
14502
|
+
import { join as join86 } from "path";
|
|
14180
14503
|
import { z as z39 } from "zod/mini";
|
|
14181
14504
|
|
|
14182
14505
|
// src/features/skills/tool-skill.ts
|
|
14183
|
-
import { join as
|
|
14506
|
+
import { join as join85 } from "path";
|
|
14184
14507
|
|
|
14185
14508
|
// src/types/ai-dir.ts
|
|
14186
|
-
import path2, { basename as basename4, join as
|
|
14509
|
+
import path2, { basename as basename4, join as join84, relative as relative4, resolve as resolve5 } from "path";
|
|
14187
14510
|
var AiDir = class {
|
|
14188
14511
|
/**
|
|
14189
14512
|
* @example "."
|
|
@@ -14280,8 +14603,8 @@ var AiDir = class {
|
|
|
14280
14603
|
* @returns Array of files with their relative paths and buffers
|
|
14281
14604
|
*/
|
|
14282
14605
|
static async collectOtherFiles(outputRoot, relativeDirPath, dirName, excludeFileName) {
|
|
14283
|
-
const dirPath =
|
|
14284
|
-
const glob =
|
|
14606
|
+
const dirPath = join84(outputRoot, relativeDirPath, dirName);
|
|
14607
|
+
const glob = join84(dirPath, "**", "*");
|
|
14285
14608
|
const filePaths = await findFilesByGlobs(glob, { type: "file" });
|
|
14286
14609
|
const filteredPaths = filePaths.filter((filePath) => basename4(filePath) !== excludeFileName);
|
|
14287
14610
|
const files = await Promise.all(
|
|
@@ -14382,8 +14705,8 @@ var ToolSkill = class extends AiDir {
|
|
|
14382
14705
|
}) {
|
|
14383
14706
|
const settablePaths = getSettablePaths({ global });
|
|
14384
14707
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
14385
|
-
const skillDirPath =
|
|
14386
|
-
const skillFilePath =
|
|
14708
|
+
const skillDirPath = join85(outputRoot, actualRelativeDirPath, dirName);
|
|
14709
|
+
const skillFilePath = join85(skillDirPath, SKILL_FILE_NAME);
|
|
14387
14710
|
if (!await fileExists(skillFilePath)) {
|
|
14388
14711
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
14389
14712
|
}
|
|
@@ -14407,7 +14730,7 @@ var ToolSkill = class extends AiDir {
|
|
|
14407
14730
|
}
|
|
14408
14731
|
requireMainFileFrontmatter() {
|
|
14409
14732
|
if (!this.mainFile?.frontmatter) {
|
|
14410
|
-
throw new Error(`Frontmatter is not defined in ${
|
|
14733
|
+
throw new Error(`Frontmatter is not defined in ${join85(this.relativeDirPath, this.dirName)}`);
|
|
14411
14734
|
}
|
|
14412
14735
|
return this.mainFile.frontmatter;
|
|
14413
14736
|
}
|
|
@@ -14447,7 +14770,7 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
14447
14770
|
const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
|
|
14448
14771
|
if (!result.success) {
|
|
14449
14772
|
throw new Error(
|
|
14450
|
-
`Invalid frontmatter in ${
|
|
14773
|
+
`Invalid frontmatter in ${join86(relativeDirPath, dirName)}: ${formatError(result.error)}`
|
|
14451
14774
|
);
|
|
14452
14775
|
}
|
|
14453
14776
|
}
|
|
@@ -14506,8 +14829,8 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
14506
14829
|
}) {
|
|
14507
14830
|
const settablePaths = this.getSettablePaths();
|
|
14508
14831
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
14509
|
-
const skillDirPath =
|
|
14510
|
-
const skillFilePath =
|
|
14832
|
+
const skillDirPath = join86(outputRoot, actualRelativeDirPath, dirName);
|
|
14833
|
+
const skillFilePath = join86(skillDirPath, SKILL_FILE_NAME);
|
|
14511
14834
|
if (!await fileExists(skillFilePath)) {
|
|
14512
14835
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
14513
14836
|
}
|
|
@@ -14584,7 +14907,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
14584
14907
|
throw new Error("AgentsmdSkill does not support global mode.");
|
|
14585
14908
|
}
|
|
14586
14909
|
return {
|
|
14587
|
-
relativeDirPath:
|
|
14910
|
+
relativeDirPath: join87(".agents", "skills")
|
|
14588
14911
|
};
|
|
14589
14912
|
}
|
|
14590
14913
|
static async fromDir(params) {
|
|
@@ -14611,11 +14934,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
14611
14934
|
};
|
|
14612
14935
|
|
|
14613
14936
|
// src/features/skills/factorydroid-skill.ts
|
|
14614
|
-
import { join as
|
|
14937
|
+
import { join as join88 } from "path";
|
|
14615
14938
|
var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
14616
14939
|
static getSettablePaths(_options) {
|
|
14617
14940
|
return {
|
|
14618
|
-
relativeDirPath:
|
|
14941
|
+
relativeDirPath: join88(".factory", "skills")
|
|
14619
14942
|
};
|
|
14620
14943
|
}
|
|
14621
14944
|
static async fromDir(params) {
|
|
@@ -14642,11 +14965,11 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
|
14642
14965
|
};
|
|
14643
14966
|
|
|
14644
14967
|
// src/features/skills/rovodev-skill.ts
|
|
14645
|
-
import { join as
|
|
14968
|
+
import { join as join90 } from "path";
|
|
14646
14969
|
import { z as z41 } from "zod/mini";
|
|
14647
14970
|
|
|
14648
14971
|
// src/features/skills/rulesync-skill.ts
|
|
14649
|
-
import { join as
|
|
14972
|
+
import { join as join89 } from "path";
|
|
14650
14973
|
import { z as z40 } from "zod/mini";
|
|
14651
14974
|
var RulesyncSkillFrontmatterSchemaInternal = z40.looseObject({
|
|
14652
14975
|
name: z40.string(),
|
|
@@ -14686,6 +15009,23 @@ var RulesyncSkillFrontmatterSchemaInternal = z40.looseObject({
|
|
|
14686
15009
|
license: z40.optional(z40.string())
|
|
14687
15010
|
})
|
|
14688
15011
|
),
|
|
15012
|
+
pi: z40.optional(
|
|
15013
|
+
z40.looseObject({
|
|
15014
|
+
"allowed-tools": z40.optional(z40.array(z40.string())),
|
|
15015
|
+
"disable-model-invocation": z40.optional(z40.boolean()),
|
|
15016
|
+
license: z40.optional(z40.string()),
|
|
15017
|
+
compatibility: z40.optional(z40.looseObject({})),
|
|
15018
|
+
metadata: z40.optional(z40.looseObject({}))
|
|
15019
|
+
})
|
|
15020
|
+
),
|
|
15021
|
+
replit: z40.optional(
|
|
15022
|
+
z40.looseObject({
|
|
15023
|
+
"allowed-tools": z40.optional(z40.array(z40.string())),
|
|
15024
|
+
license: z40.optional(z40.string()),
|
|
15025
|
+
compatibility: z40.optional(z40.looseObject({})),
|
|
15026
|
+
metadata: z40.optional(z40.looseObject({}))
|
|
15027
|
+
})
|
|
15028
|
+
),
|
|
14689
15029
|
cline: z40.optional(z40.looseObject({})),
|
|
14690
15030
|
roo: z40.optional(z40.looseObject({})),
|
|
14691
15031
|
takt: z40.optional(
|
|
@@ -14733,7 +15073,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
14733
15073
|
}
|
|
14734
15074
|
getFrontmatter() {
|
|
14735
15075
|
if (!this.mainFile?.frontmatter) {
|
|
14736
|
-
throw new Error(`Frontmatter is not defined in ${
|
|
15076
|
+
throw new Error(`Frontmatter is not defined in ${join89(this.relativeDirPath, this.dirName)}`);
|
|
14737
15077
|
}
|
|
14738
15078
|
const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
|
|
14739
15079
|
return result;
|
|
@@ -14759,8 +15099,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
14759
15099
|
dirName,
|
|
14760
15100
|
global = false
|
|
14761
15101
|
}) {
|
|
14762
|
-
const skillDirPath =
|
|
14763
|
-
const skillFilePath =
|
|
15102
|
+
const skillDirPath = join89(outputRoot, relativeDirPath, dirName);
|
|
15103
|
+
const skillFilePath = join89(skillDirPath, SKILL_FILE_NAME);
|
|
14764
15104
|
if (!await fileExists(skillFilePath)) {
|
|
14765
15105
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
14766
15106
|
}
|
|
@@ -14797,7 +15137,7 @@ var RovodevSkillFrontmatterSchema = z41.looseObject({
|
|
|
14797
15137
|
var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
14798
15138
|
constructor({
|
|
14799
15139
|
outputRoot = process.cwd(),
|
|
14800
|
-
relativeDirPath =
|
|
15140
|
+
relativeDirPath = join90(".rovodev", "skills"),
|
|
14801
15141
|
dirName,
|
|
14802
15142
|
frontmatter,
|
|
14803
15143
|
body,
|
|
@@ -14826,8 +15166,8 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
14826
15166
|
}
|
|
14827
15167
|
static getSettablePaths(_options) {
|
|
14828
15168
|
return {
|
|
14829
|
-
relativeDirPath:
|
|
14830
|
-
alternativeSkillRoots: [
|
|
15169
|
+
relativeDirPath: join90(".rovodev", "skills"),
|
|
15170
|
+
alternativeSkillRoots: [join90(".agents", "skills")]
|
|
14831
15171
|
};
|
|
14832
15172
|
}
|
|
14833
15173
|
getFrontmatter() {
|
|
@@ -14915,13 +15255,13 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
14915
15255
|
});
|
|
14916
15256
|
const result = RovodevSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
14917
15257
|
if (!result.success) {
|
|
14918
|
-
const skillDirPath =
|
|
15258
|
+
const skillDirPath = join90(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
14919
15259
|
throw new Error(
|
|
14920
|
-
`Invalid frontmatter in ${
|
|
15260
|
+
`Invalid frontmatter in ${join90(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
14921
15261
|
);
|
|
14922
15262
|
}
|
|
14923
15263
|
if (result.data.name !== loaded.dirName) {
|
|
14924
|
-
const skillFilePath =
|
|
15264
|
+
const skillFilePath = join90(
|
|
14925
15265
|
loaded.outputRoot,
|
|
14926
15266
|
loaded.relativeDirPath,
|
|
14927
15267
|
loaded.dirName,
|
|
@@ -14963,11 +15303,11 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
14963
15303
|
};
|
|
14964
15304
|
|
|
14965
15305
|
// src/features/skills/skills-processor.ts
|
|
14966
|
-
import { basename as basename6, join as
|
|
15306
|
+
import { basename as basename6, join as join113 } from "path";
|
|
14967
15307
|
import { z as z60 } from "zod/mini";
|
|
14968
15308
|
|
|
14969
15309
|
// src/types/dir-feature-processor.ts
|
|
14970
|
-
import { join as
|
|
15310
|
+
import { join as join91 } from "path";
|
|
14971
15311
|
var DirFeatureProcessor = class {
|
|
14972
15312
|
outputRoot;
|
|
14973
15313
|
inputRoot;
|
|
@@ -15010,7 +15350,7 @@ var DirFeatureProcessor = class {
|
|
|
15010
15350
|
const mainFile = aiDir.getMainFile();
|
|
15011
15351
|
let mainFileContent;
|
|
15012
15352
|
if (mainFile) {
|
|
15013
|
-
const mainFilePath =
|
|
15353
|
+
const mainFilePath = join91(dirPath, mainFile.name);
|
|
15014
15354
|
const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter, {
|
|
15015
15355
|
avoidBlockScalars: this.avoidBlockScalars
|
|
15016
15356
|
});
|
|
@@ -15030,7 +15370,7 @@ var DirFeatureProcessor = class {
|
|
|
15030
15370
|
const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
|
|
15031
15371
|
otherFileContents.push(contentWithNewline);
|
|
15032
15372
|
if (!dirHasChanges) {
|
|
15033
|
-
const filePath =
|
|
15373
|
+
const filePath = join91(dirPath, file.relativeFilePathToDirPath);
|
|
15034
15374
|
const existingContent = await readFileContentOrNull(filePath);
|
|
15035
15375
|
if (!fileContentsEquivalent({
|
|
15036
15376
|
filePath,
|
|
@@ -15048,24 +15388,24 @@ var DirFeatureProcessor = class {
|
|
|
15048
15388
|
if (this.dryRun) {
|
|
15049
15389
|
this.logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
|
|
15050
15390
|
if (mainFile) {
|
|
15051
|
-
this.logger.info(`[DRY RUN] Would write: ${
|
|
15052
|
-
changedPaths.push(
|
|
15391
|
+
this.logger.info(`[DRY RUN] Would write: ${join91(dirPath, mainFile.name)}`);
|
|
15392
|
+
changedPaths.push(join91(relativeDir, mainFile.name));
|
|
15053
15393
|
}
|
|
15054
15394
|
for (const file of otherFiles) {
|
|
15055
15395
|
this.logger.info(
|
|
15056
|
-
`[DRY RUN] Would write: ${
|
|
15396
|
+
`[DRY RUN] Would write: ${join91(dirPath, file.relativeFilePathToDirPath)}`
|
|
15057
15397
|
);
|
|
15058
|
-
changedPaths.push(
|
|
15398
|
+
changedPaths.push(join91(relativeDir, file.relativeFilePathToDirPath));
|
|
15059
15399
|
}
|
|
15060
15400
|
} else {
|
|
15061
15401
|
await ensureDir(dirPath);
|
|
15062
15402
|
if (mainFile && mainFileContent) {
|
|
15063
|
-
const mainFilePath =
|
|
15403
|
+
const mainFilePath = join91(dirPath, mainFile.name);
|
|
15064
15404
|
await writeFileContent(mainFilePath, mainFileContent);
|
|
15065
|
-
changedPaths.push(
|
|
15405
|
+
changedPaths.push(join91(relativeDir, mainFile.name));
|
|
15066
15406
|
}
|
|
15067
15407
|
for (const [i, file] of otherFiles.entries()) {
|
|
15068
|
-
const filePath =
|
|
15408
|
+
const filePath = join91(dirPath, file.relativeFilePathToDirPath);
|
|
15069
15409
|
const content = otherFileContents[i];
|
|
15070
15410
|
if (content === void 0) {
|
|
15071
15411
|
throw new Error(
|
|
@@ -15073,7 +15413,7 @@ var DirFeatureProcessor = class {
|
|
|
15073
15413
|
);
|
|
15074
15414
|
}
|
|
15075
15415
|
await writeFileContent(filePath, content);
|
|
15076
|
-
changedPaths.push(
|
|
15416
|
+
changedPaths.push(join91(relativeDir, file.relativeFilePathToDirPath));
|
|
15077
15417
|
}
|
|
15078
15418
|
}
|
|
15079
15419
|
changedCount++;
|
|
@@ -15105,7 +15445,7 @@ var DirFeatureProcessor = class {
|
|
|
15105
15445
|
};
|
|
15106
15446
|
|
|
15107
15447
|
// src/features/skills/agentsskills-skill.ts
|
|
15108
|
-
import { join as
|
|
15448
|
+
import { join as join92 } from "path";
|
|
15109
15449
|
import { z as z42 } from "zod/mini";
|
|
15110
15450
|
var AgentsSkillsSkillFrontmatterSchema = z42.looseObject({
|
|
15111
15451
|
name: z42.string(),
|
|
@@ -15114,7 +15454,7 @@ var AgentsSkillsSkillFrontmatterSchema = z42.looseObject({
|
|
|
15114
15454
|
var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
15115
15455
|
constructor({
|
|
15116
15456
|
outputRoot = process.cwd(),
|
|
15117
|
-
relativeDirPath =
|
|
15457
|
+
relativeDirPath = join92(".agents", "skills"),
|
|
15118
15458
|
dirName,
|
|
15119
15459
|
frontmatter,
|
|
15120
15460
|
body,
|
|
@@ -15146,7 +15486,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
15146
15486
|
throw new Error("AgentsSkillsSkill does not support global mode.");
|
|
15147
15487
|
}
|
|
15148
15488
|
return {
|
|
15149
|
-
relativeDirPath:
|
|
15489
|
+
relativeDirPath: join92(".agents", "skills")
|
|
15150
15490
|
};
|
|
15151
15491
|
}
|
|
15152
15492
|
getFrontmatter() {
|
|
@@ -15226,9 +15566,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
15226
15566
|
});
|
|
15227
15567
|
const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
15228
15568
|
if (!result.success) {
|
|
15229
|
-
const skillDirPath =
|
|
15569
|
+
const skillDirPath = join92(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
15230
15570
|
throw new Error(
|
|
15231
|
-
`Invalid frontmatter in ${
|
|
15571
|
+
`Invalid frontmatter in ${join92(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
15232
15572
|
);
|
|
15233
15573
|
}
|
|
15234
15574
|
return new _AgentsSkillsSkill({
|
|
@@ -15263,10 +15603,10 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
15263
15603
|
};
|
|
15264
15604
|
|
|
15265
15605
|
// src/features/skills/antigravity-shared-skill.ts
|
|
15266
|
-
import { join as
|
|
15606
|
+
import { join as join94 } from "path";
|
|
15267
15607
|
|
|
15268
15608
|
// src/features/skills/antigravity-skill.ts
|
|
15269
|
-
import { join as
|
|
15609
|
+
import { join as join93 } from "path";
|
|
15270
15610
|
import { z as z43 } from "zod/mini";
|
|
15271
15611
|
var AntigravitySkillFrontmatterSchema = z43.looseObject({
|
|
15272
15612
|
name: z43.string(),
|
|
@@ -15275,7 +15615,7 @@ var AntigravitySkillFrontmatterSchema = z43.looseObject({
|
|
|
15275
15615
|
var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
15276
15616
|
constructor({
|
|
15277
15617
|
outputRoot = process.cwd(),
|
|
15278
|
-
relativeDirPath =
|
|
15618
|
+
relativeDirPath = join93(".agent", "skills"),
|
|
15279
15619
|
dirName,
|
|
15280
15620
|
frontmatter,
|
|
15281
15621
|
body,
|
|
@@ -15307,11 +15647,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
15307
15647
|
} = {}) {
|
|
15308
15648
|
if (global) {
|
|
15309
15649
|
return {
|
|
15310
|
-
relativeDirPath:
|
|
15650
|
+
relativeDirPath: join93(".gemini", "antigravity", "skills")
|
|
15311
15651
|
};
|
|
15312
15652
|
}
|
|
15313
15653
|
return {
|
|
15314
|
-
relativeDirPath:
|
|
15654
|
+
relativeDirPath: join93(".agent", "skills")
|
|
15315
15655
|
};
|
|
15316
15656
|
}
|
|
15317
15657
|
getFrontmatter() {
|
|
@@ -15391,9 +15731,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
15391
15731
|
});
|
|
15392
15732
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
15393
15733
|
if (!result.success) {
|
|
15394
|
-
const skillDirPath =
|
|
15734
|
+
const skillDirPath = join93(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
15395
15735
|
throw new Error(
|
|
15396
|
-
`Invalid frontmatter in ${
|
|
15736
|
+
`Invalid frontmatter in ${join93(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
15397
15737
|
);
|
|
15398
15738
|
}
|
|
15399
15739
|
return new _AntigravitySkill({
|
|
@@ -15430,7 +15770,7 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
15430
15770
|
var AntigravitySharedSkill = class extends ToolSkill {
|
|
15431
15771
|
constructor({
|
|
15432
15772
|
outputRoot = process.cwd(),
|
|
15433
|
-
relativeDirPath =
|
|
15773
|
+
relativeDirPath = join94(".agents", "skills"),
|
|
15434
15774
|
dirName,
|
|
15435
15775
|
frontmatter,
|
|
15436
15776
|
body,
|
|
@@ -15470,11 +15810,11 @@ var AntigravitySharedSkill = class extends ToolSkill {
|
|
|
15470
15810
|
} = {}) {
|
|
15471
15811
|
if (global) {
|
|
15472
15812
|
return {
|
|
15473
|
-
relativeDirPath:
|
|
15813
|
+
relativeDirPath: join94(".gemini", this.getGlobalSubdir(), "skills")
|
|
15474
15814
|
};
|
|
15475
15815
|
}
|
|
15476
15816
|
return {
|
|
15477
|
-
relativeDirPath:
|
|
15817
|
+
relativeDirPath: join94(".agents", "skills")
|
|
15478
15818
|
};
|
|
15479
15819
|
}
|
|
15480
15820
|
getFrontmatter() {
|
|
@@ -15554,9 +15894,9 @@ var AntigravitySharedSkill = class extends ToolSkill {
|
|
|
15554
15894
|
});
|
|
15555
15895
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
15556
15896
|
if (!result.success) {
|
|
15557
|
-
const skillDirPath =
|
|
15897
|
+
const skillDirPath = join94(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
15558
15898
|
throw new Error(
|
|
15559
|
-
`Invalid frontmatter in ${
|
|
15899
|
+
`Invalid frontmatter in ${join94(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
15560
15900
|
);
|
|
15561
15901
|
}
|
|
15562
15902
|
return new this({
|
|
@@ -15610,10 +15950,10 @@ var AntigravityIdeSkill = class extends AntigravitySharedSkill {
|
|
|
15610
15950
|
};
|
|
15611
15951
|
|
|
15612
15952
|
// src/features/skills/claudecode-skill.ts
|
|
15613
|
-
import { join as
|
|
15953
|
+
import { join as join95 } from "path";
|
|
15614
15954
|
import { z as z44 } from "zod/mini";
|
|
15615
|
-
var CLAUDE_SKILLS_DIR_PATH =
|
|
15616
|
-
var CLAUDE_SCHEDULED_TASKS_DIR_PATH =
|
|
15955
|
+
var CLAUDE_SKILLS_DIR_PATH = join95(".claude", "skills");
|
|
15956
|
+
var CLAUDE_SCHEDULED_TASKS_DIR_PATH = join95(".claude", "scheduled-tasks");
|
|
15617
15957
|
var ClaudecodeSkillFrontmatterSchema = z44.looseObject({
|
|
15618
15958
|
name: z44.string(),
|
|
15619
15959
|
description: z44.string(),
|
|
@@ -15625,7 +15965,7 @@ var ClaudecodeSkillFrontmatterSchema = z44.looseObject({
|
|
|
15625
15965
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
15626
15966
|
constructor({
|
|
15627
15967
|
outputRoot = process.cwd(),
|
|
15628
|
-
relativeDirPath =
|
|
15968
|
+
relativeDirPath = join95(".claude", "skills"),
|
|
15629
15969
|
dirName,
|
|
15630
15970
|
frontmatter,
|
|
15631
15971
|
body,
|
|
@@ -15764,9 +16104,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
15764
16104
|
});
|
|
15765
16105
|
const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
15766
16106
|
if (!result.success) {
|
|
15767
|
-
const skillDirPath =
|
|
16107
|
+
const skillDirPath = join95(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
15768
16108
|
throw new Error(
|
|
15769
|
-
`Invalid frontmatter in ${
|
|
16109
|
+
`Invalid frontmatter in ${join95(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
15770
16110
|
);
|
|
15771
16111
|
}
|
|
15772
16112
|
return new _ClaudecodeSkill({
|
|
@@ -15800,7 +16140,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
15800
16140
|
};
|
|
15801
16141
|
|
|
15802
16142
|
// src/features/skills/cline-skill.ts
|
|
15803
|
-
import { join as
|
|
16143
|
+
import { join as join96 } from "path";
|
|
15804
16144
|
import { z as z45 } from "zod/mini";
|
|
15805
16145
|
var ClineSkillFrontmatterSchema = z45.looseObject({
|
|
15806
16146
|
name: z45.string(),
|
|
@@ -15809,7 +16149,7 @@ var ClineSkillFrontmatterSchema = z45.looseObject({
|
|
|
15809
16149
|
var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
15810
16150
|
constructor({
|
|
15811
16151
|
outputRoot = process.cwd(),
|
|
15812
|
-
relativeDirPath =
|
|
16152
|
+
relativeDirPath = join96(".cline", "skills"),
|
|
15813
16153
|
dirName,
|
|
15814
16154
|
frontmatter,
|
|
15815
16155
|
body,
|
|
@@ -15838,7 +16178,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
15838
16178
|
}
|
|
15839
16179
|
static getSettablePaths(_options = {}) {
|
|
15840
16180
|
return {
|
|
15841
|
-
relativeDirPath:
|
|
16181
|
+
relativeDirPath: join96(".cline", "skills")
|
|
15842
16182
|
};
|
|
15843
16183
|
}
|
|
15844
16184
|
getFrontmatter() {
|
|
@@ -15926,13 +16266,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
15926
16266
|
});
|
|
15927
16267
|
const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
15928
16268
|
if (!result.success) {
|
|
15929
|
-
const skillDirPath =
|
|
16269
|
+
const skillDirPath = join96(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
15930
16270
|
throw new Error(
|
|
15931
|
-
`Invalid frontmatter in ${
|
|
16271
|
+
`Invalid frontmatter in ${join96(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
15932
16272
|
);
|
|
15933
16273
|
}
|
|
15934
16274
|
if (result.data.name !== loaded.dirName) {
|
|
15935
|
-
const skillFilePath =
|
|
16275
|
+
const skillFilePath = join96(
|
|
15936
16276
|
loaded.outputRoot,
|
|
15937
16277
|
loaded.relativeDirPath,
|
|
15938
16278
|
loaded.dirName,
|
|
@@ -15973,7 +16313,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
15973
16313
|
};
|
|
15974
16314
|
|
|
15975
16315
|
// src/features/skills/codexcli-skill.ts
|
|
15976
|
-
import { join as
|
|
16316
|
+
import { join as join97 } from "path";
|
|
15977
16317
|
import { z as z46 } from "zod/mini";
|
|
15978
16318
|
var CodexCliSkillFrontmatterSchema = z46.looseObject({
|
|
15979
16319
|
name: z46.string(),
|
|
@@ -15987,7 +16327,7 @@ var CodexCliSkillFrontmatterSchema = z46.looseObject({
|
|
|
15987
16327
|
var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
15988
16328
|
constructor({
|
|
15989
16329
|
outputRoot = process.cwd(),
|
|
15990
|
-
relativeDirPath =
|
|
16330
|
+
relativeDirPath = join97(".codex", "skills"),
|
|
15991
16331
|
dirName,
|
|
15992
16332
|
frontmatter,
|
|
15993
16333
|
body,
|
|
@@ -16018,7 +16358,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
16018
16358
|
global: _global = false
|
|
16019
16359
|
} = {}) {
|
|
16020
16360
|
return {
|
|
16021
|
-
relativeDirPath:
|
|
16361
|
+
relativeDirPath: join97(".codex", "skills")
|
|
16022
16362
|
};
|
|
16023
16363
|
}
|
|
16024
16364
|
getFrontmatter() {
|
|
@@ -16108,9 +16448,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
16108
16448
|
});
|
|
16109
16449
|
const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
16110
16450
|
if (!result.success) {
|
|
16111
|
-
const skillDirPath =
|
|
16451
|
+
const skillDirPath = join97(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
16112
16452
|
throw new Error(
|
|
16113
|
-
`Invalid frontmatter in ${
|
|
16453
|
+
`Invalid frontmatter in ${join97(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
16114
16454
|
);
|
|
16115
16455
|
}
|
|
16116
16456
|
return new _CodexCliSkill({
|
|
@@ -16144,7 +16484,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
16144
16484
|
};
|
|
16145
16485
|
|
|
16146
16486
|
// src/features/skills/copilot-skill.ts
|
|
16147
|
-
import { join as
|
|
16487
|
+
import { join as join98 } from "path";
|
|
16148
16488
|
import { z as z47 } from "zod/mini";
|
|
16149
16489
|
var CopilotSkillFrontmatterSchema = z47.looseObject({
|
|
16150
16490
|
name: z47.string(),
|
|
@@ -16154,7 +16494,7 @@ var CopilotSkillFrontmatterSchema = z47.looseObject({
|
|
|
16154
16494
|
var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
16155
16495
|
constructor({
|
|
16156
16496
|
outputRoot = process.cwd(),
|
|
16157
|
-
relativeDirPath =
|
|
16497
|
+
relativeDirPath = join98(".github", "skills"),
|
|
16158
16498
|
dirName,
|
|
16159
16499
|
frontmatter,
|
|
16160
16500
|
body,
|
|
@@ -16186,7 +16526,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
16186
16526
|
throw new Error("CopilotSkill does not support global mode.");
|
|
16187
16527
|
}
|
|
16188
16528
|
return {
|
|
16189
|
-
relativeDirPath:
|
|
16529
|
+
relativeDirPath: join98(".github", "skills")
|
|
16190
16530
|
};
|
|
16191
16531
|
}
|
|
16192
16532
|
getFrontmatter() {
|
|
@@ -16272,9 +16612,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
16272
16612
|
});
|
|
16273
16613
|
const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
16274
16614
|
if (!result.success) {
|
|
16275
|
-
const skillDirPath =
|
|
16615
|
+
const skillDirPath = join98(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
16276
16616
|
throw new Error(
|
|
16277
|
-
`Invalid frontmatter in ${
|
|
16617
|
+
`Invalid frontmatter in ${join98(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
16278
16618
|
);
|
|
16279
16619
|
}
|
|
16280
16620
|
return new _CopilotSkill({
|
|
@@ -16309,7 +16649,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
16309
16649
|
};
|
|
16310
16650
|
|
|
16311
16651
|
// src/features/skills/cursor-skill.ts
|
|
16312
|
-
import { join as
|
|
16652
|
+
import { join as join99 } from "path";
|
|
16313
16653
|
import { z as z48 } from "zod/mini";
|
|
16314
16654
|
var CursorSkillFrontmatterSchema = z48.looseObject({
|
|
16315
16655
|
name: z48.string(),
|
|
@@ -16318,7 +16658,7 @@ var CursorSkillFrontmatterSchema = z48.looseObject({
|
|
|
16318
16658
|
var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
16319
16659
|
constructor({
|
|
16320
16660
|
outputRoot = process.cwd(),
|
|
16321
|
-
relativeDirPath =
|
|
16661
|
+
relativeDirPath = join99(".cursor", "skills"),
|
|
16322
16662
|
dirName,
|
|
16323
16663
|
frontmatter,
|
|
16324
16664
|
body,
|
|
@@ -16347,7 +16687,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
16347
16687
|
}
|
|
16348
16688
|
static getSettablePaths(_options) {
|
|
16349
16689
|
return {
|
|
16350
|
-
relativeDirPath:
|
|
16690
|
+
relativeDirPath: join99(".cursor", "skills")
|
|
16351
16691
|
};
|
|
16352
16692
|
}
|
|
16353
16693
|
getFrontmatter() {
|
|
@@ -16427,9 +16767,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
16427
16767
|
});
|
|
16428
16768
|
const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
16429
16769
|
if (!result.success) {
|
|
16430
|
-
const skillDirPath =
|
|
16770
|
+
const skillDirPath = join99(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
16431
16771
|
throw new Error(
|
|
16432
|
-
`Invalid frontmatter in ${
|
|
16772
|
+
`Invalid frontmatter in ${join99(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
16433
16773
|
);
|
|
16434
16774
|
}
|
|
16435
16775
|
return new _CursorSkill({
|
|
@@ -16464,7 +16804,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
16464
16804
|
};
|
|
16465
16805
|
|
|
16466
16806
|
// src/features/skills/deepagents-skill.ts
|
|
16467
|
-
import { join as
|
|
16807
|
+
import { join as join100 } from "path";
|
|
16468
16808
|
import { z as z49 } from "zod/mini";
|
|
16469
16809
|
var DeepagentsSkillFrontmatterSchema = z49.looseObject({
|
|
16470
16810
|
name: z49.string(),
|
|
@@ -16474,7 +16814,7 @@ var DeepagentsSkillFrontmatterSchema = z49.looseObject({
|
|
|
16474
16814
|
var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
16475
16815
|
constructor({
|
|
16476
16816
|
outputRoot = process.cwd(),
|
|
16477
|
-
relativeDirPath =
|
|
16817
|
+
relativeDirPath = join100(".deepagents", "skills"),
|
|
16478
16818
|
dirName,
|
|
16479
16819
|
frontmatter,
|
|
16480
16820
|
body,
|
|
@@ -16503,7 +16843,7 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
16503
16843
|
}
|
|
16504
16844
|
static getSettablePaths(_options) {
|
|
16505
16845
|
return {
|
|
16506
|
-
relativeDirPath:
|
|
16846
|
+
relativeDirPath: join100(".deepagents", "skills")
|
|
16507
16847
|
};
|
|
16508
16848
|
}
|
|
16509
16849
|
getFrontmatter() {
|
|
@@ -16589,9 +16929,9 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
16589
16929
|
});
|
|
16590
16930
|
const result = DeepagentsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
16591
16931
|
if (!result.success) {
|
|
16592
|
-
const skillDirPath =
|
|
16932
|
+
const skillDirPath = join100(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
16593
16933
|
throw new Error(
|
|
16594
|
-
`Invalid frontmatter in ${
|
|
16934
|
+
`Invalid frontmatter in ${join100(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
16595
16935
|
);
|
|
16596
16936
|
}
|
|
16597
16937
|
return new _DeepagentsSkill({
|
|
@@ -16626,7 +16966,7 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
16626
16966
|
};
|
|
16627
16967
|
|
|
16628
16968
|
// src/features/skills/geminicli-skill.ts
|
|
16629
|
-
import { join as
|
|
16969
|
+
import { join as join101 } from "path";
|
|
16630
16970
|
import { z as z50 } from "zod/mini";
|
|
16631
16971
|
var GeminiCliSkillFrontmatterSchema = z50.looseObject({
|
|
16632
16972
|
name: z50.string(),
|
|
@@ -16666,7 +17006,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
16666
17006
|
global: _global = false
|
|
16667
17007
|
} = {}) {
|
|
16668
17008
|
return {
|
|
16669
|
-
relativeDirPath:
|
|
17009
|
+
relativeDirPath: join101(".gemini", "skills")
|
|
16670
17010
|
};
|
|
16671
17011
|
}
|
|
16672
17012
|
getFrontmatter() {
|
|
@@ -16746,9 +17086,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
16746
17086
|
});
|
|
16747
17087
|
const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
16748
17088
|
if (!result.success) {
|
|
16749
|
-
const skillDirPath =
|
|
17089
|
+
const skillDirPath = join101(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
16750
17090
|
throw new Error(
|
|
16751
|
-
`Invalid frontmatter in ${
|
|
17091
|
+
`Invalid frontmatter in ${join101(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
16752
17092
|
);
|
|
16753
17093
|
}
|
|
16754
17094
|
return new _GeminiCliSkill({
|
|
@@ -16783,7 +17123,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
16783
17123
|
};
|
|
16784
17124
|
|
|
16785
17125
|
// src/features/skills/junie-skill.ts
|
|
16786
|
-
import { join as
|
|
17126
|
+
import { join as join102 } from "path";
|
|
16787
17127
|
import { z as z51 } from "zod/mini";
|
|
16788
17128
|
var JunieSkillFrontmatterSchema = z51.looseObject({
|
|
16789
17129
|
name: z51.string(),
|
|
@@ -16792,7 +17132,7 @@ var JunieSkillFrontmatterSchema = z51.looseObject({
|
|
|
16792
17132
|
var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
16793
17133
|
constructor({
|
|
16794
17134
|
outputRoot = process.cwd(),
|
|
16795
|
-
relativeDirPath =
|
|
17135
|
+
relativeDirPath = join102(".junie", "skills"),
|
|
16796
17136
|
dirName,
|
|
16797
17137
|
frontmatter,
|
|
16798
17138
|
body,
|
|
@@ -16824,7 +17164,7 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
16824
17164
|
throw new Error("JunieSkill does not support global mode.");
|
|
16825
17165
|
}
|
|
16826
17166
|
return {
|
|
16827
|
-
relativeDirPath:
|
|
17167
|
+
relativeDirPath: join102(".junie", "skills")
|
|
16828
17168
|
};
|
|
16829
17169
|
}
|
|
16830
17170
|
getFrontmatter() {
|
|
@@ -16911,13 +17251,13 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
16911
17251
|
});
|
|
16912
17252
|
const result = JunieSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
16913
17253
|
if (!result.success) {
|
|
16914
|
-
const skillDirPath =
|
|
17254
|
+
const skillDirPath = join102(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
16915
17255
|
throw new Error(
|
|
16916
|
-
`Invalid frontmatter in ${
|
|
17256
|
+
`Invalid frontmatter in ${join102(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
16917
17257
|
);
|
|
16918
17258
|
}
|
|
16919
17259
|
if (result.data.name !== loaded.dirName) {
|
|
16920
|
-
const skillFilePath =
|
|
17260
|
+
const skillFilePath = join102(
|
|
16921
17261
|
loaded.outputRoot,
|
|
16922
17262
|
loaded.relativeDirPath,
|
|
16923
17263
|
loaded.dirName,
|
|
@@ -16959,7 +17299,7 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
16959
17299
|
};
|
|
16960
17300
|
|
|
16961
17301
|
// src/features/skills/kilo-skill.ts
|
|
16962
|
-
import { join as
|
|
17302
|
+
import { join as join103 } from "path";
|
|
16963
17303
|
import { z as z52 } from "zod/mini";
|
|
16964
17304
|
var KiloSkillFrontmatterSchema = z52.looseObject({
|
|
16965
17305
|
name: z52.string(),
|
|
@@ -16969,7 +17309,7 @@ var KiloSkillFrontmatterSchema = z52.looseObject({
|
|
|
16969
17309
|
var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
16970
17310
|
constructor({
|
|
16971
17311
|
outputRoot = process.cwd(),
|
|
16972
|
-
relativeDirPath =
|
|
17312
|
+
relativeDirPath = join103(".kilo", "skills"),
|
|
16973
17313
|
dirName,
|
|
16974
17314
|
frontmatter,
|
|
16975
17315
|
body,
|
|
@@ -16998,7 +17338,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
16998
17338
|
}
|
|
16999
17339
|
static getSettablePaths({ global = false } = {}) {
|
|
17000
17340
|
return {
|
|
17001
|
-
relativeDirPath: global ?
|
|
17341
|
+
relativeDirPath: global ? join103(".config", "kilo", "skills") : join103(".kilo", "skills")
|
|
17002
17342
|
};
|
|
17003
17343
|
}
|
|
17004
17344
|
getFrontmatter() {
|
|
@@ -17084,9 +17424,9 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
17084
17424
|
});
|
|
17085
17425
|
const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
17086
17426
|
if (!result.success) {
|
|
17087
|
-
const skillDirPath =
|
|
17427
|
+
const skillDirPath = join103(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
17088
17428
|
throw new Error(
|
|
17089
|
-
`Invalid frontmatter in ${
|
|
17429
|
+
`Invalid frontmatter in ${join103(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
17090
17430
|
);
|
|
17091
17431
|
}
|
|
17092
17432
|
return new _KiloSkill({
|
|
@@ -17120,7 +17460,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
17120
17460
|
};
|
|
17121
17461
|
|
|
17122
17462
|
// src/features/skills/kiro-skill.ts
|
|
17123
|
-
import { join as
|
|
17463
|
+
import { join as join104 } from "path";
|
|
17124
17464
|
import { z as z53 } from "zod/mini";
|
|
17125
17465
|
var KiroSkillFrontmatterSchema = z53.looseObject({
|
|
17126
17466
|
name: z53.string(),
|
|
@@ -17129,7 +17469,7 @@ var KiroSkillFrontmatterSchema = z53.looseObject({
|
|
|
17129
17469
|
var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
17130
17470
|
constructor({
|
|
17131
17471
|
outputRoot = process.cwd(),
|
|
17132
|
-
relativeDirPath =
|
|
17472
|
+
relativeDirPath = join104(".kiro", "skills"),
|
|
17133
17473
|
dirName,
|
|
17134
17474
|
frontmatter,
|
|
17135
17475
|
body,
|
|
@@ -17161,7 +17501,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
17161
17501
|
throw new Error("KiroSkill does not support global mode.");
|
|
17162
17502
|
}
|
|
17163
17503
|
return {
|
|
17164
|
-
relativeDirPath:
|
|
17504
|
+
relativeDirPath: join104(".kiro", "skills")
|
|
17165
17505
|
};
|
|
17166
17506
|
}
|
|
17167
17507
|
getFrontmatter() {
|
|
@@ -17249,13 +17589,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
17249
17589
|
});
|
|
17250
17590
|
const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
17251
17591
|
if (!result.success) {
|
|
17252
|
-
const skillDirPath =
|
|
17592
|
+
const skillDirPath = join104(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
17253
17593
|
throw new Error(
|
|
17254
|
-
`Invalid frontmatter in ${
|
|
17594
|
+
`Invalid frontmatter in ${join104(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
17255
17595
|
);
|
|
17256
17596
|
}
|
|
17257
17597
|
if (result.data.name !== loaded.dirName) {
|
|
17258
|
-
const skillFilePath =
|
|
17598
|
+
const skillFilePath = join104(
|
|
17259
17599
|
loaded.outputRoot,
|
|
17260
17600
|
loaded.relativeDirPath,
|
|
17261
17601
|
loaded.dirName,
|
|
@@ -17297,7 +17637,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
17297
17637
|
};
|
|
17298
17638
|
|
|
17299
17639
|
// src/features/skills/opencode-skill.ts
|
|
17300
|
-
import { join as
|
|
17640
|
+
import { join as join105 } from "path";
|
|
17301
17641
|
import { z as z54 } from "zod/mini";
|
|
17302
17642
|
var OpenCodeSkillFrontmatterSchema = z54.looseObject({
|
|
17303
17643
|
name: z54.string(),
|
|
@@ -17307,7 +17647,7 @@ var OpenCodeSkillFrontmatterSchema = z54.looseObject({
|
|
|
17307
17647
|
var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
17308
17648
|
constructor({
|
|
17309
17649
|
outputRoot = process.cwd(),
|
|
17310
|
-
relativeDirPath =
|
|
17650
|
+
relativeDirPath = join105(".opencode", "skill"),
|
|
17311
17651
|
dirName,
|
|
17312
17652
|
frontmatter,
|
|
17313
17653
|
body,
|
|
@@ -17336,7 +17676,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
17336
17676
|
}
|
|
17337
17677
|
static getSettablePaths({ global = false } = {}) {
|
|
17338
17678
|
return {
|
|
17339
|
-
relativeDirPath: global ?
|
|
17679
|
+
relativeDirPath: global ? join105(".config", "opencode", "skill") : join105(".opencode", "skill")
|
|
17340
17680
|
};
|
|
17341
17681
|
}
|
|
17342
17682
|
getFrontmatter() {
|
|
@@ -17422,9 +17762,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
17422
17762
|
});
|
|
17423
17763
|
const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
17424
17764
|
if (!result.success) {
|
|
17425
|
-
const skillDirPath =
|
|
17765
|
+
const skillDirPath = join105(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
17426
17766
|
throw new Error(
|
|
17427
|
-
`Invalid frontmatter in ${
|
|
17767
|
+
`Invalid frontmatter in ${join105(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
17428
17768
|
);
|
|
17429
17769
|
}
|
|
17430
17770
|
return new _OpenCodeSkill({
|
|
@@ -17458,11 +17798,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
17458
17798
|
};
|
|
17459
17799
|
|
|
17460
17800
|
// src/features/skills/pi-skill.ts
|
|
17461
|
-
import { join as
|
|
17801
|
+
import { join as join106 } from "path";
|
|
17462
17802
|
import { z as z55 } from "zod/mini";
|
|
17463
17803
|
var PiSkillFrontmatterSchema = z55.looseObject({
|
|
17464
17804
|
name: z55.string(),
|
|
17465
|
-
description: z55.string()
|
|
17805
|
+
description: z55.string(),
|
|
17806
|
+
"allowed-tools": z55.optional(z55.array(z55.string())),
|
|
17807
|
+
"disable-model-invocation": z55.optional(z55.boolean()),
|
|
17808
|
+
license: z55.optional(z55.string()),
|
|
17809
|
+
compatibility: z55.optional(z55.looseObject({})),
|
|
17810
|
+
metadata: z55.optional(z55.looseObject({}))
|
|
17466
17811
|
});
|
|
17467
17812
|
var PiSkill = class _PiSkill extends ToolSkill {
|
|
17468
17813
|
constructor({
|
|
@@ -17498,11 +17843,11 @@ var PiSkill = class _PiSkill extends ToolSkill {
|
|
|
17498
17843
|
static getSettablePaths({ global } = {}) {
|
|
17499
17844
|
if (global) {
|
|
17500
17845
|
return {
|
|
17501
|
-
relativeDirPath:
|
|
17846
|
+
relativeDirPath: join106(".pi", "agent", "skills")
|
|
17502
17847
|
};
|
|
17503
17848
|
}
|
|
17504
17849
|
return {
|
|
17505
|
-
relativeDirPath:
|
|
17850
|
+
relativeDirPath: join106(".pi", "skills")
|
|
17506
17851
|
};
|
|
17507
17852
|
}
|
|
17508
17853
|
getFrontmatter() {
|
|
@@ -17531,10 +17876,24 @@ var PiSkill = class _PiSkill extends ToolSkill {
|
|
|
17531
17876
|
}
|
|
17532
17877
|
toRulesyncSkill() {
|
|
17533
17878
|
const frontmatter = this.getFrontmatter();
|
|
17879
|
+
const piBlock = {
|
|
17880
|
+
...frontmatter["allowed-tools"] !== void 0 && {
|
|
17881
|
+
"allowed-tools": frontmatter["allowed-tools"]
|
|
17882
|
+
},
|
|
17883
|
+
...frontmatter["disable-model-invocation"] !== void 0 && {
|
|
17884
|
+
"disable-model-invocation": frontmatter["disable-model-invocation"]
|
|
17885
|
+
},
|
|
17886
|
+
...frontmatter.license !== void 0 && { license: frontmatter.license },
|
|
17887
|
+
...frontmatter.compatibility !== void 0 && {
|
|
17888
|
+
compatibility: frontmatter.compatibility
|
|
17889
|
+
},
|
|
17890
|
+
...frontmatter.metadata !== void 0 && { metadata: frontmatter.metadata }
|
|
17891
|
+
};
|
|
17534
17892
|
const rulesyncFrontmatter = {
|
|
17535
17893
|
name: frontmatter.name,
|
|
17536
17894
|
description: frontmatter.description,
|
|
17537
|
-
targets: ["*"]
|
|
17895
|
+
targets: ["*"],
|
|
17896
|
+
...Object.keys(piBlock).length > 0 && { pi: piBlock }
|
|
17538
17897
|
};
|
|
17539
17898
|
return new RulesyncSkill({
|
|
17540
17899
|
outputRoot: this.outputRoot,
|
|
@@ -17557,7 +17916,8 @@ var PiSkill = class _PiSkill extends ToolSkill {
|
|
|
17557
17916
|
const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
|
|
17558
17917
|
const piFrontmatter = {
|
|
17559
17918
|
name: rulesyncFrontmatter.name,
|
|
17560
|
-
description: rulesyncFrontmatter.description
|
|
17919
|
+
description: rulesyncFrontmatter.description,
|
|
17920
|
+
...rulesyncFrontmatter.pi
|
|
17561
17921
|
};
|
|
17562
17922
|
return new _PiSkill({
|
|
17563
17923
|
outputRoot,
|
|
@@ -17581,9 +17941,9 @@ var PiSkill = class _PiSkill extends ToolSkill {
|
|
|
17581
17941
|
});
|
|
17582
17942
|
const result = PiSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
17583
17943
|
if (!result.success) {
|
|
17584
|
-
const skillDirPath =
|
|
17944
|
+
const skillDirPath = join106(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
17585
17945
|
throw new Error(
|
|
17586
|
-
`Invalid frontmatter in ${
|
|
17946
|
+
`Invalid frontmatter in ${join106(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
17587
17947
|
);
|
|
17588
17948
|
}
|
|
17589
17949
|
return new _PiSkill({
|
|
@@ -17618,16 +17978,20 @@ var PiSkill = class _PiSkill extends ToolSkill {
|
|
|
17618
17978
|
};
|
|
17619
17979
|
|
|
17620
17980
|
// src/features/skills/replit-skill.ts
|
|
17621
|
-
import { join as
|
|
17981
|
+
import { join as join107 } from "path";
|
|
17622
17982
|
import { z as z56 } from "zod/mini";
|
|
17623
17983
|
var ReplitSkillFrontmatterSchema = z56.looseObject({
|
|
17624
17984
|
name: z56.string(),
|
|
17625
|
-
description: z56.string()
|
|
17985
|
+
description: z56.string(),
|
|
17986
|
+
"allowed-tools": z56.optional(z56.array(z56.string())),
|
|
17987
|
+
license: z56.optional(z56.string()),
|
|
17988
|
+
compatibility: z56.optional(z56.looseObject({})),
|
|
17989
|
+
metadata: z56.optional(z56.looseObject({}))
|
|
17626
17990
|
});
|
|
17627
17991
|
var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
17628
17992
|
constructor({
|
|
17629
17993
|
outputRoot = process.cwd(),
|
|
17630
|
-
relativeDirPath =
|
|
17994
|
+
relativeDirPath = join107(".agents", "skills"),
|
|
17631
17995
|
dirName,
|
|
17632
17996
|
frontmatter,
|
|
17633
17997
|
body,
|
|
@@ -17659,7 +18023,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
17659
18023
|
throw new Error("ReplitSkill does not support global mode.");
|
|
17660
18024
|
}
|
|
17661
18025
|
return {
|
|
17662
|
-
relativeDirPath:
|
|
18026
|
+
relativeDirPath: join107(".agents", "skills")
|
|
17663
18027
|
};
|
|
17664
18028
|
}
|
|
17665
18029
|
getFrontmatter() {
|
|
@@ -17689,10 +18053,21 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
17689
18053
|
}
|
|
17690
18054
|
toRulesyncSkill() {
|
|
17691
18055
|
const frontmatter = this.getFrontmatter();
|
|
18056
|
+
const replitBlock = {
|
|
18057
|
+
...frontmatter["allowed-tools"] !== void 0 && {
|
|
18058
|
+
"allowed-tools": frontmatter["allowed-tools"]
|
|
18059
|
+
},
|
|
18060
|
+
...frontmatter.license !== void 0 && { license: frontmatter.license },
|
|
18061
|
+
...frontmatter.compatibility !== void 0 && {
|
|
18062
|
+
compatibility: frontmatter.compatibility
|
|
18063
|
+
},
|
|
18064
|
+
...frontmatter.metadata !== void 0 && { metadata: frontmatter.metadata }
|
|
18065
|
+
};
|
|
17692
18066
|
const rulesyncFrontmatter = {
|
|
17693
18067
|
name: frontmatter.name,
|
|
17694
18068
|
description: frontmatter.description,
|
|
17695
|
-
targets: ["*"]
|
|
18069
|
+
targets: ["*"],
|
|
18070
|
+
...Object.keys(replitBlock).length > 0 && { replit: replitBlock }
|
|
17696
18071
|
};
|
|
17697
18072
|
return new RulesyncSkill({
|
|
17698
18073
|
outputRoot: this.outputRoot,
|
|
@@ -17715,7 +18090,8 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
17715
18090
|
const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
|
|
17716
18091
|
const replitFrontmatter = {
|
|
17717
18092
|
name: rulesyncFrontmatter.name,
|
|
17718
|
-
description: rulesyncFrontmatter.description
|
|
18093
|
+
description: rulesyncFrontmatter.description,
|
|
18094
|
+
...rulesyncFrontmatter.replit
|
|
17719
18095
|
};
|
|
17720
18096
|
return new _ReplitSkill({
|
|
17721
18097
|
outputRoot,
|
|
@@ -17739,9 +18115,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
17739
18115
|
});
|
|
17740
18116
|
const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
17741
18117
|
if (!result.success) {
|
|
17742
|
-
const skillDirPath =
|
|
18118
|
+
const skillDirPath = join107(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
17743
18119
|
throw new Error(
|
|
17744
|
-
`Invalid frontmatter in ${
|
|
18120
|
+
`Invalid frontmatter in ${join107(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
17745
18121
|
);
|
|
17746
18122
|
}
|
|
17747
18123
|
return new _ReplitSkill({
|
|
@@ -17776,7 +18152,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
17776
18152
|
};
|
|
17777
18153
|
|
|
17778
18154
|
// src/features/skills/roo-skill.ts
|
|
17779
|
-
import { join as
|
|
18155
|
+
import { join as join108 } from "path";
|
|
17780
18156
|
import { z as z57 } from "zod/mini";
|
|
17781
18157
|
var RooSkillFrontmatterSchema = z57.looseObject({
|
|
17782
18158
|
name: z57.string(),
|
|
@@ -17785,7 +18161,7 @@ var RooSkillFrontmatterSchema = z57.looseObject({
|
|
|
17785
18161
|
var RooSkill = class _RooSkill extends ToolSkill {
|
|
17786
18162
|
constructor({
|
|
17787
18163
|
outputRoot = process.cwd(),
|
|
17788
|
-
relativeDirPath =
|
|
18164
|
+
relativeDirPath = join108(".roo", "skills"),
|
|
17789
18165
|
dirName,
|
|
17790
18166
|
frontmatter,
|
|
17791
18167
|
body,
|
|
@@ -17816,7 +18192,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
17816
18192
|
global: _global = false
|
|
17817
18193
|
} = {}) {
|
|
17818
18194
|
return {
|
|
17819
|
-
relativeDirPath:
|
|
18195
|
+
relativeDirPath: join108(".roo", "skills")
|
|
17820
18196
|
};
|
|
17821
18197
|
}
|
|
17822
18198
|
getFrontmatter() {
|
|
@@ -17904,13 +18280,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
17904
18280
|
});
|
|
17905
18281
|
const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
17906
18282
|
if (!result.success) {
|
|
17907
|
-
const skillDirPath =
|
|
18283
|
+
const skillDirPath = join108(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
17908
18284
|
throw new Error(
|
|
17909
|
-
`Invalid frontmatter in ${
|
|
18285
|
+
`Invalid frontmatter in ${join108(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
17910
18286
|
);
|
|
17911
18287
|
}
|
|
17912
18288
|
if (result.data.name !== loaded.dirName) {
|
|
17913
|
-
const skillFilePath =
|
|
18289
|
+
const skillFilePath = join108(
|
|
17914
18290
|
loaded.outputRoot,
|
|
17915
18291
|
loaded.relativeDirPath,
|
|
17916
18292
|
loaded.dirName,
|
|
@@ -17951,14 +18327,14 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
17951
18327
|
};
|
|
17952
18328
|
|
|
17953
18329
|
// src/features/skills/skills-utils.ts
|
|
17954
|
-
import { basename as basename5, join as
|
|
18330
|
+
import { basename as basename5, join as join109 } from "path";
|
|
17955
18331
|
async function getLocalSkillDirNames(outputRoot) {
|
|
17956
|
-
const skillsDir =
|
|
18332
|
+
const skillsDir = join109(outputRoot, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
|
|
17957
18333
|
const names = /* @__PURE__ */ new Set();
|
|
17958
18334
|
if (!await directoryExists(skillsDir)) {
|
|
17959
18335
|
return names;
|
|
17960
18336
|
}
|
|
17961
|
-
const dirPaths = await findFilesByGlobs(
|
|
18337
|
+
const dirPaths = await findFilesByGlobs(join109(skillsDir, "*"), { type: "dir" });
|
|
17962
18338
|
for (const dirPath of dirPaths) {
|
|
17963
18339
|
const name = basename5(dirPath);
|
|
17964
18340
|
if (name === basename5(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
|
|
@@ -17968,7 +18344,7 @@ async function getLocalSkillDirNames(outputRoot) {
|
|
|
17968
18344
|
}
|
|
17969
18345
|
|
|
17970
18346
|
// src/features/skills/takt-skill.ts
|
|
17971
|
-
import path3, { join as
|
|
18347
|
+
import path3, { join as join110, relative as relative5, resolve as resolve6 } from "path";
|
|
17972
18348
|
var DEFAULT_TAKT_SKILL_DIR = "knowledge";
|
|
17973
18349
|
var TaktSkill = class _TaktSkill extends ToolSkill {
|
|
17974
18350
|
fileName;
|
|
@@ -18005,7 +18381,7 @@ var TaktSkill = class _TaktSkill extends ToolSkill {
|
|
|
18005
18381
|
}
|
|
18006
18382
|
static getSettablePaths(_options = {}) {
|
|
18007
18383
|
return {
|
|
18008
|
-
relativeDirPath:
|
|
18384
|
+
relativeDirPath: join110(".takt", "facets", DEFAULT_TAKT_SKILL_DIR)
|
|
18009
18385
|
};
|
|
18010
18386
|
}
|
|
18011
18387
|
/**
|
|
@@ -18016,7 +18392,7 @@ var TaktSkill = class _TaktSkill extends ToolSkill {
|
|
|
18016
18392
|
* malicious `relativeDirPath` cannot escape `outputRoot`.
|
|
18017
18393
|
*/
|
|
18018
18394
|
getDirPath() {
|
|
18019
|
-
const fullPath =
|
|
18395
|
+
const fullPath = join110(this.outputRoot, this.relativeDirPath);
|
|
18020
18396
|
const resolvedFull = resolve6(fullPath);
|
|
18021
18397
|
const resolvedBase = resolve6(this.outputRoot);
|
|
18022
18398
|
const rel = relative5(resolvedBase, resolvedFull);
|
|
@@ -18057,7 +18433,7 @@ var TaktSkill = class _TaktSkill extends ToolSkill {
|
|
|
18057
18433
|
const stem = overrideName ?? rulesyncSkill.getDirName();
|
|
18058
18434
|
assertSafeTaktName({ name: stem, featureLabel: "skill", sourceLabel });
|
|
18059
18435
|
const fileName = `${stem}.md`;
|
|
18060
|
-
const relativeDirPath =
|
|
18436
|
+
const relativeDirPath = join110(".takt", "facets", DEFAULT_TAKT_SKILL_DIR);
|
|
18061
18437
|
return new _TaktSkill({
|
|
18062
18438
|
outputRoot,
|
|
18063
18439
|
relativeDirPath,
|
|
@@ -18107,7 +18483,7 @@ var TaktSkill = class _TaktSkill extends ToolSkill {
|
|
|
18107
18483
|
};
|
|
18108
18484
|
|
|
18109
18485
|
// src/features/skills/windsurf-skill.ts
|
|
18110
|
-
import { join as
|
|
18486
|
+
import { join as join111 } from "path";
|
|
18111
18487
|
import { z as z58 } from "zod/mini";
|
|
18112
18488
|
var WindsurfSkillFrontmatterSchema = z58.looseObject({
|
|
18113
18489
|
name: z58.string(),
|
|
@@ -18146,11 +18522,11 @@ var WindsurfSkill = class _WindsurfSkill extends ToolSkill {
|
|
|
18146
18522
|
static getSettablePaths({ global = false } = {}) {
|
|
18147
18523
|
if (global) {
|
|
18148
18524
|
return {
|
|
18149
|
-
relativeDirPath:
|
|
18525
|
+
relativeDirPath: join111(".codeium", "windsurf", "skills")
|
|
18150
18526
|
};
|
|
18151
18527
|
}
|
|
18152
18528
|
return {
|
|
18153
|
-
relativeDirPath:
|
|
18529
|
+
relativeDirPath: join111(".windsurf", "skills")
|
|
18154
18530
|
};
|
|
18155
18531
|
}
|
|
18156
18532
|
getFrontmatter() {
|
|
@@ -18230,9 +18606,9 @@ var WindsurfSkill = class _WindsurfSkill extends ToolSkill {
|
|
|
18230
18606
|
});
|
|
18231
18607
|
const result = WindsurfSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
18232
18608
|
if (!result.success) {
|
|
18233
|
-
const skillDirPath =
|
|
18609
|
+
const skillDirPath = join111(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
18234
18610
|
throw new Error(
|
|
18235
|
-
`Invalid frontmatter in ${
|
|
18611
|
+
`Invalid frontmatter in ${join111(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
18236
18612
|
);
|
|
18237
18613
|
}
|
|
18238
18614
|
return new _WindsurfSkill({
|
|
@@ -18267,7 +18643,7 @@ var WindsurfSkill = class _WindsurfSkill extends ToolSkill {
|
|
|
18267
18643
|
};
|
|
18268
18644
|
|
|
18269
18645
|
// src/features/skills/zed-skill.ts
|
|
18270
|
-
import { join as
|
|
18646
|
+
import { join as join112 } from "path";
|
|
18271
18647
|
import { z as z59 } from "zod/mini";
|
|
18272
18648
|
var ZedSkillFrontmatterSchema = z59.looseObject({
|
|
18273
18649
|
name: z59.string(),
|
|
@@ -18277,7 +18653,7 @@ var ZedSkillFrontmatterSchema = z59.looseObject({
|
|
|
18277
18653
|
var ZedSkill = class _ZedSkill extends ToolSkill {
|
|
18278
18654
|
constructor({
|
|
18279
18655
|
outputRoot = process.cwd(),
|
|
18280
|
-
relativeDirPath =
|
|
18656
|
+
relativeDirPath = join112(".agents", "skills"),
|
|
18281
18657
|
dirName,
|
|
18282
18658
|
frontmatter,
|
|
18283
18659
|
body,
|
|
@@ -18306,7 +18682,7 @@ var ZedSkill = class _ZedSkill extends ToolSkill {
|
|
|
18306
18682
|
}
|
|
18307
18683
|
static getSettablePaths(_options) {
|
|
18308
18684
|
return {
|
|
18309
|
-
relativeDirPath:
|
|
18685
|
+
relativeDirPath: join112(".agents", "skills")
|
|
18310
18686
|
};
|
|
18311
18687
|
}
|
|
18312
18688
|
getFrontmatter() {
|
|
@@ -18385,9 +18761,9 @@ var ZedSkill = class _ZedSkill extends ToolSkill {
|
|
|
18385
18761
|
});
|
|
18386
18762
|
const result = ZedSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
18387
18763
|
if (!result.success) {
|
|
18388
|
-
const skillDirPath =
|
|
18764
|
+
const skillDirPath = join112(loaded.outputRoot, loaded.relativeDirPath, loaded.dirName);
|
|
18389
18765
|
throw new Error(
|
|
18390
|
-
`Invalid frontmatter in ${
|
|
18766
|
+
`Invalid frontmatter in ${join112(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
18391
18767
|
);
|
|
18392
18768
|
}
|
|
18393
18769
|
return new _ZedSkill({
|
|
@@ -18721,10 +19097,10 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
18721
19097
|
)
|
|
18722
19098
|
);
|
|
18723
19099
|
const localSkillNames = new Set(localDirNames);
|
|
18724
|
-
const curatedDirPath =
|
|
19100
|
+
const curatedDirPath = join113(this.inputRoot, RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
|
|
18725
19101
|
let curatedSkills = [];
|
|
18726
19102
|
if (await directoryExists(curatedDirPath)) {
|
|
18727
|
-
const curatedDirPaths = await findFilesByGlobs(
|
|
19103
|
+
const curatedDirPaths = await findFilesByGlobs(join113(curatedDirPath, "*"), { type: "dir" });
|
|
18728
19104
|
const curatedDirNames = curatedDirPaths.map((path4) => basename6(path4));
|
|
18729
19105
|
const nonConflicting = curatedDirNames.filter((name) => {
|
|
18730
19106
|
if (localSkillNames.has(name)) {
|
|
@@ -18762,11 +19138,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
18762
19138
|
const seenDirNames = /* @__PURE__ */ new Set();
|
|
18763
19139
|
const loadEntries = [];
|
|
18764
19140
|
for (const root of roots) {
|
|
18765
|
-
const skillsDirPath =
|
|
19141
|
+
const skillsDirPath = join113(this.outputRoot, root);
|
|
18766
19142
|
if (!await directoryExists(skillsDirPath)) {
|
|
18767
19143
|
continue;
|
|
18768
19144
|
}
|
|
18769
|
-
const dirPaths = await findFilesByGlobs(
|
|
19145
|
+
const dirPaths = await findFilesByGlobs(join113(skillsDirPath, "*"), { type: "dir" });
|
|
18770
19146
|
for (const dirPath of dirPaths) {
|
|
18771
19147
|
const dirName = basename6(dirPath);
|
|
18772
19148
|
if (seenDirNames.has(dirName)) {
|
|
@@ -18797,11 +19173,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
18797
19173
|
const roots = toolSkillSearchRoots(paths);
|
|
18798
19174
|
const toolSkills = [];
|
|
18799
19175
|
for (const root of roots) {
|
|
18800
|
-
const skillsDirPath =
|
|
19176
|
+
const skillsDirPath = join113(this.outputRoot, root);
|
|
18801
19177
|
if (!await directoryExists(skillsDirPath)) {
|
|
18802
19178
|
continue;
|
|
18803
19179
|
}
|
|
18804
|
-
const dirPaths = await findFilesByGlobs(
|
|
19180
|
+
const dirPaths = await findFilesByGlobs(join113(skillsDirPath, "*"), { type: "dir" });
|
|
18805
19181
|
for (const dirPath of dirPaths) {
|
|
18806
19182
|
const dirName = basename6(dirPath);
|
|
18807
19183
|
const toolSkill = factory.class.forDeletion({
|
|
@@ -18865,10 +19241,10 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
18865
19241
|
};
|
|
18866
19242
|
|
|
18867
19243
|
// src/features/subagents/agentsmd-subagent.ts
|
|
18868
|
-
import { join as
|
|
19244
|
+
import { join as join115 } from "path";
|
|
18869
19245
|
|
|
18870
19246
|
// src/features/subagents/simulated-subagent.ts
|
|
18871
|
-
import { basename as basename7, join as
|
|
19247
|
+
import { basename as basename7, join as join114 } from "path";
|
|
18872
19248
|
import { z as z61 } from "zod/mini";
|
|
18873
19249
|
|
|
18874
19250
|
// src/features/subagents/tool-subagent.ts
|
|
@@ -18933,7 +19309,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
18933
19309
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
18934
19310
|
if (!result.success) {
|
|
18935
19311
|
throw new Error(
|
|
18936
|
-
`Invalid frontmatter in ${
|
|
19312
|
+
`Invalid frontmatter in ${join114(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
18937
19313
|
);
|
|
18938
19314
|
}
|
|
18939
19315
|
}
|
|
@@ -18984,7 +19360,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
18984
19360
|
return {
|
|
18985
19361
|
success: false,
|
|
18986
19362
|
error: new Error(
|
|
18987
|
-
`Invalid frontmatter in ${
|
|
19363
|
+
`Invalid frontmatter in ${join114(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
18988
19364
|
)
|
|
18989
19365
|
};
|
|
18990
19366
|
}
|
|
@@ -18994,7 +19370,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
18994
19370
|
relativeFilePath,
|
|
18995
19371
|
validate = true
|
|
18996
19372
|
}) {
|
|
18997
|
-
const filePath =
|
|
19373
|
+
const filePath = join114(outputRoot, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
18998
19374
|
const fileContent = await readFileContent(filePath);
|
|
18999
19375
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
19000
19376
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -19030,7 +19406,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
19030
19406
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
19031
19407
|
static getSettablePaths() {
|
|
19032
19408
|
return {
|
|
19033
|
-
relativeDirPath:
|
|
19409
|
+
relativeDirPath: join115(".agents", "subagents")
|
|
19034
19410
|
};
|
|
19035
19411
|
}
|
|
19036
19412
|
static async fromFile(params) {
|
|
@@ -19053,11 +19429,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
19053
19429
|
};
|
|
19054
19430
|
|
|
19055
19431
|
// src/features/subagents/factorydroid-subagent.ts
|
|
19056
|
-
import { join as
|
|
19432
|
+
import { join as join116 } from "path";
|
|
19057
19433
|
var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
|
|
19058
19434
|
static getSettablePaths(_options) {
|
|
19059
19435
|
return {
|
|
19060
|
-
relativeDirPath:
|
|
19436
|
+
relativeDirPath: join116(".factory", "droids")
|
|
19061
19437
|
};
|
|
19062
19438
|
}
|
|
19063
19439
|
static async fromFile(params) {
|
|
@@ -19080,11 +19456,11 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
|
|
|
19080
19456
|
};
|
|
19081
19457
|
|
|
19082
19458
|
// src/features/subagents/geminicli-subagent.ts
|
|
19083
|
-
import { join as
|
|
19459
|
+
import { join as join118 } from "path";
|
|
19084
19460
|
import { z as z63 } from "zod/mini";
|
|
19085
19461
|
|
|
19086
19462
|
// src/features/subagents/rulesync-subagent.ts
|
|
19087
|
-
import { basename as basename8, join as
|
|
19463
|
+
import { basename as basename8, join as join117 } from "path";
|
|
19088
19464
|
import { z as z62 } from "zod/mini";
|
|
19089
19465
|
var RulesyncSubagentFrontmatterSchema = z62.looseObject({
|
|
19090
19466
|
targets: z62._default(RulesyncTargetsSchema, ["*"]),
|
|
@@ -19103,7 +19479,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
19103
19479
|
const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
19104
19480
|
if (!parseResult.success && rest.validate !== false) {
|
|
19105
19481
|
throw new Error(
|
|
19106
|
-
`Invalid frontmatter in ${
|
|
19482
|
+
`Invalid frontmatter in ${join117(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
19107
19483
|
);
|
|
19108
19484
|
}
|
|
19109
19485
|
const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
|
|
@@ -19136,7 +19512,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
19136
19512
|
return {
|
|
19137
19513
|
success: false,
|
|
19138
19514
|
error: new Error(
|
|
19139
|
-
`Invalid frontmatter in ${
|
|
19515
|
+
`Invalid frontmatter in ${join117(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
19140
19516
|
)
|
|
19141
19517
|
};
|
|
19142
19518
|
}
|
|
@@ -19145,7 +19521,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
19145
19521
|
outputRoot = process.cwd(),
|
|
19146
19522
|
relativeFilePath
|
|
19147
19523
|
}) {
|
|
19148
|
-
const filePath =
|
|
19524
|
+
const filePath = join117(outputRoot, RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
|
|
19149
19525
|
const fileContent = await readFileContent(filePath);
|
|
19150
19526
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
19151
19527
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -19176,7 +19552,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
19176
19552
|
const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
19177
19553
|
if (!result.success) {
|
|
19178
19554
|
throw new Error(
|
|
19179
|
-
`Invalid frontmatter in ${
|
|
19555
|
+
`Invalid frontmatter in ${join118(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
19180
19556
|
);
|
|
19181
19557
|
}
|
|
19182
19558
|
}
|
|
@@ -19189,7 +19565,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
19189
19565
|
}
|
|
19190
19566
|
static getSettablePaths(_options = {}) {
|
|
19191
19567
|
return {
|
|
19192
|
-
relativeDirPath:
|
|
19568
|
+
relativeDirPath: join118(".gemini", "agents")
|
|
19193
19569
|
};
|
|
19194
19570
|
}
|
|
19195
19571
|
getFrontmatter() {
|
|
@@ -19257,7 +19633,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
19257
19633
|
return {
|
|
19258
19634
|
success: false,
|
|
19259
19635
|
error: new Error(
|
|
19260
|
-
`Invalid frontmatter in ${
|
|
19636
|
+
`Invalid frontmatter in ${join118(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
19261
19637
|
)
|
|
19262
19638
|
};
|
|
19263
19639
|
}
|
|
@@ -19275,7 +19651,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
19275
19651
|
global = false
|
|
19276
19652
|
}) {
|
|
19277
19653
|
const paths = this.getSettablePaths({ global });
|
|
19278
|
-
const filePath =
|
|
19654
|
+
const filePath = join118(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
19279
19655
|
const fileContent = await readFileContent(filePath);
|
|
19280
19656
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
19281
19657
|
const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -19311,11 +19687,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
19311
19687
|
};
|
|
19312
19688
|
|
|
19313
19689
|
// src/features/subagents/roo-subagent.ts
|
|
19314
|
-
import { join as
|
|
19690
|
+
import { join as join119 } from "path";
|
|
19315
19691
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
19316
19692
|
static getSettablePaths() {
|
|
19317
19693
|
return {
|
|
19318
|
-
relativeDirPath:
|
|
19694
|
+
relativeDirPath: join119(".roo", "subagents")
|
|
19319
19695
|
};
|
|
19320
19696
|
}
|
|
19321
19697
|
static async fromFile(params) {
|
|
@@ -19338,7 +19714,7 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
19338
19714
|
};
|
|
19339
19715
|
|
|
19340
19716
|
// src/features/subagents/rovodev-subagent.ts
|
|
19341
|
-
import { join as
|
|
19717
|
+
import { join as join120 } from "path";
|
|
19342
19718
|
import { z as z64 } from "zod/mini";
|
|
19343
19719
|
var RovodevSubagentFrontmatterSchema = z64.looseObject({
|
|
19344
19720
|
name: z64.string(),
|
|
@@ -19352,7 +19728,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
19352
19728
|
const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
19353
19729
|
if (!result.success) {
|
|
19354
19730
|
throw new Error(
|
|
19355
|
-
`Invalid frontmatter in ${
|
|
19731
|
+
`Invalid frontmatter in ${join120(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
19356
19732
|
);
|
|
19357
19733
|
}
|
|
19358
19734
|
}
|
|
@@ -19364,7 +19740,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
19364
19740
|
}
|
|
19365
19741
|
static getSettablePaths(_options = {}) {
|
|
19366
19742
|
return {
|
|
19367
|
-
relativeDirPath:
|
|
19743
|
+
relativeDirPath: join120(".rovodev", "subagents")
|
|
19368
19744
|
};
|
|
19369
19745
|
}
|
|
19370
19746
|
getFrontmatter() {
|
|
@@ -19427,7 +19803,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
19427
19803
|
return {
|
|
19428
19804
|
success: false,
|
|
19429
19805
|
error: new Error(
|
|
19430
|
-
`Invalid frontmatter in ${
|
|
19806
|
+
`Invalid frontmatter in ${join120(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
19431
19807
|
)
|
|
19432
19808
|
};
|
|
19433
19809
|
}
|
|
@@ -19444,7 +19820,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
19444
19820
|
global = false
|
|
19445
19821
|
}) {
|
|
19446
19822
|
const paths = this.getSettablePaths({ global });
|
|
19447
|
-
const filePath =
|
|
19823
|
+
const filePath = join120(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
19448
19824
|
const fileContent = await readFileContent(filePath);
|
|
19449
19825
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
19450
19826
|
const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -19483,11 +19859,11 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
19483
19859
|
};
|
|
19484
19860
|
|
|
19485
19861
|
// src/features/subagents/subagents-processor.ts
|
|
19486
|
-
import { basename as basename10, join as
|
|
19862
|
+
import { basename as basename10, join as join133 } from "path";
|
|
19487
19863
|
import { z as z75 } from "zod/mini";
|
|
19488
19864
|
|
|
19489
19865
|
// src/features/subagents/claudecode-subagent.ts
|
|
19490
|
-
import { join as
|
|
19866
|
+
import { join as join121 } from "path";
|
|
19491
19867
|
import { z as z65 } from "zod/mini";
|
|
19492
19868
|
var ClaudecodeSubagentFrontmatterSchema = z65.looseObject({
|
|
19493
19869
|
name: z65.string(),
|
|
@@ -19505,7 +19881,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
19505
19881
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
19506
19882
|
if (!result.success) {
|
|
19507
19883
|
throw new Error(
|
|
19508
|
-
`Invalid frontmatter in ${
|
|
19884
|
+
`Invalid frontmatter in ${join121(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
19509
19885
|
);
|
|
19510
19886
|
}
|
|
19511
19887
|
}
|
|
@@ -19517,7 +19893,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
19517
19893
|
}
|
|
19518
19894
|
static getSettablePaths(_options = {}) {
|
|
19519
19895
|
return {
|
|
19520
|
-
relativeDirPath:
|
|
19896
|
+
relativeDirPath: join121(".claude", "agents")
|
|
19521
19897
|
};
|
|
19522
19898
|
}
|
|
19523
19899
|
getFrontmatter() {
|
|
@@ -19596,7 +19972,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
19596
19972
|
return {
|
|
19597
19973
|
success: false,
|
|
19598
19974
|
error: new Error(
|
|
19599
|
-
`Invalid frontmatter in ${
|
|
19975
|
+
`Invalid frontmatter in ${join121(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
19600
19976
|
)
|
|
19601
19977
|
};
|
|
19602
19978
|
}
|
|
@@ -19614,7 +19990,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
19614
19990
|
global = false
|
|
19615
19991
|
}) {
|
|
19616
19992
|
const paths = this.getSettablePaths({ global });
|
|
19617
|
-
const filePath =
|
|
19993
|
+
const filePath = join121(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
19618
19994
|
const fileContent = await readFileContent(filePath);
|
|
19619
19995
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
19620
19996
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -19649,7 +20025,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
19649
20025
|
};
|
|
19650
20026
|
|
|
19651
20027
|
// src/features/subagents/codexcli-subagent.ts
|
|
19652
|
-
import { join as
|
|
20028
|
+
import { join as join122 } from "path";
|
|
19653
20029
|
import * as smolToml6 from "smol-toml";
|
|
19654
20030
|
import { z as z66 } from "zod/mini";
|
|
19655
20031
|
var CodexCliSubagentTomlSchema = z66.looseObject({
|
|
@@ -19680,7 +20056,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
19680
20056
|
CodexCliSubagentTomlSchema.parse(parsed);
|
|
19681
20057
|
} catch (error) {
|
|
19682
20058
|
throw new Error(
|
|
19683
|
-
`Invalid TOML in ${
|
|
20059
|
+
`Invalid TOML in ${join122(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
19684
20060
|
{ cause: error }
|
|
19685
20061
|
);
|
|
19686
20062
|
}
|
|
@@ -19692,7 +20068,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
19692
20068
|
}
|
|
19693
20069
|
static getSettablePaths(_options = {}) {
|
|
19694
20070
|
return {
|
|
19695
|
-
relativeDirPath:
|
|
20071
|
+
relativeDirPath: join122(".codex", "agents")
|
|
19696
20072
|
};
|
|
19697
20073
|
}
|
|
19698
20074
|
getBody() {
|
|
@@ -19704,7 +20080,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
19704
20080
|
parsed = CodexCliSubagentTomlSchema.parse(smolToml6.parse(this.body));
|
|
19705
20081
|
} catch (error) {
|
|
19706
20082
|
throw new Error(
|
|
19707
|
-
`Failed to parse TOML in ${
|
|
20083
|
+
`Failed to parse TOML in ${join122(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
19708
20084
|
{ cause: error }
|
|
19709
20085
|
);
|
|
19710
20086
|
}
|
|
@@ -19785,7 +20161,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
19785
20161
|
global = false
|
|
19786
20162
|
}) {
|
|
19787
20163
|
const paths = this.getSettablePaths({ global });
|
|
19788
|
-
const filePath =
|
|
20164
|
+
const filePath = join122(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
19789
20165
|
const fileContent = await readFileContent(filePath);
|
|
19790
20166
|
const subagent = new _CodexCliSubagent({
|
|
19791
20167
|
outputRoot,
|
|
@@ -19823,7 +20199,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
19823
20199
|
};
|
|
19824
20200
|
|
|
19825
20201
|
// src/features/subagents/copilot-subagent.ts
|
|
19826
|
-
import { join as
|
|
20202
|
+
import { join as join123 } from "path";
|
|
19827
20203
|
import { z as z67 } from "zod/mini";
|
|
19828
20204
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
19829
20205
|
var CopilotSubagentFrontmatterSchema = z67.looseObject({
|
|
@@ -19864,7 +20240,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
19864
20240
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
19865
20241
|
if (!result.success) {
|
|
19866
20242
|
throw new Error(
|
|
19867
|
-
`Invalid frontmatter in ${
|
|
20243
|
+
`Invalid frontmatter in ${join123(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
19868
20244
|
);
|
|
19869
20245
|
}
|
|
19870
20246
|
}
|
|
@@ -19876,7 +20252,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
19876
20252
|
}
|
|
19877
20253
|
static getSettablePaths(_options = {}) {
|
|
19878
20254
|
return {
|
|
19879
|
-
relativeDirPath:
|
|
20255
|
+
relativeDirPath: join123(".github", "agents")
|
|
19880
20256
|
};
|
|
19881
20257
|
}
|
|
19882
20258
|
getFrontmatter() {
|
|
@@ -19950,7 +20326,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
19950
20326
|
return {
|
|
19951
20327
|
success: false,
|
|
19952
20328
|
error: new Error(
|
|
19953
|
-
`Invalid frontmatter in ${
|
|
20329
|
+
`Invalid frontmatter in ${join123(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
19954
20330
|
)
|
|
19955
20331
|
};
|
|
19956
20332
|
}
|
|
@@ -19968,7 +20344,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
19968
20344
|
global = false
|
|
19969
20345
|
}) {
|
|
19970
20346
|
const paths = this.getSettablePaths({ global });
|
|
19971
|
-
const filePath =
|
|
20347
|
+
const filePath = join123(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
19972
20348
|
const fileContent = await readFileContent(filePath);
|
|
19973
20349
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
19974
20350
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -20004,7 +20380,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
20004
20380
|
};
|
|
20005
20381
|
|
|
20006
20382
|
// src/features/subagents/copilotcli-subagent.ts
|
|
20007
|
-
import { join as
|
|
20383
|
+
import { join as join124 } from "path";
|
|
20008
20384
|
import { z as z68 } from "zod/mini";
|
|
20009
20385
|
var CopilotCliSubagentFrontmatterSchema = z68.looseObject({
|
|
20010
20386
|
description: z68.string(),
|
|
@@ -20040,7 +20416,7 @@ var CopilotcliSubagent = class _CopilotcliSubagent extends ToolSubagent {
|
|
|
20040
20416
|
const result = CopilotCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
20041
20417
|
if (!result.success) {
|
|
20042
20418
|
throw new Error(
|
|
20043
|
-
`Invalid frontmatter in ${
|
|
20419
|
+
`Invalid frontmatter in ${join124(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
20044
20420
|
);
|
|
20045
20421
|
}
|
|
20046
20422
|
}
|
|
@@ -20052,9 +20428,9 @@ var CopilotcliSubagent = class _CopilotcliSubagent extends ToolSubagent {
|
|
|
20052
20428
|
global = false
|
|
20053
20429
|
} = {}) {
|
|
20054
20430
|
if (global) {
|
|
20055
|
-
return { relativeDirPath:
|
|
20431
|
+
return { relativeDirPath: join124(".copilot", "agents") };
|
|
20056
20432
|
}
|
|
20057
|
-
return { relativeDirPath:
|
|
20433
|
+
return { relativeDirPath: join124(".github", "agents") };
|
|
20058
20434
|
}
|
|
20059
20435
|
getFrontmatter() {
|
|
20060
20436
|
return this.frontmatter;
|
|
@@ -20132,7 +20508,7 @@ var CopilotcliSubagent = class _CopilotcliSubagent extends ToolSubagent {
|
|
|
20132
20508
|
return {
|
|
20133
20509
|
success: false,
|
|
20134
20510
|
error: new Error(
|
|
20135
|
-
`Invalid frontmatter in ${
|
|
20511
|
+
`Invalid frontmatter in ${join124(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
20136
20512
|
)
|
|
20137
20513
|
};
|
|
20138
20514
|
}
|
|
@@ -20149,7 +20525,7 @@ var CopilotcliSubagent = class _CopilotcliSubagent extends ToolSubagent {
|
|
|
20149
20525
|
global = false
|
|
20150
20526
|
}) {
|
|
20151
20527
|
const paths = this.getSettablePaths({ global });
|
|
20152
|
-
const filePath =
|
|
20528
|
+
const filePath = join124(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
20153
20529
|
const fileContent = await readFileContent(filePath);
|
|
20154
20530
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
20155
20531
|
const result = CopilotCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -20185,7 +20561,7 @@ var CopilotcliSubagent = class _CopilotcliSubagent extends ToolSubagent {
|
|
|
20185
20561
|
};
|
|
20186
20562
|
|
|
20187
20563
|
// src/features/subagents/cursor-subagent.ts
|
|
20188
|
-
import { join as
|
|
20564
|
+
import { join as join125 } from "path";
|
|
20189
20565
|
import { z as z69 } from "zod/mini";
|
|
20190
20566
|
var CursorSubagentFrontmatterSchema = z69.looseObject({
|
|
20191
20567
|
name: z69.string(),
|
|
@@ -20199,7 +20575,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
20199
20575
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
20200
20576
|
if (!result.success) {
|
|
20201
20577
|
throw new Error(
|
|
20202
|
-
`Invalid frontmatter in ${
|
|
20578
|
+
`Invalid frontmatter in ${join125(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
20203
20579
|
);
|
|
20204
20580
|
}
|
|
20205
20581
|
}
|
|
@@ -20211,7 +20587,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
20211
20587
|
}
|
|
20212
20588
|
static getSettablePaths(_options = {}) {
|
|
20213
20589
|
return {
|
|
20214
|
-
relativeDirPath:
|
|
20590
|
+
relativeDirPath: join125(".cursor", "agents")
|
|
20215
20591
|
};
|
|
20216
20592
|
}
|
|
20217
20593
|
getFrontmatter() {
|
|
@@ -20278,7 +20654,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
20278
20654
|
return {
|
|
20279
20655
|
success: false,
|
|
20280
20656
|
error: new Error(
|
|
20281
|
-
`Invalid frontmatter in ${
|
|
20657
|
+
`Invalid frontmatter in ${join125(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
20282
20658
|
)
|
|
20283
20659
|
};
|
|
20284
20660
|
}
|
|
@@ -20296,7 +20672,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
20296
20672
|
global = false
|
|
20297
20673
|
}) {
|
|
20298
20674
|
const paths = this.getSettablePaths({ global });
|
|
20299
|
-
const filePath =
|
|
20675
|
+
const filePath = join125(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
20300
20676
|
const fileContent = await readFileContent(filePath);
|
|
20301
20677
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
20302
20678
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -20332,7 +20708,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
20332
20708
|
};
|
|
20333
20709
|
|
|
20334
20710
|
// src/features/subagents/deepagents-subagent.ts
|
|
20335
|
-
import { join as
|
|
20711
|
+
import { join as join126 } from "path";
|
|
20336
20712
|
import { z as z70 } from "zod/mini";
|
|
20337
20713
|
var DeepagentsSubagentFrontmatterSchema = z70.looseObject({
|
|
20338
20714
|
name: z70.string(),
|
|
@@ -20347,7 +20723,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
20347
20723
|
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
20348
20724
|
if (!result.success) {
|
|
20349
20725
|
throw new Error(
|
|
20350
|
-
`Invalid frontmatter in ${
|
|
20726
|
+
`Invalid frontmatter in ${join126(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
20351
20727
|
);
|
|
20352
20728
|
}
|
|
20353
20729
|
}
|
|
@@ -20357,7 +20733,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
20357
20733
|
}
|
|
20358
20734
|
static getSettablePaths(_options = {}) {
|
|
20359
20735
|
return {
|
|
20360
|
-
relativeDirPath:
|
|
20736
|
+
relativeDirPath: join126(".deepagents", "agents")
|
|
20361
20737
|
};
|
|
20362
20738
|
}
|
|
20363
20739
|
getFrontmatter() {
|
|
@@ -20432,7 +20808,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
20432
20808
|
return {
|
|
20433
20809
|
success: false,
|
|
20434
20810
|
error: new Error(
|
|
20435
|
-
`Invalid frontmatter in ${
|
|
20811
|
+
`Invalid frontmatter in ${join126(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
20436
20812
|
)
|
|
20437
20813
|
};
|
|
20438
20814
|
}
|
|
@@ -20450,7 +20826,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
20450
20826
|
global = false
|
|
20451
20827
|
}) {
|
|
20452
20828
|
const paths = this.getSettablePaths({ global });
|
|
20453
|
-
const filePath =
|
|
20829
|
+
const filePath = join126(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
20454
20830
|
const fileContent = await readFileContent(filePath);
|
|
20455
20831
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
20456
20832
|
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -20485,7 +20861,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
20485
20861
|
};
|
|
20486
20862
|
|
|
20487
20863
|
// src/features/subagents/junie-subagent.ts
|
|
20488
|
-
import { join as
|
|
20864
|
+
import { join as join127 } from "path";
|
|
20489
20865
|
import { z as z71 } from "zod/mini";
|
|
20490
20866
|
var JunieSubagentFrontmatterSchema = z71.looseObject({
|
|
20491
20867
|
name: z71.optional(z71.string()),
|
|
@@ -20499,7 +20875,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
20499
20875
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
20500
20876
|
if (!result.success) {
|
|
20501
20877
|
throw new Error(
|
|
20502
|
-
`Invalid frontmatter in ${
|
|
20878
|
+
`Invalid frontmatter in ${join127(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
20503
20879
|
);
|
|
20504
20880
|
}
|
|
20505
20881
|
}
|
|
@@ -20514,7 +20890,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
20514
20890
|
throw new Error("JunieSubagent does not support global mode.");
|
|
20515
20891
|
}
|
|
20516
20892
|
return {
|
|
20517
|
-
relativeDirPath:
|
|
20893
|
+
relativeDirPath: join127(".junie", "agents")
|
|
20518
20894
|
};
|
|
20519
20895
|
}
|
|
20520
20896
|
getFrontmatter() {
|
|
@@ -20590,7 +20966,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
20590
20966
|
return {
|
|
20591
20967
|
success: false,
|
|
20592
20968
|
error: new Error(
|
|
20593
|
-
`Invalid frontmatter in ${
|
|
20969
|
+
`Invalid frontmatter in ${join127(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
20594
20970
|
)
|
|
20595
20971
|
};
|
|
20596
20972
|
}
|
|
@@ -20608,7 +20984,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
20608
20984
|
global = false
|
|
20609
20985
|
}) {
|
|
20610
20986
|
const paths = this.getSettablePaths({ global });
|
|
20611
|
-
const filePath =
|
|
20987
|
+
const filePath = join127(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
20612
20988
|
const fileContent = await readFileContent(filePath);
|
|
20613
20989
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
20614
20990
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -20643,11 +21019,11 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
20643
21019
|
};
|
|
20644
21020
|
|
|
20645
21021
|
// src/features/subagents/kilo-subagent.ts
|
|
20646
|
-
import { join as
|
|
21022
|
+
import { join as join129 } from "path";
|
|
20647
21023
|
import { z as z73 } from "zod/mini";
|
|
20648
21024
|
|
|
20649
21025
|
// src/features/subagents/opencode-style-subagent.ts
|
|
20650
|
-
import { basename as basename9, join as
|
|
21026
|
+
import { basename as basename9, join as join128 } from "path";
|
|
20651
21027
|
import { z as z72 } from "zod/mini";
|
|
20652
21028
|
var OpenCodeStyleSubagentFrontmatterSchema = z72.looseObject({
|
|
20653
21029
|
description: z72.optional(z72.string()),
|
|
@@ -20662,7 +21038,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
20662
21038
|
const result = OpenCodeStyleSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
20663
21039
|
if (!result.success) {
|
|
20664
21040
|
throw new Error(
|
|
20665
|
-
`Invalid frontmatter in ${
|
|
21041
|
+
`Invalid frontmatter in ${join128(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
20666
21042
|
);
|
|
20667
21043
|
}
|
|
20668
21044
|
}
|
|
@@ -20704,7 +21080,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
20704
21080
|
return {
|
|
20705
21081
|
success: false,
|
|
20706
21082
|
error: new Error(
|
|
20707
|
-
`Invalid frontmatter in ${
|
|
21083
|
+
`Invalid frontmatter in ${join128(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
20708
21084
|
)
|
|
20709
21085
|
};
|
|
20710
21086
|
}
|
|
@@ -20755,7 +21131,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
20755
21131
|
return {
|
|
20756
21132
|
success: false,
|
|
20757
21133
|
error: new Error(
|
|
20758
|
-
`Invalid frontmatter in ${
|
|
21134
|
+
`Invalid frontmatter in ${join129(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
20759
21135
|
)
|
|
20760
21136
|
};
|
|
20761
21137
|
}
|
|
@@ -20763,7 +21139,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
20763
21139
|
global = false
|
|
20764
21140
|
} = {}) {
|
|
20765
21141
|
return {
|
|
20766
|
-
relativeDirPath: global ?
|
|
21142
|
+
relativeDirPath: global ? join129(".config", "kilo", "agent") : join129(".kilo", "agent")
|
|
20767
21143
|
};
|
|
20768
21144
|
}
|
|
20769
21145
|
static fromRulesyncSubagent({
|
|
@@ -20812,7 +21188,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
20812
21188
|
global = false
|
|
20813
21189
|
}) {
|
|
20814
21190
|
const paths = this.getSettablePaths({ global });
|
|
20815
|
-
const filePath =
|
|
21191
|
+
const filePath = join129(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
20816
21192
|
const fileContent = await readFileContent(filePath);
|
|
20817
21193
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
20818
21194
|
const result = KiloSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -20850,7 +21226,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
20850
21226
|
};
|
|
20851
21227
|
|
|
20852
21228
|
// src/features/subagents/kiro-subagent.ts
|
|
20853
|
-
import { join as
|
|
21229
|
+
import { join as join130 } from "path";
|
|
20854
21230
|
import { z as z74 } from "zod/mini";
|
|
20855
21231
|
var KiroCliSubagentJsonSchema = z74.looseObject({
|
|
20856
21232
|
name: z74.string(),
|
|
@@ -20877,7 +21253,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
20877
21253
|
KiroCliSubagentJsonSchema.parse(parsed);
|
|
20878
21254
|
} catch (error) {
|
|
20879
21255
|
throw new Error(
|
|
20880
|
-
`Invalid JSON in ${
|
|
21256
|
+
`Invalid JSON in ${join130(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
20881
21257
|
{ cause: error }
|
|
20882
21258
|
);
|
|
20883
21259
|
}
|
|
@@ -20889,7 +21265,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
20889
21265
|
}
|
|
20890
21266
|
static getSettablePaths(_options = {}) {
|
|
20891
21267
|
return {
|
|
20892
|
-
relativeDirPath:
|
|
21268
|
+
relativeDirPath: join130(".kiro", "agents")
|
|
20893
21269
|
};
|
|
20894
21270
|
}
|
|
20895
21271
|
getBody() {
|
|
@@ -20901,7 +21277,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
20901
21277
|
parsed = JSON.parse(this.body);
|
|
20902
21278
|
} catch (error) {
|
|
20903
21279
|
throw new Error(
|
|
20904
|
-
`Failed to parse JSON in ${
|
|
21280
|
+
`Failed to parse JSON in ${join130(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
20905
21281
|
{ cause: error }
|
|
20906
21282
|
);
|
|
20907
21283
|
}
|
|
@@ -20982,7 +21358,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
20982
21358
|
global = false
|
|
20983
21359
|
}) {
|
|
20984
21360
|
const paths = this.getSettablePaths({ global });
|
|
20985
|
-
const filePath =
|
|
21361
|
+
const filePath = join130(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
20986
21362
|
const fileContent = await readFileContent(filePath);
|
|
20987
21363
|
const subagent = new _KiroSubagent({
|
|
20988
21364
|
outputRoot,
|
|
@@ -21020,7 +21396,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
21020
21396
|
};
|
|
21021
21397
|
|
|
21022
21398
|
// src/features/subagents/opencode-subagent.ts
|
|
21023
|
-
import { join as
|
|
21399
|
+
import { join as join131 } from "path";
|
|
21024
21400
|
var OpenCodeSubagentFrontmatterSchema = OpenCodeStyleSubagentFrontmatterSchema;
|
|
21025
21401
|
var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
21026
21402
|
getToolTarget() {
|
|
@@ -21030,7 +21406,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
21030
21406
|
global = false
|
|
21031
21407
|
} = {}) {
|
|
21032
21408
|
return {
|
|
21033
|
-
relativeDirPath: global ?
|
|
21409
|
+
relativeDirPath: global ? join131(".config", "opencode", "agent") : join131(".opencode", "agent")
|
|
21034
21410
|
};
|
|
21035
21411
|
}
|
|
21036
21412
|
static fromRulesyncSubagent({
|
|
@@ -21074,7 +21450,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
21074
21450
|
global = false
|
|
21075
21451
|
}) {
|
|
21076
21452
|
const paths = this.getSettablePaths({ global });
|
|
21077
|
-
const filePath =
|
|
21453
|
+
const filePath = join131(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
21078
21454
|
const fileContent = await readFileContent(filePath);
|
|
21079
21455
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
21080
21456
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -21112,7 +21488,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
21112
21488
|
};
|
|
21113
21489
|
|
|
21114
21490
|
// src/features/subagents/takt-subagent.ts
|
|
21115
|
-
import { join as
|
|
21491
|
+
import { join as join132 } from "path";
|
|
21116
21492
|
var DEFAULT_TAKT_SUBAGENT_DIR = "personas";
|
|
21117
21493
|
var TaktSubagent = class _TaktSubagent extends ToolSubagent {
|
|
21118
21494
|
body;
|
|
@@ -21124,7 +21500,7 @@ var TaktSubagent = class _TaktSubagent extends ToolSubagent {
|
|
|
21124
21500
|
}
|
|
21125
21501
|
static getSettablePaths(_options = {}) {
|
|
21126
21502
|
return {
|
|
21127
|
-
relativeDirPath:
|
|
21503
|
+
relativeDirPath: join132(".takt", "facets", DEFAULT_TAKT_SUBAGENT_DIR)
|
|
21128
21504
|
};
|
|
21129
21505
|
}
|
|
21130
21506
|
getBody() {
|
|
@@ -21186,7 +21562,7 @@ var TaktSubagent = class _TaktSubagent extends ToolSubagent {
|
|
|
21186
21562
|
global = false
|
|
21187
21563
|
}) {
|
|
21188
21564
|
const paths = this.getSettablePaths({ global });
|
|
21189
|
-
const filePath =
|
|
21565
|
+
const filePath = join132(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
21190
21566
|
const fileContent = await readFileContent(filePath);
|
|
21191
21567
|
const { body } = parseFrontmatter(fileContent, filePath);
|
|
21192
21568
|
return new _TaktSubagent({
|
|
@@ -21443,7 +21819,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
21443
21819
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
21444
21820
|
*/
|
|
21445
21821
|
async loadRulesyncFiles() {
|
|
21446
|
-
const subagentsDir =
|
|
21822
|
+
const subagentsDir = join133(this.inputRoot, RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
21447
21823
|
const dirExists = await directoryExists(subagentsDir);
|
|
21448
21824
|
if (!dirExists) {
|
|
21449
21825
|
this.logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -21458,7 +21834,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
21458
21834
|
this.logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
21459
21835
|
const rulesyncSubagents = [];
|
|
21460
21836
|
for (const mdFile of mdFiles) {
|
|
21461
|
-
const filepath =
|
|
21837
|
+
const filepath = join133(subagentsDir, mdFile);
|
|
21462
21838
|
try {
|
|
21463
21839
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
21464
21840
|
outputRoot: this.inputRoot,
|
|
@@ -21489,7 +21865,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
21489
21865
|
const factory = this.getFactory(this.toolTarget);
|
|
21490
21866
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
21491
21867
|
const subagentFilePaths = await findFilesByGlobs(
|
|
21492
|
-
|
|
21868
|
+
join133(this.outputRoot, paths.relativeDirPath, factory.meta.filePattern)
|
|
21493
21869
|
);
|
|
21494
21870
|
if (forDeletion) {
|
|
21495
21871
|
const toolSubagents2 = subagentFilePaths.map(
|
|
@@ -21556,13 +21932,13 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
21556
21932
|
};
|
|
21557
21933
|
|
|
21558
21934
|
// src/features/rules/agentsmd-rule.ts
|
|
21559
|
-
import { join as
|
|
21935
|
+
import { join as join136 } from "path";
|
|
21560
21936
|
|
|
21561
21937
|
// src/features/rules/tool-rule.ts
|
|
21562
|
-
import { join as
|
|
21938
|
+
import { join as join135 } from "path";
|
|
21563
21939
|
|
|
21564
21940
|
// src/features/rules/rulesync-rule.ts
|
|
21565
|
-
import { join as
|
|
21941
|
+
import { join as join134 } from "path";
|
|
21566
21942
|
import { z as z76 } from "zod/mini";
|
|
21567
21943
|
var RulesyncRuleFrontmatterSchema = z76.object({
|
|
21568
21944
|
root: z76.optional(z76.boolean()),
|
|
@@ -21615,7 +21991,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
21615
21991
|
const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
21616
21992
|
if (!parseResult.success && rest.validate !== false) {
|
|
21617
21993
|
throw new Error(
|
|
21618
|
-
`Invalid frontmatter in ${
|
|
21994
|
+
`Invalid frontmatter in ${join134(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
21619
21995
|
);
|
|
21620
21996
|
}
|
|
21621
21997
|
const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
|
|
@@ -21650,7 +22026,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
21650
22026
|
return {
|
|
21651
22027
|
success: false,
|
|
21652
22028
|
error: new Error(
|
|
21653
|
-
`Invalid frontmatter in ${
|
|
22029
|
+
`Invalid frontmatter in ${join134(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
21654
22030
|
)
|
|
21655
22031
|
};
|
|
21656
22032
|
}
|
|
@@ -21660,7 +22036,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
21660
22036
|
relativeFilePath,
|
|
21661
22037
|
validate = true
|
|
21662
22038
|
}) {
|
|
21663
|
-
const filePath =
|
|
22039
|
+
const filePath = join134(
|
|
21664
22040
|
outputRoot,
|
|
21665
22041
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
21666
22042
|
relativeFilePath
|
|
@@ -21759,7 +22135,7 @@ var ToolRule = class extends ToolFile {
|
|
|
21759
22135
|
rulesyncRule,
|
|
21760
22136
|
validate = true,
|
|
21761
22137
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
21762
|
-
nonRootPath = { relativeDirPath:
|
|
22138
|
+
nonRootPath = { relativeDirPath: join135(".agents", "memories") }
|
|
21763
22139
|
}) {
|
|
21764
22140
|
const params = this.buildToolRuleParamsDefault({
|
|
21765
22141
|
outputRoot,
|
|
@@ -21770,7 +22146,7 @@ var ToolRule = class extends ToolFile {
|
|
|
21770
22146
|
});
|
|
21771
22147
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
21772
22148
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
21773
|
-
params.relativeDirPath =
|
|
22149
|
+
params.relativeDirPath = join135(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
21774
22150
|
params.relativeFilePath = "AGENTS.md";
|
|
21775
22151
|
}
|
|
21776
22152
|
return params;
|
|
@@ -21819,7 +22195,7 @@ var ToolRule = class extends ToolFile {
|
|
|
21819
22195
|
}
|
|
21820
22196
|
};
|
|
21821
22197
|
function buildToolPath(toolDir, subDir, excludeToolDir) {
|
|
21822
|
-
return excludeToolDir ? subDir :
|
|
22198
|
+
return excludeToolDir ? subDir : join135(toolDir, subDir);
|
|
21823
22199
|
}
|
|
21824
22200
|
|
|
21825
22201
|
// src/features/rules/agentsmd-rule.ts
|
|
@@ -21848,8 +22224,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
21848
22224
|
validate = true
|
|
21849
22225
|
}) {
|
|
21850
22226
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
21851
|
-
const relativePath = isRoot ? "AGENTS.md" :
|
|
21852
|
-
const fileContent = await readFileContent(
|
|
22227
|
+
const relativePath = isRoot ? "AGENTS.md" : join136(".agents", "memories", relativeFilePath);
|
|
22228
|
+
const fileContent = await readFileContent(join136(outputRoot, relativePath));
|
|
21853
22229
|
return new _AgentsMdRule({
|
|
21854
22230
|
outputRoot,
|
|
21855
22231
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -21904,7 +22280,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
21904
22280
|
};
|
|
21905
22281
|
|
|
21906
22282
|
// src/features/rules/antigravity-cli-rule.ts
|
|
21907
|
-
import { join as
|
|
22283
|
+
import { join as join137 } from "path";
|
|
21908
22284
|
var AntigravityCliRule = class _AntigravityCliRule extends ToolRule {
|
|
21909
22285
|
static getSettablePaths({
|
|
21910
22286
|
global,
|
|
@@ -21939,7 +22315,7 @@ var AntigravityCliRule = class _AntigravityCliRule extends ToolRule {
|
|
|
21939
22315
|
if (isRoot) {
|
|
21940
22316
|
const relativePath2 = paths.root.relativeFilePath;
|
|
21941
22317
|
const fileContent2 = await readFileContent(
|
|
21942
|
-
|
|
22318
|
+
join137(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
21943
22319
|
);
|
|
21944
22320
|
return new _AntigravityCliRule({
|
|
21945
22321
|
outputRoot,
|
|
@@ -21953,8 +22329,8 @@ var AntigravityCliRule = class _AntigravityCliRule extends ToolRule {
|
|
|
21953
22329
|
if (!paths.nonRoot) {
|
|
21954
22330
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
21955
22331
|
}
|
|
21956
|
-
const relativePath =
|
|
21957
|
-
const fileContent = await readFileContent(
|
|
22332
|
+
const relativePath = join137(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
22333
|
+
const fileContent = await readFileContent(join137(outputRoot, relativePath));
|
|
21958
22334
|
return new _AntigravityCliRule({
|
|
21959
22335
|
outputRoot,
|
|
21960
22336
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -22013,10 +22389,10 @@ var AntigravityCliRule = class _AntigravityCliRule extends ToolRule {
|
|
|
22013
22389
|
};
|
|
22014
22390
|
|
|
22015
22391
|
// src/features/rules/antigravity-ide-rule.ts
|
|
22016
|
-
import { join as
|
|
22392
|
+
import { join as join139 } from "path";
|
|
22017
22393
|
|
|
22018
22394
|
// src/features/rules/antigravity-rule.ts
|
|
22019
|
-
import { join as
|
|
22395
|
+
import { join as join138 } from "path";
|
|
22020
22396
|
import { z as z77 } from "zod/mini";
|
|
22021
22397
|
var AntigravityRuleFrontmatterSchema = z77.looseObject({
|
|
22022
22398
|
trigger: z77.optional(
|
|
@@ -22175,7 +22551,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
22175
22551
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
22176
22552
|
if (!result.success) {
|
|
22177
22553
|
throw new Error(
|
|
22178
|
-
`Invalid frontmatter in ${
|
|
22554
|
+
`Invalid frontmatter in ${join138(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
22179
22555
|
);
|
|
22180
22556
|
}
|
|
22181
22557
|
}
|
|
@@ -22199,7 +22575,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
22199
22575
|
relativeFilePath,
|
|
22200
22576
|
validate = true
|
|
22201
22577
|
}) {
|
|
22202
|
-
const filePath =
|
|
22578
|
+
const filePath = join138(
|
|
22203
22579
|
outputRoot,
|
|
22204
22580
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
22205
22581
|
relativeFilePath
|
|
@@ -22347,7 +22723,7 @@ var AntigravityIdeRule = class _AntigravityIdeRule extends ToolRule {
|
|
|
22347
22723
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
22348
22724
|
if (!result.success) {
|
|
22349
22725
|
throw new Error(
|
|
22350
|
-
`Invalid frontmatter in ${
|
|
22726
|
+
`Invalid frontmatter in ${join139(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
22351
22727
|
);
|
|
22352
22728
|
}
|
|
22353
22729
|
}
|
|
@@ -22390,7 +22766,7 @@ var AntigravityIdeRule = class _AntigravityIdeRule extends ToolRule {
|
|
|
22390
22766
|
if (global) {
|
|
22391
22767
|
const rootPath = _AntigravityIdeRule.getGlobalRootPath();
|
|
22392
22768
|
const fileContent2 = await readFileContent(
|
|
22393
|
-
|
|
22769
|
+
join139(outputRoot, rootPath.relativeDirPath, rootPath.relativeFilePath)
|
|
22394
22770
|
);
|
|
22395
22771
|
return new _AntigravityIdeRule({
|
|
22396
22772
|
outputRoot,
|
|
@@ -22403,7 +22779,7 @@ var AntigravityIdeRule = class _AntigravityIdeRule extends ToolRule {
|
|
|
22403
22779
|
});
|
|
22404
22780
|
}
|
|
22405
22781
|
const nonRootDirPath = buildToolPath(".agents", "rules");
|
|
22406
|
-
const filePath =
|
|
22782
|
+
const filePath = join139(outputRoot, nonRootDirPath, relativeFilePath);
|
|
22407
22783
|
const fileContent = await readFileContent(filePath);
|
|
22408
22784
|
const { frontmatter, body } = parseFrontmatter(fileContent, filePath);
|
|
22409
22785
|
let parsedFrontmatter;
|
|
@@ -22532,7 +22908,7 @@ var AntigravityIdeRule = class _AntigravityIdeRule extends ToolRule {
|
|
|
22532
22908
|
};
|
|
22533
22909
|
|
|
22534
22910
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
22535
|
-
import { join as
|
|
22911
|
+
import { join as join140 } from "path";
|
|
22536
22912
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
22537
22913
|
toRulesyncRule() {
|
|
22538
22914
|
const rulesyncFrontmatter = {
|
|
@@ -22592,8 +22968,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
22592
22968
|
}) {
|
|
22593
22969
|
const settablePaths = this.getSettablePaths();
|
|
22594
22970
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
22595
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath :
|
|
22596
|
-
const fileContent = await readFileContent(
|
|
22971
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : join140(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
22972
|
+
const fileContent = await readFileContent(join140(outputRoot, relativePath));
|
|
22597
22973
|
return new _AugmentcodeLegacyRule({
|
|
22598
22974
|
outputRoot,
|
|
22599
22975
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -22622,7 +22998,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
22622
22998
|
};
|
|
22623
22999
|
|
|
22624
23000
|
// src/features/rules/augmentcode-rule.ts
|
|
22625
|
-
import { join as
|
|
23001
|
+
import { join as join141 } from "path";
|
|
22626
23002
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
22627
23003
|
toRulesyncRule() {
|
|
22628
23004
|
return this.toRulesyncRuleDefault();
|
|
@@ -22653,7 +23029,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
22653
23029
|
relativeFilePath,
|
|
22654
23030
|
validate = true
|
|
22655
23031
|
}) {
|
|
22656
|
-
const filePath =
|
|
23032
|
+
const filePath = join141(
|
|
22657
23033
|
outputRoot,
|
|
22658
23034
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
22659
23035
|
relativeFilePath
|
|
@@ -22693,7 +23069,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
22693
23069
|
};
|
|
22694
23070
|
|
|
22695
23071
|
// src/features/rules/claudecode-legacy-rule.ts
|
|
22696
|
-
import { join as
|
|
23072
|
+
import { join as join142 } from "path";
|
|
22697
23073
|
var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
22698
23074
|
static getSettablePaths({
|
|
22699
23075
|
global,
|
|
@@ -22735,7 +23111,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
22735
23111
|
if (isRoot) {
|
|
22736
23112
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
22737
23113
|
const fileContent2 = await readFileContent(
|
|
22738
|
-
|
|
23114
|
+
join142(outputRoot, rootDirPath, paths.root.relativeFilePath)
|
|
22739
23115
|
);
|
|
22740
23116
|
return new _ClaudecodeLegacyRule({
|
|
22741
23117
|
outputRoot,
|
|
@@ -22749,8 +23125,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
22749
23125
|
if (!paths.nonRoot) {
|
|
22750
23126
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
22751
23127
|
}
|
|
22752
|
-
const relativePath =
|
|
22753
|
-
const fileContent = await readFileContent(
|
|
23128
|
+
const relativePath = join142(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
23129
|
+
const fileContent = await readFileContent(join142(outputRoot, relativePath));
|
|
22754
23130
|
return new _ClaudecodeLegacyRule({
|
|
22755
23131
|
outputRoot,
|
|
22756
23132
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -22809,7 +23185,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
22809
23185
|
};
|
|
22810
23186
|
|
|
22811
23187
|
// src/features/rules/claudecode-rule.ts
|
|
22812
|
-
import { join as
|
|
23188
|
+
import { join as join143 } from "path";
|
|
22813
23189
|
import { z as z78 } from "zod/mini";
|
|
22814
23190
|
var ClaudecodeRuleFrontmatterSchema = z78.object({
|
|
22815
23191
|
paths: z78.optional(z78.array(z78.string()))
|
|
@@ -22850,7 +23226,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
22850
23226
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
22851
23227
|
if (!result.success) {
|
|
22852
23228
|
throw new Error(
|
|
22853
|
-
`Invalid frontmatter in ${
|
|
23229
|
+
`Invalid frontmatter in ${join143(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
22854
23230
|
);
|
|
22855
23231
|
}
|
|
22856
23232
|
}
|
|
@@ -22880,7 +23256,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
22880
23256
|
if (isRoot) {
|
|
22881
23257
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
22882
23258
|
const fileContent2 = await readFileContent(
|
|
22883
|
-
|
|
23259
|
+
join143(outputRoot, rootDirPath, paths.root.relativeFilePath)
|
|
22884
23260
|
);
|
|
22885
23261
|
return new _ClaudecodeRule({
|
|
22886
23262
|
outputRoot,
|
|
@@ -22895,8 +23271,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
22895
23271
|
if (!paths.nonRoot) {
|
|
22896
23272
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
22897
23273
|
}
|
|
22898
|
-
const relativePath =
|
|
22899
|
-
const filePath =
|
|
23274
|
+
const relativePath = join143(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
23275
|
+
const filePath = join143(outputRoot, relativePath);
|
|
22900
23276
|
const fileContent = await readFileContent(filePath);
|
|
22901
23277
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
22902
23278
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -23007,7 +23383,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
23007
23383
|
return {
|
|
23008
23384
|
success: false,
|
|
23009
23385
|
error: new Error(
|
|
23010
|
-
`Invalid frontmatter in ${
|
|
23386
|
+
`Invalid frontmatter in ${join143(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
23011
23387
|
)
|
|
23012
23388
|
};
|
|
23013
23389
|
}
|
|
@@ -23027,7 +23403,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
23027
23403
|
};
|
|
23028
23404
|
|
|
23029
23405
|
// src/features/rules/cline-rule.ts
|
|
23030
|
-
import { join as
|
|
23406
|
+
import { join as join144 } from "path";
|
|
23031
23407
|
import { z as z79 } from "zod/mini";
|
|
23032
23408
|
var ClineRuleFrontmatterSchema = z79.object({
|
|
23033
23409
|
description: z79.string()
|
|
@@ -23073,7 +23449,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
23073
23449
|
validate = true
|
|
23074
23450
|
}) {
|
|
23075
23451
|
const fileContent = await readFileContent(
|
|
23076
|
-
|
|
23452
|
+
join144(outputRoot, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
23077
23453
|
);
|
|
23078
23454
|
return new _ClineRule({
|
|
23079
23455
|
outputRoot,
|
|
@@ -23099,7 +23475,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
23099
23475
|
};
|
|
23100
23476
|
|
|
23101
23477
|
// src/features/rules/codexcli-rule.ts
|
|
23102
|
-
import { join as
|
|
23478
|
+
import { join as join145 } from "path";
|
|
23103
23479
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
23104
23480
|
static getSettablePaths({
|
|
23105
23481
|
global,
|
|
@@ -23134,7 +23510,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
23134
23510
|
if (isRoot) {
|
|
23135
23511
|
const relativePath2 = paths.root.relativeFilePath;
|
|
23136
23512
|
const fileContent2 = await readFileContent(
|
|
23137
|
-
|
|
23513
|
+
join145(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
23138
23514
|
);
|
|
23139
23515
|
return new _CodexcliRule({
|
|
23140
23516
|
outputRoot,
|
|
@@ -23148,8 +23524,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
23148
23524
|
if (!paths.nonRoot) {
|
|
23149
23525
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
23150
23526
|
}
|
|
23151
|
-
const relativePath =
|
|
23152
|
-
const fileContent = await readFileContent(
|
|
23527
|
+
const relativePath = join145(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
23528
|
+
const fileContent = await readFileContent(join145(outputRoot, relativePath));
|
|
23153
23529
|
return new _CodexcliRule({
|
|
23154
23530
|
outputRoot,
|
|
23155
23531
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -23208,7 +23584,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
23208
23584
|
};
|
|
23209
23585
|
|
|
23210
23586
|
// src/features/rules/copilot-rule.ts
|
|
23211
|
-
import { join as
|
|
23587
|
+
import { join as join146 } from "path";
|
|
23212
23588
|
import { z as z80 } from "zod/mini";
|
|
23213
23589
|
var CopilotRuleFrontmatterSchema = z80.object({
|
|
23214
23590
|
description: z80.optional(z80.string()),
|
|
@@ -23216,7 +23592,7 @@ var CopilotRuleFrontmatterSchema = z80.object({
|
|
|
23216
23592
|
excludeAgent: z80.optional(z80.union([z80.literal("code-review"), z80.literal("coding-agent")]))
|
|
23217
23593
|
});
|
|
23218
23594
|
var normalizeRelativePath = (p) => toPosixPath(p).replace(/\/+/g, "/");
|
|
23219
|
-
var sameRelativePath = (left, right) => normalizeRelativePath(
|
|
23595
|
+
var sameRelativePath = (left, right) => normalizeRelativePath(join146(left.dir, left.file)) === normalizeRelativePath(join146(right.dir, right.file));
|
|
23220
23596
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
23221
23597
|
frontmatter;
|
|
23222
23598
|
body;
|
|
@@ -23247,7 +23623,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
23247
23623
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
23248
23624
|
if (!result.success) {
|
|
23249
23625
|
throw new Error(
|
|
23250
|
-
`Invalid frontmatter in ${
|
|
23626
|
+
`Invalid frontmatter in ${join146(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
23251
23627
|
);
|
|
23252
23628
|
}
|
|
23253
23629
|
}
|
|
@@ -23340,8 +23716,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
23340
23716
|
) : relativeFilePath === paths.root.relativeFilePath;
|
|
23341
23717
|
const resolvedRelativeDirPath = relativeDirPath ?? (isRoot ? paths.root.relativeDirPath : paths.nonRoot?.relativeDirPath ?? paths.root.relativeDirPath);
|
|
23342
23718
|
if (isRoot) {
|
|
23343
|
-
const relativePath2 =
|
|
23344
|
-
const filePath2 =
|
|
23719
|
+
const relativePath2 = join146(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
23720
|
+
const filePath2 = join146(outputRoot, relativePath2);
|
|
23345
23721
|
const fileContent2 = await readFileContent(filePath2);
|
|
23346
23722
|
return new _CopilotRule({
|
|
23347
23723
|
outputRoot,
|
|
@@ -23356,8 +23732,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
23356
23732
|
if (!paths.nonRoot) {
|
|
23357
23733
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
23358
23734
|
}
|
|
23359
|
-
const relativePath =
|
|
23360
|
-
const filePath =
|
|
23735
|
+
const relativePath = join146(resolvedRelativeDirPath, relativeFilePath);
|
|
23736
|
+
const filePath = join146(outputRoot, relativePath);
|
|
23361
23737
|
const fileContent = await readFileContent(filePath);
|
|
23362
23738
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
23363
23739
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -23406,7 +23782,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
23406
23782
|
return {
|
|
23407
23783
|
success: false,
|
|
23408
23784
|
error: new Error(
|
|
23409
|
-
`Invalid frontmatter in ${
|
|
23785
|
+
`Invalid frontmatter in ${join146(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
23410
23786
|
)
|
|
23411
23787
|
};
|
|
23412
23788
|
}
|
|
@@ -23462,7 +23838,7 @@ var CopilotcliRule = class _CopilotcliRule extends CopilotRule {
|
|
|
23462
23838
|
};
|
|
23463
23839
|
|
|
23464
23840
|
// src/features/rules/cursor-rule.ts
|
|
23465
|
-
import { join as
|
|
23841
|
+
import { join as join147 } from "path";
|
|
23466
23842
|
import { z as z81 } from "zod/mini";
|
|
23467
23843
|
var CursorRuleFrontmatterSchema = z81.object({
|
|
23468
23844
|
description: z81.optional(z81.string()),
|
|
@@ -23484,7 +23860,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
23484
23860
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
23485
23861
|
if (!result.success) {
|
|
23486
23862
|
throw new Error(
|
|
23487
|
-
`Invalid frontmatter in ${
|
|
23863
|
+
`Invalid frontmatter in ${join147(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
23488
23864
|
);
|
|
23489
23865
|
}
|
|
23490
23866
|
}
|
|
@@ -23600,7 +23976,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
23600
23976
|
relativeFilePath,
|
|
23601
23977
|
validate = true
|
|
23602
23978
|
}) {
|
|
23603
|
-
const filePath =
|
|
23979
|
+
const filePath = join147(
|
|
23604
23980
|
outputRoot,
|
|
23605
23981
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
23606
23982
|
relativeFilePath
|
|
@@ -23610,7 +23986,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
23610
23986
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
23611
23987
|
if (!result.success) {
|
|
23612
23988
|
throw new Error(
|
|
23613
|
-
`Invalid frontmatter in ${
|
|
23989
|
+
`Invalid frontmatter in ${join147(outputRoot, relativeFilePath)}: ${formatError(result.error)}`
|
|
23614
23990
|
);
|
|
23615
23991
|
}
|
|
23616
23992
|
return new _CursorRule({
|
|
@@ -23647,7 +24023,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
23647
24023
|
return {
|
|
23648
24024
|
success: false,
|
|
23649
24025
|
error: new Error(
|
|
23650
|
-
`Invalid frontmatter in ${
|
|
24026
|
+
`Invalid frontmatter in ${join147(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
23651
24027
|
)
|
|
23652
24028
|
};
|
|
23653
24029
|
}
|
|
@@ -23667,7 +24043,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
23667
24043
|
};
|
|
23668
24044
|
|
|
23669
24045
|
// src/features/rules/deepagents-rule.ts
|
|
23670
|
-
import { join as
|
|
24046
|
+
import { join as join148 } from "path";
|
|
23671
24047
|
var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
23672
24048
|
constructor({ fileContent, root, ...rest }) {
|
|
23673
24049
|
super({
|
|
@@ -23694,8 +24070,8 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
23694
24070
|
}) {
|
|
23695
24071
|
const settablePaths = this.getSettablePaths();
|
|
23696
24072
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
23697
|
-
const relativePath = isRoot ?
|
|
23698
|
-
const fileContent = await readFileContent(
|
|
24073
|
+
const relativePath = isRoot ? join148(".deepagents", "AGENTS.md") : join148(".deepagents", "memories", relativeFilePath);
|
|
24074
|
+
const fileContent = await readFileContent(join148(outputRoot, relativePath));
|
|
23699
24075
|
return new _DeepagentsRule({
|
|
23700
24076
|
outputRoot,
|
|
23701
24077
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -23750,7 +24126,7 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
23750
24126
|
};
|
|
23751
24127
|
|
|
23752
24128
|
// src/features/rules/factorydroid-rule.ts
|
|
23753
|
-
import { join as
|
|
24129
|
+
import { join as join149 } from "path";
|
|
23754
24130
|
var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
23755
24131
|
constructor({ fileContent, root, ...rest }) {
|
|
23756
24132
|
super({
|
|
@@ -23790,8 +24166,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
23790
24166
|
const paths = this.getSettablePaths({ global });
|
|
23791
24167
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
23792
24168
|
if (isRoot) {
|
|
23793
|
-
const relativePath2 =
|
|
23794
|
-
const fileContent2 = await readFileContent(
|
|
24169
|
+
const relativePath2 = join149(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
24170
|
+
const fileContent2 = await readFileContent(join149(outputRoot, relativePath2));
|
|
23795
24171
|
return new _FactorydroidRule({
|
|
23796
24172
|
outputRoot,
|
|
23797
24173
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -23804,8 +24180,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
23804
24180
|
if (!paths.nonRoot) {
|
|
23805
24181
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
23806
24182
|
}
|
|
23807
|
-
const relativePath =
|
|
23808
|
-
const fileContent = await readFileContent(
|
|
24183
|
+
const relativePath = join149(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24184
|
+
const fileContent = await readFileContent(join149(outputRoot, relativePath));
|
|
23809
24185
|
return new _FactorydroidRule({
|
|
23810
24186
|
outputRoot,
|
|
23811
24187
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -23864,7 +24240,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
23864
24240
|
};
|
|
23865
24241
|
|
|
23866
24242
|
// src/features/rules/geminicli-rule.ts
|
|
23867
|
-
import { join as
|
|
24243
|
+
import { join as join150 } from "path";
|
|
23868
24244
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
23869
24245
|
static getSettablePaths({
|
|
23870
24246
|
global,
|
|
@@ -23899,7 +24275,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
23899
24275
|
if (isRoot) {
|
|
23900
24276
|
const relativePath2 = paths.root.relativeFilePath;
|
|
23901
24277
|
const fileContent2 = await readFileContent(
|
|
23902
|
-
|
|
24278
|
+
join150(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
23903
24279
|
);
|
|
23904
24280
|
return new _GeminiCliRule({
|
|
23905
24281
|
outputRoot,
|
|
@@ -23913,8 +24289,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
23913
24289
|
if (!paths.nonRoot) {
|
|
23914
24290
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
23915
24291
|
}
|
|
23916
|
-
const relativePath =
|
|
23917
|
-
const fileContent = await readFileContent(
|
|
24292
|
+
const relativePath = join150(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24293
|
+
const fileContent = await readFileContent(join150(outputRoot, relativePath));
|
|
23918
24294
|
return new _GeminiCliRule({
|
|
23919
24295
|
outputRoot,
|
|
23920
24296
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -23973,7 +24349,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
23973
24349
|
};
|
|
23974
24350
|
|
|
23975
24351
|
// src/features/rules/goose-rule.ts
|
|
23976
|
-
import { join as
|
|
24352
|
+
import { join as join151 } from "path";
|
|
23977
24353
|
var GooseRule = class _GooseRule extends ToolRule {
|
|
23978
24354
|
static getSettablePaths({
|
|
23979
24355
|
global,
|
|
@@ -24008,7 +24384,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
24008
24384
|
if (isRoot) {
|
|
24009
24385
|
const relativePath2 = paths.root.relativeFilePath;
|
|
24010
24386
|
const fileContent2 = await readFileContent(
|
|
24011
|
-
|
|
24387
|
+
join151(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
24012
24388
|
);
|
|
24013
24389
|
return new _GooseRule({
|
|
24014
24390
|
outputRoot,
|
|
@@ -24022,8 +24398,8 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
24022
24398
|
if (!paths.nonRoot) {
|
|
24023
24399
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
24024
24400
|
}
|
|
24025
|
-
const relativePath =
|
|
24026
|
-
const fileContent = await readFileContent(
|
|
24401
|
+
const relativePath = join151(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24402
|
+
const fileContent = await readFileContent(join151(outputRoot, relativePath));
|
|
24027
24403
|
return new _GooseRule({
|
|
24028
24404
|
outputRoot,
|
|
24029
24405
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -24082,7 +24458,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
24082
24458
|
};
|
|
24083
24459
|
|
|
24084
24460
|
// src/features/rules/junie-rule.ts
|
|
24085
|
-
import { join as
|
|
24461
|
+
import { join as join152 } from "path";
|
|
24086
24462
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
24087
24463
|
static getSettablePaths(_options = {}) {
|
|
24088
24464
|
return {
|
|
@@ -24111,8 +24487,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
24111
24487
|
}) {
|
|
24112
24488
|
const isRoot = _JunieRule.isRootRelativeFilePath(relativeFilePath);
|
|
24113
24489
|
const settablePaths = this.getSettablePaths();
|
|
24114
|
-
const relativePath = isRoot ?
|
|
24115
|
-
const fileContent = await readFileContent(
|
|
24490
|
+
const relativePath = isRoot ? join152(settablePaths.root.relativeDirPath, settablePaths.root.relativeFilePath) : join152(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24491
|
+
const fileContent = await readFileContent(join152(outputRoot, relativePath));
|
|
24116
24492
|
return new _JunieRule({
|
|
24117
24493
|
outputRoot,
|
|
24118
24494
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -24167,7 +24543,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
24167
24543
|
};
|
|
24168
24544
|
|
|
24169
24545
|
// src/features/rules/kilo-rule.ts
|
|
24170
|
-
import { join as
|
|
24546
|
+
import { join as join153 } from "path";
|
|
24171
24547
|
var KiloRule = class _KiloRule extends ToolRule {
|
|
24172
24548
|
static getSettablePaths({
|
|
24173
24549
|
global,
|
|
@@ -24202,7 +24578,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
24202
24578
|
if (isRoot) {
|
|
24203
24579
|
const relativePath2 = paths.root.relativeFilePath;
|
|
24204
24580
|
const fileContent2 = await readFileContent(
|
|
24205
|
-
|
|
24581
|
+
join153(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
24206
24582
|
);
|
|
24207
24583
|
return new _KiloRule({
|
|
24208
24584
|
outputRoot,
|
|
@@ -24216,8 +24592,8 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
24216
24592
|
if (!paths.nonRoot) {
|
|
24217
24593
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
24218
24594
|
}
|
|
24219
|
-
const relativePath =
|
|
24220
|
-
const fileContent = await readFileContent(
|
|
24595
|
+
const relativePath = join153(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24596
|
+
const fileContent = await readFileContent(join153(outputRoot, relativePath));
|
|
24221
24597
|
return new _KiloRule({
|
|
24222
24598
|
outputRoot,
|
|
24223
24599
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -24276,7 +24652,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
24276
24652
|
};
|
|
24277
24653
|
|
|
24278
24654
|
// src/features/rules/kiro-rule.ts
|
|
24279
|
-
import { join as
|
|
24655
|
+
import { join as join154 } from "path";
|
|
24280
24656
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
24281
24657
|
static getSettablePaths(_options = {}) {
|
|
24282
24658
|
return {
|
|
@@ -24291,7 +24667,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
24291
24667
|
validate = true
|
|
24292
24668
|
}) {
|
|
24293
24669
|
const fileContent = await readFileContent(
|
|
24294
|
-
|
|
24670
|
+
join154(outputRoot, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
24295
24671
|
);
|
|
24296
24672
|
return new _KiroRule({
|
|
24297
24673
|
outputRoot,
|
|
@@ -24345,7 +24721,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
24345
24721
|
};
|
|
24346
24722
|
|
|
24347
24723
|
// src/features/rules/opencode-rule.ts
|
|
24348
|
-
import { join as
|
|
24724
|
+
import { join as join155 } from "path";
|
|
24349
24725
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
24350
24726
|
static getSettablePaths({
|
|
24351
24727
|
global,
|
|
@@ -24380,7 +24756,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
24380
24756
|
if (isRoot) {
|
|
24381
24757
|
const relativePath2 = paths.root.relativeFilePath;
|
|
24382
24758
|
const fileContent2 = await readFileContent(
|
|
24383
|
-
|
|
24759
|
+
join155(outputRoot, paths.root.relativeDirPath, relativePath2)
|
|
24384
24760
|
);
|
|
24385
24761
|
return new _OpenCodeRule({
|
|
24386
24762
|
outputRoot,
|
|
@@ -24394,8 +24770,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
24394
24770
|
if (!paths.nonRoot) {
|
|
24395
24771
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
24396
24772
|
}
|
|
24397
|
-
const relativePath =
|
|
24398
|
-
const fileContent = await readFileContent(
|
|
24773
|
+
const relativePath = join155(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24774
|
+
const fileContent = await readFileContent(join155(outputRoot, relativePath));
|
|
24399
24775
|
return new _OpenCodeRule({
|
|
24400
24776
|
outputRoot,
|
|
24401
24777
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -24454,7 +24830,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
24454
24830
|
};
|
|
24455
24831
|
|
|
24456
24832
|
// src/features/rules/pi-rule.ts
|
|
24457
|
-
import { join as
|
|
24833
|
+
import { join as join156 } from "path";
|
|
24458
24834
|
var PiRule = class _PiRule extends ToolRule {
|
|
24459
24835
|
static getSettablePaths({
|
|
24460
24836
|
global,
|
|
@@ -24488,7 +24864,7 @@ var PiRule = class _PiRule extends ToolRule {
|
|
|
24488
24864
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
24489
24865
|
if (isRoot) {
|
|
24490
24866
|
const fileContent2 = await readFileContent(
|
|
24491
|
-
|
|
24867
|
+
join156(outputRoot, paths.root.relativeDirPath, paths.root.relativeFilePath)
|
|
24492
24868
|
);
|
|
24493
24869
|
return new _PiRule({
|
|
24494
24870
|
outputRoot,
|
|
@@ -24504,8 +24880,8 @@ var PiRule = class _PiRule extends ToolRule {
|
|
|
24504
24880
|
`PiRule does not support non-root rules in global mode; expected '${paths.root.relativeFilePath}' but got '${relativeFilePath}'`
|
|
24505
24881
|
);
|
|
24506
24882
|
}
|
|
24507
|
-
const relativePath =
|
|
24508
|
-
const fileContent = await readFileContent(
|
|
24883
|
+
const relativePath = join156(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
24884
|
+
const fileContent = await readFileContent(join156(outputRoot, relativePath));
|
|
24509
24885
|
return new _PiRule({
|
|
24510
24886
|
outputRoot,
|
|
24511
24887
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -24569,7 +24945,7 @@ var PiRule = class _PiRule extends ToolRule {
|
|
|
24569
24945
|
};
|
|
24570
24946
|
|
|
24571
24947
|
// src/features/rules/qwencode-rule.ts
|
|
24572
|
-
import { join as
|
|
24948
|
+
import { join as join157 } from "path";
|
|
24573
24949
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
24574
24950
|
static getSettablePaths(_options = {}) {
|
|
24575
24951
|
return {
|
|
@@ -24588,8 +24964,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
24588
24964
|
validate = true
|
|
24589
24965
|
}) {
|
|
24590
24966
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
24591
|
-
const relativePath = isRoot ? "QWEN.md" :
|
|
24592
|
-
const fileContent = await readFileContent(
|
|
24967
|
+
const relativePath = isRoot ? "QWEN.md" : join157(".qwen", "memories", relativeFilePath);
|
|
24968
|
+
const fileContent = await readFileContent(join157(outputRoot, relativePath));
|
|
24593
24969
|
return new _QwencodeRule({
|
|
24594
24970
|
outputRoot,
|
|
24595
24971
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -24641,7 +25017,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
24641
25017
|
};
|
|
24642
25018
|
|
|
24643
25019
|
// src/features/rules/replit-rule.ts
|
|
24644
|
-
import { join as
|
|
25020
|
+
import { join as join158 } from "path";
|
|
24645
25021
|
var ReplitRule = class _ReplitRule extends ToolRule {
|
|
24646
25022
|
static getSettablePaths(_options = {}) {
|
|
24647
25023
|
return {
|
|
@@ -24663,7 +25039,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
24663
25039
|
}
|
|
24664
25040
|
const relativePath = paths.root.relativeFilePath;
|
|
24665
25041
|
const fileContent = await readFileContent(
|
|
24666
|
-
|
|
25042
|
+
join158(outputRoot, paths.root.relativeDirPath, relativePath)
|
|
24667
25043
|
);
|
|
24668
25044
|
return new _ReplitRule({
|
|
24669
25045
|
outputRoot,
|
|
@@ -24729,7 +25105,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
24729
25105
|
};
|
|
24730
25106
|
|
|
24731
25107
|
// src/features/rules/roo-rule.ts
|
|
24732
|
-
import { join as
|
|
25108
|
+
import { join as join159 } from "path";
|
|
24733
25109
|
var RooRule = class _RooRule extends ToolRule {
|
|
24734
25110
|
static getSettablePaths(_options = {}) {
|
|
24735
25111
|
return {
|
|
@@ -24744,7 +25120,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
24744
25120
|
validate = true
|
|
24745
25121
|
}) {
|
|
24746
25122
|
const fileContent = await readFileContent(
|
|
24747
|
-
|
|
25123
|
+
join159(outputRoot, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
24748
25124
|
);
|
|
24749
25125
|
return new _RooRule({
|
|
24750
25126
|
outputRoot,
|
|
@@ -24813,7 +25189,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
24813
25189
|
};
|
|
24814
25190
|
|
|
24815
25191
|
// src/features/rules/rovodev-rule.ts
|
|
24816
|
-
import { join as
|
|
25192
|
+
import { join as join160 } from "path";
|
|
24817
25193
|
var DISALLOWED_ROVODEV_MODULAR_RULE_BASENAMES = /* @__PURE__ */ new Set(["agents.md", "agents.local.md"]);
|
|
24818
25194
|
var RovodevRule = class _RovodevRule extends ToolRule {
|
|
24819
25195
|
/**
|
|
@@ -24857,7 +25233,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
24857
25233
|
root: rovodevAgents,
|
|
24858
25234
|
alternativeRoots: [{ relativeDirPath: ".", relativeFilePath: "AGENTS.md" }],
|
|
24859
25235
|
nonRoot: {
|
|
24860
|
-
relativeDirPath:
|
|
25236
|
+
relativeDirPath: join160(".rovodev", ".rulesync", "modular-rules")
|
|
24861
25237
|
}
|
|
24862
25238
|
};
|
|
24863
25239
|
}
|
|
@@ -24896,10 +25272,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
24896
25272
|
}) {
|
|
24897
25273
|
if (!this.isAllowedModularRulesRelativePath(relativeFilePath)) {
|
|
24898
25274
|
throw new Error(
|
|
24899
|
-
`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${
|
|
25275
|
+
`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${join160(relativeDirPath, relativeFilePath)}`
|
|
24900
25276
|
);
|
|
24901
25277
|
}
|
|
24902
|
-
const fileContent = await readFileContent(
|
|
25278
|
+
const fileContent = await readFileContent(join160(outputRoot, relativeDirPath, relativeFilePath));
|
|
24903
25279
|
return new _RovodevRule({
|
|
24904
25280
|
outputRoot,
|
|
24905
25281
|
relativeDirPath,
|
|
@@ -24919,10 +25295,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
24919
25295
|
paths
|
|
24920
25296
|
}) {
|
|
24921
25297
|
const relativeDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
24922
|
-
const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${
|
|
25298
|
+
const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${join160(paths.root.relativeDirPath, paths.root.relativeFilePath)} or project root` : join160(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
24923
25299
|
if (relativeFilePath !== "AGENTS.md") {
|
|
24924
25300
|
throw new Error(
|
|
24925
|
-
`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${
|
|
25301
|
+
`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${join160(relativeDirPath, relativeFilePath)}`
|
|
24926
25302
|
);
|
|
24927
25303
|
}
|
|
24928
25304
|
const allowed = relativeDirPath === paths.root.relativeDirPath || "alternativeRoots" in paths && paths.alternativeRoots?.some(
|
|
@@ -24930,10 +25306,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
24930
25306
|
);
|
|
24931
25307
|
if (!allowed) {
|
|
24932
25308
|
throw new Error(
|
|
24933
|
-
`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${
|
|
25309
|
+
`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${join160(relativeDirPath, relativeFilePath)}`
|
|
24934
25310
|
);
|
|
24935
25311
|
}
|
|
24936
|
-
const fileContent = await readFileContent(
|
|
25312
|
+
const fileContent = await readFileContent(join160(outputRoot, relativeDirPath, relativeFilePath));
|
|
24937
25313
|
return new _RovodevRule({
|
|
24938
25314
|
outputRoot,
|
|
24939
25315
|
relativeDirPath,
|
|
@@ -25047,7 +25423,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
25047
25423
|
};
|
|
25048
25424
|
|
|
25049
25425
|
// src/features/rules/takt-rule.ts
|
|
25050
|
-
import { join as
|
|
25426
|
+
import { join as join161 } from "path";
|
|
25051
25427
|
var DEFAULT_TAKT_RULE_DIR = "policies";
|
|
25052
25428
|
var TaktRule = class _TaktRule extends ToolRule {
|
|
25053
25429
|
static getSettablePaths({
|
|
@@ -25059,7 +25435,7 @@ var TaktRule = class _TaktRule extends ToolRule {
|
|
|
25059
25435
|
root: {
|
|
25060
25436
|
relativeDirPath: buildToolPath(
|
|
25061
25437
|
".takt",
|
|
25062
|
-
|
|
25438
|
+
join161("facets", DEFAULT_TAKT_RULE_DIR),
|
|
25063
25439
|
excludeToolDir
|
|
25064
25440
|
),
|
|
25065
25441
|
relativeFilePath: "overview.md"
|
|
@@ -25070,7 +25446,7 @@ var TaktRule = class _TaktRule extends ToolRule {
|
|
|
25070
25446
|
nonRoot: {
|
|
25071
25447
|
relativeDirPath: buildToolPath(
|
|
25072
25448
|
".takt",
|
|
25073
|
-
|
|
25449
|
+
join161("facets", DEFAULT_TAKT_RULE_DIR),
|
|
25074
25450
|
excludeToolDir
|
|
25075
25451
|
)
|
|
25076
25452
|
}
|
|
@@ -25088,8 +25464,8 @@ var TaktRule = class _TaktRule extends ToolRule {
|
|
|
25088
25464
|
validate = true,
|
|
25089
25465
|
relativeDirPath: overrideDirPath
|
|
25090
25466
|
}) {
|
|
25091
|
-
const dirPath = overrideDirPath ??
|
|
25092
|
-
const filePath =
|
|
25467
|
+
const dirPath = overrideDirPath ?? join161(".takt", "facets", DEFAULT_TAKT_RULE_DIR);
|
|
25468
|
+
const filePath = join161(outputRoot, dirPath, relativeFilePath);
|
|
25093
25469
|
const fileContent = await readFileContent(filePath);
|
|
25094
25470
|
const { body } = parseFrontmatter(fileContent, filePath);
|
|
25095
25471
|
return new _TaktRule({
|
|
@@ -25128,7 +25504,7 @@ var TaktRule = class _TaktRule extends ToolRule {
|
|
|
25128
25504
|
const stem = overrideName ?? sourceStem;
|
|
25129
25505
|
assertSafeTaktName({ name: stem, featureLabel: "rule", sourceLabel });
|
|
25130
25506
|
const relativeFilePath = `${stem}.md`;
|
|
25131
|
-
const relativeDirPath =
|
|
25507
|
+
const relativeDirPath = join161(".takt", "facets", DEFAULT_TAKT_RULE_DIR);
|
|
25132
25508
|
return new _TaktRule({
|
|
25133
25509
|
outputRoot,
|
|
25134
25510
|
relativeDirPath,
|
|
@@ -25153,7 +25529,7 @@ var TaktRule = class _TaktRule extends ToolRule {
|
|
|
25153
25529
|
};
|
|
25154
25530
|
|
|
25155
25531
|
// src/features/rules/warp-rule.ts
|
|
25156
|
-
import { join as
|
|
25532
|
+
import { join as join162 } from "path";
|
|
25157
25533
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
25158
25534
|
constructor({ fileContent, root, ...rest }) {
|
|
25159
25535
|
super({
|
|
@@ -25166,7 +25542,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
25166
25542
|
return {
|
|
25167
25543
|
root: {
|
|
25168
25544
|
relativeDirPath: ".",
|
|
25169
|
-
relativeFilePath: "
|
|
25545
|
+
relativeFilePath: "AGENTS.md"
|
|
25170
25546
|
},
|
|
25171
25547
|
nonRoot: {
|
|
25172
25548
|
relativeDirPath: buildToolPath(".warp", "memories", _options.excludeToolDir)
|
|
@@ -25179,8 +25555,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
25179
25555
|
validate = true
|
|
25180
25556
|
}) {
|
|
25181
25557
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
25182
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath :
|
|
25183
|
-
const fileContent = await readFileContent(
|
|
25558
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : join162(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
25559
|
+
const fileContent = await readFileContent(join162(outputRoot, relativePath));
|
|
25184
25560
|
return new _WarpRule({
|
|
25185
25561
|
outputRoot,
|
|
25186
25562
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -25196,7 +25572,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
25196
25572
|
validate = true
|
|
25197
25573
|
}) {
|
|
25198
25574
|
return new _WarpRule(
|
|
25199
|
-
this.
|
|
25575
|
+
this.buildToolRuleParamsAgentsmd({
|
|
25200
25576
|
outputRoot,
|
|
25201
25577
|
rulesyncRule,
|
|
25202
25578
|
validate,
|
|
@@ -25235,7 +25611,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
25235
25611
|
};
|
|
25236
25612
|
|
|
25237
25613
|
// src/features/rules/windsurf-rule.ts
|
|
25238
|
-
import { join as
|
|
25614
|
+
import { join as join163 } from "path";
|
|
25239
25615
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
25240
25616
|
static getSettablePaths(_options = {}) {
|
|
25241
25617
|
return {
|
|
@@ -25250,7 +25626,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
25250
25626
|
validate = true
|
|
25251
25627
|
}) {
|
|
25252
25628
|
const fileContent = await readFileContent(
|
|
25253
|
-
|
|
25629
|
+
join163(outputRoot, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
25254
25630
|
);
|
|
25255
25631
|
return new _WindsurfRule({
|
|
25256
25632
|
outputRoot,
|
|
@@ -25321,7 +25697,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
25321
25697
|
};
|
|
25322
25698
|
|
|
25323
25699
|
// src/features/rules/zed-rule.ts
|
|
25324
|
-
import { join as
|
|
25700
|
+
import { join as join164 } from "path";
|
|
25325
25701
|
var ZedRule = class _ZedRule extends ToolRule {
|
|
25326
25702
|
static getSettablePaths({
|
|
25327
25703
|
global,
|
|
@@ -25330,7 +25706,7 @@ var ZedRule = class _ZedRule extends ToolRule {
|
|
|
25330
25706
|
if (global) {
|
|
25331
25707
|
return {
|
|
25332
25708
|
root: {
|
|
25333
|
-
relativeDirPath: buildToolPath(
|
|
25709
|
+
relativeDirPath: buildToolPath(join164(".config", "zed"), ".", excludeToolDir),
|
|
25334
25710
|
relativeFilePath: "AGENTS.md"
|
|
25335
25711
|
}
|
|
25336
25712
|
};
|
|
@@ -25354,7 +25730,7 @@ var ZedRule = class _ZedRule extends ToolRule {
|
|
|
25354
25730
|
throw new Error(`ZedRule only supports root rules: ${relativeFilePath}`);
|
|
25355
25731
|
}
|
|
25356
25732
|
const fileContent = await readFileContent(
|
|
25357
|
-
|
|
25733
|
+
join164(outputRoot, paths.root.relativeDirPath, paths.root.relativeFilePath)
|
|
25358
25734
|
);
|
|
25359
25735
|
return new _ZedRule({
|
|
25360
25736
|
outputRoot,
|
|
@@ -25455,7 +25831,7 @@ var rulesProcessorToolTargets = [
|
|
|
25455
25831
|
"zed"
|
|
25456
25832
|
];
|
|
25457
25833
|
var RulesProcessorToolTargetSchema = z82.enum(rulesProcessorToolTargets);
|
|
25458
|
-
var formatRulePaths = (rules) => rules.map((r) =>
|
|
25834
|
+
var formatRulePaths = (rules) => rules.map((r) => join165(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
|
|
25459
25835
|
var RulesFeatureOptionsSchema = z82.looseObject({
|
|
25460
25836
|
ruleDiscoveryMode: z82.optional(z82.enum(["none", "explicit"])),
|
|
25461
25837
|
includeLocalRoot: z82.optional(z82.boolean())
|
|
@@ -25991,7 +26367,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
25991
26367
|
}).relativeDirPath;
|
|
25992
26368
|
return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
|
|
25993
26369
|
const frontmatter = skill.getFrontmatter();
|
|
25994
|
-
const relativePath =
|
|
26370
|
+
const relativePath = join165(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
|
|
25995
26371
|
return {
|
|
25996
26372
|
name: frontmatter.name,
|
|
25997
26373
|
description: frontmatter.description,
|
|
@@ -26120,8 +26496,8 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26120
26496
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
26121
26497
|
*/
|
|
26122
26498
|
async loadRulesyncFiles() {
|
|
26123
|
-
const rulesyncOutputRoot =
|
|
26124
|
-
const files = await findFilesByGlobs(
|
|
26499
|
+
const rulesyncOutputRoot = join165(this.inputRoot, RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
26500
|
+
const files = await findFilesByGlobs(join165(rulesyncOutputRoot, "**", "*.md"));
|
|
26125
26501
|
this.logger.debug(`Found ${files.length} rulesync files`);
|
|
26126
26502
|
const rulesyncRules = await Promise.all(
|
|
26127
26503
|
files.map((file) => {
|
|
@@ -26237,13 +26613,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26237
26613
|
return [];
|
|
26238
26614
|
}
|
|
26239
26615
|
const uniqueRootFilePaths = await findFilesWithFallback(
|
|
26240
|
-
|
|
26616
|
+
join165(
|
|
26241
26617
|
this.outputRoot,
|
|
26242
26618
|
settablePaths.root.relativeDirPath ?? ".",
|
|
26243
26619
|
settablePaths.root.relativeFilePath
|
|
26244
26620
|
),
|
|
26245
26621
|
settablePaths.alternativeRoots,
|
|
26246
|
-
(alt) =>
|
|
26622
|
+
(alt) => join165(this.outputRoot, alt.relativeDirPath, alt.relativeFilePath)
|
|
26247
26623
|
);
|
|
26248
26624
|
if (forDeletion) {
|
|
26249
26625
|
return buildDeletionRulesFromPaths(uniqueRootFilePaths);
|
|
@@ -26274,7 +26650,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26274
26650
|
return [];
|
|
26275
26651
|
}
|
|
26276
26652
|
const uniqueLocalRootFilePaths2 = await findFilesByGlobs(
|
|
26277
|
-
|
|
26653
|
+
join165(this.outputRoot, "AGENTS.local.md")
|
|
26278
26654
|
);
|
|
26279
26655
|
return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths2);
|
|
26280
26656
|
}
|
|
@@ -26285,9 +26661,9 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26285
26661
|
return [];
|
|
26286
26662
|
}
|
|
26287
26663
|
const uniqueLocalRootFilePaths = await findFilesWithFallback(
|
|
26288
|
-
|
|
26664
|
+
join165(this.outputRoot, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
|
|
26289
26665
|
settablePaths.alternativeRoots,
|
|
26290
|
-
(alt) =>
|
|
26666
|
+
(alt) => join165(this.outputRoot, alt.relativeDirPath, "CLAUDE.local.md")
|
|
26291
26667
|
);
|
|
26292
26668
|
return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths);
|
|
26293
26669
|
})();
|
|
@@ -26298,20 +26674,20 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26298
26674
|
if (!forDeletion || this.toolTarget !== "rovodev" || this.global) {
|
|
26299
26675
|
return [];
|
|
26300
26676
|
}
|
|
26301
|
-
const primaryPaths = await findFilesByGlobs(
|
|
26677
|
+
const primaryPaths = await findFilesByGlobs(join165(this.outputRoot, ".rovodev", "AGENTS.md"));
|
|
26302
26678
|
if (primaryPaths.length === 0) {
|
|
26303
26679
|
return [];
|
|
26304
26680
|
}
|
|
26305
|
-
const mirrorPaths = await findFilesByGlobs(
|
|
26681
|
+
const mirrorPaths = await findFilesByGlobs(join165(this.outputRoot, "AGENTS.md"));
|
|
26306
26682
|
return buildDeletionRulesFromPaths(mirrorPaths);
|
|
26307
26683
|
})();
|
|
26308
26684
|
const nonRootToolRules = await (async () => {
|
|
26309
26685
|
if (!settablePaths.nonRoot) {
|
|
26310
26686
|
return [];
|
|
26311
26687
|
}
|
|
26312
|
-
const nonRootOutputRoot =
|
|
26688
|
+
const nonRootOutputRoot = join165(this.outputRoot, settablePaths.nonRoot.relativeDirPath);
|
|
26313
26689
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
26314
|
-
|
|
26690
|
+
join165(nonRootOutputRoot, "**", `*.${factory.meta.extension}`)
|
|
26315
26691
|
);
|
|
26316
26692
|
if (forDeletion) {
|
|
26317
26693
|
return buildDeletionRulesFromPaths(nonRootFilePaths, {
|
|
@@ -26325,7 +26701,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
26325
26701
|
const ok = RovodevRule.isAllowedModularRulesRelativePath(relativeFilePath);
|
|
26326
26702
|
if (!ok) {
|
|
26327
26703
|
this.logger.warn(
|
|
26328
|
-
`Skipping reserved Rovodev path under modular-rules (import): ${
|
|
26704
|
+
`Skipping reserved Rovodev path under modular-rules (import): ${join165(modularRootRelative, relativeFilePath)}`
|
|
26329
26705
|
);
|
|
26330
26706
|
}
|
|
26331
26707
|
return ok;
|
|
@@ -26451,14 +26827,14 @@ s/<command> [arguments]
|
|
|
26451
26827
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
26452
26828
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
26453
26829
|
|
|
26454
|
-
When users call a custom slash command, you have to look for the markdown file, \`${
|
|
26830
|
+
When users call a custom slash command, you have to look for the markdown file, \`${join165(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
26455
26831
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
26456
26832
|
|
|
26457
26833
|
Simulated subagents are specialized AI assistants that can be invoked to handle specific types of tasks. In this case, it can be appear something like custom slash commands simply. Simulated subagents can be called by custom slash commands.
|
|
26458
26834
|
|
|
26459
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${
|
|
26835
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${join165(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
26460
26836
|
|
|
26461
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${
|
|
26837
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${join165(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
26462
26838
|
const skillsSection = skills ? this.generateSkillsSection(skills) : "";
|
|
26463
26839
|
const result = [
|
|
26464
26840
|
overview,
|
|
@@ -26716,7 +27092,7 @@ function buildPermissionsStrategy(ctx) {
|
|
|
26716
27092
|
}
|
|
26717
27093
|
|
|
26718
27094
|
// src/lib/generate.ts
|
|
26719
|
-
import { join as
|
|
27095
|
+
import { join as join166 } from "path";
|
|
26720
27096
|
import { intersection } from "es-toolkit";
|
|
26721
27097
|
async function processFeatureGeneration(params) {
|
|
26722
27098
|
const { config, processor, toolFiles } = params;
|
|
@@ -26790,7 +27166,7 @@ function warnUnsupportedTargets(params) {
|
|
|
26790
27166
|
}
|
|
26791
27167
|
}
|
|
26792
27168
|
async function checkRulesyncDirExists(params) {
|
|
26793
|
-
return fileExists(
|
|
27169
|
+
return fileExists(join166(params.inputRoot, RULESYNC_RELATIVE_DIR_PATH));
|
|
26794
27170
|
}
|
|
26795
27171
|
async function generate(params) {
|
|
26796
27172
|
const { config, logger } = params;
|