rulesync 7.17.0 → 7.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{chunk-ZQUEAGJI.js → chunk-JP3BFD7L.js} +849 -695
- package/dist/cli/index.cjs +1160 -1003
- package/dist/cli/index.js +9 -6
- package/dist/index.cjs +879 -725
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -673,12 +673,12 @@ function getBaseDirsInLightOfGlobal({
|
|
|
673
673
|
}
|
|
674
674
|
|
|
675
675
|
// src/lib/generate.ts
|
|
676
|
-
var
|
|
676
|
+
var import_node_path119 = require("path");
|
|
677
677
|
var import_es_toolkit4 = require("es-toolkit");
|
|
678
678
|
|
|
679
679
|
// src/features/commands/commands-processor.ts
|
|
680
|
-
var
|
|
681
|
-
var
|
|
680
|
+
var import_node_path22 = require("path");
|
|
681
|
+
var import_mini14 = require("zod/mini");
|
|
682
682
|
|
|
683
683
|
// src/types/feature-processor.ts
|
|
684
684
|
var FeatureProcessor = class {
|
|
@@ -2277,12 +2277,152 @@ prompt = ""`;
|
|
|
2277
2277
|
}
|
|
2278
2278
|
};
|
|
2279
2279
|
|
|
2280
|
-
// src/features/commands/
|
|
2280
|
+
// src/features/commands/junie-command.ts
|
|
2281
2281
|
var import_node_path17 = require("path");
|
|
2282
|
+
var import_mini11 = require("zod/mini");
|
|
2283
|
+
var JunieCommandFrontmatterSchema = import_mini11.z.looseObject({
|
|
2284
|
+
description: import_mini11.z.optional(import_mini11.z.string())
|
|
2285
|
+
});
|
|
2286
|
+
var JunieCommand = class _JunieCommand extends ToolCommand {
|
|
2287
|
+
frontmatter;
|
|
2288
|
+
body;
|
|
2289
|
+
constructor({ frontmatter, body, ...rest }) {
|
|
2290
|
+
if (rest.validate) {
|
|
2291
|
+
const result = JunieCommandFrontmatterSchema.safeParse(frontmatter);
|
|
2292
|
+
if (!result.success) {
|
|
2293
|
+
throw new Error(
|
|
2294
|
+
`Invalid frontmatter in ${(0, import_node_path17.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
2295
|
+
);
|
|
2296
|
+
}
|
|
2297
|
+
}
|
|
2298
|
+
super({
|
|
2299
|
+
...rest,
|
|
2300
|
+
fileContent: stringifyFrontmatter(body, frontmatter)
|
|
2301
|
+
});
|
|
2302
|
+
this.frontmatter = frontmatter;
|
|
2303
|
+
this.body = body;
|
|
2304
|
+
}
|
|
2305
|
+
static getSettablePaths(_options = {}) {
|
|
2306
|
+
return {
|
|
2307
|
+
relativeDirPath: (0, import_node_path17.join)(".junie", "commands")
|
|
2308
|
+
};
|
|
2309
|
+
}
|
|
2310
|
+
getBody() {
|
|
2311
|
+
return this.body;
|
|
2312
|
+
}
|
|
2313
|
+
getFrontmatter() {
|
|
2314
|
+
return this.frontmatter;
|
|
2315
|
+
}
|
|
2316
|
+
toRulesyncCommand() {
|
|
2317
|
+
const { description, ...restFields } = this.frontmatter;
|
|
2318
|
+
const rulesyncFrontmatter = {
|
|
2319
|
+
targets: ["*"],
|
|
2320
|
+
description,
|
|
2321
|
+
// Preserve extra fields in junie section
|
|
2322
|
+
...Object.keys(restFields).length > 0 && { junie: restFields }
|
|
2323
|
+
};
|
|
2324
|
+
const fileContent = stringifyFrontmatter(this.body, rulesyncFrontmatter);
|
|
2325
|
+
return new RulesyncCommand({
|
|
2326
|
+
baseDir: process.cwd(),
|
|
2327
|
+
// RulesyncCommand baseDir is always the project root directory
|
|
2328
|
+
frontmatter: rulesyncFrontmatter,
|
|
2329
|
+
body: this.body,
|
|
2330
|
+
relativeDirPath: RulesyncCommand.getSettablePaths().relativeDirPath,
|
|
2331
|
+
relativeFilePath: this.relativeFilePath,
|
|
2332
|
+
fileContent,
|
|
2333
|
+
validate: true
|
|
2334
|
+
});
|
|
2335
|
+
}
|
|
2336
|
+
static fromRulesyncCommand({
|
|
2337
|
+
baseDir = process.cwd(),
|
|
2338
|
+
rulesyncCommand,
|
|
2339
|
+
validate = true,
|
|
2340
|
+
global = false
|
|
2341
|
+
}) {
|
|
2342
|
+
const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
|
|
2343
|
+
const junieFields = rulesyncFrontmatter.junie ?? {};
|
|
2344
|
+
const junieFrontmatter = {
|
|
2345
|
+
description: rulesyncFrontmatter.description,
|
|
2346
|
+
...junieFields
|
|
2347
|
+
};
|
|
2348
|
+
const body = rulesyncCommand.getBody();
|
|
2349
|
+
const paths = this.getSettablePaths({ global });
|
|
2350
|
+
return new _JunieCommand({
|
|
2351
|
+
baseDir,
|
|
2352
|
+
frontmatter: junieFrontmatter,
|
|
2353
|
+
body,
|
|
2354
|
+
relativeDirPath: paths.relativeDirPath,
|
|
2355
|
+
relativeFilePath: rulesyncCommand.getRelativeFilePath(),
|
|
2356
|
+
validate
|
|
2357
|
+
});
|
|
2358
|
+
}
|
|
2359
|
+
validate() {
|
|
2360
|
+
if (!this.frontmatter) {
|
|
2361
|
+
return { success: true, error: null };
|
|
2362
|
+
}
|
|
2363
|
+
const result = JunieCommandFrontmatterSchema.safeParse(this.frontmatter);
|
|
2364
|
+
if (result.success) {
|
|
2365
|
+
return { success: true, error: null };
|
|
2366
|
+
} else {
|
|
2367
|
+
return {
|
|
2368
|
+
success: false,
|
|
2369
|
+
error: new Error(
|
|
2370
|
+
`Invalid frontmatter in ${(0, import_node_path17.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
2371
|
+
)
|
|
2372
|
+
};
|
|
2373
|
+
}
|
|
2374
|
+
}
|
|
2375
|
+
static isTargetedByRulesyncCommand(rulesyncCommand) {
|
|
2376
|
+
return this.isTargetedByRulesyncCommandDefault({
|
|
2377
|
+
rulesyncCommand,
|
|
2378
|
+
toolTarget: "junie"
|
|
2379
|
+
});
|
|
2380
|
+
}
|
|
2381
|
+
static async fromFile({
|
|
2382
|
+
baseDir = process.cwd(),
|
|
2383
|
+
relativeFilePath,
|
|
2384
|
+
validate = true,
|
|
2385
|
+
global = false
|
|
2386
|
+
}) {
|
|
2387
|
+
const paths = this.getSettablePaths({ global });
|
|
2388
|
+
const filePath = (0, import_node_path17.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
2389
|
+
const fileContent = await readFileContent(filePath);
|
|
2390
|
+
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
2391
|
+
const result = JunieCommandFrontmatterSchema.safeParse(frontmatter);
|
|
2392
|
+
if (!result.success) {
|
|
2393
|
+
throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
|
|
2394
|
+
}
|
|
2395
|
+
return new _JunieCommand({
|
|
2396
|
+
baseDir,
|
|
2397
|
+
relativeDirPath: paths.relativeDirPath,
|
|
2398
|
+
relativeFilePath,
|
|
2399
|
+
frontmatter: result.data,
|
|
2400
|
+
body: content.trim(),
|
|
2401
|
+
validate
|
|
2402
|
+
});
|
|
2403
|
+
}
|
|
2404
|
+
static forDeletion({
|
|
2405
|
+
baseDir = process.cwd(),
|
|
2406
|
+
relativeDirPath,
|
|
2407
|
+
relativeFilePath
|
|
2408
|
+
}) {
|
|
2409
|
+
return new _JunieCommand({
|
|
2410
|
+
baseDir,
|
|
2411
|
+
relativeDirPath,
|
|
2412
|
+
relativeFilePath,
|
|
2413
|
+
frontmatter: { description: "" },
|
|
2414
|
+
body: "",
|
|
2415
|
+
validate: false
|
|
2416
|
+
});
|
|
2417
|
+
}
|
|
2418
|
+
};
|
|
2419
|
+
|
|
2420
|
+
// src/features/commands/kilo-command.ts
|
|
2421
|
+
var import_node_path18 = require("path");
|
|
2282
2422
|
var KiloCommand = class _KiloCommand extends ToolCommand {
|
|
2283
2423
|
static getSettablePaths(_options = {}) {
|
|
2284
2424
|
return {
|
|
2285
|
-
relativeDirPath: (0,
|
|
2425
|
+
relativeDirPath: (0, import_node_path18.join)(".kilocode", "workflows")
|
|
2286
2426
|
};
|
|
2287
2427
|
}
|
|
2288
2428
|
toRulesyncCommand() {
|
|
@@ -2331,7 +2471,7 @@ var KiloCommand = class _KiloCommand extends ToolCommand {
|
|
|
2331
2471
|
validate = true
|
|
2332
2472
|
}) {
|
|
2333
2473
|
const paths = this.getSettablePaths();
|
|
2334
|
-
const filePath = (0,
|
|
2474
|
+
const filePath = (0, import_node_path18.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
2335
2475
|
const fileContent = await readFileContent(filePath);
|
|
2336
2476
|
const { body: content } = parseFrontmatter(fileContent, filePath);
|
|
2337
2477
|
return new _KiloCommand({
|
|
@@ -2358,11 +2498,11 @@ var KiloCommand = class _KiloCommand extends ToolCommand {
|
|
|
2358
2498
|
};
|
|
2359
2499
|
|
|
2360
2500
|
// src/features/commands/kiro-command.ts
|
|
2361
|
-
var
|
|
2501
|
+
var import_node_path19 = require("path");
|
|
2362
2502
|
var KiroCommand = class _KiroCommand extends ToolCommand {
|
|
2363
2503
|
static getSettablePaths(_options = {}) {
|
|
2364
2504
|
return {
|
|
2365
|
-
relativeDirPath: (0,
|
|
2505
|
+
relativeDirPath: (0, import_node_path19.join)(".kiro", "prompts")
|
|
2366
2506
|
};
|
|
2367
2507
|
}
|
|
2368
2508
|
toRulesyncCommand() {
|
|
@@ -2411,7 +2551,7 @@ var KiroCommand = class _KiroCommand extends ToolCommand {
|
|
|
2411
2551
|
validate = true
|
|
2412
2552
|
}) {
|
|
2413
2553
|
const paths = this.getSettablePaths();
|
|
2414
|
-
const filePath = (0,
|
|
2554
|
+
const filePath = (0, import_node_path19.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
2415
2555
|
const fileContent = await readFileContent(filePath);
|
|
2416
2556
|
const { body: content } = parseFrontmatter(fileContent, filePath);
|
|
2417
2557
|
return new _KiroCommand({
|
|
@@ -2438,13 +2578,13 @@ var KiroCommand = class _KiroCommand extends ToolCommand {
|
|
|
2438
2578
|
};
|
|
2439
2579
|
|
|
2440
2580
|
// src/features/commands/opencode-command.ts
|
|
2441
|
-
var
|
|
2442
|
-
var
|
|
2443
|
-
var OpenCodeCommandFrontmatterSchema =
|
|
2444
|
-
description:
|
|
2445
|
-
agent: (0,
|
|
2446
|
-
subtask: (0,
|
|
2447
|
-
model: (0,
|
|
2581
|
+
var import_node_path20 = require("path");
|
|
2582
|
+
var import_mini12 = require("zod/mini");
|
|
2583
|
+
var OpenCodeCommandFrontmatterSchema = import_mini12.z.looseObject({
|
|
2584
|
+
description: import_mini12.z.optional(import_mini12.z.string()),
|
|
2585
|
+
agent: (0, import_mini12.optional)(import_mini12.z.string()),
|
|
2586
|
+
subtask: (0, import_mini12.optional)(import_mini12.z.boolean()),
|
|
2587
|
+
model: (0, import_mini12.optional)(import_mini12.z.string())
|
|
2448
2588
|
});
|
|
2449
2589
|
var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
2450
2590
|
frontmatter;
|
|
@@ -2454,7 +2594,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
2454
2594
|
const result = OpenCodeCommandFrontmatterSchema.safeParse(frontmatter);
|
|
2455
2595
|
if (!result.success) {
|
|
2456
2596
|
throw new Error(
|
|
2457
|
-
`Invalid frontmatter in ${(0,
|
|
2597
|
+
`Invalid frontmatter in ${(0, import_node_path20.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
2458
2598
|
);
|
|
2459
2599
|
}
|
|
2460
2600
|
}
|
|
@@ -2467,7 +2607,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
2467
2607
|
}
|
|
2468
2608
|
static getSettablePaths({ global } = {}) {
|
|
2469
2609
|
return {
|
|
2470
|
-
relativeDirPath: global ? (0,
|
|
2610
|
+
relativeDirPath: global ? (0, import_node_path20.join)(".config", "opencode", "command") : (0, import_node_path20.join)(".opencode", "command")
|
|
2471
2611
|
};
|
|
2472
2612
|
}
|
|
2473
2613
|
getBody() {
|
|
@@ -2528,7 +2668,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
2528
2668
|
return {
|
|
2529
2669
|
success: false,
|
|
2530
2670
|
error: new Error(
|
|
2531
|
-
`Invalid frontmatter in ${(0,
|
|
2671
|
+
`Invalid frontmatter in ${(0, import_node_path20.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
2532
2672
|
)
|
|
2533
2673
|
};
|
|
2534
2674
|
}
|
|
@@ -2539,7 +2679,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
2539
2679
|
global = false
|
|
2540
2680
|
}) {
|
|
2541
2681
|
const paths = this.getSettablePaths({ global });
|
|
2542
|
-
const filePath = (0,
|
|
2682
|
+
const filePath = (0, import_node_path20.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
2543
2683
|
const fileContent = await readFileContent(filePath);
|
|
2544
2684
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
2545
2685
|
const result = OpenCodeCommandFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -2578,18 +2718,18 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
2578
2718
|
};
|
|
2579
2719
|
|
|
2580
2720
|
// src/features/commands/roo-command.ts
|
|
2581
|
-
var
|
|
2582
|
-
var
|
|
2583
|
-
var RooCommandFrontmatterSchema =
|
|
2584
|
-
description:
|
|
2585
|
-
"argument-hint": (0,
|
|
2721
|
+
var import_node_path21 = require("path");
|
|
2722
|
+
var import_mini13 = require("zod/mini");
|
|
2723
|
+
var RooCommandFrontmatterSchema = import_mini13.z.looseObject({
|
|
2724
|
+
description: import_mini13.z.optional(import_mini13.z.string()),
|
|
2725
|
+
"argument-hint": (0, import_mini13.optional)(import_mini13.z.string())
|
|
2586
2726
|
});
|
|
2587
2727
|
var RooCommand = class _RooCommand extends ToolCommand {
|
|
2588
2728
|
frontmatter;
|
|
2589
2729
|
body;
|
|
2590
2730
|
static getSettablePaths() {
|
|
2591
2731
|
return {
|
|
2592
|
-
relativeDirPath: (0,
|
|
2732
|
+
relativeDirPath: (0, import_node_path21.join)(".roo", "commands")
|
|
2593
2733
|
};
|
|
2594
2734
|
}
|
|
2595
2735
|
constructor({ frontmatter, body, ...rest }) {
|
|
@@ -2597,7 +2737,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
2597
2737
|
const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
|
|
2598
2738
|
if (!result.success) {
|
|
2599
2739
|
throw new Error(
|
|
2600
|
-
`Invalid frontmatter in ${(0,
|
|
2740
|
+
`Invalid frontmatter in ${(0, import_node_path21.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
2601
2741
|
);
|
|
2602
2742
|
}
|
|
2603
2743
|
}
|
|
@@ -2668,7 +2808,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
2668
2808
|
return {
|
|
2669
2809
|
success: false,
|
|
2670
2810
|
error: new Error(
|
|
2671
|
-
`Invalid frontmatter in ${(0,
|
|
2811
|
+
`Invalid frontmatter in ${(0, import_node_path21.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
2672
2812
|
)
|
|
2673
2813
|
};
|
|
2674
2814
|
}
|
|
@@ -2684,7 +2824,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
2684
2824
|
relativeFilePath,
|
|
2685
2825
|
validate = true
|
|
2686
2826
|
}) {
|
|
2687
|
-
const filePath = (0,
|
|
2827
|
+
const filePath = (0, import_node_path21.join)(baseDir, _RooCommand.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
2688
2828
|
const fileContent = await readFileContent(filePath);
|
|
2689
2829
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
2690
2830
|
const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -2730,12 +2870,13 @@ var commandsProcessorToolTargetTuple = [
|
|
|
2730
2870
|
"cursor",
|
|
2731
2871
|
"factorydroid",
|
|
2732
2872
|
"geminicli",
|
|
2873
|
+
"junie",
|
|
2733
2874
|
"kilo",
|
|
2734
2875
|
"kiro",
|
|
2735
2876
|
"opencode",
|
|
2736
2877
|
"roo"
|
|
2737
2878
|
];
|
|
2738
|
-
var CommandsProcessorToolTargetSchema =
|
|
2879
|
+
var CommandsProcessorToolTargetSchema = import_mini14.z.enum(commandsProcessorToolTargetTuple);
|
|
2739
2880
|
var toolCommandFactories = /* @__PURE__ */ new Map([
|
|
2740
2881
|
[
|
|
2741
2882
|
"agentsmd",
|
|
@@ -2867,6 +3008,19 @@ var toolCommandFactories = /* @__PURE__ */ new Map([
|
|
|
2867
3008
|
}
|
|
2868
3009
|
}
|
|
2869
3010
|
],
|
|
3011
|
+
[
|
|
3012
|
+
"junie",
|
|
3013
|
+
{
|
|
3014
|
+
class: JunieCommand,
|
|
3015
|
+
meta: {
|
|
3016
|
+
extension: "md",
|
|
3017
|
+
supportsProject: true,
|
|
3018
|
+
supportsGlobal: true,
|
|
3019
|
+
isSimulated: false,
|
|
3020
|
+
supportsSubdirectory: false
|
|
3021
|
+
}
|
|
3022
|
+
}
|
|
3023
|
+
],
|
|
2870
3024
|
[
|
|
2871
3025
|
"kilo",
|
|
2872
3026
|
{
|
|
@@ -3005,12 +3159,12 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
3005
3159
|
return rulesyncCommands;
|
|
3006
3160
|
}
|
|
3007
3161
|
flattenRelativeFilePath(rulesyncCommand) {
|
|
3008
|
-
const flatPath = (0,
|
|
3162
|
+
const flatPath = (0, import_node_path22.basename)(rulesyncCommand.getRelativeFilePath());
|
|
3009
3163
|
if (flatPath === rulesyncCommand.getRelativeFilePath()) return rulesyncCommand;
|
|
3010
3164
|
return rulesyncCommand.withRelativeFilePath(flatPath);
|
|
3011
3165
|
}
|
|
3012
3166
|
safeRelativePath(basePath, fullPath) {
|
|
3013
|
-
const rel = (0,
|
|
3167
|
+
const rel = (0, import_node_path22.relative)(basePath, fullPath);
|
|
3014
3168
|
checkPathTraversal({ relativePath: rel, intendedRootDir: basePath });
|
|
3015
3169
|
return rel;
|
|
3016
3170
|
}
|
|
@@ -3020,7 +3174,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
3020
3174
|
*/
|
|
3021
3175
|
async loadRulesyncFiles() {
|
|
3022
3176
|
const basePath = RulesyncCommand.getSettablePaths().relativeDirPath;
|
|
3023
|
-
const rulesyncCommandPaths = await findFilesByGlobs((0,
|
|
3177
|
+
const rulesyncCommandPaths = await findFilesByGlobs((0, import_node_path22.join)(basePath, "**", "*.md"));
|
|
3024
3178
|
const rulesyncCommands = await Promise.all(
|
|
3025
3179
|
rulesyncCommandPaths.map(
|
|
3026
3180
|
(path3) => RulesyncCommand.fromFile({ relativeFilePath: this.safeRelativePath(basePath, path3) })
|
|
@@ -3038,8 +3192,8 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
3038
3192
|
} = {}) {
|
|
3039
3193
|
const factory = this.getFactory(this.toolTarget);
|
|
3040
3194
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
3041
|
-
const baseDirFull = (0,
|
|
3042
|
-
const globPattern = factory.meta.supportsSubdirectory ? (0,
|
|
3195
|
+
const baseDirFull = (0, import_node_path22.join)(this.baseDir, paths.relativeDirPath);
|
|
3196
|
+
const globPattern = factory.meta.supportsSubdirectory ? (0, import_node_path22.join)(baseDirFull, "**", `*.${factory.meta.extension}`) : (0, import_node_path22.join)(baseDirFull, `*.${factory.meta.extension}`);
|
|
3043
3197
|
const commandFilePaths = await findFilesByGlobs(globPattern);
|
|
3044
3198
|
if (forDeletion) {
|
|
3045
3199
|
const toolCommands2 = commandFilePaths.map(
|
|
@@ -3102,28 +3256,28 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
3102
3256
|
};
|
|
3103
3257
|
|
|
3104
3258
|
// src/features/hooks/hooks-processor.ts
|
|
3105
|
-
var
|
|
3259
|
+
var import_mini18 = require("zod/mini");
|
|
3106
3260
|
|
|
3107
3261
|
// src/types/hooks.ts
|
|
3108
|
-
var
|
|
3262
|
+
var import_mini15 = require("zod/mini");
|
|
3109
3263
|
var CONTROL_CHARS = ["\n", "\r", "\0"];
|
|
3110
3264
|
var hasControlChars = (val) => CONTROL_CHARS.some((char) => val.includes(char));
|
|
3111
|
-
var safeString =
|
|
3112
|
-
|
|
3113
|
-
|
|
3265
|
+
var safeString = import_mini15.z.pipe(
|
|
3266
|
+
import_mini15.z.string(),
|
|
3267
|
+
import_mini15.z.custom(
|
|
3114
3268
|
(val) => typeof val === "string" && !hasControlChars(val),
|
|
3115
3269
|
"must not contain newline, carriage return, or NUL characters"
|
|
3116
3270
|
)
|
|
3117
3271
|
);
|
|
3118
|
-
var HookDefinitionSchema =
|
|
3119
|
-
command:
|
|
3120
|
-
type:
|
|
3121
|
-
timeout:
|
|
3122
|
-
matcher:
|
|
3123
|
-
prompt:
|
|
3124
|
-
loop_limit:
|
|
3125
|
-
name:
|
|
3126
|
-
description:
|
|
3272
|
+
var HookDefinitionSchema = import_mini15.z.looseObject({
|
|
3273
|
+
command: import_mini15.z.optional(safeString),
|
|
3274
|
+
type: import_mini15.z.optional(import_mini15.z.enum(["command", "prompt"])),
|
|
3275
|
+
timeout: import_mini15.z.optional(import_mini15.z.number()),
|
|
3276
|
+
matcher: import_mini15.z.optional(safeString),
|
|
3277
|
+
prompt: import_mini15.z.optional(safeString),
|
|
3278
|
+
loop_limit: import_mini15.z.optional(import_mini15.z.nullable(import_mini15.z.number())),
|
|
3279
|
+
name: import_mini15.z.optional(safeString),
|
|
3280
|
+
description: import_mini15.z.optional(safeString)
|
|
3127
3281
|
});
|
|
3128
3282
|
var CURSOR_HOOK_EVENTS = [
|
|
3129
3283
|
"sessionStart",
|
|
@@ -3203,16 +3357,16 @@ var GEMINICLI_HOOK_EVENTS = [
|
|
|
3203
3357
|
"preCompact",
|
|
3204
3358
|
"notification"
|
|
3205
3359
|
];
|
|
3206
|
-
var hooksRecordSchema =
|
|
3207
|
-
var HooksConfigSchema =
|
|
3208
|
-
version:
|
|
3360
|
+
var hooksRecordSchema = import_mini15.z.record(import_mini15.z.string(), import_mini15.z.array(HookDefinitionSchema));
|
|
3361
|
+
var HooksConfigSchema = import_mini15.z.looseObject({
|
|
3362
|
+
version: import_mini15.z.optional(import_mini15.z.number()),
|
|
3209
3363
|
hooks: hooksRecordSchema,
|
|
3210
|
-
cursor:
|
|
3211
|
-
claudecode:
|
|
3212
|
-
copilot:
|
|
3213
|
-
opencode:
|
|
3214
|
-
factorydroid:
|
|
3215
|
-
geminicli:
|
|
3364
|
+
cursor: import_mini15.z.optional(import_mini15.z.looseObject({ hooks: import_mini15.z.optional(hooksRecordSchema) })),
|
|
3365
|
+
claudecode: import_mini15.z.optional(import_mini15.z.looseObject({ hooks: import_mini15.z.optional(hooksRecordSchema) })),
|
|
3366
|
+
copilot: import_mini15.z.optional(import_mini15.z.looseObject({ hooks: import_mini15.z.optional(hooksRecordSchema) })),
|
|
3367
|
+
opencode: import_mini15.z.optional(import_mini15.z.looseObject({ hooks: import_mini15.z.optional(hooksRecordSchema) })),
|
|
3368
|
+
factorydroid: import_mini15.z.optional(import_mini15.z.looseObject({ hooks: import_mini15.z.optional(hooksRecordSchema) })),
|
|
3369
|
+
geminicli: import_mini15.z.optional(import_mini15.z.looseObject({ hooks: import_mini15.z.optional(hooksRecordSchema) }))
|
|
3216
3370
|
});
|
|
3217
3371
|
var CANONICAL_TO_CLAUDE_EVENT_NAMES = {
|
|
3218
3372
|
sessionStart: "SessionStart",
|
|
@@ -3309,7 +3463,7 @@ var GEMINICLI_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
|
|
|
3309
3463
|
);
|
|
3310
3464
|
|
|
3311
3465
|
// src/features/hooks/claudecode-hooks.ts
|
|
3312
|
-
var
|
|
3466
|
+
var import_node_path24 = require("path");
|
|
3313
3467
|
|
|
3314
3468
|
// src/features/hooks/tool-hooks-converter.ts
|
|
3315
3469
|
function isToolMatcherEntry(x) {
|
|
@@ -3417,7 +3571,7 @@ var ToolFile = class extends AiFile {
|
|
|
3417
3571
|
};
|
|
3418
3572
|
|
|
3419
3573
|
// src/features/hooks/rulesync-hooks.ts
|
|
3420
|
-
var
|
|
3574
|
+
var import_node_path23 = require("path");
|
|
3421
3575
|
var RulesyncHooks = class _RulesyncHooks extends RulesyncFile {
|
|
3422
3576
|
json;
|
|
3423
3577
|
constructor(params) {
|
|
@@ -3448,7 +3602,7 @@ var RulesyncHooks = class _RulesyncHooks extends RulesyncFile {
|
|
|
3448
3602
|
validate = true
|
|
3449
3603
|
}) {
|
|
3450
3604
|
const paths = _RulesyncHooks.getSettablePaths();
|
|
3451
|
-
const filePath = (0,
|
|
3605
|
+
const filePath = (0, import_node_path23.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
3452
3606
|
if (!await fileExists(filePath)) {
|
|
3453
3607
|
throw new Error(`No ${RULESYNC_HOOKS_RELATIVE_FILE_PATH} found.`);
|
|
3454
3608
|
}
|
|
@@ -3528,7 +3682,7 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
|
|
|
3528
3682
|
global = false
|
|
3529
3683
|
}) {
|
|
3530
3684
|
const paths = _ClaudecodeHooks.getSettablePaths({ global });
|
|
3531
|
-
const filePath = (0,
|
|
3685
|
+
const filePath = (0, import_node_path24.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
3532
3686
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
|
|
3533
3687
|
return new _ClaudecodeHooks({
|
|
3534
3688
|
baseDir,
|
|
@@ -3545,7 +3699,7 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
|
|
|
3545
3699
|
global = false
|
|
3546
3700
|
}) {
|
|
3547
3701
|
const paths = _ClaudecodeHooks.getSettablePaths({ global });
|
|
3548
|
-
const filePath = (0,
|
|
3702
|
+
const filePath = (0, import_node_path24.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
3549
3703
|
const existingContent = await readOrInitializeFileContent(
|
|
3550
3704
|
filePath,
|
|
3551
3705
|
JSON.stringify({}, null, 2)
|
|
@@ -3581,7 +3735,7 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
|
|
|
3581
3735
|
settings = JSON.parse(this.getFileContent());
|
|
3582
3736
|
} catch (error) {
|
|
3583
3737
|
throw new Error(
|
|
3584
|
-
`Failed to parse Claude hooks content in ${(0,
|
|
3738
|
+
`Failed to parse Claude hooks content in ${(0, import_node_path24.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
3585
3739
|
{
|
|
3586
3740
|
cause: error
|
|
3587
3741
|
}
|
|
@@ -3614,13 +3768,13 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
|
|
|
3614
3768
|
};
|
|
3615
3769
|
|
|
3616
3770
|
// src/features/hooks/copilot-hooks.ts
|
|
3617
|
-
var
|
|
3618
|
-
var
|
|
3619
|
-
var CopilotHookEntrySchema =
|
|
3620
|
-
type:
|
|
3621
|
-
bash:
|
|
3622
|
-
powershell:
|
|
3623
|
-
timeoutSec:
|
|
3771
|
+
var import_node_path25 = require("path");
|
|
3772
|
+
var import_mini16 = require("zod/mini");
|
|
3773
|
+
var CopilotHookEntrySchema = import_mini16.z.looseObject({
|
|
3774
|
+
type: import_mini16.z.string(),
|
|
3775
|
+
bash: import_mini16.z.optional(import_mini16.z.string()),
|
|
3776
|
+
powershell: import_mini16.z.optional(import_mini16.z.string()),
|
|
3777
|
+
timeoutSec: import_mini16.z.optional(import_mini16.z.number())
|
|
3624
3778
|
});
|
|
3625
3779
|
function canonicalToCopilotHooks(config) {
|
|
3626
3780
|
const canonicalSchemaKeys = Object.keys(HookDefinitionSchema.shape);
|
|
@@ -3717,7 +3871,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
|
|
|
3717
3871
|
}
|
|
3718
3872
|
static getSettablePaths(_options = {}) {
|
|
3719
3873
|
return {
|
|
3720
|
-
relativeDirPath: (0,
|
|
3874
|
+
relativeDirPath: (0, import_node_path25.join)(".github", "hooks"),
|
|
3721
3875
|
relativeFilePath: "copilot-hooks.json"
|
|
3722
3876
|
};
|
|
3723
3877
|
}
|
|
@@ -3727,7 +3881,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
|
|
|
3727
3881
|
global = false
|
|
3728
3882
|
}) {
|
|
3729
3883
|
const paths = _CopilotHooks.getSettablePaths({ global });
|
|
3730
|
-
const filePath = (0,
|
|
3884
|
+
const filePath = (0, import_node_path25.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
3731
3885
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
|
|
3732
3886
|
return new _CopilotHooks({
|
|
3733
3887
|
baseDir,
|
|
@@ -3760,7 +3914,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
|
|
|
3760
3914
|
parsed = JSON.parse(this.getFileContent());
|
|
3761
3915
|
} catch (error) {
|
|
3762
3916
|
throw new Error(
|
|
3763
|
-
`Failed to parse Copilot hooks content in ${(0,
|
|
3917
|
+
`Failed to parse Copilot hooks content in ${(0, import_node_path25.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
3764
3918
|
{
|
|
3765
3919
|
cause: error
|
|
3766
3920
|
}
|
|
@@ -3790,7 +3944,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
|
|
|
3790
3944
|
};
|
|
3791
3945
|
|
|
3792
3946
|
// src/features/hooks/cursor-hooks.ts
|
|
3793
|
-
var
|
|
3947
|
+
var import_node_path26 = require("path");
|
|
3794
3948
|
var CursorHooks = class _CursorHooks extends ToolHooks {
|
|
3795
3949
|
constructor(params) {
|
|
3796
3950
|
const { rulesyncHooks: _r, ...rest } = params;
|
|
@@ -3811,7 +3965,7 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
|
|
|
3811
3965
|
}) {
|
|
3812
3966
|
const paths = _CursorHooks.getSettablePaths();
|
|
3813
3967
|
const fileContent = await readFileContent(
|
|
3814
|
-
(0,
|
|
3968
|
+
(0, import_node_path26.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
3815
3969
|
);
|
|
3816
3970
|
return new _CursorHooks({
|
|
3817
3971
|
baseDir,
|
|
@@ -3898,7 +4052,7 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
|
|
|
3898
4052
|
};
|
|
3899
4053
|
|
|
3900
4054
|
// src/features/hooks/factorydroid-hooks.ts
|
|
3901
|
-
var
|
|
4055
|
+
var import_node_path27 = require("path");
|
|
3902
4056
|
var FACTORYDROID_CONVERTER_CONFIG = {
|
|
3903
4057
|
supportedEvents: FACTORYDROID_HOOK_EVENTS,
|
|
3904
4058
|
canonicalToToolEventNames: CANONICAL_TO_FACTORYDROID_EVENT_NAMES,
|
|
@@ -3924,7 +4078,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
3924
4078
|
global = false
|
|
3925
4079
|
}) {
|
|
3926
4080
|
const paths = _FactorydroidHooks.getSettablePaths({ global });
|
|
3927
|
-
const filePath = (0,
|
|
4081
|
+
const filePath = (0, import_node_path27.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
3928
4082
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
|
|
3929
4083
|
return new _FactorydroidHooks({
|
|
3930
4084
|
baseDir,
|
|
@@ -3941,7 +4095,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
3941
4095
|
global = false
|
|
3942
4096
|
}) {
|
|
3943
4097
|
const paths = _FactorydroidHooks.getSettablePaths({ global });
|
|
3944
|
-
const filePath = (0,
|
|
4098
|
+
const filePath = (0, import_node_path27.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
3945
4099
|
const existingContent = await readOrInitializeFileContent(
|
|
3946
4100
|
filePath,
|
|
3947
4101
|
JSON.stringify({}, null, 2)
|
|
@@ -3977,7 +4131,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
3977
4131
|
settings = JSON.parse(this.getFileContent());
|
|
3978
4132
|
} catch (error) {
|
|
3979
4133
|
throw new Error(
|
|
3980
|
-
`Failed to parse Factory Droid hooks content in ${(0,
|
|
4134
|
+
`Failed to parse Factory Droid hooks content in ${(0, import_node_path27.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
3981
4135
|
{
|
|
3982
4136
|
cause: error
|
|
3983
4137
|
}
|
|
@@ -4010,8 +4164,8 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
4010
4164
|
};
|
|
4011
4165
|
|
|
4012
4166
|
// src/features/hooks/geminicli-hooks.ts
|
|
4013
|
-
var
|
|
4014
|
-
var
|
|
4167
|
+
var import_node_path28 = require("path");
|
|
4168
|
+
var import_mini17 = require("zod/mini");
|
|
4015
4169
|
function canonicalToGeminicliHooks(config) {
|
|
4016
4170
|
const geminiSupported = new Set(GEMINICLI_HOOK_EVENTS);
|
|
4017
4171
|
const sharedHooks = {};
|
|
@@ -4055,16 +4209,16 @@ function canonicalToGeminicliHooks(config) {
|
|
|
4055
4209
|
}
|
|
4056
4210
|
return gemini;
|
|
4057
4211
|
}
|
|
4058
|
-
var GeminiHookEntrySchema =
|
|
4059
|
-
type:
|
|
4060
|
-
command:
|
|
4061
|
-
timeout:
|
|
4062
|
-
name:
|
|
4063
|
-
description:
|
|
4212
|
+
var GeminiHookEntrySchema = import_mini17.z.looseObject({
|
|
4213
|
+
type: import_mini17.z.optional(import_mini17.z.string()),
|
|
4214
|
+
command: import_mini17.z.optional(import_mini17.z.string()),
|
|
4215
|
+
timeout: import_mini17.z.optional(import_mini17.z.number()),
|
|
4216
|
+
name: import_mini17.z.optional(import_mini17.z.string()),
|
|
4217
|
+
description: import_mini17.z.optional(import_mini17.z.string())
|
|
4064
4218
|
});
|
|
4065
|
-
var GeminiMatcherEntrySchema =
|
|
4066
|
-
matcher:
|
|
4067
|
-
hooks:
|
|
4219
|
+
var GeminiMatcherEntrySchema = import_mini17.z.looseObject({
|
|
4220
|
+
matcher: import_mini17.z.optional(import_mini17.z.string()),
|
|
4221
|
+
hooks: import_mini17.z.optional(import_mini17.z.array(GeminiHookEntrySchema))
|
|
4068
4222
|
});
|
|
4069
4223
|
function geminiHooksToCanonical(geminiHooks) {
|
|
4070
4224
|
if (geminiHooks === null || geminiHooks === void 0 || typeof geminiHooks !== "object") {
|
|
@@ -4119,7 +4273,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
|
|
|
4119
4273
|
global = false
|
|
4120
4274
|
}) {
|
|
4121
4275
|
const paths = _GeminicliHooks.getSettablePaths({ global });
|
|
4122
|
-
const filePath = (0,
|
|
4276
|
+
const filePath = (0, import_node_path28.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4123
4277
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
|
|
4124
4278
|
return new _GeminicliHooks({
|
|
4125
4279
|
baseDir,
|
|
@@ -4136,7 +4290,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
|
|
|
4136
4290
|
global = false
|
|
4137
4291
|
}) {
|
|
4138
4292
|
const paths = _GeminicliHooks.getSettablePaths({ global });
|
|
4139
|
-
const filePath = (0,
|
|
4293
|
+
const filePath = (0, import_node_path28.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4140
4294
|
const existingContent = await readOrInitializeFileContent(
|
|
4141
4295
|
filePath,
|
|
4142
4296
|
JSON.stringify({}, null, 2)
|
|
@@ -4168,7 +4322,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
|
|
|
4168
4322
|
settings = JSON.parse(this.getFileContent());
|
|
4169
4323
|
} catch (error) {
|
|
4170
4324
|
throw new Error(
|
|
4171
|
-
`Failed to parse Gemini CLI hooks content in ${(0,
|
|
4325
|
+
`Failed to parse Gemini CLI hooks content in ${(0, import_node_path28.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
4172
4326
|
{
|
|
4173
4327
|
cause: error
|
|
4174
4328
|
}
|
|
@@ -4198,7 +4352,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
|
|
|
4198
4352
|
};
|
|
4199
4353
|
|
|
4200
4354
|
// src/features/hooks/opencode-hooks.ts
|
|
4201
|
-
var
|
|
4355
|
+
var import_node_path29 = require("path");
|
|
4202
4356
|
var NAMED_HOOKS = /* @__PURE__ */ new Set(["tool.execute.before", "tool.execute.after"]);
|
|
4203
4357
|
function escapeForTemplateLiteral(command) {
|
|
4204
4358
|
return command.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${");
|
|
@@ -4296,7 +4450,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
|
|
|
4296
4450
|
}
|
|
4297
4451
|
static getSettablePaths(options) {
|
|
4298
4452
|
return {
|
|
4299
|
-
relativeDirPath: options?.global ? (0,
|
|
4453
|
+
relativeDirPath: options?.global ? (0, import_node_path29.join)(".config", "opencode", "plugins") : (0, import_node_path29.join)(".opencode", "plugins"),
|
|
4300
4454
|
relativeFilePath: "rulesync-hooks.js"
|
|
4301
4455
|
};
|
|
4302
4456
|
}
|
|
@@ -4307,7 +4461,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
|
|
|
4307
4461
|
}) {
|
|
4308
4462
|
const paths = _OpencodeHooks.getSettablePaths({ global });
|
|
4309
4463
|
const fileContent = await readFileContent(
|
|
4310
|
-
(0,
|
|
4464
|
+
(0, import_node_path29.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
4311
4465
|
);
|
|
4312
4466
|
return new _OpencodeHooks({
|
|
4313
4467
|
baseDir,
|
|
@@ -4364,7 +4518,7 @@ var hooksProcessorToolTargetTuple = [
|
|
|
4364
4518
|
"factorydroid",
|
|
4365
4519
|
"geminicli"
|
|
4366
4520
|
];
|
|
4367
|
-
var HooksProcessorToolTargetSchema =
|
|
4521
|
+
var HooksProcessorToolTargetSchema = import_mini18.z.enum(hooksProcessorToolTargetTuple);
|
|
4368
4522
|
var toolHooksFactories = /* @__PURE__ */ new Map([
|
|
4369
4523
|
[
|
|
4370
4524
|
"cursor",
|
|
@@ -4599,13 +4753,13 @@ var HooksProcessor = class extends FeatureProcessor {
|
|
|
4599
4753
|
};
|
|
4600
4754
|
|
|
4601
4755
|
// src/features/ignore/ignore-processor.ts
|
|
4602
|
-
var
|
|
4756
|
+
var import_mini19 = require("zod/mini");
|
|
4603
4757
|
|
|
4604
4758
|
// src/features/ignore/augmentcode-ignore.ts
|
|
4605
|
-
var
|
|
4759
|
+
var import_node_path31 = require("path");
|
|
4606
4760
|
|
|
4607
4761
|
// src/features/ignore/rulesync-ignore.ts
|
|
4608
|
-
var
|
|
4762
|
+
var import_node_path30 = require("path");
|
|
4609
4763
|
var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
4610
4764
|
validate() {
|
|
4611
4765
|
return { success: true, error: null };
|
|
@@ -4625,12 +4779,12 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
|
4625
4779
|
static async fromFile() {
|
|
4626
4780
|
const baseDir = process.cwd();
|
|
4627
4781
|
const paths = this.getSettablePaths();
|
|
4628
|
-
const recommendedPath = (0,
|
|
4782
|
+
const recommendedPath = (0, import_node_path30.join)(
|
|
4629
4783
|
baseDir,
|
|
4630
4784
|
paths.recommended.relativeDirPath,
|
|
4631
4785
|
paths.recommended.relativeFilePath
|
|
4632
4786
|
);
|
|
4633
|
-
const legacyPath = (0,
|
|
4787
|
+
const legacyPath = (0, import_node_path30.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
4634
4788
|
if (await fileExists(recommendedPath)) {
|
|
4635
4789
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
4636
4790
|
return new _RulesyncIgnore({
|
|
@@ -4746,7 +4900,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
4746
4900
|
validate = true
|
|
4747
4901
|
}) {
|
|
4748
4902
|
const fileContent = await readFileContent(
|
|
4749
|
-
(0,
|
|
4903
|
+
(0, import_node_path31.join)(
|
|
4750
4904
|
baseDir,
|
|
4751
4905
|
this.getSettablePaths().relativeDirPath,
|
|
4752
4906
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4776,7 +4930,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
4776
4930
|
};
|
|
4777
4931
|
|
|
4778
4932
|
// src/features/ignore/claudecode-ignore.ts
|
|
4779
|
-
var
|
|
4933
|
+
var import_node_path32 = require("path");
|
|
4780
4934
|
var import_es_toolkit2 = require("es-toolkit");
|
|
4781
4935
|
var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
4782
4936
|
constructor(params) {
|
|
@@ -4819,7 +4973,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
4819
4973
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
4820
4974
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
4821
4975
|
const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
|
|
4822
|
-
const filePath = (0,
|
|
4976
|
+
const filePath = (0, import_node_path32.join)(
|
|
4823
4977
|
baseDir,
|
|
4824
4978
|
this.getSettablePaths().relativeDirPath,
|
|
4825
4979
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4855,7 +5009,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
4855
5009
|
validate = true
|
|
4856
5010
|
}) {
|
|
4857
5011
|
const fileContent = await readFileContent(
|
|
4858
|
-
(0,
|
|
5012
|
+
(0, import_node_path32.join)(
|
|
4859
5013
|
baseDir,
|
|
4860
5014
|
this.getSettablePaths().relativeDirPath,
|
|
4861
5015
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4885,7 +5039,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
4885
5039
|
};
|
|
4886
5040
|
|
|
4887
5041
|
// src/features/ignore/cline-ignore.ts
|
|
4888
|
-
var
|
|
5042
|
+
var import_node_path33 = require("path");
|
|
4889
5043
|
var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
4890
5044
|
static getSettablePaths() {
|
|
4891
5045
|
return {
|
|
@@ -4922,7 +5076,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
4922
5076
|
validate = true
|
|
4923
5077
|
}) {
|
|
4924
5078
|
const fileContent = await readFileContent(
|
|
4925
|
-
(0,
|
|
5079
|
+
(0, import_node_path33.join)(
|
|
4926
5080
|
baseDir,
|
|
4927
5081
|
this.getSettablePaths().relativeDirPath,
|
|
4928
5082
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4952,7 +5106,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
4952
5106
|
};
|
|
4953
5107
|
|
|
4954
5108
|
// src/features/ignore/cursor-ignore.ts
|
|
4955
|
-
var
|
|
5109
|
+
var import_node_path34 = require("path");
|
|
4956
5110
|
var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
4957
5111
|
static getSettablePaths() {
|
|
4958
5112
|
return {
|
|
@@ -4985,7 +5139,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
4985
5139
|
validate = true
|
|
4986
5140
|
}) {
|
|
4987
5141
|
const fileContent = await readFileContent(
|
|
4988
|
-
(0,
|
|
5142
|
+
(0, import_node_path34.join)(
|
|
4989
5143
|
baseDir,
|
|
4990
5144
|
this.getSettablePaths().relativeDirPath,
|
|
4991
5145
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5015,7 +5169,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
5015
5169
|
};
|
|
5016
5170
|
|
|
5017
5171
|
// src/features/ignore/geminicli-ignore.ts
|
|
5018
|
-
var
|
|
5172
|
+
var import_node_path35 = require("path");
|
|
5019
5173
|
var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
5020
5174
|
static getSettablePaths() {
|
|
5021
5175
|
return {
|
|
@@ -5042,7 +5196,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
5042
5196
|
validate = true
|
|
5043
5197
|
}) {
|
|
5044
5198
|
const fileContent = await readFileContent(
|
|
5045
|
-
(0,
|
|
5199
|
+
(0, import_node_path35.join)(
|
|
5046
5200
|
baseDir,
|
|
5047
5201
|
this.getSettablePaths().relativeDirPath,
|
|
5048
5202
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5072,7 +5226,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
5072
5226
|
};
|
|
5073
5227
|
|
|
5074
5228
|
// src/features/ignore/goose-ignore.ts
|
|
5075
|
-
var
|
|
5229
|
+
var import_node_path36 = require("path");
|
|
5076
5230
|
var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
5077
5231
|
static getSettablePaths() {
|
|
5078
5232
|
return {
|
|
@@ -5109,7 +5263,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
|
5109
5263
|
validate = true
|
|
5110
5264
|
}) {
|
|
5111
5265
|
const fileContent = await readFileContent(
|
|
5112
|
-
(0,
|
|
5266
|
+
(0, import_node_path36.join)(
|
|
5113
5267
|
baseDir,
|
|
5114
5268
|
this.getSettablePaths().relativeDirPath,
|
|
5115
5269
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5139,7 +5293,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
|
5139
5293
|
};
|
|
5140
5294
|
|
|
5141
5295
|
// src/features/ignore/junie-ignore.ts
|
|
5142
|
-
var
|
|
5296
|
+
var import_node_path37 = require("path");
|
|
5143
5297
|
var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
5144
5298
|
static getSettablePaths() {
|
|
5145
5299
|
return {
|
|
@@ -5166,7 +5320,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
5166
5320
|
validate = true
|
|
5167
5321
|
}) {
|
|
5168
5322
|
const fileContent = await readFileContent(
|
|
5169
|
-
(0,
|
|
5323
|
+
(0, import_node_path37.join)(
|
|
5170
5324
|
baseDir,
|
|
5171
5325
|
this.getSettablePaths().relativeDirPath,
|
|
5172
5326
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5196,7 +5350,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
5196
5350
|
};
|
|
5197
5351
|
|
|
5198
5352
|
// src/features/ignore/kilo-ignore.ts
|
|
5199
|
-
var
|
|
5353
|
+
var import_node_path38 = require("path");
|
|
5200
5354
|
var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
5201
5355
|
static getSettablePaths() {
|
|
5202
5356
|
return {
|
|
@@ -5233,7 +5387,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
|
5233
5387
|
validate = true
|
|
5234
5388
|
}) {
|
|
5235
5389
|
const fileContent = await readFileContent(
|
|
5236
|
-
(0,
|
|
5390
|
+
(0, import_node_path38.join)(
|
|
5237
5391
|
baseDir,
|
|
5238
5392
|
this.getSettablePaths().relativeDirPath,
|
|
5239
5393
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5263,7 +5417,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
|
5263
5417
|
};
|
|
5264
5418
|
|
|
5265
5419
|
// src/features/ignore/kiro-ignore.ts
|
|
5266
|
-
var
|
|
5420
|
+
var import_node_path39 = require("path");
|
|
5267
5421
|
var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
5268
5422
|
static getSettablePaths() {
|
|
5269
5423
|
return {
|
|
@@ -5290,7 +5444,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
5290
5444
|
validate = true
|
|
5291
5445
|
}) {
|
|
5292
5446
|
const fileContent = await readFileContent(
|
|
5293
|
-
(0,
|
|
5447
|
+
(0, import_node_path39.join)(
|
|
5294
5448
|
baseDir,
|
|
5295
5449
|
this.getSettablePaths().relativeDirPath,
|
|
5296
5450
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5320,7 +5474,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
5320
5474
|
};
|
|
5321
5475
|
|
|
5322
5476
|
// src/features/ignore/qwencode-ignore.ts
|
|
5323
|
-
var
|
|
5477
|
+
var import_node_path40 = require("path");
|
|
5324
5478
|
var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
5325
5479
|
static getSettablePaths() {
|
|
5326
5480
|
return {
|
|
@@ -5347,7 +5501,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
5347
5501
|
validate = true
|
|
5348
5502
|
}) {
|
|
5349
5503
|
const fileContent = await readFileContent(
|
|
5350
|
-
(0,
|
|
5504
|
+
(0, import_node_path40.join)(
|
|
5351
5505
|
baseDir,
|
|
5352
5506
|
this.getSettablePaths().relativeDirPath,
|
|
5353
5507
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5377,7 +5531,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
5377
5531
|
};
|
|
5378
5532
|
|
|
5379
5533
|
// src/features/ignore/roo-ignore.ts
|
|
5380
|
-
var
|
|
5534
|
+
var import_node_path41 = require("path");
|
|
5381
5535
|
var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
5382
5536
|
static getSettablePaths() {
|
|
5383
5537
|
return {
|
|
@@ -5404,7 +5558,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
5404
5558
|
validate = true
|
|
5405
5559
|
}) {
|
|
5406
5560
|
const fileContent = await readFileContent(
|
|
5407
|
-
(0,
|
|
5561
|
+
(0, import_node_path41.join)(
|
|
5408
5562
|
baseDir,
|
|
5409
5563
|
this.getSettablePaths().relativeDirPath,
|
|
5410
5564
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5434,7 +5588,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
5434
5588
|
};
|
|
5435
5589
|
|
|
5436
5590
|
// src/features/ignore/windsurf-ignore.ts
|
|
5437
|
-
var
|
|
5591
|
+
var import_node_path42 = require("path");
|
|
5438
5592
|
var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
5439
5593
|
static getSettablePaths() {
|
|
5440
5594
|
return {
|
|
@@ -5461,7 +5615,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
5461
5615
|
validate = true
|
|
5462
5616
|
}) {
|
|
5463
5617
|
const fileContent = await readFileContent(
|
|
5464
|
-
(0,
|
|
5618
|
+
(0, import_node_path42.join)(
|
|
5465
5619
|
baseDir,
|
|
5466
5620
|
this.getSettablePaths().relativeDirPath,
|
|
5467
5621
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5491,7 +5645,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
5491
5645
|
};
|
|
5492
5646
|
|
|
5493
5647
|
// src/features/ignore/zed-ignore.ts
|
|
5494
|
-
var
|
|
5648
|
+
var import_node_path43 = require("path");
|
|
5495
5649
|
var import_es_toolkit3 = require("es-toolkit");
|
|
5496
5650
|
var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
5497
5651
|
constructor(params) {
|
|
@@ -5528,7 +5682,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
|
5528
5682
|
}) {
|
|
5529
5683
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
5530
5684
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
5531
|
-
const filePath = (0,
|
|
5685
|
+
const filePath = (0, import_node_path43.join)(
|
|
5532
5686
|
baseDir,
|
|
5533
5687
|
this.getSettablePaths().relativeDirPath,
|
|
5534
5688
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5555,7 +5709,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
|
5555
5709
|
validate = true
|
|
5556
5710
|
}) {
|
|
5557
5711
|
const fileContent = await readFileContent(
|
|
5558
|
-
(0,
|
|
5712
|
+
(0, import_node_path43.join)(
|
|
5559
5713
|
baseDir,
|
|
5560
5714
|
this.getSettablePaths().relativeDirPath,
|
|
5561
5715
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5601,7 +5755,7 @@ var ignoreProcessorToolTargets = [
|
|
|
5601
5755
|
"windsurf",
|
|
5602
5756
|
"zed"
|
|
5603
5757
|
];
|
|
5604
|
-
var IgnoreProcessorToolTargetSchema =
|
|
5758
|
+
var IgnoreProcessorToolTargetSchema = import_mini19.z.enum(ignoreProcessorToolTargets);
|
|
5605
5759
|
var toolIgnoreFactories = /* @__PURE__ */ new Map([
|
|
5606
5760
|
["augmentcode", { class: AugmentcodeIgnore }],
|
|
5607
5761
|
["claudecode", { class: ClaudecodeIgnore }],
|
|
@@ -5739,52 +5893,52 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
5739
5893
|
};
|
|
5740
5894
|
|
|
5741
5895
|
// src/features/mcp/mcp-processor.ts
|
|
5742
|
-
var
|
|
5896
|
+
var import_mini23 = require("zod/mini");
|
|
5743
5897
|
|
|
5744
5898
|
// src/features/mcp/claudecode-mcp.ts
|
|
5745
|
-
var
|
|
5899
|
+
var import_node_path45 = require("path");
|
|
5746
5900
|
|
|
5747
5901
|
// src/features/mcp/rulesync-mcp.ts
|
|
5748
|
-
var
|
|
5902
|
+
var import_node_path44 = require("path");
|
|
5749
5903
|
var import_object = require("es-toolkit/object");
|
|
5750
|
-
var
|
|
5904
|
+
var import_mini21 = require("zod/mini");
|
|
5751
5905
|
|
|
5752
5906
|
// src/types/mcp.ts
|
|
5753
|
-
var
|
|
5754
|
-
var McpServerSchema =
|
|
5755
|
-
type:
|
|
5756
|
-
command:
|
|
5757
|
-
args:
|
|
5758
|
-
url:
|
|
5759
|
-
httpUrl:
|
|
5760
|
-
env:
|
|
5761
|
-
disabled:
|
|
5762
|
-
networkTimeout:
|
|
5763
|
-
timeout:
|
|
5764
|
-
trust:
|
|
5765
|
-
cwd:
|
|
5766
|
-
transport:
|
|
5767
|
-
alwaysAllow:
|
|
5768
|
-
tools:
|
|
5769
|
-
kiroAutoApprove:
|
|
5770
|
-
kiroAutoBlock:
|
|
5771
|
-
headers:
|
|
5772
|
-
enabledTools:
|
|
5773
|
-
disabledTools:
|
|
5907
|
+
var import_mini20 = require("zod/mini");
|
|
5908
|
+
var McpServerSchema = import_mini20.z.looseObject({
|
|
5909
|
+
type: import_mini20.z.optional(import_mini20.z.enum(["stdio", "sse", "http"])),
|
|
5910
|
+
command: import_mini20.z.optional(import_mini20.z.union([import_mini20.z.string(), import_mini20.z.array(import_mini20.z.string())])),
|
|
5911
|
+
args: import_mini20.z.optional(import_mini20.z.array(import_mini20.z.string())),
|
|
5912
|
+
url: import_mini20.z.optional(import_mini20.z.string()),
|
|
5913
|
+
httpUrl: import_mini20.z.optional(import_mini20.z.string()),
|
|
5914
|
+
env: import_mini20.z.optional(import_mini20.z.record(import_mini20.z.string(), import_mini20.z.string())),
|
|
5915
|
+
disabled: import_mini20.z.optional(import_mini20.z.boolean()),
|
|
5916
|
+
networkTimeout: import_mini20.z.optional(import_mini20.z.number()),
|
|
5917
|
+
timeout: import_mini20.z.optional(import_mini20.z.number()),
|
|
5918
|
+
trust: import_mini20.z.optional(import_mini20.z.boolean()),
|
|
5919
|
+
cwd: import_mini20.z.optional(import_mini20.z.string()),
|
|
5920
|
+
transport: import_mini20.z.optional(import_mini20.z.enum(["stdio", "sse", "http"])),
|
|
5921
|
+
alwaysAllow: import_mini20.z.optional(import_mini20.z.array(import_mini20.z.string())),
|
|
5922
|
+
tools: import_mini20.z.optional(import_mini20.z.array(import_mini20.z.string())),
|
|
5923
|
+
kiroAutoApprove: import_mini20.z.optional(import_mini20.z.array(import_mini20.z.string())),
|
|
5924
|
+
kiroAutoBlock: import_mini20.z.optional(import_mini20.z.array(import_mini20.z.string())),
|
|
5925
|
+
headers: import_mini20.z.optional(import_mini20.z.record(import_mini20.z.string(), import_mini20.z.string())),
|
|
5926
|
+
enabledTools: import_mini20.z.optional(import_mini20.z.array(import_mini20.z.string())),
|
|
5927
|
+
disabledTools: import_mini20.z.optional(import_mini20.z.array(import_mini20.z.string()))
|
|
5774
5928
|
});
|
|
5775
|
-
var McpServersSchema =
|
|
5929
|
+
var McpServersSchema = import_mini20.z.record(import_mini20.z.string(), McpServerSchema);
|
|
5776
5930
|
|
|
5777
5931
|
// src/features/mcp/rulesync-mcp.ts
|
|
5778
|
-
var RulesyncMcpServerSchema =
|
|
5779
|
-
targets:
|
|
5780
|
-
description:
|
|
5781
|
-
exposed:
|
|
5932
|
+
var RulesyncMcpServerSchema = import_mini21.z.extend(McpServerSchema, {
|
|
5933
|
+
targets: import_mini21.z.optional(RulesyncTargetsSchema),
|
|
5934
|
+
description: import_mini21.z.optional(import_mini21.z.string()),
|
|
5935
|
+
exposed: import_mini21.z.optional(import_mini21.z.boolean())
|
|
5782
5936
|
});
|
|
5783
|
-
var RulesyncMcpConfigSchema =
|
|
5784
|
-
mcpServers:
|
|
5937
|
+
var RulesyncMcpConfigSchema = import_mini21.z.object({
|
|
5938
|
+
mcpServers: import_mini21.z.record(import_mini21.z.string(), RulesyncMcpServerSchema)
|
|
5785
5939
|
});
|
|
5786
|
-
var RulesyncMcpFileSchema =
|
|
5787
|
-
$schema:
|
|
5940
|
+
var RulesyncMcpFileSchema = import_mini21.z.looseObject({
|
|
5941
|
+
$schema: import_mini21.z.optional(import_mini21.z.string()),
|
|
5788
5942
|
...RulesyncMcpConfigSchema.shape
|
|
5789
5943
|
});
|
|
5790
5944
|
var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
@@ -5821,12 +5975,12 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
5821
5975
|
static async fromFile({ validate = true }) {
|
|
5822
5976
|
const baseDir = process.cwd();
|
|
5823
5977
|
const paths = this.getSettablePaths();
|
|
5824
|
-
const recommendedPath = (0,
|
|
5978
|
+
const recommendedPath = (0, import_node_path44.join)(
|
|
5825
5979
|
baseDir,
|
|
5826
5980
|
paths.recommended.relativeDirPath,
|
|
5827
5981
|
paths.recommended.relativeFilePath
|
|
5828
5982
|
);
|
|
5829
|
-
const legacyPath = (0,
|
|
5983
|
+
const legacyPath = (0, import_node_path44.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
5830
5984
|
if (await fileExists(recommendedPath)) {
|
|
5831
5985
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
5832
5986
|
return new _RulesyncMcp({
|
|
@@ -5980,7 +6134,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
5980
6134
|
global = false
|
|
5981
6135
|
}) {
|
|
5982
6136
|
const paths = this.getSettablePaths({ global });
|
|
5983
|
-
const fileContent = await readFileContentOrNull((0,
|
|
6137
|
+
const fileContent = await readFileContentOrNull((0, import_node_path45.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
5984
6138
|
const json = JSON.parse(fileContent);
|
|
5985
6139
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
5986
6140
|
return new _ClaudecodeMcp({
|
|
@@ -5999,7 +6153,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
5999
6153
|
}) {
|
|
6000
6154
|
const paths = this.getSettablePaths({ global });
|
|
6001
6155
|
const fileContent = await readOrInitializeFileContent(
|
|
6002
|
-
(0,
|
|
6156
|
+
(0, import_node_path45.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
6003
6157
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
6004
6158
|
);
|
|
6005
6159
|
const json = JSON.parse(fileContent);
|
|
@@ -6038,7 +6192,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
6038
6192
|
};
|
|
6039
6193
|
|
|
6040
6194
|
// src/features/mcp/cline-mcp.ts
|
|
6041
|
-
var
|
|
6195
|
+
var import_node_path46 = require("path");
|
|
6042
6196
|
var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
6043
6197
|
json;
|
|
6044
6198
|
constructor(params) {
|
|
@@ -6059,7 +6213,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
6059
6213
|
validate = true
|
|
6060
6214
|
}) {
|
|
6061
6215
|
const fileContent = await readFileContent(
|
|
6062
|
-
(0,
|
|
6216
|
+
(0, import_node_path46.join)(
|
|
6063
6217
|
baseDir,
|
|
6064
6218
|
this.getSettablePaths().relativeDirPath,
|
|
6065
6219
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6108,7 +6262,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
6108
6262
|
};
|
|
6109
6263
|
|
|
6110
6264
|
// src/features/mcp/codexcli-mcp.ts
|
|
6111
|
-
var
|
|
6265
|
+
var import_node_path47 = require("path");
|
|
6112
6266
|
var smolToml = __toESM(require("smol-toml"), 1);
|
|
6113
6267
|
function convertFromCodexFormat(codexMcp) {
|
|
6114
6268
|
const result = {};
|
|
@@ -6191,7 +6345,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
6191
6345
|
global = false
|
|
6192
6346
|
}) {
|
|
6193
6347
|
const paths = this.getSettablePaths({ global });
|
|
6194
|
-
const fileContent = await readFileContentOrNull((0,
|
|
6348
|
+
const fileContent = await readFileContentOrNull((0, import_node_path47.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
|
|
6195
6349
|
return new _CodexcliMcp({
|
|
6196
6350
|
baseDir,
|
|
6197
6351
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -6207,7 +6361,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
6207
6361
|
global = false
|
|
6208
6362
|
}) {
|
|
6209
6363
|
const paths = this.getSettablePaths({ global });
|
|
6210
|
-
const configTomlFilePath = (0,
|
|
6364
|
+
const configTomlFilePath = (0, import_node_path47.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
6211
6365
|
const configTomlFileContent = await readOrInitializeFileContent(
|
|
6212
6366
|
configTomlFilePath,
|
|
6213
6367
|
smolToml.stringify({})
|
|
@@ -6261,7 +6415,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
6261
6415
|
};
|
|
6262
6416
|
|
|
6263
6417
|
// src/features/mcp/copilot-mcp.ts
|
|
6264
|
-
var
|
|
6418
|
+
var import_node_path48 = require("path");
|
|
6265
6419
|
function convertToCopilotFormat(mcpServers) {
|
|
6266
6420
|
return { servers: mcpServers };
|
|
6267
6421
|
}
|
|
@@ -6288,7 +6442,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
6288
6442
|
validate = true
|
|
6289
6443
|
}) {
|
|
6290
6444
|
const fileContent = await readFileContent(
|
|
6291
|
-
(0,
|
|
6445
|
+
(0, import_node_path48.join)(
|
|
6292
6446
|
baseDir,
|
|
6293
6447
|
this.getSettablePaths().relativeDirPath,
|
|
6294
6448
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6341,7 +6495,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
6341
6495
|
};
|
|
6342
6496
|
|
|
6343
6497
|
// src/features/mcp/cursor-mcp.ts
|
|
6344
|
-
var
|
|
6498
|
+
var import_node_path49 = require("path");
|
|
6345
6499
|
var CURSOR_ENV_VAR_PATTERN = /\$\{env:([^}]+)\}/g;
|
|
6346
6500
|
function isMcpServers(value) {
|
|
6347
6501
|
return value !== void 0 && value !== null && typeof value === "object";
|
|
@@ -6391,7 +6545,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
6391
6545
|
this.json = JSON.parse(this.fileContent);
|
|
6392
6546
|
} catch (error) {
|
|
6393
6547
|
throw new Error(
|
|
6394
|
-
`Failed to parse Cursor MCP config at ${(0,
|
|
6548
|
+
`Failed to parse Cursor MCP config at ${(0, import_node_path49.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(error)}`,
|
|
6395
6549
|
{ cause: error }
|
|
6396
6550
|
);
|
|
6397
6551
|
}
|
|
@@ -6417,14 +6571,14 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
6417
6571
|
global = false
|
|
6418
6572
|
}) {
|
|
6419
6573
|
const paths = this.getSettablePaths({ global });
|
|
6420
|
-
const filePath = (0,
|
|
6574
|
+
const filePath = (0, import_node_path49.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
6421
6575
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"mcpServers":{}}';
|
|
6422
6576
|
let json;
|
|
6423
6577
|
try {
|
|
6424
6578
|
json = JSON.parse(fileContent);
|
|
6425
6579
|
} catch (error) {
|
|
6426
6580
|
throw new Error(
|
|
6427
|
-
`Failed to parse Cursor MCP config at ${(0,
|
|
6581
|
+
`Failed to parse Cursor MCP config at ${(0, import_node_path49.join)(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
|
|
6428
6582
|
{ cause: error }
|
|
6429
6583
|
);
|
|
6430
6584
|
}
|
|
@@ -6446,7 +6600,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
6446
6600
|
}) {
|
|
6447
6601
|
const paths = this.getSettablePaths({ global });
|
|
6448
6602
|
const fileContent = await readOrInitializeFileContent(
|
|
6449
|
-
(0,
|
|
6603
|
+
(0, import_node_path49.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
6450
6604
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
6451
6605
|
);
|
|
6452
6606
|
let json;
|
|
@@ -6454,7 +6608,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
6454
6608
|
json = JSON.parse(fileContent);
|
|
6455
6609
|
} catch (error) {
|
|
6456
6610
|
throw new Error(
|
|
6457
|
-
`Failed to parse Cursor MCP config at ${(0,
|
|
6611
|
+
`Failed to parse Cursor MCP config at ${(0, import_node_path49.join)(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
|
|
6458
6612
|
{ cause: error }
|
|
6459
6613
|
);
|
|
6460
6614
|
}
|
|
@@ -6503,7 +6657,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
6503
6657
|
};
|
|
6504
6658
|
|
|
6505
6659
|
// src/features/mcp/factorydroid-mcp.ts
|
|
6506
|
-
var
|
|
6660
|
+
var import_node_path50 = require("path");
|
|
6507
6661
|
var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
6508
6662
|
json;
|
|
6509
6663
|
constructor(params) {
|
|
@@ -6524,7 +6678,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
6524
6678
|
validate = true
|
|
6525
6679
|
}) {
|
|
6526
6680
|
const fileContent = await readFileContent(
|
|
6527
|
-
(0,
|
|
6681
|
+
(0, import_node_path50.join)(
|
|
6528
6682
|
baseDir,
|
|
6529
6683
|
this.getSettablePaths().relativeDirPath,
|
|
6530
6684
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6578,7 +6732,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
6578
6732
|
};
|
|
6579
6733
|
|
|
6580
6734
|
// src/features/mcp/geminicli-mcp.ts
|
|
6581
|
-
var
|
|
6735
|
+
var import_node_path51 = require("path");
|
|
6582
6736
|
var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
6583
6737
|
json;
|
|
6584
6738
|
constructor(params) {
|
|
@@ -6606,7 +6760,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
6606
6760
|
global = false
|
|
6607
6761
|
}) {
|
|
6608
6762
|
const paths = this.getSettablePaths({ global });
|
|
6609
|
-
const fileContent = await readFileContentOrNull((0,
|
|
6763
|
+
const fileContent = await readFileContentOrNull((0, import_node_path51.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6610
6764
|
const json = JSON.parse(fileContent);
|
|
6611
6765
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
6612
6766
|
return new _GeminiCliMcp({
|
|
@@ -6625,7 +6779,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
6625
6779
|
}) {
|
|
6626
6780
|
const paths = this.getSettablePaths({ global });
|
|
6627
6781
|
const fileContent = await readOrInitializeFileContent(
|
|
6628
|
-
(0,
|
|
6782
|
+
(0, import_node_path51.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
6629
6783
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
6630
6784
|
);
|
|
6631
6785
|
const json = JSON.parse(fileContent);
|
|
@@ -6670,7 +6824,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
6670
6824
|
};
|
|
6671
6825
|
|
|
6672
6826
|
// src/features/mcp/junie-mcp.ts
|
|
6673
|
-
var
|
|
6827
|
+
var import_node_path52 = require("path");
|
|
6674
6828
|
var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
6675
6829
|
json;
|
|
6676
6830
|
constructor(params) {
|
|
@@ -6682,7 +6836,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
6682
6836
|
}
|
|
6683
6837
|
static getSettablePaths() {
|
|
6684
6838
|
return {
|
|
6685
|
-
relativeDirPath: (0,
|
|
6839
|
+
relativeDirPath: (0, import_node_path52.join)(".junie", "mcp"),
|
|
6686
6840
|
relativeFilePath: "mcp.json"
|
|
6687
6841
|
};
|
|
6688
6842
|
}
|
|
@@ -6691,7 +6845,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
6691
6845
|
validate = true
|
|
6692
6846
|
}) {
|
|
6693
6847
|
const fileContent = await readFileContent(
|
|
6694
|
-
(0,
|
|
6848
|
+
(0, import_node_path52.join)(
|
|
6695
6849
|
baseDir,
|
|
6696
6850
|
this.getSettablePaths().relativeDirPath,
|
|
6697
6851
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6740,7 +6894,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
6740
6894
|
};
|
|
6741
6895
|
|
|
6742
6896
|
// src/features/mcp/kilo-mcp.ts
|
|
6743
|
-
var
|
|
6897
|
+
var import_node_path53 = require("path");
|
|
6744
6898
|
var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
6745
6899
|
json;
|
|
6746
6900
|
constructor(params) {
|
|
@@ -6761,7 +6915,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
6761
6915
|
validate = true
|
|
6762
6916
|
}) {
|
|
6763
6917
|
const paths = this.getSettablePaths();
|
|
6764
|
-
const fileContent = await readFileContentOrNull((0,
|
|
6918
|
+
const fileContent = await readFileContentOrNull((0, import_node_path53.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6765
6919
|
return new _KiloMcp({
|
|
6766
6920
|
baseDir,
|
|
6767
6921
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -6809,7 +6963,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
6809
6963
|
};
|
|
6810
6964
|
|
|
6811
6965
|
// src/features/mcp/kiro-mcp.ts
|
|
6812
|
-
var
|
|
6966
|
+
var import_node_path54 = require("path");
|
|
6813
6967
|
var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
6814
6968
|
json;
|
|
6815
6969
|
constructor(params) {
|
|
@@ -6821,7 +6975,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
6821
6975
|
}
|
|
6822
6976
|
static getSettablePaths() {
|
|
6823
6977
|
return {
|
|
6824
|
-
relativeDirPath: (0,
|
|
6978
|
+
relativeDirPath: (0, import_node_path54.join)(".kiro", "settings"),
|
|
6825
6979
|
relativeFilePath: "mcp.json"
|
|
6826
6980
|
};
|
|
6827
6981
|
}
|
|
@@ -6830,7 +6984,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
6830
6984
|
validate = true
|
|
6831
6985
|
}) {
|
|
6832
6986
|
const paths = this.getSettablePaths();
|
|
6833
|
-
const fileContent = await readFileContentOrNull((0,
|
|
6987
|
+
const fileContent = await readFileContentOrNull((0, import_node_path54.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6834
6988
|
return new _KiroMcp({
|
|
6835
6989
|
baseDir,
|
|
6836
6990
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -6878,30 +7032,30 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
6878
7032
|
};
|
|
6879
7033
|
|
|
6880
7034
|
// src/features/mcp/opencode-mcp.ts
|
|
6881
|
-
var
|
|
7035
|
+
var import_node_path55 = require("path");
|
|
6882
7036
|
var import_jsonc_parser2 = require("jsonc-parser");
|
|
6883
|
-
var
|
|
6884
|
-
var OpencodeMcpLocalServerSchema =
|
|
6885
|
-
type:
|
|
6886
|
-
command:
|
|
6887
|
-
environment:
|
|
6888
|
-
enabled:
|
|
6889
|
-
cwd:
|
|
7037
|
+
var import_mini22 = require("zod/mini");
|
|
7038
|
+
var OpencodeMcpLocalServerSchema = import_mini22.z.object({
|
|
7039
|
+
type: import_mini22.z.literal("local"),
|
|
7040
|
+
command: import_mini22.z.array(import_mini22.z.string()),
|
|
7041
|
+
environment: import_mini22.z.optional(import_mini22.z.record(import_mini22.z.string(), import_mini22.z.string())),
|
|
7042
|
+
enabled: import_mini22.z._default(import_mini22.z.boolean(), true),
|
|
7043
|
+
cwd: import_mini22.z.optional(import_mini22.z.string())
|
|
6890
7044
|
});
|
|
6891
|
-
var OpencodeMcpRemoteServerSchema =
|
|
6892
|
-
type:
|
|
6893
|
-
url:
|
|
6894
|
-
headers:
|
|
6895
|
-
enabled:
|
|
7045
|
+
var OpencodeMcpRemoteServerSchema = import_mini22.z.object({
|
|
7046
|
+
type: import_mini22.z.literal("remote"),
|
|
7047
|
+
url: import_mini22.z.string(),
|
|
7048
|
+
headers: import_mini22.z.optional(import_mini22.z.record(import_mini22.z.string(), import_mini22.z.string())),
|
|
7049
|
+
enabled: import_mini22.z._default(import_mini22.z.boolean(), true)
|
|
6896
7050
|
});
|
|
6897
|
-
var OpencodeMcpServerSchema =
|
|
7051
|
+
var OpencodeMcpServerSchema = import_mini22.z.union([
|
|
6898
7052
|
OpencodeMcpLocalServerSchema,
|
|
6899
7053
|
OpencodeMcpRemoteServerSchema
|
|
6900
7054
|
]);
|
|
6901
|
-
var OpencodeConfigSchema =
|
|
6902
|
-
$schema:
|
|
6903
|
-
mcp:
|
|
6904
|
-
tools:
|
|
7055
|
+
var OpencodeConfigSchema = import_mini22.z.looseObject({
|
|
7056
|
+
$schema: import_mini22.z.optional(import_mini22.z.string()),
|
|
7057
|
+
mcp: import_mini22.z.optional(import_mini22.z.record(import_mini22.z.string(), OpencodeMcpServerSchema)),
|
|
7058
|
+
tools: import_mini22.z.optional(import_mini22.z.record(import_mini22.z.string(), import_mini22.z.boolean()))
|
|
6905
7059
|
});
|
|
6906
7060
|
function convertFromOpencodeFormat(opencodeMcp, tools) {
|
|
6907
7061
|
return Object.fromEntries(
|
|
@@ -7019,7 +7173,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
7019
7173
|
static getSettablePaths({ global } = {}) {
|
|
7020
7174
|
if (global) {
|
|
7021
7175
|
return {
|
|
7022
|
-
relativeDirPath: (0,
|
|
7176
|
+
relativeDirPath: (0, import_node_path55.join)(".config", "opencode"),
|
|
7023
7177
|
relativeFilePath: "opencode.json"
|
|
7024
7178
|
};
|
|
7025
7179
|
}
|
|
@@ -7034,11 +7188,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
7034
7188
|
global = false
|
|
7035
7189
|
}) {
|
|
7036
7190
|
const basePaths = this.getSettablePaths({ global });
|
|
7037
|
-
const jsonDir = (0,
|
|
7191
|
+
const jsonDir = (0, import_node_path55.join)(baseDir, basePaths.relativeDirPath);
|
|
7038
7192
|
let fileContent = null;
|
|
7039
7193
|
let relativeFilePath = "opencode.jsonc";
|
|
7040
|
-
const jsoncPath = (0,
|
|
7041
|
-
const jsonPath = (0,
|
|
7194
|
+
const jsoncPath = (0, import_node_path55.join)(jsonDir, "opencode.jsonc");
|
|
7195
|
+
const jsonPath = (0, import_node_path55.join)(jsonDir, "opencode.json");
|
|
7042
7196
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
7043
7197
|
if (!fileContent) {
|
|
7044
7198
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -7064,11 +7218,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
7064
7218
|
global = false
|
|
7065
7219
|
}) {
|
|
7066
7220
|
const basePaths = this.getSettablePaths({ global });
|
|
7067
|
-
const jsonDir = (0,
|
|
7221
|
+
const jsonDir = (0, import_node_path55.join)(baseDir, basePaths.relativeDirPath);
|
|
7068
7222
|
let fileContent = null;
|
|
7069
7223
|
let relativeFilePath = "opencode.jsonc";
|
|
7070
|
-
const jsoncPath = (0,
|
|
7071
|
-
const jsonPath = (0,
|
|
7224
|
+
const jsoncPath = (0, import_node_path55.join)(jsonDir, "opencode.jsonc");
|
|
7225
|
+
const jsonPath = (0, import_node_path55.join)(jsonDir, "opencode.json");
|
|
7072
7226
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
7073
7227
|
if (!fileContent) {
|
|
7074
7228
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -7129,7 +7283,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
7129
7283
|
};
|
|
7130
7284
|
|
|
7131
7285
|
// src/features/mcp/roo-mcp.ts
|
|
7132
|
-
var
|
|
7286
|
+
var import_node_path56 = require("path");
|
|
7133
7287
|
function isRooMcpServers(value) {
|
|
7134
7288
|
return value !== void 0 && value !== null && typeof value === "object";
|
|
7135
7289
|
}
|
|
@@ -7181,7 +7335,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
7181
7335
|
validate = true
|
|
7182
7336
|
}) {
|
|
7183
7337
|
const fileContent = await readFileContent(
|
|
7184
|
-
(0,
|
|
7338
|
+
(0, import_node_path56.join)(
|
|
7185
7339
|
baseDir,
|
|
7186
7340
|
this.getSettablePaths().relativeDirPath,
|
|
7187
7341
|
this.getSettablePaths().relativeFilePath
|
|
@@ -7252,7 +7406,7 @@ var mcpProcessorToolTargetTuple = [
|
|
|
7252
7406
|
"opencode",
|
|
7253
7407
|
"roo"
|
|
7254
7408
|
];
|
|
7255
|
-
var McpProcessorToolTargetSchema =
|
|
7409
|
+
var McpProcessorToolTargetSchema = import_mini23.z.enum(mcpProcessorToolTargetTuple);
|
|
7256
7410
|
var toolMcpFactories = /* @__PURE__ */ new Map([
|
|
7257
7411
|
[
|
|
7258
7412
|
"claudecode",
|
|
@@ -7554,25 +7708,25 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
7554
7708
|
};
|
|
7555
7709
|
|
|
7556
7710
|
// src/features/rules/rules-processor.ts
|
|
7557
|
-
var
|
|
7711
|
+
var import_node_path118 = require("path");
|
|
7558
7712
|
var import_toon = require("@toon-format/toon");
|
|
7559
|
-
var
|
|
7713
|
+
var import_mini57 = require("zod/mini");
|
|
7560
7714
|
|
|
7561
7715
|
// src/constants/general.ts
|
|
7562
7716
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
7563
7717
|
|
|
7564
7718
|
// src/features/skills/agentsmd-skill.ts
|
|
7565
|
-
var
|
|
7719
|
+
var import_node_path60 = require("path");
|
|
7566
7720
|
|
|
7567
7721
|
// src/features/skills/simulated-skill.ts
|
|
7568
|
-
var
|
|
7569
|
-
var
|
|
7722
|
+
var import_node_path59 = require("path");
|
|
7723
|
+
var import_mini24 = require("zod/mini");
|
|
7570
7724
|
|
|
7571
7725
|
// src/features/skills/tool-skill.ts
|
|
7572
|
-
var
|
|
7726
|
+
var import_node_path58 = require("path");
|
|
7573
7727
|
|
|
7574
7728
|
// src/types/ai-dir.ts
|
|
7575
|
-
var
|
|
7729
|
+
var import_node_path57 = __toESM(require("path"), 1);
|
|
7576
7730
|
var AiDir = class {
|
|
7577
7731
|
/**
|
|
7578
7732
|
* @example "."
|
|
@@ -7606,7 +7760,7 @@ var AiDir = class {
|
|
|
7606
7760
|
otherFiles = [],
|
|
7607
7761
|
global = false
|
|
7608
7762
|
}) {
|
|
7609
|
-
if (dirName.includes(
|
|
7763
|
+
if (dirName.includes(import_node_path57.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
|
|
7610
7764
|
throw new Error(`Directory name cannot contain path separators: dirName="${dirName}"`);
|
|
7611
7765
|
}
|
|
7612
7766
|
this.baseDir = baseDir;
|
|
@@ -7629,11 +7783,11 @@ var AiDir = class {
|
|
|
7629
7783
|
return this.dirName;
|
|
7630
7784
|
}
|
|
7631
7785
|
getDirPath() {
|
|
7632
|
-
const fullPath =
|
|
7633
|
-
const resolvedFull = (0,
|
|
7634
|
-
const resolvedBase = (0,
|
|
7635
|
-
const rel = (0,
|
|
7636
|
-
if (rel.startsWith("..") ||
|
|
7786
|
+
const fullPath = import_node_path57.default.join(this.baseDir, this.relativeDirPath, this.dirName);
|
|
7787
|
+
const resolvedFull = (0, import_node_path57.resolve)(fullPath);
|
|
7788
|
+
const resolvedBase = (0, import_node_path57.resolve)(this.baseDir);
|
|
7789
|
+
const rel = (0, import_node_path57.relative)(resolvedBase, resolvedFull);
|
|
7790
|
+
if (rel.startsWith("..") || import_node_path57.default.isAbsolute(rel)) {
|
|
7637
7791
|
throw new Error(
|
|
7638
7792
|
`Path traversal detected: Final path escapes baseDir. baseDir="${this.baseDir}", relativeDirPath="${this.relativeDirPath}", dirName="${this.dirName}"`
|
|
7639
7793
|
);
|
|
@@ -7647,7 +7801,7 @@ var AiDir = class {
|
|
|
7647
7801
|
return this.otherFiles;
|
|
7648
7802
|
}
|
|
7649
7803
|
getRelativePathFromCwd() {
|
|
7650
|
-
return
|
|
7804
|
+
return import_node_path57.default.join(this.relativeDirPath, this.dirName);
|
|
7651
7805
|
}
|
|
7652
7806
|
getGlobal() {
|
|
7653
7807
|
return this.global;
|
|
@@ -7666,15 +7820,15 @@ var AiDir = class {
|
|
|
7666
7820
|
* @returns Array of files with their relative paths and buffers
|
|
7667
7821
|
*/
|
|
7668
7822
|
static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
|
|
7669
|
-
const dirPath = (0,
|
|
7670
|
-
const glob = (0,
|
|
7823
|
+
const dirPath = (0, import_node_path57.join)(baseDir, relativeDirPath, dirName);
|
|
7824
|
+
const glob = (0, import_node_path57.join)(dirPath, "**", "*");
|
|
7671
7825
|
const filePaths = await findFilesByGlobs(glob, { type: "file" });
|
|
7672
|
-
const filteredPaths = filePaths.filter((filePath) => (0,
|
|
7826
|
+
const filteredPaths = filePaths.filter((filePath) => (0, import_node_path57.basename)(filePath) !== excludeFileName);
|
|
7673
7827
|
const files = await Promise.all(
|
|
7674
7828
|
filteredPaths.map(async (filePath) => {
|
|
7675
7829
|
const fileBuffer = await readFileBuffer(filePath);
|
|
7676
7830
|
return {
|
|
7677
|
-
relativeFilePathToDirPath: (0,
|
|
7831
|
+
relativeFilePathToDirPath: (0, import_node_path57.relative)(dirPath, filePath),
|
|
7678
7832
|
fileBuffer
|
|
7679
7833
|
};
|
|
7680
7834
|
})
|
|
@@ -7765,8 +7919,8 @@ var ToolSkill = class extends AiDir {
|
|
|
7765
7919
|
}) {
|
|
7766
7920
|
const settablePaths = getSettablePaths({ global });
|
|
7767
7921
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
7768
|
-
const skillDirPath = (0,
|
|
7769
|
-
const skillFilePath = (0,
|
|
7922
|
+
const skillDirPath = (0, import_node_path58.join)(baseDir, actualRelativeDirPath, dirName);
|
|
7923
|
+
const skillFilePath = (0, import_node_path58.join)(skillDirPath, SKILL_FILE_NAME);
|
|
7770
7924
|
if (!await fileExists(skillFilePath)) {
|
|
7771
7925
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
7772
7926
|
}
|
|
@@ -7790,16 +7944,16 @@ var ToolSkill = class extends AiDir {
|
|
|
7790
7944
|
}
|
|
7791
7945
|
requireMainFileFrontmatter() {
|
|
7792
7946
|
if (!this.mainFile?.frontmatter) {
|
|
7793
|
-
throw new Error(`Frontmatter is not defined in ${(0,
|
|
7947
|
+
throw new Error(`Frontmatter is not defined in ${(0, import_node_path58.join)(this.relativeDirPath, this.dirName)}`);
|
|
7794
7948
|
}
|
|
7795
7949
|
return this.mainFile.frontmatter;
|
|
7796
7950
|
}
|
|
7797
7951
|
};
|
|
7798
7952
|
|
|
7799
7953
|
// src/features/skills/simulated-skill.ts
|
|
7800
|
-
var SimulatedSkillFrontmatterSchema =
|
|
7801
|
-
name:
|
|
7802
|
-
description:
|
|
7954
|
+
var SimulatedSkillFrontmatterSchema = import_mini24.z.looseObject({
|
|
7955
|
+
name: import_mini24.z.string(),
|
|
7956
|
+
description: import_mini24.z.string()
|
|
7803
7957
|
});
|
|
7804
7958
|
var SimulatedSkill = class extends ToolSkill {
|
|
7805
7959
|
frontmatter;
|
|
@@ -7830,7 +7984,7 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
7830
7984
|
const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
|
|
7831
7985
|
if (!result.success) {
|
|
7832
7986
|
throw new Error(
|
|
7833
|
-
`Invalid frontmatter in ${(0,
|
|
7987
|
+
`Invalid frontmatter in ${(0, import_node_path59.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
|
|
7834
7988
|
);
|
|
7835
7989
|
}
|
|
7836
7990
|
}
|
|
@@ -7889,8 +8043,8 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
7889
8043
|
}) {
|
|
7890
8044
|
const settablePaths = this.getSettablePaths();
|
|
7891
8045
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
7892
|
-
const skillDirPath = (0,
|
|
7893
|
-
const skillFilePath = (0,
|
|
8046
|
+
const skillDirPath = (0, import_node_path59.join)(baseDir, actualRelativeDirPath, dirName);
|
|
8047
|
+
const skillFilePath = (0, import_node_path59.join)(skillDirPath, SKILL_FILE_NAME);
|
|
7894
8048
|
if (!await fileExists(skillFilePath)) {
|
|
7895
8049
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
7896
8050
|
}
|
|
@@ -7967,7 +8121,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
7967
8121
|
throw new Error("AgentsmdSkill does not support global mode.");
|
|
7968
8122
|
}
|
|
7969
8123
|
return {
|
|
7970
|
-
relativeDirPath: (0,
|
|
8124
|
+
relativeDirPath: (0, import_node_path60.join)(".agents", "skills")
|
|
7971
8125
|
};
|
|
7972
8126
|
}
|
|
7973
8127
|
static async fromDir(params) {
|
|
@@ -7994,11 +8148,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
7994
8148
|
};
|
|
7995
8149
|
|
|
7996
8150
|
// src/features/skills/factorydroid-skill.ts
|
|
7997
|
-
var
|
|
8151
|
+
var import_node_path61 = require("path");
|
|
7998
8152
|
var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
7999
8153
|
static getSettablePaths(_options) {
|
|
8000
8154
|
return {
|
|
8001
|
-
relativeDirPath: (0,
|
|
8155
|
+
relativeDirPath: (0, import_node_path61.join)(".factory", "skills")
|
|
8002
8156
|
};
|
|
8003
8157
|
}
|
|
8004
8158
|
static async fromDir(params) {
|
|
@@ -8025,11 +8179,11 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
|
8025
8179
|
};
|
|
8026
8180
|
|
|
8027
8181
|
// src/features/skills/skills-processor.ts
|
|
8028
|
-
var
|
|
8029
|
-
var
|
|
8182
|
+
var import_node_path79 = require("path");
|
|
8183
|
+
var import_mini40 = require("zod/mini");
|
|
8030
8184
|
|
|
8031
8185
|
// src/types/dir-feature-processor.ts
|
|
8032
|
-
var
|
|
8186
|
+
var import_node_path62 = require("path");
|
|
8033
8187
|
var DirFeatureProcessor = class {
|
|
8034
8188
|
baseDir;
|
|
8035
8189
|
dryRun;
|
|
@@ -8066,7 +8220,7 @@ var DirFeatureProcessor = class {
|
|
|
8066
8220
|
const mainFile = aiDir.getMainFile();
|
|
8067
8221
|
let mainFileContent;
|
|
8068
8222
|
if (mainFile) {
|
|
8069
|
-
const mainFilePath = (0,
|
|
8223
|
+
const mainFilePath = (0, import_node_path62.join)(dirPath, mainFile.name);
|
|
8070
8224
|
const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter, {
|
|
8071
8225
|
avoidBlockScalars: this.avoidBlockScalars
|
|
8072
8226
|
});
|
|
@@ -8082,7 +8236,7 @@ var DirFeatureProcessor = class {
|
|
|
8082
8236
|
const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
|
|
8083
8237
|
otherFileContents.push(contentWithNewline);
|
|
8084
8238
|
if (!dirHasChanges) {
|
|
8085
|
-
const filePath = (0,
|
|
8239
|
+
const filePath = (0, import_node_path62.join)(dirPath, file.relativeFilePathToDirPath);
|
|
8086
8240
|
const existingContent = await readFileContentOrNull(filePath);
|
|
8087
8241
|
if (existingContent !== contentWithNewline) {
|
|
8088
8242
|
dirHasChanges = true;
|
|
@@ -8096,22 +8250,22 @@ var DirFeatureProcessor = class {
|
|
|
8096
8250
|
if (this.dryRun) {
|
|
8097
8251
|
logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
|
|
8098
8252
|
if (mainFile) {
|
|
8099
|
-
logger.info(`[DRY RUN] Would write: ${(0,
|
|
8100
|
-
changedPaths.push((0,
|
|
8253
|
+
logger.info(`[DRY RUN] Would write: ${(0, import_node_path62.join)(dirPath, mainFile.name)}`);
|
|
8254
|
+
changedPaths.push((0, import_node_path62.join)(relativeDir, mainFile.name));
|
|
8101
8255
|
}
|
|
8102
8256
|
for (const file of otherFiles) {
|
|
8103
|
-
logger.info(`[DRY RUN] Would write: ${(0,
|
|
8104
|
-
changedPaths.push((0,
|
|
8257
|
+
logger.info(`[DRY RUN] Would write: ${(0, import_node_path62.join)(dirPath, file.relativeFilePathToDirPath)}`);
|
|
8258
|
+
changedPaths.push((0, import_node_path62.join)(relativeDir, file.relativeFilePathToDirPath));
|
|
8105
8259
|
}
|
|
8106
8260
|
} else {
|
|
8107
8261
|
await ensureDir(dirPath);
|
|
8108
8262
|
if (mainFile && mainFileContent) {
|
|
8109
|
-
const mainFilePath = (0,
|
|
8263
|
+
const mainFilePath = (0, import_node_path62.join)(dirPath, mainFile.name);
|
|
8110
8264
|
await writeFileContent(mainFilePath, mainFileContent);
|
|
8111
|
-
changedPaths.push((0,
|
|
8265
|
+
changedPaths.push((0, import_node_path62.join)(relativeDir, mainFile.name));
|
|
8112
8266
|
}
|
|
8113
8267
|
for (const [i, file] of otherFiles.entries()) {
|
|
8114
|
-
const filePath = (0,
|
|
8268
|
+
const filePath = (0, import_node_path62.join)(dirPath, file.relativeFilePathToDirPath);
|
|
8115
8269
|
const content = otherFileContents[i];
|
|
8116
8270
|
if (content === void 0) {
|
|
8117
8271
|
throw new Error(
|
|
@@ -8119,7 +8273,7 @@ var DirFeatureProcessor = class {
|
|
|
8119
8273
|
);
|
|
8120
8274
|
}
|
|
8121
8275
|
await writeFileContent(filePath, content);
|
|
8122
|
-
changedPaths.push((0,
|
|
8276
|
+
changedPaths.push((0, import_node_path62.join)(relativeDir, file.relativeFilePathToDirPath));
|
|
8123
8277
|
}
|
|
8124
8278
|
}
|
|
8125
8279
|
changedCount++;
|
|
@@ -8151,40 +8305,40 @@ var DirFeatureProcessor = class {
|
|
|
8151
8305
|
};
|
|
8152
8306
|
|
|
8153
8307
|
// src/features/skills/agentsskills-skill.ts
|
|
8154
|
-
var
|
|
8155
|
-
var
|
|
8308
|
+
var import_node_path64 = require("path");
|
|
8309
|
+
var import_mini26 = require("zod/mini");
|
|
8156
8310
|
|
|
8157
8311
|
// src/features/skills/rulesync-skill.ts
|
|
8158
|
-
var
|
|
8159
|
-
var
|
|
8160
|
-
var RulesyncSkillFrontmatterSchemaInternal =
|
|
8161
|
-
name:
|
|
8162
|
-
description:
|
|
8163
|
-
targets:
|
|
8164
|
-
claudecode:
|
|
8165
|
-
|
|
8166
|
-
"allowed-tools":
|
|
8167
|
-
model:
|
|
8168
|
-
"disable-model-invocation":
|
|
8312
|
+
var import_node_path63 = require("path");
|
|
8313
|
+
var import_mini25 = require("zod/mini");
|
|
8314
|
+
var RulesyncSkillFrontmatterSchemaInternal = import_mini25.z.looseObject({
|
|
8315
|
+
name: import_mini25.z.string(),
|
|
8316
|
+
description: import_mini25.z.string(),
|
|
8317
|
+
targets: import_mini25.z._default(RulesyncTargetsSchema, ["*"]),
|
|
8318
|
+
claudecode: import_mini25.z.optional(
|
|
8319
|
+
import_mini25.z.looseObject({
|
|
8320
|
+
"allowed-tools": import_mini25.z.optional(import_mini25.z.array(import_mini25.z.string())),
|
|
8321
|
+
model: import_mini25.z.optional(import_mini25.z.string()),
|
|
8322
|
+
"disable-model-invocation": import_mini25.z.optional(import_mini25.z.boolean())
|
|
8169
8323
|
})
|
|
8170
8324
|
),
|
|
8171
|
-
codexcli:
|
|
8172
|
-
|
|
8173
|
-
"short-description":
|
|
8325
|
+
codexcli: import_mini25.z.optional(
|
|
8326
|
+
import_mini25.z.looseObject({
|
|
8327
|
+
"short-description": import_mini25.z.optional(import_mini25.z.string())
|
|
8174
8328
|
})
|
|
8175
8329
|
),
|
|
8176
|
-
opencode:
|
|
8177
|
-
|
|
8178
|
-
"allowed-tools":
|
|
8330
|
+
opencode: import_mini25.z.optional(
|
|
8331
|
+
import_mini25.z.looseObject({
|
|
8332
|
+
"allowed-tools": import_mini25.z.optional(import_mini25.z.array(import_mini25.z.string()))
|
|
8179
8333
|
})
|
|
8180
8334
|
),
|
|
8181
|
-
copilot:
|
|
8182
|
-
|
|
8183
|
-
license:
|
|
8335
|
+
copilot: import_mini25.z.optional(
|
|
8336
|
+
import_mini25.z.looseObject({
|
|
8337
|
+
license: import_mini25.z.optional(import_mini25.z.string())
|
|
8184
8338
|
})
|
|
8185
8339
|
),
|
|
8186
|
-
cline:
|
|
8187
|
-
roo:
|
|
8340
|
+
cline: import_mini25.z.optional(import_mini25.z.looseObject({})),
|
|
8341
|
+
roo: import_mini25.z.optional(import_mini25.z.looseObject({}))
|
|
8188
8342
|
});
|
|
8189
8343
|
var RulesyncSkillFrontmatterSchema = RulesyncSkillFrontmatterSchemaInternal;
|
|
8190
8344
|
var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
@@ -8224,7 +8378,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
8224
8378
|
}
|
|
8225
8379
|
getFrontmatter() {
|
|
8226
8380
|
if (!this.mainFile?.frontmatter) {
|
|
8227
|
-
throw new Error(`Frontmatter is not defined in ${(0,
|
|
8381
|
+
throw new Error(`Frontmatter is not defined in ${(0, import_node_path63.join)(this.relativeDirPath, this.dirName)}`);
|
|
8228
8382
|
}
|
|
8229
8383
|
const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
|
|
8230
8384
|
return result;
|
|
@@ -8250,8 +8404,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
8250
8404
|
dirName,
|
|
8251
8405
|
global = false
|
|
8252
8406
|
}) {
|
|
8253
|
-
const skillDirPath = (0,
|
|
8254
|
-
const skillFilePath = (0,
|
|
8407
|
+
const skillDirPath = (0, import_node_path63.join)(baseDir, relativeDirPath, dirName);
|
|
8408
|
+
const skillFilePath = (0, import_node_path63.join)(skillDirPath, SKILL_FILE_NAME);
|
|
8255
8409
|
if (!await fileExists(skillFilePath)) {
|
|
8256
8410
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
8257
8411
|
}
|
|
@@ -8281,14 +8435,14 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
8281
8435
|
};
|
|
8282
8436
|
|
|
8283
8437
|
// src/features/skills/agentsskills-skill.ts
|
|
8284
|
-
var AgentsSkillsSkillFrontmatterSchema =
|
|
8285
|
-
name:
|
|
8286
|
-
description:
|
|
8438
|
+
var AgentsSkillsSkillFrontmatterSchema = import_mini26.z.looseObject({
|
|
8439
|
+
name: import_mini26.z.string(),
|
|
8440
|
+
description: import_mini26.z.string()
|
|
8287
8441
|
});
|
|
8288
8442
|
var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
8289
8443
|
constructor({
|
|
8290
8444
|
baseDir = process.cwd(),
|
|
8291
|
-
relativeDirPath = (0,
|
|
8445
|
+
relativeDirPath = (0, import_node_path64.join)(".agents", "skills"),
|
|
8292
8446
|
dirName,
|
|
8293
8447
|
frontmatter,
|
|
8294
8448
|
body,
|
|
@@ -8320,7 +8474,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
8320
8474
|
throw new Error("AgentsSkillsSkill does not support global mode.");
|
|
8321
8475
|
}
|
|
8322
8476
|
return {
|
|
8323
|
-
relativeDirPath: (0,
|
|
8477
|
+
relativeDirPath: (0, import_node_path64.join)(".agents", "skills")
|
|
8324
8478
|
};
|
|
8325
8479
|
}
|
|
8326
8480
|
getFrontmatter() {
|
|
@@ -8400,9 +8554,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
8400
8554
|
});
|
|
8401
8555
|
const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8402
8556
|
if (!result.success) {
|
|
8403
|
-
const skillDirPath = (0,
|
|
8557
|
+
const skillDirPath = (0, import_node_path64.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8404
8558
|
throw new Error(
|
|
8405
|
-
`Invalid frontmatter in ${(0,
|
|
8559
|
+
`Invalid frontmatter in ${(0, import_node_path64.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8406
8560
|
);
|
|
8407
8561
|
}
|
|
8408
8562
|
return new _AgentsSkillsSkill({
|
|
@@ -8437,16 +8591,16 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
8437
8591
|
};
|
|
8438
8592
|
|
|
8439
8593
|
// src/features/skills/antigravity-skill.ts
|
|
8440
|
-
var
|
|
8441
|
-
var
|
|
8442
|
-
var AntigravitySkillFrontmatterSchema =
|
|
8443
|
-
name:
|
|
8444
|
-
description:
|
|
8594
|
+
var import_node_path65 = require("path");
|
|
8595
|
+
var import_mini27 = require("zod/mini");
|
|
8596
|
+
var AntigravitySkillFrontmatterSchema = import_mini27.z.looseObject({
|
|
8597
|
+
name: import_mini27.z.string(),
|
|
8598
|
+
description: import_mini27.z.string()
|
|
8445
8599
|
});
|
|
8446
8600
|
var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
8447
8601
|
constructor({
|
|
8448
8602
|
baseDir = process.cwd(),
|
|
8449
|
-
relativeDirPath = (0,
|
|
8603
|
+
relativeDirPath = (0, import_node_path65.join)(".agent", "skills"),
|
|
8450
8604
|
dirName,
|
|
8451
8605
|
frontmatter,
|
|
8452
8606
|
body,
|
|
@@ -8478,11 +8632,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
8478
8632
|
} = {}) {
|
|
8479
8633
|
if (global) {
|
|
8480
8634
|
return {
|
|
8481
|
-
relativeDirPath: (0,
|
|
8635
|
+
relativeDirPath: (0, import_node_path65.join)(".gemini", "antigravity", "skills")
|
|
8482
8636
|
};
|
|
8483
8637
|
}
|
|
8484
8638
|
return {
|
|
8485
|
-
relativeDirPath: (0,
|
|
8639
|
+
relativeDirPath: (0, import_node_path65.join)(".agent", "skills")
|
|
8486
8640
|
};
|
|
8487
8641
|
}
|
|
8488
8642
|
getFrontmatter() {
|
|
@@ -8562,9 +8716,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
8562
8716
|
});
|
|
8563
8717
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8564
8718
|
if (!result.success) {
|
|
8565
|
-
const skillDirPath = (0,
|
|
8719
|
+
const skillDirPath = (0, import_node_path65.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8566
8720
|
throw new Error(
|
|
8567
|
-
`Invalid frontmatter in ${(0,
|
|
8721
|
+
`Invalid frontmatter in ${(0, import_node_path65.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8568
8722
|
);
|
|
8569
8723
|
}
|
|
8570
8724
|
return new _AntigravitySkill({
|
|
@@ -8598,19 +8752,19 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
8598
8752
|
};
|
|
8599
8753
|
|
|
8600
8754
|
// src/features/skills/claudecode-skill.ts
|
|
8601
|
-
var
|
|
8602
|
-
var
|
|
8603
|
-
var ClaudecodeSkillFrontmatterSchema =
|
|
8604
|
-
name:
|
|
8605
|
-
description:
|
|
8606
|
-
"allowed-tools":
|
|
8607
|
-
model:
|
|
8608
|
-
"disable-model-invocation":
|
|
8755
|
+
var import_node_path66 = require("path");
|
|
8756
|
+
var import_mini28 = require("zod/mini");
|
|
8757
|
+
var ClaudecodeSkillFrontmatterSchema = import_mini28.z.looseObject({
|
|
8758
|
+
name: import_mini28.z.string(),
|
|
8759
|
+
description: import_mini28.z.string(),
|
|
8760
|
+
"allowed-tools": import_mini28.z.optional(import_mini28.z.array(import_mini28.z.string())),
|
|
8761
|
+
model: import_mini28.z.optional(import_mini28.z.string()),
|
|
8762
|
+
"disable-model-invocation": import_mini28.z.optional(import_mini28.z.boolean())
|
|
8609
8763
|
});
|
|
8610
8764
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
8611
8765
|
constructor({
|
|
8612
8766
|
baseDir = process.cwd(),
|
|
8613
|
-
relativeDirPath = (0,
|
|
8767
|
+
relativeDirPath = (0, import_node_path66.join)(".claude", "skills"),
|
|
8614
8768
|
dirName,
|
|
8615
8769
|
frontmatter,
|
|
8616
8770
|
body,
|
|
@@ -8641,7 +8795,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
8641
8795
|
global: _global = false
|
|
8642
8796
|
} = {}) {
|
|
8643
8797
|
return {
|
|
8644
|
-
relativeDirPath: (0,
|
|
8798
|
+
relativeDirPath: (0, import_node_path66.join)(".claude", "skills")
|
|
8645
8799
|
};
|
|
8646
8800
|
}
|
|
8647
8801
|
getFrontmatter() {
|
|
@@ -8738,9 +8892,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
8738
8892
|
});
|
|
8739
8893
|
const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8740
8894
|
if (!result.success) {
|
|
8741
|
-
const skillDirPath = (0,
|
|
8895
|
+
const skillDirPath = (0, import_node_path66.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8742
8896
|
throw new Error(
|
|
8743
|
-
`Invalid frontmatter in ${(0,
|
|
8897
|
+
`Invalid frontmatter in ${(0, import_node_path66.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8744
8898
|
);
|
|
8745
8899
|
}
|
|
8746
8900
|
return new _ClaudecodeSkill({
|
|
@@ -8774,16 +8928,16 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
8774
8928
|
};
|
|
8775
8929
|
|
|
8776
8930
|
// src/features/skills/cline-skill.ts
|
|
8777
|
-
var
|
|
8778
|
-
var
|
|
8779
|
-
var ClineSkillFrontmatterSchema =
|
|
8780
|
-
name:
|
|
8781
|
-
description:
|
|
8931
|
+
var import_node_path67 = require("path");
|
|
8932
|
+
var import_mini29 = require("zod/mini");
|
|
8933
|
+
var ClineSkillFrontmatterSchema = import_mini29.z.looseObject({
|
|
8934
|
+
name: import_mini29.z.string(),
|
|
8935
|
+
description: import_mini29.z.string()
|
|
8782
8936
|
});
|
|
8783
8937
|
var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
8784
8938
|
constructor({
|
|
8785
8939
|
baseDir = process.cwd(),
|
|
8786
|
-
relativeDirPath = (0,
|
|
8940
|
+
relativeDirPath = (0, import_node_path67.join)(".cline", "skills"),
|
|
8787
8941
|
dirName,
|
|
8788
8942
|
frontmatter,
|
|
8789
8943
|
body,
|
|
@@ -8812,7 +8966,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
8812
8966
|
}
|
|
8813
8967
|
static getSettablePaths(_options = {}) {
|
|
8814
8968
|
return {
|
|
8815
|
-
relativeDirPath: (0,
|
|
8969
|
+
relativeDirPath: (0, import_node_path67.join)(".cline", "skills")
|
|
8816
8970
|
};
|
|
8817
8971
|
}
|
|
8818
8972
|
getFrontmatter() {
|
|
@@ -8900,13 +9054,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
8900
9054
|
});
|
|
8901
9055
|
const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8902
9056
|
if (!result.success) {
|
|
8903
|
-
const skillDirPath = (0,
|
|
9057
|
+
const skillDirPath = (0, import_node_path67.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8904
9058
|
throw new Error(
|
|
8905
|
-
`Invalid frontmatter in ${(0,
|
|
9059
|
+
`Invalid frontmatter in ${(0, import_node_path67.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8906
9060
|
);
|
|
8907
9061
|
}
|
|
8908
9062
|
if (result.data.name !== loaded.dirName) {
|
|
8909
|
-
const skillFilePath = (0,
|
|
9063
|
+
const skillFilePath = (0, import_node_path67.join)(
|
|
8910
9064
|
loaded.baseDir,
|
|
8911
9065
|
loaded.relativeDirPath,
|
|
8912
9066
|
loaded.dirName,
|
|
@@ -8947,21 +9101,21 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
8947
9101
|
};
|
|
8948
9102
|
|
|
8949
9103
|
// src/features/skills/codexcli-skill.ts
|
|
8950
|
-
var
|
|
8951
|
-
var
|
|
8952
|
-
var CodexCliSkillFrontmatterSchema =
|
|
8953
|
-
name:
|
|
8954
|
-
description:
|
|
8955
|
-
metadata:
|
|
8956
|
-
|
|
8957
|
-
"short-description":
|
|
9104
|
+
var import_node_path68 = require("path");
|
|
9105
|
+
var import_mini30 = require("zod/mini");
|
|
9106
|
+
var CodexCliSkillFrontmatterSchema = import_mini30.z.looseObject({
|
|
9107
|
+
name: import_mini30.z.string(),
|
|
9108
|
+
description: import_mini30.z.string(),
|
|
9109
|
+
metadata: import_mini30.z.optional(
|
|
9110
|
+
import_mini30.z.looseObject({
|
|
9111
|
+
"short-description": import_mini30.z.optional(import_mini30.z.string())
|
|
8958
9112
|
})
|
|
8959
9113
|
)
|
|
8960
9114
|
});
|
|
8961
9115
|
var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
8962
9116
|
constructor({
|
|
8963
9117
|
baseDir = process.cwd(),
|
|
8964
|
-
relativeDirPath = (0,
|
|
9118
|
+
relativeDirPath = (0, import_node_path68.join)(".codex", "skills"),
|
|
8965
9119
|
dirName,
|
|
8966
9120
|
frontmatter,
|
|
8967
9121
|
body,
|
|
@@ -8992,7 +9146,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
8992
9146
|
global: _global = false
|
|
8993
9147
|
} = {}) {
|
|
8994
9148
|
return {
|
|
8995
|
-
relativeDirPath: (0,
|
|
9149
|
+
relativeDirPath: (0, import_node_path68.join)(".codex", "skills")
|
|
8996
9150
|
};
|
|
8997
9151
|
}
|
|
8998
9152
|
getFrontmatter() {
|
|
@@ -9082,9 +9236,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
9082
9236
|
});
|
|
9083
9237
|
const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9084
9238
|
if (!result.success) {
|
|
9085
|
-
const skillDirPath = (0,
|
|
9239
|
+
const skillDirPath = (0, import_node_path68.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9086
9240
|
throw new Error(
|
|
9087
|
-
`Invalid frontmatter in ${(0,
|
|
9241
|
+
`Invalid frontmatter in ${(0, import_node_path68.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9088
9242
|
);
|
|
9089
9243
|
}
|
|
9090
9244
|
return new _CodexCliSkill({
|
|
@@ -9118,17 +9272,17 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
9118
9272
|
};
|
|
9119
9273
|
|
|
9120
9274
|
// src/features/skills/copilot-skill.ts
|
|
9121
|
-
var
|
|
9122
|
-
var
|
|
9123
|
-
var CopilotSkillFrontmatterSchema =
|
|
9124
|
-
name:
|
|
9125
|
-
description:
|
|
9126
|
-
license:
|
|
9275
|
+
var import_node_path69 = require("path");
|
|
9276
|
+
var import_mini31 = require("zod/mini");
|
|
9277
|
+
var CopilotSkillFrontmatterSchema = import_mini31.z.looseObject({
|
|
9278
|
+
name: import_mini31.z.string(),
|
|
9279
|
+
description: import_mini31.z.string(),
|
|
9280
|
+
license: import_mini31.z.optional(import_mini31.z.string())
|
|
9127
9281
|
});
|
|
9128
9282
|
var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
9129
9283
|
constructor({
|
|
9130
9284
|
baseDir = process.cwd(),
|
|
9131
|
-
relativeDirPath = (0,
|
|
9285
|
+
relativeDirPath = (0, import_node_path69.join)(".github", "skills"),
|
|
9132
9286
|
dirName,
|
|
9133
9287
|
frontmatter,
|
|
9134
9288
|
body,
|
|
@@ -9160,7 +9314,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
9160
9314
|
throw new Error("CopilotSkill does not support global mode.");
|
|
9161
9315
|
}
|
|
9162
9316
|
return {
|
|
9163
|
-
relativeDirPath: (0,
|
|
9317
|
+
relativeDirPath: (0, import_node_path69.join)(".github", "skills")
|
|
9164
9318
|
};
|
|
9165
9319
|
}
|
|
9166
9320
|
getFrontmatter() {
|
|
@@ -9246,9 +9400,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
9246
9400
|
});
|
|
9247
9401
|
const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9248
9402
|
if (!result.success) {
|
|
9249
|
-
const skillDirPath = (0,
|
|
9403
|
+
const skillDirPath = (0, import_node_path69.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9250
9404
|
throw new Error(
|
|
9251
|
-
`Invalid frontmatter in ${(0,
|
|
9405
|
+
`Invalid frontmatter in ${(0, import_node_path69.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9252
9406
|
);
|
|
9253
9407
|
}
|
|
9254
9408
|
return new _CopilotSkill({
|
|
@@ -9283,16 +9437,16 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
9283
9437
|
};
|
|
9284
9438
|
|
|
9285
9439
|
// src/features/skills/cursor-skill.ts
|
|
9286
|
-
var
|
|
9287
|
-
var
|
|
9288
|
-
var CursorSkillFrontmatterSchema =
|
|
9289
|
-
name:
|
|
9290
|
-
description:
|
|
9440
|
+
var import_node_path70 = require("path");
|
|
9441
|
+
var import_mini32 = require("zod/mini");
|
|
9442
|
+
var CursorSkillFrontmatterSchema = import_mini32.z.looseObject({
|
|
9443
|
+
name: import_mini32.z.string(),
|
|
9444
|
+
description: import_mini32.z.string()
|
|
9291
9445
|
});
|
|
9292
9446
|
var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
9293
9447
|
constructor({
|
|
9294
9448
|
baseDir = process.cwd(),
|
|
9295
|
-
relativeDirPath = (0,
|
|
9449
|
+
relativeDirPath = (0, import_node_path70.join)(".cursor", "skills"),
|
|
9296
9450
|
dirName,
|
|
9297
9451
|
frontmatter,
|
|
9298
9452
|
body,
|
|
@@ -9321,7 +9475,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
9321
9475
|
}
|
|
9322
9476
|
static getSettablePaths(_options) {
|
|
9323
9477
|
return {
|
|
9324
|
-
relativeDirPath: (0,
|
|
9478
|
+
relativeDirPath: (0, import_node_path70.join)(".cursor", "skills")
|
|
9325
9479
|
};
|
|
9326
9480
|
}
|
|
9327
9481
|
getFrontmatter() {
|
|
@@ -9401,9 +9555,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
9401
9555
|
});
|
|
9402
9556
|
const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9403
9557
|
if (!result.success) {
|
|
9404
|
-
const skillDirPath = (0,
|
|
9558
|
+
const skillDirPath = (0, import_node_path70.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9405
9559
|
throw new Error(
|
|
9406
|
-
`Invalid frontmatter in ${(0,
|
|
9560
|
+
`Invalid frontmatter in ${(0, import_node_path70.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9407
9561
|
);
|
|
9408
9562
|
}
|
|
9409
9563
|
return new _CursorSkill({
|
|
@@ -9436,13 +9590,13 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
9436
9590
|
});
|
|
9437
9591
|
}
|
|
9438
9592
|
};
|
|
9439
|
-
|
|
9440
|
-
// src/features/skills/geminicli-skill.ts
|
|
9441
|
-
var
|
|
9442
|
-
var
|
|
9443
|
-
var GeminiCliSkillFrontmatterSchema =
|
|
9444
|
-
name:
|
|
9445
|
-
description:
|
|
9593
|
+
|
|
9594
|
+
// src/features/skills/geminicli-skill.ts
|
|
9595
|
+
var import_node_path71 = require("path");
|
|
9596
|
+
var import_mini33 = require("zod/mini");
|
|
9597
|
+
var GeminiCliSkillFrontmatterSchema = import_mini33.z.looseObject({
|
|
9598
|
+
name: import_mini33.z.string(),
|
|
9599
|
+
description: import_mini33.z.string()
|
|
9446
9600
|
});
|
|
9447
9601
|
var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
9448
9602
|
constructor({
|
|
@@ -9478,7 +9632,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
9478
9632
|
global: _global = false
|
|
9479
9633
|
} = {}) {
|
|
9480
9634
|
return {
|
|
9481
|
-
relativeDirPath: (0,
|
|
9635
|
+
relativeDirPath: (0, import_node_path71.join)(".gemini", "skills")
|
|
9482
9636
|
};
|
|
9483
9637
|
}
|
|
9484
9638
|
getFrontmatter() {
|
|
@@ -9558,9 +9712,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
9558
9712
|
});
|
|
9559
9713
|
const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9560
9714
|
if (!result.success) {
|
|
9561
|
-
const skillDirPath = (0,
|
|
9715
|
+
const skillDirPath = (0, import_node_path71.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9562
9716
|
throw new Error(
|
|
9563
|
-
`Invalid frontmatter in ${(0,
|
|
9717
|
+
`Invalid frontmatter in ${(0, import_node_path71.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9564
9718
|
);
|
|
9565
9719
|
}
|
|
9566
9720
|
return new _GeminiCliSkill({
|
|
@@ -9595,16 +9749,16 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
9595
9749
|
};
|
|
9596
9750
|
|
|
9597
9751
|
// src/features/skills/junie-skill.ts
|
|
9598
|
-
var
|
|
9599
|
-
var
|
|
9600
|
-
var JunieSkillFrontmatterSchema =
|
|
9601
|
-
name:
|
|
9602
|
-
description:
|
|
9752
|
+
var import_node_path72 = require("path");
|
|
9753
|
+
var import_mini34 = require("zod/mini");
|
|
9754
|
+
var JunieSkillFrontmatterSchema = import_mini34.z.looseObject({
|
|
9755
|
+
name: import_mini34.z.string(),
|
|
9756
|
+
description: import_mini34.z.string()
|
|
9603
9757
|
});
|
|
9604
9758
|
var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
9605
9759
|
constructor({
|
|
9606
9760
|
baseDir = process.cwd(),
|
|
9607
|
-
relativeDirPath = (0,
|
|
9761
|
+
relativeDirPath = (0, import_node_path72.join)(".junie", "skills"),
|
|
9608
9762
|
dirName,
|
|
9609
9763
|
frontmatter,
|
|
9610
9764
|
body,
|
|
@@ -9636,7 +9790,7 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
9636
9790
|
throw new Error("JunieSkill does not support global mode.");
|
|
9637
9791
|
}
|
|
9638
9792
|
return {
|
|
9639
|
-
relativeDirPath: (0,
|
|
9793
|
+
relativeDirPath: (0, import_node_path72.join)(".junie", "skills")
|
|
9640
9794
|
};
|
|
9641
9795
|
}
|
|
9642
9796
|
getFrontmatter() {
|
|
@@ -9723,13 +9877,13 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
9723
9877
|
});
|
|
9724
9878
|
const result = JunieSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9725
9879
|
if (!result.success) {
|
|
9726
|
-
const skillDirPath = (0,
|
|
9880
|
+
const skillDirPath = (0, import_node_path72.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9727
9881
|
throw new Error(
|
|
9728
|
-
`Invalid frontmatter in ${(0,
|
|
9882
|
+
`Invalid frontmatter in ${(0, import_node_path72.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9729
9883
|
);
|
|
9730
9884
|
}
|
|
9731
9885
|
if (result.data.name !== loaded.dirName) {
|
|
9732
|
-
const skillFilePath = (0,
|
|
9886
|
+
const skillFilePath = (0, import_node_path72.join)(
|
|
9733
9887
|
loaded.baseDir,
|
|
9734
9888
|
loaded.relativeDirPath,
|
|
9735
9889
|
loaded.dirName,
|
|
@@ -9771,16 +9925,16 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
9771
9925
|
};
|
|
9772
9926
|
|
|
9773
9927
|
// src/features/skills/kilo-skill.ts
|
|
9774
|
-
var
|
|
9775
|
-
var
|
|
9776
|
-
var KiloSkillFrontmatterSchema =
|
|
9777
|
-
name:
|
|
9778
|
-
description:
|
|
9928
|
+
var import_node_path73 = require("path");
|
|
9929
|
+
var import_mini35 = require("zod/mini");
|
|
9930
|
+
var KiloSkillFrontmatterSchema = import_mini35.z.looseObject({
|
|
9931
|
+
name: import_mini35.z.string(),
|
|
9932
|
+
description: import_mini35.z.string()
|
|
9779
9933
|
});
|
|
9780
9934
|
var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
9781
9935
|
constructor({
|
|
9782
9936
|
baseDir = process.cwd(),
|
|
9783
|
-
relativeDirPath = (0,
|
|
9937
|
+
relativeDirPath = (0, import_node_path73.join)(".kilocode", "skills"),
|
|
9784
9938
|
dirName,
|
|
9785
9939
|
frontmatter,
|
|
9786
9940
|
body,
|
|
@@ -9811,7 +9965,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
9811
9965
|
global: _global = false
|
|
9812
9966
|
} = {}) {
|
|
9813
9967
|
return {
|
|
9814
|
-
relativeDirPath: (0,
|
|
9968
|
+
relativeDirPath: (0, import_node_path73.join)(".kilocode", "skills")
|
|
9815
9969
|
};
|
|
9816
9970
|
}
|
|
9817
9971
|
getFrontmatter() {
|
|
@@ -9899,13 +10053,13 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
9899
10053
|
});
|
|
9900
10054
|
const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9901
10055
|
if (!result.success) {
|
|
9902
|
-
const skillDirPath = (0,
|
|
10056
|
+
const skillDirPath = (0, import_node_path73.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9903
10057
|
throw new Error(
|
|
9904
|
-
`Invalid frontmatter in ${(0,
|
|
10058
|
+
`Invalid frontmatter in ${(0, import_node_path73.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9905
10059
|
);
|
|
9906
10060
|
}
|
|
9907
10061
|
if (result.data.name !== loaded.dirName) {
|
|
9908
|
-
const skillFilePath = (0,
|
|
10062
|
+
const skillFilePath = (0, import_node_path73.join)(
|
|
9909
10063
|
loaded.baseDir,
|
|
9910
10064
|
loaded.relativeDirPath,
|
|
9911
10065
|
loaded.dirName,
|
|
@@ -9946,16 +10100,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
9946
10100
|
};
|
|
9947
10101
|
|
|
9948
10102
|
// src/features/skills/kiro-skill.ts
|
|
9949
|
-
var
|
|
9950
|
-
var
|
|
9951
|
-
var KiroSkillFrontmatterSchema =
|
|
9952
|
-
name:
|
|
9953
|
-
description:
|
|
10103
|
+
var import_node_path74 = require("path");
|
|
10104
|
+
var import_mini36 = require("zod/mini");
|
|
10105
|
+
var KiroSkillFrontmatterSchema = import_mini36.z.looseObject({
|
|
10106
|
+
name: import_mini36.z.string(),
|
|
10107
|
+
description: import_mini36.z.string()
|
|
9954
10108
|
});
|
|
9955
10109
|
var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
9956
10110
|
constructor({
|
|
9957
10111
|
baseDir = process.cwd(),
|
|
9958
|
-
relativeDirPath = (0,
|
|
10112
|
+
relativeDirPath = (0, import_node_path74.join)(".kiro", "skills"),
|
|
9959
10113
|
dirName,
|
|
9960
10114
|
frontmatter,
|
|
9961
10115
|
body,
|
|
@@ -9987,7 +10141,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
9987
10141
|
throw new Error("KiroSkill does not support global mode.");
|
|
9988
10142
|
}
|
|
9989
10143
|
return {
|
|
9990
|
-
relativeDirPath: (0,
|
|
10144
|
+
relativeDirPath: (0, import_node_path74.join)(".kiro", "skills")
|
|
9991
10145
|
};
|
|
9992
10146
|
}
|
|
9993
10147
|
getFrontmatter() {
|
|
@@ -10075,13 +10229,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
10075
10229
|
});
|
|
10076
10230
|
const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10077
10231
|
if (!result.success) {
|
|
10078
|
-
const skillDirPath = (0,
|
|
10232
|
+
const skillDirPath = (0, import_node_path74.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10079
10233
|
throw new Error(
|
|
10080
|
-
`Invalid frontmatter in ${(0,
|
|
10234
|
+
`Invalid frontmatter in ${(0, import_node_path74.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10081
10235
|
);
|
|
10082
10236
|
}
|
|
10083
10237
|
if (result.data.name !== loaded.dirName) {
|
|
10084
|
-
const skillFilePath = (0,
|
|
10238
|
+
const skillFilePath = (0, import_node_path74.join)(
|
|
10085
10239
|
loaded.baseDir,
|
|
10086
10240
|
loaded.relativeDirPath,
|
|
10087
10241
|
loaded.dirName,
|
|
@@ -10123,17 +10277,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
10123
10277
|
};
|
|
10124
10278
|
|
|
10125
10279
|
// src/features/skills/opencode-skill.ts
|
|
10126
|
-
var
|
|
10127
|
-
var
|
|
10128
|
-
var OpenCodeSkillFrontmatterSchema =
|
|
10129
|
-
name:
|
|
10130
|
-
description:
|
|
10131
|
-
"allowed-tools":
|
|
10280
|
+
var import_node_path75 = require("path");
|
|
10281
|
+
var import_mini37 = require("zod/mini");
|
|
10282
|
+
var OpenCodeSkillFrontmatterSchema = import_mini37.z.looseObject({
|
|
10283
|
+
name: import_mini37.z.string(),
|
|
10284
|
+
description: import_mini37.z.string(),
|
|
10285
|
+
"allowed-tools": import_mini37.z.optional(import_mini37.z.array(import_mini37.z.string()))
|
|
10132
10286
|
});
|
|
10133
10287
|
var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
10134
10288
|
constructor({
|
|
10135
10289
|
baseDir = process.cwd(),
|
|
10136
|
-
relativeDirPath = (0,
|
|
10290
|
+
relativeDirPath = (0, import_node_path75.join)(".opencode", "skill"),
|
|
10137
10291
|
dirName,
|
|
10138
10292
|
frontmatter,
|
|
10139
10293
|
body,
|
|
@@ -10162,7 +10316,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
10162
10316
|
}
|
|
10163
10317
|
static getSettablePaths({ global = false } = {}) {
|
|
10164
10318
|
return {
|
|
10165
|
-
relativeDirPath: global ? (0,
|
|
10319
|
+
relativeDirPath: global ? (0, import_node_path75.join)(".config", "opencode", "skill") : (0, import_node_path75.join)(".opencode", "skill")
|
|
10166
10320
|
};
|
|
10167
10321
|
}
|
|
10168
10322
|
getFrontmatter() {
|
|
@@ -10248,9 +10402,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
10248
10402
|
});
|
|
10249
10403
|
const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10250
10404
|
if (!result.success) {
|
|
10251
|
-
const skillDirPath = (0,
|
|
10405
|
+
const skillDirPath = (0, import_node_path75.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10252
10406
|
throw new Error(
|
|
10253
|
-
`Invalid frontmatter in ${(0,
|
|
10407
|
+
`Invalid frontmatter in ${(0, import_node_path75.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10254
10408
|
);
|
|
10255
10409
|
}
|
|
10256
10410
|
return new _OpenCodeSkill({
|
|
@@ -10284,16 +10438,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
10284
10438
|
};
|
|
10285
10439
|
|
|
10286
10440
|
// src/features/skills/replit-skill.ts
|
|
10287
|
-
var
|
|
10288
|
-
var
|
|
10289
|
-
var ReplitSkillFrontmatterSchema =
|
|
10290
|
-
name:
|
|
10291
|
-
description:
|
|
10441
|
+
var import_node_path76 = require("path");
|
|
10442
|
+
var import_mini38 = require("zod/mini");
|
|
10443
|
+
var ReplitSkillFrontmatterSchema = import_mini38.z.looseObject({
|
|
10444
|
+
name: import_mini38.z.string(),
|
|
10445
|
+
description: import_mini38.z.string()
|
|
10292
10446
|
});
|
|
10293
10447
|
var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
10294
10448
|
constructor({
|
|
10295
10449
|
baseDir = process.cwd(),
|
|
10296
|
-
relativeDirPath = (0,
|
|
10450
|
+
relativeDirPath = (0, import_node_path76.join)(".agents", "skills"),
|
|
10297
10451
|
dirName,
|
|
10298
10452
|
frontmatter,
|
|
10299
10453
|
body,
|
|
@@ -10325,7 +10479,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
10325
10479
|
throw new Error("ReplitSkill does not support global mode.");
|
|
10326
10480
|
}
|
|
10327
10481
|
return {
|
|
10328
|
-
relativeDirPath: (0,
|
|
10482
|
+
relativeDirPath: (0, import_node_path76.join)(".agents", "skills")
|
|
10329
10483
|
};
|
|
10330
10484
|
}
|
|
10331
10485
|
getFrontmatter() {
|
|
@@ -10405,9 +10559,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
10405
10559
|
});
|
|
10406
10560
|
const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10407
10561
|
if (!result.success) {
|
|
10408
|
-
const skillDirPath = (0,
|
|
10562
|
+
const skillDirPath = (0, import_node_path76.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10409
10563
|
throw new Error(
|
|
10410
|
-
`Invalid frontmatter in ${(0,
|
|
10564
|
+
`Invalid frontmatter in ${(0, import_node_path76.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10411
10565
|
);
|
|
10412
10566
|
}
|
|
10413
10567
|
return new _ReplitSkill({
|
|
@@ -10442,16 +10596,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
10442
10596
|
};
|
|
10443
10597
|
|
|
10444
10598
|
// src/features/skills/roo-skill.ts
|
|
10445
|
-
var
|
|
10446
|
-
var
|
|
10447
|
-
var RooSkillFrontmatterSchema =
|
|
10448
|
-
name:
|
|
10449
|
-
description:
|
|
10599
|
+
var import_node_path77 = require("path");
|
|
10600
|
+
var import_mini39 = require("zod/mini");
|
|
10601
|
+
var RooSkillFrontmatterSchema = import_mini39.z.looseObject({
|
|
10602
|
+
name: import_mini39.z.string(),
|
|
10603
|
+
description: import_mini39.z.string()
|
|
10450
10604
|
});
|
|
10451
10605
|
var RooSkill = class _RooSkill extends ToolSkill {
|
|
10452
10606
|
constructor({
|
|
10453
10607
|
baseDir = process.cwd(),
|
|
10454
|
-
relativeDirPath = (0,
|
|
10608
|
+
relativeDirPath = (0, import_node_path77.join)(".roo", "skills"),
|
|
10455
10609
|
dirName,
|
|
10456
10610
|
frontmatter,
|
|
10457
10611
|
body,
|
|
@@ -10482,7 +10636,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
10482
10636
|
global: _global = false
|
|
10483
10637
|
} = {}) {
|
|
10484
10638
|
return {
|
|
10485
|
-
relativeDirPath: (0,
|
|
10639
|
+
relativeDirPath: (0, import_node_path77.join)(".roo", "skills")
|
|
10486
10640
|
};
|
|
10487
10641
|
}
|
|
10488
10642
|
getFrontmatter() {
|
|
@@ -10570,13 +10724,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
10570
10724
|
});
|
|
10571
10725
|
const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10572
10726
|
if (!result.success) {
|
|
10573
|
-
const skillDirPath = (0,
|
|
10727
|
+
const skillDirPath = (0, import_node_path77.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10574
10728
|
throw new Error(
|
|
10575
|
-
`Invalid frontmatter in ${(0,
|
|
10729
|
+
`Invalid frontmatter in ${(0, import_node_path77.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10576
10730
|
);
|
|
10577
10731
|
}
|
|
10578
10732
|
if (result.data.name !== loaded.dirName) {
|
|
10579
|
-
const skillFilePath = (0,
|
|
10733
|
+
const skillFilePath = (0, import_node_path77.join)(
|
|
10580
10734
|
loaded.baseDir,
|
|
10581
10735
|
loaded.relativeDirPath,
|
|
10582
10736
|
loaded.dirName,
|
|
@@ -10617,17 +10771,17 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
10617
10771
|
};
|
|
10618
10772
|
|
|
10619
10773
|
// src/features/skills/skills-utils.ts
|
|
10620
|
-
var
|
|
10774
|
+
var import_node_path78 = require("path");
|
|
10621
10775
|
async function getLocalSkillDirNames(baseDir) {
|
|
10622
|
-
const skillsDir = (0,
|
|
10776
|
+
const skillsDir = (0, import_node_path78.join)(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
|
|
10623
10777
|
const names = /* @__PURE__ */ new Set();
|
|
10624
10778
|
if (!await directoryExists(skillsDir)) {
|
|
10625
10779
|
return names;
|
|
10626
10780
|
}
|
|
10627
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
10781
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path78.join)(skillsDir, "*"), { type: "dir" });
|
|
10628
10782
|
for (const dirPath of dirPaths) {
|
|
10629
|
-
const name = (0,
|
|
10630
|
-
if (name === (0,
|
|
10783
|
+
const name = (0, import_node_path78.basename)(dirPath);
|
|
10784
|
+
if (name === (0, import_node_path78.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
|
|
10631
10785
|
names.add(name);
|
|
10632
10786
|
}
|
|
10633
10787
|
return names;
|
|
@@ -10653,7 +10807,7 @@ var skillsProcessorToolTargetTuple = [
|
|
|
10653
10807
|
"replit",
|
|
10654
10808
|
"roo"
|
|
10655
10809
|
];
|
|
10656
|
-
var SkillsProcessorToolTargetSchema =
|
|
10810
|
+
var SkillsProcessorToolTargetSchema = import_mini40.z.enum(skillsProcessorToolTargetTuple);
|
|
10657
10811
|
var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
10658
10812
|
[
|
|
10659
10813
|
"agentsmd",
|
|
@@ -10862,11 +11016,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
10862
11016
|
)
|
|
10863
11017
|
);
|
|
10864
11018
|
const localSkillNames = new Set(localDirNames);
|
|
10865
|
-
const curatedDirPath = (0,
|
|
11019
|
+
const curatedDirPath = (0, import_node_path79.join)(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
|
|
10866
11020
|
let curatedSkills = [];
|
|
10867
11021
|
if (await directoryExists(curatedDirPath)) {
|
|
10868
|
-
const curatedDirPaths = await findFilesByGlobs((0,
|
|
10869
|
-
const curatedDirNames = curatedDirPaths.map((path3) => (0,
|
|
11022
|
+
const curatedDirPaths = await findFilesByGlobs((0, import_node_path79.join)(curatedDirPath, "*"), { type: "dir" });
|
|
11023
|
+
const curatedDirNames = curatedDirPaths.map((path3) => (0, import_node_path79.basename)(path3));
|
|
10870
11024
|
const nonConflicting = curatedDirNames.filter((name) => {
|
|
10871
11025
|
if (localSkillNames.has(name)) {
|
|
10872
11026
|
logger.debug(`Skipping curated skill "${name}": local skill takes precedence.`);
|
|
@@ -10899,9 +11053,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
10899
11053
|
async loadToolDirs() {
|
|
10900
11054
|
const factory = this.getFactory(this.toolTarget);
|
|
10901
11055
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
10902
|
-
const skillsDirPath = (0,
|
|
10903
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
10904
|
-
const dirNames = dirPaths.map((path3) => (0,
|
|
11056
|
+
const skillsDirPath = (0, import_node_path79.join)(this.baseDir, paths.relativeDirPath);
|
|
11057
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path79.join)(skillsDirPath, "*"), { type: "dir" });
|
|
11058
|
+
const dirNames = dirPaths.map((path3) => (0, import_node_path79.basename)(path3));
|
|
10905
11059
|
const toolSkills = await Promise.all(
|
|
10906
11060
|
dirNames.map(
|
|
10907
11061
|
(dirName) => factory.class.fromDir({
|
|
@@ -10917,9 +11071,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
10917
11071
|
async loadToolDirsToDelete() {
|
|
10918
11072
|
const factory = this.getFactory(this.toolTarget);
|
|
10919
11073
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
10920
|
-
const skillsDirPath = (0,
|
|
10921
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
10922
|
-
const dirNames = dirPaths.map((path3) => (0,
|
|
11074
|
+
const skillsDirPath = (0, import_node_path79.join)(this.baseDir, paths.relativeDirPath);
|
|
11075
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path79.join)(skillsDirPath, "*"), { type: "dir" });
|
|
11076
|
+
const dirNames = dirPaths.map((path3) => (0, import_node_path79.basename)(path3));
|
|
10923
11077
|
const toolSkills = dirNames.map(
|
|
10924
11078
|
(dirName) => factory.class.forDeletion({
|
|
10925
11079
|
baseDir: this.baseDir,
|
|
@@ -10980,11 +11134,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
10980
11134
|
};
|
|
10981
11135
|
|
|
10982
11136
|
// src/features/subagents/agentsmd-subagent.ts
|
|
10983
|
-
var
|
|
11137
|
+
var import_node_path81 = require("path");
|
|
10984
11138
|
|
|
10985
11139
|
// src/features/subagents/simulated-subagent.ts
|
|
10986
|
-
var
|
|
10987
|
-
var
|
|
11140
|
+
var import_node_path80 = require("path");
|
|
11141
|
+
var import_mini41 = require("zod/mini");
|
|
10988
11142
|
|
|
10989
11143
|
// src/features/subagents/tool-subagent.ts
|
|
10990
11144
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -11036,9 +11190,9 @@ var ToolSubagent = class extends ToolFile {
|
|
|
11036
11190
|
};
|
|
11037
11191
|
|
|
11038
11192
|
// src/features/subagents/simulated-subagent.ts
|
|
11039
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
11040
|
-
name:
|
|
11041
|
-
description:
|
|
11193
|
+
var SimulatedSubagentFrontmatterSchema = import_mini41.z.object({
|
|
11194
|
+
name: import_mini41.z.string(),
|
|
11195
|
+
description: import_mini41.z.optional(import_mini41.z.string())
|
|
11042
11196
|
});
|
|
11043
11197
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
11044
11198
|
frontmatter;
|
|
@@ -11048,7 +11202,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
11048
11202
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11049
11203
|
if (!result.success) {
|
|
11050
11204
|
throw new Error(
|
|
11051
|
-
`Invalid frontmatter in ${(0,
|
|
11205
|
+
`Invalid frontmatter in ${(0, import_node_path80.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11052
11206
|
);
|
|
11053
11207
|
}
|
|
11054
11208
|
}
|
|
@@ -11099,7 +11253,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
11099
11253
|
return {
|
|
11100
11254
|
success: false,
|
|
11101
11255
|
error: new Error(
|
|
11102
|
-
`Invalid frontmatter in ${(0,
|
|
11256
|
+
`Invalid frontmatter in ${(0, import_node_path80.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11103
11257
|
)
|
|
11104
11258
|
};
|
|
11105
11259
|
}
|
|
@@ -11109,7 +11263,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
11109
11263
|
relativeFilePath,
|
|
11110
11264
|
validate = true
|
|
11111
11265
|
}) {
|
|
11112
|
-
const filePath = (0,
|
|
11266
|
+
const filePath = (0, import_node_path80.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
11113
11267
|
const fileContent = await readFileContent(filePath);
|
|
11114
11268
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
11115
11269
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -11119,7 +11273,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
11119
11273
|
return {
|
|
11120
11274
|
baseDir,
|
|
11121
11275
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
11122
|
-
relativeFilePath: (0,
|
|
11276
|
+
relativeFilePath: (0, import_node_path80.basename)(relativeFilePath),
|
|
11123
11277
|
frontmatter: result.data,
|
|
11124
11278
|
body: content.trim(),
|
|
11125
11279
|
validate
|
|
@@ -11145,7 +11299,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
11145
11299
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
11146
11300
|
static getSettablePaths() {
|
|
11147
11301
|
return {
|
|
11148
|
-
relativeDirPath: (0,
|
|
11302
|
+
relativeDirPath: (0, import_node_path81.join)(".agents", "subagents")
|
|
11149
11303
|
};
|
|
11150
11304
|
}
|
|
11151
11305
|
static async fromFile(params) {
|
|
@@ -11168,11 +11322,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
11168
11322
|
};
|
|
11169
11323
|
|
|
11170
11324
|
// src/features/subagents/factorydroid-subagent.ts
|
|
11171
|
-
var
|
|
11325
|
+
var import_node_path82 = require("path");
|
|
11172
11326
|
var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
|
|
11173
11327
|
static getSettablePaths(_options) {
|
|
11174
11328
|
return {
|
|
11175
|
-
relativeDirPath: (0,
|
|
11329
|
+
relativeDirPath: (0, import_node_path82.join)(".factory", "droids")
|
|
11176
11330
|
};
|
|
11177
11331
|
}
|
|
11178
11332
|
static async fromFile(params) {
|
|
@@ -11195,11 +11349,11 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
|
|
|
11195
11349
|
};
|
|
11196
11350
|
|
|
11197
11351
|
// src/features/subagents/geminicli-subagent.ts
|
|
11198
|
-
var
|
|
11352
|
+
var import_node_path83 = require("path");
|
|
11199
11353
|
var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
11200
11354
|
static getSettablePaths() {
|
|
11201
11355
|
return {
|
|
11202
|
-
relativeDirPath: (0,
|
|
11356
|
+
relativeDirPath: (0, import_node_path83.join)(".gemini", "subagents")
|
|
11203
11357
|
};
|
|
11204
11358
|
}
|
|
11205
11359
|
static async fromFile(params) {
|
|
@@ -11222,11 +11376,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
|
11222
11376
|
};
|
|
11223
11377
|
|
|
11224
11378
|
// src/features/subagents/roo-subagent.ts
|
|
11225
|
-
var
|
|
11379
|
+
var import_node_path84 = require("path");
|
|
11226
11380
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
11227
11381
|
static getSettablePaths() {
|
|
11228
11382
|
return {
|
|
11229
|
-
relativeDirPath: (0,
|
|
11383
|
+
relativeDirPath: (0, import_node_path84.join)(".roo", "subagents")
|
|
11230
11384
|
};
|
|
11231
11385
|
}
|
|
11232
11386
|
static async fromFile(params) {
|
|
@@ -11249,20 +11403,20 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
11249
11403
|
};
|
|
11250
11404
|
|
|
11251
11405
|
// src/features/subagents/subagents-processor.ts
|
|
11252
|
-
var
|
|
11253
|
-
var
|
|
11406
|
+
var import_node_path93 = require("path");
|
|
11407
|
+
var import_mini50 = require("zod/mini");
|
|
11254
11408
|
|
|
11255
11409
|
// src/features/subagents/claudecode-subagent.ts
|
|
11256
|
-
var
|
|
11257
|
-
var
|
|
11410
|
+
var import_node_path86 = require("path");
|
|
11411
|
+
var import_mini43 = require("zod/mini");
|
|
11258
11412
|
|
|
11259
11413
|
// src/features/subagents/rulesync-subagent.ts
|
|
11260
|
-
var
|
|
11261
|
-
var
|
|
11262
|
-
var RulesyncSubagentFrontmatterSchema =
|
|
11263
|
-
targets:
|
|
11264
|
-
name:
|
|
11265
|
-
description:
|
|
11414
|
+
var import_node_path85 = require("path");
|
|
11415
|
+
var import_mini42 = require("zod/mini");
|
|
11416
|
+
var RulesyncSubagentFrontmatterSchema = import_mini42.z.looseObject({
|
|
11417
|
+
targets: import_mini42.z._default(RulesyncTargetsSchema, ["*"]),
|
|
11418
|
+
name: import_mini42.z.string(),
|
|
11419
|
+
description: import_mini42.z.optional(import_mini42.z.string())
|
|
11266
11420
|
});
|
|
11267
11421
|
var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
11268
11422
|
frontmatter;
|
|
@@ -11271,7 +11425,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
11271
11425
|
const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11272
11426
|
if (!parseResult.success && rest.validate !== false) {
|
|
11273
11427
|
throw new Error(
|
|
11274
|
-
`Invalid frontmatter in ${(0,
|
|
11428
|
+
`Invalid frontmatter in ${(0, import_node_path85.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
11275
11429
|
);
|
|
11276
11430
|
}
|
|
11277
11431
|
const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
|
|
@@ -11304,7 +11458,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
11304
11458
|
return {
|
|
11305
11459
|
success: false,
|
|
11306
11460
|
error: new Error(
|
|
11307
|
-
`Invalid frontmatter in ${(0,
|
|
11461
|
+
`Invalid frontmatter in ${(0, import_node_path85.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11308
11462
|
)
|
|
11309
11463
|
};
|
|
11310
11464
|
}
|
|
@@ -11312,14 +11466,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
11312
11466
|
static async fromFile({
|
|
11313
11467
|
relativeFilePath
|
|
11314
11468
|
}) {
|
|
11315
|
-
const filePath = (0,
|
|
11469
|
+
const filePath = (0, import_node_path85.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
|
|
11316
11470
|
const fileContent = await readFileContent(filePath);
|
|
11317
11471
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
11318
11472
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11319
11473
|
if (!result.success) {
|
|
11320
11474
|
throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
|
|
11321
11475
|
}
|
|
11322
|
-
const filename = (0,
|
|
11476
|
+
const filename = (0, import_node_path85.basename)(relativeFilePath);
|
|
11323
11477
|
return new _RulesyncSubagent({
|
|
11324
11478
|
baseDir: process.cwd(),
|
|
11325
11479
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
@@ -11331,13 +11485,13 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
11331
11485
|
};
|
|
11332
11486
|
|
|
11333
11487
|
// src/features/subagents/claudecode-subagent.ts
|
|
11334
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
11335
|
-
name:
|
|
11336
|
-
description:
|
|
11337
|
-
model:
|
|
11338
|
-
tools:
|
|
11339
|
-
permissionMode:
|
|
11340
|
-
skills:
|
|
11488
|
+
var ClaudecodeSubagentFrontmatterSchema = import_mini43.z.looseObject({
|
|
11489
|
+
name: import_mini43.z.string(),
|
|
11490
|
+
description: import_mini43.z.optional(import_mini43.z.string()),
|
|
11491
|
+
model: import_mini43.z.optional(import_mini43.z.string()),
|
|
11492
|
+
tools: import_mini43.z.optional(import_mini43.z.union([import_mini43.z.string(), import_mini43.z.array(import_mini43.z.string())])),
|
|
11493
|
+
permissionMode: import_mini43.z.optional(import_mini43.z.string()),
|
|
11494
|
+
skills: import_mini43.z.optional(import_mini43.z.union([import_mini43.z.string(), import_mini43.z.array(import_mini43.z.string())]))
|
|
11341
11495
|
});
|
|
11342
11496
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
11343
11497
|
frontmatter;
|
|
@@ -11347,7 +11501,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
11347
11501
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11348
11502
|
if (!result.success) {
|
|
11349
11503
|
throw new Error(
|
|
11350
|
-
`Invalid frontmatter in ${(0,
|
|
11504
|
+
`Invalid frontmatter in ${(0, import_node_path86.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11351
11505
|
);
|
|
11352
11506
|
}
|
|
11353
11507
|
}
|
|
@@ -11359,7 +11513,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
11359
11513
|
}
|
|
11360
11514
|
static getSettablePaths(_options = {}) {
|
|
11361
11515
|
return {
|
|
11362
|
-
relativeDirPath: (0,
|
|
11516
|
+
relativeDirPath: (0, import_node_path86.join)(".claude", "agents")
|
|
11363
11517
|
};
|
|
11364
11518
|
}
|
|
11365
11519
|
getFrontmatter() {
|
|
@@ -11438,7 +11592,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
11438
11592
|
return {
|
|
11439
11593
|
success: false,
|
|
11440
11594
|
error: new Error(
|
|
11441
|
-
`Invalid frontmatter in ${(0,
|
|
11595
|
+
`Invalid frontmatter in ${(0, import_node_path86.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11442
11596
|
)
|
|
11443
11597
|
};
|
|
11444
11598
|
}
|
|
@@ -11456,7 +11610,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
11456
11610
|
global = false
|
|
11457
11611
|
}) {
|
|
11458
11612
|
const paths = this.getSettablePaths({ global });
|
|
11459
|
-
const filePath = (0,
|
|
11613
|
+
const filePath = (0, import_node_path86.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11460
11614
|
const fileContent = await readFileContent(filePath);
|
|
11461
11615
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
11462
11616
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -11491,16 +11645,16 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
11491
11645
|
};
|
|
11492
11646
|
|
|
11493
11647
|
// src/features/subagents/codexcli-subagent.ts
|
|
11494
|
-
var
|
|
11648
|
+
var import_node_path87 = require("path");
|
|
11495
11649
|
var smolToml2 = __toESM(require("smol-toml"), 1);
|
|
11496
|
-
var
|
|
11497
|
-
var CodexCliSubagentTomlSchema =
|
|
11498
|
-
name:
|
|
11499
|
-
description:
|
|
11500
|
-
developer_instructions:
|
|
11501
|
-
model:
|
|
11502
|
-
model_reasoning_effort:
|
|
11503
|
-
sandbox_mode:
|
|
11650
|
+
var import_mini44 = require("zod/mini");
|
|
11651
|
+
var CodexCliSubagentTomlSchema = import_mini44.z.looseObject({
|
|
11652
|
+
name: import_mini44.z.string(),
|
|
11653
|
+
description: import_mini44.z.optional(import_mini44.z.string()),
|
|
11654
|
+
developer_instructions: import_mini44.z.optional(import_mini44.z.string()),
|
|
11655
|
+
model: import_mini44.z.optional(import_mini44.z.string()),
|
|
11656
|
+
model_reasoning_effort: import_mini44.z.optional(import_mini44.z.string()),
|
|
11657
|
+
sandbox_mode: import_mini44.z.optional(import_mini44.z.string())
|
|
11504
11658
|
});
|
|
11505
11659
|
var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
11506
11660
|
body;
|
|
@@ -11511,7 +11665,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
11511
11665
|
CodexCliSubagentTomlSchema.parse(parsed);
|
|
11512
11666
|
} catch (error) {
|
|
11513
11667
|
throw new Error(
|
|
11514
|
-
`Invalid TOML in ${(0,
|
|
11668
|
+
`Invalid TOML in ${(0, import_node_path87.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
11515
11669
|
{ cause: error }
|
|
11516
11670
|
);
|
|
11517
11671
|
}
|
|
@@ -11523,7 +11677,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
11523
11677
|
}
|
|
11524
11678
|
static getSettablePaths(_options = {}) {
|
|
11525
11679
|
return {
|
|
11526
|
-
relativeDirPath: (0,
|
|
11680
|
+
relativeDirPath: (0, import_node_path87.join)(".codex", "agents")
|
|
11527
11681
|
};
|
|
11528
11682
|
}
|
|
11529
11683
|
getBody() {
|
|
@@ -11535,7 +11689,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
11535
11689
|
parsed = CodexCliSubagentTomlSchema.parse(smolToml2.parse(this.body));
|
|
11536
11690
|
} catch (error) {
|
|
11537
11691
|
throw new Error(
|
|
11538
|
-
`Failed to parse TOML in ${(0,
|
|
11692
|
+
`Failed to parse TOML in ${(0, import_node_path87.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
11539
11693
|
{ cause: error }
|
|
11540
11694
|
);
|
|
11541
11695
|
}
|
|
@@ -11616,7 +11770,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
11616
11770
|
global = false
|
|
11617
11771
|
}) {
|
|
11618
11772
|
const paths = this.getSettablePaths({ global });
|
|
11619
|
-
const filePath = (0,
|
|
11773
|
+
const filePath = (0, import_node_path87.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11620
11774
|
const fileContent = await readFileContent(filePath);
|
|
11621
11775
|
const subagent = new _CodexCliSubagent({
|
|
11622
11776
|
baseDir,
|
|
@@ -11654,13 +11808,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
11654
11808
|
};
|
|
11655
11809
|
|
|
11656
11810
|
// src/features/subagents/copilot-subagent.ts
|
|
11657
|
-
var
|
|
11658
|
-
var
|
|
11811
|
+
var import_node_path88 = require("path");
|
|
11812
|
+
var import_mini45 = require("zod/mini");
|
|
11659
11813
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
11660
|
-
var CopilotSubagentFrontmatterSchema =
|
|
11661
|
-
name:
|
|
11662
|
-
description:
|
|
11663
|
-
tools:
|
|
11814
|
+
var CopilotSubagentFrontmatterSchema = import_mini45.z.looseObject({
|
|
11815
|
+
name: import_mini45.z.string(),
|
|
11816
|
+
description: import_mini45.z.optional(import_mini45.z.string()),
|
|
11817
|
+
tools: import_mini45.z.optional(import_mini45.z.union([import_mini45.z.string(), import_mini45.z.array(import_mini45.z.string())]))
|
|
11664
11818
|
});
|
|
11665
11819
|
var normalizeTools = (tools) => {
|
|
11666
11820
|
if (!tools) {
|
|
@@ -11680,7 +11834,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
11680
11834
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11681
11835
|
if (!result.success) {
|
|
11682
11836
|
throw new Error(
|
|
11683
|
-
`Invalid frontmatter in ${(0,
|
|
11837
|
+
`Invalid frontmatter in ${(0, import_node_path88.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11684
11838
|
);
|
|
11685
11839
|
}
|
|
11686
11840
|
}
|
|
@@ -11692,7 +11846,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
11692
11846
|
}
|
|
11693
11847
|
static getSettablePaths(_options = {}) {
|
|
11694
11848
|
return {
|
|
11695
|
-
relativeDirPath: (0,
|
|
11849
|
+
relativeDirPath: (0, import_node_path88.join)(".github", "agents")
|
|
11696
11850
|
};
|
|
11697
11851
|
}
|
|
11698
11852
|
getFrontmatter() {
|
|
@@ -11766,7 +11920,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
11766
11920
|
return {
|
|
11767
11921
|
success: false,
|
|
11768
11922
|
error: new Error(
|
|
11769
|
-
`Invalid frontmatter in ${(0,
|
|
11923
|
+
`Invalid frontmatter in ${(0, import_node_path88.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11770
11924
|
)
|
|
11771
11925
|
};
|
|
11772
11926
|
}
|
|
@@ -11784,7 +11938,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
11784
11938
|
global = false
|
|
11785
11939
|
}) {
|
|
11786
11940
|
const paths = this.getSettablePaths({ global });
|
|
11787
|
-
const filePath = (0,
|
|
11941
|
+
const filePath = (0, import_node_path88.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11788
11942
|
const fileContent = await readFileContent(filePath);
|
|
11789
11943
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
11790
11944
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -11820,11 +11974,11 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
11820
11974
|
};
|
|
11821
11975
|
|
|
11822
11976
|
// src/features/subagents/cursor-subagent.ts
|
|
11823
|
-
var
|
|
11824
|
-
var
|
|
11825
|
-
var CursorSubagentFrontmatterSchema =
|
|
11826
|
-
name:
|
|
11827
|
-
description:
|
|
11977
|
+
var import_node_path89 = require("path");
|
|
11978
|
+
var import_mini46 = require("zod/mini");
|
|
11979
|
+
var CursorSubagentFrontmatterSchema = import_mini46.z.looseObject({
|
|
11980
|
+
name: import_mini46.z.string(),
|
|
11981
|
+
description: import_mini46.z.optional(import_mini46.z.string())
|
|
11828
11982
|
});
|
|
11829
11983
|
var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
11830
11984
|
frontmatter;
|
|
@@ -11834,7 +11988,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
11834
11988
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11835
11989
|
if (!result.success) {
|
|
11836
11990
|
throw new Error(
|
|
11837
|
-
`Invalid frontmatter in ${(0,
|
|
11991
|
+
`Invalid frontmatter in ${(0, import_node_path89.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11838
11992
|
);
|
|
11839
11993
|
}
|
|
11840
11994
|
}
|
|
@@ -11846,7 +12000,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
11846
12000
|
}
|
|
11847
12001
|
static getSettablePaths(_options = {}) {
|
|
11848
12002
|
return {
|
|
11849
|
-
relativeDirPath: (0,
|
|
12003
|
+
relativeDirPath: (0, import_node_path89.join)(".cursor", "agents")
|
|
11850
12004
|
};
|
|
11851
12005
|
}
|
|
11852
12006
|
getFrontmatter() {
|
|
@@ -11913,7 +12067,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
11913
12067
|
return {
|
|
11914
12068
|
success: false,
|
|
11915
12069
|
error: new Error(
|
|
11916
|
-
`Invalid frontmatter in ${(0,
|
|
12070
|
+
`Invalid frontmatter in ${(0, import_node_path89.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11917
12071
|
)
|
|
11918
12072
|
};
|
|
11919
12073
|
}
|
|
@@ -11931,7 +12085,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
11931
12085
|
global = false
|
|
11932
12086
|
}) {
|
|
11933
12087
|
const paths = this.getSettablePaths({ global });
|
|
11934
|
-
const filePath = (0,
|
|
12088
|
+
const filePath = (0, import_node_path89.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11935
12089
|
const fileContent = await readFileContent(filePath);
|
|
11936
12090
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
11937
12091
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -11967,11 +12121,11 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
11967
12121
|
};
|
|
11968
12122
|
|
|
11969
12123
|
// src/features/subagents/junie-subagent.ts
|
|
11970
|
-
var
|
|
11971
|
-
var
|
|
11972
|
-
var JunieSubagentFrontmatterSchema =
|
|
11973
|
-
name:
|
|
11974
|
-
description:
|
|
12124
|
+
var import_node_path90 = require("path");
|
|
12125
|
+
var import_mini47 = require("zod/mini");
|
|
12126
|
+
var JunieSubagentFrontmatterSchema = import_mini47.z.looseObject({
|
|
12127
|
+
name: import_mini47.z.optional(import_mini47.z.string()),
|
|
12128
|
+
description: import_mini47.z.string()
|
|
11975
12129
|
});
|
|
11976
12130
|
var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
11977
12131
|
frontmatter;
|
|
@@ -11981,7 +12135,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
11981
12135
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11982
12136
|
if (!result.success) {
|
|
11983
12137
|
throw new Error(
|
|
11984
|
-
`Invalid frontmatter in ${(0,
|
|
12138
|
+
`Invalid frontmatter in ${(0, import_node_path90.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11985
12139
|
);
|
|
11986
12140
|
}
|
|
11987
12141
|
}
|
|
@@ -11996,7 +12150,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
11996
12150
|
throw new Error("JunieSubagent does not support global mode.");
|
|
11997
12151
|
}
|
|
11998
12152
|
return {
|
|
11999
|
-
relativeDirPath: (0,
|
|
12153
|
+
relativeDirPath: (0, import_node_path90.join)(".junie", "agents")
|
|
12000
12154
|
};
|
|
12001
12155
|
}
|
|
12002
12156
|
getFrontmatter() {
|
|
@@ -12072,7 +12226,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
12072
12226
|
return {
|
|
12073
12227
|
success: false,
|
|
12074
12228
|
error: new Error(
|
|
12075
|
-
`Invalid frontmatter in ${(0,
|
|
12229
|
+
`Invalid frontmatter in ${(0, import_node_path90.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
12076
12230
|
)
|
|
12077
12231
|
};
|
|
12078
12232
|
}
|
|
@@ -12090,7 +12244,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
12090
12244
|
global = false
|
|
12091
12245
|
}) {
|
|
12092
12246
|
const paths = this.getSettablePaths({ global });
|
|
12093
|
-
const filePath = (0,
|
|
12247
|
+
const filePath = (0, import_node_path90.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
12094
12248
|
const fileContent = await readFileContent(filePath);
|
|
12095
12249
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
12096
12250
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -12125,23 +12279,23 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
12125
12279
|
};
|
|
12126
12280
|
|
|
12127
12281
|
// src/features/subagents/kiro-subagent.ts
|
|
12128
|
-
var
|
|
12129
|
-
var
|
|
12130
|
-
var KiroCliSubagentJsonSchema =
|
|
12131
|
-
name:
|
|
12132
|
-
description:
|
|
12133
|
-
prompt:
|
|
12134
|
-
tools:
|
|
12135
|
-
toolAliases:
|
|
12136
|
-
toolSettings:
|
|
12137
|
-
toolSchema:
|
|
12138
|
-
hooks:
|
|
12139
|
-
model:
|
|
12140
|
-
mcpServers:
|
|
12141
|
-
useLegacyMcpJson:
|
|
12142
|
-
resources:
|
|
12143
|
-
allowedTools:
|
|
12144
|
-
includeMcpJson:
|
|
12282
|
+
var import_node_path91 = require("path");
|
|
12283
|
+
var import_mini48 = require("zod/mini");
|
|
12284
|
+
var KiroCliSubagentJsonSchema = import_mini48.z.looseObject({
|
|
12285
|
+
name: import_mini48.z.string(),
|
|
12286
|
+
description: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.string())),
|
|
12287
|
+
prompt: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.string())),
|
|
12288
|
+
tools: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.array(import_mini48.z.string()))),
|
|
12289
|
+
toolAliases: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.record(import_mini48.z.string(), import_mini48.z.string()))),
|
|
12290
|
+
toolSettings: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.unknown())),
|
|
12291
|
+
toolSchema: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.unknown())),
|
|
12292
|
+
hooks: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.record(import_mini48.z.string(), import_mini48.z.array(import_mini48.z.unknown())))),
|
|
12293
|
+
model: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.string())),
|
|
12294
|
+
mcpServers: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.record(import_mini48.z.string(), import_mini48.z.unknown()))),
|
|
12295
|
+
useLegacyMcpJson: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.boolean())),
|
|
12296
|
+
resources: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.array(import_mini48.z.string()))),
|
|
12297
|
+
allowedTools: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.array(import_mini48.z.string()))),
|
|
12298
|
+
includeMcpJson: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.boolean()))
|
|
12145
12299
|
});
|
|
12146
12300
|
var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
12147
12301
|
body;
|
|
@@ -12152,7 +12306,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
12152
12306
|
KiroCliSubagentJsonSchema.parse(parsed);
|
|
12153
12307
|
} catch (error) {
|
|
12154
12308
|
throw new Error(
|
|
12155
|
-
`Invalid JSON in ${(0,
|
|
12309
|
+
`Invalid JSON in ${(0, import_node_path91.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
12156
12310
|
{ cause: error }
|
|
12157
12311
|
);
|
|
12158
12312
|
}
|
|
@@ -12164,7 +12318,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
12164
12318
|
}
|
|
12165
12319
|
static getSettablePaths(_options = {}) {
|
|
12166
12320
|
return {
|
|
12167
|
-
relativeDirPath: (0,
|
|
12321
|
+
relativeDirPath: (0, import_node_path91.join)(".kiro", "agents")
|
|
12168
12322
|
};
|
|
12169
12323
|
}
|
|
12170
12324
|
getBody() {
|
|
@@ -12176,7 +12330,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
12176
12330
|
parsed = JSON.parse(this.body);
|
|
12177
12331
|
} catch (error) {
|
|
12178
12332
|
throw new Error(
|
|
12179
|
-
`Failed to parse JSON in ${(0,
|
|
12333
|
+
`Failed to parse JSON in ${(0, import_node_path91.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
12180
12334
|
{ cause: error }
|
|
12181
12335
|
);
|
|
12182
12336
|
}
|
|
@@ -12257,7 +12411,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
12257
12411
|
global = false
|
|
12258
12412
|
}) {
|
|
12259
12413
|
const paths = this.getSettablePaths({ global });
|
|
12260
|
-
const filePath = (0,
|
|
12414
|
+
const filePath = (0, import_node_path91.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
12261
12415
|
const fileContent = await readFileContent(filePath);
|
|
12262
12416
|
const subagent = new _KiroSubagent({
|
|
12263
12417
|
baseDir,
|
|
@@ -12295,12 +12449,12 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
12295
12449
|
};
|
|
12296
12450
|
|
|
12297
12451
|
// src/features/subagents/opencode-subagent.ts
|
|
12298
|
-
var
|
|
12299
|
-
var
|
|
12300
|
-
var OpenCodeSubagentFrontmatterSchema =
|
|
12301
|
-
description:
|
|
12302
|
-
mode:
|
|
12303
|
-
name:
|
|
12452
|
+
var import_node_path92 = require("path");
|
|
12453
|
+
var import_mini49 = require("zod/mini");
|
|
12454
|
+
var OpenCodeSubagentFrontmatterSchema = import_mini49.z.looseObject({
|
|
12455
|
+
description: import_mini49.z.optional(import_mini49.z.string()),
|
|
12456
|
+
mode: import_mini49.z._default(import_mini49.z.string(), "subagent"),
|
|
12457
|
+
name: import_mini49.z.optional(import_mini49.z.string())
|
|
12304
12458
|
});
|
|
12305
12459
|
var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
12306
12460
|
frontmatter;
|
|
@@ -12310,7 +12464,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
12310
12464
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
12311
12465
|
if (!result.success) {
|
|
12312
12466
|
throw new Error(
|
|
12313
|
-
`Invalid frontmatter in ${(0,
|
|
12467
|
+
`Invalid frontmatter in ${(0, import_node_path92.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
12314
12468
|
);
|
|
12315
12469
|
}
|
|
12316
12470
|
}
|
|
@@ -12324,7 +12478,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
12324
12478
|
global = false
|
|
12325
12479
|
} = {}) {
|
|
12326
12480
|
return {
|
|
12327
|
-
relativeDirPath: global ? (0,
|
|
12481
|
+
relativeDirPath: global ? (0, import_node_path92.join)(".config", "opencode", "agent") : (0, import_node_path92.join)(".opencode", "agent")
|
|
12328
12482
|
};
|
|
12329
12483
|
}
|
|
12330
12484
|
getFrontmatter() {
|
|
@@ -12337,7 +12491,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
12337
12491
|
const { description, mode, name, ...opencodeSection } = this.frontmatter;
|
|
12338
12492
|
const rulesyncFrontmatter = {
|
|
12339
12493
|
targets: ["*"],
|
|
12340
|
-
name: name ?? (0,
|
|
12494
|
+
name: name ?? (0, import_node_path92.basename)(this.getRelativeFilePath(), ".md"),
|
|
12341
12495
|
description,
|
|
12342
12496
|
opencode: { mode, ...opencodeSection }
|
|
12343
12497
|
};
|
|
@@ -12390,7 +12544,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
12390
12544
|
return {
|
|
12391
12545
|
success: false,
|
|
12392
12546
|
error: new Error(
|
|
12393
|
-
`Invalid frontmatter in ${(0,
|
|
12547
|
+
`Invalid frontmatter in ${(0, import_node_path92.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
12394
12548
|
)
|
|
12395
12549
|
};
|
|
12396
12550
|
}
|
|
@@ -12407,7 +12561,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
12407
12561
|
global = false
|
|
12408
12562
|
}) {
|
|
12409
12563
|
const paths = this.getSettablePaths({ global });
|
|
12410
|
-
const filePath = (0,
|
|
12564
|
+
const filePath = (0, import_node_path92.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
12411
12565
|
const fileContent = await readFileContent(filePath);
|
|
12412
12566
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
12413
12567
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -12457,7 +12611,7 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
12457
12611
|
"opencode",
|
|
12458
12612
|
"roo"
|
|
12459
12613
|
];
|
|
12460
|
-
var SubagentsProcessorToolTargetSchema =
|
|
12614
|
+
var SubagentsProcessorToolTargetSchema = import_mini50.z.enum(subagentsProcessorToolTargetTuple);
|
|
12461
12615
|
var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
12462
12616
|
[
|
|
12463
12617
|
"agentsmd",
|
|
@@ -12626,7 +12780,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
12626
12780
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
12627
12781
|
*/
|
|
12628
12782
|
async loadRulesyncFiles() {
|
|
12629
|
-
const subagentsDir = (0,
|
|
12783
|
+
const subagentsDir = (0, import_node_path93.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
12630
12784
|
const dirExists = await directoryExists(subagentsDir);
|
|
12631
12785
|
if (!dirExists) {
|
|
12632
12786
|
logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -12641,7 +12795,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
12641
12795
|
logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
12642
12796
|
const rulesyncSubagents = [];
|
|
12643
12797
|
for (const mdFile of mdFiles) {
|
|
12644
|
-
const filepath = (0,
|
|
12798
|
+
const filepath = (0, import_node_path93.join)(subagentsDir, mdFile);
|
|
12645
12799
|
try {
|
|
12646
12800
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
12647
12801
|
relativeFilePath: mdFile,
|
|
@@ -12671,14 +12825,14 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
12671
12825
|
const factory = this.getFactory(this.toolTarget);
|
|
12672
12826
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
12673
12827
|
const subagentFilePaths = await findFilesByGlobs(
|
|
12674
|
-
(0,
|
|
12828
|
+
(0, import_node_path93.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
|
|
12675
12829
|
);
|
|
12676
12830
|
if (forDeletion) {
|
|
12677
12831
|
const toolSubagents2 = subagentFilePaths.map(
|
|
12678
12832
|
(path3) => factory.class.forDeletion({
|
|
12679
12833
|
baseDir: this.baseDir,
|
|
12680
12834
|
relativeDirPath: paths.relativeDirPath,
|
|
12681
|
-
relativeFilePath: (0,
|
|
12835
|
+
relativeFilePath: (0, import_node_path93.basename)(path3),
|
|
12682
12836
|
global: this.global
|
|
12683
12837
|
})
|
|
12684
12838
|
).filter((subagent) => subagent.isDeletable());
|
|
@@ -12691,7 +12845,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
12691
12845
|
subagentFilePaths.map(
|
|
12692
12846
|
(path3) => factory.class.fromFile({
|
|
12693
12847
|
baseDir: this.baseDir,
|
|
12694
|
-
relativeFilePath: (0,
|
|
12848
|
+
relativeFilePath: (0, import_node_path93.basename)(path3),
|
|
12695
12849
|
global: this.global
|
|
12696
12850
|
})
|
|
12697
12851
|
)
|
|
@@ -12736,49 +12890,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
12736
12890
|
};
|
|
12737
12891
|
|
|
12738
12892
|
// src/features/rules/agentsmd-rule.ts
|
|
12739
|
-
var
|
|
12893
|
+
var import_node_path96 = require("path");
|
|
12740
12894
|
|
|
12741
12895
|
// src/features/rules/tool-rule.ts
|
|
12742
|
-
var
|
|
12896
|
+
var import_node_path95 = require("path");
|
|
12743
12897
|
|
|
12744
12898
|
// src/features/rules/rulesync-rule.ts
|
|
12745
|
-
var
|
|
12746
|
-
var
|
|
12747
|
-
var RulesyncRuleFrontmatterSchema =
|
|
12748
|
-
root:
|
|
12749
|
-
localRoot:
|
|
12750
|
-
targets:
|
|
12751
|
-
description:
|
|
12752
|
-
globs:
|
|
12753
|
-
agentsmd:
|
|
12754
|
-
|
|
12899
|
+
var import_node_path94 = require("path");
|
|
12900
|
+
var import_mini51 = require("zod/mini");
|
|
12901
|
+
var RulesyncRuleFrontmatterSchema = import_mini51.z.object({
|
|
12902
|
+
root: import_mini51.z.optional(import_mini51.z.boolean()),
|
|
12903
|
+
localRoot: import_mini51.z.optional(import_mini51.z.boolean()),
|
|
12904
|
+
targets: import_mini51.z._default(RulesyncTargetsSchema, ["*"]),
|
|
12905
|
+
description: import_mini51.z.optional(import_mini51.z.string()),
|
|
12906
|
+
globs: import_mini51.z.optional(import_mini51.z.array(import_mini51.z.string())),
|
|
12907
|
+
agentsmd: import_mini51.z.optional(
|
|
12908
|
+
import_mini51.z.object({
|
|
12755
12909
|
// @example "path/to/subproject"
|
|
12756
|
-
subprojectPath:
|
|
12910
|
+
subprojectPath: import_mini51.z.optional(import_mini51.z.string())
|
|
12757
12911
|
})
|
|
12758
12912
|
),
|
|
12759
|
-
claudecode:
|
|
12760
|
-
|
|
12913
|
+
claudecode: import_mini51.z.optional(
|
|
12914
|
+
import_mini51.z.object({
|
|
12761
12915
|
// Glob patterns for conditional rules (takes precedence over globs)
|
|
12762
12916
|
// @example ["src/**/*.ts", "tests/**/*.test.ts"]
|
|
12763
|
-
paths:
|
|
12917
|
+
paths: import_mini51.z.optional(import_mini51.z.array(import_mini51.z.string()))
|
|
12764
12918
|
})
|
|
12765
12919
|
),
|
|
12766
|
-
cursor:
|
|
12767
|
-
|
|
12768
|
-
alwaysApply:
|
|
12769
|
-
description:
|
|
12770
|
-
globs:
|
|
12920
|
+
cursor: import_mini51.z.optional(
|
|
12921
|
+
import_mini51.z.object({
|
|
12922
|
+
alwaysApply: import_mini51.z.optional(import_mini51.z.boolean()),
|
|
12923
|
+
description: import_mini51.z.optional(import_mini51.z.string()),
|
|
12924
|
+
globs: import_mini51.z.optional(import_mini51.z.array(import_mini51.z.string()))
|
|
12771
12925
|
})
|
|
12772
12926
|
),
|
|
12773
|
-
copilot:
|
|
12774
|
-
|
|
12775
|
-
excludeAgent:
|
|
12927
|
+
copilot: import_mini51.z.optional(
|
|
12928
|
+
import_mini51.z.object({
|
|
12929
|
+
excludeAgent: import_mini51.z.optional(import_mini51.z.union([import_mini51.z.literal("code-review"), import_mini51.z.literal("coding-agent")]))
|
|
12776
12930
|
})
|
|
12777
12931
|
),
|
|
12778
|
-
antigravity:
|
|
12779
|
-
|
|
12780
|
-
trigger:
|
|
12781
|
-
globs:
|
|
12932
|
+
antigravity: import_mini51.z.optional(
|
|
12933
|
+
import_mini51.z.looseObject({
|
|
12934
|
+
trigger: import_mini51.z.optional(import_mini51.z.string()),
|
|
12935
|
+
globs: import_mini51.z.optional(import_mini51.z.array(import_mini51.z.string()))
|
|
12782
12936
|
})
|
|
12783
12937
|
)
|
|
12784
12938
|
});
|
|
@@ -12789,7 +12943,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
12789
12943
|
const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
12790
12944
|
if (!parseResult.success && rest.validate !== false) {
|
|
12791
12945
|
throw new Error(
|
|
12792
|
-
`Invalid frontmatter in ${(0,
|
|
12946
|
+
`Invalid frontmatter in ${(0, import_node_path94.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
12793
12947
|
);
|
|
12794
12948
|
}
|
|
12795
12949
|
const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
|
|
@@ -12824,7 +12978,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
12824
12978
|
return {
|
|
12825
12979
|
success: false,
|
|
12826
12980
|
error: new Error(
|
|
12827
|
-
`Invalid frontmatter in ${(0,
|
|
12981
|
+
`Invalid frontmatter in ${(0, import_node_path94.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
12828
12982
|
)
|
|
12829
12983
|
};
|
|
12830
12984
|
}
|
|
@@ -12833,7 +12987,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
12833
12987
|
relativeFilePath,
|
|
12834
12988
|
validate = true
|
|
12835
12989
|
}) {
|
|
12836
|
-
const filePath = (0,
|
|
12990
|
+
const filePath = (0, import_node_path94.join)(
|
|
12837
12991
|
process.cwd(),
|
|
12838
12992
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
12839
12993
|
relativeFilePath
|
|
@@ -12935,7 +13089,7 @@ var ToolRule = class extends ToolFile {
|
|
|
12935
13089
|
rulesyncRule,
|
|
12936
13090
|
validate = true,
|
|
12937
13091
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
12938
|
-
nonRootPath = { relativeDirPath: (0,
|
|
13092
|
+
nonRootPath = { relativeDirPath: (0, import_node_path95.join)(".agents", "memories") }
|
|
12939
13093
|
}) {
|
|
12940
13094
|
const params = this.buildToolRuleParamsDefault({
|
|
12941
13095
|
baseDir,
|
|
@@ -12946,7 +13100,7 @@ var ToolRule = class extends ToolFile {
|
|
|
12946
13100
|
});
|
|
12947
13101
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
12948
13102
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
12949
|
-
params.relativeDirPath = (0,
|
|
13103
|
+
params.relativeDirPath = (0, import_node_path95.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
12950
13104
|
params.relativeFilePath = "AGENTS.md";
|
|
12951
13105
|
}
|
|
12952
13106
|
return params;
|
|
@@ -12995,7 +13149,7 @@ var ToolRule = class extends ToolFile {
|
|
|
12995
13149
|
}
|
|
12996
13150
|
};
|
|
12997
13151
|
function buildToolPath(toolDir, subDir, excludeToolDir) {
|
|
12998
|
-
return excludeToolDir ? subDir : (0,
|
|
13152
|
+
return excludeToolDir ? subDir : (0, import_node_path95.join)(toolDir, subDir);
|
|
12999
13153
|
}
|
|
13000
13154
|
|
|
13001
13155
|
// src/features/rules/agentsmd-rule.ts
|
|
@@ -13024,8 +13178,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
13024
13178
|
validate = true
|
|
13025
13179
|
}) {
|
|
13026
13180
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
13027
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
13028
|
-
const fileContent = await readFileContent((0,
|
|
13181
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path96.join)(".agents", "memories", relativeFilePath);
|
|
13182
|
+
const fileContent = await readFileContent((0, import_node_path96.join)(baseDir, relativePath));
|
|
13029
13183
|
return new _AgentsMdRule({
|
|
13030
13184
|
baseDir,
|
|
13031
13185
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -13080,21 +13234,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
13080
13234
|
};
|
|
13081
13235
|
|
|
13082
13236
|
// src/features/rules/antigravity-rule.ts
|
|
13083
|
-
var
|
|
13084
|
-
var
|
|
13085
|
-
var AntigravityRuleFrontmatterSchema =
|
|
13086
|
-
trigger:
|
|
13087
|
-
|
|
13088
|
-
|
|
13089
|
-
|
|
13090
|
-
|
|
13091
|
-
|
|
13092
|
-
|
|
13237
|
+
var import_node_path97 = require("path");
|
|
13238
|
+
var import_mini52 = require("zod/mini");
|
|
13239
|
+
var AntigravityRuleFrontmatterSchema = import_mini52.z.looseObject({
|
|
13240
|
+
trigger: import_mini52.z.optional(
|
|
13241
|
+
import_mini52.z.union([
|
|
13242
|
+
import_mini52.z.literal("always_on"),
|
|
13243
|
+
import_mini52.z.literal("glob"),
|
|
13244
|
+
import_mini52.z.literal("manual"),
|
|
13245
|
+
import_mini52.z.literal("model_decision"),
|
|
13246
|
+
import_mini52.z.string()
|
|
13093
13247
|
// accepts any string for forward compatibility
|
|
13094
13248
|
])
|
|
13095
13249
|
),
|
|
13096
|
-
globs:
|
|
13097
|
-
description:
|
|
13250
|
+
globs: import_mini52.z.optional(import_mini52.z.string()),
|
|
13251
|
+
description: import_mini52.z.optional(import_mini52.z.string())
|
|
13098
13252
|
});
|
|
13099
13253
|
function parseGlobsString(globs) {
|
|
13100
13254
|
if (!globs) {
|
|
@@ -13239,7 +13393,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
13239
13393
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
13240
13394
|
if (!result.success) {
|
|
13241
13395
|
throw new Error(
|
|
13242
|
-
`Invalid frontmatter in ${(0,
|
|
13396
|
+
`Invalid frontmatter in ${(0, import_node_path97.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
13243
13397
|
);
|
|
13244
13398
|
}
|
|
13245
13399
|
}
|
|
@@ -13263,7 +13417,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
13263
13417
|
relativeFilePath,
|
|
13264
13418
|
validate = true
|
|
13265
13419
|
}) {
|
|
13266
|
-
const filePath = (0,
|
|
13420
|
+
const filePath = (0, import_node_path97.join)(
|
|
13267
13421
|
baseDir,
|
|
13268
13422
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
13269
13423
|
relativeFilePath
|
|
@@ -13403,7 +13557,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
13403
13557
|
};
|
|
13404
13558
|
|
|
13405
13559
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
13406
|
-
var
|
|
13560
|
+
var import_node_path98 = require("path");
|
|
13407
13561
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
13408
13562
|
toRulesyncRule() {
|
|
13409
13563
|
const rulesyncFrontmatter = {
|
|
@@ -13463,8 +13617,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
13463
13617
|
}) {
|
|
13464
13618
|
const settablePaths = this.getSettablePaths();
|
|
13465
13619
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
13466
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0,
|
|
13467
|
-
const fileContent = await readFileContent((0,
|
|
13620
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path98.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13621
|
+
const fileContent = await readFileContent((0, import_node_path98.join)(baseDir, relativePath));
|
|
13468
13622
|
return new _AugmentcodeLegacyRule({
|
|
13469
13623
|
baseDir,
|
|
13470
13624
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -13493,7 +13647,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
13493
13647
|
};
|
|
13494
13648
|
|
|
13495
13649
|
// src/features/rules/augmentcode-rule.ts
|
|
13496
|
-
var
|
|
13650
|
+
var import_node_path99 = require("path");
|
|
13497
13651
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
13498
13652
|
toRulesyncRule() {
|
|
13499
13653
|
return this.toRulesyncRuleDefault();
|
|
@@ -13524,7 +13678,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
13524
13678
|
relativeFilePath,
|
|
13525
13679
|
validate = true
|
|
13526
13680
|
}) {
|
|
13527
|
-
const filePath = (0,
|
|
13681
|
+
const filePath = (0, import_node_path99.join)(
|
|
13528
13682
|
baseDir,
|
|
13529
13683
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
13530
13684
|
relativeFilePath
|
|
@@ -13564,7 +13718,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
13564
13718
|
};
|
|
13565
13719
|
|
|
13566
13720
|
// src/features/rules/claudecode-legacy-rule.ts
|
|
13567
|
-
var
|
|
13721
|
+
var import_node_path100 = require("path");
|
|
13568
13722
|
var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
13569
13723
|
static getSettablePaths({
|
|
13570
13724
|
global,
|
|
@@ -13606,7 +13760,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
13606
13760
|
if (isRoot) {
|
|
13607
13761
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
13608
13762
|
const fileContent2 = await readFileContent(
|
|
13609
|
-
(0,
|
|
13763
|
+
(0, import_node_path100.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
|
|
13610
13764
|
);
|
|
13611
13765
|
return new _ClaudecodeLegacyRule({
|
|
13612
13766
|
baseDir,
|
|
@@ -13620,8 +13774,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
13620
13774
|
if (!paths.nonRoot) {
|
|
13621
13775
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13622
13776
|
}
|
|
13623
|
-
const relativePath = (0,
|
|
13624
|
-
const fileContent = await readFileContent((0,
|
|
13777
|
+
const relativePath = (0, import_node_path100.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13778
|
+
const fileContent = await readFileContent((0, import_node_path100.join)(baseDir, relativePath));
|
|
13625
13779
|
return new _ClaudecodeLegacyRule({
|
|
13626
13780
|
baseDir,
|
|
13627
13781
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -13680,10 +13834,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
13680
13834
|
};
|
|
13681
13835
|
|
|
13682
13836
|
// src/features/rules/claudecode-rule.ts
|
|
13683
|
-
var
|
|
13684
|
-
var
|
|
13685
|
-
var ClaudecodeRuleFrontmatterSchema =
|
|
13686
|
-
paths:
|
|
13837
|
+
var import_node_path101 = require("path");
|
|
13838
|
+
var import_mini53 = require("zod/mini");
|
|
13839
|
+
var ClaudecodeRuleFrontmatterSchema = import_mini53.z.object({
|
|
13840
|
+
paths: import_mini53.z.optional(import_mini53.z.array(import_mini53.z.string()))
|
|
13687
13841
|
});
|
|
13688
13842
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
13689
13843
|
frontmatter;
|
|
@@ -13721,7 +13875,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
13721
13875
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
13722
13876
|
if (!result.success) {
|
|
13723
13877
|
throw new Error(
|
|
13724
|
-
`Invalid frontmatter in ${(0,
|
|
13878
|
+
`Invalid frontmatter in ${(0, import_node_path101.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
13725
13879
|
);
|
|
13726
13880
|
}
|
|
13727
13881
|
}
|
|
@@ -13751,7 +13905,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
13751
13905
|
if (isRoot) {
|
|
13752
13906
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
13753
13907
|
const fileContent2 = await readFileContent(
|
|
13754
|
-
(0,
|
|
13908
|
+
(0, import_node_path101.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
|
|
13755
13909
|
);
|
|
13756
13910
|
return new _ClaudecodeRule({
|
|
13757
13911
|
baseDir,
|
|
@@ -13766,8 +13920,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
13766
13920
|
if (!paths.nonRoot) {
|
|
13767
13921
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13768
13922
|
}
|
|
13769
|
-
const relativePath = (0,
|
|
13770
|
-
const filePath = (0,
|
|
13923
|
+
const relativePath = (0, import_node_path101.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13924
|
+
const filePath = (0, import_node_path101.join)(baseDir, relativePath);
|
|
13771
13925
|
const fileContent = await readFileContent(filePath);
|
|
13772
13926
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
13773
13927
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -13878,7 +14032,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
13878
14032
|
return {
|
|
13879
14033
|
success: false,
|
|
13880
14034
|
error: new Error(
|
|
13881
|
-
`Invalid frontmatter in ${(0,
|
|
14035
|
+
`Invalid frontmatter in ${(0, import_node_path101.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
13882
14036
|
)
|
|
13883
14037
|
};
|
|
13884
14038
|
}
|
|
@@ -13898,10 +14052,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
13898
14052
|
};
|
|
13899
14053
|
|
|
13900
14054
|
// src/features/rules/cline-rule.ts
|
|
13901
|
-
var
|
|
13902
|
-
var
|
|
13903
|
-
var ClineRuleFrontmatterSchema =
|
|
13904
|
-
description:
|
|
14055
|
+
var import_node_path102 = require("path");
|
|
14056
|
+
var import_mini54 = require("zod/mini");
|
|
14057
|
+
var ClineRuleFrontmatterSchema = import_mini54.z.object({
|
|
14058
|
+
description: import_mini54.z.string()
|
|
13905
14059
|
});
|
|
13906
14060
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
13907
14061
|
static getSettablePaths(_options = {}) {
|
|
@@ -13944,7 +14098,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
13944
14098
|
validate = true
|
|
13945
14099
|
}) {
|
|
13946
14100
|
const fileContent = await readFileContent(
|
|
13947
|
-
(0,
|
|
14101
|
+
(0, import_node_path102.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
13948
14102
|
);
|
|
13949
14103
|
return new _ClineRule({
|
|
13950
14104
|
baseDir,
|
|
@@ -13970,7 +14124,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
13970
14124
|
};
|
|
13971
14125
|
|
|
13972
14126
|
// src/features/rules/codexcli-rule.ts
|
|
13973
|
-
var
|
|
14127
|
+
var import_node_path103 = require("path");
|
|
13974
14128
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
13975
14129
|
static getSettablePaths({
|
|
13976
14130
|
global,
|
|
@@ -14005,7 +14159,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
14005
14159
|
if (isRoot) {
|
|
14006
14160
|
const relativePath2 = paths.root.relativeFilePath;
|
|
14007
14161
|
const fileContent2 = await readFileContent(
|
|
14008
|
-
(0,
|
|
14162
|
+
(0, import_node_path103.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
14009
14163
|
);
|
|
14010
14164
|
return new _CodexcliRule({
|
|
14011
14165
|
baseDir,
|
|
@@ -14019,8 +14173,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
14019
14173
|
if (!paths.nonRoot) {
|
|
14020
14174
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
14021
14175
|
}
|
|
14022
|
-
const relativePath = (0,
|
|
14023
|
-
const fileContent = await readFileContent((0,
|
|
14176
|
+
const relativePath = (0, import_node_path103.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14177
|
+
const fileContent = await readFileContent((0, import_node_path103.join)(baseDir, relativePath));
|
|
14024
14178
|
return new _CodexcliRule({
|
|
14025
14179
|
baseDir,
|
|
14026
14180
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -14079,12 +14233,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
14079
14233
|
};
|
|
14080
14234
|
|
|
14081
14235
|
// src/features/rules/copilot-rule.ts
|
|
14082
|
-
var
|
|
14083
|
-
var
|
|
14084
|
-
var CopilotRuleFrontmatterSchema =
|
|
14085
|
-
description:
|
|
14086
|
-
applyTo:
|
|
14087
|
-
excludeAgent:
|
|
14236
|
+
var import_node_path104 = require("path");
|
|
14237
|
+
var import_mini55 = require("zod/mini");
|
|
14238
|
+
var CopilotRuleFrontmatterSchema = import_mini55.z.object({
|
|
14239
|
+
description: import_mini55.z.optional(import_mini55.z.string()),
|
|
14240
|
+
applyTo: import_mini55.z.optional(import_mini55.z.string()),
|
|
14241
|
+
excludeAgent: import_mini55.z.optional(import_mini55.z.union([import_mini55.z.literal("code-review"), import_mini55.z.literal("coding-agent")]))
|
|
14088
14242
|
});
|
|
14089
14243
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
14090
14244
|
frontmatter;
|
|
@@ -14116,7 +14270,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
14116
14270
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
14117
14271
|
if (!result.success) {
|
|
14118
14272
|
throw new Error(
|
|
14119
|
-
`Invalid frontmatter in ${(0,
|
|
14273
|
+
`Invalid frontmatter in ${(0, import_node_path104.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14120
14274
|
);
|
|
14121
14275
|
}
|
|
14122
14276
|
}
|
|
@@ -14206,8 +14360,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
14206
14360
|
const paths = this.getSettablePaths({ global });
|
|
14207
14361
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
14208
14362
|
if (isRoot) {
|
|
14209
|
-
const relativePath2 = (0,
|
|
14210
|
-
const filePath2 = (0,
|
|
14363
|
+
const relativePath2 = (0, import_node_path104.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
14364
|
+
const filePath2 = (0, import_node_path104.join)(baseDir, relativePath2);
|
|
14211
14365
|
const fileContent2 = await readFileContent(filePath2);
|
|
14212
14366
|
return new _CopilotRule({
|
|
14213
14367
|
baseDir,
|
|
@@ -14222,8 +14376,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
14222
14376
|
if (!paths.nonRoot) {
|
|
14223
14377
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
14224
14378
|
}
|
|
14225
|
-
const relativePath = (0,
|
|
14226
|
-
const filePath = (0,
|
|
14379
|
+
const relativePath = (0, import_node_path104.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14380
|
+
const filePath = (0, import_node_path104.join)(baseDir, relativePath);
|
|
14227
14381
|
const fileContent = await readFileContent(filePath);
|
|
14228
14382
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14229
14383
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14269,7 +14423,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
14269
14423
|
return {
|
|
14270
14424
|
success: false,
|
|
14271
14425
|
error: new Error(
|
|
14272
|
-
`Invalid frontmatter in ${(0,
|
|
14426
|
+
`Invalid frontmatter in ${(0, import_node_path104.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14273
14427
|
)
|
|
14274
14428
|
};
|
|
14275
14429
|
}
|
|
@@ -14289,12 +14443,12 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
14289
14443
|
};
|
|
14290
14444
|
|
|
14291
14445
|
// src/features/rules/cursor-rule.ts
|
|
14292
|
-
var
|
|
14293
|
-
var
|
|
14294
|
-
var CursorRuleFrontmatterSchema =
|
|
14295
|
-
description:
|
|
14296
|
-
globs:
|
|
14297
|
-
alwaysApply:
|
|
14446
|
+
var import_node_path105 = require("path");
|
|
14447
|
+
var import_mini56 = require("zod/mini");
|
|
14448
|
+
var CursorRuleFrontmatterSchema = import_mini56.z.object({
|
|
14449
|
+
description: import_mini56.z.optional(import_mini56.z.string()),
|
|
14450
|
+
globs: import_mini56.z.optional(import_mini56.z.string()),
|
|
14451
|
+
alwaysApply: import_mini56.z.optional(import_mini56.z.boolean())
|
|
14298
14452
|
});
|
|
14299
14453
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
14300
14454
|
frontmatter;
|
|
@@ -14311,7 +14465,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
14311
14465
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
14312
14466
|
if (!result.success) {
|
|
14313
14467
|
throw new Error(
|
|
14314
|
-
`Invalid frontmatter in ${(0,
|
|
14468
|
+
`Invalid frontmatter in ${(0, import_node_path105.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14315
14469
|
);
|
|
14316
14470
|
}
|
|
14317
14471
|
}
|
|
@@ -14427,7 +14581,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
14427
14581
|
relativeFilePath,
|
|
14428
14582
|
validate = true
|
|
14429
14583
|
}) {
|
|
14430
|
-
const filePath = (0,
|
|
14584
|
+
const filePath = (0, import_node_path105.join)(
|
|
14431
14585
|
baseDir,
|
|
14432
14586
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
14433
14587
|
relativeFilePath
|
|
@@ -14437,7 +14591,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
14437
14591
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
14438
14592
|
if (!result.success) {
|
|
14439
14593
|
throw new Error(
|
|
14440
|
-
`Invalid frontmatter in ${(0,
|
|
14594
|
+
`Invalid frontmatter in ${(0, import_node_path105.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
14441
14595
|
);
|
|
14442
14596
|
}
|
|
14443
14597
|
return new _CursorRule({
|
|
@@ -14474,7 +14628,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
14474
14628
|
return {
|
|
14475
14629
|
success: false,
|
|
14476
14630
|
error: new Error(
|
|
14477
|
-
`Invalid frontmatter in ${(0,
|
|
14631
|
+
`Invalid frontmatter in ${(0, import_node_path105.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14478
14632
|
)
|
|
14479
14633
|
};
|
|
14480
14634
|
}
|
|
@@ -14494,7 +14648,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
14494
14648
|
};
|
|
14495
14649
|
|
|
14496
14650
|
// src/features/rules/factorydroid-rule.ts
|
|
14497
|
-
var
|
|
14651
|
+
var import_node_path106 = require("path");
|
|
14498
14652
|
var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
14499
14653
|
constructor({ fileContent, root, ...rest }) {
|
|
14500
14654
|
super({
|
|
@@ -14534,8 +14688,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
14534
14688
|
const paths = this.getSettablePaths({ global });
|
|
14535
14689
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
14536
14690
|
if (isRoot) {
|
|
14537
|
-
const relativePath2 = (0,
|
|
14538
|
-
const fileContent2 = await readFileContent((0,
|
|
14691
|
+
const relativePath2 = (0, import_node_path106.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
14692
|
+
const fileContent2 = await readFileContent((0, import_node_path106.join)(baseDir, relativePath2));
|
|
14539
14693
|
return new _FactorydroidRule({
|
|
14540
14694
|
baseDir,
|
|
14541
14695
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -14548,8 +14702,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
14548
14702
|
if (!paths.nonRoot) {
|
|
14549
14703
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
14550
14704
|
}
|
|
14551
|
-
const relativePath = (0,
|
|
14552
|
-
const fileContent = await readFileContent((0,
|
|
14705
|
+
const relativePath = (0, import_node_path106.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14706
|
+
const fileContent = await readFileContent((0, import_node_path106.join)(baseDir, relativePath));
|
|
14553
14707
|
return new _FactorydroidRule({
|
|
14554
14708
|
baseDir,
|
|
14555
14709
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -14608,7 +14762,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
14608
14762
|
};
|
|
14609
14763
|
|
|
14610
14764
|
// src/features/rules/geminicli-rule.ts
|
|
14611
|
-
var
|
|
14765
|
+
var import_node_path107 = require("path");
|
|
14612
14766
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
14613
14767
|
static getSettablePaths({
|
|
14614
14768
|
global,
|
|
@@ -14643,7 +14797,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
14643
14797
|
if (isRoot) {
|
|
14644
14798
|
const relativePath2 = paths.root.relativeFilePath;
|
|
14645
14799
|
const fileContent2 = await readFileContent(
|
|
14646
|
-
(0,
|
|
14800
|
+
(0, import_node_path107.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
14647
14801
|
);
|
|
14648
14802
|
return new _GeminiCliRule({
|
|
14649
14803
|
baseDir,
|
|
@@ -14657,8 +14811,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
14657
14811
|
if (!paths.nonRoot) {
|
|
14658
14812
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
14659
14813
|
}
|
|
14660
|
-
const relativePath = (0,
|
|
14661
|
-
const fileContent = await readFileContent((0,
|
|
14814
|
+
const relativePath = (0, import_node_path107.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14815
|
+
const fileContent = await readFileContent((0, import_node_path107.join)(baseDir, relativePath));
|
|
14662
14816
|
return new _GeminiCliRule({
|
|
14663
14817
|
baseDir,
|
|
14664
14818
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -14717,7 +14871,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
14717
14871
|
};
|
|
14718
14872
|
|
|
14719
14873
|
// src/features/rules/goose-rule.ts
|
|
14720
|
-
var
|
|
14874
|
+
var import_node_path108 = require("path");
|
|
14721
14875
|
var GooseRule = class _GooseRule extends ToolRule {
|
|
14722
14876
|
static getSettablePaths({
|
|
14723
14877
|
global,
|
|
@@ -14752,7 +14906,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
14752
14906
|
if (isRoot) {
|
|
14753
14907
|
const relativePath2 = paths.root.relativeFilePath;
|
|
14754
14908
|
const fileContent2 = await readFileContent(
|
|
14755
|
-
(0,
|
|
14909
|
+
(0, import_node_path108.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
14756
14910
|
);
|
|
14757
14911
|
return new _GooseRule({
|
|
14758
14912
|
baseDir,
|
|
@@ -14766,8 +14920,8 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
14766
14920
|
if (!paths.nonRoot) {
|
|
14767
14921
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
14768
14922
|
}
|
|
14769
|
-
const relativePath = (0,
|
|
14770
|
-
const fileContent = await readFileContent((0,
|
|
14923
|
+
const relativePath = (0, import_node_path108.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14924
|
+
const fileContent = await readFileContent((0, import_node_path108.join)(baseDir, relativePath));
|
|
14771
14925
|
return new _GooseRule({
|
|
14772
14926
|
baseDir,
|
|
14773
14927
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -14826,7 +14980,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
14826
14980
|
};
|
|
14827
14981
|
|
|
14828
14982
|
// src/features/rules/junie-rule.ts
|
|
14829
|
-
var
|
|
14983
|
+
var import_node_path109 = require("path");
|
|
14830
14984
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
14831
14985
|
static getSettablePaths(_options = {}) {
|
|
14832
14986
|
return {
|
|
@@ -14845,8 +14999,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
14845
14999
|
validate = true
|
|
14846
15000
|
}) {
|
|
14847
15001
|
const isRoot = relativeFilePath === "guidelines.md";
|
|
14848
|
-
const relativePath = isRoot ? "guidelines.md" : (0,
|
|
14849
|
-
const fileContent = await readFileContent((0,
|
|
15002
|
+
const relativePath = isRoot ? "guidelines.md" : (0, import_node_path109.join)(".junie", "memories", relativeFilePath);
|
|
15003
|
+
const fileContent = await readFileContent((0, import_node_path109.join)(baseDir, relativePath));
|
|
14850
15004
|
return new _JunieRule({
|
|
14851
15005
|
baseDir,
|
|
14852
15006
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -14901,7 +15055,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
14901
15055
|
};
|
|
14902
15056
|
|
|
14903
15057
|
// src/features/rules/kilo-rule.ts
|
|
14904
|
-
var
|
|
15058
|
+
var import_node_path110 = require("path");
|
|
14905
15059
|
var KiloRule = class _KiloRule extends ToolRule {
|
|
14906
15060
|
static getSettablePaths(_options = {}) {
|
|
14907
15061
|
return {
|
|
@@ -14916,7 +15070,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
14916
15070
|
validate = true
|
|
14917
15071
|
}) {
|
|
14918
15072
|
const fileContent = await readFileContent(
|
|
14919
|
-
(0,
|
|
15073
|
+
(0, import_node_path110.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
14920
15074
|
);
|
|
14921
15075
|
return new _KiloRule({
|
|
14922
15076
|
baseDir,
|
|
@@ -14968,7 +15122,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
14968
15122
|
};
|
|
14969
15123
|
|
|
14970
15124
|
// src/features/rules/kiro-rule.ts
|
|
14971
|
-
var
|
|
15125
|
+
var import_node_path111 = require("path");
|
|
14972
15126
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
14973
15127
|
static getSettablePaths(_options = {}) {
|
|
14974
15128
|
return {
|
|
@@ -14983,7 +15137,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
14983
15137
|
validate = true
|
|
14984
15138
|
}) {
|
|
14985
15139
|
const fileContent = await readFileContent(
|
|
14986
|
-
(0,
|
|
15140
|
+
(0, import_node_path111.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
14987
15141
|
);
|
|
14988
15142
|
return new _KiroRule({
|
|
14989
15143
|
baseDir,
|
|
@@ -15037,7 +15191,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
15037
15191
|
};
|
|
15038
15192
|
|
|
15039
15193
|
// src/features/rules/opencode-rule.ts
|
|
15040
|
-
var
|
|
15194
|
+
var import_node_path112 = require("path");
|
|
15041
15195
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
15042
15196
|
static getSettablePaths({
|
|
15043
15197
|
global,
|
|
@@ -15072,7 +15226,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
15072
15226
|
if (isRoot) {
|
|
15073
15227
|
const relativePath2 = paths.root.relativeFilePath;
|
|
15074
15228
|
const fileContent2 = await readFileContent(
|
|
15075
|
-
(0,
|
|
15229
|
+
(0, import_node_path112.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
15076
15230
|
);
|
|
15077
15231
|
return new _OpenCodeRule({
|
|
15078
15232
|
baseDir,
|
|
@@ -15086,8 +15240,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
15086
15240
|
if (!paths.nonRoot) {
|
|
15087
15241
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
15088
15242
|
}
|
|
15089
|
-
const relativePath = (0,
|
|
15090
|
-
const fileContent = await readFileContent((0,
|
|
15243
|
+
const relativePath = (0, import_node_path112.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
15244
|
+
const fileContent = await readFileContent((0, import_node_path112.join)(baseDir, relativePath));
|
|
15091
15245
|
return new _OpenCodeRule({
|
|
15092
15246
|
baseDir,
|
|
15093
15247
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -15146,7 +15300,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
15146
15300
|
};
|
|
15147
15301
|
|
|
15148
15302
|
// src/features/rules/qwencode-rule.ts
|
|
15149
|
-
var
|
|
15303
|
+
var import_node_path113 = require("path");
|
|
15150
15304
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
15151
15305
|
static getSettablePaths(_options = {}) {
|
|
15152
15306
|
return {
|
|
@@ -15165,8 +15319,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
15165
15319
|
validate = true
|
|
15166
15320
|
}) {
|
|
15167
15321
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
15168
|
-
const relativePath = isRoot ? "QWEN.md" : (0,
|
|
15169
|
-
const fileContent = await readFileContent((0,
|
|
15322
|
+
const relativePath = isRoot ? "QWEN.md" : (0, import_node_path113.join)(".qwen", "memories", relativeFilePath);
|
|
15323
|
+
const fileContent = await readFileContent((0, import_node_path113.join)(baseDir, relativePath));
|
|
15170
15324
|
return new _QwencodeRule({
|
|
15171
15325
|
baseDir,
|
|
15172
15326
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -15218,7 +15372,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
15218
15372
|
};
|
|
15219
15373
|
|
|
15220
15374
|
// src/features/rules/replit-rule.ts
|
|
15221
|
-
var
|
|
15375
|
+
var import_node_path114 = require("path");
|
|
15222
15376
|
var ReplitRule = class _ReplitRule extends ToolRule {
|
|
15223
15377
|
static getSettablePaths(_options = {}) {
|
|
15224
15378
|
return {
|
|
@@ -15240,7 +15394,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
15240
15394
|
}
|
|
15241
15395
|
const relativePath = paths.root.relativeFilePath;
|
|
15242
15396
|
const fileContent = await readFileContent(
|
|
15243
|
-
(0,
|
|
15397
|
+
(0, import_node_path114.join)(baseDir, paths.root.relativeDirPath, relativePath)
|
|
15244
15398
|
);
|
|
15245
15399
|
return new _ReplitRule({
|
|
15246
15400
|
baseDir,
|
|
@@ -15306,7 +15460,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
15306
15460
|
};
|
|
15307
15461
|
|
|
15308
15462
|
// src/features/rules/roo-rule.ts
|
|
15309
|
-
var
|
|
15463
|
+
var import_node_path115 = require("path");
|
|
15310
15464
|
var RooRule = class _RooRule extends ToolRule {
|
|
15311
15465
|
static getSettablePaths(_options = {}) {
|
|
15312
15466
|
return {
|
|
@@ -15321,7 +15475,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
15321
15475
|
validate = true
|
|
15322
15476
|
}) {
|
|
15323
15477
|
const fileContent = await readFileContent(
|
|
15324
|
-
(0,
|
|
15478
|
+
(0, import_node_path115.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
15325
15479
|
);
|
|
15326
15480
|
return new _RooRule({
|
|
15327
15481
|
baseDir,
|
|
@@ -15390,7 +15544,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
15390
15544
|
};
|
|
15391
15545
|
|
|
15392
15546
|
// src/features/rules/warp-rule.ts
|
|
15393
|
-
var
|
|
15547
|
+
var import_node_path116 = require("path");
|
|
15394
15548
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
15395
15549
|
constructor({ fileContent, root, ...rest }) {
|
|
15396
15550
|
super({
|
|
@@ -15416,8 +15570,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
15416
15570
|
validate = true
|
|
15417
15571
|
}) {
|
|
15418
15572
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
15419
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0,
|
|
15420
|
-
const fileContent = await readFileContent((0,
|
|
15573
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path116.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
15574
|
+
const fileContent = await readFileContent((0, import_node_path116.join)(baseDir, relativePath));
|
|
15421
15575
|
return new _WarpRule({
|
|
15422
15576
|
baseDir,
|
|
15423
15577
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -15472,7 +15626,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
15472
15626
|
};
|
|
15473
15627
|
|
|
15474
15628
|
// src/features/rules/windsurf-rule.ts
|
|
15475
|
-
var
|
|
15629
|
+
var import_node_path117 = require("path");
|
|
15476
15630
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
15477
15631
|
static getSettablePaths(_options = {}) {
|
|
15478
15632
|
return {
|
|
@@ -15487,7 +15641,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
15487
15641
|
validate = true
|
|
15488
15642
|
}) {
|
|
15489
15643
|
const fileContent = await readFileContent(
|
|
15490
|
-
(0,
|
|
15644
|
+
(0, import_node_path117.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
15491
15645
|
);
|
|
15492
15646
|
return new _WindsurfRule({
|
|
15493
15647
|
baseDir,
|
|
@@ -15563,8 +15717,8 @@ var rulesProcessorToolTargets = [
|
|
|
15563
15717
|
"warp",
|
|
15564
15718
|
"windsurf"
|
|
15565
15719
|
];
|
|
15566
|
-
var RulesProcessorToolTargetSchema =
|
|
15567
|
-
var formatRulePaths = (rules) => rules.map((r) => (0,
|
|
15720
|
+
var RulesProcessorToolTargetSchema = import_mini57.z.enum(rulesProcessorToolTargets);
|
|
15721
|
+
var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path118.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
|
|
15568
15722
|
var toolRuleFactories = /* @__PURE__ */ new Map([
|
|
15569
15723
|
[
|
|
15570
15724
|
"agentsmd",
|
|
@@ -15939,7 +16093,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
15939
16093
|
}).relativeDirPath;
|
|
15940
16094
|
return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
|
|
15941
16095
|
const frontmatter = skill.getFrontmatter();
|
|
15942
|
-
const relativePath = (0,
|
|
16096
|
+
const relativePath = (0, import_node_path118.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
|
|
15943
16097
|
return {
|
|
15944
16098
|
name: frontmatter.name,
|
|
15945
16099
|
description: frontmatter.description,
|
|
@@ -16052,12 +16206,12 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
16052
16206
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
16053
16207
|
*/
|
|
16054
16208
|
async loadRulesyncFiles() {
|
|
16055
|
-
const rulesyncBaseDir = (0,
|
|
16056
|
-
const files = await findFilesByGlobs((0,
|
|
16209
|
+
const rulesyncBaseDir = (0, import_node_path118.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
16210
|
+
const files = await findFilesByGlobs((0, import_node_path118.join)(rulesyncBaseDir, "**", "*.md"));
|
|
16057
16211
|
logger.debug(`Found ${files.length} rulesync files`);
|
|
16058
16212
|
const rulesyncRules = await Promise.all(
|
|
16059
16213
|
files.map((file) => {
|
|
16060
|
-
const relativeFilePath = (0,
|
|
16214
|
+
const relativeFilePath = (0, import_node_path118.relative)(rulesyncBaseDir, file);
|
|
16061
16215
|
checkPathTraversal({
|
|
16062
16216
|
relativePath: relativeFilePath,
|
|
16063
16217
|
intendedRootDir: rulesyncBaseDir
|
|
@@ -16132,7 +16286,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
16132
16286
|
global: this.global
|
|
16133
16287
|
});
|
|
16134
16288
|
const resolveRelativeDirPath = (filePath) => {
|
|
16135
|
-
const dirName = (0,
|
|
16289
|
+
const dirName = (0, import_node_path118.dirname)((0, import_node_path118.relative)(this.baseDir, filePath));
|
|
16136
16290
|
return dirName === "" ? "." : dirName;
|
|
16137
16291
|
};
|
|
16138
16292
|
const findFilesWithFallback = async (primaryGlob, alternativeRoots, buildAltGlob) => {
|
|
@@ -16150,13 +16304,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
16150
16304
|
return [];
|
|
16151
16305
|
}
|
|
16152
16306
|
const uniqueRootFilePaths = await findFilesWithFallback(
|
|
16153
|
-
(0,
|
|
16307
|
+
(0, import_node_path118.join)(
|
|
16154
16308
|
this.baseDir,
|
|
16155
16309
|
settablePaths.root.relativeDirPath ?? ".",
|
|
16156
16310
|
settablePaths.root.relativeFilePath
|
|
16157
16311
|
),
|
|
16158
16312
|
settablePaths.alternativeRoots,
|
|
16159
|
-
(alt) => (0,
|
|
16313
|
+
(alt) => (0, import_node_path118.join)(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
|
|
16160
16314
|
);
|
|
16161
16315
|
if (forDeletion) {
|
|
16162
16316
|
return uniqueRootFilePaths.map((filePath) => {
|
|
@@ -16168,7 +16322,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
16168
16322
|
return factory.class.forDeletion({
|
|
16169
16323
|
baseDir: this.baseDir,
|
|
16170
16324
|
relativeDirPath,
|
|
16171
|
-
relativeFilePath: (0,
|
|
16325
|
+
relativeFilePath: (0, import_node_path118.basename)(filePath),
|
|
16172
16326
|
global: this.global
|
|
16173
16327
|
});
|
|
16174
16328
|
}).filter((rule) => rule.isDeletable());
|
|
@@ -16182,7 +16336,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
16182
16336
|
});
|
|
16183
16337
|
return factory.class.fromFile({
|
|
16184
16338
|
baseDir: this.baseDir,
|
|
16185
|
-
relativeFilePath: (0,
|
|
16339
|
+
relativeFilePath: (0, import_node_path118.basename)(filePath),
|
|
16186
16340
|
relativeDirPath,
|
|
16187
16341
|
global: this.global
|
|
16188
16342
|
});
|
|
@@ -16201,9 +16355,9 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
16201
16355
|
return [];
|
|
16202
16356
|
}
|
|
16203
16357
|
const uniqueLocalRootFilePaths = await findFilesWithFallback(
|
|
16204
|
-
(0,
|
|
16358
|
+
(0, import_node_path118.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
|
|
16205
16359
|
settablePaths.alternativeRoots,
|
|
16206
|
-
(alt) => (0,
|
|
16360
|
+
(alt) => (0, import_node_path118.join)(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
|
|
16207
16361
|
);
|
|
16208
16362
|
return uniqueLocalRootFilePaths.map((filePath) => {
|
|
16209
16363
|
const relativeDirPath = resolveRelativeDirPath(filePath);
|
|
@@ -16214,7 +16368,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
16214
16368
|
return factory.class.forDeletion({
|
|
16215
16369
|
baseDir: this.baseDir,
|
|
16216
16370
|
relativeDirPath,
|
|
16217
|
-
relativeFilePath: (0,
|
|
16371
|
+
relativeFilePath: (0, import_node_path118.basename)(filePath),
|
|
16218
16372
|
global: this.global
|
|
16219
16373
|
});
|
|
16220
16374
|
}).filter((rule) => rule.isDeletable());
|
|
@@ -16224,13 +16378,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
16224
16378
|
if (!settablePaths.nonRoot) {
|
|
16225
16379
|
return [];
|
|
16226
16380
|
}
|
|
16227
|
-
const nonRootBaseDir = (0,
|
|
16381
|
+
const nonRootBaseDir = (0, import_node_path118.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
|
|
16228
16382
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
16229
|
-
(0,
|
|
16383
|
+
(0, import_node_path118.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
|
|
16230
16384
|
);
|
|
16231
16385
|
if (forDeletion) {
|
|
16232
16386
|
return nonRootFilePaths.map((filePath) => {
|
|
16233
|
-
const relativeFilePath = (0,
|
|
16387
|
+
const relativeFilePath = (0, import_node_path118.relative)(nonRootBaseDir, filePath);
|
|
16234
16388
|
checkPathTraversal({
|
|
16235
16389
|
relativePath: relativeFilePath,
|
|
16236
16390
|
intendedRootDir: nonRootBaseDir
|
|
@@ -16245,7 +16399,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
16245
16399
|
}
|
|
16246
16400
|
return await Promise.all(
|
|
16247
16401
|
nonRootFilePaths.map((filePath) => {
|
|
16248
|
-
const relativeFilePath = (0,
|
|
16402
|
+
const relativeFilePath = (0, import_node_path118.relative)(nonRootBaseDir, filePath);
|
|
16249
16403
|
checkPathTraversal({
|
|
16250
16404
|
relativePath: relativeFilePath,
|
|
16251
16405
|
intendedRootDir: nonRootBaseDir
|
|
@@ -16358,14 +16512,14 @@ s/<command> [arguments]
|
|
|
16358
16512
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
16359
16513
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
16360
16514
|
|
|
16361
|
-
When users call a custom slash command, you have to look for the markdown file, \`${(0,
|
|
16515
|
+
When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path118.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
16362
16516
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
16363
16517
|
|
|
16364
16518
|
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.
|
|
16365
16519
|
|
|
16366
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0,
|
|
16520
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path118.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
16367
16521
|
|
|
16368
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0,
|
|
16522
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path118.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
16369
16523
|
const skillsSection = skills ? this.generateSkillsSection(skills) : "";
|
|
16370
16524
|
const result = [
|
|
16371
16525
|
overview,
|
|
@@ -16445,7 +16599,7 @@ function warnUnsupportedTargets(params) {
|
|
|
16445
16599
|
}
|
|
16446
16600
|
}
|
|
16447
16601
|
async function checkRulesyncDirExists(params) {
|
|
16448
|
-
return fileExists((0,
|
|
16602
|
+
return fileExists((0, import_node_path119.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
|
|
16449
16603
|
}
|
|
16450
16604
|
async function generate(params) {
|
|
16451
16605
|
const { config } = params;
|