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
|
@@ -665,12 +665,12 @@ function getBaseDirsInLightOfGlobal({
|
|
|
665
665
|
}
|
|
666
666
|
|
|
667
667
|
// src/lib/generate.ts
|
|
668
|
-
import { join as
|
|
668
|
+
import { join as join117 } from "path";
|
|
669
669
|
import { intersection } from "es-toolkit";
|
|
670
670
|
|
|
671
671
|
// src/features/commands/commands-processor.ts
|
|
672
|
-
import { basename as basename2, join as
|
|
673
|
-
import { z as
|
|
672
|
+
import { basename as basename2, join as join20, relative as relative3 } from "path";
|
|
673
|
+
import { z as z14 } from "zod/mini";
|
|
674
674
|
|
|
675
675
|
// src/types/feature-processor.ts
|
|
676
676
|
var FeatureProcessor = class {
|
|
@@ -2269,12 +2269,152 @@ prompt = ""`;
|
|
|
2269
2269
|
}
|
|
2270
2270
|
};
|
|
2271
2271
|
|
|
2272
|
-
// src/features/commands/
|
|
2272
|
+
// src/features/commands/junie-command.ts
|
|
2273
2273
|
import { join as join15 } from "path";
|
|
2274
|
+
import { z as z11 } from "zod/mini";
|
|
2275
|
+
var JunieCommandFrontmatterSchema = z11.looseObject({
|
|
2276
|
+
description: z11.optional(z11.string())
|
|
2277
|
+
});
|
|
2278
|
+
var JunieCommand = class _JunieCommand extends ToolCommand {
|
|
2279
|
+
frontmatter;
|
|
2280
|
+
body;
|
|
2281
|
+
constructor({ frontmatter, body, ...rest }) {
|
|
2282
|
+
if (rest.validate) {
|
|
2283
|
+
const result = JunieCommandFrontmatterSchema.safeParse(frontmatter);
|
|
2284
|
+
if (!result.success) {
|
|
2285
|
+
throw new Error(
|
|
2286
|
+
`Invalid frontmatter in ${join15(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
2287
|
+
);
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
super({
|
|
2291
|
+
...rest,
|
|
2292
|
+
fileContent: stringifyFrontmatter(body, frontmatter)
|
|
2293
|
+
});
|
|
2294
|
+
this.frontmatter = frontmatter;
|
|
2295
|
+
this.body = body;
|
|
2296
|
+
}
|
|
2297
|
+
static getSettablePaths(_options = {}) {
|
|
2298
|
+
return {
|
|
2299
|
+
relativeDirPath: join15(".junie", "commands")
|
|
2300
|
+
};
|
|
2301
|
+
}
|
|
2302
|
+
getBody() {
|
|
2303
|
+
return this.body;
|
|
2304
|
+
}
|
|
2305
|
+
getFrontmatter() {
|
|
2306
|
+
return this.frontmatter;
|
|
2307
|
+
}
|
|
2308
|
+
toRulesyncCommand() {
|
|
2309
|
+
const { description, ...restFields } = this.frontmatter;
|
|
2310
|
+
const rulesyncFrontmatter = {
|
|
2311
|
+
targets: ["*"],
|
|
2312
|
+
description,
|
|
2313
|
+
// Preserve extra fields in junie section
|
|
2314
|
+
...Object.keys(restFields).length > 0 && { junie: restFields }
|
|
2315
|
+
};
|
|
2316
|
+
const fileContent = stringifyFrontmatter(this.body, rulesyncFrontmatter);
|
|
2317
|
+
return new RulesyncCommand({
|
|
2318
|
+
baseDir: process.cwd(),
|
|
2319
|
+
// RulesyncCommand baseDir is always the project root directory
|
|
2320
|
+
frontmatter: rulesyncFrontmatter,
|
|
2321
|
+
body: this.body,
|
|
2322
|
+
relativeDirPath: RulesyncCommand.getSettablePaths().relativeDirPath,
|
|
2323
|
+
relativeFilePath: this.relativeFilePath,
|
|
2324
|
+
fileContent,
|
|
2325
|
+
validate: true
|
|
2326
|
+
});
|
|
2327
|
+
}
|
|
2328
|
+
static fromRulesyncCommand({
|
|
2329
|
+
baseDir = process.cwd(),
|
|
2330
|
+
rulesyncCommand,
|
|
2331
|
+
validate = true,
|
|
2332
|
+
global = false
|
|
2333
|
+
}) {
|
|
2334
|
+
const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
|
|
2335
|
+
const junieFields = rulesyncFrontmatter.junie ?? {};
|
|
2336
|
+
const junieFrontmatter = {
|
|
2337
|
+
description: rulesyncFrontmatter.description,
|
|
2338
|
+
...junieFields
|
|
2339
|
+
};
|
|
2340
|
+
const body = rulesyncCommand.getBody();
|
|
2341
|
+
const paths = this.getSettablePaths({ global });
|
|
2342
|
+
return new _JunieCommand({
|
|
2343
|
+
baseDir,
|
|
2344
|
+
frontmatter: junieFrontmatter,
|
|
2345
|
+
body,
|
|
2346
|
+
relativeDirPath: paths.relativeDirPath,
|
|
2347
|
+
relativeFilePath: rulesyncCommand.getRelativeFilePath(),
|
|
2348
|
+
validate
|
|
2349
|
+
});
|
|
2350
|
+
}
|
|
2351
|
+
validate() {
|
|
2352
|
+
if (!this.frontmatter) {
|
|
2353
|
+
return { success: true, error: null };
|
|
2354
|
+
}
|
|
2355
|
+
const result = JunieCommandFrontmatterSchema.safeParse(this.frontmatter);
|
|
2356
|
+
if (result.success) {
|
|
2357
|
+
return { success: true, error: null };
|
|
2358
|
+
} else {
|
|
2359
|
+
return {
|
|
2360
|
+
success: false,
|
|
2361
|
+
error: new Error(
|
|
2362
|
+
`Invalid frontmatter in ${join15(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
2363
|
+
)
|
|
2364
|
+
};
|
|
2365
|
+
}
|
|
2366
|
+
}
|
|
2367
|
+
static isTargetedByRulesyncCommand(rulesyncCommand) {
|
|
2368
|
+
return this.isTargetedByRulesyncCommandDefault({
|
|
2369
|
+
rulesyncCommand,
|
|
2370
|
+
toolTarget: "junie"
|
|
2371
|
+
});
|
|
2372
|
+
}
|
|
2373
|
+
static async fromFile({
|
|
2374
|
+
baseDir = process.cwd(),
|
|
2375
|
+
relativeFilePath,
|
|
2376
|
+
validate = true,
|
|
2377
|
+
global = false
|
|
2378
|
+
}) {
|
|
2379
|
+
const paths = this.getSettablePaths({ global });
|
|
2380
|
+
const filePath = join15(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
2381
|
+
const fileContent = await readFileContent(filePath);
|
|
2382
|
+
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
2383
|
+
const result = JunieCommandFrontmatterSchema.safeParse(frontmatter);
|
|
2384
|
+
if (!result.success) {
|
|
2385
|
+
throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
|
|
2386
|
+
}
|
|
2387
|
+
return new _JunieCommand({
|
|
2388
|
+
baseDir,
|
|
2389
|
+
relativeDirPath: paths.relativeDirPath,
|
|
2390
|
+
relativeFilePath,
|
|
2391
|
+
frontmatter: result.data,
|
|
2392
|
+
body: content.trim(),
|
|
2393
|
+
validate
|
|
2394
|
+
});
|
|
2395
|
+
}
|
|
2396
|
+
static forDeletion({
|
|
2397
|
+
baseDir = process.cwd(),
|
|
2398
|
+
relativeDirPath,
|
|
2399
|
+
relativeFilePath
|
|
2400
|
+
}) {
|
|
2401
|
+
return new _JunieCommand({
|
|
2402
|
+
baseDir,
|
|
2403
|
+
relativeDirPath,
|
|
2404
|
+
relativeFilePath,
|
|
2405
|
+
frontmatter: { description: "" },
|
|
2406
|
+
body: "",
|
|
2407
|
+
validate: false
|
|
2408
|
+
});
|
|
2409
|
+
}
|
|
2410
|
+
};
|
|
2411
|
+
|
|
2412
|
+
// src/features/commands/kilo-command.ts
|
|
2413
|
+
import { join as join16 } from "path";
|
|
2274
2414
|
var KiloCommand = class _KiloCommand extends ToolCommand {
|
|
2275
2415
|
static getSettablePaths(_options = {}) {
|
|
2276
2416
|
return {
|
|
2277
|
-
relativeDirPath:
|
|
2417
|
+
relativeDirPath: join16(".kilocode", "workflows")
|
|
2278
2418
|
};
|
|
2279
2419
|
}
|
|
2280
2420
|
toRulesyncCommand() {
|
|
@@ -2323,7 +2463,7 @@ var KiloCommand = class _KiloCommand extends ToolCommand {
|
|
|
2323
2463
|
validate = true
|
|
2324
2464
|
}) {
|
|
2325
2465
|
const paths = this.getSettablePaths();
|
|
2326
|
-
const filePath =
|
|
2466
|
+
const filePath = join16(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
2327
2467
|
const fileContent = await readFileContent(filePath);
|
|
2328
2468
|
const { body: content } = parseFrontmatter(fileContent, filePath);
|
|
2329
2469
|
return new _KiloCommand({
|
|
@@ -2350,11 +2490,11 @@ var KiloCommand = class _KiloCommand extends ToolCommand {
|
|
|
2350
2490
|
};
|
|
2351
2491
|
|
|
2352
2492
|
// src/features/commands/kiro-command.ts
|
|
2353
|
-
import { join as
|
|
2493
|
+
import { join as join17 } from "path";
|
|
2354
2494
|
var KiroCommand = class _KiroCommand extends ToolCommand {
|
|
2355
2495
|
static getSettablePaths(_options = {}) {
|
|
2356
2496
|
return {
|
|
2357
|
-
relativeDirPath:
|
|
2497
|
+
relativeDirPath: join17(".kiro", "prompts")
|
|
2358
2498
|
};
|
|
2359
2499
|
}
|
|
2360
2500
|
toRulesyncCommand() {
|
|
@@ -2403,7 +2543,7 @@ var KiroCommand = class _KiroCommand extends ToolCommand {
|
|
|
2403
2543
|
validate = true
|
|
2404
2544
|
}) {
|
|
2405
2545
|
const paths = this.getSettablePaths();
|
|
2406
|
-
const filePath =
|
|
2546
|
+
const filePath = join17(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
2407
2547
|
const fileContent = await readFileContent(filePath);
|
|
2408
2548
|
const { body: content } = parseFrontmatter(fileContent, filePath);
|
|
2409
2549
|
return new _KiroCommand({
|
|
@@ -2430,13 +2570,13 @@ var KiroCommand = class _KiroCommand extends ToolCommand {
|
|
|
2430
2570
|
};
|
|
2431
2571
|
|
|
2432
2572
|
// src/features/commands/opencode-command.ts
|
|
2433
|
-
import { join as
|
|
2434
|
-
import { optional as optional2, z as
|
|
2435
|
-
var OpenCodeCommandFrontmatterSchema =
|
|
2436
|
-
description:
|
|
2437
|
-
agent: optional2(
|
|
2438
|
-
subtask: optional2(
|
|
2439
|
-
model: optional2(
|
|
2573
|
+
import { join as join18 } from "path";
|
|
2574
|
+
import { optional as optional2, z as z12 } from "zod/mini";
|
|
2575
|
+
var OpenCodeCommandFrontmatterSchema = z12.looseObject({
|
|
2576
|
+
description: z12.optional(z12.string()),
|
|
2577
|
+
agent: optional2(z12.string()),
|
|
2578
|
+
subtask: optional2(z12.boolean()),
|
|
2579
|
+
model: optional2(z12.string())
|
|
2440
2580
|
});
|
|
2441
2581
|
var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
2442
2582
|
frontmatter;
|
|
@@ -2446,7 +2586,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
2446
2586
|
const result = OpenCodeCommandFrontmatterSchema.safeParse(frontmatter);
|
|
2447
2587
|
if (!result.success) {
|
|
2448
2588
|
throw new Error(
|
|
2449
|
-
`Invalid frontmatter in ${
|
|
2589
|
+
`Invalid frontmatter in ${join18(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
2450
2590
|
);
|
|
2451
2591
|
}
|
|
2452
2592
|
}
|
|
@@ -2459,7 +2599,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
2459
2599
|
}
|
|
2460
2600
|
static getSettablePaths({ global } = {}) {
|
|
2461
2601
|
return {
|
|
2462
|
-
relativeDirPath: global ?
|
|
2602
|
+
relativeDirPath: global ? join18(".config", "opencode", "command") : join18(".opencode", "command")
|
|
2463
2603
|
};
|
|
2464
2604
|
}
|
|
2465
2605
|
getBody() {
|
|
@@ -2520,7 +2660,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
2520
2660
|
return {
|
|
2521
2661
|
success: false,
|
|
2522
2662
|
error: new Error(
|
|
2523
|
-
`Invalid frontmatter in ${
|
|
2663
|
+
`Invalid frontmatter in ${join18(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
2524
2664
|
)
|
|
2525
2665
|
};
|
|
2526
2666
|
}
|
|
@@ -2531,7 +2671,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
2531
2671
|
global = false
|
|
2532
2672
|
}) {
|
|
2533
2673
|
const paths = this.getSettablePaths({ global });
|
|
2534
|
-
const filePath =
|
|
2674
|
+
const filePath = join18(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
2535
2675
|
const fileContent = await readFileContent(filePath);
|
|
2536
2676
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
2537
2677
|
const result = OpenCodeCommandFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -2570,18 +2710,18 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
2570
2710
|
};
|
|
2571
2711
|
|
|
2572
2712
|
// src/features/commands/roo-command.ts
|
|
2573
|
-
import { join as
|
|
2574
|
-
import { optional as optional3, z as
|
|
2575
|
-
var RooCommandFrontmatterSchema =
|
|
2576
|
-
description:
|
|
2577
|
-
"argument-hint": optional3(
|
|
2713
|
+
import { join as join19 } from "path";
|
|
2714
|
+
import { optional as optional3, z as z13 } from "zod/mini";
|
|
2715
|
+
var RooCommandFrontmatterSchema = z13.looseObject({
|
|
2716
|
+
description: z13.optional(z13.string()),
|
|
2717
|
+
"argument-hint": optional3(z13.string())
|
|
2578
2718
|
});
|
|
2579
2719
|
var RooCommand = class _RooCommand extends ToolCommand {
|
|
2580
2720
|
frontmatter;
|
|
2581
2721
|
body;
|
|
2582
2722
|
static getSettablePaths() {
|
|
2583
2723
|
return {
|
|
2584
|
-
relativeDirPath:
|
|
2724
|
+
relativeDirPath: join19(".roo", "commands")
|
|
2585
2725
|
};
|
|
2586
2726
|
}
|
|
2587
2727
|
constructor({ frontmatter, body, ...rest }) {
|
|
@@ -2589,7 +2729,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
2589
2729
|
const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
|
|
2590
2730
|
if (!result.success) {
|
|
2591
2731
|
throw new Error(
|
|
2592
|
-
`Invalid frontmatter in ${
|
|
2732
|
+
`Invalid frontmatter in ${join19(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
2593
2733
|
);
|
|
2594
2734
|
}
|
|
2595
2735
|
}
|
|
@@ -2660,7 +2800,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
2660
2800
|
return {
|
|
2661
2801
|
success: false,
|
|
2662
2802
|
error: new Error(
|
|
2663
|
-
`Invalid frontmatter in ${
|
|
2803
|
+
`Invalid frontmatter in ${join19(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
2664
2804
|
)
|
|
2665
2805
|
};
|
|
2666
2806
|
}
|
|
@@ -2676,7 +2816,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
2676
2816
|
relativeFilePath,
|
|
2677
2817
|
validate = true
|
|
2678
2818
|
}) {
|
|
2679
|
-
const filePath =
|
|
2819
|
+
const filePath = join19(baseDir, _RooCommand.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
2680
2820
|
const fileContent = await readFileContent(filePath);
|
|
2681
2821
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
2682
2822
|
const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -2722,12 +2862,13 @@ var commandsProcessorToolTargetTuple = [
|
|
|
2722
2862
|
"cursor",
|
|
2723
2863
|
"factorydroid",
|
|
2724
2864
|
"geminicli",
|
|
2865
|
+
"junie",
|
|
2725
2866
|
"kilo",
|
|
2726
2867
|
"kiro",
|
|
2727
2868
|
"opencode",
|
|
2728
2869
|
"roo"
|
|
2729
2870
|
];
|
|
2730
|
-
var CommandsProcessorToolTargetSchema =
|
|
2871
|
+
var CommandsProcessorToolTargetSchema = z14.enum(commandsProcessorToolTargetTuple);
|
|
2731
2872
|
var toolCommandFactories = /* @__PURE__ */ new Map([
|
|
2732
2873
|
[
|
|
2733
2874
|
"agentsmd",
|
|
@@ -2859,6 +3000,19 @@ var toolCommandFactories = /* @__PURE__ */ new Map([
|
|
|
2859
3000
|
}
|
|
2860
3001
|
}
|
|
2861
3002
|
],
|
|
3003
|
+
[
|
|
3004
|
+
"junie",
|
|
3005
|
+
{
|
|
3006
|
+
class: JunieCommand,
|
|
3007
|
+
meta: {
|
|
3008
|
+
extension: "md",
|
|
3009
|
+
supportsProject: true,
|
|
3010
|
+
supportsGlobal: true,
|
|
3011
|
+
isSimulated: false,
|
|
3012
|
+
supportsSubdirectory: false
|
|
3013
|
+
}
|
|
3014
|
+
}
|
|
3015
|
+
],
|
|
2862
3016
|
[
|
|
2863
3017
|
"kilo",
|
|
2864
3018
|
{
|
|
@@ -3012,7 +3166,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
3012
3166
|
*/
|
|
3013
3167
|
async loadRulesyncFiles() {
|
|
3014
3168
|
const basePath = RulesyncCommand.getSettablePaths().relativeDirPath;
|
|
3015
|
-
const rulesyncCommandPaths = await findFilesByGlobs(
|
|
3169
|
+
const rulesyncCommandPaths = await findFilesByGlobs(join20(basePath, "**", "*.md"));
|
|
3016
3170
|
const rulesyncCommands = await Promise.all(
|
|
3017
3171
|
rulesyncCommandPaths.map(
|
|
3018
3172
|
(path3) => RulesyncCommand.fromFile({ relativeFilePath: this.safeRelativePath(basePath, path3) })
|
|
@@ -3030,8 +3184,8 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
3030
3184
|
} = {}) {
|
|
3031
3185
|
const factory = this.getFactory(this.toolTarget);
|
|
3032
3186
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
3033
|
-
const baseDirFull =
|
|
3034
|
-
const globPattern = factory.meta.supportsSubdirectory ?
|
|
3187
|
+
const baseDirFull = join20(this.baseDir, paths.relativeDirPath);
|
|
3188
|
+
const globPattern = factory.meta.supportsSubdirectory ? join20(baseDirFull, "**", `*.${factory.meta.extension}`) : join20(baseDirFull, `*.${factory.meta.extension}`);
|
|
3035
3189
|
const commandFilePaths = await findFilesByGlobs(globPattern);
|
|
3036
3190
|
if (forDeletion) {
|
|
3037
3191
|
const toolCommands2 = commandFilePaths.map(
|
|
@@ -3094,28 +3248,28 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
3094
3248
|
};
|
|
3095
3249
|
|
|
3096
3250
|
// src/features/hooks/hooks-processor.ts
|
|
3097
|
-
import { z as
|
|
3251
|
+
import { z as z18 } from "zod/mini";
|
|
3098
3252
|
|
|
3099
3253
|
// src/types/hooks.ts
|
|
3100
|
-
import { z as
|
|
3254
|
+
import { z as z15 } from "zod/mini";
|
|
3101
3255
|
var CONTROL_CHARS = ["\n", "\r", "\0"];
|
|
3102
3256
|
var hasControlChars = (val) => CONTROL_CHARS.some((char) => val.includes(char));
|
|
3103
|
-
var safeString =
|
|
3104
|
-
|
|
3105
|
-
|
|
3257
|
+
var safeString = z15.pipe(
|
|
3258
|
+
z15.string(),
|
|
3259
|
+
z15.custom(
|
|
3106
3260
|
(val) => typeof val === "string" && !hasControlChars(val),
|
|
3107
3261
|
"must not contain newline, carriage return, or NUL characters"
|
|
3108
3262
|
)
|
|
3109
3263
|
);
|
|
3110
|
-
var HookDefinitionSchema =
|
|
3111
|
-
command:
|
|
3112
|
-
type:
|
|
3113
|
-
timeout:
|
|
3114
|
-
matcher:
|
|
3115
|
-
prompt:
|
|
3116
|
-
loop_limit:
|
|
3117
|
-
name:
|
|
3118
|
-
description:
|
|
3264
|
+
var HookDefinitionSchema = z15.looseObject({
|
|
3265
|
+
command: z15.optional(safeString),
|
|
3266
|
+
type: z15.optional(z15.enum(["command", "prompt"])),
|
|
3267
|
+
timeout: z15.optional(z15.number()),
|
|
3268
|
+
matcher: z15.optional(safeString),
|
|
3269
|
+
prompt: z15.optional(safeString),
|
|
3270
|
+
loop_limit: z15.optional(z15.nullable(z15.number())),
|
|
3271
|
+
name: z15.optional(safeString),
|
|
3272
|
+
description: z15.optional(safeString)
|
|
3119
3273
|
});
|
|
3120
3274
|
var CURSOR_HOOK_EVENTS = [
|
|
3121
3275
|
"sessionStart",
|
|
@@ -3195,16 +3349,16 @@ var GEMINICLI_HOOK_EVENTS = [
|
|
|
3195
3349
|
"preCompact",
|
|
3196
3350
|
"notification"
|
|
3197
3351
|
];
|
|
3198
|
-
var hooksRecordSchema =
|
|
3199
|
-
var HooksConfigSchema =
|
|
3200
|
-
version:
|
|
3352
|
+
var hooksRecordSchema = z15.record(z15.string(), z15.array(HookDefinitionSchema));
|
|
3353
|
+
var HooksConfigSchema = z15.looseObject({
|
|
3354
|
+
version: z15.optional(z15.number()),
|
|
3201
3355
|
hooks: hooksRecordSchema,
|
|
3202
|
-
cursor:
|
|
3203
|
-
claudecode:
|
|
3204
|
-
copilot:
|
|
3205
|
-
opencode:
|
|
3206
|
-
factorydroid:
|
|
3207
|
-
geminicli:
|
|
3356
|
+
cursor: z15.optional(z15.looseObject({ hooks: z15.optional(hooksRecordSchema) })),
|
|
3357
|
+
claudecode: z15.optional(z15.looseObject({ hooks: z15.optional(hooksRecordSchema) })),
|
|
3358
|
+
copilot: z15.optional(z15.looseObject({ hooks: z15.optional(hooksRecordSchema) })),
|
|
3359
|
+
opencode: z15.optional(z15.looseObject({ hooks: z15.optional(hooksRecordSchema) })),
|
|
3360
|
+
factorydroid: z15.optional(z15.looseObject({ hooks: z15.optional(hooksRecordSchema) })),
|
|
3361
|
+
geminicli: z15.optional(z15.looseObject({ hooks: z15.optional(hooksRecordSchema) }))
|
|
3208
3362
|
});
|
|
3209
3363
|
var CANONICAL_TO_CLAUDE_EVENT_NAMES = {
|
|
3210
3364
|
sessionStart: "SessionStart",
|
|
@@ -3301,7 +3455,7 @@ var GEMINICLI_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
|
|
|
3301
3455
|
);
|
|
3302
3456
|
|
|
3303
3457
|
// src/features/hooks/claudecode-hooks.ts
|
|
3304
|
-
import { join as
|
|
3458
|
+
import { join as join22 } from "path";
|
|
3305
3459
|
|
|
3306
3460
|
// src/features/hooks/tool-hooks-converter.ts
|
|
3307
3461
|
function isToolMatcherEntry(x) {
|
|
@@ -3409,7 +3563,7 @@ var ToolFile = class extends AiFile {
|
|
|
3409
3563
|
};
|
|
3410
3564
|
|
|
3411
3565
|
// src/features/hooks/rulesync-hooks.ts
|
|
3412
|
-
import { join as
|
|
3566
|
+
import { join as join21 } from "path";
|
|
3413
3567
|
var RulesyncHooks = class _RulesyncHooks extends RulesyncFile {
|
|
3414
3568
|
json;
|
|
3415
3569
|
constructor(params) {
|
|
@@ -3440,7 +3594,7 @@ var RulesyncHooks = class _RulesyncHooks extends RulesyncFile {
|
|
|
3440
3594
|
validate = true
|
|
3441
3595
|
}) {
|
|
3442
3596
|
const paths = _RulesyncHooks.getSettablePaths();
|
|
3443
|
-
const filePath =
|
|
3597
|
+
const filePath = join21(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
3444
3598
|
if (!await fileExists(filePath)) {
|
|
3445
3599
|
throw new Error(`No ${RULESYNC_HOOKS_RELATIVE_FILE_PATH} found.`);
|
|
3446
3600
|
}
|
|
@@ -3520,7 +3674,7 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
|
|
|
3520
3674
|
global = false
|
|
3521
3675
|
}) {
|
|
3522
3676
|
const paths = _ClaudecodeHooks.getSettablePaths({ global });
|
|
3523
|
-
const filePath =
|
|
3677
|
+
const filePath = join22(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
3524
3678
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
|
|
3525
3679
|
return new _ClaudecodeHooks({
|
|
3526
3680
|
baseDir,
|
|
@@ -3537,7 +3691,7 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
|
|
|
3537
3691
|
global = false
|
|
3538
3692
|
}) {
|
|
3539
3693
|
const paths = _ClaudecodeHooks.getSettablePaths({ global });
|
|
3540
|
-
const filePath =
|
|
3694
|
+
const filePath = join22(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
3541
3695
|
const existingContent = await readOrInitializeFileContent(
|
|
3542
3696
|
filePath,
|
|
3543
3697
|
JSON.stringify({}, null, 2)
|
|
@@ -3573,7 +3727,7 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
|
|
|
3573
3727
|
settings = JSON.parse(this.getFileContent());
|
|
3574
3728
|
} catch (error) {
|
|
3575
3729
|
throw new Error(
|
|
3576
|
-
`Failed to parse Claude hooks content in ${
|
|
3730
|
+
`Failed to parse Claude hooks content in ${join22(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
3577
3731
|
{
|
|
3578
3732
|
cause: error
|
|
3579
3733
|
}
|
|
@@ -3606,13 +3760,13 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
|
|
|
3606
3760
|
};
|
|
3607
3761
|
|
|
3608
3762
|
// src/features/hooks/copilot-hooks.ts
|
|
3609
|
-
import { join as
|
|
3610
|
-
import { z as
|
|
3611
|
-
var CopilotHookEntrySchema =
|
|
3612
|
-
type:
|
|
3613
|
-
bash:
|
|
3614
|
-
powershell:
|
|
3615
|
-
timeoutSec:
|
|
3763
|
+
import { join as join23 } from "path";
|
|
3764
|
+
import { z as z16 } from "zod/mini";
|
|
3765
|
+
var CopilotHookEntrySchema = z16.looseObject({
|
|
3766
|
+
type: z16.string(),
|
|
3767
|
+
bash: z16.optional(z16.string()),
|
|
3768
|
+
powershell: z16.optional(z16.string()),
|
|
3769
|
+
timeoutSec: z16.optional(z16.number())
|
|
3616
3770
|
});
|
|
3617
3771
|
function canonicalToCopilotHooks(config) {
|
|
3618
3772
|
const canonicalSchemaKeys = Object.keys(HookDefinitionSchema.shape);
|
|
@@ -3709,7 +3863,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
|
|
|
3709
3863
|
}
|
|
3710
3864
|
static getSettablePaths(_options = {}) {
|
|
3711
3865
|
return {
|
|
3712
|
-
relativeDirPath:
|
|
3866
|
+
relativeDirPath: join23(".github", "hooks"),
|
|
3713
3867
|
relativeFilePath: "copilot-hooks.json"
|
|
3714
3868
|
};
|
|
3715
3869
|
}
|
|
@@ -3719,7 +3873,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
|
|
|
3719
3873
|
global = false
|
|
3720
3874
|
}) {
|
|
3721
3875
|
const paths = _CopilotHooks.getSettablePaths({ global });
|
|
3722
|
-
const filePath =
|
|
3876
|
+
const filePath = join23(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
3723
3877
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
|
|
3724
3878
|
return new _CopilotHooks({
|
|
3725
3879
|
baseDir,
|
|
@@ -3752,7 +3906,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
|
|
|
3752
3906
|
parsed = JSON.parse(this.getFileContent());
|
|
3753
3907
|
} catch (error) {
|
|
3754
3908
|
throw new Error(
|
|
3755
|
-
`Failed to parse Copilot hooks content in ${
|
|
3909
|
+
`Failed to parse Copilot hooks content in ${join23(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
3756
3910
|
{
|
|
3757
3911
|
cause: error
|
|
3758
3912
|
}
|
|
@@ -3782,7 +3936,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
|
|
|
3782
3936
|
};
|
|
3783
3937
|
|
|
3784
3938
|
// src/features/hooks/cursor-hooks.ts
|
|
3785
|
-
import { join as
|
|
3939
|
+
import { join as join24 } from "path";
|
|
3786
3940
|
var CursorHooks = class _CursorHooks extends ToolHooks {
|
|
3787
3941
|
constructor(params) {
|
|
3788
3942
|
const { rulesyncHooks: _r, ...rest } = params;
|
|
@@ -3803,7 +3957,7 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
|
|
|
3803
3957
|
}) {
|
|
3804
3958
|
const paths = _CursorHooks.getSettablePaths();
|
|
3805
3959
|
const fileContent = await readFileContent(
|
|
3806
|
-
|
|
3960
|
+
join24(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
3807
3961
|
);
|
|
3808
3962
|
return new _CursorHooks({
|
|
3809
3963
|
baseDir,
|
|
@@ -3890,7 +4044,7 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
|
|
|
3890
4044
|
};
|
|
3891
4045
|
|
|
3892
4046
|
// src/features/hooks/factorydroid-hooks.ts
|
|
3893
|
-
import { join as
|
|
4047
|
+
import { join as join25 } from "path";
|
|
3894
4048
|
var FACTORYDROID_CONVERTER_CONFIG = {
|
|
3895
4049
|
supportedEvents: FACTORYDROID_HOOK_EVENTS,
|
|
3896
4050
|
canonicalToToolEventNames: CANONICAL_TO_FACTORYDROID_EVENT_NAMES,
|
|
@@ -3916,7 +4070,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
3916
4070
|
global = false
|
|
3917
4071
|
}) {
|
|
3918
4072
|
const paths = _FactorydroidHooks.getSettablePaths({ global });
|
|
3919
|
-
const filePath =
|
|
4073
|
+
const filePath = join25(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
3920
4074
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
|
|
3921
4075
|
return new _FactorydroidHooks({
|
|
3922
4076
|
baseDir,
|
|
@@ -3933,7 +4087,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
3933
4087
|
global = false
|
|
3934
4088
|
}) {
|
|
3935
4089
|
const paths = _FactorydroidHooks.getSettablePaths({ global });
|
|
3936
|
-
const filePath =
|
|
4090
|
+
const filePath = join25(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
3937
4091
|
const existingContent = await readOrInitializeFileContent(
|
|
3938
4092
|
filePath,
|
|
3939
4093
|
JSON.stringify({}, null, 2)
|
|
@@ -3969,7 +4123,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
3969
4123
|
settings = JSON.parse(this.getFileContent());
|
|
3970
4124
|
} catch (error) {
|
|
3971
4125
|
throw new Error(
|
|
3972
|
-
`Failed to parse Factory Droid hooks content in ${
|
|
4126
|
+
`Failed to parse Factory Droid hooks content in ${join25(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
3973
4127
|
{
|
|
3974
4128
|
cause: error
|
|
3975
4129
|
}
|
|
@@ -4002,8 +4156,8 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
4002
4156
|
};
|
|
4003
4157
|
|
|
4004
4158
|
// src/features/hooks/geminicli-hooks.ts
|
|
4005
|
-
import { join as
|
|
4006
|
-
import { z as
|
|
4159
|
+
import { join as join26 } from "path";
|
|
4160
|
+
import { z as z17 } from "zod/mini";
|
|
4007
4161
|
function canonicalToGeminicliHooks(config) {
|
|
4008
4162
|
const geminiSupported = new Set(GEMINICLI_HOOK_EVENTS);
|
|
4009
4163
|
const sharedHooks = {};
|
|
@@ -4047,16 +4201,16 @@ function canonicalToGeminicliHooks(config) {
|
|
|
4047
4201
|
}
|
|
4048
4202
|
return gemini;
|
|
4049
4203
|
}
|
|
4050
|
-
var GeminiHookEntrySchema =
|
|
4051
|
-
type:
|
|
4052
|
-
command:
|
|
4053
|
-
timeout:
|
|
4054
|
-
name:
|
|
4055
|
-
description:
|
|
4204
|
+
var GeminiHookEntrySchema = z17.looseObject({
|
|
4205
|
+
type: z17.optional(z17.string()),
|
|
4206
|
+
command: z17.optional(z17.string()),
|
|
4207
|
+
timeout: z17.optional(z17.number()),
|
|
4208
|
+
name: z17.optional(z17.string()),
|
|
4209
|
+
description: z17.optional(z17.string())
|
|
4056
4210
|
});
|
|
4057
|
-
var GeminiMatcherEntrySchema =
|
|
4058
|
-
matcher:
|
|
4059
|
-
hooks:
|
|
4211
|
+
var GeminiMatcherEntrySchema = z17.looseObject({
|
|
4212
|
+
matcher: z17.optional(z17.string()),
|
|
4213
|
+
hooks: z17.optional(z17.array(GeminiHookEntrySchema))
|
|
4060
4214
|
});
|
|
4061
4215
|
function geminiHooksToCanonical(geminiHooks) {
|
|
4062
4216
|
if (geminiHooks === null || geminiHooks === void 0 || typeof geminiHooks !== "object") {
|
|
@@ -4111,7 +4265,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
|
|
|
4111
4265
|
global = false
|
|
4112
4266
|
}) {
|
|
4113
4267
|
const paths = _GeminicliHooks.getSettablePaths({ global });
|
|
4114
|
-
const filePath =
|
|
4268
|
+
const filePath = join26(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4115
4269
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
|
|
4116
4270
|
return new _GeminicliHooks({
|
|
4117
4271
|
baseDir,
|
|
@@ -4128,7 +4282,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
|
|
|
4128
4282
|
global = false
|
|
4129
4283
|
}) {
|
|
4130
4284
|
const paths = _GeminicliHooks.getSettablePaths({ global });
|
|
4131
|
-
const filePath =
|
|
4285
|
+
const filePath = join26(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4132
4286
|
const existingContent = await readOrInitializeFileContent(
|
|
4133
4287
|
filePath,
|
|
4134
4288
|
JSON.stringify({}, null, 2)
|
|
@@ -4160,7 +4314,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
|
|
|
4160
4314
|
settings = JSON.parse(this.getFileContent());
|
|
4161
4315
|
} catch (error) {
|
|
4162
4316
|
throw new Error(
|
|
4163
|
-
`Failed to parse Gemini CLI hooks content in ${
|
|
4317
|
+
`Failed to parse Gemini CLI hooks content in ${join26(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
4164
4318
|
{
|
|
4165
4319
|
cause: error
|
|
4166
4320
|
}
|
|
@@ -4190,7 +4344,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
|
|
|
4190
4344
|
};
|
|
4191
4345
|
|
|
4192
4346
|
// src/features/hooks/opencode-hooks.ts
|
|
4193
|
-
import { join as
|
|
4347
|
+
import { join as join27 } from "path";
|
|
4194
4348
|
var NAMED_HOOKS = /* @__PURE__ */ new Set(["tool.execute.before", "tool.execute.after"]);
|
|
4195
4349
|
function escapeForTemplateLiteral(command) {
|
|
4196
4350
|
return command.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${");
|
|
@@ -4288,7 +4442,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
|
|
|
4288
4442
|
}
|
|
4289
4443
|
static getSettablePaths(options) {
|
|
4290
4444
|
return {
|
|
4291
|
-
relativeDirPath: options?.global ?
|
|
4445
|
+
relativeDirPath: options?.global ? join27(".config", "opencode", "plugins") : join27(".opencode", "plugins"),
|
|
4292
4446
|
relativeFilePath: "rulesync-hooks.js"
|
|
4293
4447
|
};
|
|
4294
4448
|
}
|
|
@@ -4299,7 +4453,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
|
|
|
4299
4453
|
}) {
|
|
4300
4454
|
const paths = _OpencodeHooks.getSettablePaths({ global });
|
|
4301
4455
|
const fileContent = await readFileContent(
|
|
4302
|
-
|
|
4456
|
+
join27(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
4303
4457
|
);
|
|
4304
4458
|
return new _OpencodeHooks({
|
|
4305
4459
|
baseDir,
|
|
@@ -4356,7 +4510,7 @@ var hooksProcessorToolTargetTuple = [
|
|
|
4356
4510
|
"factorydroid",
|
|
4357
4511
|
"geminicli"
|
|
4358
4512
|
];
|
|
4359
|
-
var HooksProcessorToolTargetSchema =
|
|
4513
|
+
var HooksProcessorToolTargetSchema = z18.enum(hooksProcessorToolTargetTuple);
|
|
4360
4514
|
var toolHooksFactories = /* @__PURE__ */ new Map([
|
|
4361
4515
|
[
|
|
4362
4516
|
"cursor",
|
|
@@ -4591,13 +4745,13 @@ var HooksProcessor = class extends FeatureProcessor {
|
|
|
4591
4745
|
};
|
|
4592
4746
|
|
|
4593
4747
|
// src/features/ignore/ignore-processor.ts
|
|
4594
|
-
import { z as
|
|
4748
|
+
import { z as z19 } from "zod/mini";
|
|
4595
4749
|
|
|
4596
4750
|
// src/features/ignore/augmentcode-ignore.ts
|
|
4597
|
-
import { join as
|
|
4751
|
+
import { join as join29 } from "path";
|
|
4598
4752
|
|
|
4599
4753
|
// src/features/ignore/rulesync-ignore.ts
|
|
4600
|
-
import { join as
|
|
4754
|
+
import { join as join28 } from "path";
|
|
4601
4755
|
var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
4602
4756
|
validate() {
|
|
4603
4757
|
return { success: true, error: null };
|
|
@@ -4617,12 +4771,12 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
|
4617
4771
|
static async fromFile() {
|
|
4618
4772
|
const baseDir = process.cwd();
|
|
4619
4773
|
const paths = this.getSettablePaths();
|
|
4620
|
-
const recommendedPath =
|
|
4774
|
+
const recommendedPath = join28(
|
|
4621
4775
|
baseDir,
|
|
4622
4776
|
paths.recommended.relativeDirPath,
|
|
4623
4777
|
paths.recommended.relativeFilePath
|
|
4624
4778
|
);
|
|
4625
|
-
const legacyPath =
|
|
4779
|
+
const legacyPath = join28(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
4626
4780
|
if (await fileExists(recommendedPath)) {
|
|
4627
4781
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
4628
4782
|
return new _RulesyncIgnore({
|
|
@@ -4738,7 +4892,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
4738
4892
|
validate = true
|
|
4739
4893
|
}) {
|
|
4740
4894
|
const fileContent = await readFileContent(
|
|
4741
|
-
|
|
4895
|
+
join29(
|
|
4742
4896
|
baseDir,
|
|
4743
4897
|
this.getSettablePaths().relativeDirPath,
|
|
4744
4898
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4768,7 +4922,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
4768
4922
|
};
|
|
4769
4923
|
|
|
4770
4924
|
// src/features/ignore/claudecode-ignore.ts
|
|
4771
|
-
import { join as
|
|
4925
|
+
import { join as join30 } from "path";
|
|
4772
4926
|
import { uniq } from "es-toolkit";
|
|
4773
4927
|
var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
4774
4928
|
constructor(params) {
|
|
@@ -4811,7 +4965,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
4811
4965
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
4812
4966
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
4813
4967
|
const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
|
|
4814
|
-
const filePath =
|
|
4968
|
+
const filePath = join30(
|
|
4815
4969
|
baseDir,
|
|
4816
4970
|
this.getSettablePaths().relativeDirPath,
|
|
4817
4971
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4847,7 +5001,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
4847
5001
|
validate = true
|
|
4848
5002
|
}) {
|
|
4849
5003
|
const fileContent = await readFileContent(
|
|
4850
|
-
|
|
5004
|
+
join30(
|
|
4851
5005
|
baseDir,
|
|
4852
5006
|
this.getSettablePaths().relativeDirPath,
|
|
4853
5007
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4877,7 +5031,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
4877
5031
|
};
|
|
4878
5032
|
|
|
4879
5033
|
// src/features/ignore/cline-ignore.ts
|
|
4880
|
-
import { join as
|
|
5034
|
+
import { join as join31 } from "path";
|
|
4881
5035
|
var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
4882
5036
|
static getSettablePaths() {
|
|
4883
5037
|
return {
|
|
@@ -4914,7 +5068,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
4914
5068
|
validate = true
|
|
4915
5069
|
}) {
|
|
4916
5070
|
const fileContent = await readFileContent(
|
|
4917
|
-
|
|
5071
|
+
join31(
|
|
4918
5072
|
baseDir,
|
|
4919
5073
|
this.getSettablePaths().relativeDirPath,
|
|
4920
5074
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4944,7 +5098,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
4944
5098
|
};
|
|
4945
5099
|
|
|
4946
5100
|
// src/features/ignore/cursor-ignore.ts
|
|
4947
|
-
import { join as
|
|
5101
|
+
import { join as join32 } from "path";
|
|
4948
5102
|
var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
4949
5103
|
static getSettablePaths() {
|
|
4950
5104
|
return {
|
|
@@ -4977,7 +5131,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
4977
5131
|
validate = true
|
|
4978
5132
|
}) {
|
|
4979
5133
|
const fileContent = await readFileContent(
|
|
4980
|
-
|
|
5134
|
+
join32(
|
|
4981
5135
|
baseDir,
|
|
4982
5136
|
this.getSettablePaths().relativeDirPath,
|
|
4983
5137
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5007,7 +5161,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
5007
5161
|
};
|
|
5008
5162
|
|
|
5009
5163
|
// src/features/ignore/geminicli-ignore.ts
|
|
5010
|
-
import { join as
|
|
5164
|
+
import { join as join33 } from "path";
|
|
5011
5165
|
var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
5012
5166
|
static getSettablePaths() {
|
|
5013
5167
|
return {
|
|
@@ -5034,7 +5188,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
5034
5188
|
validate = true
|
|
5035
5189
|
}) {
|
|
5036
5190
|
const fileContent = await readFileContent(
|
|
5037
|
-
|
|
5191
|
+
join33(
|
|
5038
5192
|
baseDir,
|
|
5039
5193
|
this.getSettablePaths().relativeDirPath,
|
|
5040
5194
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5064,7 +5218,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
5064
5218
|
};
|
|
5065
5219
|
|
|
5066
5220
|
// src/features/ignore/goose-ignore.ts
|
|
5067
|
-
import { join as
|
|
5221
|
+
import { join as join34 } from "path";
|
|
5068
5222
|
var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
5069
5223
|
static getSettablePaths() {
|
|
5070
5224
|
return {
|
|
@@ -5101,7 +5255,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
|
5101
5255
|
validate = true
|
|
5102
5256
|
}) {
|
|
5103
5257
|
const fileContent = await readFileContent(
|
|
5104
|
-
|
|
5258
|
+
join34(
|
|
5105
5259
|
baseDir,
|
|
5106
5260
|
this.getSettablePaths().relativeDirPath,
|
|
5107
5261
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5131,7 +5285,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
|
5131
5285
|
};
|
|
5132
5286
|
|
|
5133
5287
|
// src/features/ignore/junie-ignore.ts
|
|
5134
|
-
import { join as
|
|
5288
|
+
import { join as join35 } from "path";
|
|
5135
5289
|
var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
5136
5290
|
static getSettablePaths() {
|
|
5137
5291
|
return {
|
|
@@ -5158,7 +5312,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
5158
5312
|
validate = true
|
|
5159
5313
|
}) {
|
|
5160
5314
|
const fileContent = await readFileContent(
|
|
5161
|
-
|
|
5315
|
+
join35(
|
|
5162
5316
|
baseDir,
|
|
5163
5317
|
this.getSettablePaths().relativeDirPath,
|
|
5164
5318
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5188,7 +5342,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
5188
5342
|
};
|
|
5189
5343
|
|
|
5190
5344
|
// src/features/ignore/kilo-ignore.ts
|
|
5191
|
-
import { join as
|
|
5345
|
+
import { join as join36 } from "path";
|
|
5192
5346
|
var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
5193
5347
|
static getSettablePaths() {
|
|
5194
5348
|
return {
|
|
@@ -5225,7 +5379,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
|
5225
5379
|
validate = true
|
|
5226
5380
|
}) {
|
|
5227
5381
|
const fileContent = await readFileContent(
|
|
5228
|
-
|
|
5382
|
+
join36(
|
|
5229
5383
|
baseDir,
|
|
5230
5384
|
this.getSettablePaths().relativeDirPath,
|
|
5231
5385
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5255,7 +5409,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
|
5255
5409
|
};
|
|
5256
5410
|
|
|
5257
5411
|
// src/features/ignore/kiro-ignore.ts
|
|
5258
|
-
import { join as
|
|
5412
|
+
import { join as join37 } from "path";
|
|
5259
5413
|
var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
5260
5414
|
static getSettablePaths() {
|
|
5261
5415
|
return {
|
|
@@ -5282,7 +5436,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
5282
5436
|
validate = true
|
|
5283
5437
|
}) {
|
|
5284
5438
|
const fileContent = await readFileContent(
|
|
5285
|
-
|
|
5439
|
+
join37(
|
|
5286
5440
|
baseDir,
|
|
5287
5441
|
this.getSettablePaths().relativeDirPath,
|
|
5288
5442
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5312,7 +5466,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
5312
5466
|
};
|
|
5313
5467
|
|
|
5314
5468
|
// src/features/ignore/qwencode-ignore.ts
|
|
5315
|
-
import { join as
|
|
5469
|
+
import { join as join38 } from "path";
|
|
5316
5470
|
var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
5317
5471
|
static getSettablePaths() {
|
|
5318
5472
|
return {
|
|
@@ -5339,7 +5493,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
5339
5493
|
validate = true
|
|
5340
5494
|
}) {
|
|
5341
5495
|
const fileContent = await readFileContent(
|
|
5342
|
-
|
|
5496
|
+
join38(
|
|
5343
5497
|
baseDir,
|
|
5344
5498
|
this.getSettablePaths().relativeDirPath,
|
|
5345
5499
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5369,7 +5523,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
5369
5523
|
};
|
|
5370
5524
|
|
|
5371
5525
|
// src/features/ignore/roo-ignore.ts
|
|
5372
|
-
import { join as
|
|
5526
|
+
import { join as join39 } from "path";
|
|
5373
5527
|
var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
5374
5528
|
static getSettablePaths() {
|
|
5375
5529
|
return {
|
|
@@ -5396,7 +5550,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
5396
5550
|
validate = true
|
|
5397
5551
|
}) {
|
|
5398
5552
|
const fileContent = await readFileContent(
|
|
5399
|
-
|
|
5553
|
+
join39(
|
|
5400
5554
|
baseDir,
|
|
5401
5555
|
this.getSettablePaths().relativeDirPath,
|
|
5402
5556
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5426,7 +5580,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
5426
5580
|
};
|
|
5427
5581
|
|
|
5428
5582
|
// src/features/ignore/windsurf-ignore.ts
|
|
5429
|
-
import { join as
|
|
5583
|
+
import { join as join40 } from "path";
|
|
5430
5584
|
var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
5431
5585
|
static getSettablePaths() {
|
|
5432
5586
|
return {
|
|
@@ -5453,7 +5607,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
5453
5607
|
validate = true
|
|
5454
5608
|
}) {
|
|
5455
5609
|
const fileContent = await readFileContent(
|
|
5456
|
-
|
|
5610
|
+
join40(
|
|
5457
5611
|
baseDir,
|
|
5458
5612
|
this.getSettablePaths().relativeDirPath,
|
|
5459
5613
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5483,7 +5637,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
5483
5637
|
};
|
|
5484
5638
|
|
|
5485
5639
|
// src/features/ignore/zed-ignore.ts
|
|
5486
|
-
import { join as
|
|
5640
|
+
import { join as join41 } from "path";
|
|
5487
5641
|
import { uniq as uniq2 } from "es-toolkit";
|
|
5488
5642
|
var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
5489
5643
|
constructor(params) {
|
|
@@ -5520,7 +5674,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
|
5520
5674
|
}) {
|
|
5521
5675
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
5522
5676
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
5523
|
-
const filePath =
|
|
5677
|
+
const filePath = join41(
|
|
5524
5678
|
baseDir,
|
|
5525
5679
|
this.getSettablePaths().relativeDirPath,
|
|
5526
5680
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5547,7 +5701,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
|
5547
5701
|
validate = true
|
|
5548
5702
|
}) {
|
|
5549
5703
|
const fileContent = await readFileContent(
|
|
5550
|
-
|
|
5704
|
+
join41(
|
|
5551
5705
|
baseDir,
|
|
5552
5706
|
this.getSettablePaths().relativeDirPath,
|
|
5553
5707
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5593,7 +5747,7 @@ var ignoreProcessorToolTargets = [
|
|
|
5593
5747
|
"windsurf",
|
|
5594
5748
|
"zed"
|
|
5595
5749
|
];
|
|
5596
|
-
var IgnoreProcessorToolTargetSchema =
|
|
5750
|
+
var IgnoreProcessorToolTargetSchema = z19.enum(ignoreProcessorToolTargets);
|
|
5597
5751
|
var toolIgnoreFactories = /* @__PURE__ */ new Map([
|
|
5598
5752
|
["augmentcode", { class: AugmentcodeIgnore }],
|
|
5599
5753
|
["claudecode", { class: ClaudecodeIgnore }],
|
|
@@ -5731,52 +5885,52 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
5731
5885
|
};
|
|
5732
5886
|
|
|
5733
5887
|
// src/features/mcp/mcp-processor.ts
|
|
5734
|
-
import { z as
|
|
5888
|
+
import { z as z23 } from "zod/mini";
|
|
5735
5889
|
|
|
5736
5890
|
// src/features/mcp/claudecode-mcp.ts
|
|
5737
|
-
import { join as
|
|
5891
|
+
import { join as join43 } from "path";
|
|
5738
5892
|
|
|
5739
5893
|
// src/features/mcp/rulesync-mcp.ts
|
|
5740
|
-
import { join as
|
|
5894
|
+
import { join as join42 } from "path";
|
|
5741
5895
|
import { omit } from "es-toolkit/object";
|
|
5742
|
-
import { z as
|
|
5896
|
+
import { z as z21 } from "zod/mini";
|
|
5743
5897
|
|
|
5744
5898
|
// src/types/mcp.ts
|
|
5745
|
-
import { z as
|
|
5746
|
-
var McpServerSchema =
|
|
5747
|
-
type:
|
|
5748
|
-
command:
|
|
5749
|
-
args:
|
|
5750
|
-
url:
|
|
5751
|
-
httpUrl:
|
|
5752
|
-
env:
|
|
5753
|
-
disabled:
|
|
5754
|
-
networkTimeout:
|
|
5755
|
-
timeout:
|
|
5756
|
-
trust:
|
|
5757
|
-
cwd:
|
|
5758
|
-
transport:
|
|
5759
|
-
alwaysAllow:
|
|
5760
|
-
tools:
|
|
5761
|
-
kiroAutoApprove:
|
|
5762
|
-
kiroAutoBlock:
|
|
5763
|
-
headers:
|
|
5764
|
-
enabledTools:
|
|
5765
|
-
disabledTools:
|
|
5899
|
+
import { z as z20 } from "zod/mini";
|
|
5900
|
+
var McpServerSchema = z20.looseObject({
|
|
5901
|
+
type: z20.optional(z20.enum(["stdio", "sse", "http"])),
|
|
5902
|
+
command: z20.optional(z20.union([z20.string(), z20.array(z20.string())])),
|
|
5903
|
+
args: z20.optional(z20.array(z20.string())),
|
|
5904
|
+
url: z20.optional(z20.string()),
|
|
5905
|
+
httpUrl: z20.optional(z20.string()),
|
|
5906
|
+
env: z20.optional(z20.record(z20.string(), z20.string())),
|
|
5907
|
+
disabled: z20.optional(z20.boolean()),
|
|
5908
|
+
networkTimeout: z20.optional(z20.number()),
|
|
5909
|
+
timeout: z20.optional(z20.number()),
|
|
5910
|
+
trust: z20.optional(z20.boolean()),
|
|
5911
|
+
cwd: z20.optional(z20.string()),
|
|
5912
|
+
transport: z20.optional(z20.enum(["stdio", "sse", "http"])),
|
|
5913
|
+
alwaysAllow: z20.optional(z20.array(z20.string())),
|
|
5914
|
+
tools: z20.optional(z20.array(z20.string())),
|
|
5915
|
+
kiroAutoApprove: z20.optional(z20.array(z20.string())),
|
|
5916
|
+
kiroAutoBlock: z20.optional(z20.array(z20.string())),
|
|
5917
|
+
headers: z20.optional(z20.record(z20.string(), z20.string())),
|
|
5918
|
+
enabledTools: z20.optional(z20.array(z20.string())),
|
|
5919
|
+
disabledTools: z20.optional(z20.array(z20.string()))
|
|
5766
5920
|
});
|
|
5767
|
-
var McpServersSchema =
|
|
5921
|
+
var McpServersSchema = z20.record(z20.string(), McpServerSchema);
|
|
5768
5922
|
|
|
5769
5923
|
// src/features/mcp/rulesync-mcp.ts
|
|
5770
|
-
var RulesyncMcpServerSchema =
|
|
5771
|
-
targets:
|
|
5772
|
-
description:
|
|
5773
|
-
exposed:
|
|
5924
|
+
var RulesyncMcpServerSchema = z21.extend(McpServerSchema, {
|
|
5925
|
+
targets: z21.optional(RulesyncTargetsSchema),
|
|
5926
|
+
description: z21.optional(z21.string()),
|
|
5927
|
+
exposed: z21.optional(z21.boolean())
|
|
5774
5928
|
});
|
|
5775
|
-
var RulesyncMcpConfigSchema =
|
|
5776
|
-
mcpServers:
|
|
5929
|
+
var RulesyncMcpConfigSchema = z21.object({
|
|
5930
|
+
mcpServers: z21.record(z21.string(), RulesyncMcpServerSchema)
|
|
5777
5931
|
});
|
|
5778
|
-
var RulesyncMcpFileSchema =
|
|
5779
|
-
$schema:
|
|
5932
|
+
var RulesyncMcpFileSchema = z21.looseObject({
|
|
5933
|
+
$schema: z21.optional(z21.string()),
|
|
5780
5934
|
...RulesyncMcpConfigSchema.shape
|
|
5781
5935
|
});
|
|
5782
5936
|
var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
@@ -5813,12 +5967,12 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
5813
5967
|
static async fromFile({ validate = true }) {
|
|
5814
5968
|
const baseDir = process.cwd();
|
|
5815
5969
|
const paths = this.getSettablePaths();
|
|
5816
|
-
const recommendedPath =
|
|
5970
|
+
const recommendedPath = join42(
|
|
5817
5971
|
baseDir,
|
|
5818
5972
|
paths.recommended.relativeDirPath,
|
|
5819
5973
|
paths.recommended.relativeFilePath
|
|
5820
5974
|
);
|
|
5821
|
-
const legacyPath =
|
|
5975
|
+
const legacyPath = join42(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
5822
5976
|
if (await fileExists(recommendedPath)) {
|
|
5823
5977
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
5824
5978
|
return new _RulesyncMcp({
|
|
@@ -5972,7 +6126,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
5972
6126
|
global = false
|
|
5973
6127
|
}) {
|
|
5974
6128
|
const paths = this.getSettablePaths({ global });
|
|
5975
|
-
const fileContent = await readFileContentOrNull(
|
|
6129
|
+
const fileContent = await readFileContentOrNull(join43(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
5976
6130
|
const json = JSON.parse(fileContent);
|
|
5977
6131
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
5978
6132
|
return new _ClaudecodeMcp({
|
|
@@ -5991,7 +6145,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
5991
6145
|
}) {
|
|
5992
6146
|
const paths = this.getSettablePaths({ global });
|
|
5993
6147
|
const fileContent = await readOrInitializeFileContent(
|
|
5994
|
-
|
|
6148
|
+
join43(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
5995
6149
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
5996
6150
|
);
|
|
5997
6151
|
const json = JSON.parse(fileContent);
|
|
@@ -6030,7 +6184,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
6030
6184
|
};
|
|
6031
6185
|
|
|
6032
6186
|
// src/features/mcp/cline-mcp.ts
|
|
6033
|
-
import { join as
|
|
6187
|
+
import { join as join44 } from "path";
|
|
6034
6188
|
var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
6035
6189
|
json;
|
|
6036
6190
|
constructor(params) {
|
|
@@ -6051,7 +6205,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
6051
6205
|
validate = true
|
|
6052
6206
|
}) {
|
|
6053
6207
|
const fileContent = await readFileContent(
|
|
6054
|
-
|
|
6208
|
+
join44(
|
|
6055
6209
|
baseDir,
|
|
6056
6210
|
this.getSettablePaths().relativeDirPath,
|
|
6057
6211
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6100,7 +6254,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
6100
6254
|
};
|
|
6101
6255
|
|
|
6102
6256
|
// src/features/mcp/codexcli-mcp.ts
|
|
6103
|
-
import { join as
|
|
6257
|
+
import { join as join45 } from "path";
|
|
6104
6258
|
import * as smolToml from "smol-toml";
|
|
6105
6259
|
function convertFromCodexFormat(codexMcp) {
|
|
6106
6260
|
const result = {};
|
|
@@ -6183,7 +6337,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
6183
6337
|
global = false
|
|
6184
6338
|
}) {
|
|
6185
6339
|
const paths = this.getSettablePaths({ global });
|
|
6186
|
-
const fileContent = await readFileContentOrNull(
|
|
6340
|
+
const fileContent = await readFileContentOrNull(join45(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
|
|
6187
6341
|
return new _CodexcliMcp({
|
|
6188
6342
|
baseDir,
|
|
6189
6343
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -6199,7 +6353,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
6199
6353
|
global = false
|
|
6200
6354
|
}) {
|
|
6201
6355
|
const paths = this.getSettablePaths({ global });
|
|
6202
|
-
const configTomlFilePath =
|
|
6356
|
+
const configTomlFilePath = join45(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
6203
6357
|
const configTomlFileContent = await readOrInitializeFileContent(
|
|
6204
6358
|
configTomlFilePath,
|
|
6205
6359
|
smolToml.stringify({})
|
|
@@ -6253,7 +6407,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
6253
6407
|
};
|
|
6254
6408
|
|
|
6255
6409
|
// src/features/mcp/copilot-mcp.ts
|
|
6256
|
-
import { join as
|
|
6410
|
+
import { join as join46 } from "path";
|
|
6257
6411
|
function convertToCopilotFormat(mcpServers) {
|
|
6258
6412
|
return { servers: mcpServers };
|
|
6259
6413
|
}
|
|
@@ -6280,7 +6434,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
6280
6434
|
validate = true
|
|
6281
6435
|
}) {
|
|
6282
6436
|
const fileContent = await readFileContent(
|
|
6283
|
-
|
|
6437
|
+
join46(
|
|
6284
6438
|
baseDir,
|
|
6285
6439
|
this.getSettablePaths().relativeDirPath,
|
|
6286
6440
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6333,7 +6487,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
6333
6487
|
};
|
|
6334
6488
|
|
|
6335
6489
|
// src/features/mcp/cursor-mcp.ts
|
|
6336
|
-
import { join as
|
|
6490
|
+
import { join as join47 } from "path";
|
|
6337
6491
|
var CURSOR_ENV_VAR_PATTERN = /\$\{env:([^}]+)\}/g;
|
|
6338
6492
|
function isMcpServers(value) {
|
|
6339
6493
|
return value !== void 0 && value !== null && typeof value === "object";
|
|
@@ -6383,7 +6537,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
6383
6537
|
this.json = JSON.parse(this.fileContent);
|
|
6384
6538
|
} catch (error) {
|
|
6385
6539
|
throw new Error(
|
|
6386
|
-
`Failed to parse Cursor MCP config at ${
|
|
6540
|
+
`Failed to parse Cursor MCP config at ${join47(this.relativeDirPath, this.relativeFilePath)}: ${formatError(error)}`,
|
|
6387
6541
|
{ cause: error }
|
|
6388
6542
|
);
|
|
6389
6543
|
}
|
|
@@ -6409,14 +6563,14 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
6409
6563
|
global = false
|
|
6410
6564
|
}) {
|
|
6411
6565
|
const paths = this.getSettablePaths({ global });
|
|
6412
|
-
const filePath =
|
|
6566
|
+
const filePath = join47(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
6413
6567
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"mcpServers":{}}';
|
|
6414
6568
|
let json;
|
|
6415
6569
|
try {
|
|
6416
6570
|
json = JSON.parse(fileContent);
|
|
6417
6571
|
} catch (error) {
|
|
6418
6572
|
throw new Error(
|
|
6419
|
-
`Failed to parse Cursor MCP config at ${
|
|
6573
|
+
`Failed to parse Cursor MCP config at ${join47(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
|
|
6420
6574
|
{ cause: error }
|
|
6421
6575
|
);
|
|
6422
6576
|
}
|
|
@@ -6438,7 +6592,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
6438
6592
|
}) {
|
|
6439
6593
|
const paths = this.getSettablePaths({ global });
|
|
6440
6594
|
const fileContent = await readOrInitializeFileContent(
|
|
6441
|
-
|
|
6595
|
+
join47(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
6442
6596
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
6443
6597
|
);
|
|
6444
6598
|
let json;
|
|
@@ -6446,7 +6600,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
6446
6600
|
json = JSON.parse(fileContent);
|
|
6447
6601
|
} catch (error) {
|
|
6448
6602
|
throw new Error(
|
|
6449
|
-
`Failed to parse Cursor MCP config at ${
|
|
6603
|
+
`Failed to parse Cursor MCP config at ${join47(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
|
|
6450
6604
|
{ cause: error }
|
|
6451
6605
|
);
|
|
6452
6606
|
}
|
|
@@ -6495,7 +6649,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
6495
6649
|
};
|
|
6496
6650
|
|
|
6497
6651
|
// src/features/mcp/factorydroid-mcp.ts
|
|
6498
|
-
import { join as
|
|
6652
|
+
import { join as join48 } from "path";
|
|
6499
6653
|
var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
6500
6654
|
json;
|
|
6501
6655
|
constructor(params) {
|
|
@@ -6516,7 +6670,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
6516
6670
|
validate = true
|
|
6517
6671
|
}) {
|
|
6518
6672
|
const fileContent = await readFileContent(
|
|
6519
|
-
|
|
6673
|
+
join48(
|
|
6520
6674
|
baseDir,
|
|
6521
6675
|
this.getSettablePaths().relativeDirPath,
|
|
6522
6676
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6570,7 +6724,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
6570
6724
|
};
|
|
6571
6725
|
|
|
6572
6726
|
// src/features/mcp/geminicli-mcp.ts
|
|
6573
|
-
import { join as
|
|
6727
|
+
import { join as join49 } from "path";
|
|
6574
6728
|
var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
6575
6729
|
json;
|
|
6576
6730
|
constructor(params) {
|
|
@@ -6598,7 +6752,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
6598
6752
|
global = false
|
|
6599
6753
|
}) {
|
|
6600
6754
|
const paths = this.getSettablePaths({ global });
|
|
6601
|
-
const fileContent = await readFileContentOrNull(
|
|
6755
|
+
const fileContent = await readFileContentOrNull(join49(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6602
6756
|
const json = JSON.parse(fileContent);
|
|
6603
6757
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
6604
6758
|
return new _GeminiCliMcp({
|
|
@@ -6617,7 +6771,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
6617
6771
|
}) {
|
|
6618
6772
|
const paths = this.getSettablePaths({ global });
|
|
6619
6773
|
const fileContent = await readOrInitializeFileContent(
|
|
6620
|
-
|
|
6774
|
+
join49(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
6621
6775
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
6622
6776
|
);
|
|
6623
6777
|
const json = JSON.parse(fileContent);
|
|
@@ -6662,7 +6816,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
6662
6816
|
};
|
|
6663
6817
|
|
|
6664
6818
|
// src/features/mcp/junie-mcp.ts
|
|
6665
|
-
import { join as
|
|
6819
|
+
import { join as join50 } from "path";
|
|
6666
6820
|
var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
6667
6821
|
json;
|
|
6668
6822
|
constructor(params) {
|
|
@@ -6674,7 +6828,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
6674
6828
|
}
|
|
6675
6829
|
static getSettablePaths() {
|
|
6676
6830
|
return {
|
|
6677
|
-
relativeDirPath:
|
|
6831
|
+
relativeDirPath: join50(".junie", "mcp"),
|
|
6678
6832
|
relativeFilePath: "mcp.json"
|
|
6679
6833
|
};
|
|
6680
6834
|
}
|
|
@@ -6683,7 +6837,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
6683
6837
|
validate = true
|
|
6684
6838
|
}) {
|
|
6685
6839
|
const fileContent = await readFileContent(
|
|
6686
|
-
|
|
6840
|
+
join50(
|
|
6687
6841
|
baseDir,
|
|
6688
6842
|
this.getSettablePaths().relativeDirPath,
|
|
6689
6843
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6732,7 +6886,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
6732
6886
|
};
|
|
6733
6887
|
|
|
6734
6888
|
// src/features/mcp/kilo-mcp.ts
|
|
6735
|
-
import { join as
|
|
6889
|
+
import { join as join51 } from "path";
|
|
6736
6890
|
var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
6737
6891
|
json;
|
|
6738
6892
|
constructor(params) {
|
|
@@ -6753,7 +6907,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
6753
6907
|
validate = true
|
|
6754
6908
|
}) {
|
|
6755
6909
|
const paths = this.getSettablePaths();
|
|
6756
|
-
const fileContent = await readFileContentOrNull(
|
|
6910
|
+
const fileContent = await readFileContentOrNull(join51(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6757
6911
|
return new _KiloMcp({
|
|
6758
6912
|
baseDir,
|
|
6759
6913
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -6801,7 +6955,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
6801
6955
|
};
|
|
6802
6956
|
|
|
6803
6957
|
// src/features/mcp/kiro-mcp.ts
|
|
6804
|
-
import { join as
|
|
6958
|
+
import { join as join52 } from "path";
|
|
6805
6959
|
var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
6806
6960
|
json;
|
|
6807
6961
|
constructor(params) {
|
|
@@ -6813,7 +6967,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
6813
6967
|
}
|
|
6814
6968
|
static getSettablePaths() {
|
|
6815
6969
|
return {
|
|
6816
|
-
relativeDirPath:
|
|
6970
|
+
relativeDirPath: join52(".kiro", "settings"),
|
|
6817
6971
|
relativeFilePath: "mcp.json"
|
|
6818
6972
|
};
|
|
6819
6973
|
}
|
|
@@ -6822,7 +6976,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
6822
6976
|
validate = true
|
|
6823
6977
|
}) {
|
|
6824
6978
|
const paths = this.getSettablePaths();
|
|
6825
|
-
const fileContent = await readFileContentOrNull(
|
|
6979
|
+
const fileContent = await readFileContentOrNull(join52(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6826
6980
|
return new _KiroMcp({
|
|
6827
6981
|
baseDir,
|
|
6828
6982
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -6870,30 +7024,30 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
6870
7024
|
};
|
|
6871
7025
|
|
|
6872
7026
|
// src/features/mcp/opencode-mcp.ts
|
|
6873
|
-
import { join as
|
|
7027
|
+
import { join as join53 } from "path";
|
|
6874
7028
|
import { parse as parseJsonc2 } from "jsonc-parser";
|
|
6875
|
-
import { z as
|
|
6876
|
-
var OpencodeMcpLocalServerSchema =
|
|
6877
|
-
type:
|
|
6878
|
-
command:
|
|
6879
|
-
environment:
|
|
6880
|
-
enabled:
|
|
6881
|
-
cwd:
|
|
7029
|
+
import { z as z22 } from "zod/mini";
|
|
7030
|
+
var OpencodeMcpLocalServerSchema = z22.object({
|
|
7031
|
+
type: z22.literal("local"),
|
|
7032
|
+
command: z22.array(z22.string()),
|
|
7033
|
+
environment: z22.optional(z22.record(z22.string(), z22.string())),
|
|
7034
|
+
enabled: z22._default(z22.boolean(), true),
|
|
7035
|
+
cwd: z22.optional(z22.string())
|
|
6882
7036
|
});
|
|
6883
|
-
var OpencodeMcpRemoteServerSchema =
|
|
6884
|
-
type:
|
|
6885
|
-
url:
|
|
6886
|
-
headers:
|
|
6887
|
-
enabled:
|
|
7037
|
+
var OpencodeMcpRemoteServerSchema = z22.object({
|
|
7038
|
+
type: z22.literal("remote"),
|
|
7039
|
+
url: z22.string(),
|
|
7040
|
+
headers: z22.optional(z22.record(z22.string(), z22.string())),
|
|
7041
|
+
enabled: z22._default(z22.boolean(), true)
|
|
6888
7042
|
});
|
|
6889
|
-
var OpencodeMcpServerSchema =
|
|
7043
|
+
var OpencodeMcpServerSchema = z22.union([
|
|
6890
7044
|
OpencodeMcpLocalServerSchema,
|
|
6891
7045
|
OpencodeMcpRemoteServerSchema
|
|
6892
7046
|
]);
|
|
6893
|
-
var OpencodeConfigSchema =
|
|
6894
|
-
$schema:
|
|
6895
|
-
mcp:
|
|
6896
|
-
tools:
|
|
7047
|
+
var OpencodeConfigSchema = z22.looseObject({
|
|
7048
|
+
$schema: z22.optional(z22.string()),
|
|
7049
|
+
mcp: z22.optional(z22.record(z22.string(), OpencodeMcpServerSchema)),
|
|
7050
|
+
tools: z22.optional(z22.record(z22.string(), z22.boolean()))
|
|
6897
7051
|
});
|
|
6898
7052
|
function convertFromOpencodeFormat(opencodeMcp, tools) {
|
|
6899
7053
|
return Object.fromEntries(
|
|
@@ -7011,7 +7165,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
7011
7165
|
static getSettablePaths({ global } = {}) {
|
|
7012
7166
|
if (global) {
|
|
7013
7167
|
return {
|
|
7014
|
-
relativeDirPath:
|
|
7168
|
+
relativeDirPath: join53(".config", "opencode"),
|
|
7015
7169
|
relativeFilePath: "opencode.json"
|
|
7016
7170
|
};
|
|
7017
7171
|
}
|
|
@@ -7026,11 +7180,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
7026
7180
|
global = false
|
|
7027
7181
|
}) {
|
|
7028
7182
|
const basePaths = this.getSettablePaths({ global });
|
|
7029
|
-
const jsonDir =
|
|
7183
|
+
const jsonDir = join53(baseDir, basePaths.relativeDirPath);
|
|
7030
7184
|
let fileContent = null;
|
|
7031
7185
|
let relativeFilePath = "opencode.jsonc";
|
|
7032
|
-
const jsoncPath =
|
|
7033
|
-
const jsonPath =
|
|
7186
|
+
const jsoncPath = join53(jsonDir, "opencode.jsonc");
|
|
7187
|
+
const jsonPath = join53(jsonDir, "opencode.json");
|
|
7034
7188
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
7035
7189
|
if (!fileContent) {
|
|
7036
7190
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -7056,11 +7210,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
7056
7210
|
global = false
|
|
7057
7211
|
}) {
|
|
7058
7212
|
const basePaths = this.getSettablePaths({ global });
|
|
7059
|
-
const jsonDir =
|
|
7213
|
+
const jsonDir = join53(baseDir, basePaths.relativeDirPath);
|
|
7060
7214
|
let fileContent = null;
|
|
7061
7215
|
let relativeFilePath = "opencode.jsonc";
|
|
7062
|
-
const jsoncPath =
|
|
7063
|
-
const jsonPath =
|
|
7216
|
+
const jsoncPath = join53(jsonDir, "opencode.jsonc");
|
|
7217
|
+
const jsonPath = join53(jsonDir, "opencode.json");
|
|
7064
7218
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
7065
7219
|
if (!fileContent) {
|
|
7066
7220
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -7121,7 +7275,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
7121
7275
|
};
|
|
7122
7276
|
|
|
7123
7277
|
// src/features/mcp/roo-mcp.ts
|
|
7124
|
-
import { join as
|
|
7278
|
+
import { join as join54 } from "path";
|
|
7125
7279
|
function isRooMcpServers(value) {
|
|
7126
7280
|
return value !== void 0 && value !== null && typeof value === "object";
|
|
7127
7281
|
}
|
|
@@ -7173,7 +7327,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
7173
7327
|
validate = true
|
|
7174
7328
|
}) {
|
|
7175
7329
|
const fileContent = await readFileContent(
|
|
7176
|
-
|
|
7330
|
+
join54(
|
|
7177
7331
|
baseDir,
|
|
7178
7332
|
this.getSettablePaths().relativeDirPath,
|
|
7179
7333
|
this.getSettablePaths().relativeFilePath
|
|
@@ -7244,7 +7398,7 @@ var mcpProcessorToolTargetTuple = [
|
|
|
7244
7398
|
"opencode",
|
|
7245
7399
|
"roo"
|
|
7246
7400
|
];
|
|
7247
|
-
var McpProcessorToolTargetSchema =
|
|
7401
|
+
var McpProcessorToolTargetSchema = z23.enum(mcpProcessorToolTargetTuple);
|
|
7248
7402
|
var toolMcpFactories = /* @__PURE__ */ new Map([
|
|
7249
7403
|
[
|
|
7250
7404
|
"claudecode",
|
|
@@ -7546,25 +7700,25 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
7546
7700
|
};
|
|
7547
7701
|
|
|
7548
7702
|
// src/features/rules/rules-processor.ts
|
|
7549
|
-
import { basename as basename10, dirname as dirname3, join as
|
|
7703
|
+
import { basename as basename10, dirname as dirname3, join as join116, relative as relative5 } from "path";
|
|
7550
7704
|
import { encode } from "@toon-format/toon";
|
|
7551
|
-
import { z as
|
|
7705
|
+
import { z as z57 } from "zod/mini";
|
|
7552
7706
|
|
|
7553
7707
|
// src/constants/general.ts
|
|
7554
7708
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
7555
7709
|
|
|
7556
7710
|
// src/features/skills/agentsmd-skill.ts
|
|
7557
|
-
import { join as
|
|
7711
|
+
import { join as join58 } from "path";
|
|
7558
7712
|
|
|
7559
7713
|
// src/features/skills/simulated-skill.ts
|
|
7560
|
-
import { join as
|
|
7561
|
-
import { z as
|
|
7714
|
+
import { join as join57 } from "path";
|
|
7715
|
+
import { z as z24 } from "zod/mini";
|
|
7562
7716
|
|
|
7563
7717
|
// src/features/skills/tool-skill.ts
|
|
7564
|
-
import { join as
|
|
7718
|
+
import { join as join56 } from "path";
|
|
7565
7719
|
|
|
7566
7720
|
// src/types/ai-dir.ts
|
|
7567
|
-
import path2, { basename as basename3, join as
|
|
7721
|
+
import path2, { basename as basename3, join as join55, relative as relative4, resolve as resolve4 } from "path";
|
|
7568
7722
|
var AiDir = class {
|
|
7569
7723
|
/**
|
|
7570
7724
|
* @example "."
|
|
@@ -7658,8 +7812,8 @@ var AiDir = class {
|
|
|
7658
7812
|
* @returns Array of files with their relative paths and buffers
|
|
7659
7813
|
*/
|
|
7660
7814
|
static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
|
|
7661
|
-
const dirPath =
|
|
7662
|
-
const glob =
|
|
7815
|
+
const dirPath = join55(baseDir, relativeDirPath, dirName);
|
|
7816
|
+
const glob = join55(dirPath, "**", "*");
|
|
7663
7817
|
const filePaths = await findFilesByGlobs(glob, { type: "file" });
|
|
7664
7818
|
const filteredPaths = filePaths.filter((filePath) => basename3(filePath) !== excludeFileName);
|
|
7665
7819
|
const files = await Promise.all(
|
|
@@ -7757,8 +7911,8 @@ var ToolSkill = class extends AiDir {
|
|
|
7757
7911
|
}) {
|
|
7758
7912
|
const settablePaths = getSettablePaths({ global });
|
|
7759
7913
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
7760
|
-
const skillDirPath =
|
|
7761
|
-
const skillFilePath =
|
|
7914
|
+
const skillDirPath = join56(baseDir, actualRelativeDirPath, dirName);
|
|
7915
|
+
const skillFilePath = join56(skillDirPath, SKILL_FILE_NAME);
|
|
7762
7916
|
if (!await fileExists(skillFilePath)) {
|
|
7763
7917
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
7764
7918
|
}
|
|
@@ -7782,16 +7936,16 @@ var ToolSkill = class extends AiDir {
|
|
|
7782
7936
|
}
|
|
7783
7937
|
requireMainFileFrontmatter() {
|
|
7784
7938
|
if (!this.mainFile?.frontmatter) {
|
|
7785
|
-
throw new Error(`Frontmatter is not defined in ${
|
|
7939
|
+
throw new Error(`Frontmatter is not defined in ${join56(this.relativeDirPath, this.dirName)}`);
|
|
7786
7940
|
}
|
|
7787
7941
|
return this.mainFile.frontmatter;
|
|
7788
7942
|
}
|
|
7789
7943
|
};
|
|
7790
7944
|
|
|
7791
7945
|
// src/features/skills/simulated-skill.ts
|
|
7792
|
-
var SimulatedSkillFrontmatterSchema =
|
|
7793
|
-
name:
|
|
7794
|
-
description:
|
|
7946
|
+
var SimulatedSkillFrontmatterSchema = z24.looseObject({
|
|
7947
|
+
name: z24.string(),
|
|
7948
|
+
description: z24.string()
|
|
7795
7949
|
});
|
|
7796
7950
|
var SimulatedSkill = class extends ToolSkill {
|
|
7797
7951
|
frontmatter;
|
|
@@ -7822,7 +7976,7 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
7822
7976
|
const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
|
|
7823
7977
|
if (!result.success) {
|
|
7824
7978
|
throw new Error(
|
|
7825
|
-
`Invalid frontmatter in ${
|
|
7979
|
+
`Invalid frontmatter in ${join57(relativeDirPath, dirName)}: ${formatError(result.error)}`
|
|
7826
7980
|
);
|
|
7827
7981
|
}
|
|
7828
7982
|
}
|
|
@@ -7881,8 +8035,8 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
7881
8035
|
}) {
|
|
7882
8036
|
const settablePaths = this.getSettablePaths();
|
|
7883
8037
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
7884
|
-
const skillDirPath =
|
|
7885
|
-
const skillFilePath =
|
|
8038
|
+
const skillDirPath = join57(baseDir, actualRelativeDirPath, dirName);
|
|
8039
|
+
const skillFilePath = join57(skillDirPath, SKILL_FILE_NAME);
|
|
7886
8040
|
if (!await fileExists(skillFilePath)) {
|
|
7887
8041
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
7888
8042
|
}
|
|
@@ -7959,7 +8113,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
7959
8113
|
throw new Error("AgentsmdSkill does not support global mode.");
|
|
7960
8114
|
}
|
|
7961
8115
|
return {
|
|
7962
|
-
relativeDirPath:
|
|
8116
|
+
relativeDirPath: join58(".agents", "skills")
|
|
7963
8117
|
};
|
|
7964
8118
|
}
|
|
7965
8119
|
static async fromDir(params) {
|
|
@@ -7986,11 +8140,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
7986
8140
|
};
|
|
7987
8141
|
|
|
7988
8142
|
// src/features/skills/factorydroid-skill.ts
|
|
7989
|
-
import { join as
|
|
8143
|
+
import { join as join59 } from "path";
|
|
7990
8144
|
var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
7991
8145
|
static getSettablePaths(_options) {
|
|
7992
8146
|
return {
|
|
7993
|
-
relativeDirPath:
|
|
8147
|
+
relativeDirPath: join59(".factory", "skills")
|
|
7994
8148
|
};
|
|
7995
8149
|
}
|
|
7996
8150
|
static async fromDir(params) {
|
|
@@ -8017,11 +8171,11 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
|
8017
8171
|
};
|
|
8018
8172
|
|
|
8019
8173
|
// src/features/skills/skills-processor.ts
|
|
8020
|
-
import { basename as basename5, join as
|
|
8021
|
-
import { z as
|
|
8174
|
+
import { basename as basename5, join as join77 } from "path";
|
|
8175
|
+
import { z as z40 } from "zod/mini";
|
|
8022
8176
|
|
|
8023
8177
|
// src/types/dir-feature-processor.ts
|
|
8024
|
-
import { join as
|
|
8178
|
+
import { join as join60 } from "path";
|
|
8025
8179
|
var DirFeatureProcessor = class {
|
|
8026
8180
|
baseDir;
|
|
8027
8181
|
dryRun;
|
|
@@ -8058,7 +8212,7 @@ var DirFeatureProcessor = class {
|
|
|
8058
8212
|
const mainFile = aiDir.getMainFile();
|
|
8059
8213
|
let mainFileContent;
|
|
8060
8214
|
if (mainFile) {
|
|
8061
|
-
const mainFilePath =
|
|
8215
|
+
const mainFilePath = join60(dirPath, mainFile.name);
|
|
8062
8216
|
const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter, {
|
|
8063
8217
|
avoidBlockScalars: this.avoidBlockScalars
|
|
8064
8218
|
});
|
|
@@ -8074,7 +8228,7 @@ var DirFeatureProcessor = class {
|
|
|
8074
8228
|
const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
|
|
8075
8229
|
otherFileContents.push(contentWithNewline);
|
|
8076
8230
|
if (!dirHasChanges) {
|
|
8077
|
-
const filePath =
|
|
8231
|
+
const filePath = join60(dirPath, file.relativeFilePathToDirPath);
|
|
8078
8232
|
const existingContent = await readFileContentOrNull(filePath);
|
|
8079
8233
|
if (existingContent !== contentWithNewline) {
|
|
8080
8234
|
dirHasChanges = true;
|
|
@@ -8088,22 +8242,22 @@ var DirFeatureProcessor = class {
|
|
|
8088
8242
|
if (this.dryRun) {
|
|
8089
8243
|
logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
|
|
8090
8244
|
if (mainFile) {
|
|
8091
|
-
logger.info(`[DRY RUN] Would write: ${
|
|
8092
|
-
changedPaths.push(
|
|
8245
|
+
logger.info(`[DRY RUN] Would write: ${join60(dirPath, mainFile.name)}`);
|
|
8246
|
+
changedPaths.push(join60(relativeDir, mainFile.name));
|
|
8093
8247
|
}
|
|
8094
8248
|
for (const file of otherFiles) {
|
|
8095
|
-
logger.info(`[DRY RUN] Would write: ${
|
|
8096
|
-
changedPaths.push(
|
|
8249
|
+
logger.info(`[DRY RUN] Would write: ${join60(dirPath, file.relativeFilePathToDirPath)}`);
|
|
8250
|
+
changedPaths.push(join60(relativeDir, file.relativeFilePathToDirPath));
|
|
8097
8251
|
}
|
|
8098
8252
|
} else {
|
|
8099
8253
|
await ensureDir(dirPath);
|
|
8100
8254
|
if (mainFile && mainFileContent) {
|
|
8101
|
-
const mainFilePath =
|
|
8255
|
+
const mainFilePath = join60(dirPath, mainFile.name);
|
|
8102
8256
|
await writeFileContent(mainFilePath, mainFileContent);
|
|
8103
|
-
changedPaths.push(
|
|
8257
|
+
changedPaths.push(join60(relativeDir, mainFile.name));
|
|
8104
8258
|
}
|
|
8105
8259
|
for (const [i, file] of otherFiles.entries()) {
|
|
8106
|
-
const filePath =
|
|
8260
|
+
const filePath = join60(dirPath, file.relativeFilePathToDirPath);
|
|
8107
8261
|
const content = otherFileContents[i];
|
|
8108
8262
|
if (content === void 0) {
|
|
8109
8263
|
throw new Error(
|
|
@@ -8111,7 +8265,7 @@ var DirFeatureProcessor = class {
|
|
|
8111
8265
|
);
|
|
8112
8266
|
}
|
|
8113
8267
|
await writeFileContent(filePath, content);
|
|
8114
|
-
changedPaths.push(
|
|
8268
|
+
changedPaths.push(join60(relativeDir, file.relativeFilePathToDirPath));
|
|
8115
8269
|
}
|
|
8116
8270
|
}
|
|
8117
8271
|
changedCount++;
|
|
@@ -8143,40 +8297,40 @@ var DirFeatureProcessor = class {
|
|
|
8143
8297
|
};
|
|
8144
8298
|
|
|
8145
8299
|
// src/features/skills/agentsskills-skill.ts
|
|
8146
|
-
import { join as
|
|
8147
|
-
import { z as
|
|
8300
|
+
import { join as join62 } from "path";
|
|
8301
|
+
import { z as z26 } from "zod/mini";
|
|
8148
8302
|
|
|
8149
8303
|
// src/features/skills/rulesync-skill.ts
|
|
8150
|
-
import { join as
|
|
8151
|
-
import { z as
|
|
8152
|
-
var RulesyncSkillFrontmatterSchemaInternal =
|
|
8153
|
-
name:
|
|
8154
|
-
description:
|
|
8155
|
-
targets:
|
|
8156
|
-
claudecode:
|
|
8157
|
-
|
|
8158
|
-
"allowed-tools":
|
|
8159
|
-
model:
|
|
8160
|
-
"disable-model-invocation":
|
|
8304
|
+
import { join as join61 } from "path";
|
|
8305
|
+
import { z as z25 } from "zod/mini";
|
|
8306
|
+
var RulesyncSkillFrontmatterSchemaInternal = z25.looseObject({
|
|
8307
|
+
name: z25.string(),
|
|
8308
|
+
description: z25.string(),
|
|
8309
|
+
targets: z25._default(RulesyncTargetsSchema, ["*"]),
|
|
8310
|
+
claudecode: z25.optional(
|
|
8311
|
+
z25.looseObject({
|
|
8312
|
+
"allowed-tools": z25.optional(z25.array(z25.string())),
|
|
8313
|
+
model: z25.optional(z25.string()),
|
|
8314
|
+
"disable-model-invocation": z25.optional(z25.boolean())
|
|
8161
8315
|
})
|
|
8162
8316
|
),
|
|
8163
|
-
codexcli:
|
|
8164
|
-
|
|
8165
|
-
"short-description":
|
|
8317
|
+
codexcli: z25.optional(
|
|
8318
|
+
z25.looseObject({
|
|
8319
|
+
"short-description": z25.optional(z25.string())
|
|
8166
8320
|
})
|
|
8167
8321
|
),
|
|
8168
|
-
opencode:
|
|
8169
|
-
|
|
8170
|
-
"allowed-tools":
|
|
8322
|
+
opencode: z25.optional(
|
|
8323
|
+
z25.looseObject({
|
|
8324
|
+
"allowed-tools": z25.optional(z25.array(z25.string()))
|
|
8171
8325
|
})
|
|
8172
8326
|
),
|
|
8173
|
-
copilot:
|
|
8174
|
-
|
|
8175
|
-
license:
|
|
8327
|
+
copilot: z25.optional(
|
|
8328
|
+
z25.looseObject({
|
|
8329
|
+
license: z25.optional(z25.string())
|
|
8176
8330
|
})
|
|
8177
8331
|
),
|
|
8178
|
-
cline:
|
|
8179
|
-
roo:
|
|
8332
|
+
cline: z25.optional(z25.looseObject({})),
|
|
8333
|
+
roo: z25.optional(z25.looseObject({}))
|
|
8180
8334
|
});
|
|
8181
8335
|
var RulesyncSkillFrontmatterSchema = RulesyncSkillFrontmatterSchemaInternal;
|
|
8182
8336
|
var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
@@ -8216,7 +8370,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
8216
8370
|
}
|
|
8217
8371
|
getFrontmatter() {
|
|
8218
8372
|
if (!this.mainFile?.frontmatter) {
|
|
8219
|
-
throw new Error(`Frontmatter is not defined in ${
|
|
8373
|
+
throw new Error(`Frontmatter is not defined in ${join61(this.relativeDirPath, this.dirName)}`);
|
|
8220
8374
|
}
|
|
8221
8375
|
const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
|
|
8222
8376
|
return result;
|
|
@@ -8242,8 +8396,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
8242
8396
|
dirName,
|
|
8243
8397
|
global = false
|
|
8244
8398
|
}) {
|
|
8245
|
-
const skillDirPath =
|
|
8246
|
-
const skillFilePath =
|
|
8399
|
+
const skillDirPath = join61(baseDir, relativeDirPath, dirName);
|
|
8400
|
+
const skillFilePath = join61(skillDirPath, SKILL_FILE_NAME);
|
|
8247
8401
|
if (!await fileExists(skillFilePath)) {
|
|
8248
8402
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
8249
8403
|
}
|
|
@@ -8273,14 +8427,14 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
8273
8427
|
};
|
|
8274
8428
|
|
|
8275
8429
|
// src/features/skills/agentsskills-skill.ts
|
|
8276
|
-
var AgentsSkillsSkillFrontmatterSchema =
|
|
8277
|
-
name:
|
|
8278
|
-
description:
|
|
8430
|
+
var AgentsSkillsSkillFrontmatterSchema = z26.looseObject({
|
|
8431
|
+
name: z26.string(),
|
|
8432
|
+
description: z26.string()
|
|
8279
8433
|
});
|
|
8280
8434
|
var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
8281
8435
|
constructor({
|
|
8282
8436
|
baseDir = process.cwd(),
|
|
8283
|
-
relativeDirPath =
|
|
8437
|
+
relativeDirPath = join62(".agents", "skills"),
|
|
8284
8438
|
dirName,
|
|
8285
8439
|
frontmatter,
|
|
8286
8440
|
body,
|
|
@@ -8312,7 +8466,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
8312
8466
|
throw new Error("AgentsSkillsSkill does not support global mode.");
|
|
8313
8467
|
}
|
|
8314
8468
|
return {
|
|
8315
|
-
relativeDirPath:
|
|
8469
|
+
relativeDirPath: join62(".agents", "skills")
|
|
8316
8470
|
};
|
|
8317
8471
|
}
|
|
8318
8472
|
getFrontmatter() {
|
|
@@ -8392,9 +8546,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
8392
8546
|
});
|
|
8393
8547
|
const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8394
8548
|
if (!result.success) {
|
|
8395
|
-
const skillDirPath =
|
|
8549
|
+
const skillDirPath = join62(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8396
8550
|
throw new Error(
|
|
8397
|
-
`Invalid frontmatter in ${
|
|
8551
|
+
`Invalid frontmatter in ${join62(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8398
8552
|
);
|
|
8399
8553
|
}
|
|
8400
8554
|
return new _AgentsSkillsSkill({
|
|
@@ -8429,16 +8583,16 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
8429
8583
|
};
|
|
8430
8584
|
|
|
8431
8585
|
// src/features/skills/antigravity-skill.ts
|
|
8432
|
-
import { join as
|
|
8433
|
-
import { z as
|
|
8434
|
-
var AntigravitySkillFrontmatterSchema =
|
|
8435
|
-
name:
|
|
8436
|
-
description:
|
|
8586
|
+
import { join as join63 } from "path";
|
|
8587
|
+
import { z as z27 } from "zod/mini";
|
|
8588
|
+
var AntigravitySkillFrontmatterSchema = z27.looseObject({
|
|
8589
|
+
name: z27.string(),
|
|
8590
|
+
description: z27.string()
|
|
8437
8591
|
});
|
|
8438
8592
|
var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
8439
8593
|
constructor({
|
|
8440
8594
|
baseDir = process.cwd(),
|
|
8441
|
-
relativeDirPath =
|
|
8595
|
+
relativeDirPath = join63(".agent", "skills"),
|
|
8442
8596
|
dirName,
|
|
8443
8597
|
frontmatter,
|
|
8444
8598
|
body,
|
|
@@ -8470,11 +8624,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
8470
8624
|
} = {}) {
|
|
8471
8625
|
if (global) {
|
|
8472
8626
|
return {
|
|
8473
|
-
relativeDirPath:
|
|
8627
|
+
relativeDirPath: join63(".gemini", "antigravity", "skills")
|
|
8474
8628
|
};
|
|
8475
8629
|
}
|
|
8476
8630
|
return {
|
|
8477
|
-
relativeDirPath:
|
|
8631
|
+
relativeDirPath: join63(".agent", "skills")
|
|
8478
8632
|
};
|
|
8479
8633
|
}
|
|
8480
8634
|
getFrontmatter() {
|
|
@@ -8554,9 +8708,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
8554
8708
|
});
|
|
8555
8709
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8556
8710
|
if (!result.success) {
|
|
8557
|
-
const skillDirPath =
|
|
8711
|
+
const skillDirPath = join63(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8558
8712
|
throw new Error(
|
|
8559
|
-
`Invalid frontmatter in ${
|
|
8713
|
+
`Invalid frontmatter in ${join63(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8560
8714
|
);
|
|
8561
8715
|
}
|
|
8562
8716
|
return new _AntigravitySkill({
|
|
@@ -8590,19 +8744,19 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
8590
8744
|
};
|
|
8591
8745
|
|
|
8592
8746
|
// src/features/skills/claudecode-skill.ts
|
|
8593
|
-
import { join as
|
|
8594
|
-
import { z as
|
|
8595
|
-
var ClaudecodeSkillFrontmatterSchema =
|
|
8596
|
-
name:
|
|
8597
|
-
description:
|
|
8598
|
-
"allowed-tools":
|
|
8599
|
-
model:
|
|
8600
|
-
"disable-model-invocation":
|
|
8747
|
+
import { join as join64 } from "path";
|
|
8748
|
+
import { z as z28 } from "zod/mini";
|
|
8749
|
+
var ClaudecodeSkillFrontmatterSchema = z28.looseObject({
|
|
8750
|
+
name: z28.string(),
|
|
8751
|
+
description: z28.string(),
|
|
8752
|
+
"allowed-tools": z28.optional(z28.array(z28.string())),
|
|
8753
|
+
model: z28.optional(z28.string()),
|
|
8754
|
+
"disable-model-invocation": z28.optional(z28.boolean())
|
|
8601
8755
|
});
|
|
8602
8756
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
8603
8757
|
constructor({
|
|
8604
8758
|
baseDir = process.cwd(),
|
|
8605
|
-
relativeDirPath =
|
|
8759
|
+
relativeDirPath = join64(".claude", "skills"),
|
|
8606
8760
|
dirName,
|
|
8607
8761
|
frontmatter,
|
|
8608
8762
|
body,
|
|
@@ -8633,7 +8787,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
8633
8787
|
global: _global = false
|
|
8634
8788
|
} = {}) {
|
|
8635
8789
|
return {
|
|
8636
|
-
relativeDirPath:
|
|
8790
|
+
relativeDirPath: join64(".claude", "skills")
|
|
8637
8791
|
};
|
|
8638
8792
|
}
|
|
8639
8793
|
getFrontmatter() {
|
|
@@ -8730,9 +8884,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
8730
8884
|
});
|
|
8731
8885
|
const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8732
8886
|
if (!result.success) {
|
|
8733
|
-
const skillDirPath =
|
|
8887
|
+
const skillDirPath = join64(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8734
8888
|
throw new Error(
|
|
8735
|
-
`Invalid frontmatter in ${
|
|
8889
|
+
`Invalid frontmatter in ${join64(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8736
8890
|
);
|
|
8737
8891
|
}
|
|
8738
8892
|
return new _ClaudecodeSkill({
|
|
@@ -8766,16 +8920,16 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
8766
8920
|
};
|
|
8767
8921
|
|
|
8768
8922
|
// src/features/skills/cline-skill.ts
|
|
8769
|
-
import { join as
|
|
8770
|
-
import { z as
|
|
8771
|
-
var ClineSkillFrontmatterSchema =
|
|
8772
|
-
name:
|
|
8773
|
-
description:
|
|
8923
|
+
import { join as join65 } from "path";
|
|
8924
|
+
import { z as z29 } from "zod/mini";
|
|
8925
|
+
var ClineSkillFrontmatterSchema = z29.looseObject({
|
|
8926
|
+
name: z29.string(),
|
|
8927
|
+
description: z29.string()
|
|
8774
8928
|
});
|
|
8775
8929
|
var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
8776
8930
|
constructor({
|
|
8777
8931
|
baseDir = process.cwd(),
|
|
8778
|
-
relativeDirPath =
|
|
8932
|
+
relativeDirPath = join65(".cline", "skills"),
|
|
8779
8933
|
dirName,
|
|
8780
8934
|
frontmatter,
|
|
8781
8935
|
body,
|
|
@@ -8804,7 +8958,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
8804
8958
|
}
|
|
8805
8959
|
static getSettablePaths(_options = {}) {
|
|
8806
8960
|
return {
|
|
8807
|
-
relativeDirPath:
|
|
8961
|
+
relativeDirPath: join65(".cline", "skills")
|
|
8808
8962
|
};
|
|
8809
8963
|
}
|
|
8810
8964
|
getFrontmatter() {
|
|
@@ -8892,13 +9046,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
8892
9046
|
});
|
|
8893
9047
|
const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8894
9048
|
if (!result.success) {
|
|
8895
|
-
const skillDirPath =
|
|
9049
|
+
const skillDirPath = join65(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8896
9050
|
throw new Error(
|
|
8897
|
-
`Invalid frontmatter in ${
|
|
9051
|
+
`Invalid frontmatter in ${join65(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8898
9052
|
);
|
|
8899
9053
|
}
|
|
8900
9054
|
if (result.data.name !== loaded.dirName) {
|
|
8901
|
-
const skillFilePath =
|
|
9055
|
+
const skillFilePath = join65(
|
|
8902
9056
|
loaded.baseDir,
|
|
8903
9057
|
loaded.relativeDirPath,
|
|
8904
9058
|
loaded.dirName,
|
|
@@ -8939,21 +9093,21 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
8939
9093
|
};
|
|
8940
9094
|
|
|
8941
9095
|
// src/features/skills/codexcli-skill.ts
|
|
8942
|
-
import { join as
|
|
8943
|
-
import { z as
|
|
8944
|
-
var CodexCliSkillFrontmatterSchema =
|
|
8945
|
-
name:
|
|
8946
|
-
description:
|
|
8947
|
-
metadata:
|
|
8948
|
-
|
|
8949
|
-
"short-description":
|
|
9096
|
+
import { join as join66 } from "path";
|
|
9097
|
+
import { z as z30 } from "zod/mini";
|
|
9098
|
+
var CodexCliSkillFrontmatterSchema = z30.looseObject({
|
|
9099
|
+
name: z30.string(),
|
|
9100
|
+
description: z30.string(),
|
|
9101
|
+
metadata: z30.optional(
|
|
9102
|
+
z30.looseObject({
|
|
9103
|
+
"short-description": z30.optional(z30.string())
|
|
8950
9104
|
})
|
|
8951
9105
|
)
|
|
8952
9106
|
});
|
|
8953
9107
|
var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
8954
9108
|
constructor({
|
|
8955
9109
|
baseDir = process.cwd(),
|
|
8956
|
-
relativeDirPath =
|
|
9110
|
+
relativeDirPath = join66(".codex", "skills"),
|
|
8957
9111
|
dirName,
|
|
8958
9112
|
frontmatter,
|
|
8959
9113
|
body,
|
|
@@ -8984,7 +9138,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
8984
9138
|
global: _global = false
|
|
8985
9139
|
} = {}) {
|
|
8986
9140
|
return {
|
|
8987
|
-
relativeDirPath:
|
|
9141
|
+
relativeDirPath: join66(".codex", "skills")
|
|
8988
9142
|
};
|
|
8989
9143
|
}
|
|
8990
9144
|
getFrontmatter() {
|
|
@@ -9074,9 +9228,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
9074
9228
|
});
|
|
9075
9229
|
const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9076
9230
|
if (!result.success) {
|
|
9077
|
-
const skillDirPath =
|
|
9231
|
+
const skillDirPath = join66(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9078
9232
|
throw new Error(
|
|
9079
|
-
`Invalid frontmatter in ${
|
|
9233
|
+
`Invalid frontmatter in ${join66(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9080
9234
|
);
|
|
9081
9235
|
}
|
|
9082
9236
|
return new _CodexCliSkill({
|
|
@@ -9110,17 +9264,17 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
9110
9264
|
};
|
|
9111
9265
|
|
|
9112
9266
|
// src/features/skills/copilot-skill.ts
|
|
9113
|
-
import { join as
|
|
9114
|
-
import { z as
|
|
9115
|
-
var CopilotSkillFrontmatterSchema =
|
|
9116
|
-
name:
|
|
9117
|
-
description:
|
|
9118
|
-
license:
|
|
9267
|
+
import { join as join67 } from "path";
|
|
9268
|
+
import { z as z31 } from "zod/mini";
|
|
9269
|
+
var CopilotSkillFrontmatterSchema = z31.looseObject({
|
|
9270
|
+
name: z31.string(),
|
|
9271
|
+
description: z31.string(),
|
|
9272
|
+
license: z31.optional(z31.string())
|
|
9119
9273
|
});
|
|
9120
9274
|
var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
9121
9275
|
constructor({
|
|
9122
9276
|
baseDir = process.cwd(),
|
|
9123
|
-
relativeDirPath =
|
|
9277
|
+
relativeDirPath = join67(".github", "skills"),
|
|
9124
9278
|
dirName,
|
|
9125
9279
|
frontmatter,
|
|
9126
9280
|
body,
|
|
@@ -9152,7 +9306,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
9152
9306
|
throw new Error("CopilotSkill does not support global mode.");
|
|
9153
9307
|
}
|
|
9154
9308
|
return {
|
|
9155
|
-
relativeDirPath:
|
|
9309
|
+
relativeDirPath: join67(".github", "skills")
|
|
9156
9310
|
};
|
|
9157
9311
|
}
|
|
9158
9312
|
getFrontmatter() {
|
|
@@ -9238,9 +9392,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
9238
9392
|
});
|
|
9239
9393
|
const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9240
9394
|
if (!result.success) {
|
|
9241
|
-
const skillDirPath =
|
|
9395
|
+
const skillDirPath = join67(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9242
9396
|
throw new Error(
|
|
9243
|
-
`Invalid frontmatter in ${
|
|
9397
|
+
`Invalid frontmatter in ${join67(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9244
9398
|
);
|
|
9245
9399
|
}
|
|
9246
9400
|
return new _CopilotSkill({
|
|
@@ -9275,16 +9429,16 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
9275
9429
|
};
|
|
9276
9430
|
|
|
9277
9431
|
// src/features/skills/cursor-skill.ts
|
|
9278
|
-
import { join as
|
|
9279
|
-
import { z as
|
|
9280
|
-
var CursorSkillFrontmatterSchema =
|
|
9281
|
-
name:
|
|
9282
|
-
description:
|
|
9432
|
+
import { join as join68 } from "path";
|
|
9433
|
+
import { z as z32 } from "zod/mini";
|
|
9434
|
+
var CursorSkillFrontmatterSchema = z32.looseObject({
|
|
9435
|
+
name: z32.string(),
|
|
9436
|
+
description: z32.string()
|
|
9283
9437
|
});
|
|
9284
9438
|
var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
9285
9439
|
constructor({
|
|
9286
9440
|
baseDir = process.cwd(),
|
|
9287
|
-
relativeDirPath =
|
|
9441
|
+
relativeDirPath = join68(".cursor", "skills"),
|
|
9288
9442
|
dirName,
|
|
9289
9443
|
frontmatter,
|
|
9290
9444
|
body,
|
|
@@ -9313,7 +9467,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
9313
9467
|
}
|
|
9314
9468
|
static getSettablePaths(_options) {
|
|
9315
9469
|
return {
|
|
9316
|
-
relativeDirPath:
|
|
9470
|
+
relativeDirPath: join68(".cursor", "skills")
|
|
9317
9471
|
};
|
|
9318
9472
|
}
|
|
9319
9473
|
getFrontmatter() {
|
|
@@ -9393,9 +9547,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
9393
9547
|
});
|
|
9394
9548
|
const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9395
9549
|
if (!result.success) {
|
|
9396
|
-
const skillDirPath =
|
|
9550
|
+
const skillDirPath = join68(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9397
9551
|
throw new Error(
|
|
9398
|
-
`Invalid frontmatter in ${
|
|
9552
|
+
`Invalid frontmatter in ${join68(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9399
9553
|
);
|
|
9400
9554
|
}
|
|
9401
9555
|
return new _CursorSkill({
|
|
@@ -9430,11 +9584,11 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
9430
9584
|
};
|
|
9431
9585
|
|
|
9432
9586
|
// src/features/skills/geminicli-skill.ts
|
|
9433
|
-
import { join as
|
|
9434
|
-
import { z as
|
|
9435
|
-
var GeminiCliSkillFrontmatterSchema =
|
|
9436
|
-
name:
|
|
9437
|
-
description:
|
|
9587
|
+
import { join as join69 } from "path";
|
|
9588
|
+
import { z as z33 } from "zod/mini";
|
|
9589
|
+
var GeminiCliSkillFrontmatterSchema = z33.looseObject({
|
|
9590
|
+
name: z33.string(),
|
|
9591
|
+
description: z33.string()
|
|
9438
9592
|
});
|
|
9439
9593
|
var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
9440
9594
|
constructor({
|
|
@@ -9470,7 +9624,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
9470
9624
|
global: _global = false
|
|
9471
9625
|
} = {}) {
|
|
9472
9626
|
return {
|
|
9473
|
-
relativeDirPath:
|
|
9627
|
+
relativeDirPath: join69(".gemini", "skills")
|
|
9474
9628
|
};
|
|
9475
9629
|
}
|
|
9476
9630
|
getFrontmatter() {
|
|
@@ -9550,9 +9704,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
9550
9704
|
});
|
|
9551
9705
|
const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9552
9706
|
if (!result.success) {
|
|
9553
|
-
const skillDirPath =
|
|
9707
|
+
const skillDirPath = join69(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9554
9708
|
throw new Error(
|
|
9555
|
-
`Invalid frontmatter in ${
|
|
9709
|
+
`Invalid frontmatter in ${join69(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9556
9710
|
);
|
|
9557
9711
|
}
|
|
9558
9712
|
return new _GeminiCliSkill({
|
|
@@ -9587,16 +9741,16 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
9587
9741
|
};
|
|
9588
9742
|
|
|
9589
9743
|
// src/features/skills/junie-skill.ts
|
|
9590
|
-
import { join as
|
|
9591
|
-
import { z as
|
|
9592
|
-
var JunieSkillFrontmatterSchema =
|
|
9593
|
-
name:
|
|
9594
|
-
description:
|
|
9744
|
+
import { join as join70 } from "path";
|
|
9745
|
+
import { z as z34 } from "zod/mini";
|
|
9746
|
+
var JunieSkillFrontmatterSchema = z34.looseObject({
|
|
9747
|
+
name: z34.string(),
|
|
9748
|
+
description: z34.string()
|
|
9595
9749
|
});
|
|
9596
9750
|
var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
9597
9751
|
constructor({
|
|
9598
9752
|
baseDir = process.cwd(),
|
|
9599
|
-
relativeDirPath =
|
|
9753
|
+
relativeDirPath = join70(".junie", "skills"),
|
|
9600
9754
|
dirName,
|
|
9601
9755
|
frontmatter,
|
|
9602
9756
|
body,
|
|
@@ -9628,7 +9782,7 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
9628
9782
|
throw new Error("JunieSkill does not support global mode.");
|
|
9629
9783
|
}
|
|
9630
9784
|
return {
|
|
9631
|
-
relativeDirPath:
|
|
9785
|
+
relativeDirPath: join70(".junie", "skills")
|
|
9632
9786
|
};
|
|
9633
9787
|
}
|
|
9634
9788
|
getFrontmatter() {
|
|
@@ -9715,13 +9869,13 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
9715
9869
|
});
|
|
9716
9870
|
const result = JunieSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9717
9871
|
if (!result.success) {
|
|
9718
|
-
const skillDirPath =
|
|
9872
|
+
const skillDirPath = join70(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9719
9873
|
throw new Error(
|
|
9720
|
-
`Invalid frontmatter in ${
|
|
9874
|
+
`Invalid frontmatter in ${join70(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9721
9875
|
);
|
|
9722
9876
|
}
|
|
9723
9877
|
if (result.data.name !== loaded.dirName) {
|
|
9724
|
-
const skillFilePath =
|
|
9878
|
+
const skillFilePath = join70(
|
|
9725
9879
|
loaded.baseDir,
|
|
9726
9880
|
loaded.relativeDirPath,
|
|
9727
9881
|
loaded.dirName,
|
|
@@ -9763,16 +9917,16 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
9763
9917
|
};
|
|
9764
9918
|
|
|
9765
9919
|
// src/features/skills/kilo-skill.ts
|
|
9766
|
-
import { join as
|
|
9767
|
-
import { z as
|
|
9768
|
-
var KiloSkillFrontmatterSchema =
|
|
9769
|
-
name:
|
|
9770
|
-
description:
|
|
9920
|
+
import { join as join71 } from "path";
|
|
9921
|
+
import { z as z35 } from "zod/mini";
|
|
9922
|
+
var KiloSkillFrontmatterSchema = z35.looseObject({
|
|
9923
|
+
name: z35.string(),
|
|
9924
|
+
description: z35.string()
|
|
9771
9925
|
});
|
|
9772
9926
|
var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
9773
9927
|
constructor({
|
|
9774
9928
|
baseDir = process.cwd(),
|
|
9775
|
-
relativeDirPath =
|
|
9929
|
+
relativeDirPath = join71(".kilocode", "skills"),
|
|
9776
9930
|
dirName,
|
|
9777
9931
|
frontmatter,
|
|
9778
9932
|
body,
|
|
@@ -9803,7 +9957,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
9803
9957
|
global: _global = false
|
|
9804
9958
|
} = {}) {
|
|
9805
9959
|
return {
|
|
9806
|
-
relativeDirPath:
|
|
9960
|
+
relativeDirPath: join71(".kilocode", "skills")
|
|
9807
9961
|
};
|
|
9808
9962
|
}
|
|
9809
9963
|
getFrontmatter() {
|
|
@@ -9891,13 +10045,13 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
9891
10045
|
});
|
|
9892
10046
|
const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9893
10047
|
if (!result.success) {
|
|
9894
|
-
const skillDirPath =
|
|
10048
|
+
const skillDirPath = join71(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9895
10049
|
throw new Error(
|
|
9896
|
-
`Invalid frontmatter in ${
|
|
10050
|
+
`Invalid frontmatter in ${join71(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9897
10051
|
);
|
|
9898
10052
|
}
|
|
9899
10053
|
if (result.data.name !== loaded.dirName) {
|
|
9900
|
-
const skillFilePath =
|
|
10054
|
+
const skillFilePath = join71(
|
|
9901
10055
|
loaded.baseDir,
|
|
9902
10056
|
loaded.relativeDirPath,
|
|
9903
10057
|
loaded.dirName,
|
|
@@ -9938,16 +10092,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
9938
10092
|
};
|
|
9939
10093
|
|
|
9940
10094
|
// src/features/skills/kiro-skill.ts
|
|
9941
|
-
import { join as
|
|
9942
|
-
import { z as
|
|
9943
|
-
var KiroSkillFrontmatterSchema =
|
|
9944
|
-
name:
|
|
9945
|
-
description:
|
|
10095
|
+
import { join as join72 } from "path";
|
|
10096
|
+
import { z as z36 } from "zod/mini";
|
|
10097
|
+
var KiroSkillFrontmatterSchema = z36.looseObject({
|
|
10098
|
+
name: z36.string(),
|
|
10099
|
+
description: z36.string()
|
|
9946
10100
|
});
|
|
9947
10101
|
var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
9948
10102
|
constructor({
|
|
9949
10103
|
baseDir = process.cwd(),
|
|
9950
|
-
relativeDirPath =
|
|
10104
|
+
relativeDirPath = join72(".kiro", "skills"),
|
|
9951
10105
|
dirName,
|
|
9952
10106
|
frontmatter,
|
|
9953
10107
|
body,
|
|
@@ -9979,7 +10133,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
9979
10133
|
throw new Error("KiroSkill does not support global mode.");
|
|
9980
10134
|
}
|
|
9981
10135
|
return {
|
|
9982
|
-
relativeDirPath:
|
|
10136
|
+
relativeDirPath: join72(".kiro", "skills")
|
|
9983
10137
|
};
|
|
9984
10138
|
}
|
|
9985
10139
|
getFrontmatter() {
|
|
@@ -10067,13 +10221,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
10067
10221
|
});
|
|
10068
10222
|
const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10069
10223
|
if (!result.success) {
|
|
10070
|
-
const skillDirPath =
|
|
10224
|
+
const skillDirPath = join72(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10071
10225
|
throw new Error(
|
|
10072
|
-
`Invalid frontmatter in ${
|
|
10226
|
+
`Invalid frontmatter in ${join72(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10073
10227
|
);
|
|
10074
10228
|
}
|
|
10075
10229
|
if (result.data.name !== loaded.dirName) {
|
|
10076
|
-
const skillFilePath =
|
|
10230
|
+
const skillFilePath = join72(
|
|
10077
10231
|
loaded.baseDir,
|
|
10078
10232
|
loaded.relativeDirPath,
|
|
10079
10233
|
loaded.dirName,
|
|
@@ -10115,17 +10269,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
10115
10269
|
};
|
|
10116
10270
|
|
|
10117
10271
|
// src/features/skills/opencode-skill.ts
|
|
10118
|
-
import { join as
|
|
10119
|
-
import { z as
|
|
10120
|
-
var OpenCodeSkillFrontmatterSchema =
|
|
10121
|
-
name:
|
|
10122
|
-
description:
|
|
10123
|
-
"allowed-tools":
|
|
10272
|
+
import { join as join73 } from "path";
|
|
10273
|
+
import { z as z37 } from "zod/mini";
|
|
10274
|
+
var OpenCodeSkillFrontmatterSchema = z37.looseObject({
|
|
10275
|
+
name: z37.string(),
|
|
10276
|
+
description: z37.string(),
|
|
10277
|
+
"allowed-tools": z37.optional(z37.array(z37.string()))
|
|
10124
10278
|
});
|
|
10125
10279
|
var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
10126
10280
|
constructor({
|
|
10127
10281
|
baseDir = process.cwd(),
|
|
10128
|
-
relativeDirPath =
|
|
10282
|
+
relativeDirPath = join73(".opencode", "skill"),
|
|
10129
10283
|
dirName,
|
|
10130
10284
|
frontmatter,
|
|
10131
10285
|
body,
|
|
@@ -10154,7 +10308,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
10154
10308
|
}
|
|
10155
10309
|
static getSettablePaths({ global = false } = {}) {
|
|
10156
10310
|
return {
|
|
10157
|
-
relativeDirPath: global ?
|
|
10311
|
+
relativeDirPath: global ? join73(".config", "opencode", "skill") : join73(".opencode", "skill")
|
|
10158
10312
|
};
|
|
10159
10313
|
}
|
|
10160
10314
|
getFrontmatter() {
|
|
@@ -10240,9 +10394,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
10240
10394
|
});
|
|
10241
10395
|
const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10242
10396
|
if (!result.success) {
|
|
10243
|
-
const skillDirPath =
|
|
10397
|
+
const skillDirPath = join73(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10244
10398
|
throw new Error(
|
|
10245
|
-
`Invalid frontmatter in ${
|
|
10399
|
+
`Invalid frontmatter in ${join73(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10246
10400
|
);
|
|
10247
10401
|
}
|
|
10248
10402
|
return new _OpenCodeSkill({
|
|
@@ -10276,16 +10430,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
10276
10430
|
};
|
|
10277
10431
|
|
|
10278
10432
|
// src/features/skills/replit-skill.ts
|
|
10279
|
-
import { join as
|
|
10280
|
-
import { z as
|
|
10281
|
-
var ReplitSkillFrontmatterSchema =
|
|
10282
|
-
name:
|
|
10283
|
-
description:
|
|
10433
|
+
import { join as join74 } from "path";
|
|
10434
|
+
import { z as z38 } from "zod/mini";
|
|
10435
|
+
var ReplitSkillFrontmatterSchema = z38.looseObject({
|
|
10436
|
+
name: z38.string(),
|
|
10437
|
+
description: z38.string()
|
|
10284
10438
|
});
|
|
10285
10439
|
var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
10286
10440
|
constructor({
|
|
10287
10441
|
baseDir = process.cwd(),
|
|
10288
|
-
relativeDirPath =
|
|
10442
|
+
relativeDirPath = join74(".agents", "skills"),
|
|
10289
10443
|
dirName,
|
|
10290
10444
|
frontmatter,
|
|
10291
10445
|
body,
|
|
@@ -10317,7 +10471,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
10317
10471
|
throw new Error("ReplitSkill does not support global mode.");
|
|
10318
10472
|
}
|
|
10319
10473
|
return {
|
|
10320
|
-
relativeDirPath:
|
|
10474
|
+
relativeDirPath: join74(".agents", "skills")
|
|
10321
10475
|
};
|
|
10322
10476
|
}
|
|
10323
10477
|
getFrontmatter() {
|
|
@@ -10397,9 +10551,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
10397
10551
|
});
|
|
10398
10552
|
const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10399
10553
|
if (!result.success) {
|
|
10400
|
-
const skillDirPath =
|
|
10554
|
+
const skillDirPath = join74(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10401
10555
|
throw new Error(
|
|
10402
|
-
`Invalid frontmatter in ${
|
|
10556
|
+
`Invalid frontmatter in ${join74(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10403
10557
|
);
|
|
10404
10558
|
}
|
|
10405
10559
|
return new _ReplitSkill({
|
|
@@ -10434,16 +10588,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
10434
10588
|
};
|
|
10435
10589
|
|
|
10436
10590
|
// src/features/skills/roo-skill.ts
|
|
10437
|
-
import { join as
|
|
10438
|
-
import { z as
|
|
10439
|
-
var RooSkillFrontmatterSchema =
|
|
10440
|
-
name:
|
|
10441
|
-
description:
|
|
10591
|
+
import { join as join75 } from "path";
|
|
10592
|
+
import { z as z39 } from "zod/mini";
|
|
10593
|
+
var RooSkillFrontmatterSchema = z39.looseObject({
|
|
10594
|
+
name: z39.string(),
|
|
10595
|
+
description: z39.string()
|
|
10442
10596
|
});
|
|
10443
10597
|
var RooSkill = class _RooSkill extends ToolSkill {
|
|
10444
10598
|
constructor({
|
|
10445
10599
|
baseDir = process.cwd(),
|
|
10446
|
-
relativeDirPath =
|
|
10600
|
+
relativeDirPath = join75(".roo", "skills"),
|
|
10447
10601
|
dirName,
|
|
10448
10602
|
frontmatter,
|
|
10449
10603
|
body,
|
|
@@ -10474,7 +10628,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
10474
10628
|
global: _global = false
|
|
10475
10629
|
} = {}) {
|
|
10476
10630
|
return {
|
|
10477
|
-
relativeDirPath:
|
|
10631
|
+
relativeDirPath: join75(".roo", "skills")
|
|
10478
10632
|
};
|
|
10479
10633
|
}
|
|
10480
10634
|
getFrontmatter() {
|
|
@@ -10562,13 +10716,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
10562
10716
|
});
|
|
10563
10717
|
const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10564
10718
|
if (!result.success) {
|
|
10565
|
-
const skillDirPath =
|
|
10719
|
+
const skillDirPath = join75(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10566
10720
|
throw new Error(
|
|
10567
|
-
`Invalid frontmatter in ${
|
|
10721
|
+
`Invalid frontmatter in ${join75(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10568
10722
|
);
|
|
10569
10723
|
}
|
|
10570
10724
|
if (result.data.name !== loaded.dirName) {
|
|
10571
|
-
const skillFilePath =
|
|
10725
|
+
const skillFilePath = join75(
|
|
10572
10726
|
loaded.baseDir,
|
|
10573
10727
|
loaded.relativeDirPath,
|
|
10574
10728
|
loaded.dirName,
|
|
@@ -10609,14 +10763,14 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
10609
10763
|
};
|
|
10610
10764
|
|
|
10611
10765
|
// src/features/skills/skills-utils.ts
|
|
10612
|
-
import { basename as basename4, join as
|
|
10766
|
+
import { basename as basename4, join as join76 } from "path";
|
|
10613
10767
|
async function getLocalSkillDirNames(baseDir) {
|
|
10614
|
-
const skillsDir =
|
|
10768
|
+
const skillsDir = join76(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
|
|
10615
10769
|
const names = /* @__PURE__ */ new Set();
|
|
10616
10770
|
if (!await directoryExists(skillsDir)) {
|
|
10617
10771
|
return names;
|
|
10618
10772
|
}
|
|
10619
|
-
const dirPaths = await findFilesByGlobs(
|
|
10773
|
+
const dirPaths = await findFilesByGlobs(join76(skillsDir, "*"), { type: "dir" });
|
|
10620
10774
|
for (const dirPath of dirPaths) {
|
|
10621
10775
|
const name = basename4(dirPath);
|
|
10622
10776
|
if (name === basename4(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
|
|
@@ -10645,7 +10799,7 @@ var skillsProcessorToolTargetTuple = [
|
|
|
10645
10799
|
"replit",
|
|
10646
10800
|
"roo"
|
|
10647
10801
|
];
|
|
10648
|
-
var SkillsProcessorToolTargetSchema =
|
|
10802
|
+
var SkillsProcessorToolTargetSchema = z40.enum(skillsProcessorToolTargetTuple);
|
|
10649
10803
|
var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
10650
10804
|
[
|
|
10651
10805
|
"agentsmd",
|
|
@@ -10854,10 +11008,10 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
10854
11008
|
)
|
|
10855
11009
|
);
|
|
10856
11010
|
const localSkillNames = new Set(localDirNames);
|
|
10857
|
-
const curatedDirPath =
|
|
11011
|
+
const curatedDirPath = join77(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
|
|
10858
11012
|
let curatedSkills = [];
|
|
10859
11013
|
if (await directoryExists(curatedDirPath)) {
|
|
10860
|
-
const curatedDirPaths = await findFilesByGlobs(
|
|
11014
|
+
const curatedDirPaths = await findFilesByGlobs(join77(curatedDirPath, "*"), { type: "dir" });
|
|
10861
11015
|
const curatedDirNames = curatedDirPaths.map((path3) => basename5(path3));
|
|
10862
11016
|
const nonConflicting = curatedDirNames.filter((name) => {
|
|
10863
11017
|
if (localSkillNames.has(name)) {
|
|
@@ -10891,8 +11045,8 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
10891
11045
|
async loadToolDirs() {
|
|
10892
11046
|
const factory = this.getFactory(this.toolTarget);
|
|
10893
11047
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
10894
|
-
const skillsDirPath =
|
|
10895
|
-
const dirPaths = await findFilesByGlobs(
|
|
11048
|
+
const skillsDirPath = join77(this.baseDir, paths.relativeDirPath);
|
|
11049
|
+
const dirPaths = await findFilesByGlobs(join77(skillsDirPath, "*"), { type: "dir" });
|
|
10896
11050
|
const dirNames = dirPaths.map((path3) => basename5(path3));
|
|
10897
11051
|
const toolSkills = await Promise.all(
|
|
10898
11052
|
dirNames.map(
|
|
@@ -10909,8 +11063,8 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
10909
11063
|
async loadToolDirsToDelete() {
|
|
10910
11064
|
const factory = this.getFactory(this.toolTarget);
|
|
10911
11065
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
10912
|
-
const skillsDirPath =
|
|
10913
|
-
const dirPaths = await findFilesByGlobs(
|
|
11066
|
+
const skillsDirPath = join77(this.baseDir, paths.relativeDirPath);
|
|
11067
|
+
const dirPaths = await findFilesByGlobs(join77(skillsDirPath, "*"), { type: "dir" });
|
|
10914
11068
|
const dirNames = dirPaths.map((path3) => basename5(path3));
|
|
10915
11069
|
const toolSkills = dirNames.map(
|
|
10916
11070
|
(dirName) => factory.class.forDeletion({
|
|
@@ -10972,11 +11126,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
10972
11126
|
};
|
|
10973
11127
|
|
|
10974
11128
|
// src/features/subagents/agentsmd-subagent.ts
|
|
10975
|
-
import { join as
|
|
11129
|
+
import { join as join79 } from "path";
|
|
10976
11130
|
|
|
10977
11131
|
// src/features/subagents/simulated-subagent.ts
|
|
10978
|
-
import { basename as basename6, join as
|
|
10979
|
-
import { z as
|
|
11132
|
+
import { basename as basename6, join as join78 } from "path";
|
|
11133
|
+
import { z as z41 } from "zod/mini";
|
|
10980
11134
|
|
|
10981
11135
|
// src/features/subagents/tool-subagent.ts
|
|
10982
11136
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -11028,9 +11182,9 @@ var ToolSubagent = class extends ToolFile {
|
|
|
11028
11182
|
};
|
|
11029
11183
|
|
|
11030
11184
|
// src/features/subagents/simulated-subagent.ts
|
|
11031
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
11032
|
-
name:
|
|
11033
|
-
description:
|
|
11185
|
+
var SimulatedSubagentFrontmatterSchema = z41.object({
|
|
11186
|
+
name: z41.string(),
|
|
11187
|
+
description: z41.optional(z41.string())
|
|
11034
11188
|
});
|
|
11035
11189
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
11036
11190
|
frontmatter;
|
|
@@ -11040,7 +11194,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
11040
11194
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11041
11195
|
if (!result.success) {
|
|
11042
11196
|
throw new Error(
|
|
11043
|
-
`Invalid frontmatter in ${
|
|
11197
|
+
`Invalid frontmatter in ${join78(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11044
11198
|
);
|
|
11045
11199
|
}
|
|
11046
11200
|
}
|
|
@@ -11091,7 +11245,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
11091
11245
|
return {
|
|
11092
11246
|
success: false,
|
|
11093
11247
|
error: new Error(
|
|
11094
|
-
`Invalid frontmatter in ${
|
|
11248
|
+
`Invalid frontmatter in ${join78(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11095
11249
|
)
|
|
11096
11250
|
};
|
|
11097
11251
|
}
|
|
@@ -11101,7 +11255,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
11101
11255
|
relativeFilePath,
|
|
11102
11256
|
validate = true
|
|
11103
11257
|
}) {
|
|
11104
|
-
const filePath =
|
|
11258
|
+
const filePath = join78(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
11105
11259
|
const fileContent = await readFileContent(filePath);
|
|
11106
11260
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
11107
11261
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -11137,7 +11291,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
11137
11291
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
11138
11292
|
static getSettablePaths() {
|
|
11139
11293
|
return {
|
|
11140
|
-
relativeDirPath:
|
|
11294
|
+
relativeDirPath: join79(".agents", "subagents")
|
|
11141
11295
|
};
|
|
11142
11296
|
}
|
|
11143
11297
|
static async fromFile(params) {
|
|
@@ -11160,11 +11314,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
11160
11314
|
};
|
|
11161
11315
|
|
|
11162
11316
|
// src/features/subagents/factorydroid-subagent.ts
|
|
11163
|
-
import { join as
|
|
11317
|
+
import { join as join80 } from "path";
|
|
11164
11318
|
var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
|
|
11165
11319
|
static getSettablePaths(_options) {
|
|
11166
11320
|
return {
|
|
11167
|
-
relativeDirPath:
|
|
11321
|
+
relativeDirPath: join80(".factory", "droids")
|
|
11168
11322
|
};
|
|
11169
11323
|
}
|
|
11170
11324
|
static async fromFile(params) {
|
|
@@ -11187,11 +11341,11 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
|
|
|
11187
11341
|
};
|
|
11188
11342
|
|
|
11189
11343
|
// src/features/subagents/geminicli-subagent.ts
|
|
11190
|
-
import { join as
|
|
11344
|
+
import { join as join81 } from "path";
|
|
11191
11345
|
var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
11192
11346
|
static getSettablePaths() {
|
|
11193
11347
|
return {
|
|
11194
|
-
relativeDirPath:
|
|
11348
|
+
relativeDirPath: join81(".gemini", "subagents")
|
|
11195
11349
|
};
|
|
11196
11350
|
}
|
|
11197
11351
|
static async fromFile(params) {
|
|
@@ -11214,11 +11368,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
|
11214
11368
|
};
|
|
11215
11369
|
|
|
11216
11370
|
// src/features/subagents/roo-subagent.ts
|
|
11217
|
-
import { join as
|
|
11371
|
+
import { join as join82 } from "path";
|
|
11218
11372
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
11219
11373
|
static getSettablePaths() {
|
|
11220
11374
|
return {
|
|
11221
|
-
relativeDirPath:
|
|
11375
|
+
relativeDirPath: join82(".roo", "subagents")
|
|
11222
11376
|
};
|
|
11223
11377
|
}
|
|
11224
11378
|
static async fromFile(params) {
|
|
@@ -11241,20 +11395,20 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
11241
11395
|
};
|
|
11242
11396
|
|
|
11243
11397
|
// src/features/subagents/subagents-processor.ts
|
|
11244
|
-
import { basename as basename9, join as
|
|
11245
|
-
import { z as
|
|
11398
|
+
import { basename as basename9, join as join91 } from "path";
|
|
11399
|
+
import { z as z50 } from "zod/mini";
|
|
11246
11400
|
|
|
11247
11401
|
// src/features/subagents/claudecode-subagent.ts
|
|
11248
|
-
import { join as
|
|
11249
|
-
import { z as
|
|
11402
|
+
import { join as join84 } from "path";
|
|
11403
|
+
import { z as z43 } from "zod/mini";
|
|
11250
11404
|
|
|
11251
11405
|
// src/features/subagents/rulesync-subagent.ts
|
|
11252
|
-
import { basename as basename7, join as
|
|
11253
|
-
import { z as
|
|
11254
|
-
var RulesyncSubagentFrontmatterSchema =
|
|
11255
|
-
targets:
|
|
11256
|
-
name:
|
|
11257
|
-
description:
|
|
11406
|
+
import { basename as basename7, join as join83 } from "path";
|
|
11407
|
+
import { z as z42 } from "zod/mini";
|
|
11408
|
+
var RulesyncSubagentFrontmatterSchema = z42.looseObject({
|
|
11409
|
+
targets: z42._default(RulesyncTargetsSchema, ["*"]),
|
|
11410
|
+
name: z42.string(),
|
|
11411
|
+
description: z42.optional(z42.string())
|
|
11258
11412
|
});
|
|
11259
11413
|
var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
11260
11414
|
frontmatter;
|
|
@@ -11263,7 +11417,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
11263
11417
|
const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11264
11418
|
if (!parseResult.success && rest.validate !== false) {
|
|
11265
11419
|
throw new Error(
|
|
11266
|
-
`Invalid frontmatter in ${
|
|
11420
|
+
`Invalid frontmatter in ${join83(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
11267
11421
|
);
|
|
11268
11422
|
}
|
|
11269
11423
|
const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
|
|
@@ -11296,7 +11450,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
11296
11450
|
return {
|
|
11297
11451
|
success: false,
|
|
11298
11452
|
error: new Error(
|
|
11299
|
-
`Invalid frontmatter in ${
|
|
11453
|
+
`Invalid frontmatter in ${join83(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11300
11454
|
)
|
|
11301
11455
|
};
|
|
11302
11456
|
}
|
|
@@ -11304,7 +11458,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
11304
11458
|
static async fromFile({
|
|
11305
11459
|
relativeFilePath
|
|
11306
11460
|
}) {
|
|
11307
|
-
const filePath =
|
|
11461
|
+
const filePath = join83(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
|
|
11308
11462
|
const fileContent = await readFileContent(filePath);
|
|
11309
11463
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
11310
11464
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -11323,13 +11477,13 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
11323
11477
|
};
|
|
11324
11478
|
|
|
11325
11479
|
// src/features/subagents/claudecode-subagent.ts
|
|
11326
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
11327
|
-
name:
|
|
11328
|
-
description:
|
|
11329
|
-
model:
|
|
11330
|
-
tools:
|
|
11331
|
-
permissionMode:
|
|
11332
|
-
skills:
|
|
11480
|
+
var ClaudecodeSubagentFrontmatterSchema = z43.looseObject({
|
|
11481
|
+
name: z43.string(),
|
|
11482
|
+
description: z43.optional(z43.string()),
|
|
11483
|
+
model: z43.optional(z43.string()),
|
|
11484
|
+
tools: z43.optional(z43.union([z43.string(), z43.array(z43.string())])),
|
|
11485
|
+
permissionMode: z43.optional(z43.string()),
|
|
11486
|
+
skills: z43.optional(z43.union([z43.string(), z43.array(z43.string())]))
|
|
11333
11487
|
});
|
|
11334
11488
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
11335
11489
|
frontmatter;
|
|
@@ -11339,7 +11493,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
11339
11493
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11340
11494
|
if (!result.success) {
|
|
11341
11495
|
throw new Error(
|
|
11342
|
-
`Invalid frontmatter in ${
|
|
11496
|
+
`Invalid frontmatter in ${join84(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11343
11497
|
);
|
|
11344
11498
|
}
|
|
11345
11499
|
}
|
|
@@ -11351,7 +11505,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
11351
11505
|
}
|
|
11352
11506
|
static getSettablePaths(_options = {}) {
|
|
11353
11507
|
return {
|
|
11354
|
-
relativeDirPath:
|
|
11508
|
+
relativeDirPath: join84(".claude", "agents")
|
|
11355
11509
|
};
|
|
11356
11510
|
}
|
|
11357
11511
|
getFrontmatter() {
|
|
@@ -11430,7 +11584,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
11430
11584
|
return {
|
|
11431
11585
|
success: false,
|
|
11432
11586
|
error: new Error(
|
|
11433
|
-
`Invalid frontmatter in ${
|
|
11587
|
+
`Invalid frontmatter in ${join84(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11434
11588
|
)
|
|
11435
11589
|
};
|
|
11436
11590
|
}
|
|
@@ -11448,7 +11602,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
11448
11602
|
global = false
|
|
11449
11603
|
}) {
|
|
11450
11604
|
const paths = this.getSettablePaths({ global });
|
|
11451
|
-
const filePath =
|
|
11605
|
+
const filePath = join84(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11452
11606
|
const fileContent = await readFileContent(filePath);
|
|
11453
11607
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
11454
11608
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -11483,16 +11637,16 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
11483
11637
|
};
|
|
11484
11638
|
|
|
11485
11639
|
// src/features/subagents/codexcli-subagent.ts
|
|
11486
|
-
import { join as
|
|
11640
|
+
import { join as join85 } from "path";
|
|
11487
11641
|
import * as smolToml2 from "smol-toml";
|
|
11488
|
-
import { z as
|
|
11489
|
-
var CodexCliSubagentTomlSchema =
|
|
11490
|
-
name:
|
|
11491
|
-
description:
|
|
11492
|
-
developer_instructions:
|
|
11493
|
-
model:
|
|
11494
|
-
model_reasoning_effort:
|
|
11495
|
-
sandbox_mode:
|
|
11642
|
+
import { z as z44 } from "zod/mini";
|
|
11643
|
+
var CodexCliSubagentTomlSchema = z44.looseObject({
|
|
11644
|
+
name: z44.string(),
|
|
11645
|
+
description: z44.optional(z44.string()),
|
|
11646
|
+
developer_instructions: z44.optional(z44.string()),
|
|
11647
|
+
model: z44.optional(z44.string()),
|
|
11648
|
+
model_reasoning_effort: z44.optional(z44.string()),
|
|
11649
|
+
sandbox_mode: z44.optional(z44.string())
|
|
11496
11650
|
});
|
|
11497
11651
|
var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
11498
11652
|
body;
|
|
@@ -11503,7 +11657,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
11503
11657
|
CodexCliSubagentTomlSchema.parse(parsed);
|
|
11504
11658
|
} catch (error) {
|
|
11505
11659
|
throw new Error(
|
|
11506
|
-
`Invalid TOML in ${
|
|
11660
|
+
`Invalid TOML in ${join85(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
11507
11661
|
{ cause: error }
|
|
11508
11662
|
);
|
|
11509
11663
|
}
|
|
@@ -11515,7 +11669,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
11515
11669
|
}
|
|
11516
11670
|
static getSettablePaths(_options = {}) {
|
|
11517
11671
|
return {
|
|
11518
|
-
relativeDirPath:
|
|
11672
|
+
relativeDirPath: join85(".codex", "agents")
|
|
11519
11673
|
};
|
|
11520
11674
|
}
|
|
11521
11675
|
getBody() {
|
|
@@ -11527,7 +11681,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
11527
11681
|
parsed = CodexCliSubagentTomlSchema.parse(smolToml2.parse(this.body));
|
|
11528
11682
|
} catch (error) {
|
|
11529
11683
|
throw new Error(
|
|
11530
|
-
`Failed to parse TOML in ${
|
|
11684
|
+
`Failed to parse TOML in ${join85(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
11531
11685
|
{ cause: error }
|
|
11532
11686
|
);
|
|
11533
11687
|
}
|
|
@@ -11608,7 +11762,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
11608
11762
|
global = false
|
|
11609
11763
|
}) {
|
|
11610
11764
|
const paths = this.getSettablePaths({ global });
|
|
11611
|
-
const filePath =
|
|
11765
|
+
const filePath = join85(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11612
11766
|
const fileContent = await readFileContent(filePath);
|
|
11613
11767
|
const subagent = new _CodexCliSubagent({
|
|
11614
11768
|
baseDir,
|
|
@@ -11646,13 +11800,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
11646
11800
|
};
|
|
11647
11801
|
|
|
11648
11802
|
// src/features/subagents/copilot-subagent.ts
|
|
11649
|
-
import { join as
|
|
11650
|
-
import { z as
|
|
11803
|
+
import { join as join86 } from "path";
|
|
11804
|
+
import { z as z45 } from "zod/mini";
|
|
11651
11805
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
11652
|
-
var CopilotSubagentFrontmatterSchema =
|
|
11653
|
-
name:
|
|
11654
|
-
description:
|
|
11655
|
-
tools:
|
|
11806
|
+
var CopilotSubagentFrontmatterSchema = z45.looseObject({
|
|
11807
|
+
name: z45.string(),
|
|
11808
|
+
description: z45.optional(z45.string()),
|
|
11809
|
+
tools: z45.optional(z45.union([z45.string(), z45.array(z45.string())]))
|
|
11656
11810
|
});
|
|
11657
11811
|
var normalizeTools = (tools) => {
|
|
11658
11812
|
if (!tools) {
|
|
@@ -11672,7 +11826,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
11672
11826
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11673
11827
|
if (!result.success) {
|
|
11674
11828
|
throw new Error(
|
|
11675
|
-
`Invalid frontmatter in ${
|
|
11829
|
+
`Invalid frontmatter in ${join86(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11676
11830
|
);
|
|
11677
11831
|
}
|
|
11678
11832
|
}
|
|
@@ -11684,7 +11838,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
11684
11838
|
}
|
|
11685
11839
|
static getSettablePaths(_options = {}) {
|
|
11686
11840
|
return {
|
|
11687
|
-
relativeDirPath:
|
|
11841
|
+
relativeDirPath: join86(".github", "agents")
|
|
11688
11842
|
};
|
|
11689
11843
|
}
|
|
11690
11844
|
getFrontmatter() {
|
|
@@ -11758,7 +11912,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
11758
11912
|
return {
|
|
11759
11913
|
success: false,
|
|
11760
11914
|
error: new Error(
|
|
11761
|
-
`Invalid frontmatter in ${
|
|
11915
|
+
`Invalid frontmatter in ${join86(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11762
11916
|
)
|
|
11763
11917
|
};
|
|
11764
11918
|
}
|
|
@@ -11776,7 +11930,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
11776
11930
|
global = false
|
|
11777
11931
|
}) {
|
|
11778
11932
|
const paths = this.getSettablePaths({ global });
|
|
11779
|
-
const filePath =
|
|
11933
|
+
const filePath = join86(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11780
11934
|
const fileContent = await readFileContent(filePath);
|
|
11781
11935
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
11782
11936
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -11812,11 +11966,11 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
11812
11966
|
};
|
|
11813
11967
|
|
|
11814
11968
|
// src/features/subagents/cursor-subagent.ts
|
|
11815
|
-
import { join as
|
|
11816
|
-
import { z as
|
|
11817
|
-
var CursorSubagentFrontmatterSchema =
|
|
11818
|
-
name:
|
|
11819
|
-
description:
|
|
11969
|
+
import { join as join87 } from "path";
|
|
11970
|
+
import { z as z46 } from "zod/mini";
|
|
11971
|
+
var CursorSubagentFrontmatterSchema = z46.looseObject({
|
|
11972
|
+
name: z46.string(),
|
|
11973
|
+
description: z46.optional(z46.string())
|
|
11820
11974
|
});
|
|
11821
11975
|
var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
11822
11976
|
frontmatter;
|
|
@@ -11826,7 +11980,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
11826
11980
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11827
11981
|
if (!result.success) {
|
|
11828
11982
|
throw new Error(
|
|
11829
|
-
`Invalid frontmatter in ${
|
|
11983
|
+
`Invalid frontmatter in ${join87(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11830
11984
|
);
|
|
11831
11985
|
}
|
|
11832
11986
|
}
|
|
@@ -11838,7 +11992,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
11838
11992
|
}
|
|
11839
11993
|
static getSettablePaths(_options = {}) {
|
|
11840
11994
|
return {
|
|
11841
|
-
relativeDirPath:
|
|
11995
|
+
relativeDirPath: join87(".cursor", "agents")
|
|
11842
11996
|
};
|
|
11843
11997
|
}
|
|
11844
11998
|
getFrontmatter() {
|
|
@@ -11905,7 +12059,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
11905
12059
|
return {
|
|
11906
12060
|
success: false,
|
|
11907
12061
|
error: new Error(
|
|
11908
|
-
`Invalid frontmatter in ${
|
|
12062
|
+
`Invalid frontmatter in ${join87(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11909
12063
|
)
|
|
11910
12064
|
};
|
|
11911
12065
|
}
|
|
@@ -11923,7 +12077,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
11923
12077
|
global = false
|
|
11924
12078
|
}) {
|
|
11925
12079
|
const paths = this.getSettablePaths({ global });
|
|
11926
|
-
const filePath =
|
|
12080
|
+
const filePath = join87(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11927
12081
|
const fileContent = await readFileContent(filePath);
|
|
11928
12082
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
11929
12083
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -11959,11 +12113,11 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
11959
12113
|
};
|
|
11960
12114
|
|
|
11961
12115
|
// src/features/subagents/junie-subagent.ts
|
|
11962
|
-
import { join as
|
|
11963
|
-
import { z as
|
|
11964
|
-
var JunieSubagentFrontmatterSchema =
|
|
11965
|
-
name:
|
|
11966
|
-
description:
|
|
12116
|
+
import { join as join88 } from "path";
|
|
12117
|
+
import { z as z47 } from "zod/mini";
|
|
12118
|
+
var JunieSubagentFrontmatterSchema = z47.looseObject({
|
|
12119
|
+
name: z47.optional(z47.string()),
|
|
12120
|
+
description: z47.string()
|
|
11967
12121
|
});
|
|
11968
12122
|
var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
11969
12123
|
frontmatter;
|
|
@@ -11973,7 +12127,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
11973
12127
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11974
12128
|
if (!result.success) {
|
|
11975
12129
|
throw new Error(
|
|
11976
|
-
`Invalid frontmatter in ${
|
|
12130
|
+
`Invalid frontmatter in ${join88(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11977
12131
|
);
|
|
11978
12132
|
}
|
|
11979
12133
|
}
|
|
@@ -11988,7 +12142,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
11988
12142
|
throw new Error("JunieSubagent does not support global mode.");
|
|
11989
12143
|
}
|
|
11990
12144
|
return {
|
|
11991
|
-
relativeDirPath:
|
|
12145
|
+
relativeDirPath: join88(".junie", "agents")
|
|
11992
12146
|
};
|
|
11993
12147
|
}
|
|
11994
12148
|
getFrontmatter() {
|
|
@@ -12064,7 +12218,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
12064
12218
|
return {
|
|
12065
12219
|
success: false,
|
|
12066
12220
|
error: new Error(
|
|
12067
|
-
`Invalid frontmatter in ${
|
|
12221
|
+
`Invalid frontmatter in ${join88(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
12068
12222
|
)
|
|
12069
12223
|
};
|
|
12070
12224
|
}
|
|
@@ -12082,7 +12236,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
12082
12236
|
global = false
|
|
12083
12237
|
}) {
|
|
12084
12238
|
const paths = this.getSettablePaths({ global });
|
|
12085
|
-
const filePath =
|
|
12239
|
+
const filePath = join88(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
12086
12240
|
const fileContent = await readFileContent(filePath);
|
|
12087
12241
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
12088
12242
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -12117,23 +12271,23 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
12117
12271
|
};
|
|
12118
12272
|
|
|
12119
12273
|
// src/features/subagents/kiro-subagent.ts
|
|
12120
|
-
import { join as
|
|
12121
|
-
import { z as
|
|
12122
|
-
var KiroCliSubagentJsonSchema =
|
|
12123
|
-
name:
|
|
12124
|
-
description:
|
|
12125
|
-
prompt:
|
|
12126
|
-
tools:
|
|
12127
|
-
toolAliases:
|
|
12128
|
-
toolSettings:
|
|
12129
|
-
toolSchema:
|
|
12130
|
-
hooks:
|
|
12131
|
-
model:
|
|
12132
|
-
mcpServers:
|
|
12133
|
-
useLegacyMcpJson:
|
|
12134
|
-
resources:
|
|
12135
|
-
allowedTools:
|
|
12136
|
-
includeMcpJson:
|
|
12274
|
+
import { join as join89 } from "path";
|
|
12275
|
+
import { z as z48 } from "zod/mini";
|
|
12276
|
+
var KiroCliSubagentJsonSchema = z48.looseObject({
|
|
12277
|
+
name: z48.string(),
|
|
12278
|
+
description: z48.optional(z48.nullable(z48.string())),
|
|
12279
|
+
prompt: z48.optional(z48.nullable(z48.string())),
|
|
12280
|
+
tools: z48.optional(z48.nullable(z48.array(z48.string()))),
|
|
12281
|
+
toolAliases: z48.optional(z48.nullable(z48.record(z48.string(), z48.string()))),
|
|
12282
|
+
toolSettings: z48.optional(z48.nullable(z48.unknown())),
|
|
12283
|
+
toolSchema: z48.optional(z48.nullable(z48.unknown())),
|
|
12284
|
+
hooks: z48.optional(z48.nullable(z48.record(z48.string(), z48.array(z48.unknown())))),
|
|
12285
|
+
model: z48.optional(z48.nullable(z48.string())),
|
|
12286
|
+
mcpServers: z48.optional(z48.nullable(z48.record(z48.string(), z48.unknown()))),
|
|
12287
|
+
useLegacyMcpJson: z48.optional(z48.nullable(z48.boolean())),
|
|
12288
|
+
resources: z48.optional(z48.nullable(z48.array(z48.string()))),
|
|
12289
|
+
allowedTools: z48.optional(z48.nullable(z48.array(z48.string()))),
|
|
12290
|
+
includeMcpJson: z48.optional(z48.nullable(z48.boolean()))
|
|
12137
12291
|
});
|
|
12138
12292
|
var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
12139
12293
|
body;
|
|
@@ -12144,7 +12298,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
12144
12298
|
KiroCliSubagentJsonSchema.parse(parsed);
|
|
12145
12299
|
} catch (error) {
|
|
12146
12300
|
throw new Error(
|
|
12147
|
-
`Invalid JSON in ${
|
|
12301
|
+
`Invalid JSON in ${join89(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
12148
12302
|
{ cause: error }
|
|
12149
12303
|
);
|
|
12150
12304
|
}
|
|
@@ -12156,7 +12310,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
12156
12310
|
}
|
|
12157
12311
|
static getSettablePaths(_options = {}) {
|
|
12158
12312
|
return {
|
|
12159
|
-
relativeDirPath:
|
|
12313
|
+
relativeDirPath: join89(".kiro", "agents")
|
|
12160
12314
|
};
|
|
12161
12315
|
}
|
|
12162
12316
|
getBody() {
|
|
@@ -12168,7 +12322,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
12168
12322
|
parsed = JSON.parse(this.body);
|
|
12169
12323
|
} catch (error) {
|
|
12170
12324
|
throw new Error(
|
|
12171
|
-
`Failed to parse JSON in ${
|
|
12325
|
+
`Failed to parse JSON in ${join89(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
12172
12326
|
{ cause: error }
|
|
12173
12327
|
);
|
|
12174
12328
|
}
|
|
@@ -12249,7 +12403,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
12249
12403
|
global = false
|
|
12250
12404
|
}) {
|
|
12251
12405
|
const paths = this.getSettablePaths({ global });
|
|
12252
|
-
const filePath =
|
|
12406
|
+
const filePath = join89(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
12253
12407
|
const fileContent = await readFileContent(filePath);
|
|
12254
12408
|
const subagent = new _KiroSubagent({
|
|
12255
12409
|
baseDir,
|
|
@@ -12287,12 +12441,12 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
12287
12441
|
};
|
|
12288
12442
|
|
|
12289
12443
|
// src/features/subagents/opencode-subagent.ts
|
|
12290
|
-
import { basename as basename8, join as
|
|
12291
|
-
import { z as
|
|
12292
|
-
var OpenCodeSubagentFrontmatterSchema =
|
|
12293
|
-
description:
|
|
12294
|
-
mode:
|
|
12295
|
-
name:
|
|
12444
|
+
import { basename as basename8, join as join90 } from "path";
|
|
12445
|
+
import { z as z49 } from "zod/mini";
|
|
12446
|
+
var OpenCodeSubagentFrontmatterSchema = z49.looseObject({
|
|
12447
|
+
description: z49.optional(z49.string()),
|
|
12448
|
+
mode: z49._default(z49.string(), "subagent"),
|
|
12449
|
+
name: z49.optional(z49.string())
|
|
12296
12450
|
});
|
|
12297
12451
|
var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
12298
12452
|
frontmatter;
|
|
@@ -12302,7 +12456,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
12302
12456
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
12303
12457
|
if (!result.success) {
|
|
12304
12458
|
throw new Error(
|
|
12305
|
-
`Invalid frontmatter in ${
|
|
12459
|
+
`Invalid frontmatter in ${join90(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
12306
12460
|
);
|
|
12307
12461
|
}
|
|
12308
12462
|
}
|
|
@@ -12316,7 +12470,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
12316
12470
|
global = false
|
|
12317
12471
|
} = {}) {
|
|
12318
12472
|
return {
|
|
12319
|
-
relativeDirPath: global ?
|
|
12473
|
+
relativeDirPath: global ? join90(".config", "opencode", "agent") : join90(".opencode", "agent")
|
|
12320
12474
|
};
|
|
12321
12475
|
}
|
|
12322
12476
|
getFrontmatter() {
|
|
@@ -12382,7 +12536,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
12382
12536
|
return {
|
|
12383
12537
|
success: false,
|
|
12384
12538
|
error: new Error(
|
|
12385
|
-
`Invalid frontmatter in ${
|
|
12539
|
+
`Invalid frontmatter in ${join90(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
12386
12540
|
)
|
|
12387
12541
|
};
|
|
12388
12542
|
}
|
|
@@ -12399,7 +12553,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
12399
12553
|
global = false
|
|
12400
12554
|
}) {
|
|
12401
12555
|
const paths = this.getSettablePaths({ global });
|
|
12402
|
-
const filePath =
|
|
12556
|
+
const filePath = join90(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
12403
12557
|
const fileContent = await readFileContent(filePath);
|
|
12404
12558
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
12405
12559
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -12449,7 +12603,7 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
12449
12603
|
"opencode",
|
|
12450
12604
|
"roo"
|
|
12451
12605
|
];
|
|
12452
|
-
var SubagentsProcessorToolTargetSchema =
|
|
12606
|
+
var SubagentsProcessorToolTargetSchema = z50.enum(subagentsProcessorToolTargetTuple);
|
|
12453
12607
|
var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
12454
12608
|
[
|
|
12455
12609
|
"agentsmd",
|
|
@@ -12618,7 +12772,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
12618
12772
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
12619
12773
|
*/
|
|
12620
12774
|
async loadRulesyncFiles() {
|
|
12621
|
-
const subagentsDir =
|
|
12775
|
+
const subagentsDir = join91(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
12622
12776
|
const dirExists = await directoryExists(subagentsDir);
|
|
12623
12777
|
if (!dirExists) {
|
|
12624
12778
|
logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -12633,7 +12787,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
12633
12787
|
logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
12634
12788
|
const rulesyncSubagents = [];
|
|
12635
12789
|
for (const mdFile of mdFiles) {
|
|
12636
|
-
const filepath =
|
|
12790
|
+
const filepath = join91(subagentsDir, mdFile);
|
|
12637
12791
|
try {
|
|
12638
12792
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
12639
12793
|
relativeFilePath: mdFile,
|
|
@@ -12663,7 +12817,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
12663
12817
|
const factory = this.getFactory(this.toolTarget);
|
|
12664
12818
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
12665
12819
|
const subagentFilePaths = await findFilesByGlobs(
|
|
12666
|
-
|
|
12820
|
+
join91(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
|
|
12667
12821
|
);
|
|
12668
12822
|
if (forDeletion) {
|
|
12669
12823
|
const toolSubagents2 = subagentFilePaths.map(
|
|
@@ -12728,49 +12882,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
12728
12882
|
};
|
|
12729
12883
|
|
|
12730
12884
|
// src/features/rules/agentsmd-rule.ts
|
|
12731
|
-
import { join as
|
|
12885
|
+
import { join as join94 } from "path";
|
|
12732
12886
|
|
|
12733
12887
|
// src/features/rules/tool-rule.ts
|
|
12734
|
-
import { join as
|
|
12888
|
+
import { join as join93 } from "path";
|
|
12735
12889
|
|
|
12736
12890
|
// src/features/rules/rulesync-rule.ts
|
|
12737
|
-
import { join as
|
|
12738
|
-
import { z as
|
|
12739
|
-
var RulesyncRuleFrontmatterSchema =
|
|
12740
|
-
root:
|
|
12741
|
-
localRoot:
|
|
12742
|
-
targets:
|
|
12743
|
-
description:
|
|
12744
|
-
globs:
|
|
12745
|
-
agentsmd:
|
|
12746
|
-
|
|
12891
|
+
import { join as join92 } from "path";
|
|
12892
|
+
import { z as z51 } from "zod/mini";
|
|
12893
|
+
var RulesyncRuleFrontmatterSchema = z51.object({
|
|
12894
|
+
root: z51.optional(z51.boolean()),
|
|
12895
|
+
localRoot: z51.optional(z51.boolean()),
|
|
12896
|
+
targets: z51._default(RulesyncTargetsSchema, ["*"]),
|
|
12897
|
+
description: z51.optional(z51.string()),
|
|
12898
|
+
globs: z51.optional(z51.array(z51.string())),
|
|
12899
|
+
agentsmd: z51.optional(
|
|
12900
|
+
z51.object({
|
|
12747
12901
|
// @example "path/to/subproject"
|
|
12748
|
-
subprojectPath:
|
|
12902
|
+
subprojectPath: z51.optional(z51.string())
|
|
12749
12903
|
})
|
|
12750
12904
|
),
|
|
12751
|
-
claudecode:
|
|
12752
|
-
|
|
12905
|
+
claudecode: z51.optional(
|
|
12906
|
+
z51.object({
|
|
12753
12907
|
// Glob patterns for conditional rules (takes precedence over globs)
|
|
12754
12908
|
// @example ["src/**/*.ts", "tests/**/*.test.ts"]
|
|
12755
|
-
paths:
|
|
12909
|
+
paths: z51.optional(z51.array(z51.string()))
|
|
12756
12910
|
})
|
|
12757
12911
|
),
|
|
12758
|
-
cursor:
|
|
12759
|
-
|
|
12760
|
-
alwaysApply:
|
|
12761
|
-
description:
|
|
12762
|
-
globs:
|
|
12912
|
+
cursor: z51.optional(
|
|
12913
|
+
z51.object({
|
|
12914
|
+
alwaysApply: z51.optional(z51.boolean()),
|
|
12915
|
+
description: z51.optional(z51.string()),
|
|
12916
|
+
globs: z51.optional(z51.array(z51.string()))
|
|
12763
12917
|
})
|
|
12764
12918
|
),
|
|
12765
|
-
copilot:
|
|
12766
|
-
|
|
12767
|
-
excludeAgent:
|
|
12919
|
+
copilot: z51.optional(
|
|
12920
|
+
z51.object({
|
|
12921
|
+
excludeAgent: z51.optional(z51.union([z51.literal("code-review"), z51.literal("coding-agent")]))
|
|
12768
12922
|
})
|
|
12769
12923
|
),
|
|
12770
|
-
antigravity:
|
|
12771
|
-
|
|
12772
|
-
trigger:
|
|
12773
|
-
globs:
|
|
12924
|
+
antigravity: z51.optional(
|
|
12925
|
+
z51.looseObject({
|
|
12926
|
+
trigger: z51.optional(z51.string()),
|
|
12927
|
+
globs: z51.optional(z51.array(z51.string()))
|
|
12774
12928
|
})
|
|
12775
12929
|
)
|
|
12776
12930
|
});
|
|
@@ -12781,7 +12935,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
12781
12935
|
const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
12782
12936
|
if (!parseResult.success && rest.validate !== false) {
|
|
12783
12937
|
throw new Error(
|
|
12784
|
-
`Invalid frontmatter in ${
|
|
12938
|
+
`Invalid frontmatter in ${join92(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
12785
12939
|
);
|
|
12786
12940
|
}
|
|
12787
12941
|
const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
|
|
@@ -12816,7 +12970,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
12816
12970
|
return {
|
|
12817
12971
|
success: false,
|
|
12818
12972
|
error: new Error(
|
|
12819
|
-
`Invalid frontmatter in ${
|
|
12973
|
+
`Invalid frontmatter in ${join92(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
12820
12974
|
)
|
|
12821
12975
|
};
|
|
12822
12976
|
}
|
|
@@ -12825,7 +12979,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
12825
12979
|
relativeFilePath,
|
|
12826
12980
|
validate = true
|
|
12827
12981
|
}) {
|
|
12828
|
-
const filePath =
|
|
12982
|
+
const filePath = join92(
|
|
12829
12983
|
process.cwd(),
|
|
12830
12984
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
12831
12985
|
relativeFilePath
|
|
@@ -12927,7 +13081,7 @@ var ToolRule = class extends ToolFile {
|
|
|
12927
13081
|
rulesyncRule,
|
|
12928
13082
|
validate = true,
|
|
12929
13083
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
12930
|
-
nonRootPath = { relativeDirPath:
|
|
13084
|
+
nonRootPath = { relativeDirPath: join93(".agents", "memories") }
|
|
12931
13085
|
}) {
|
|
12932
13086
|
const params = this.buildToolRuleParamsDefault({
|
|
12933
13087
|
baseDir,
|
|
@@ -12938,7 +13092,7 @@ var ToolRule = class extends ToolFile {
|
|
|
12938
13092
|
});
|
|
12939
13093
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
12940
13094
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
12941
|
-
params.relativeDirPath =
|
|
13095
|
+
params.relativeDirPath = join93(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
12942
13096
|
params.relativeFilePath = "AGENTS.md";
|
|
12943
13097
|
}
|
|
12944
13098
|
return params;
|
|
@@ -12987,7 +13141,7 @@ var ToolRule = class extends ToolFile {
|
|
|
12987
13141
|
}
|
|
12988
13142
|
};
|
|
12989
13143
|
function buildToolPath(toolDir, subDir, excludeToolDir) {
|
|
12990
|
-
return excludeToolDir ? subDir :
|
|
13144
|
+
return excludeToolDir ? subDir : join93(toolDir, subDir);
|
|
12991
13145
|
}
|
|
12992
13146
|
|
|
12993
13147
|
// src/features/rules/agentsmd-rule.ts
|
|
@@ -13016,8 +13170,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
13016
13170
|
validate = true
|
|
13017
13171
|
}) {
|
|
13018
13172
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
13019
|
-
const relativePath = isRoot ? "AGENTS.md" :
|
|
13020
|
-
const fileContent = await readFileContent(
|
|
13173
|
+
const relativePath = isRoot ? "AGENTS.md" : join94(".agents", "memories", relativeFilePath);
|
|
13174
|
+
const fileContent = await readFileContent(join94(baseDir, relativePath));
|
|
13021
13175
|
return new _AgentsMdRule({
|
|
13022
13176
|
baseDir,
|
|
13023
13177
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -13072,21 +13226,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
13072
13226
|
};
|
|
13073
13227
|
|
|
13074
13228
|
// src/features/rules/antigravity-rule.ts
|
|
13075
|
-
import { join as
|
|
13076
|
-
import { z as
|
|
13077
|
-
var AntigravityRuleFrontmatterSchema =
|
|
13078
|
-
trigger:
|
|
13079
|
-
|
|
13080
|
-
|
|
13081
|
-
|
|
13082
|
-
|
|
13083
|
-
|
|
13084
|
-
|
|
13229
|
+
import { join as join95 } from "path";
|
|
13230
|
+
import { z as z52 } from "zod/mini";
|
|
13231
|
+
var AntigravityRuleFrontmatterSchema = z52.looseObject({
|
|
13232
|
+
trigger: z52.optional(
|
|
13233
|
+
z52.union([
|
|
13234
|
+
z52.literal("always_on"),
|
|
13235
|
+
z52.literal("glob"),
|
|
13236
|
+
z52.literal("manual"),
|
|
13237
|
+
z52.literal("model_decision"),
|
|
13238
|
+
z52.string()
|
|
13085
13239
|
// accepts any string for forward compatibility
|
|
13086
13240
|
])
|
|
13087
13241
|
),
|
|
13088
|
-
globs:
|
|
13089
|
-
description:
|
|
13242
|
+
globs: z52.optional(z52.string()),
|
|
13243
|
+
description: z52.optional(z52.string())
|
|
13090
13244
|
});
|
|
13091
13245
|
function parseGlobsString(globs) {
|
|
13092
13246
|
if (!globs) {
|
|
@@ -13231,7 +13385,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
13231
13385
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
13232
13386
|
if (!result.success) {
|
|
13233
13387
|
throw new Error(
|
|
13234
|
-
`Invalid frontmatter in ${
|
|
13388
|
+
`Invalid frontmatter in ${join95(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
13235
13389
|
);
|
|
13236
13390
|
}
|
|
13237
13391
|
}
|
|
@@ -13255,7 +13409,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
13255
13409
|
relativeFilePath,
|
|
13256
13410
|
validate = true
|
|
13257
13411
|
}) {
|
|
13258
|
-
const filePath =
|
|
13412
|
+
const filePath = join95(
|
|
13259
13413
|
baseDir,
|
|
13260
13414
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
13261
13415
|
relativeFilePath
|
|
@@ -13395,7 +13549,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
13395
13549
|
};
|
|
13396
13550
|
|
|
13397
13551
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
13398
|
-
import { join as
|
|
13552
|
+
import { join as join96 } from "path";
|
|
13399
13553
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
13400
13554
|
toRulesyncRule() {
|
|
13401
13555
|
const rulesyncFrontmatter = {
|
|
@@ -13455,8 +13609,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
13455
13609
|
}) {
|
|
13456
13610
|
const settablePaths = this.getSettablePaths();
|
|
13457
13611
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
13458
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath :
|
|
13459
|
-
const fileContent = await readFileContent(
|
|
13612
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : join96(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13613
|
+
const fileContent = await readFileContent(join96(baseDir, relativePath));
|
|
13460
13614
|
return new _AugmentcodeLegacyRule({
|
|
13461
13615
|
baseDir,
|
|
13462
13616
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -13485,7 +13639,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
13485
13639
|
};
|
|
13486
13640
|
|
|
13487
13641
|
// src/features/rules/augmentcode-rule.ts
|
|
13488
|
-
import { join as
|
|
13642
|
+
import { join as join97 } from "path";
|
|
13489
13643
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
13490
13644
|
toRulesyncRule() {
|
|
13491
13645
|
return this.toRulesyncRuleDefault();
|
|
@@ -13516,7 +13670,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
13516
13670
|
relativeFilePath,
|
|
13517
13671
|
validate = true
|
|
13518
13672
|
}) {
|
|
13519
|
-
const filePath =
|
|
13673
|
+
const filePath = join97(
|
|
13520
13674
|
baseDir,
|
|
13521
13675
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
13522
13676
|
relativeFilePath
|
|
@@ -13556,7 +13710,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
13556
13710
|
};
|
|
13557
13711
|
|
|
13558
13712
|
// src/features/rules/claudecode-legacy-rule.ts
|
|
13559
|
-
import { join as
|
|
13713
|
+
import { join as join98 } from "path";
|
|
13560
13714
|
var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
13561
13715
|
static getSettablePaths({
|
|
13562
13716
|
global,
|
|
@@ -13598,7 +13752,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
13598
13752
|
if (isRoot) {
|
|
13599
13753
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
13600
13754
|
const fileContent2 = await readFileContent(
|
|
13601
|
-
|
|
13755
|
+
join98(baseDir, rootDirPath, paths.root.relativeFilePath)
|
|
13602
13756
|
);
|
|
13603
13757
|
return new _ClaudecodeLegacyRule({
|
|
13604
13758
|
baseDir,
|
|
@@ -13612,8 +13766,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
13612
13766
|
if (!paths.nonRoot) {
|
|
13613
13767
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13614
13768
|
}
|
|
13615
|
-
const relativePath =
|
|
13616
|
-
const fileContent = await readFileContent(
|
|
13769
|
+
const relativePath = join98(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13770
|
+
const fileContent = await readFileContent(join98(baseDir, relativePath));
|
|
13617
13771
|
return new _ClaudecodeLegacyRule({
|
|
13618
13772
|
baseDir,
|
|
13619
13773
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -13672,10 +13826,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
13672
13826
|
};
|
|
13673
13827
|
|
|
13674
13828
|
// src/features/rules/claudecode-rule.ts
|
|
13675
|
-
import { join as
|
|
13676
|
-
import { z as
|
|
13677
|
-
var ClaudecodeRuleFrontmatterSchema =
|
|
13678
|
-
paths:
|
|
13829
|
+
import { join as join99 } from "path";
|
|
13830
|
+
import { z as z53 } from "zod/mini";
|
|
13831
|
+
var ClaudecodeRuleFrontmatterSchema = z53.object({
|
|
13832
|
+
paths: z53.optional(z53.array(z53.string()))
|
|
13679
13833
|
});
|
|
13680
13834
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
13681
13835
|
frontmatter;
|
|
@@ -13713,7 +13867,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
13713
13867
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
13714
13868
|
if (!result.success) {
|
|
13715
13869
|
throw new Error(
|
|
13716
|
-
`Invalid frontmatter in ${
|
|
13870
|
+
`Invalid frontmatter in ${join99(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
13717
13871
|
);
|
|
13718
13872
|
}
|
|
13719
13873
|
}
|
|
@@ -13743,7 +13897,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
13743
13897
|
if (isRoot) {
|
|
13744
13898
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
13745
13899
|
const fileContent2 = await readFileContent(
|
|
13746
|
-
|
|
13900
|
+
join99(baseDir, rootDirPath, paths.root.relativeFilePath)
|
|
13747
13901
|
);
|
|
13748
13902
|
return new _ClaudecodeRule({
|
|
13749
13903
|
baseDir,
|
|
@@ -13758,8 +13912,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
13758
13912
|
if (!paths.nonRoot) {
|
|
13759
13913
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13760
13914
|
}
|
|
13761
|
-
const relativePath =
|
|
13762
|
-
const filePath =
|
|
13915
|
+
const relativePath = join99(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13916
|
+
const filePath = join99(baseDir, relativePath);
|
|
13763
13917
|
const fileContent = await readFileContent(filePath);
|
|
13764
13918
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
13765
13919
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -13870,7 +14024,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
13870
14024
|
return {
|
|
13871
14025
|
success: false,
|
|
13872
14026
|
error: new Error(
|
|
13873
|
-
`Invalid frontmatter in ${
|
|
14027
|
+
`Invalid frontmatter in ${join99(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
13874
14028
|
)
|
|
13875
14029
|
};
|
|
13876
14030
|
}
|
|
@@ -13890,10 +14044,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
13890
14044
|
};
|
|
13891
14045
|
|
|
13892
14046
|
// src/features/rules/cline-rule.ts
|
|
13893
|
-
import { join as
|
|
13894
|
-
import { z as
|
|
13895
|
-
var ClineRuleFrontmatterSchema =
|
|
13896
|
-
description:
|
|
14047
|
+
import { join as join100 } from "path";
|
|
14048
|
+
import { z as z54 } from "zod/mini";
|
|
14049
|
+
var ClineRuleFrontmatterSchema = z54.object({
|
|
14050
|
+
description: z54.string()
|
|
13897
14051
|
});
|
|
13898
14052
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
13899
14053
|
static getSettablePaths(_options = {}) {
|
|
@@ -13936,7 +14090,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
13936
14090
|
validate = true
|
|
13937
14091
|
}) {
|
|
13938
14092
|
const fileContent = await readFileContent(
|
|
13939
|
-
|
|
14093
|
+
join100(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
13940
14094
|
);
|
|
13941
14095
|
return new _ClineRule({
|
|
13942
14096
|
baseDir,
|
|
@@ -13962,7 +14116,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
13962
14116
|
};
|
|
13963
14117
|
|
|
13964
14118
|
// src/features/rules/codexcli-rule.ts
|
|
13965
|
-
import { join as
|
|
14119
|
+
import { join as join101 } from "path";
|
|
13966
14120
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
13967
14121
|
static getSettablePaths({
|
|
13968
14122
|
global,
|
|
@@ -13997,7 +14151,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
13997
14151
|
if (isRoot) {
|
|
13998
14152
|
const relativePath2 = paths.root.relativeFilePath;
|
|
13999
14153
|
const fileContent2 = await readFileContent(
|
|
14000
|
-
|
|
14154
|
+
join101(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
14001
14155
|
);
|
|
14002
14156
|
return new _CodexcliRule({
|
|
14003
14157
|
baseDir,
|
|
@@ -14011,8 +14165,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
14011
14165
|
if (!paths.nonRoot) {
|
|
14012
14166
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
14013
14167
|
}
|
|
14014
|
-
const relativePath =
|
|
14015
|
-
const fileContent = await readFileContent(
|
|
14168
|
+
const relativePath = join101(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14169
|
+
const fileContent = await readFileContent(join101(baseDir, relativePath));
|
|
14016
14170
|
return new _CodexcliRule({
|
|
14017
14171
|
baseDir,
|
|
14018
14172
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -14071,12 +14225,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
14071
14225
|
};
|
|
14072
14226
|
|
|
14073
14227
|
// src/features/rules/copilot-rule.ts
|
|
14074
|
-
import { join as
|
|
14075
|
-
import { z as
|
|
14076
|
-
var CopilotRuleFrontmatterSchema =
|
|
14077
|
-
description:
|
|
14078
|
-
applyTo:
|
|
14079
|
-
excludeAgent:
|
|
14228
|
+
import { join as join102 } from "path";
|
|
14229
|
+
import { z as z55 } from "zod/mini";
|
|
14230
|
+
var CopilotRuleFrontmatterSchema = z55.object({
|
|
14231
|
+
description: z55.optional(z55.string()),
|
|
14232
|
+
applyTo: z55.optional(z55.string()),
|
|
14233
|
+
excludeAgent: z55.optional(z55.union([z55.literal("code-review"), z55.literal("coding-agent")]))
|
|
14080
14234
|
});
|
|
14081
14235
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
14082
14236
|
frontmatter;
|
|
@@ -14108,7 +14262,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
14108
14262
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
14109
14263
|
if (!result.success) {
|
|
14110
14264
|
throw new Error(
|
|
14111
|
-
`Invalid frontmatter in ${
|
|
14265
|
+
`Invalid frontmatter in ${join102(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14112
14266
|
);
|
|
14113
14267
|
}
|
|
14114
14268
|
}
|
|
@@ -14198,8 +14352,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
14198
14352
|
const paths = this.getSettablePaths({ global });
|
|
14199
14353
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
14200
14354
|
if (isRoot) {
|
|
14201
|
-
const relativePath2 =
|
|
14202
|
-
const filePath2 =
|
|
14355
|
+
const relativePath2 = join102(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
14356
|
+
const filePath2 = join102(baseDir, relativePath2);
|
|
14203
14357
|
const fileContent2 = await readFileContent(filePath2);
|
|
14204
14358
|
return new _CopilotRule({
|
|
14205
14359
|
baseDir,
|
|
@@ -14214,8 +14368,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
14214
14368
|
if (!paths.nonRoot) {
|
|
14215
14369
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
14216
14370
|
}
|
|
14217
|
-
const relativePath =
|
|
14218
|
-
const filePath =
|
|
14371
|
+
const relativePath = join102(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14372
|
+
const filePath = join102(baseDir, relativePath);
|
|
14219
14373
|
const fileContent = await readFileContent(filePath);
|
|
14220
14374
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14221
14375
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14261,7 +14415,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
14261
14415
|
return {
|
|
14262
14416
|
success: false,
|
|
14263
14417
|
error: new Error(
|
|
14264
|
-
`Invalid frontmatter in ${
|
|
14418
|
+
`Invalid frontmatter in ${join102(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14265
14419
|
)
|
|
14266
14420
|
};
|
|
14267
14421
|
}
|
|
@@ -14281,12 +14435,12 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
14281
14435
|
};
|
|
14282
14436
|
|
|
14283
14437
|
// src/features/rules/cursor-rule.ts
|
|
14284
|
-
import { join as
|
|
14285
|
-
import { z as
|
|
14286
|
-
var CursorRuleFrontmatterSchema =
|
|
14287
|
-
description:
|
|
14288
|
-
globs:
|
|
14289
|
-
alwaysApply:
|
|
14438
|
+
import { join as join103 } from "path";
|
|
14439
|
+
import { z as z56 } from "zod/mini";
|
|
14440
|
+
var CursorRuleFrontmatterSchema = z56.object({
|
|
14441
|
+
description: z56.optional(z56.string()),
|
|
14442
|
+
globs: z56.optional(z56.string()),
|
|
14443
|
+
alwaysApply: z56.optional(z56.boolean())
|
|
14290
14444
|
});
|
|
14291
14445
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
14292
14446
|
frontmatter;
|
|
@@ -14303,7 +14457,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
14303
14457
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
14304
14458
|
if (!result.success) {
|
|
14305
14459
|
throw new Error(
|
|
14306
|
-
`Invalid frontmatter in ${
|
|
14460
|
+
`Invalid frontmatter in ${join103(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14307
14461
|
);
|
|
14308
14462
|
}
|
|
14309
14463
|
}
|
|
@@ -14419,7 +14573,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
14419
14573
|
relativeFilePath,
|
|
14420
14574
|
validate = true
|
|
14421
14575
|
}) {
|
|
14422
|
-
const filePath =
|
|
14576
|
+
const filePath = join103(
|
|
14423
14577
|
baseDir,
|
|
14424
14578
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
14425
14579
|
relativeFilePath
|
|
@@ -14429,7 +14583,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
14429
14583
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
14430
14584
|
if (!result.success) {
|
|
14431
14585
|
throw new Error(
|
|
14432
|
-
`Invalid frontmatter in ${
|
|
14586
|
+
`Invalid frontmatter in ${join103(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
14433
14587
|
);
|
|
14434
14588
|
}
|
|
14435
14589
|
return new _CursorRule({
|
|
@@ -14466,7 +14620,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
14466
14620
|
return {
|
|
14467
14621
|
success: false,
|
|
14468
14622
|
error: new Error(
|
|
14469
|
-
`Invalid frontmatter in ${
|
|
14623
|
+
`Invalid frontmatter in ${join103(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14470
14624
|
)
|
|
14471
14625
|
};
|
|
14472
14626
|
}
|
|
@@ -14486,7 +14640,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
14486
14640
|
};
|
|
14487
14641
|
|
|
14488
14642
|
// src/features/rules/factorydroid-rule.ts
|
|
14489
|
-
import { join as
|
|
14643
|
+
import { join as join104 } from "path";
|
|
14490
14644
|
var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
14491
14645
|
constructor({ fileContent, root, ...rest }) {
|
|
14492
14646
|
super({
|
|
@@ -14526,8 +14680,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
14526
14680
|
const paths = this.getSettablePaths({ global });
|
|
14527
14681
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
14528
14682
|
if (isRoot) {
|
|
14529
|
-
const relativePath2 =
|
|
14530
|
-
const fileContent2 = await readFileContent(
|
|
14683
|
+
const relativePath2 = join104(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
14684
|
+
const fileContent2 = await readFileContent(join104(baseDir, relativePath2));
|
|
14531
14685
|
return new _FactorydroidRule({
|
|
14532
14686
|
baseDir,
|
|
14533
14687
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -14540,8 +14694,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
14540
14694
|
if (!paths.nonRoot) {
|
|
14541
14695
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
14542
14696
|
}
|
|
14543
|
-
const relativePath =
|
|
14544
|
-
const fileContent = await readFileContent(
|
|
14697
|
+
const relativePath = join104(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14698
|
+
const fileContent = await readFileContent(join104(baseDir, relativePath));
|
|
14545
14699
|
return new _FactorydroidRule({
|
|
14546
14700
|
baseDir,
|
|
14547
14701
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -14600,7 +14754,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
14600
14754
|
};
|
|
14601
14755
|
|
|
14602
14756
|
// src/features/rules/geminicli-rule.ts
|
|
14603
|
-
import { join as
|
|
14757
|
+
import { join as join105 } from "path";
|
|
14604
14758
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
14605
14759
|
static getSettablePaths({
|
|
14606
14760
|
global,
|
|
@@ -14635,7 +14789,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
14635
14789
|
if (isRoot) {
|
|
14636
14790
|
const relativePath2 = paths.root.relativeFilePath;
|
|
14637
14791
|
const fileContent2 = await readFileContent(
|
|
14638
|
-
|
|
14792
|
+
join105(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
14639
14793
|
);
|
|
14640
14794
|
return new _GeminiCliRule({
|
|
14641
14795
|
baseDir,
|
|
@@ -14649,8 +14803,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
14649
14803
|
if (!paths.nonRoot) {
|
|
14650
14804
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
14651
14805
|
}
|
|
14652
|
-
const relativePath =
|
|
14653
|
-
const fileContent = await readFileContent(
|
|
14806
|
+
const relativePath = join105(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14807
|
+
const fileContent = await readFileContent(join105(baseDir, relativePath));
|
|
14654
14808
|
return new _GeminiCliRule({
|
|
14655
14809
|
baseDir,
|
|
14656
14810
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -14709,7 +14863,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
14709
14863
|
};
|
|
14710
14864
|
|
|
14711
14865
|
// src/features/rules/goose-rule.ts
|
|
14712
|
-
import { join as
|
|
14866
|
+
import { join as join106 } from "path";
|
|
14713
14867
|
var GooseRule = class _GooseRule extends ToolRule {
|
|
14714
14868
|
static getSettablePaths({
|
|
14715
14869
|
global,
|
|
@@ -14744,7 +14898,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
14744
14898
|
if (isRoot) {
|
|
14745
14899
|
const relativePath2 = paths.root.relativeFilePath;
|
|
14746
14900
|
const fileContent2 = await readFileContent(
|
|
14747
|
-
|
|
14901
|
+
join106(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
14748
14902
|
);
|
|
14749
14903
|
return new _GooseRule({
|
|
14750
14904
|
baseDir,
|
|
@@ -14758,8 +14912,8 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
14758
14912
|
if (!paths.nonRoot) {
|
|
14759
14913
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
14760
14914
|
}
|
|
14761
|
-
const relativePath =
|
|
14762
|
-
const fileContent = await readFileContent(
|
|
14915
|
+
const relativePath = join106(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14916
|
+
const fileContent = await readFileContent(join106(baseDir, relativePath));
|
|
14763
14917
|
return new _GooseRule({
|
|
14764
14918
|
baseDir,
|
|
14765
14919
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -14818,7 +14972,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
14818
14972
|
};
|
|
14819
14973
|
|
|
14820
14974
|
// src/features/rules/junie-rule.ts
|
|
14821
|
-
import { join as
|
|
14975
|
+
import { join as join107 } from "path";
|
|
14822
14976
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
14823
14977
|
static getSettablePaths(_options = {}) {
|
|
14824
14978
|
return {
|
|
@@ -14837,8 +14991,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
14837
14991
|
validate = true
|
|
14838
14992
|
}) {
|
|
14839
14993
|
const isRoot = relativeFilePath === "guidelines.md";
|
|
14840
|
-
const relativePath = isRoot ? "guidelines.md" :
|
|
14841
|
-
const fileContent = await readFileContent(
|
|
14994
|
+
const relativePath = isRoot ? "guidelines.md" : join107(".junie", "memories", relativeFilePath);
|
|
14995
|
+
const fileContent = await readFileContent(join107(baseDir, relativePath));
|
|
14842
14996
|
return new _JunieRule({
|
|
14843
14997
|
baseDir,
|
|
14844
14998
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -14893,7 +15047,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
14893
15047
|
};
|
|
14894
15048
|
|
|
14895
15049
|
// src/features/rules/kilo-rule.ts
|
|
14896
|
-
import { join as
|
|
15050
|
+
import { join as join108 } from "path";
|
|
14897
15051
|
var KiloRule = class _KiloRule extends ToolRule {
|
|
14898
15052
|
static getSettablePaths(_options = {}) {
|
|
14899
15053
|
return {
|
|
@@ -14908,7 +15062,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
14908
15062
|
validate = true
|
|
14909
15063
|
}) {
|
|
14910
15064
|
const fileContent = await readFileContent(
|
|
14911
|
-
|
|
15065
|
+
join108(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
14912
15066
|
);
|
|
14913
15067
|
return new _KiloRule({
|
|
14914
15068
|
baseDir,
|
|
@@ -14960,7 +15114,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
14960
15114
|
};
|
|
14961
15115
|
|
|
14962
15116
|
// src/features/rules/kiro-rule.ts
|
|
14963
|
-
import { join as
|
|
15117
|
+
import { join as join109 } from "path";
|
|
14964
15118
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
14965
15119
|
static getSettablePaths(_options = {}) {
|
|
14966
15120
|
return {
|
|
@@ -14975,7 +15129,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
14975
15129
|
validate = true
|
|
14976
15130
|
}) {
|
|
14977
15131
|
const fileContent = await readFileContent(
|
|
14978
|
-
|
|
15132
|
+
join109(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
14979
15133
|
);
|
|
14980
15134
|
return new _KiroRule({
|
|
14981
15135
|
baseDir,
|
|
@@ -15029,7 +15183,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
15029
15183
|
};
|
|
15030
15184
|
|
|
15031
15185
|
// src/features/rules/opencode-rule.ts
|
|
15032
|
-
import { join as
|
|
15186
|
+
import { join as join110 } from "path";
|
|
15033
15187
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
15034
15188
|
static getSettablePaths({
|
|
15035
15189
|
global,
|
|
@@ -15064,7 +15218,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
15064
15218
|
if (isRoot) {
|
|
15065
15219
|
const relativePath2 = paths.root.relativeFilePath;
|
|
15066
15220
|
const fileContent2 = await readFileContent(
|
|
15067
|
-
|
|
15221
|
+
join110(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
15068
15222
|
);
|
|
15069
15223
|
return new _OpenCodeRule({
|
|
15070
15224
|
baseDir,
|
|
@@ -15078,8 +15232,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
15078
15232
|
if (!paths.nonRoot) {
|
|
15079
15233
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
15080
15234
|
}
|
|
15081
|
-
const relativePath =
|
|
15082
|
-
const fileContent = await readFileContent(
|
|
15235
|
+
const relativePath = join110(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
15236
|
+
const fileContent = await readFileContent(join110(baseDir, relativePath));
|
|
15083
15237
|
return new _OpenCodeRule({
|
|
15084
15238
|
baseDir,
|
|
15085
15239
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -15138,7 +15292,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
15138
15292
|
};
|
|
15139
15293
|
|
|
15140
15294
|
// src/features/rules/qwencode-rule.ts
|
|
15141
|
-
import { join as
|
|
15295
|
+
import { join as join111 } from "path";
|
|
15142
15296
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
15143
15297
|
static getSettablePaths(_options = {}) {
|
|
15144
15298
|
return {
|
|
@@ -15157,8 +15311,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
15157
15311
|
validate = true
|
|
15158
15312
|
}) {
|
|
15159
15313
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
15160
|
-
const relativePath = isRoot ? "QWEN.md" :
|
|
15161
|
-
const fileContent = await readFileContent(
|
|
15314
|
+
const relativePath = isRoot ? "QWEN.md" : join111(".qwen", "memories", relativeFilePath);
|
|
15315
|
+
const fileContent = await readFileContent(join111(baseDir, relativePath));
|
|
15162
15316
|
return new _QwencodeRule({
|
|
15163
15317
|
baseDir,
|
|
15164
15318
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -15210,7 +15364,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
15210
15364
|
};
|
|
15211
15365
|
|
|
15212
15366
|
// src/features/rules/replit-rule.ts
|
|
15213
|
-
import { join as
|
|
15367
|
+
import { join as join112 } from "path";
|
|
15214
15368
|
var ReplitRule = class _ReplitRule extends ToolRule {
|
|
15215
15369
|
static getSettablePaths(_options = {}) {
|
|
15216
15370
|
return {
|
|
@@ -15232,7 +15386,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
15232
15386
|
}
|
|
15233
15387
|
const relativePath = paths.root.relativeFilePath;
|
|
15234
15388
|
const fileContent = await readFileContent(
|
|
15235
|
-
|
|
15389
|
+
join112(baseDir, paths.root.relativeDirPath, relativePath)
|
|
15236
15390
|
);
|
|
15237
15391
|
return new _ReplitRule({
|
|
15238
15392
|
baseDir,
|
|
@@ -15298,7 +15452,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
15298
15452
|
};
|
|
15299
15453
|
|
|
15300
15454
|
// src/features/rules/roo-rule.ts
|
|
15301
|
-
import { join as
|
|
15455
|
+
import { join as join113 } from "path";
|
|
15302
15456
|
var RooRule = class _RooRule extends ToolRule {
|
|
15303
15457
|
static getSettablePaths(_options = {}) {
|
|
15304
15458
|
return {
|
|
@@ -15313,7 +15467,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
15313
15467
|
validate = true
|
|
15314
15468
|
}) {
|
|
15315
15469
|
const fileContent = await readFileContent(
|
|
15316
|
-
|
|
15470
|
+
join113(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
15317
15471
|
);
|
|
15318
15472
|
return new _RooRule({
|
|
15319
15473
|
baseDir,
|
|
@@ -15382,7 +15536,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
15382
15536
|
};
|
|
15383
15537
|
|
|
15384
15538
|
// src/features/rules/warp-rule.ts
|
|
15385
|
-
import { join as
|
|
15539
|
+
import { join as join114 } from "path";
|
|
15386
15540
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
15387
15541
|
constructor({ fileContent, root, ...rest }) {
|
|
15388
15542
|
super({
|
|
@@ -15408,8 +15562,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
15408
15562
|
validate = true
|
|
15409
15563
|
}) {
|
|
15410
15564
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
15411
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath :
|
|
15412
|
-
const fileContent = await readFileContent(
|
|
15565
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : join114(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
15566
|
+
const fileContent = await readFileContent(join114(baseDir, relativePath));
|
|
15413
15567
|
return new _WarpRule({
|
|
15414
15568
|
baseDir,
|
|
15415
15569
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -15464,7 +15618,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
15464
15618
|
};
|
|
15465
15619
|
|
|
15466
15620
|
// src/features/rules/windsurf-rule.ts
|
|
15467
|
-
import { join as
|
|
15621
|
+
import { join as join115 } from "path";
|
|
15468
15622
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
15469
15623
|
static getSettablePaths(_options = {}) {
|
|
15470
15624
|
return {
|
|
@@ -15479,7 +15633,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
15479
15633
|
validate = true
|
|
15480
15634
|
}) {
|
|
15481
15635
|
const fileContent = await readFileContent(
|
|
15482
|
-
|
|
15636
|
+
join115(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
15483
15637
|
);
|
|
15484
15638
|
return new _WindsurfRule({
|
|
15485
15639
|
baseDir,
|
|
@@ -15555,8 +15709,8 @@ var rulesProcessorToolTargets = [
|
|
|
15555
15709
|
"warp",
|
|
15556
15710
|
"windsurf"
|
|
15557
15711
|
];
|
|
15558
|
-
var RulesProcessorToolTargetSchema =
|
|
15559
|
-
var formatRulePaths = (rules) => rules.map((r) =>
|
|
15712
|
+
var RulesProcessorToolTargetSchema = z57.enum(rulesProcessorToolTargets);
|
|
15713
|
+
var formatRulePaths = (rules) => rules.map((r) => join116(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
|
|
15560
15714
|
var toolRuleFactories = /* @__PURE__ */ new Map([
|
|
15561
15715
|
[
|
|
15562
15716
|
"agentsmd",
|
|
@@ -15931,7 +16085,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
15931
16085
|
}).relativeDirPath;
|
|
15932
16086
|
return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
|
|
15933
16087
|
const frontmatter = skill.getFrontmatter();
|
|
15934
|
-
const relativePath =
|
|
16088
|
+
const relativePath = join116(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
|
|
15935
16089
|
return {
|
|
15936
16090
|
name: frontmatter.name,
|
|
15937
16091
|
description: frontmatter.description,
|
|
@@ -16044,8 +16198,8 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
16044
16198
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
16045
16199
|
*/
|
|
16046
16200
|
async loadRulesyncFiles() {
|
|
16047
|
-
const rulesyncBaseDir =
|
|
16048
|
-
const files = await findFilesByGlobs(
|
|
16201
|
+
const rulesyncBaseDir = join116(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
16202
|
+
const files = await findFilesByGlobs(join116(rulesyncBaseDir, "**", "*.md"));
|
|
16049
16203
|
logger.debug(`Found ${files.length} rulesync files`);
|
|
16050
16204
|
const rulesyncRules = await Promise.all(
|
|
16051
16205
|
files.map((file) => {
|
|
@@ -16142,13 +16296,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
16142
16296
|
return [];
|
|
16143
16297
|
}
|
|
16144
16298
|
const uniqueRootFilePaths = await findFilesWithFallback(
|
|
16145
|
-
|
|
16299
|
+
join116(
|
|
16146
16300
|
this.baseDir,
|
|
16147
16301
|
settablePaths.root.relativeDirPath ?? ".",
|
|
16148
16302
|
settablePaths.root.relativeFilePath
|
|
16149
16303
|
),
|
|
16150
16304
|
settablePaths.alternativeRoots,
|
|
16151
|
-
(alt) =>
|
|
16305
|
+
(alt) => join116(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
|
|
16152
16306
|
);
|
|
16153
16307
|
if (forDeletion) {
|
|
16154
16308
|
return uniqueRootFilePaths.map((filePath) => {
|
|
@@ -16193,9 +16347,9 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
16193
16347
|
return [];
|
|
16194
16348
|
}
|
|
16195
16349
|
const uniqueLocalRootFilePaths = await findFilesWithFallback(
|
|
16196
|
-
|
|
16350
|
+
join116(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
|
|
16197
16351
|
settablePaths.alternativeRoots,
|
|
16198
|
-
(alt) =>
|
|
16352
|
+
(alt) => join116(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
|
|
16199
16353
|
);
|
|
16200
16354
|
return uniqueLocalRootFilePaths.map((filePath) => {
|
|
16201
16355
|
const relativeDirPath = resolveRelativeDirPath(filePath);
|
|
@@ -16216,9 +16370,9 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
16216
16370
|
if (!settablePaths.nonRoot) {
|
|
16217
16371
|
return [];
|
|
16218
16372
|
}
|
|
16219
|
-
const nonRootBaseDir =
|
|
16373
|
+
const nonRootBaseDir = join116(this.baseDir, settablePaths.nonRoot.relativeDirPath);
|
|
16220
16374
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
16221
|
-
|
|
16375
|
+
join116(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
|
|
16222
16376
|
);
|
|
16223
16377
|
if (forDeletion) {
|
|
16224
16378
|
return nonRootFilePaths.map((filePath) => {
|
|
@@ -16350,14 +16504,14 @@ s/<command> [arguments]
|
|
|
16350
16504
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
16351
16505
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
16352
16506
|
|
|
16353
|
-
When users call a custom slash command, you have to look for the markdown file, \`${
|
|
16507
|
+
When users call a custom slash command, you have to look for the markdown file, \`${join116(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
16354
16508
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
16355
16509
|
|
|
16356
16510
|
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.
|
|
16357
16511
|
|
|
16358
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${
|
|
16512
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${join116(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
16359
16513
|
|
|
16360
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${
|
|
16514
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${join116(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
16361
16515
|
const skillsSection = skills ? this.generateSkillsSection(skills) : "";
|
|
16362
16516
|
const result = [
|
|
16363
16517
|
overview,
|
|
@@ -16437,7 +16591,7 @@ function warnUnsupportedTargets(params) {
|
|
|
16437
16591
|
}
|
|
16438
16592
|
}
|
|
16439
16593
|
async function checkRulesyncDirExists(params) {
|
|
16440
|
-
return fileExists(
|
|
16594
|
+
return fileExists(join117(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
|
|
16441
16595
|
}
|
|
16442
16596
|
async function generate(params) {
|
|
16443
16597
|
const { config } = params;
|