rulesync 8.1.0 → 8.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/{chunk-FLZZ3LEK.js → chunk-RVBJT5ST.js} +1019 -610
- package/dist/cli/index.cjs +672 -253
- package/dist/cli/index.js +13 -3
- package/dist/index.cjs +1044 -635
- package/dist/index.js +1 -1
- package/package.json +5 -4
package/dist/index.cjs
CHANGED
|
@@ -262,12 +262,13 @@ var FeaturesSchema = import_mini.z.array(FeatureSchema);
|
|
|
262
262
|
var FeatureOptionsSchema = import_mini.z.record(import_mini.z.string(), import_mini.z.unknown());
|
|
263
263
|
var FeatureValueSchema = import_mini.z.union([import_mini.z.boolean(), FeatureOptionsSchema]);
|
|
264
264
|
var PerFeatureConfigSchema = import_mini.z.record(import_mini.z.string(), FeatureValueSchema);
|
|
265
|
+
var PerTargetFeaturesValueSchema = import_mini.z.union([
|
|
266
|
+
import_mini.z.array(import_mini.z.enum(ALL_FEATURES_WITH_WILDCARD)),
|
|
267
|
+
PerFeatureConfigSchema
|
|
268
|
+
]);
|
|
265
269
|
var RulesyncFeaturesSchema = import_mini.z.union([
|
|
266
270
|
import_mini.z.array(import_mini.z.enum(ALL_FEATURES_WITH_WILDCARD)),
|
|
267
|
-
import_mini.z.record(
|
|
268
|
-
import_mini.z.string(),
|
|
269
|
-
import_mini.z.union([import_mini.z.array(import_mini.z.enum(ALL_FEATURES_WITH_WILDCARD)), PerFeatureConfigSchema])
|
|
270
|
-
)
|
|
271
|
+
import_mini.z.record(import_mini.z.string(), PerTargetFeaturesValueSchema)
|
|
271
272
|
]);
|
|
272
273
|
var isFeatureValueEnabled = (value) => {
|
|
273
274
|
if (value === true) return true;
|
|
@@ -310,6 +311,14 @@ var ALL_TOOL_TARGETS_WITH_WILDCARD = [...ALL_TOOL_TARGETS, "*"];
|
|
|
310
311
|
var ToolTargetSchema = import_mini2.z.enum(ALL_TOOL_TARGETS);
|
|
311
312
|
var ToolTargetsSchema = import_mini2.z.array(ToolTargetSchema);
|
|
312
313
|
var RulesyncTargetsSchema = import_mini2.z.array(import_mini2.z.enum(ALL_TOOL_TARGETS_WITH_WILDCARD));
|
|
314
|
+
var RulesyncConfigTargetsObjectSchema = import_mini2.z.record(import_mini2.z.string(), PerTargetFeaturesValueSchema);
|
|
315
|
+
var RulesyncConfigTargetsSchema = import_mini2.z.union([
|
|
316
|
+
RulesyncTargetsSchema,
|
|
317
|
+
RulesyncConfigTargetsObjectSchema
|
|
318
|
+
]);
|
|
319
|
+
var isRulesyncConfigTargetsObject = (value) => {
|
|
320
|
+
return !Array.isArray(value);
|
|
321
|
+
};
|
|
313
322
|
|
|
314
323
|
// src/utils/validation.ts
|
|
315
324
|
function findControlCharacter(value) {
|
|
@@ -346,7 +355,7 @@ var SourceEntrySchema = import_mini3.z.object({
|
|
|
346
355
|
});
|
|
347
356
|
var ConfigParamsSchema = import_mini3.z.object({
|
|
348
357
|
baseDirs: import_mini3.z.array(import_mini3.z.string()),
|
|
349
|
-
targets:
|
|
358
|
+
targets: RulesyncConfigTargetsSchema,
|
|
350
359
|
features: RulesyncFeaturesSchema,
|
|
351
360
|
verbose: import_mini3.z.boolean(),
|
|
352
361
|
delete: import_mini3.z.boolean(),
|
|
@@ -373,10 +382,42 @@ var CONFLICTING_TARGET_PAIRS = [
|
|
|
373
382
|
["claudecode", "claudecode-legacy"]
|
|
374
383
|
];
|
|
375
384
|
var LEGACY_TARGETS = ["augmentcode-legacy", "claudecode-legacy"];
|
|
385
|
+
var assertTargetsFeaturesExclusive = ({
|
|
386
|
+
targets,
|
|
387
|
+
features
|
|
388
|
+
}) => {
|
|
389
|
+
const targetsIsObject = targets !== void 0 && !Array.isArray(targets);
|
|
390
|
+
const featuresIsObject = features !== void 0 && !Array.isArray(features);
|
|
391
|
+
if (targetsIsObject && features !== void 0) {
|
|
392
|
+
throw new Error(
|
|
393
|
+
"Invalid config: when 'targets' is in object form, 'features' must be omitted. Declare per-target features inside the 'targets' object instead."
|
|
394
|
+
);
|
|
395
|
+
}
|
|
396
|
+
if (featuresIsObject && targets !== void 0) {
|
|
397
|
+
throw new Error(
|
|
398
|
+
"Invalid config: when 'features' is in object form, 'targets' must be omitted. Migrate to the 'targets' object form, e.g. `targets: { claudecode: [...] }`."
|
|
399
|
+
);
|
|
400
|
+
}
|
|
401
|
+
};
|
|
402
|
+
var assertTargetsOrFeaturesProvided = ({
|
|
403
|
+
targets,
|
|
404
|
+
features
|
|
405
|
+
}) => {
|
|
406
|
+
if (targets === void 0 && features === void 0) {
|
|
407
|
+
throw new Error("Invalid config: at least one of 'targets' or 'features' must be provided.");
|
|
408
|
+
}
|
|
409
|
+
};
|
|
376
410
|
var Config = class _Config {
|
|
377
411
|
baseDirs;
|
|
378
412
|
targets;
|
|
379
413
|
features;
|
|
414
|
+
/**
|
|
415
|
+
* Cached list of validated `ToolTarget` keys for the object form of
|
|
416
|
+
* `targets`. Populated in the constructor after `validateObjectFormTargetKeys`
|
|
417
|
+
* so `getTargets()` does not rebuild the `ALL_TOOL_TARGETS` set on every call.
|
|
418
|
+
* Undefined when `this.targets` is in array form.
|
|
419
|
+
*/
|
|
420
|
+
objectFormTargetKeys;
|
|
380
421
|
verbose;
|
|
381
422
|
delete;
|
|
382
423
|
global;
|
|
@@ -404,13 +445,19 @@ var Config = class _Config {
|
|
|
404
445
|
check,
|
|
405
446
|
sources
|
|
406
447
|
}) {
|
|
407
|
-
|
|
448
|
+
assertTargetsFeaturesExclusive({ targets, features });
|
|
449
|
+
assertTargetsOrFeaturesProvided({ targets, features });
|
|
450
|
+
const resolvedTargets = targets ?? [];
|
|
451
|
+
const resolvedFeatures = features ?? [];
|
|
452
|
+
this.validateObjectFormTargetKeys(resolvedTargets);
|
|
453
|
+
this.validateConflictingTargets(resolvedTargets);
|
|
408
454
|
if (dryRun && check) {
|
|
409
455
|
throw new Error("--dry-run and --check cannot be used together");
|
|
410
456
|
}
|
|
411
457
|
this.baseDirs = baseDirs;
|
|
412
|
-
this.targets =
|
|
413
|
-
this.features =
|
|
458
|
+
this.targets = resolvedTargets;
|
|
459
|
+
this.features = resolvedFeatures;
|
|
460
|
+
this.objectFormTargetKeys = isRulesyncConfigTargetsObject(resolvedTargets) ? _Config.filterValidToolTargets(Object.keys(resolvedTargets)) : void 0;
|
|
414
461
|
this.verbose = verbose;
|
|
415
462
|
this.delete = isDelete;
|
|
416
463
|
this.global = global ?? false;
|
|
@@ -423,11 +470,37 @@ var Config = class _Config {
|
|
|
423
470
|
this.check = check ?? false;
|
|
424
471
|
this.sources = sources ?? [];
|
|
425
472
|
}
|
|
473
|
+
/**
|
|
474
|
+
* Rejects unknown keys (and the special `*` key) in the object form of
|
|
475
|
+
* `targets`. For the array form this is already enforced at the Zod schema
|
|
476
|
+
* level via `z.enum(ALL_TOOL_TARGETS_WITH_WILDCARD)`; for the object form
|
|
477
|
+
* `z.record(z.string(), ...)` intentionally accepts any string key (to work
|
|
478
|
+
* around zod's `z.record(z.enum(...))` requiring ALL enum members), so
|
|
479
|
+
* runtime validation lives here instead.
|
|
480
|
+
*/
|
|
481
|
+
validateObjectFormTargetKeys(targets) {
|
|
482
|
+
if (Array.isArray(targets)) return;
|
|
483
|
+
const validTargets = new Set(ALL_TOOL_TARGETS);
|
|
484
|
+
for (const key of Object.keys(targets)) {
|
|
485
|
+
if (key === "*") {
|
|
486
|
+
throw new Error(
|
|
487
|
+
"Invalid target '*' in object form: wildcard is only supported in the array form `targets: ['*']`. Per-target options cannot be attached to a wildcard."
|
|
488
|
+
);
|
|
489
|
+
}
|
|
490
|
+
if (!validTargets.has(key)) {
|
|
491
|
+
throw new Error(`Unknown target '${key}'. Valid targets: ${ALL_TOOL_TARGETS.join(", ")}.`);
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
}
|
|
426
495
|
validateConflictingTargets(targets) {
|
|
496
|
+
const has = (target) => {
|
|
497
|
+
if (Array.isArray(targets)) {
|
|
498
|
+
return targets.includes(target);
|
|
499
|
+
}
|
|
500
|
+
return Object.prototype.hasOwnProperty.call(targets, target);
|
|
501
|
+
};
|
|
427
502
|
for (const [target1, target2] of CONFLICTING_TARGET_PAIRS) {
|
|
428
|
-
|
|
429
|
-
const hasTarget2 = targets.includes(target2);
|
|
430
|
-
if (hasTarget1 && hasTarget2) {
|
|
503
|
+
if (has(target1) && has(target2)) {
|
|
431
504
|
throw new Error(
|
|
432
505
|
`Conflicting targets: '${target1}' and '${target2}' cannot be used together. Please choose one.`
|
|
433
506
|
);
|
|
@@ -437,16 +510,45 @@ var Config = class _Config {
|
|
|
437
510
|
getBaseDirs() {
|
|
438
511
|
return this.baseDirs;
|
|
439
512
|
}
|
|
513
|
+
/**
|
|
514
|
+
* Filter an arbitrary string-key list down to the known `ToolTarget` set,
|
|
515
|
+
* skipping `*` (which is only meaningful as an array element, not a key).
|
|
516
|
+
*/
|
|
517
|
+
static filterValidToolTargets(keys) {
|
|
518
|
+
const validTargets = new Set(ALL_TOOL_TARGETS);
|
|
519
|
+
const result = [];
|
|
520
|
+
for (const key of keys) {
|
|
521
|
+
if (key === "*") continue;
|
|
522
|
+
if (!validTargets.has(key)) continue;
|
|
523
|
+
result.push(key);
|
|
524
|
+
}
|
|
525
|
+
return result;
|
|
526
|
+
}
|
|
440
527
|
getTargets() {
|
|
441
|
-
if (this.
|
|
528
|
+
if (this.objectFormTargetKeys !== void 0) {
|
|
529
|
+
return this.objectFormTargetKeys;
|
|
530
|
+
}
|
|
531
|
+
const arrayTargets = Array.isArray(this.targets) ? this.targets : [];
|
|
532
|
+
if (!Array.isArray(this.features)) {
|
|
533
|
+
return _Config.filterValidToolTargets(Object.keys(this.features));
|
|
534
|
+
}
|
|
535
|
+
if (arrayTargets.includes("*")) {
|
|
442
536
|
return ALL_TOOL_TARGETS.filter(
|
|
443
537
|
// eslint-disable-next-line no-type-assertion/no-type-assertion
|
|
444
538
|
(target) => !LEGACY_TARGETS.includes(target)
|
|
445
539
|
);
|
|
446
540
|
}
|
|
447
|
-
return
|
|
541
|
+
return arrayTargets.filter((target) => target !== "*");
|
|
448
542
|
}
|
|
449
543
|
getFeatures(target) {
|
|
544
|
+
if (isRulesyncConfigTargetsObject(this.targets)) {
|
|
545
|
+
if (target) {
|
|
546
|
+
const value = this.targets[target];
|
|
547
|
+
if (!value) return [];
|
|
548
|
+
return _Config.normalizeTargetFeatures(value);
|
|
549
|
+
}
|
|
550
|
+
return _Config.collectAllFeatures(Object.values(this.targets));
|
|
551
|
+
}
|
|
450
552
|
if (!Array.isArray(this.features)) {
|
|
451
553
|
const perTargetFeatures = this.features;
|
|
452
554
|
if (target) {
|
|
@@ -456,20 +558,7 @@ var Config = class _Config {
|
|
|
456
558
|
}
|
|
457
559
|
return _Config.normalizeTargetFeatures(targetFeatures);
|
|
458
560
|
}
|
|
459
|
-
|
|
460
|
-
for (const features of Object.values(perTargetFeatures)) {
|
|
461
|
-
if (!features) continue;
|
|
462
|
-
const normalized = _Config.normalizeTargetFeatures(features);
|
|
463
|
-
for (const feature of normalized) {
|
|
464
|
-
if (!allFeatures.includes(feature)) {
|
|
465
|
-
allFeatures.push(feature);
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
if (allFeatures.length === ALL_FEATURES.length) {
|
|
469
|
-
return allFeatures;
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
return allFeatures;
|
|
561
|
+
return _Config.collectAllFeatures(Object.values(perTargetFeatures));
|
|
473
562
|
}
|
|
474
563
|
if (this.features.includes("*")) {
|
|
475
564
|
return [...ALL_FEATURES];
|
|
@@ -497,23 +586,40 @@ var Config = class _Config {
|
|
|
497
586
|
}
|
|
498
587
|
return enabled;
|
|
499
588
|
}
|
|
589
|
+
/**
|
|
590
|
+
* Collect the union of features across all per-target values.
|
|
591
|
+
* Used when `getFeatures()` is called without a target in object mode.
|
|
592
|
+
*/
|
|
593
|
+
static collectAllFeatures(values) {
|
|
594
|
+
const allFeatures = [];
|
|
595
|
+
for (const value of values) {
|
|
596
|
+
if (!value) continue;
|
|
597
|
+
const normalized = _Config.normalizeTargetFeatures(value);
|
|
598
|
+
for (const feature of normalized) {
|
|
599
|
+
if (!allFeatures.includes(feature)) {
|
|
600
|
+
allFeatures.push(feature);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
if (allFeatures.length === ALL_FEATURES.length) {
|
|
604
|
+
return allFeatures;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
return allFeatures;
|
|
608
|
+
}
|
|
500
609
|
/**
|
|
501
610
|
* Returns the per-feature options object for a given target/feature, if any.
|
|
502
611
|
* Returns `undefined` when no per-feature options were provided or when the
|
|
503
612
|
* feature is not enabled for the given target.
|
|
504
613
|
*/
|
|
505
614
|
getFeatureOptions(target, feature) {
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
}
|
|
509
|
-
const targetFeatures = this.features[target];
|
|
510
|
-
if (!targetFeatures || Array.isArray(targetFeatures)) {
|
|
615
|
+
const value = isRulesyncConfigTargetsObject(this.targets) ? this.targets[target] : !Array.isArray(this.features) ? this.features[target] : void 0;
|
|
616
|
+
if (!value || Array.isArray(value)) {
|
|
511
617
|
return void 0;
|
|
512
618
|
}
|
|
513
|
-
const perFeature =
|
|
514
|
-
const
|
|
515
|
-
if (
|
|
516
|
-
return
|
|
619
|
+
const perFeature = value;
|
|
620
|
+
const featureValue = perFeature[feature];
|
|
621
|
+
if (featureValue && typeof featureValue === "object" && isFeatureValueEnabled(featureValue)) {
|
|
622
|
+
return featureValue;
|
|
517
623
|
}
|
|
518
624
|
return void 0;
|
|
519
625
|
}
|
|
@@ -521,6 +627,13 @@ var Config = class _Config {
|
|
|
521
627
|
* Check if per-target features configuration is being used.
|
|
522
628
|
*/
|
|
523
629
|
hasPerTargetFeatures() {
|
|
630
|
+
return isRulesyncConfigTargetsObject(this.targets) || !Array.isArray(this.features);
|
|
631
|
+
}
|
|
632
|
+
/**
|
|
633
|
+
* Returns true if the deprecated object form under `features` is in use.
|
|
634
|
+
* Callers can use this to emit a migration warning.
|
|
635
|
+
*/
|
|
636
|
+
hasDeprecatedFeaturesObjectForm() {
|
|
524
637
|
return !Array.isArray(this.features);
|
|
525
638
|
}
|
|
526
639
|
getVerbose() {
|
|
@@ -565,6 +678,17 @@ var Config = class _Config {
|
|
|
565
678
|
}
|
|
566
679
|
};
|
|
567
680
|
|
|
681
|
+
// src/config/deprecation-warnings.ts
|
|
682
|
+
var deprecationWarningEmitted = false;
|
|
683
|
+
var emitFeaturesObjectFormDeprecationWarning = () => {
|
|
684
|
+
if (deprecationWarningEmitted) return;
|
|
685
|
+
if (process.env.RULESYNC_SILENT_DEPRECATION) return;
|
|
686
|
+
deprecationWarningEmitted = true;
|
|
687
|
+
console.warn(
|
|
688
|
+
"[rulesync] DEPRECATED: 'features' object form is deprecated. Use the new 'targets' object form instead: `targets: { claudecode: { rules: true, ignore: { fileMode: 'local' } } }`. See https://github.com/dyoshikawa/rulesync/blob/main/docs/guide/configuration.md for the migration guide."
|
|
689
|
+
);
|
|
690
|
+
};
|
|
691
|
+
|
|
568
692
|
// src/config/config-resolver.ts
|
|
569
693
|
var getDefaults = () => ({
|
|
570
694
|
targets: ["agentsmd"],
|
|
@@ -591,6 +715,10 @@ var loadConfigFromFile = async (filePath) => {
|
|
|
591
715
|
const jsonData = (0, import_jsonc_parser.parse)(fileContent);
|
|
592
716
|
const parsed = ConfigFileSchema.parse(jsonData);
|
|
593
717
|
const { $schema: _schema, ...configParams } = parsed;
|
|
718
|
+
assertTargetsFeaturesExclusive({
|
|
719
|
+
targets: configParams.targets,
|
|
720
|
+
features: configParams.features
|
|
721
|
+
});
|
|
594
722
|
return configParams;
|
|
595
723
|
};
|
|
596
724
|
var mergeConfigs = (baseConfig, localConfig) => {
|
|
@@ -634,14 +762,35 @@ var ConfigResolver = class {
|
|
|
634
762
|
const localConfigPath = (0, import_node_path4.join)(configDir, RULESYNC_LOCAL_CONFIG_RELATIVE_FILE_PATH);
|
|
635
763
|
const localConfig = await loadConfigFromFile(localConfigPath);
|
|
636
764
|
const configByFile = mergeConfigs(baseConfig, localConfig);
|
|
765
|
+
try {
|
|
766
|
+
assertTargetsFeaturesExclusive({
|
|
767
|
+
targets: configByFile.targets,
|
|
768
|
+
features: configByFile.features
|
|
769
|
+
});
|
|
770
|
+
} catch (error) {
|
|
771
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
772
|
+
throw new Error(
|
|
773
|
+
`${detail} (detected after merging '${validatedConfigPath}' with '${localConfigPath}' \u2014 the two files combined produce the invalid combination; remove the conflicting field from one of them).`,
|
|
774
|
+
{ cause: error }
|
|
775
|
+
);
|
|
776
|
+
}
|
|
637
777
|
const resolvedGlobal = global ?? configByFile.global ?? getDefaults().global;
|
|
638
778
|
const resolvedSimulateCommands = simulateCommands ?? configByFile.simulateCommands ?? getDefaults().simulateCommands;
|
|
639
779
|
const resolvedSimulateSubagents = simulateSubagents ?? configByFile.simulateSubagents ?? getDefaults().simulateSubagents;
|
|
640
780
|
const resolvedSimulateSkills = simulateSkills ?? configByFile.simulateSkills ?? getDefaults().simulateSkills;
|
|
641
781
|
const resolvedGitignoreTargetsOnly = gitignoreTargetsOnly ?? configByFile.gitignoreTargetsOnly ?? getDefaults().gitignoreTargetsOnly;
|
|
782
|
+
const userProvidedFeatures = features ?? configByFile.features;
|
|
783
|
+
const userProvidedTargets = targets ?? configByFile.targets;
|
|
784
|
+
const targetsIsObject = userProvidedTargets !== void 0 && !Array.isArray(userProvidedTargets);
|
|
785
|
+
const featuresIsObject = userProvidedFeatures !== void 0 && !Array.isArray(userProvidedFeatures);
|
|
786
|
+
if (featuresIsObject) {
|
|
787
|
+
emitFeaturesObjectFormDeprecationWarning();
|
|
788
|
+
}
|
|
789
|
+
const resolvedFeatures = userProvidedFeatures ?? (targetsIsObject ? void 0 : getDefaults().features);
|
|
790
|
+
const resolvedTargets = userProvidedTargets ?? (featuresIsObject ? void 0 : getDefaults().targets);
|
|
642
791
|
const configParams = {
|
|
643
|
-
targets:
|
|
644
|
-
features:
|
|
792
|
+
targets: resolvedTargets,
|
|
793
|
+
features: resolvedFeatures,
|
|
645
794
|
verbose: verbose ?? configByFile.verbose ?? getDefaults().verbose,
|
|
646
795
|
delete: isDelete ?? configByFile.delete ?? getDefaults().delete,
|
|
647
796
|
baseDirs: getBaseDirsInLightOfGlobal({
|
|
@@ -676,7 +825,7 @@ function getBaseDirsInLightOfGlobal({
|
|
|
676
825
|
}
|
|
677
826
|
|
|
678
827
|
// src/lib/generate.ts
|
|
679
|
-
var
|
|
828
|
+
var import_node_path140 = require("path");
|
|
680
829
|
var import_es_toolkit5 = require("es-toolkit");
|
|
681
830
|
|
|
682
831
|
// src/features/commands/commands-processor.ts
|
|
@@ -8992,7 +9141,7 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
8992
9141
|
};
|
|
8993
9142
|
|
|
8994
9143
|
// src/features/permissions/permissions-processor.ts
|
|
8995
|
-
var
|
|
9144
|
+
var import_mini32 = require("zod/mini");
|
|
8996
9145
|
|
|
8997
9146
|
// src/features/permissions/claudecode-permissions.ts
|
|
8998
9147
|
var import_node_path65 = require("path");
|
|
@@ -9321,6 +9470,7 @@ function convertClaudeToRulesyncPermissions(params) {
|
|
|
9321
9470
|
var import_node_path66 = require("path");
|
|
9322
9471
|
var smolToml4 = __toESM(require("smol-toml"), 1);
|
|
9323
9472
|
var RULESYNC_PROFILE_NAME = "rulesync";
|
|
9473
|
+
var RULESYNC_BASH_RULES_FILE_NAME = "rulesync.rules";
|
|
9324
9474
|
var CodexcliPermissions = class _CodexcliPermissions extends ToolPermissions {
|
|
9325
9475
|
static getSettablePaths(_options = {}) {
|
|
9326
9476
|
return {
|
|
@@ -9410,6 +9560,22 @@ var CodexcliPermissions = class _CodexcliPermissions extends ToolPermissions {
|
|
|
9410
9560
|
});
|
|
9411
9561
|
}
|
|
9412
9562
|
};
|
|
9563
|
+
var CodexcliRulesFile = class extends ToolFile {
|
|
9564
|
+
validate() {
|
|
9565
|
+
return { success: true, error: null };
|
|
9566
|
+
}
|
|
9567
|
+
};
|
|
9568
|
+
function createCodexcliBashRulesFile({
|
|
9569
|
+
baseDir = process.cwd(),
|
|
9570
|
+
config
|
|
9571
|
+
}) {
|
|
9572
|
+
return new CodexcliRulesFile({
|
|
9573
|
+
baseDir,
|
|
9574
|
+
relativeDirPath: (0, import_node_path66.join)(".codex", "rules"),
|
|
9575
|
+
relativeFilePath: RULESYNC_BASH_RULES_FILE_NAME,
|
|
9576
|
+
fileContent: buildCodexBashRulesContent(config)
|
|
9577
|
+
});
|
|
9578
|
+
}
|
|
9413
9579
|
function convertRulesyncToCodexProfile({
|
|
9414
9580
|
config,
|
|
9415
9581
|
logger
|
|
@@ -9518,6 +9684,46 @@ function mapReadAction(action) {
|
|
|
9518
9684
|
function mapWriteAction(action) {
|
|
9519
9685
|
return action === "allow" ? "write" : "none";
|
|
9520
9686
|
}
|
|
9687
|
+
function buildCodexBashRulesContent(config) {
|
|
9688
|
+
const bashRules = config.permission.bash ?? {};
|
|
9689
|
+
const entries = Object.entries(bashRules);
|
|
9690
|
+
const header = [
|
|
9691
|
+
"# Generated by Rulesync from .rulesync/permissions.json (permission.bash)",
|
|
9692
|
+
"# https://developers.openai.com/codex/rules"
|
|
9693
|
+
];
|
|
9694
|
+
if (entries.length === 0) {
|
|
9695
|
+
return [...header, "# No bash permission rules were configured."].join("\n");
|
|
9696
|
+
}
|
|
9697
|
+
const ruleBlocks = entries.map(([pattern, action]) => {
|
|
9698
|
+
const tokens = toCommandPatternTokens(pattern);
|
|
9699
|
+
if (tokens.length === 0) {
|
|
9700
|
+
return null;
|
|
9701
|
+
}
|
|
9702
|
+
const serializedTokens = tokens.map((token) => JSON.stringify(token)).join(", ");
|
|
9703
|
+
const decision = mapBashActionToDecision(action);
|
|
9704
|
+
return [
|
|
9705
|
+
"",
|
|
9706
|
+
`# ${pattern}`,
|
|
9707
|
+
"prefix_rule(",
|
|
9708
|
+
` pattern = [${serializedTokens}],`,
|
|
9709
|
+
` decision = ${JSON.stringify(decision)},`,
|
|
9710
|
+
` justification = ${JSON.stringify(`Generated from Rulesync permission.bash: ${pattern}`)},`,
|
|
9711
|
+
")"
|
|
9712
|
+
].join("\n");
|
|
9713
|
+
}).filter((block) => block !== null);
|
|
9714
|
+
if (ruleBlocks.length === 0) {
|
|
9715
|
+
return [...header, "# No valid bash patterns were found."].join("\n");
|
|
9716
|
+
}
|
|
9717
|
+
return [...header, ...ruleBlocks].join("\n");
|
|
9718
|
+
}
|
|
9719
|
+
function toCommandPatternTokens(commandPattern) {
|
|
9720
|
+
return commandPattern.trim().split(/\s+/).map((token) => token.trim()).filter((token) => token.length > 0);
|
|
9721
|
+
}
|
|
9722
|
+
function mapBashActionToDecision(action) {
|
|
9723
|
+
if (action === "allow") return "allow";
|
|
9724
|
+
if (action === "ask") return "prompt";
|
|
9725
|
+
return "forbidden";
|
|
9726
|
+
}
|
|
9521
9727
|
|
|
9522
9728
|
// src/features/permissions/geminicli-permissions.ts
|
|
9523
9729
|
var import_node_path67 = require("path");
|
|
@@ -9683,16 +9889,200 @@ function parseGeminicliToolEntry({ entry }) {
|
|
|
9683
9889
|
};
|
|
9684
9890
|
}
|
|
9685
9891
|
|
|
9686
|
-
// src/features/permissions/
|
|
9892
|
+
// src/features/permissions/kiro-permissions.ts
|
|
9687
9893
|
var import_node_path68 = require("path");
|
|
9688
|
-
var import_jsonc_parser5 = require("jsonc-parser");
|
|
9689
9894
|
var import_mini30 = require("zod/mini");
|
|
9690
|
-
var
|
|
9691
|
-
import_mini30.z.
|
|
9692
|
-
import_mini30.z.record(import_mini30.z.string(), import_mini30.z.
|
|
9895
|
+
var KiroAgentSchema = import_mini30.z.looseObject({
|
|
9896
|
+
allowedTools: import_mini30.z.optional(import_mini30.z.array(import_mini30.z.string())),
|
|
9897
|
+
toolsSettings: import_mini30.z.optional(import_mini30.z.record(import_mini30.z.string(), import_mini30.z.unknown()))
|
|
9898
|
+
});
|
|
9899
|
+
var UnknownRecordSchema = import_mini30.z.record(import_mini30.z.string(), import_mini30.z.unknown());
|
|
9900
|
+
var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
9901
|
+
static getSettablePaths(_options = {}) {
|
|
9902
|
+
return {
|
|
9903
|
+
relativeDirPath: (0, import_node_path68.join)(".kiro", "agents"),
|
|
9904
|
+
relativeFilePath: "default.json"
|
|
9905
|
+
};
|
|
9906
|
+
}
|
|
9907
|
+
isDeletable() {
|
|
9908
|
+
return false;
|
|
9909
|
+
}
|
|
9910
|
+
static async fromFile({
|
|
9911
|
+
baseDir = process.cwd(),
|
|
9912
|
+
validate = true
|
|
9913
|
+
}) {
|
|
9914
|
+
const paths = this.getSettablePaths();
|
|
9915
|
+
const filePath = (0, import_node_path68.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
9916
|
+
const fileContent = await readFileContentOrNull(filePath) ?? JSON.stringify({}, null, 2);
|
|
9917
|
+
return new _KiroPermissions({
|
|
9918
|
+
baseDir,
|
|
9919
|
+
relativeDirPath: paths.relativeDirPath,
|
|
9920
|
+
relativeFilePath: paths.relativeFilePath,
|
|
9921
|
+
fileContent,
|
|
9922
|
+
validate
|
|
9923
|
+
});
|
|
9924
|
+
}
|
|
9925
|
+
static async fromRulesyncPermissions({
|
|
9926
|
+
baseDir = process.cwd(),
|
|
9927
|
+
rulesyncPermissions,
|
|
9928
|
+
validate = true,
|
|
9929
|
+
logger
|
|
9930
|
+
}) {
|
|
9931
|
+
const paths = this.getSettablePaths();
|
|
9932
|
+
const filePath = (0, import_node_path68.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
9933
|
+
const existingContent = await readFileContentOrNull(filePath) ?? JSON.stringify({}, null, 2);
|
|
9934
|
+
const parsedResult = KiroAgentSchema.safeParse(JSON.parse(existingContent));
|
|
9935
|
+
if (!parsedResult.success) {
|
|
9936
|
+
throw new Error(
|
|
9937
|
+
`Failed to parse existing Kiro agent config at ${filePath}: ${formatError(parsedResult.error)}`
|
|
9938
|
+
);
|
|
9939
|
+
}
|
|
9940
|
+
const config = rulesyncPermissions.getJson();
|
|
9941
|
+
const next = buildKiroPermissionsFromRulesync({ config, logger, existing: parsedResult.data });
|
|
9942
|
+
return new _KiroPermissions({
|
|
9943
|
+
baseDir,
|
|
9944
|
+
relativeDirPath: paths.relativeDirPath,
|
|
9945
|
+
relativeFilePath: paths.relativeFilePath,
|
|
9946
|
+
fileContent: JSON.stringify(next, null, 2),
|
|
9947
|
+
validate
|
|
9948
|
+
});
|
|
9949
|
+
}
|
|
9950
|
+
toRulesyncPermissions() {
|
|
9951
|
+
let parsed;
|
|
9952
|
+
try {
|
|
9953
|
+
parsed = KiroAgentSchema.parse(JSON.parse(this.getFileContent()));
|
|
9954
|
+
} catch (error) {
|
|
9955
|
+
throw new Error(
|
|
9956
|
+
`Failed to parse Kiro permissions content in ${(0, import_node_path68.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
9957
|
+
{ cause: error }
|
|
9958
|
+
);
|
|
9959
|
+
}
|
|
9960
|
+
const permission = {};
|
|
9961
|
+
const toolsSettings = parsed.toolsSettings ?? {};
|
|
9962
|
+
const shellSettings = asRecord(toolsSettings.shell);
|
|
9963
|
+
const shellAllow = asStringArray(shellSettings.allowedCommands);
|
|
9964
|
+
const shellDeny = asStringArray(shellSettings.deniedCommands);
|
|
9965
|
+
if (shellAllow.length > 0 || shellDeny.length > 0) {
|
|
9966
|
+
permission.bash = {};
|
|
9967
|
+
for (const pattern of shellAllow) permission.bash[pattern] = "allow";
|
|
9968
|
+
for (const pattern of shellDeny) permission.bash[pattern] = "deny";
|
|
9969
|
+
}
|
|
9970
|
+
const readSettings = asRecord(toolsSettings.read);
|
|
9971
|
+
const readAllow = asStringArray(readSettings.allowedPaths);
|
|
9972
|
+
const readDeny = asStringArray(readSettings.deniedPaths);
|
|
9973
|
+
if (readAllow.length > 0 || readDeny.length > 0) {
|
|
9974
|
+
permission.read = {};
|
|
9975
|
+
for (const pattern of readAllow) permission.read[pattern] = "allow";
|
|
9976
|
+
for (const pattern of readDeny) permission.read[pattern] = "deny";
|
|
9977
|
+
}
|
|
9978
|
+
const writeSettings = asRecord(toolsSettings.write);
|
|
9979
|
+
const writeAllow = asStringArray(writeSettings.allowedPaths);
|
|
9980
|
+
const writeDeny = asStringArray(writeSettings.deniedPaths);
|
|
9981
|
+
if (writeAllow.length > 0 || writeDeny.length > 0) {
|
|
9982
|
+
permission.write = {};
|
|
9983
|
+
for (const pattern of writeAllow) permission.write[pattern] = "allow";
|
|
9984
|
+
for (const pattern of writeDeny) permission.write[pattern] = "deny";
|
|
9985
|
+
}
|
|
9986
|
+
const allowedTools = new Set(parsed.allowedTools ?? []);
|
|
9987
|
+
if (allowedTools.has("web_fetch")) {
|
|
9988
|
+
permission.webfetch = { "*": "allow" };
|
|
9989
|
+
}
|
|
9990
|
+
if (allowedTools.has("web_search")) {
|
|
9991
|
+
permission.websearch = { "*": "allow" };
|
|
9992
|
+
}
|
|
9993
|
+
return this.toRulesyncPermissionsDefault({
|
|
9994
|
+
fileContent: JSON.stringify({ permission }, null, 2)
|
|
9995
|
+
});
|
|
9996
|
+
}
|
|
9997
|
+
validate() {
|
|
9998
|
+
return { success: true, error: null };
|
|
9999
|
+
}
|
|
10000
|
+
static forDeletion({
|
|
10001
|
+
baseDir = process.cwd(),
|
|
10002
|
+
relativeDirPath,
|
|
10003
|
+
relativeFilePath
|
|
10004
|
+
}) {
|
|
10005
|
+
return new _KiroPermissions({
|
|
10006
|
+
baseDir,
|
|
10007
|
+
relativeDirPath,
|
|
10008
|
+
relativeFilePath,
|
|
10009
|
+
fileContent: JSON.stringify({}, null, 2),
|
|
10010
|
+
validate: false
|
|
10011
|
+
});
|
|
10012
|
+
}
|
|
10013
|
+
};
|
|
10014
|
+
function buildKiroPermissionsFromRulesync({
|
|
10015
|
+
config,
|
|
10016
|
+
logger,
|
|
10017
|
+
existing
|
|
10018
|
+
}) {
|
|
10019
|
+
const nextAllowedTools = new Set(existing.allowedTools ?? []);
|
|
10020
|
+
const nextToolsSettings = { ...asRecord(existing.toolsSettings) };
|
|
10021
|
+
const shell = {
|
|
10022
|
+
allowedCommands: [],
|
|
10023
|
+
deniedCommands: []
|
|
10024
|
+
};
|
|
10025
|
+
const read = {
|
|
10026
|
+
allowedPaths: [],
|
|
10027
|
+
deniedPaths: []
|
|
10028
|
+
};
|
|
10029
|
+
const write = {
|
|
10030
|
+
allowedPaths: [],
|
|
10031
|
+
deniedPaths: []
|
|
10032
|
+
};
|
|
10033
|
+
for (const [category, rules] of Object.entries(config.permission)) {
|
|
10034
|
+
for (const [pattern, action] of Object.entries(rules)) {
|
|
10035
|
+
if (action === "ask") {
|
|
10036
|
+
logger?.warn(`Kiro permissions do not support "ask". Skipping ${category}:${pattern}`);
|
|
10037
|
+
continue;
|
|
10038
|
+
}
|
|
10039
|
+
if (category === "bash") {
|
|
10040
|
+
(action === "allow" ? shell.allowedCommands : shell.deniedCommands).push(pattern);
|
|
10041
|
+
} else if (category === "read") {
|
|
10042
|
+
(action === "allow" ? read.allowedPaths : read.deniedPaths).push(pattern);
|
|
10043
|
+
} else if (category === "edit" || category === "write") {
|
|
10044
|
+
(action === "allow" ? write.allowedPaths : write.deniedPaths).push(pattern);
|
|
10045
|
+
} else if (category === "webfetch" || category === "websearch") {
|
|
10046
|
+
if (pattern !== "*") {
|
|
10047
|
+
logger?.warn(
|
|
10048
|
+
`Kiro ${category} supports only wildcard (*) via allowedTools. Skipping rule: ${pattern}`
|
|
10049
|
+
);
|
|
10050
|
+
continue;
|
|
10051
|
+
}
|
|
10052
|
+
if (action === "allow")
|
|
10053
|
+
nextAllowedTools.add(category === "webfetch" ? "web_fetch" : "web_search");
|
|
10054
|
+
} else {
|
|
10055
|
+
logger?.warn(`Kiro permissions do not support category: ${category}. Skipping.`);
|
|
10056
|
+
}
|
|
10057
|
+
}
|
|
10058
|
+
}
|
|
10059
|
+
nextToolsSettings.shell = shell;
|
|
10060
|
+
nextToolsSettings.read = read;
|
|
10061
|
+
nextToolsSettings.write = write;
|
|
10062
|
+
return {
|
|
10063
|
+
...existing,
|
|
10064
|
+
allowedTools: [...nextAllowedTools].toSorted(),
|
|
10065
|
+
toolsSettings: nextToolsSettings
|
|
10066
|
+
};
|
|
10067
|
+
}
|
|
10068
|
+
function asRecord(value) {
|
|
10069
|
+
const result = UnknownRecordSchema.safeParse(value);
|
|
10070
|
+
return result.success ? result.data : {};
|
|
10071
|
+
}
|
|
10072
|
+
function asStringArray(value) {
|
|
10073
|
+
return Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
|
|
10074
|
+
}
|
|
10075
|
+
|
|
10076
|
+
// src/features/permissions/opencode-permissions.ts
|
|
10077
|
+
var import_node_path69 = require("path");
|
|
10078
|
+
var import_jsonc_parser5 = require("jsonc-parser");
|
|
10079
|
+
var import_mini31 = require("zod/mini");
|
|
10080
|
+
var OpencodePermissionSchema = import_mini31.z.union([
|
|
10081
|
+
import_mini31.z.enum(["allow", "ask", "deny"]),
|
|
10082
|
+
import_mini31.z.record(import_mini31.z.string(), import_mini31.z.enum(["allow", "ask", "deny"]))
|
|
9693
10083
|
]);
|
|
9694
|
-
var OpencodePermissionsConfigSchema =
|
|
9695
|
-
permission:
|
|
10084
|
+
var OpencodePermissionsConfigSchema = import_mini31.z.looseObject({
|
|
10085
|
+
permission: import_mini31.z.optional(import_mini31.z.record(import_mini31.z.string(), OpencodePermissionSchema))
|
|
9696
10086
|
});
|
|
9697
10087
|
var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
9698
10088
|
json;
|
|
@@ -9709,7 +10099,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
9709
10099
|
static getSettablePaths({
|
|
9710
10100
|
global = false
|
|
9711
10101
|
} = {}) {
|
|
9712
|
-
return global ? { relativeDirPath: (0,
|
|
10102
|
+
return global ? { relativeDirPath: (0, import_node_path69.join)(".config", "opencode"), relativeFilePath: "opencode.json" } : { relativeDirPath: ".", relativeFilePath: "opencode.json" };
|
|
9713
10103
|
}
|
|
9714
10104
|
static async fromFile({
|
|
9715
10105
|
baseDir = process.cwd(),
|
|
@@ -9717,9 +10107,9 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
9717
10107
|
global = false
|
|
9718
10108
|
}) {
|
|
9719
10109
|
const basePaths = _OpencodePermissions.getSettablePaths({ global });
|
|
9720
|
-
const jsonDir = (0,
|
|
9721
|
-
const jsoncPath = (0,
|
|
9722
|
-
const jsonPath = (0,
|
|
10110
|
+
const jsonDir = (0, import_node_path69.join)(baseDir, basePaths.relativeDirPath);
|
|
10111
|
+
const jsoncPath = (0, import_node_path69.join)(jsonDir, "opencode.jsonc");
|
|
10112
|
+
const jsonPath = (0, import_node_path69.join)(jsonDir, "opencode.json");
|
|
9723
10113
|
let fileContent = await readFileContentOrNull(jsoncPath);
|
|
9724
10114
|
let relativeFilePath = "opencode.jsonc";
|
|
9725
10115
|
if (!fileContent) {
|
|
@@ -9744,9 +10134,9 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
9744
10134
|
global = false
|
|
9745
10135
|
}) {
|
|
9746
10136
|
const basePaths = _OpencodePermissions.getSettablePaths({ global });
|
|
9747
|
-
const jsonDir = (0,
|
|
9748
|
-
const jsoncPath = (0,
|
|
9749
|
-
const jsonPath = (0,
|
|
10137
|
+
const jsonDir = (0, import_node_path69.join)(baseDir, basePaths.relativeDirPath);
|
|
10138
|
+
const jsoncPath = (0, import_node_path69.join)(jsonDir, "opencode.jsonc");
|
|
10139
|
+
const jsonPath = (0, import_node_path69.join)(jsonDir, "opencode.json");
|
|
9750
10140
|
let fileContent = await readFileContentOrNull(jsoncPath);
|
|
9751
10141
|
let relativeFilePath = "opencode.jsonc";
|
|
9752
10142
|
if (!fileContent) {
|
|
@@ -9820,9 +10210,10 @@ var permissionsProcessorToolTargetTuple = [
|
|
|
9820
10210
|
"claudecode",
|
|
9821
10211
|
"codexcli",
|
|
9822
10212
|
"geminicli",
|
|
10213
|
+
"kiro",
|
|
9823
10214
|
"opencode"
|
|
9824
10215
|
];
|
|
9825
|
-
var PermissionsProcessorToolTargetSchema =
|
|
10216
|
+
var PermissionsProcessorToolTargetSchema = import_mini32.z.enum(permissionsProcessorToolTargetTuple);
|
|
9826
10217
|
var toolPermissionsFactories = /* @__PURE__ */ new Map([
|
|
9827
10218
|
[
|
|
9828
10219
|
"claudecode",
|
|
@@ -9830,7 +10221,7 @@ var toolPermissionsFactories = /* @__PURE__ */ new Map([
|
|
|
9830
10221
|
class: ClaudecodePermissions,
|
|
9831
10222
|
meta: {
|
|
9832
10223
|
supportsProject: true,
|
|
9833
|
-
supportsGlobal:
|
|
10224
|
+
supportsGlobal: true,
|
|
9834
10225
|
supportsImport: true
|
|
9835
10226
|
}
|
|
9836
10227
|
}
|
|
@@ -9857,6 +10248,17 @@ var toolPermissionsFactories = /* @__PURE__ */ new Map([
|
|
|
9857
10248
|
}
|
|
9858
10249
|
}
|
|
9859
10250
|
],
|
|
10251
|
+
[
|
|
10252
|
+
"kiro",
|
|
10253
|
+
{
|
|
10254
|
+
class: KiroPermissions,
|
|
10255
|
+
meta: {
|
|
10256
|
+
supportsProject: true,
|
|
10257
|
+
supportsGlobal: false,
|
|
10258
|
+
supportsImport: true
|
|
10259
|
+
}
|
|
10260
|
+
}
|
|
10261
|
+
],
|
|
9860
10262
|
[
|
|
9861
10263
|
"opencode",
|
|
9862
10264
|
{
|
|
@@ -9952,7 +10354,14 @@ var PermissionsProcessor = class extends FeatureProcessor {
|
|
|
9952
10354
|
logger: this.logger,
|
|
9953
10355
|
global: this.global
|
|
9954
10356
|
});
|
|
9955
|
-
|
|
10357
|
+
if (this.toolTarget !== "codexcli") {
|
|
10358
|
+
return [toolPermissions];
|
|
10359
|
+
}
|
|
10360
|
+
const bashRulesFile = createCodexcliBashRulesFile({
|
|
10361
|
+
baseDir: this.baseDir,
|
|
10362
|
+
config: rulesyncPermissions.getJson()
|
|
10363
|
+
});
|
|
10364
|
+
return [toolPermissions, bashRulesFile];
|
|
9956
10365
|
}
|
|
9957
10366
|
async convertToolFilesToRulesyncFiles(toolFiles) {
|
|
9958
10367
|
const permissions = toolFiles.filter((f) => f instanceof ToolPermissions);
|
|
@@ -9967,25 +10376,25 @@ var PermissionsProcessor = class extends FeatureProcessor {
|
|
|
9967
10376
|
};
|
|
9968
10377
|
|
|
9969
10378
|
// src/features/rules/rules-processor.ts
|
|
9970
|
-
var
|
|
10379
|
+
var import_node_path139 = require("path");
|
|
9971
10380
|
var import_toon = require("@toon-format/toon");
|
|
9972
|
-
var
|
|
10381
|
+
var import_mini71 = require("zod/mini");
|
|
9973
10382
|
|
|
9974
10383
|
// src/constants/general.ts
|
|
9975
10384
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
9976
10385
|
|
|
9977
10386
|
// src/features/skills/agentsmd-skill.ts
|
|
9978
|
-
var
|
|
10387
|
+
var import_node_path73 = require("path");
|
|
9979
10388
|
|
|
9980
10389
|
// src/features/skills/simulated-skill.ts
|
|
9981
|
-
var
|
|
9982
|
-
var
|
|
10390
|
+
var import_node_path72 = require("path");
|
|
10391
|
+
var import_mini33 = require("zod/mini");
|
|
9983
10392
|
|
|
9984
10393
|
// src/features/skills/tool-skill.ts
|
|
9985
|
-
var
|
|
10394
|
+
var import_node_path71 = require("path");
|
|
9986
10395
|
|
|
9987
10396
|
// src/types/ai-dir.ts
|
|
9988
|
-
var
|
|
10397
|
+
var import_node_path70 = __toESM(require("path"), 1);
|
|
9989
10398
|
var AiDir = class {
|
|
9990
10399
|
/**
|
|
9991
10400
|
* @example "."
|
|
@@ -10019,7 +10428,7 @@ var AiDir = class {
|
|
|
10019
10428
|
otherFiles = [],
|
|
10020
10429
|
global = false
|
|
10021
10430
|
}) {
|
|
10022
|
-
if (dirName.includes(
|
|
10431
|
+
if (dirName.includes(import_node_path70.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
|
|
10023
10432
|
throw new Error(`Directory name cannot contain path separators: dirName="${dirName}"`);
|
|
10024
10433
|
}
|
|
10025
10434
|
this.baseDir = baseDir;
|
|
@@ -10042,11 +10451,11 @@ var AiDir = class {
|
|
|
10042
10451
|
return this.dirName;
|
|
10043
10452
|
}
|
|
10044
10453
|
getDirPath() {
|
|
10045
|
-
const fullPath =
|
|
10046
|
-
const resolvedFull = (0,
|
|
10047
|
-
const resolvedBase = (0,
|
|
10048
|
-
const rel = (0,
|
|
10049
|
-
if (rel.startsWith("..") ||
|
|
10454
|
+
const fullPath = import_node_path70.default.join(this.baseDir, this.relativeDirPath, this.dirName);
|
|
10455
|
+
const resolvedFull = (0, import_node_path70.resolve)(fullPath);
|
|
10456
|
+
const resolvedBase = (0, import_node_path70.resolve)(this.baseDir);
|
|
10457
|
+
const rel = (0, import_node_path70.relative)(resolvedBase, resolvedFull);
|
|
10458
|
+
if (rel.startsWith("..") || import_node_path70.default.isAbsolute(rel)) {
|
|
10050
10459
|
throw new Error(
|
|
10051
10460
|
`Path traversal detected: Final path escapes baseDir. baseDir="${this.baseDir}", relativeDirPath="${this.relativeDirPath}", dirName="${this.dirName}"`
|
|
10052
10461
|
);
|
|
@@ -10063,7 +10472,7 @@ var AiDir = class {
|
|
|
10063
10472
|
* Returns the relative path from CWD with POSIX separators for consistent cross-platform output.
|
|
10064
10473
|
*/
|
|
10065
10474
|
getRelativePathFromCwd() {
|
|
10066
|
-
return toPosixPath(
|
|
10475
|
+
return toPosixPath(import_node_path70.default.join(this.relativeDirPath, this.dirName));
|
|
10067
10476
|
}
|
|
10068
10477
|
getGlobal() {
|
|
10069
10478
|
return this.global;
|
|
@@ -10082,15 +10491,15 @@ var AiDir = class {
|
|
|
10082
10491
|
* @returns Array of files with their relative paths and buffers
|
|
10083
10492
|
*/
|
|
10084
10493
|
static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
|
|
10085
|
-
const dirPath = (0,
|
|
10086
|
-
const glob = (0,
|
|
10494
|
+
const dirPath = (0, import_node_path70.join)(baseDir, relativeDirPath, dirName);
|
|
10495
|
+
const glob = (0, import_node_path70.join)(dirPath, "**", "*");
|
|
10087
10496
|
const filePaths = await findFilesByGlobs(glob, { type: "file" });
|
|
10088
|
-
const filteredPaths = filePaths.filter((filePath) => (0,
|
|
10497
|
+
const filteredPaths = filePaths.filter((filePath) => (0, import_node_path70.basename)(filePath) !== excludeFileName);
|
|
10089
10498
|
const files = await Promise.all(
|
|
10090
10499
|
filteredPaths.map(async (filePath) => {
|
|
10091
10500
|
const fileBuffer = await readFileBuffer(filePath);
|
|
10092
10501
|
return {
|
|
10093
|
-
relativeFilePathToDirPath: (0,
|
|
10502
|
+
relativeFilePathToDirPath: (0, import_node_path70.relative)(dirPath, filePath),
|
|
10094
10503
|
fileBuffer
|
|
10095
10504
|
};
|
|
10096
10505
|
})
|
|
@@ -10184,8 +10593,8 @@ var ToolSkill = class extends AiDir {
|
|
|
10184
10593
|
}) {
|
|
10185
10594
|
const settablePaths = getSettablePaths({ global });
|
|
10186
10595
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
10187
|
-
const skillDirPath = (0,
|
|
10188
|
-
const skillFilePath = (0,
|
|
10596
|
+
const skillDirPath = (0, import_node_path71.join)(baseDir, actualRelativeDirPath, dirName);
|
|
10597
|
+
const skillFilePath = (0, import_node_path71.join)(skillDirPath, SKILL_FILE_NAME);
|
|
10189
10598
|
if (!await fileExists(skillFilePath)) {
|
|
10190
10599
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
10191
10600
|
}
|
|
@@ -10209,16 +10618,16 @@ var ToolSkill = class extends AiDir {
|
|
|
10209
10618
|
}
|
|
10210
10619
|
requireMainFileFrontmatter() {
|
|
10211
10620
|
if (!this.mainFile?.frontmatter) {
|
|
10212
|
-
throw new Error(`Frontmatter is not defined in ${(0,
|
|
10621
|
+
throw new Error(`Frontmatter is not defined in ${(0, import_node_path71.join)(this.relativeDirPath, this.dirName)}`);
|
|
10213
10622
|
}
|
|
10214
10623
|
return this.mainFile.frontmatter;
|
|
10215
10624
|
}
|
|
10216
10625
|
};
|
|
10217
10626
|
|
|
10218
10627
|
// src/features/skills/simulated-skill.ts
|
|
10219
|
-
var SimulatedSkillFrontmatterSchema =
|
|
10220
|
-
name:
|
|
10221
|
-
description:
|
|
10628
|
+
var SimulatedSkillFrontmatterSchema = import_mini33.z.looseObject({
|
|
10629
|
+
name: import_mini33.z.string(),
|
|
10630
|
+
description: import_mini33.z.string()
|
|
10222
10631
|
});
|
|
10223
10632
|
var SimulatedSkill = class extends ToolSkill {
|
|
10224
10633
|
frontmatter;
|
|
@@ -10249,7 +10658,7 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
10249
10658
|
const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
|
|
10250
10659
|
if (!result.success) {
|
|
10251
10660
|
throw new Error(
|
|
10252
|
-
`Invalid frontmatter in ${(0,
|
|
10661
|
+
`Invalid frontmatter in ${(0, import_node_path72.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
|
|
10253
10662
|
);
|
|
10254
10663
|
}
|
|
10255
10664
|
}
|
|
@@ -10308,8 +10717,8 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
10308
10717
|
}) {
|
|
10309
10718
|
const settablePaths = this.getSettablePaths();
|
|
10310
10719
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
10311
|
-
const skillDirPath = (0,
|
|
10312
|
-
const skillFilePath = (0,
|
|
10720
|
+
const skillDirPath = (0, import_node_path72.join)(baseDir, actualRelativeDirPath, dirName);
|
|
10721
|
+
const skillFilePath = (0, import_node_path72.join)(skillDirPath, SKILL_FILE_NAME);
|
|
10313
10722
|
if (!await fileExists(skillFilePath)) {
|
|
10314
10723
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
10315
10724
|
}
|
|
@@ -10386,7 +10795,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
10386
10795
|
throw new Error("AgentsmdSkill does not support global mode.");
|
|
10387
10796
|
}
|
|
10388
10797
|
return {
|
|
10389
|
-
relativeDirPath: (0,
|
|
10798
|
+
relativeDirPath: (0, import_node_path73.join)(".agents", "skills")
|
|
10390
10799
|
};
|
|
10391
10800
|
}
|
|
10392
10801
|
static async fromDir(params) {
|
|
@@ -10413,11 +10822,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
10413
10822
|
};
|
|
10414
10823
|
|
|
10415
10824
|
// src/features/skills/factorydroid-skill.ts
|
|
10416
|
-
var
|
|
10825
|
+
var import_node_path74 = require("path");
|
|
10417
10826
|
var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
10418
10827
|
static getSettablePaths(_options) {
|
|
10419
10828
|
return {
|
|
10420
|
-
relativeDirPath: (0,
|
|
10829
|
+
relativeDirPath: (0, import_node_path74.join)(".factory", "skills")
|
|
10421
10830
|
};
|
|
10422
10831
|
}
|
|
10423
10832
|
static async fromDir(params) {
|
|
@@ -10444,50 +10853,50 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
|
10444
10853
|
};
|
|
10445
10854
|
|
|
10446
10855
|
// src/features/skills/rovodev-skill.ts
|
|
10447
|
-
var
|
|
10448
|
-
var
|
|
10856
|
+
var import_node_path76 = require("path");
|
|
10857
|
+
var import_mini35 = require("zod/mini");
|
|
10449
10858
|
|
|
10450
10859
|
// src/features/skills/rulesync-skill.ts
|
|
10451
|
-
var
|
|
10452
|
-
var
|
|
10453
|
-
var RulesyncSkillFrontmatterSchemaInternal =
|
|
10454
|
-
name:
|
|
10455
|
-
description:
|
|
10456
|
-
targets:
|
|
10457
|
-
claudecode:
|
|
10458
|
-
|
|
10459
|
-
"allowed-tools":
|
|
10460
|
-
model:
|
|
10461
|
-
"disable-model-invocation":
|
|
10860
|
+
var import_node_path75 = require("path");
|
|
10861
|
+
var import_mini34 = require("zod/mini");
|
|
10862
|
+
var RulesyncSkillFrontmatterSchemaInternal = import_mini34.z.looseObject({
|
|
10863
|
+
name: import_mini34.z.string(),
|
|
10864
|
+
description: import_mini34.z.string(),
|
|
10865
|
+
targets: import_mini34.z._default(RulesyncTargetsSchema, ["*"]),
|
|
10866
|
+
claudecode: import_mini34.z.optional(
|
|
10867
|
+
import_mini34.z.looseObject({
|
|
10868
|
+
"allowed-tools": import_mini34.z.optional(import_mini34.z.array(import_mini34.z.string())),
|
|
10869
|
+
model: import_mini34.z.optional(import_mini34.z.string()),
|
|
10870
|
+
"disable-model-invocation": import_mini34.z.optional(import_mini34.z.boolean())
|
|
10462
10871
|
})
|
|
10463
10872
|
),
|
|
10464
|
-
codexcli:
|
|
10465
|
-
|
|
10466
|
-
"short-description":
|
|
10873
|
+
codexcli: import_mini34.z.optional(
|
|
10874
|
+
import_mini34.z.looseObject({
|
|
10875
|
+
"short-description": import_mini34.z.optional(import_mini34.z.string())
|
|
10467
10876
|
})
|
|
10468
10877
|
),
|
|
10469
|
-
opencode:
|
|
10470
|
-
|
|
10471
|
-
"allowed-tools":
|
|
10878
|
+
opencode: import_mini34.z.optional(
|
|
10879
|
+
import_mini34.z.looseObject({
|
|
10880
|
+
"allowed-tools": import_mini34.z.optional(import_mini34.z.array(import_mini34.z.string()))
|
|
10472
10881
|
})
|
|
10473
10882
|
),
|
|
10474
|
-
kilo:
|
|
10475
|
-
|
|
10476
|
-
"allowed-tools":
|
|
10883
|
+
kilo: import_mini34.z.optional(
|
|
10884
|
+
import_mini34.z.looseObject({
|
|
10885
|
+
"allowed-tools": import_mini34.z.optional(import_mini34.z.array(import_mini34.z.string()))
|
|
10477
10886
|
})
|
|
10478
10887
|
),
|
|
10479
|
-
deepagents:
|
|
10480
|
-
|
|
10481
|
-
"allowed-tools":
|
|
10888
|
+
deepagents: import_mini34.z.optional(
|
|
10889
|
+
import_mini34.z.looseObject({
|
|
10890
|
+
"allowed-tools": import_mini34.z.optional(import_mini34.z.array(import_mini34.z.string()))
|
|
10482
10891
|
})
|
|
10483
10892
|
),
|
|
10484
|
-
copilot:
|
|
10485
|
-
|
|
10486
|
-
license:
|
|
10893
|
+
copilot: import_mini34.z.optional(
|
|
10894
|
+
import_mini34.z.looseObject({
|
|
10895
|
+
license: import_mini34.z.optional(import_mini34.z.string())
|
|
10487
10896
|
})
|
|
10488
10897
|
),
|
|
10489
|
-
cline:
|
|
10490
|
-
roo:
|
|
10898
|
+
cline: import_mini34.z.optional(import_mini34.z.looseObject({})),
|
|
10899
|
+
roo: import_mini34.z.optional(import_mini34.z.looseObject({}))
|
|
10491
10900
|
});
|
|
10492
10901
|
var RulesyncSkillFrontmatterSchema = RulesyncSkillFrontmatterSchemaInternal;
|
|
10493
10902
|
var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
@@ -10527,7 +10936,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
10527
10936
|
}
|
|
10528
10937
|
getFrontmatter() {
|
|
10529
10938
|
if (!this.mainFile?.frontmatter) {
|
|
10530
|
-
throw new Error(`Frontmatter is not defined in ${(0,
|
|
10939
|
+
throw new Error(`Frontmatter is not defined in ${(0, import_node_path75.join)(this.relativeDirPath, this.dirName)}`);
|
|
10531
10940
|
}
|
|
10532
10941
|
const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
|
|
10533
10942
|
return result;
|
|
@@ -10553,8 +10962,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
10553
10962
|
dirName,
|
|
10554
10963
|
global = false
|
|
10555
10964
|
}) {
|
|
10556
|
-
const skillDirPath = (0,
|
|
10557
|
-
const skillFilePath = (0,
|
|
10965
|
+
const skillDirPath = (0, import_node_path75.join)(baseDir, relativeDirPath, dirName);
|
|
10966
|
+
const skillFilePath = (0, import_node_path75.join)(skillDirPath, SKILL_FILE_NAME);
|
|
10558
10967
|
if (!await fileExists(skillFilePath)) {
|
|
10559
10968
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
10560
10969
|
}
|
|
@@ -10584,14 +10993,14 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
10584
10993
|
};
|
|
10585
10994
|
|
|
10586
10995
|
// src/features/skills/rovodev-skill.ts
|
|
10587
|
-
var RovodevSkillFrontmatterSchema =
|
|
10588
|
-
name:
|
|
10589
|
-
description:
|
|
10996
|
+
var RovodevSkillFrontmatterSchema = import_mini35.z.looseObject({
|
|
10997
|
+
name: import_mini35.z.string(),
|
|
10998
|
+
description: import_mini35.z.string()
|
|
10590
10999
|
});
|
|
10591
11000
|
var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
10592
11001
|
constructor({
|
|
10593
11002
|
baseDir = process.cwd(),
|
|
10594
|
-
relativeDirPath = (0,
|
|
11003
|
+
relativeDirPath = (0, import_node_path76.join)(".rovodev", "skills"),
|
|
10595
11004
|
dirName,
|
|
10596
11005
|
frontmatter,
|
|
10597
11006
|
body,
|
|
@@ -10620,8 +11029,8 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
10620
11029
|
}
|
|
10621
11030
|
static getSettablePaths(_options) {
|
|
10622
11031
|
return {
|
|
10623
|
-
relativeDirPath: (0,
|
|
10624
|
-
alternativeSkillRoots: [(0,
|
|
11032
|
+
relativeDirPath: (0, import_node_path76.join)(".rovodev", "skills"),
|
|
11033
|
+
alternativeSkillRoots: [(0, import_node_path76.join)(".agents", "skills")]
|
|
10625
11034
|
};
|
|
10626
11035
|
}
|
|
10627
11036
|
getFrontmatter() {
|
|
@@ -10709,13 +11118,13 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
10709
11118
|
});
|
|
10710
11119
|
const result = RovodevSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10711
11120
|
if (!result.success) {
|
|
10712
|
-
const skillDirPath = (0,
|
|
11121
|
+
const skillDirPath = (0, import_node_path76.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10713
11122
|
throw new Error(
|
|
10714
|
-
`Invalid frontmatter in ${(0,
|
|
11123
|
+
`Invalid frontmatter in ${(0, import_node_path76.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10715
11124
|
);
|
|
10716
11125
|
}
|
|
10717
11126
|
if (result.data.name !== loaded.dirName) {
|
|
10718
|
-
const skillFilePath = (0,
|
|
11127
|
+
const skillFilePath = (0, import_node_path76.join)(
|
|
10719
11128
|
loaded.baseDir,
|
|
10720
11129
|
loaded.relativeDirPath,
|
|
10721
11130
|
loaded.dirName,
|
|
@@ -10757,11 +11166,11 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
10757
11166
|
};
|
|
10758
11167
|
|
|
10759
11168
|
// src/features/skills/skills-processor.ts
|
|
10760
|
-
var
|
|
10761
|
-
var
|
|
11169
|
+
var import_node_path94 = require("path");
|
|
11170
|
+
var import_mini51 = require("zod/mini");
|
|
10762
11171
|
|
|
10763
11172
|
// src/types/dir-feature-processor.ts
|
|
10764
|
-
var
|
|
11173
|
+
var import_node_path77 = require("path");
|
|
10765
11174
|
var DirFeatureProcessor = class {
|
|
10766
11175
|
baseDir;
|
|
10767
11176
|
dryRun;
|
|
@@ -10801,7 +11210,7 @@ var DirFeatureProcessor = class {
|
|
|
10801
11210
|
const mainFile = aiDir.getMainFile();
|
|
10802
11211
|
let mainFileContent;
|
|
10803
11212
|
if (mainFile) {
|
|
10804
|
-
const mainFilePath = (0,
|
|
11213
|
+
const mainFilePath = (0, import_node_path77.join)(dirPath, mainFile.name);
|
|
10805
11214
|
const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter, {
|
|
10806
11215
|
avoidBlockScalars: this.avoidBlockScalars
|
|
10807
11216
|
});
|
|
@@ -10821,7 +11230,7 @@ var DirFeatureProcessor = class {
|
|
|
10821
11230
|
const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
|
|
10822
11231
|
otherFileContents.push(contentWithNewline);
|
|
10823
11232
|
if (!dirHasChanges) {
|
|
10824
|
-
const filePath = (0,
|
|
11233
|
+
const filePath = (0, import_node_path77.join)(dirPath, file.relativeFilePathToDirPath);
|
|
10825
11234
|
const existingContent = await readFileContentOrNull(filePath);
|
|
10826
11235
|
if (!fileContentsEquivalent({
|
|
10827
11236
|
filePath,
|
|
@@ -10839,24 +11248,24 @@ var DirFeatureProcessor = class {
|
|
|
10839
11248
|
if (this.dryRun) {
|
|
10840
11249
|
this.logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
|
|
10841
11250
|
if (mainFile) {
|
|
10842
|
-
this.logger.info(`[DRY RUN] Would write: ${(0,
|
|
10843
|
-
changedPaths.push((0,
|
|
11251
|
+
this.logger.info(`[DRY RUN] Would write: ${(0, import_node_path77.join)(dirPath, mainFile.name)}`);
|
|
11252
|
+
changedPaths.push((0, import_node_path77.join)(relativeDir, mainFile.name));
|
|
10844
11253
|
}
|
|
10845
11254
|
for (const file of otherFiles) {
|
|
10846
11255
|
this.logger.info(
|
|
10847
|
-
`[DRY RUN] Would write: ${(0,
|
|
11256
|
+
`[DRY RUN] Would write: ${(0, import_node_path77.join)(dirPath, file.relativeFilePathToDirPath)}`
|
|
10848
11257
|
);
|
|
10849
|
-
changedPaths.push((0,
|
|
11258
|
+
changedPaths.push((0, import_node_path77.join)(relativeDir, file.relativeFilePathToDirPath));
|
|
10850
11259
|
}
|
|
10851
11260
|
} else {
|
|
10852
11261
|
await ensureDir(dirPath);
|
|
10853
11262
|
if (mainFile && mainFileContent) {
|
|
10854
|
-
const mainFilePath = (0,
|
|
11263
|
+
const mainFilePath = (0, import_node_path77.join)(dirPath, mainFile.name);
|
|
10855
11264
|
await writeFileContent(mainFilePath, mainFileContent);
|
|
10856
|
-
changedPaths.push((0,
|
|
11265
|
+
changedPaths.push((0, import_node_path77.join)(relativeDir, mainFile.name));
|
|
10857
11266
|
}
|
|
10858
11267
|
for (const [i, file] of otherFiles.entries()) {
|
|
10859
|
-
const filePath = (0,
|
|
11268
|
+
const filePath = (0, import_node_path77.join)(dirPath, file.relativeFilePathToDirPath);
|
|
10860
11269
|
const content = otherFileContents[i];
|
|
10861
11270
|
if (content === void 0) {
|
|
10862
11271
|
throw new Error(
|
|
@@ -10864,7 +11273,7 @@ var DirFeatureProcessor = class {
|
|
|
10864
11273
|
);
|
|
10865
11274
|
}
|
|
10866
11275
|
await writeFileContent(filePath, content);
|
|
10867
|
-
changedPaths.push((0,
|
|
11276
|
+
changedPaths.push((0, import_node_path77.join)(relativeDir, file.relativeFilePathToDirPath));
|
|
10868
11277
|
}
|
|
10869
11278
|
}
|
|
10870
11279
|
changedCount++;
|
|
@@ -10896,16 +11305,16 @@ var DirFeatureProcessor = class {
|
|
|
10896
11305
|
};
|
|
10897
11306
|
|
|
10898
11307
|
// src/features/skills/agentsskills-skill.ts
|
|
10899
|
-
var
|
|
10900
|
-
var
|
|
10901
|
-
var AgentsSkillsSkillFrontmatterSchema =
|
|
10902
|
-
name:
|
|
10903
|
-
description:
|
|
11308
|
+
var import_node_path78 = require("path");
|
|
11309
|
+
var import_mini36 = require("zod/mini");
|
|
11310
|
+
var AgentsSkillsSkillFrontmatterSchema = import_mini36.z.looseObject({
|
|
11311
|
+
name: import_mini36.z.string(),
|
|
11312
|
+
description: import_mini36.z.string()
|
|
10904
11313
|
});
|
|
10905
11314
|
var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
10906
11315
|
constructor({
|
|
10907
11316
|
baseDir = process.cwd(),
|
|
10908
|
-
relativeDirPath = (0,
|
|
11317
|
+
relativeDirPath = (0, import_node_path78.join)(".agents", "skills"),
|
|
10909
11318
|
dirName,
|
|
10910
11319
|
frontmatter,
|
|
10911
11320
|
body,
|
|
@@ -10937,7 +11346,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
10937
11346
|
throw new Error("AgentsSkillsSkill does not support global mode.");
|
|
10938
11347
|
}
|
|
10939
11348
|
return {
|
|
10940
|
-
relativeDirPath: (0,
|
|
11349
|
+
relativeDirPath: (0, import_node_path78.join)(".agents", "skills")
|
|
10941
11350
|
};
|
|
10942
11351
|
}
|
|
10943
11352
|
getFrontmatter() {
|
|
@@ -11017,9 +11426,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
11017
11426
|
});
|
|
11018
11427
|
const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
11019
11428
|
if (!result.success) {
|
|
11020
|
-
const skillDirPath = (0,
|
|
11429
|
+
const skillDirPath = (0, import_node_path78.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
11021
11430
|
throw new Error(
|
|
11022
|
-
`Invalid frontmatter in ${(0,
|
|
11431
|
+
`Invalid frontmatter in ${(0, import_node_path78.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
11023
11432
|
);
|
|
11024
11433
|
}
|
|
11025
11434
|
return new _AgentsSkillsSkill({
|
|
@@ -11054,16 +11463,16 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
11054
11463
|
};
|
|
11055
11464
|
|
|
11056
11465
|
// src/features/skills/antigravity-skill.ts
|
|
11057
|
-
var
|
|
11058
|
-
var
|
|
11059
|
-
var AntigravitySkillFrontmatterSchema =
|
|
11060
|
-
name:
|
|
11061
|
-
description:
|
|
11466
|
+
var import_node_path79 = require("path");
|
|
11467
|
+
var import_mini37 = require("zod/mini");
|
|
11468
|
+
var AntigravitySkillFrontmatterSchema = import_mini37.z.looseObject({
|
|
11469
|
+
name: import_mini37.z.string(),
|
|
11470
|
+
description: import_mini37.z.string()
|
|
11062
11471
|
});
|
|
11063
11472
|
var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
11064
11473
|
constructor({
|
|
11065
11474
|
baseDir = process.cwd(),
|
|
11066
|
-
relativeDirPath = (0,
|
|
11475
|
+
relativeDirPath = (0, import_node_path79.join)(".agent", "skills"),
|
|
11067
11476
|
dirName,
|
|
11068
11477
|
frontmatter,
|
|
11069
11478
|
body,
|
|
@@ -11095,11 +11504,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
11095
11504
|
} = {}) {
|
|
11096
11505
|
if (global) {
|
|
11097
11506
|
return {
|
|
11098
|
-
relativeDirPath: (0,
|
|
11507
|
+
relativeDirPath: (0, import_node_path79.join)(".gemini", "antigravity", "skills")
|
|
11099
11508
|
};
|
|
11100
11509
|
}
|
|
11101
11510
|
return {
|
|
11102
|
-
relativeDirPath: (0,
|
|
11511
|
+
relativeDirPath: (0, import_node_path79.join)(".agent", "skills")
|
|
11103
11512
|
};
|
|
11104
11513
|
}
|
|
11105
11514
|
getFrontmatter() {
|
|
@@ -11179,9 +11588,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
11179
11588
|
});
|
|
11180
11589
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
11181
11590
|
if (!result.success) {
|
|
11182
|
-
const skillDirPath = (0,
|
|
11591
|
+
const skillDirPath = (0, import_node_path79.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
11183
11592
|
throw new Error(
|
|
11184
|
-
`Invalid frontmatter in ${(0,
|
|
11593
|
+
`Invalid frontmatter in ${(0, import_node_path79.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
11185
11594
|
);
|
|
11186
11595
|
}
|
|
11187
11596
|
return new _AntigravitySkill({
|
|
@@ -11215,19 +11624,19 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
11215
11624
|
};
|
|
11216
11625
|
|
|
11217
11626
|
// src/features/skills/claudecode-skill.ts
|
|
11218
|
-
var
|
|
11219
|
-
var
|
|
11220
|
-
var ClaudecodeSkillFrontmatterSchema =
|
|
11221
|
-
name:
|
|
11222
|
-
description:
|
|
11223
|
-
"allowed-tools":
|
|
11224
|
-
model:
|
|
11225
|
-
"disable-model-invocation":
|
|
11627
|
+
var import_node_path80 = require("path");
|
|
11628
|
+
var import_mini38 = require("zod/mini");
|
|
11629
|
+
var ClaudecodeSkillFrontmatterSchema = import_mini38.z.looseObject({
|
|
11630
|
+
name: import_mini38.z.string(),
|
|
11631
|
+
description: import_mini38.z.string(),
|
|
11632
|
+
"allowed-tools": import_mini38.z.optional(import_mini38.z.array(import_mini38.z.string())),
|
|
11633
|
+
model: import_mini38.z.optional(import_mini38.z.string()),
|
|
11634
|
+
"disable-model-invocation": import_mini38.z.optional(import_mini38.z.boolean())
|
|
11226
11635
|
});
|
|
11227
11636
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
11228
11637
|
constructor({
|
|
11229
11638
|
baseDir = process.cwd(),
|
|
11230
|
-
relativeDirPath = (0,
|
|
11639
|
+
relativeDirPath = (0, import_node_path80.join)(".claude", "skills"),
|
|
11231
11640
|
dirName,
|
|
11232
11641
|
frontmatter,
|
|
11233
11642
|
body,
|
|
@@ -11258,7 +11667,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
11258
11667
|
global: _global = false
|
|
11259
11668
|
} = {}) {
|
|
11260
11669
|
return {
|
|
11261
|
-
relativeDirPath: (0,
|
|
11670
|
+
relativeDirPath: (0, import_node_path80.join)(".claude", "skills")
|
|
11262
11671
|
};
|
|
11263
11672
|
}
|
|
11264
11673
|
getFrontmatter() {
|
|
@@ -11355,9 +11764,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
11355
11764
|
});
|
|
11356
11765
|
const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
11357
11766
|
if (!result.success) {
|
|
11358
|
-
const skillDirPath = (0,
|
|
11767
|
+
const skillDirPath = (0, import_node_path80.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
11359
11768
|
throw new Error(
|
|
11360
|
-
`Invalid frontmatter in ${(0,
|
|
11769
|
+
`Invalid frontmatter in ${(0, import_node_path80.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
11361
11770
|
);
|
|
11362
11771
|
}
|
|
11363
11772
|
return new _ClaudecodeSkill({
|
|
@@ -11391,16 +11800,16 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
11391
11800
|
};
|
|
11392
11801
|
|
|
11393
11802
|
// src/features/skills/cline-skill.ts
|
|
11394
|
-
var
|
|
11395
|
-
var
|
|
11396
|
-
var ClineSkillFrontmatterSchema =
|
|
11397
|
-
name:
|
|
11398
|
-
description:
|
|
11803
|
+
var import_node_path81 = require("path");
|
|
11804
|
+
var import_mini39 = require("zod/mini");
|
|
11805
|
+
var ClineSkillFrontmatterSchema = import_mini39.z.looseObject({
|
|
11806
|
+
name: import_mini39.z.string(),
|
|
11807
|
+
description: import_mini39.z.string()
|
|
11399
11808
|
});
|
|
11400
11809
|
var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
11401
11810
|
constructor({
|
|
11402
11811
|
baseDir = process.cwd(),
|
|
11403
|
-
relativeDirPath = (0,
|
|
11812
|
+
relativeDirPath = (0, import_node_path81.join)(".cline", "skills"),
|
|
11404
11813
|
dirName,
|
|
11405
11814
|
frontmatter,
|
|
11406
11815
|
body,
|
|
@@ -11429,7 +11838,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
11429
11838
|
}
|
|
11430
11839
|
static getSettablePaths(_options = {}) {
|
|
11431
11840
|
return {
|
|
11432
|
-
relativeDirPath: (0,
|
|
11841
|
+
relativeDirPath: (0, import_node_path81.join)(".cline", "skills")
|
|
11433
11842
|
};
|
|
11434
11843
|
}
|
|
11435
11844
|
getFrontmatter() {
|
|
@@ -11517,13 +11926,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
11517
11926
|
});
|
|
11518
11927
|
const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
11519
11928
|
if (!result.success) {
|
|
11520
|
-
const skillDirPath = (0,
|
|
11929
|
+
const skillDirPath = (0, import_node_path81.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
11521
11930
|
throw new Error(
|
|
11522
|
-
`Invalid frontmatter in ${(0,
|
|
11931
|
+
`Invalid frontmatter in ${(0, import_node_path81.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
11523
11932
|
);
|
|
11524
11933
|
}
|
|
11525
11934
|
if (result.data.name !== loaded.dirName) {
|
|
11526
|
-
const skillFilePath = (0,
|
|
11935
|
+
const skillFilePath = (0, import_node_path81.join)(
|
|
11527
11936
|
loaded.baseDir,
|
|
11528
11937
|
loaded.relativeDirPath,
|
|
11529
11938
|
loaded.dirName,
|
|
@@ -11564,21 +11973,21 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
11564
11973
|
};
|
|
11565
11974
|
|
|
11566
11975
|
// src/features/skills/codexcli-skill.ts
|
|
11567
|
-
var
|
|
11568
|
-
var
|
|
11569
|
-
var CodexCliSkillFrontmatterSchema =
|
|
11570
|
-
name:
|
|
11571
|
-
description:
|
|
11572
|
-
metadata:
|
|
11573
|
-
|
|
11574
|
-
"short-description":
|
|
11976
|
+
var import_node_path82 = require("path");
|
|
11977
|
+
var import_mini40 = require("zod/mini");
|
|
11978
|
+
var CodexCliSkillFrontmatterSchema = import_mini40.z.looseObject({
|
|
11979
|
+
name: import_mini40.z.string(),
|
|
11980
|
+
description: import_mini40.z.string(),
|
|
11981
|
+
metadata: import_mini40.z.optional(
|
|
11982
|
+
import_mini40.z.looseObject({
|
|
11983
|
+
"short-description": import_mini40.z.optional(import_mini40.z.string())
|
|
11575
11984
|
})
|
|
11576
11985
|
)
|
|
11577
11986
|
});
|
|
11578
11987
|
var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
11579
11988
|
constructor({
|
|
11580
11989
|
baseDir = process.cwd(),
|
|
11581
|
-
relativeDirPath = (0,
|
|
11990
|
+
relativeDirPath = (0, import_node_path82.join)(".codex", "skills"),
|
|
11582
11991
|
dirName,
|
|
11583
11992
|
frontmatter,
|
|
11584
11993
|
body,
|
|
@@ -11609,7 +12018,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
11609
12018
|
global: _global = false
|
|
11610
12019
|
} = {}) {
|
|
11611
12020
|
return {
|
|
11612
|
-
relativeDirPath: (0,
|
|
12021
|
+
relativeDirPath: (0, import_node_path82.join)(".codex", "skills")
|
|
11613
12022
|
};
|
|
11614
12023
|
}
|
|
11615
12024
|
getFrontmatter() {
|
|
@@ -11699,9 +12108,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
11699
12108
|
});
|
|
11700
12109
|
const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
11701
12110
|
if (!result.success) {
|
|
11702
|
-
const skillDirPath = (0,
|
|
12111
|
+
const skillDirPath = (0, import_node_path82.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
11703
12112
|
throw new Error(
|
|
11704
|
-
`Invalid frontmatter in ${(0,
|
|
12113
|
+
`Invalid frontmatter in ${(0, import_node_path82.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
11705
12114
|
);
|
|
11706
12115
|
}
|
|
11707
12116
|
return new _CodexCliSkill({
|
|
@@ -11735,17 +12144,17 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
11735
12144
|
};
|
|
11736
12145
|
|
|
11737
12146
|
// src/features/skills/copilot-skill.ts
|
|
11738
|
-
var
|
|
11739
|
-
var
|
|
11740
|
-
var CopilotSkillFrontmatterSchema =
|
|
11741
|
-
name:
|
|
11742
|
-
description:
|
|
11743
|
-
license:
|
|
12147
|
+
var import_node_path83 = require("path");
|
|
12148
|
+
var import_mini41 = require("zod/mini");
|
|
12149
|
+
var CopilotSkillFrontmatterSchema = import_mini41.z.looseObject({
|
|
12150
|
+
name: import_mini41.z.string(),
|
|
12151
|
+
description: import_mini41.z.string(),
|
|
12152
|
+
license: import_mini41.z.optional(import_mini41.z.string())
|
|
11744
12153
|
});
|
|
11745
12154
|
var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
11746
12155
|
constructor({
|
|
11747
12156
|
baseDir = process.cwd(),
|
|
11748
|
-
relativeDirPath = (0,
|
|
12157
|
+
relativeDirPath = (0, import_node_path83.join)(".github", "skills"),
|
|
11749
12158
|
dirName,
|
|
11750
12159
|
frontmatter,
|
|
11751
12160
|
body,
|
|
@@ -11777,7 +12186,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
11777
12186
|
throw new Error("CopilotSkill does not support global mode.");
|
|
11778
12187
|
}
|
|
11779
12188
|
return {
|
|
11780
|
-
relativeDirPath: (0,
|
|
12189
|
+
relativeDirPath: (0, import_node_path83.join)(".github", "skills")
|
|
11781
12190
|
};
|
|
11782
12191
|
}
|
|
11783
12192
|
getFrontmatter() {
|
|
@@ -11863,9 +12272,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
11863
12272
|
});
|
|
11864
12273
|
const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
11865
12274
|
if (!result.success) {
|
|
11866
|
-
const skillDirPath = (0,
|
|
12275
|
+
const skillDirPath = (0, import_node_path83.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
11867
12276
|
throw new Error(
|
|
11868
|
-
`Invalid frontmatter in ${(0,
|
|
12277
|
+
`Invalid frontmatter in ${(0, import_node_path83.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
11869
12278
|
);
|
|
11870
12279
|
}
|
|
11871
12280
|
return new _CopilotSkill({
|
|
@@ -11900,16 +12309,16 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
11900
12309
|
};
|
|
11901
12310
|
|
|
11902
12311
|
// src/features/skills/cursor-skill.ts
|
|
11903
|
-
var
|
|
11904
|
-
var
|
|
11905
|
-
var CursorSkillFrontmatterSchema =
|
|
11906
|
-
name:
|
|
11907
|
-
description:
|
|
12312
|
+
var import_node_path84 = require("path");
|
|
12313
|
+
var import_mini42 = require("zod/mini");
|
|
12314
|
+
var CursorSkillFrontmatterSchema = import_mini42.z.looseObject({
|
|
12315
|
+
name: import_mini42.z.string(),
|
|
12316
|
+
description: import_mini42.z.string()
|
|
11908
12317
|
});
|
|
11909
12318
|
var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
11910
12319
|
constructor({
|
|
11911
12320
|
baseDir = process.cwd(),
|
|
11912
|
-
relativeDirPath = (0,
|
|
12321
|
+
relativeDirPath = (0, import_node_path84.join)(".cursor", "skills"),
|
|
11913
12322
|
dirName,
|
|
11914
12323
|
frontmatter,
|
|
11915
12324
|
body,
|
|
@@ -11938,7 +12347,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
11938
12347
|
}
|
|
11939
12348
|
static getSettablePaths(_options) {
|
|
11940
12349
|
return {
|
|
11941
|
-
relativeDirPath: (0,
|
|
12350
|
+
relativeDirPath: (0, import_node_path84.join)(".cursor", "skills")
|
|
11942
12351
|
};
|
|
11943
12352
|
}
|
|
11944
12353
|
getFrontmatter() {
|
|
@@ -12018,9 +12427,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
12018
12427
|
});
|
|
12019
12428
|
const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12020
12429
|
if (!result.success) {
|
|
12021
|
-
const skillDirPath = (0,
|
|
12430
|
+
const skillDirPath = (0, import_node_path84.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
12022
12431
|
throw new Error(
|
|
12023
|
-
`Invalid frontmatter in ${(0,
|
|
12432
|
+
`Invalid frontmatter in ${(0, import_node_path84.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12024
12433
|
);
|
|
12025
12434
|
}
|
|
12026
12435
|
return new _CursorSkill({
|
|
@@ -12055,17 +12464,17 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
12055
12464
|
};
|
|
12056
12465
|
|
|
12057
12466
|
// src/features/skills/deepagents-skill.ts
|
|
12058
|
-
var
|
|
12059
|
-
var
|
|
12060
|
-
var DeepagentsSkillFrontmatterSchema =
|
|
12061
|
-
name:
|
|
12062
|
-
description:
|
|
12063
|
-
"allowed-tools":
|
|
12467
|
+
var import_node_path85 = require("path");
|
|
12468
|
+
var import_mini43 = require("zod/mini");
|
|
12469
|
+
var DeepagentsSkillFrontmatterSchema = import_mini43.z.looseObject({
|
|
12470
|
+
name: import_mini43.z.string(),
|
|
12471
|
+
description: import_mini43.z.string(),
|
|
12472
|
+
"allowed-tools": import_mini43.z.optional(import_mini43.z.array(import_mini43.z.string()))
|
|
12064
12473
|
});
|
|
12065
12474
|
var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
12066
12475
|
constructor({
|
|
12067
12476
|
baseDir = process.cwd(),
|
|
12068
|
-
relativeDirPath = (0,
|
|
12477
|
+
relativeDirPath = (0, import_node_path85.join)(".deepagents", "skills"),
|
|
12069
12478
|
dirName,
|
|
12070
12479
|
frontmatter,
|
|
12071
12480
|
body,
|
|
@@ -12094,7 +12503,7 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
12094
12503
|
}
|
|
12095
12504
|
static getSettablePaths(_options) {
|
|
12096
12505
|
return {
|
|
12097
|
-
relativeDirPath: (0,
|
|
12506
|
+
relativeDirPath: (0, import_node_path85.join)(".deepagents", "skills")
|
|
12098
12507
|
};
|
|
12099
12508
|
}
|
|
12100
12509
|
getFrontmatter() {
|
|
@@ -12180,9 +12589,9 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
12180
12589
|
});
|
|
12181
12590
|
const result = DeepagentsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12182
12591
|
if (!result.success) {
|
|
12183
|
-
const skillDirPath = (0,
|
|
12592
|
+
const skillDirPath = (0, import_node_path85.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
12184
12593
|
throw new Error(
|
|
12185
|
-
`Invalid frontmatter in ${(0,
|
|
12594
|
+
`Invalid frontmatter in ${(0, import_node_path85.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12186
12595
|
);
|
|
12187
12596
|
}
|
|
12188
12597
|
return new _DeepagentsSkill({
|
|
@@ -12217,11 +12626,11 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
12217
12626
|
};
|
|
12218
12627
|
|
|
12219
12628
|
// src/features/skills/geminicli-skill.ts
|
|
12220
|
-
var
|
|
12221
|
-
var
|
|
12222
|
-
var GeminiCliSkillFrontmatterSchema =
|
|
12223
|
-
name:
|
|
12224
|
-
description:
|
|
12629
|
+
var import_node_path86 = require("path");
|
|
12630
|
+
var import_mini44 = require("zod/mini");
|
|
12631
|
+
var GeminiCliSkillFrontmatterSchema = import_mini44.z.looseObject({
|
|
12632
|
+
name: import_mini44.z.string(),
|
|
12633
|
+
description: import_mini44.z.string()
|
|
12225
12634
|
});
|
|
12226
12635
|
var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
12227
12636
|
constructor({
|
|
@@ -12257,7 +12666,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
12257
12666
|
global: _global = false
|
|
12258
12667
|
} = {}) {
|
|
12259
12668
|
return {
|
|
12260
|
-
relativeDirPath: (0,
|
|
12669
|
+
relativeDirPath: (0, import_node_path86.join)(".gemini", "skills")
|
|
12261
12670
|
};
|
|
12262
12671
|
}
|
|
12263
12672
|
getFrontmatter() {
|
|
@@ -12337,9 +12746,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
12337
12746
|
});
|
|
12338
12747
|
const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12339
12748
|
if (!result.success) {
|
|
12340
|
-
const skillDirPath = (0,
|
|
12749
|
+
const skillDirPath = (0, import_node_path86.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
12341
12750
|
throw new Error(
|
|
12342
|
-
`Invalid frontmatter in ${(0,
|
|
12751
|
+
`Invalid frontmatter in ${(0, import_node_path86.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12343
12752
|
);
|
|
12344
12753
|
}
|
|
12345
12754
|
return new _GeminiCliSkill({
|
|
@@ -12374,16 +12783,16 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
12374
12783
|
};
|
|
12375
12784
|
|
|
12376
12785
|
// src/features/skills/junie-skill.ts
|
|
12377
|
-
var
|
|
12378
|
-
var
|
|
12379
|
-
var JunieSkillFrontmatterSchema =
|
|
12380
|
-
name:
|
|
12381
|
-
description:
|
|
12786
|
+
var import_node_path87 = require("path");
|
|
12787
|
+
var import_mini45 = require("zod/mini");
|
|
12788
|
+
var JunieSkillFrontmatterSchema = import_mini45.z.looseObject({
|
|
12789
|
+
name: import_mini45.z.string(),
|
|
12790
|
+
description: import_mini45.z.string()
|
|
12382
12791
|
});
|
|
12383
12792
|
var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
12384
12793
|
constructor({
|
|
12385
12794
|
baseDir = process.cwd(),
|
|
12386
|
-
relativeDirPath = (0,
|
|
12795
|
+
relativeDirPath = (0, import_node_path87.join)(".junie", "skills"),
|
|
12387
12796
|
dirName,
|
|
12388
12797
|
frontmatter,
|
|
12389
12798
|
body,
|
|
@@ -12415,7 +12824,7 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
12415
12824
|
throw new Error("JunieSkill does not support global mode.");
|
|
12416
12825
|
}
|
|
12417
12826
|
return {
|
|
12418
|
-
relativeDirPath: (0,
|
|
12827
|
+
relativeDirPath: (0, import_node_path87.join)(".junie", "skills")
|
|
12419
12828
|
};
|
|
12420
12829
|
}
|
|
12421
12830
|
getFrontmatter() {
|
|
@@ -12502,13 +12911,13 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
12502
12911
|
});
|
|
12503
12912
|
const result = JunieSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12504
12913
|
if (!result.success) {
|
|
12505
|
-
const skillDirPath = (0,
|
|
12914
|
+
const skillDirPath = (0, import_node_path87.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
12506
12915
|
throw new Error(
|
|
12507
|
-
`Invalid frontmatter in ${(0,
|
|
12916
|
+
`Invalid frontmatter in ${(0, import_node_path87.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12508
12917
|
);
|
|
12509
12918
|
}
|
|
12510
12919
|
if (result.data.name !== loaded.dirName) {
|
|
12511
|
-
const skillFilePath = (0,
|
|
12920
|
+
const skillFilePath = (0, import_node_path87.join)(
|
|
12512
12921
|
loaded.baseDir,
|
|
12513
12922
|
loaded.relativeDirPath,
|
|
12514
12923
|
loaded.dirName,
|
|
@@ -12550,17 +12959,17 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
12550
12959
|
};
|
|
12551
12960
|
|
|
12552
12961
|
// src/features/skills/kilo-skill.ts
|
|
12553
|
-
var
|
|
12554
|
-
var
|
|
12555
|
-
var KiloSkillFrontmatterSchema =
|
|
12556
|
-
name:
|
|
12557
|
-
description:
|
|
12558
|
-
"allowed-tools":
|
|
12962
|
+
var import_node_path88 = require("path");
|
|
12963
|
+
var import_mini46 = require("zod/mini");
|
|
12964
|
+
var KiloSkillFrontmatterSchema = import_mini46.z.looseObject({
|
|
12965
|
+
name: import_mini46.z.string(),
|
|
12966
|
+
description: import_mini46.z.string(),
|
|
12967
|
+
"allowed-tools": import_mini46.z.optional(import_mini46.z.array(import_mini46.z.string()))
|
|
12559
12968
|
});
|
|
12560
12969
|
var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
12561
12970
|
constructor({
|
|
12562
12971
|
baseDir = process.cwd(),
|
|
12563
|
-
relativeDirPath = (0,
|
|
12972
|
+
relativeDirPath = (0, import_node_path88.join)(".kilo", "skills"),
|
|
12564
12973
|
dirName,
|
|
12565
12974
|
frontmatter,
|
|
12566
12975
|
body,
|
|
@@ -12589,7 +12998,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
12589
12998
|
}
|
|
12590
12999
|
static getSettablePaths({ global = false } = {}) {
|
|
12591
13000
|
return {
|
|
12592
|
-
relativeDirPath: global ? (0,
|
|
13001
|
+
relativeDirPath: global ? (0, import_node_path88.join)(".config", "kilo", "skills") : (0, import_node_path88.join)(".kilo", "skills")
|
|
12593
13002
|
};
|
|
12594
13003
|
}
|
|
12595
13004
|
getFrontmatter() {
|
|
@@ -12675,9 +13084,9 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
12675
13084
|
});
|
|
12676
13085
|
const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12677
13086
|
if (!result.success) {
|
|
12678
|
-
const skillDirPath = (0,
|
|
13087
|
+
const skillDirPath = (0, import_node_path88.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
12679
13088
|
throw new Error(
|
|
12680
|
-
`Invalid frontmatter in ${(0,
|
|
13089
|
+
`Invalid frontmatter in ${(0, import_node_path88.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12681
13090
|
);
|
|
12682
13091
|
}
|
|
12683
13092
|
return new _KiloSkill({
|
|
@@ -12711,16 +13120,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
12711
13120
|
};
|
|
12712
13121
|
|
|
12713
13122
|
// src/features/skills/kiro-skill.ts
|
|
12714
|
-
var
|
|
12715
|
-
var
|
|
12716
|
-
var KiroSkillFrontmatterSchema =
|
|
12717
|
-
name:
|
|
12718
|
-
description:
|
|
13123
|
+
var import_node_path89 = require("path");
|
|
13124
|
+
var import_mini47 = require("zod/mini");
|
|
13125
|
+
var KiroSkillFrontmatterSchema = import_mini47.z.looseObject({
|
|
13126
|
+
name: import_mini47.z.string(),
|
|
13127
|
+
description: import_mini47.z.string()
|
|
12719
13128
|
});
|
|
12720
13129
|
var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
12721
13130
|
constructor({
|
|
12722
13131
|
baseDir = process.cwd(),
|
|
12723
|
-
relativeDirPath = (0,
|
|
13132
|
+
relativeDirPath = (0, import_node_path89.join)(".kiro", "skills"),
|
|
12724
13133
|
dirName,
|
|
12725
13134
|
frontmatter,
|
|
12726
13135
|
body,
|
|
@@ -12752,7 +13161,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
12752
13161
|
throw new Error("KiroSkill does not support global mode.");
|
|
12753
13162
|
}
|
|
12754
13163
|
return {
|
|
12755
|
-
relativeDirPath: (0,
|
|
13164
|
+
relativeDirPath: (0, import_node_path89.join)(".kiro", "skills")
|
|
12756
13165
|
};
|
|
12757
13166
|
}
|
|
12758
13167
|
getFrontmatter() {
|
|
@@ -12840,13 +13249,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
12840
13249
|
});
|
|
12841
13250
|
const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12842
13251
|
if (!result.success) {
|
|
12843
|
-
const skillDirPath = (0,
|
|
13252
|
+
const skillDirPath = (0, import_node_path89.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
12844
13253
|
throw new Error(
|
|
12845
|
-
`Invalid frontmatter in ${(0,
|
|
13254
|
+
`Invalid frontmatter in ${(0, import_node_path89.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12846
13255
|
);
|
|
12847
13256
|
}
|
|
12848
13257
|
if (result.data.name !== loaded.dirName) {
|
|
12849
|
-
const skillFilePath = (0,
|
|
13258
|
+
const skillFilePath = (0, import_node_path89.join)(
|
|
12850
13259
|
loaded.baseDir,
|
|
12851
13260
|
loaded.relativeDirPath,
|
|
12852
13261
|
loaded.dirName,
|
|
@@ -12888,17 +13297,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
12888
13297
|
};
|
|
12889
13298
|
|
|
12890
13299
|
// src/features/skills/opencode-skill.ts
|
|
12891
|
-
var
|
|
12892
|
-
var
|
|
12893
|
-
var OpenCodeSkillFrontmatterSchema =
|
|
12894
|
-
name:
|
|
12895
|
-
description:
|
|
12896
|
-
"allowed-tools":
|
|
13300
|
+
var import_node_path90 = require("path");
|
|
13301
|
+
var import_mini48 = require("zod/mini");
|
|
13302
|
+
var OpenCodeSkillFrontmatterSchema = import_mini48.z.looseObject({
|
|
13303
|
+
name: import_mini48.z.string(),
|
|
13304
|
+
description: import_mini48.z.string(),
|
|
13305
|
+
"allowed-tools": import_mini48.z.optional(import_mini48.z.array(import_mini48.z.string()))
|
|
12897
13306
|
});
|
|
12898
13307
|
var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
12899
13308
|
constructor({
|
|
12900
13309
|
baseDir = process.cwd(),
|
|
12901
|
-
relativeDirPath = (0,
|
|
13310
|
+
relativeDirPath = (0, import_node_path90.join)(".opencode", "skill"),
|
|
12902
13311
|
dirName,
|
|
12903
13312
|
frontmatter,
|
|
12904
13313
|
body,
|
|
@@ -12927,7 +13336,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
12927
13336
|
}
|
|
12928
13337
|
static getSettablePaths({ global = false } = {}) {
|
|
12929
13338
|
return {
|
|
12930
|
-
relativeDirPath: global ? (0,
|
|
13339
|
+
relativeDirPath: global ? (0, import_node_path90.join)(".config", "opencode", "skill") : (0, import_node_path90.join)(".opencode", "skill")
|
|
12931
13340
|
};
|
|
12932
13341
|
}
|
|
12933
13342
|
getFrontmatter() {
|
|
@@ -13013,9 +13422,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
13013
13422
|
});
|
|
13014
13423
|
const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
13015
13424
|
if (!result.success) {
|
|
13016
|
-
const skillDirPath = (0,
|
|
13425
|
+
const skillDirPath = (0, import_node_path90.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
13017
13426
|
throw new Error(
|
|
13018
|
-
`Invalid frontmatter in ${(0,
|
|
13427
|
+
`Invalid frontmatter in ${(0, import_node_path90.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
13019
13428
|
);
|
|
13020
13429
|
}
|
|
13021
13430
|
return new _OpenCodeSkill({
|
|
@@ -13049,16 +13458,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
13049
13458
|
};
|
|
13050
13459
|
|
|
13051
13460
|
// src/features/skills/replit-skill.ts
|
|
13052
|
-
var
|
|
13053
|
-
var
|
|
13054
|
-
var ReplitSkillFrontmatterSchema =
|
|
13055
|
-
name:
|
|
13056
|
-
description:
|
|
13461
|
+
var import_node_path91 = require("path");
|
|
13462
|
+
var import_mini49 = require("zod/mini");
|
|
13463
|
+
var ReplitSkillFrontmatterSchema = import_mini49.z.looseObject({
|
|
13464
|
+
name: import_mini49.z.string(),
|
|
13465
|
+
description: import_mini49.z.string()
|
|
13057
13466
|
});
|
|
13058
13467
|
var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
13059
13468
|
constructor({
|
|
13060
13469
|
baseDir = process.cwd(),
|
|
13061
|
-
relativeDirPath = (0,
|
|
13470
|
+
relativeDirPath = (0, import_node_path91.join)(".agents", "skills"),
|
|
13062
13471
|
dirName,
|
|
13063
13472
|
frontmatter,
|
|
13064
13473
|
body,
|
|
@@ -13090,7 +13499,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
13090
13499
|
throw new Error("ReplitSkill does not support global mode.");
|
|
13091
13500
|
}
|
|
13092
13501
|
return {
|
|
13093
|
-
relativeDirPath: (0,
|
|
13502
|
+
relativeDirPath: (0, import_node_path91.join)(".agents", "skills")
|
|
13094
13503
|
};
|
|
13095
13504
|
}
|
|
13096
13505
|
getFrontmatter() {
|
|
@@ -13170,9 +13579,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
13170
13579
|
});
|
|
13171
13580
|
const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
13172
13581
|
if (!result.success) {
|
|
13173
|
-
const skillDirPath = (0,
|
|
13582
|
+
const skillDirPath = (0, import_node_path91.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
13174
13583
|
throw new Error(
|
|
13175
|
-
`Invalid frontmatter in ${(0,
|
|
13584
|
+
`Invalid frontmatter in ${(0, import_node_path91.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
13176
13585
|
);
|
|
13177
13586
|
}
|
|
13178
13587
|
return new _ReplitSkill({
|
|
@@ -13207,16 +13616,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
13207
13616
|
};
|
|
13208
13617
|
|
|
13209
13618
|
// src/features/skills/roo-skill.ts
|
|
13210
|
-
var
|
|
13211
|
-
var
|
|
13212
|
-
var RooSkillFrontmatterSchema =
|
|
13213
|
-
name:
|
|
13214
|
-
description:
|
|
13619
|
+
var import_node_path92 = require("path");
|
|
13620
|
+
var import_mini50 = require("zod/mini");
|
|
13621
|
+
var RooSkillFrontmatterSchema = import_mini50.z.looseObject({
|
|
13622
|
+
name: import_mini50.z.string(),
|
|
13623
|
+
description: import_mini50.z.string()
|
|
13215
13624
|
});
|
|
13216
13625
|
var RooSkill = class _RooSkill extends ToolSkill {
|
|
13217
13626
|
constructor({
|
|
13218
13627
|
baseDir = process.cwd(),
|
|
13219
|
-
relativeDirPath = (0,
|
|
13628
|
+
relativeDirPath = (0, import_node_path92.join)(".roo", "skills"),
|
|
13220
13629
|
dirName,
|
|
13221
13630
|
frontmatter,
|
|
13222
13631
|
body,
|
|
@@ -13247,7 +13656,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
13247
13656
|
global: _global = false
|
|
13248
13657
|
} = {}) {
|
|
13249
13658
|
return {
|
|
13250
|
-
relativeDirPath: (0,
|
|
13659
|
+
relativeDirPath: (0, import_node_path92.join)(".roo", "skills")
|
|
13251
13660
|
};
|
|
13252
13661
|
}
|
|
13253
13662
|
getFrontmatter() {
|
|
@@ -13335,13 +13744,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
13335
13744
|
});
|
|
13336
13745
|
const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
13337
13746
|
if (!result.success) {
|
|
13338
|
-
const skillDirPath = (0,
|
|
13747
|
+
const skillDirPath = (0, import_node_path92.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
13339
13748
|
throw new Error(
|
|
13340
|
-
`Invalid frontmatter in ${(0,
|
|
13749
|
+
`Invalid frontmatter in ${(0, import_node_path92.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
13341
13750
|
);
|
|
13342
13751
|
}
|
|
13343
13752
|
if (result.data.name !== loaded.dirName) {
|
|
13344
|
-
const skillFilePath = (0,
|
|
13753
|
+
const skillFilePath = (0, import_node_path92.join)(
|
|
13345
13754
|
loaded.baseDir,
|
|
13346
13755
|
loaded.relativeDirPath,
|
|
13347
13756
|
loaded.dirName,
|
|
@@ -13382,17 +13791,17 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
13382
13791
|
};
|
|
13383
13792
|
|
|
13384
13793
|
// src/features/skills/skills-utils.ts
|
|
13385
|
-
var
|
|
13794
|
+
var import_node_path93 = require("path");
|
|
13386
13795
|
async function getLocalSkillDirNames(baseDir) {
|
|
13387
|
-
const skillsDir = (0,
|
|
13796
|
+
const skillsDir = (0, import_node_path93.join)(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
|
|
13388
13797
|
const names = /* @__PURE__ */ new Set();
|
|
13389
13798
|
if (!await directoryExists(skillsDir)) {
|
|
13390
13799
|
return names;
|
|
13391
13800
|
}
|
|
13392
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
13801
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path93.join)(skillsDir, "*"), { type: "dir" });
|
|
13393
13802
|
for (const dirPath of dirPaths) {
|
|
13394
|
-
const name = (0,
|
|
13395
|
-
if (name === (0,
|
|
13803
|
+
const name = (0, import_node_path93.basename)(dirPath);
|
|
13804
|
+
if (name === (0, import_node_path93.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
|
|
13396
13805
|
names.add(name);
|
|
13397
13806
|
}
|
|
13398
13807
|
return names;
|
|
@@ -13420,7 +13829,7 @@ var skillsProcessorToolTargetTuple = [
|
|
|
13420
13829
|
"roo",
|
|
13421
13830
|
"rovodev"
|
|
13422
13831
|
];
|
|
13423
|
-
var SkillsProcessorToolTargetSchema =
|
|
13832
|
+
var SkillsProcessorToolTargetSchema = import_mini51.z.enum(skillsProcessorToolTargetTuple);
|
|
13424
13833
|
var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
13425
13834
|
[
|
|
13426
13835
|
"agentsmd",
|
|
@@ -13644,11 +14053,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
13644
14053
|
)
|
|
13645
14054
|
);
|
|
13646
14055
|
const localSkillNames = new Set(localDirNames);
|
|
13647
|
-
const curatedDirPath = (0,
|
|
14056
|
+
const curatedDirPath = (0, import_node_path94.join)(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
|
|
13648
14057
|
let curatedSkills = [];
|
|
13649
14058
|
if (await directoryExists(curatedDirPath)) {
|
|
13650
|
-
const curatedDirPaths = await findFilesByGlobs((0,
|
|
13651
|
-
const curatedDirNames = curatedDirPaths.map((path3) => (0,
|
|
14059
|
+
const curatedDirPaths = await findFilesByGlobs((0, import_node_path94.join)(curatedDirPath, "*"), { type: "dir" });
|
|
14060
|
+
const curatedDirNames = curatedDirPaths.map((path3) => (0, import_node_path94.basename)(path3));
|
|
13652
14061
|
const nonConflicting = curatedDirNames.filter((name) => {
|
|
13653
14062
|
if (localSkillNames.has(name)) {
|
|
13654
14063
|
this.logger.debug(`Skipping curated skill "${name}": local skill takes precedence.`);
|
|
@@ -13685,13 +14094,13 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
13685
14094
|
const seenDirNames = /* @__PURE__ */ new Set();
|
|
13686
14095
|
const loadEntries = [];
|
|
13687
14096
|
for (const root of roots) {
|
|
13688
|
-
const skillsDirPath = (0,
|
|
14097
|
+
const skillsDirPath = (0, import_node_path94.join)(this.baseDir, root);
|
|
13689
14098
|
if (!await directoryExists(skillsDirPath)) {
|
|
13690
14099
|
continue;
|
|
13691
14100
|
}
|
|
13692
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
14101
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path94.join)(skillsDirPath, "*"), { type: "dir" });
|
|
13693
14102
|
for (const dirPath of dirPaths) {
|
|
13694
|
-
const dirName = (0,
|
|
14103
|
+
const dirName = (0, import_node_path94.basename)(dirPath);
|
|
13695
14104
|
if (seenDirNames.has(dirName)) {
|
|
13696
14105
|
continue;
|
|
13697
14106
|
}
|
|
@@ -13720,13 +14129,13 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
13720
14129
|
const roots = toolSkillSearchRoots(paths);
|
|
13721
14130
|
const toolSkills = [];
|
|
13722
14131
|
for (const root of roots) {
|
|
13723
|
-
const skillsDirPath = (0,
|
|
14132
|
+
const skillsDirPath = (0, import_node_path94.join)(this.baseDir, root);
|
|
13724
14133
|
if (!await directoryExists(skillsDirPath)) {
|
|
13725
14134
|
continue;
|
|
13726
14135
|
}
|
|
13727
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
14136
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path94.join)(skillsDirPath, "*"), { type: "dir" });
|
|
13728
14137
|
for (const dirPath of dirPaths) {
|
|
13729
|
-
const dirName = (0,
|
|
14138
|
+
const dirName = (0, import_node_path94.basename)(dirPath);
|
|
13730
14139
|
const toolSkill = factory.class.forDeletion({
|
|
13731
14140
|
baseDir: this.baseDir,
|
|
13732
14141
|
relativeDirPath: root,
|
|
@@ -13788,11 +14197,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
13788
14197
|
};
|
|
13789
14198
|
|
|
13790
14199
|
// src/features/subagents/agentsmd-subagent.ts
|
|
13791
|
-
var
|
|
14200
|
+
var import_node_path96 = require("path");
|
|
13792
14201
|
|
|
13793
14202
|
// src/features/subagents/simulated-subagent.ts
|
|
13794
|
-
var
|
|
13795
|
-
var
|
|
14203
|
+
var import_node_path95 = require("path");
|
|
14204
|
+
var import_mini52 = require("zod/mini");
|
|
13796
14205
|
|
|
13797
14206
|
// src/features/subagents/tool-subagent.ts
|
|
13798
14207
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -13844,9 +14253,9 @@ var ToolSubagent = class extends ToolFile {
|
|
|
13844
14253
|
};
|
|
13845
14254
|
|
|
13846
14255
|
// src/features/subagents/simulated-subagent.ts
|
|
13847
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
13848
|
-
name:
|
|
13849
|
-
description:
|
|
14256
|
+
var SimulatedSubagentFrontmatterSchema = import_mini52.z.object({
|
|
14257
|
+
name: import_mini52.z.string(),
|
|
14258
|
+
description: import_mini52.z.optional(import_mini52.z.string())
|
|
13850
14259
|
});
|
|
13851
14260
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
13852
14261
|
frontmatter;
|
|
@@ -13856,7 +14265,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
13856
14265
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
13857
14266
|
if (!result.success) {
|
|
13858
14267
|
throw new Error(
|
|
13859
|
-
`Invalid frontmatter in ${(0,
|
|
14268
|
+
`Invalid frontmatter in ${(0, import_node_path95.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
13860
14269
|
);
|
|
13861
14270
|
}
|
|
13862
14271
|
}
|
|
@@ -13907,7 +14316,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
13907
14316
|
return {
|
|
13908
14317
|
success: false,
|
|
13909
14318
|
error: new Error(
|
|
13910
|
-
`Invalid frontmatter in ${(0,
|
|
14319
|
+
`Invalid frontmatter in ${(0, import_node_path95.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
13911
14320
|
)
|
|
13912
14321
|
};
|
|
13913
14322
|
}
|
|
@@ -13917,7 +14326,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
13917
14326
|
relativeFilePath,
|
|
13918
14327
|
validate = true
|
|
13919
14328
|
}) {
|
|
13920
|
-
const filePath = (0,
|
|
14329
|
+
const filePath = (0, import_node_path95.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
13921
14330
|
const fileContent = await readFileContent(filePath);
|
|
13922
14331
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
13923
14332
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -13927,7 +14336,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
13927
14336
|
return {
|
|
13928
14337
|
baseDir,
|
|
13929
14338
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
13930
|
-
relativeFilePath: (0,
|
|
14339
|
+
relativeFilePath: (0, import_node_path95.basename)(relativeFilePath),
|
|
13931
14340
|
frontmatter: result.data,
|
|
13932
14341
|
body: content.trim(),
|
|
13933
14342
|
validate
|
|
@@ -13953,7 +14362,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
13953
14362
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
13954
14363
|
static getSettablePaths() {
|
|
13955
14364
|
return {
|
|
13956
|
-
relativeDirPath: (0,
|
|
14365
|
+
relativeDirPath: (0, import_node_path96.join)(".agents", "subagents")
|
|
13957
14366
|
};
|
|
13958
14367
|
}
|
|
13959
14368
|
static async fromFile(params) {
|
|
@@ -13976,11 +14385,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
13976
14385
|
};
|
|
13977
14386
|
|
|
13978
14387
|
// src/features/subagents/factorydroid-subagent.ts
|
|
13979
|
-
var
|
|
14388
|
+
var import_node_path97 = require("path");
|
|
13980
14389
|
var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
|
|
13981
14390
|
static getSettablePaths(_options) {
|
|
13982
14391
|
return {
|
|
13983
|
-
relativeDirPath: (0,
|
|
14392
|
+
relativeDirPath: (0, import_node_path97.join)(".factory", "droids")
|
|
13984
14393
|
};
|
|
13985
14394
|
}
|
|
13986
14395
|
static async fromFile(params) {
|
|
@@ -14003,16 +14412,16 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
|
|
|
14003
14412
|
};
|
|
14004
14413
|
|
|
14005
14414
|
// src/features/subagents/geminicli-subagent.ts
|
|
14006
|
-
var
|
|
14007
|
-
var
|
|
14415
|
+
var import_node_path99 = require("path");
|
|
14416
|
+
var import_mini54 = require("zod/mini");
|
|
14008
14417
|
|
|
14009
14418
|
// src/features/subagents/rulesync-subagent.ts
|
|
14010
|
-
var
|
|
14011
|
-
var
|
|
14012
|
-
var RulesyncSubagentFrontmatterSchema =
|
|
14013
|
-
targets:
|
|
14014
|
-
name:
|
|
14015
|
-
description:
|
|
14419
|
+
var import_node_path98 = require("path");
|
|
14420
|
+
var import_mini53 = require("zod/mini");
|
|
14421
|
+
var RulesyncSubagentFrontmatterSchema = import_mini53.z.looseObject({
|
|
14422
|
+
targets: import_mini53.z._default(RulesyncTargetsSchema, ["*"]),
|
|
14423
|
+
name: import_mini53.z.string(),
|
|
14424
|
+
description: import_mini53.z.optional(import_mini53.z.string())
|
|
14016
14425
|
});
|
|
14017
14426
|
var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
14018
14427
|
frontmatter;
|
|
@@ -14021,7 +14430,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
14021
14430
|
const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14022
14431
|
if (!parseResult.success && rest.validate !== false) {
|
|
14023
14432
|
throw new Error(
|
|
14024
|
-
`Invalid frontmatter in ${(0,
|
|
14433
|
+
`Invalid frontmatter in ${(0, import_node_path98.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
14025
14434
|
);
|
|
14026
14435
|
}
|
|
14027
14436
|
const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
|
|
@@ -14054,7 +14463,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
14054
14463
|
return {
|
|
14055
14464
|
success: false,
|
|
14056
14465
|
error: new Error(
|
|
14057
|
-
`Invalid frontmatter in ${(0,
|
|
14466
|
+
`Invalid frontmatter in ${(0, import_node_path98.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14058
14467
|
)
|
|
14059
14468
|
};
|
|
14060
14469
|
}
|
|
@@ -14062,14 +14471,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
14062
14471
|
static async fromFile({
|
|
14063
14472
|
relativeFilePath
|
|
14064
14473
|
}) {
|
|
14065
|
-
const filePath = (0,
|
|
14474
|
+
const filePath = (0, import_node_path98.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
|
|
14066
14475
|
const fileContent = await readFileContent(filePath);
|
|
14067
14476
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14068
14477
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14069
14478
|
if (!result.success) {
|
|
14070
14479
|
throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
|
|
14071
14480
|
}
|
|
14072
|
-
const filename = (0,
|
|
14481
|
+
const filename = (0, import_node_path98.basename)(relativeFilePath);
|
|
14073
14482
|
return new _RulesyncSubagent({
|
|
14074
14483
|
baseDir: process.cwd(),
|
|
14075
14484
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
@@ -14081,9 +14490,9 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
14081
14490
|
};
|
|
14082
14491
|
|
|
14083
14492
|
// src/features/subagents/geminicli-subagent.ts
|
|
14084
|
-
var GeminiCliSubagentFrontmatterSchema =
|
|
14085
|
-
name:
|
|
14086
|
-
description:
|
|
14493
|
+
var GeminiCliSubagentFrontmatterSchema = import_mini54.z.looseObject({
|
|
14494
|
+
name: import_mini54.z.string(),
|
|
14495
|
+
description: import_mini54.z.optional(import_mini54.z.string())
|
|
14087
14496
|
});
|
|
14088
14497
|
var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
14089
14498
|
frontmatter;
|
|
@@ -14093,7 +14502,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
14093
14502
|
const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14094
14503
|
if (!result.success) {
|
|
14095
14504
|
throw new Error(
|
|
14096
|
-
`Invalid frontmatter in ${(0,
|
|
14505
|
+
`Invalid frontmatter in ${(0, import_node_path99.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14097
14506
|
);
|
|
14098
14507
|
}
|
|
14099
14508
|
}
|
|
@@ -14106,7 +14515,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
14106
14515
|
}
|
|
14107
14516
|
static getSettablePaths(_options = {}) {
|
|
14108
14517
|
return {
|
|
14109
|
-
relativeDirPath: (0,
|
|
14518
|
+
relativeDirPath: (0, import_node_path99.join)(".gemini", "agents")
|
|
14110
14519
|
};
|
|
14111
14520
|
}
|
|
14112
14521
|
getFrontmatter() {
|
|
@@ -14174,7 +14583,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
14174
14583
|
return {
|
|
14175
14584
|
success: false,
|
|
14176
14585
|
error: new Error(
|
|
14177
|
-
`Invalid frontmatter in ${(0,
|
|
14586
|
+
`Invalid frontmatter in ${(0, import_node_path99.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14178
14587
|
)
|
|
14179
14588
|
};
|
|
14180
14589
|
}
|
|
@@ -14192,7 +14601,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
14192
14601
|
global = false
|
|
14193
14602
|
}) {
|
|
14194
14603
|
const paths = this.getSettablePaths({ global });
|
|
14195
|
-
const filePath = (0,
|
|
14604
|
+
const filePath = (0, import_node_path99.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
14196
14605
|
const fileContent = await readFileContent(filePath);
|
|
14197
14606
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14198
14607
|
const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14228,11 +14637,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
14228
14637
|
};
|
|
14229
14638
|
|
|
14230
14639
|
// src/features/subagents/roo-subagent.ts
|
|
14231
|
-
var
|
|
14640
|
+
var import_node_path100 = require("path");
|
|
14232
14641
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
14233
14642
|
static getSettablePaths() {
|
|
14234
14643
|
return {
|
|
14235
|
-
relativeDirPath: (0,
|
|
14644
|
+
relativeDirPath: (0, import_node_path100.join)(".roo", "subagents")
|
|
14236
14645
|
};
|
|
14237
14646
|
}
|
|
14238
14647
|
static async fromFile(params) {
|
|
@@ -14255,11 +14664,11 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
14255
14664
|
};
|
|
14256
14665
|
|
|
14257
14666
|
// src/features/subagents/rovodev-subagent.ts
|
|
14258
|
-
var
|
|
14259
|
-
var
|
|
14260
|
-
var RovodevSubagentFrontmatterSchema =
|
|
14261
|
-
name:
|
|
14262
|
-
description:
|
|
14667
|
+
var import_node_path101 = require("path");
|
|
14668
|
+
var import_mini55 = require("zod/mini");
|
|
14669
|
+
var RovodevSubagentFrontmatterSchema = import_mini55.z.looseObject({
|
|
14670
|
+
name: import_mini55.z.string(),
|
|
14671
|
+
description: import_mini55.z.optional(import_mini55.z.string())
|
|
14263
14672
|
});
|
|
14264
14673
|
var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
14265
14674
|
frontmatter;
|
|
@@ -14269,7 +14678,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
14269
14678
|
const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14270
14679
|
if (!result.success) {
|
|
14271
14680
|
throw new Error(
|
|
14272
|
-
`Invalid frontmatter in ${(0,
|
|
14681
|
+
`Invalid frontmatter in ${(0, import_node_path101.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14273
14682
|
);
|
|
14274
14683
|
}
|
|
14275
14684
|
}
|
|
@@ -14281,7 +14690,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
14281
14690
|
}
|
|
14282
14691
|
static getSettablePaths(_options = {}) {
|
|
14283
14692
|
return {
|
|
14284
|
-
relativeDirPath: (0,
|
|
14693
|
+
relativeDirPath: (0, import_node_path101.join)(".rovodev", "subagents")
|
|
14285
14694
|
};
|
|
14286
14695
|
}
|
|
14287
14696
|
getFrontmatter() {
|
|
@@ -14344,7 +14753,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
14344
14753
|
return {
|
|
14345
14754
|
success: false,
|
|
14346
14755
|
error: new Error(
|
|
14347
|
-
`Invalid frontmatter in ${(0,
|
|
14756
|
+
`Invalid frontmatter in ${(0, import_node_path101.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14348
14757
|
)
|
|
14349
14758
|
};
|
|
14350
14759
|
}
|
|
@@ -14361,7 +14770,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
14361
14770
|
global = false
|
|
14362
14771
|
}) {
|
|
14363
14772
|
const paths = this.getSettablePaths({ global });
|
|
14364
|
-
const filePath = (0,
|
|
14773
|
+
const filePath = (0, import_node_path101.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
14365
14774
|
const fileContent = await readFileContent(filePath);
|
|
14366
14775
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14367
14776
|
const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14400,19 +14809,19 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
14400
14809
|
};
|
|
14401
14810
|
|
|
14402
14811
|
// src/features/subagents/subagents-processor.ts
|
|
14403
|
-
var
|
|
14404
|
-
var
|
|
14812
|
+
var import_node_path112 = require("path");
|
|
14813
|
+
var import_mini64 = require("zod/mini");
|
|
14405
14814
|
|
|
14406
14815
|
// src/features/subagents/claudecode-subagent.ts
|
|
14407
|
-
var
|
|
14408
|
-
var
|
|
14409
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
14410
|
-
name:
|
|
14411
|
-
description:
|
|
14412
|
-
model:
|
|
14413
|
-
tools:
|
|
14414
|
-
permissionMode:
|
|
14415
|
-
skills:
|
|
14816
|
+
var import_node_path102 = require("path");
|
|
14817
|
+
var import_mini56 = require("zod/mini");
|
|
14818
|
+
var ClaudecodeSubagentFrontmatterSchema = import_mini56.z.looseObject({
|
|
14819
|
+
name: import_mini56.z.string(),
|
|
14820
|
+
description: import_mini56.z.optional(import_mini56.z.string()),
|
|
14821
|
+
model: import_mini56.z.optional(import_mini56.z.string()),
|
|
14822
|
+
tools: import_mini56.z.optional(import_mini56.z.union([import_mini56.z.string(), import_mini56.z.array(import_mini56.z.string())])),
|
|
14823
|
+
permissionMode: import_mini56.z.optional(import_mini56.z.string()),
|
|
14824
|
+
skills: import_mini56.z.optional(import_mini56.z.union([import_mini56.z.string(), import_mini56.z.array(import_mini56.z.string())]))
|
|
14416
14825
|
});
|
|
14417
14826
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
14418
14827
|
frontmatter;
|
|
@@ -14422,7 +14831,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
14422
14831
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14423
14832
|
if (!result.success) {
|
|
14424
14833
|
throw new Error(
|
|
14425
|
-
`Invalid frontmatter in ${(0,
|
|
14834
|
+
`Invalid frontmatter in ${(0, import_node_path102.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14426
14835
|
);
|
|
14427
14836
|
}
|
|
14428
14837
|
}
|
|
@@ -14434,7 +14843,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
14434
14843
|
}
|
|
14435
14844
|
static getSettablePaths(_options = {}) {
|
|
14436
14845
|
return {
|
|
14437
|
-
relativeDirPath: (0,
|
|
14846
|
+
relativeDirPath: (0, import_node_path102.join)(".claude", "agents")
|
|
14438
14847
|
};
|
|
14439
14848
|
}
|
|
14440
14849
|
getFrontmatter() {
|
|
@@ -14513,7 +14922,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
14513
14922
|
return {
|
|
14514
14923
|
success: false,
|
|
14515
14924
|
error: new Error(
|
|
14516
|
-
`Invalid frontmatter in ${(0,
|
|
14925
|
+
`Invalid frontmatter in ${(0, import_node_path102.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14517
14926
|
)
|
|
14518
14927
|
};
|
|
14519
14928
|
}
|
|
@@ -14531,7 +14940,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
14531
14940
|
global = false
|
|
14532
14941
|
}) {
|
|
14533
14942
|
const paths = this.getSettablePaths({ global });
|
|
14534
|
-
const filePath = (0,
|
|
14943
|
+
const filePath = (0, import_node_path102.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
14535
14944
|
const fileContent = await readFileContent(filePath);
|
|
14536
14945
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14537
14946
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14566,16 +14975,16 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
14566
14975
|
};
|
|
14567
14976
|
|
|
14568
14977
|
// src/features/subagents/codexcli-subagent.ts
|
|
14569
|
-
var
|
|
14978
|
+
var import_node_path103 = require("path");
|
|
14570
14979
|
var smolToml5 = __toESM(require("smol-toml"), 1);
|
|
14571
|
-
var
|
|
14572
|
-
var CodexCliSubagentTomlSchema =
|
|
14573
|
-
name:
|
|
14574
|
-
description:
|
|
14575
|
-
developer_instructions:
|
|
14576
|
-
model:
|
|
14577
|
-
model_reasoning_effort:
|
|
14578
|
-
sandbox_mode:
|
|
14980
|
+
var import_mini57 = require("zod/mini");
|
|
14981
|
+
var CodexCliSubagentTomlSchema = import_mini57.z.looseObject({
|
|
14982
|
+
name: import_mini57.z.string(),
|
|
14983
|
+
description: import_mini57.z.optional(import_mini57.z.string()),
|
|
14984
|
+
developer_instructions: import_mini57.z.optional(import_mini57.z.string()),
|
|
14985
|
+
model: import_mini57.z.optional(import_mini57.z.string()),
|
|
14986
|
+
model_reasoning_effort: import_mini57.z.optional(import_mini57.z.string()),
|
|
14987
|
+
sandbox_mode: import_mini57.z.optional(import_mini57.z.string())
|
|
14579
14988
|
});
|
|
14580
14989
|
var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
14581
14990
|
body;
|
|
@@ -14586,7 +14995,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
14586
14995
|
CodexCliSubagentTomlSchema.parse(parsed);
|
|
14587
14996
|
} catch (error) {
|
|
14588
14997
|
throw new Error(
|
|
14589
|
-
`Invalid TOML in ${(0,
|
|
14998
|
+
`Invalid TOML in ${(0, import_node_path103.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
14590
14999
|
{ cause: error }
|
|
14591
15000
|
);
|
|
14592
15001
|
}
|
|
@@ -14598,7 +15007,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
14598
15007
|
}
|
|
14599
15008
|
static getSettablePaths(_options = {}) {
|
|
14600
15009
|
return {
|
|
14601
|
-
relativeDirPath: (0,
|
|
15010
|
+
relativeDirPath: (0, import_node_path103.join)(".codex", "agents")
|
|
14602
15011
|
};
|
|
14603
15012
|
}
|
|
14604
15013
|
getBody() {
|
|
@@ -14610,7 +15019,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
14610
15019
|
parsed = CodexCliSubagentTomlSchema.parse(smolToml5.parse(this.body));
|
|
14611
15020
|
} catch (error) {
|
|
14612
15021
|
throw new Error(
|
|
14613
|
-
`Failed to parse TOML in ${(0,
|
|
15022
|
+
`Failed to parse TOML in ${(0, import_node_path103.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
14614
15023
|
{ cause: error }
|
|
14615
15024
|
);
|
|
14616
15025
|
}
|
|
@@ -14691,7 +15100,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
14691
15100
|
global = false
|
|
14692
15101
|
}) {
|
|
14693
15102
|
const paths = this.getSettablePaths({ global });
|
|
14694
|
-
const filePath = (0,
|
|
15103
|
+
const filePath = (0, import_node_path103.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
14695
15104
|
const fileContent = await readFileContent(filePath);
|
|
14696
15105
|
const subagent = new _CodexCliSubagent({
|
|
14697
15106
|
baseDir,
|
|
@@ -14729,13 +15138,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
14729
15138
|
};
|
|
14730
15139
|
|
|
14731
15140
|
// src/features/subagents/copilot-subagent.ts
|
|
14732
|
-
var
|
|
14733
|
-
var
|
|
15141
|
+
var import_node_path104 = require("path");
|
|
15142
|
+
var import_mini58 = require("zod/mini");
|
|
14734
15143
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
14735
|
-
var CopilotSubagentFrontmatterSchema =
|
|
14736
|
-
name:
|
|
14737
|
-
description:
|
|
14738
|
-
tools:
|
|
15144
|
+
var CopilotSubagentFrontmatterSchema = import_mini58.z.looseObject({
|
|
15145
|
+
name: import_mini58.z.string(),
|
|
15146
|
+
description: import_mini58.z.optional(import_mini58.z.string()),
|
|
15147
|
+
tools: import_mini58.z.optional(import_mini58.z.union([import_mini58.z.string(), import_mini58.z.array(import_mini58.z.string())]))
|
|
14739
15148
|
});
|
|
14740
15149
|
var normalizeTools = (tools) => {
|
|
14741
15150
|
if (!tools) {
|
|
@@ -14755,7 +15164,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
14755
15164
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14756
15165
|
if (!result.success) {
|
|
14757
15166
|
throw new Error(
|
|
14758
|
-
`Invalid frontmatter in ${(0,
|
|
15167
|
+
`Invalid frontmatter in ${(0, import_node_path104.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14759
15168
|
);
|
|
14760
15169
|
}
|
|
14761
15170
|
}
|
|
@@ -14767,7 +15176,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
14767
15176
|
}
|
|
14768
15177
|
static getSettablePaths(_options = {}) {
|
|
14769
15178
|
return {
|
|
14770
|
-
relativeDirPath: (0,
|
|
15179
|
+
relativeDirPath: (0, import_node_path104.join)(".github", "agents")
|
|
14771
15180
|
};
|
|
14772
15181
|
}
|
|
14773
15182
|
getFrontmatter() {
|
|
@@ -14845,7 +15254,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
14845
15254
|
return {
|
|
14846
15255
|
success: false,
|
|
14847
15256
|
error: new Error(
|
|
14848
|
-
`Invalid frontmatter in ${(0,
|
|
15257
|
+
`Invalid frontmatter in ${(0, import_node_path104.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14849
15258
|
)
|
|
14850
15259
|
};
|
|
14851
15260
|
}
|
|
@@ -14863,7 +15272,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
14863
15272
|
global = false
|
|
14864
15273
|
}) {
|
|
14865
15274
|
const paths = this.getSettablePaths({ global });
|
|
14866
|
-
const filePath = (0,
|
|
15275
|
+
const filePath = (0, import_node_path104.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
14867
15276
|
const fileContent = await readFileContent(filePath);
|
|
14868
15277
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14869
15278
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14899,11 +15308,11 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
14899
15308
|
};
|
|
14900
15309
|
|
|
14901
15310
|
// src/features/subagents/cursor-subagent.ts
|
|
14902
|
-
var
|
|
14903
|
-
var
|
|
14904
|
-
var CursorSubagentFrontmatterSchema =
|
|
14905
|
-
name:
|
|
14906
|
-
description:
|
|
15311
|
+
var import_node_path105 = require("path");
|
|
15312
|
+
var import_mini59 = require("zod/mini");
|
|
15313
|
+
var CursorSubagentFrontmatterSchema = import_mini59.z.looseObject({
|
|
15314
|
+
name: import_mini59.z.string(),
|
|
15315
|
+
description: import_mini59.z.optional(import_mini59.z.string())
|
|
14907
15316
|
});
|
|
14908
15317
|
var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
14909
15318
|
frontmatter;
|
|
@@ -14913,7 +15322,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
14913
15322
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14914
15323
|
if (!result.success) {
|
|
14915
15324
|
throw new Error(
|
|
14916
|
-
`Invalid frontmatter in ${(0,
|
|
15325
|
+
`Invalid frontmatter in ${(0, import_node_path105.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14917
15326
|
);
|
|
14918
15327
|
}
|
|
14919
15328
|
}
|
|
@@ -14925,7 +15334,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
14925
15334
|
}
|
|
14926
15335
|
static getSettablePaths(_options = {}) {
|
|
14927
15336
|
return {
|
|
14928
|
-
relativeDirPath: (0,
|
|
15337
|
+
relativeDirPath: (0, import_node_path105.join)(".cursor", "agents")
|
|
14929
15338
|
};
|
|
14930
15339
|
}
|
|
14931
15340
|
getFrontmatter() {
|
|
@@ -14992,7 +15401,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
14992
15401
|
return {
|
|
14993
15402
|
success: false,
|
|
14994
15403
|
error: new Error(
|
|
14995
|
-
`Invalid frontmatter in ${(0,
|
|
15404
|
+
`Invalid frontmatter in ${(0, import_node_path105.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14996
15405
|
)
|
|
14997
15406
|
};
|
|
14998
15407
|
}
|
|
@@ -15010,7 +15419,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
15010
15419
|
global = false
|
|
15011
15420
|
}) {
|
|
15012
15421
|
const paths = this.getSettablePaths({ global });
|
|
15013
|
-
const filePath = (0,
|
|
15422
|
+
const filePath = (0, import_node_path105.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15014
15423
|
const fileContent = await readFileContent(filePath);
|
|
15015
15424
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15016
15425
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15046,12 +15455,12 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
15046
15455
|
};
|
|
15047
15456
|
|
|
15048
15457
|
// src/features/subagents/deepagents-subagent.ts
|
|
15049
|
-
var
|
|
15050
|
-
var
|
|
15051
|
-
var DeepagentsSubagentFrontmatterSchema =
|
|
15052
|
-
name:
|
|
15053
|
-
description:
|
|
15054
|
-
model:
|
|
15458
|
+
var import_node_path106 = require("path");
|
|
15459
|
+
var import_mini60 = require("zod/mini");
|
|
15460
|
+
var DeepagentsSubagentFrontmatterSchema = import_mini60.z.looseObject({
|
|
15461
|
+
name: import_mini60.z.string(),
|
|
15462
|
+
description: import_mini60.z.optional(import_mini60.z.string()),
|
|
15463
|
+
model: import_mini60.z.optional(import_mini60.z.string())
|
|
15055
15464
|
});
|
|
15056
15465
|
var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
15057
15466
|
frontmatter;
|
|
@@ -15061,7 +15470,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
15061
15470
|
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
15062
15471
|
if (!result.success) {
|
|
15063
15472
|
throw new Error(
|
|
15064
|
-
`Invalid frontmatter in ${(0,
|
|
15473
|
+
`Invalid frontmatter in ${(0, import_node_path106.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15065
15474
|
);
|
|
15066
15475
|
}
|
|
15067
15476
|
}
|
|
@@ -15071,7 +15480,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
15071
15480
|
}
|
|
15072
15481
|
static getSettablePaths(_options = {}) {
|
|
15073
15482
|
return {
|
|
15074
|
-
relativeDirPath: (0,
|
|
15483
|
+
relativeDirPath: (0, import_node_path106.join)(".deepagents", "agents")
|
|
15075
15484
|
};
|
|
15076
15485
|
}
|
|
15077
15486
|
getFrontmatter() {
|
|
@@ -15146,7 +15555,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
15146
15555
|
return {
|
|
15147
15556
|
success: false,
|
|
15148
15557
|
error: new Error(
|
|
15149
|
-
`Invalid frontmatter in ${(0,
|
|
15558
|
+
`Invalid frontmatter in ${(0, import_node_path106.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15150
15559
|
)
|
|
15151
15560
|
};
|
|
15152
15561
|
}
|
|
@@ -15164,7 +15573,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
15164
15573
|
global = false
|
|
15165
15574
|
}) {
|
|
15166
15575
|
const paths = this.getSettablePaths({ global });
|
|
15167
|
-
const filePath = (0,
|
|
15576
|
+
const filePath = (0, import_node_path106.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15168
15577
|
const fileContent = await readFileContent(filePath);
|
|
15169
15578
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15170
15579
|
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15199,11 +15608,11 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
15199
15608
|
};
|
|
15200
15609
|
|
|
15201
15610
|
// src/features/subagents/junie-subagent.ts
|
|
15202
|
-
var
|
|
15203
|
-
var
|
|
15204
|
-
var JunieSubagentFrontmatterSchema =
|
|
15205
|
-
name:
|
|
15206
|
-
description:
|
|
15611
|
+
var import_node_path107 = require("path");
|
|
15612
|
+
var import_mini61 = require("zod/mini");
|
|
15613
|
+
var JunieSubagentFrontmatterSchema = import_mini61.z.looseObject({
|
|
15614
|
+
name: import_mini61.z.optional(import_mini61.z.string()),
|
|
15615
|
+
description: import_mini61.z.string()
|
|
15207
15616
|
});
|
|
15208
15617
|
var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
15209
15618
|
frontmatter;
|
|
@@ -15213,7 +15622,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
15213
15622
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
15214
15623
|
if (!result.success) {
|
|
15215
15624
|
throw new Error(
|
|
15216
|
-
`Invalid frontmatter in ${(0,
|
|
15625
|
+
`Invalid frontmatter in ${(0, import_node_path107.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15217
15626
|
);
|
|
15218
15627
|
}
|
|
15219
15628
|
}
|
|
@@ -15228,7 +15637,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
15228
15637
|
throw new Error("JunieSubagent does not support global mode.");
|
|
15229
15638
|
}
|
|
15230
15639
|
return {
|
|
15231
|
-
relativeDirPath: (0,
|
|
15640
|
+
relativeDirPath: (0, import_node_path107.join)(".junie", "agents")
|
|
15232
15641
|
};
|
|
15233
15642
|
}
|
|
15234
15643
|
getFrontmatter() {
|
|
@@ -15304,7 +15713,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
15304
15713
|
return {
|
|
15305
15714
|
success: false,
|
|
15306
15715
|
error: new Error(
|
|
15307
|
-
`Invalid frontmatter in ${(0,
|
|
15716
|
+
`Invalid frontmatter in ${(0, import_node_path107.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15308
15717
|
)
|
|
15309
15718
|
};
|
|
15310
15719
|
}
|
|
@@ -15322,7 +15731,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
15322
15731
|
global = false
|
|
15323
15732
|
}) {
|
|
15324
15733
|
const paths = this.getSettablePaths({ global });
|
|
15325
|
-
const filePath = (0,
|
|
15734
|
+
const filePath = (0, import_node_path107.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15326
15735
|
const fileContent = await readFileContent(filePath);
|
|
15327
15736
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15328
15737
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15357,15 +15766,15 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
15357
15766
|
};
|
|
15358
15767
|
|
|
15359
15768
|
// src/features/subagents/kilo-subagent.ts
|
|
15360
|
-
var
|
|
15769
|
+
var import_node_path109 = require("path");
|
|
15361
15770
|
|
|
15362
15771
|
// src/features/subagents/opencode-style-subagent.ts
|
|
15363
|
-
var
|
|
15364
|
-
var
|
|
15365
|
-
var OpenCodeStyleSubagentFrontmatterSchema =
|
|
15366
|
-
description:
|
|
15367
|
-
mode:
|
|
15368
|
-
name:
|
|
15772
|
+
var import_node_path108 = require("path");
|
|
15773
|
+
var import_mini62 = require("zod/mini");
|
|
15774
|
+
var OpenCodeStyleSubagentFrontmatterSchema = import_mini62.z.looseObject({
|
|
15775
|
+
description: import_mini62.z.optional(import_mini62.z.string()),
|
|
15776
|
+
mode: import_mini62.z._default(import_mini62.z.string(), "subagent"),
|
|
15777
|
+
name: import_mini62.z.optional(import_mini62.z.string())
|
|
15369
15778
|
});
|
|
15370
15779
|
var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
15371
15780
|
frontmatter;
|
|
@@ -15375,7 +15784,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
15375
15784
|
const result = OpenCodeStyleSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
15376
15785
|
if (!result.success) {
|
|
15377
15786
|
throw new Error(
|
|
15378
|
-
`Invalid frontmatter in ${(0,
|
|
15787
|
+
`Invalid frontmatter in ${(0, import_node_path108.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15379
15788
|
);
|
|
15380
15789
|
}
|
|
15381
15790
|
}
|
|
@@ -15395,7 +15804,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
15395
15804
|
const { description, mode, name, ...toolSection } = this.frontmatter;
|
|
15396
15805
|
const rulesyncFrontmatter = {
|
|
15397
15806
|
targets: ["*"],
|
|
15398
|
-
name: name ?? (0,
|
|
15807
|
+
name: name ?? (0, import_node_path108.basename)(this.getRelativeFilePath(), ".md"),
|
|
15399
15808
|
description,
|
|
15400
15809
|
[this.getToolTarget()]: { mode, ...toolSection }
|
|
15401
15810
|
};
|
|
@@ -15417,7 +15826,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
15417
15826
|
return {
|
|
15418
15827
|
success: false,
|
|
15419
15828
|
error: new Error(
|
|
15420
|
-
`Invalid frontmatter in ${(0,
|
|
15829
|
+
`Invalid frontmatter in ${(0, import_node_path108.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15421
15830
|
)
|
|
15422
15831
|
};
|
|
15423
15832
|
}
|
|
@@ -15433,7 +15842,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
15433
15842
|
global = false
|
|
15434
15843
|
} = {}) {
|
|
15435
15844
|
return {
|
|
15436
|
-
relativeDirPath: global ? (0,
|
|
15845
|
+
relativeDirPath: global ? (0, import_node_path109.join)(".config", "kilo", "agent") : (0, import_node_path109.join)(".kilo", "agent")
|
|
15437
15846
|
};
|
|
15438
15847
|
}
|
|
15439
15848
|
static fromRulesyncSubagent({
|
|
@@ -15477,7 +15886,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
15477
15886
|
global = false
|
|
15478
15887
|
}) {
|
|
15479
15888
|
const paths = this.getSettablePaths({ global });
|
|
15480
|
-
const filePath = (0,
|
|
15889
|
+
const filePath = (0, import_node_path109.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15481
15890
|
const fileContent = await readFileContent(filePath);
|
|
15482
15891
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15483
15892
|
const result = KiloSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15513,23 +15922,23 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
15513
15922
|
};
|
|
15514
15923
|
|
|
15515
15924
|
// src/features/subagents/kiro-subagent.ts
|
|
15516
|
-
var
|
|
15517
|
-
var
|
|
15518
|
-
var KiroCliSubagentJsonSchema =
|
|
15519
|
-
name:
|
|
15520
|
-
description:
|
|
15521
|
-
prompt:
|
|
15522
|
-
tools:
|
|
15523
|
-
toolAliases:
|
|
15524
|
-
toolSettings:
|
|
15525
|
-
toolSchema:
|
|
15526
|
-
hooks:
|
|
15527
|
-
model:
|
|
15528
|
-
mcpServers:
|
|
15529
|
-
useLegacyMcpJson:
|
|
15530
|
-
resources:
|
|
15531
|
-
allowedTools:
|
|
15532
|
-
includeMcpJson:
|
|
15925
|
+
var import_node_path110 = require("path");
|
|
15926
|
+
var import_mini63 = require("zod/mini");
|
|
15927
|
+
var KiroCliSubagentJsonSchema = import_mini63.z.looseObject({
|
|
15928
|
+
name: import_mini63.z.string(),
|
|
15929
|
+
description: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.string())),
|
|
15930
|
+
prompt: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.string())),
|
|
15931
|
+
tools: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.array(import_mini63.z.string()))),
|
|
15932
|
+
toolAliases: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.record(import_mini63.z.string(), import_mini63.z.string()))),
|
|
15933
|
+
toolSettings: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.unknown())),
|
|
15934
|
+
toolSchema: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.unknown())),
|
|
15935
|
+
hooks: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.record(import_mini63.z.string(), import_mini63.z.array(import_mini63.z.unknown())))),
|
|
15936
|
+
model: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.string())),
|
|
15937
|
+
mcpServers: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.record(import_mini63.z.string(), import_mini63.z.unknown()))),
|
|
15938
|
+
useLegacyMcpJson: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.boolean())),
|
|
15939
|
+
resources: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.array(import_mini63.z.string()))),
|
|
15940
|
+
allowedTools: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.array(import_mini63.z.string()))),
|
|
15941
|
+
includeMcpJson: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.boolean()))
|
|
15533
15942
|
});
|
|
15534
15943
|
var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
15535
15944
|
body;
|
|
@@ -15540,7 +15949,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
15540
15949
|
KiroCliSubagentJsonSchema.parse(parsed);
|
|
15541
15950
|
} catch (error) {
|
|
15542
15951
|
throw new Error(
|
|
15543
|
-
`Invalid JSON in ${(0,
|
|
15952
|
+
`Invalid JSON in ${(0, import_node_path110.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
15544
15953
|
{ cause: error }
|
|
15545
15954
|
);
|
|
15546
15955
|
}
|
|
@@ -15552,7 +15961,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
15552
15961
|
}
|
|
15553
15962
|
static getSettablePaths(_options = {}) {
|
|
15554
15963
|
return {
|
|
15555
|
-
relativeDirPath: (0,
|
|
15964
|
+
relativeDirPath: (0, import_node_path110.join)(".kiro", "agents")
|
|
15556
15965
|
};
|
|
15557
15966
|
}
|
|
15558
15967
|
getBody() {
|
|
@@ -15564,7 +15973,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
15564
15973
|
parsed = JSON.parse(this.body);
|
|
15565
15974
|
} catch (error) {
|
|
15566
15975
|
throw new Error(
|
|
15567
|
-
`Failed to parse JSON in ${(0,
|
|
15976
|
+
`Failed to parse JSON in ${(0, import_node_path110.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
15568
15977
|
{ cause: error }
|
|
15569
15978
|
);
|
|
15570
15979
|
}
|
|
@@ -15645,7 +16054,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
15645
16054
|
global = false
|
|
15646
16055
|
}) {
|
|
15647
16056
|
const paths = this.getSettablePaths({ global });
|
|
15648
|
-
const filePath = (0,
|
|
16057
|
+
const filePath = (0, import_node_path110.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15649
16058
|
const fileContent = await readFileContent(filePath);
|
|
15650
16059
|
const subagent = new _KiroSubagent({
|
|
15651
16060
|
baseDir,
|
|
@@ -15683,7 +16092,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
15683
16092
|
};
|
|
15684
16093
|
|
|
15685
16094
|
// src/features/subagents/opencode-subagent.ts
|
|
15686
|
-
var
|
|
16095
|
+
var import_node_path111 = require("path");
|
|
15687
16096
|
var OpenCodeSubagentFrontmatterSchema = OpenCodeStyleSubagentFrontmatterSchema;
|
|
15688
16097
|
var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
15689
16098
|
getToolTarget() {
|
|
@@ -15693,7 +16102,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
15693
16102
|
global = false
|
|
15694
16103
|
} = {}) {
|
|
15695
16104
|
return {
|
|
15696
|
-
relativeDirPath: global ? (0,
|
|
16105
|
+
relativeDirPath: global ? (0, import_node_path111.join)(".config", "opencode", "agent") : (0, import_node_path111.join)(".opencode", "agent")
|
|
15697
16106
|
};
|
|
15698
16107
|
}
|
|
15699
16108
|
static fromRulesyncSubagent({
|
|
@@ -15737,7 +16146,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
15737
16146
|
global = false
|
|
15738
16147
|
}) {
|
|
15739
16148
|
const paths = this.getSettablePaths({ global });
|
|
15740
|
-
const filePath = (0,
|
|
16149
|
+
const filePath = (0, import_node_path111.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15741
16150
|
const fileContent = await readFileContent(filePath);
|
|
15742
16151
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15743
16152
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15790,7 +16199,7 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
15790
16199
|
"roo",
|
|
15791
16200
|
"rovodev"
|
|
15792
16201
|
];
|
|
15793
|
-
var SubagentsProcessorToolTargetSchema =
|
|
16202
|
+
var SubagentsProcessorToolTargetSchema = import_mini64.z.enum(subagentsProcessorToolTargetTuple);
|
|
15794
16203
|
var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
15795
16204
|
[
|
|
15796
16205
|
"agentsmd",
|
|
@@ -15981,7 +16390,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
15981
16390
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
15982
16391
|
*/
|
|
15983
16392
|
async loadRulesyncFiles() {
|
|
15984
|
-
const subagentsDir = (0,
|
|
16393
|
+
const subagentsDir = (0, import_node_path112.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
15985
16394
|
const dirExists = await directoryExists(subagentsDir);
|
|
15986
16395
|
if (!dirExists) {
|
|
15987
16396
|
this.logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -15996,7 +16405,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
15996
16405
|
this.logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
15997
16406
|
const rulesyncSubagents = [];
|
|
15998
16407
|
for (const mdFile of mdFiles) {
|
|
15999
|
-
const filepath = (0,
|
|
16408
|
+
const filepath = (0, import_node_path112.join)(subagentsDir, mdFile);
|
|
16000
16409
|
try {
|
|
16001
16410
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
16002
16411
|
relativeFilePath: mdFile,
|
|
@@ -16026,14 +16435,14 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
16026
16435
|
const factory = this.getFactory(this.toolTarget);
|
|
16027
16436
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
16028
16437
|
const subagentFilePaths = await findFilesByGlobs(
|
|
16029
|
-
(0,
|
|
16438
|
+
(0, import_node_path112.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
|
|
16030
16439
|
);
|
|
16031
16440
|
if (forDeletion) {
|
|
16032
16441
|
const toolSubagents2 = subagentFilePaths.map(
|
|
16033
16442
|
(path3) => factory.class.forDeletion({
|
|
16034
16443
|
baseDir: this.baseDir,
|
|
16035
16444
|
relativeDirPath: paths.relativeDirPath,
|
|
16036
|
-
relativeFilePath: (0,
|
|
16445
|
+
relativeFilePath: (0, import_node_path112.basename)(path3),
|
|
16037
16446
|
global: this.global
|
|
16038
16447
|
})
|
|
16039
16448
|
).filter((subagent) => subagent.isDeletable());
|
|
@@ -16046,7 +16455,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
16046
16455
|
subagentFilePaths.map(
|
|
16047
16456
|
(path3) => factory.class.fromFile({
|
|
16048
16457
|
baseDir: this.baseDir,
|
|
16049
|
-
relativeFilePath: (0,
|
|
16458
|
+
relativeFilePath: (0, import_node_path112.basename)(path3),
|
|
16050
16459
|
global: this.global
|
|
16051
16460
|
})
|
|
16052
16461
|
)
|
|
@@ -16093,49 +16502,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
16093
16502
|
};
|
|
16094
16503
|
|
|
16095
16504
|
// src/features/rules/agentsmd-rule.ts
|
|
16096
|
-
var
|
|
16505
|
+
var import_node_path115 = require("path");
|
|
16097
16506
|
|
|
16098
16507
|
// src/features/rules/tool-rule.ts
|
|
16099
|
-
var
|
|
16508
|
+
var import_node_path114 = require("path");
|
|
16100
16509
|
|
|
16101
16510
|
// src/features/rules/rulesync-rule.ts
|
|
16102
|
-
var
|
|
16103
|
-
var
|
|
16104
|
-
var RulesyncRuleFrontmatterSchema =
|
|
16105
|
-
root:
|
|
16106
|
-
localRoot:
|
|
16107
|
-
targets:
|
|
16108
|
-
description:
|
|
16109
|
-
globs:
|
|
16110
|
-
agentsmd:
|
|
16111
|
-
|
|
16511
|
+
var import_node_path113 = require("path");
|
|
16512
|
+
var import_mini65 = require("zod/mini");
|
|
16513
|
+
var RulesyncRuleFrontmatterSchema = import_mini65.z.object({
|
|
16514
|
+
root: import_mini65.z.optional(import_mini65.z.boolean()),
|
|
16515
|
+
localRoot: import_mini65.z.optional(import_mini65.z.boolean()),
|
|
16516
|
+
targets: import_mini65.z._default(RulesyncTargetsSchema, ["*"]),
|
|
16517
|
+
description: import_mini65.z.optional(import_mini65.z.string()),
|
|
16518
|
+
globs: import_mini65.z.optional(import_mini65.z.array(import_mini65.z.string())),
|
|
16519
|
+
agentsmd: import_mini65.z.optional(
|
|
16520
|
+
import_mini65.z.looseObject({
|
|
16112
16521
|
// @example "path/to/subproject"
|
|
16113
|
-
subprojectPath:
|
|
16522
|
+
subprojectPath: import_mini65.z.optional(import_mini65.z.string())
|
|
16114
16523
|
})
|
|
16115
16524
|
),
|
|
16116
|
-
claudecode:
|
|
16117
|
-
|
|
16525
|
+
claudecode: import_mini65.z.optional(
|
|
16526
|
+
import_mini65.z.looseObject({
|
|
16118
16527
|
// Glob patterns for conditional rules (takes precedence over globs)
|
|
16119
16528
|
// @example ["src/**/*.ts", "tests/**/*.test.ts"]
|
|
16120
|
-
paths:
|
|
16529
|
+
paths: import_mini65.z.optional(import_mini65.z.array(import_mini65.z.string()))
|
|
16121
16530
|
})
|
|
16122
16531
|
),
|
|
16123
|
-
cursor:
|
|
16124
|
-
|
|
16125
|
-
alwaysApply:
|
|
16126
|
-
description:
|
|
16127
|
-
globs:
|
|
16532
|
+
cursor: import_mini65.z.optional(
|
|
16533
|
+
import_mini65.z.looseObject({
|
|
16534
|
+
alwaysApply: import_mini65.z.optional(import_mini65.z.boolean()),
|
|
16535
|
+
description: import_mini65.z.optional(import_mini65.z.string()),
|
|
16536
|
+
globs: import_mini65.z.optional(import_mini65.z.array(import_mini65.z.string()))
|
|
16128
16537
|
})
|
|
16129
16538
|
),
|
|
16130
|
-
copilot:
|
|
16131
|
-
|
|
16132
|
-
excludeAgent:
|
|
16539
|
+
copilot: import_mini65.z.optional(
|
|
16540
|
+
import_mini65.z.looseObject({
|
|
16541
|
+
excludeAgent: import_mini65.z.optional(import_mini65.z.union([import_mini65.z.literal("code-review"), import_mini65.z.literal("coding-agent")]))
|
|
16133
16542
|
})
|
|
16134
16543
|
),
|
|
16135
|
-
antigravity:
|
|
16136
|
-
|
|
16137
|
-
trigger:
|
|
16138
|
-
globs:
|
|
16544
|
+
antigravity: import_mini65.z.optional(
|
|
16545
|
+
import_mini65.z.looseObject({
|
|
16546
|
+
trigger: import_mini65.z.optional(import_mini65.z.string()),
|
|
16547
|
+
globs: import_mini65.z.optional(import_mini65.z.array(import_mini65.z.string()))
|
|
16139
16548
|
})
|
|
16140
16549
|
)
|
|
16141
16550
|
});
|
|
@@ -16146,7 +16555,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
16146
16555
|
const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
16147
16556
|
if (!parseResult.success && rest.validate !== false) {
|
|
16148
16557
|
throw new Error(
|
|
16149
|
-
`Invalid frontmatter in ${(0,
|
|
16558
|
+
`Invalid frontmatter in ${(0, import_node_path113.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
16150
16559
|
);
|
|
16151
16560
|
}
|
|
16152
16561
|
const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
|
|
@@ -16181,7 +16590,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
16181
16590
|
return {
|
|
16182
16591
|
success: false,
|
|
16183
16592
|
error: new Error(
|
|
16184
|
-
`Invalid frontmatter in ${(0,
|
|
16593
|
+
`Invalid frontmatter in ${(0, import_node_path113.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
16185
16594
|
)
|
|
16186
16595
|
};
|
|
16187
16596
|
}
|
|
@@ -16190,7 +16599,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
16190
16599
|
relativeFilePath,
|
|
16191
16600
|
validate = true
|
|
16192
16601
|
}) {
|
|
16193
|
-
const filePath = (0,
|
|
16602
|
+
const filePath = (0, import_node_path113.join)(
|
|
16194
16603
|
process.cwd(),
|
|
16195
16604
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
16196
16605
|
relativeFilePath
|
|
@@ -16289,7 +16698,7 @@ var ToolRule = class extends ToolFile {
|
|
|
16289
16698
|
rulesyncRule,
|
|
16290
16699
|
validate = true,
|
|
16291
16700
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
16292
|
-
nonRootPath = { relativeDirPath: (0,
|
|
16701
|
+
nonRootPath = { relativeDirPath: (0, import_node_path114.join)(".agents", "memories") }
|
|
16293
16702
|
}) {
|
|
16294
16703
|
const params = this.buildToolRuleParamsDefault({
|
|
16295
16704
|
baseDir,
|
|
@@ -16300,7 +16709,7 @@ var ToolRule = class extends ToolFile {
|
|
|
16300
16709
|
});
|
|
16301
16710
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
16302
16711
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
16303
|
-
params.relativeDirPath = (0,
|
|
16712
|
+
params.relativeDirPath = (0, import_node_path114.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
16304
16713
|
params.relativeFilePath = "AGENTS.md";
|
|
16305
16714
|
}
|
|
16306
16715
|
return params;
|
|
@@ -16349,7 +16758,7 @@ var ToolRule = class extends ToolFile {
|
|
|
16349
16758
|
}
|
|
16350
16759
|
};
|
|
16351
16760
|
function buildToolPath(toolDir, subDir, excludeToolDir) {
|
|
16352
|
-
return excludeToolDir ? subDir : (0,
|
|
16761
|
+
return excludeToolDir ? subDir : (0, import_node_path114.join)(toolDir, subDir);
|
|
16353
16762
|
}
|
|
16354
16763
|
|
|
16355
16764
|
// src/features/rules/agentsmd-rule.ts
|
|
@@ -16378,8 +16787,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
16378
16787
|
validate = true
|
|
16379
16788
|
}) {
|
|
16380
16789
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
16381
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
16382
|
-
const fileContent = await readFileContent((0,
|
|
16790
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path115.join)(".agents", "memories", relativeFilePath);
|
|
16791
|
+
const fileContent = await readFileContent((0, import_node_path115.join)(baseDir, relativePath));
|
|
16383
16792
|
return new _AgentsMdRule({
|
|
16384
16793
|
baseDir,
|
|
16385
16794
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -16434,21 +16843,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
16434
16843
|
};
|
|
16435
16844
|
|
|
16436
16845
|
// src/features/rules/antigravity-rule.ts
|
|
16437
|
-
var
|
|
16438
|
-
var
|
|
16439
|
-
var AntigravityRuleFrontmatterSchema =
|
|
16440
|
-
trigger:
|
|
16441
|
-
|
|
16442
|
-
|
|
16443
|
-
|
|
16444
|
-
|
|
16445
|
-
|
|
16446
|
-
|
|
16846
|
+
var import_node_path116 = require("path");
|
|
16847
|
+
var import_mini66 = require("zod/mini");
|
|
16848
|
+
var AntigravityRuleFrontmatterSchema = import_mini66.z.looseObject({
|
|
16849
|
+
trigger: import_mini66.z.optional(
|
|
16850
|
+
import_mini66.z.union([
|
|
16851
|
+
import_mini66.z.literal("always_on"),
|
|
16852
|
+
import_mini66.z.literal("glob"),
|
|
16853
|
+
import_mini66.z.literal("manual"),
|
|
16854
|
+
import_mini66.z.literal("model_decision"),
|
|
16855
|
+
import_mini66.z.string()
|
|
16447
16856
|
// accepts any string for forward compatibility
|
|
16448
16857
|
])
|
|
16449
16858
|
),
|
|
16450
|
-
globs:
|
|
16451
|
-
description:
|
|
16859
|
+
globs: import_mini66.z.optional(import_mini66.z.string()),
|
|
16860
|
+
description: import_mini66.z.optional(import_mini66.z.string())
|
|
16452
16861
|
});
|
|
16453
16862
|
function parseGlobsString(globs) {
|
|
16454
16863
|
if (!globs) {
|
|
@@ -16593,7 +17002,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
16593
17002
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
16594
17003
|
if (!result.success) {
|
|
16595
17004
|
throw new Error(
|
|
16596
|
-
`Invalid frontmatter in ${(0,
|
|
17005
|
+
`Invalid frontmatter in ${(0, import_node_path116.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
16597
17006
|
);
|
|
16598
17007
|
}
|
|
16599
17008
|
}
|
|
@@ -16617,7 +17026,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
16617
17026
|
relativeFilePath,
|
|
16618
17027
|
validate = true
|
|
16619
17028
|
}) {
|
|
16620
|
-
const filePath = (0,
|
|
17029
|
+
const filePath = (0, import_node_path116.join)(
|
|
16621
17030
|
baseDir,
|
|
16622
17031
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
16623
17032
|
relativeFilePath
|
|
@@ -16757,7 +17166,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
16757
17166
|
};
|
|
16758
17167
|
|
|
16759
17168
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
16760
|
-
var
|
|
17169
|
+
var import_node_path117 = require("path");
|
|
16761
17170
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
16762
17171
|
toRulesyncRule() {
|
|
16763
17172
|
const rulesyncFrontmatter = {
|
|
@@ -16817,8 +17226,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
16817
17226
|
}) {
|
|
16818
17227
|
const settablePaths = this.getSettablePaths();
|
|
16819
17228
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
16820
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0,
|
|
16821
|
-
const fileContent = await readFileContent((0,
|
|
17229
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path117.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17230
|
+
const fileContent = await readFileContent((0, import_node_path117.join)(baseDir, relativePath));
|
|
16822
17231
|
return new _AugmentcodeLegacyRule({
|
|
16823
17232
|
baseDir,
|
|
16824
17233
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -16847,7 +17256,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
16847
17256
|
};
|
|
16848
17257
|
|
|
16849
17258
|
// src/features/rules/augmentcode-rule.ts
|
|
16850
|
-
var
|
|
17259
|
+
var import_node_path118 = require("path");
|
|
16851
17260
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
16852
17261
|
toRulesyncRule() {
|
|
16853
17262
|
return this.toRulesyncRuleDefault();
|
|
@@ -16878,7 +17287,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
16878
17287
|
relativeFilePath,
|
|
16879
17288
|
validate = true
|
|
16880
17289
|
}) {
|
|
16881
|
-
const filePath = (0,
|
|
17290
|
+
const filePath = (0, import_node_path118.join)(
|
|
16882
17291
|
baseDir,
|
|
16883
17292
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
16884
17293
|
relativeFilePath
|
|
@@ -16918,7 +17327,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
16918
17327
|
};
|
|
16919
17328
|
|
|
16920
17329
|
// src/features/rules/claudecode-legacy-rule.ts
|
|
16921
|
-
var
|
|
17330
|
+
var import_node_path119 = require("path");
|
|
16922
17331
|
var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
16923
17332
|
static getSettablePaths({
|
|
16924
17333
|
global,
|
|
@@ -16960,7 +17369,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
16960
17369
|
if (isRoot) {
|
|
16961
17370
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
16962
17371
|
const fileContent2 = await readFileContent(
|
|
16963
|
-
(0,
|
|
17372
|
+
(0, import_node_path119.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
|
|
16964
17373
|
);
|
|
16965
17374
|
return new _ClaudecodeLegacyRule({
|
|
16966
17375
|
baseDir,
|
|
@@ -16974,8 +17383,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
16974
17383
|
if (!paths.nonRoot) {
|
|
16975
17384
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
16976
17385
|
}
|
|
16977
|
-
const relativePath = (0,
|
|
16978
|
-
const fileContent = await readFileContent((0,
|
|
17386
|
+
const relativePath = (0, import_node_path119.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17387
|
+
const fileContent = await readFileContent((0, import_node_path119.join)(baseDir, relativePath));
|
|
16979
17388
|
return new _ClaudecodeLegacyRule({
|
|
16980
17389
|
baseDir,
|
|
16981
17390
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -17034,10 +17443,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
17034
17443
|
};
|
|
17035
17444
|
|
|
17036
17445
|
// src/features/rules/claudecode-rule.ts
|
|
17037
|
-
var
|
|
17038
|
-
var
|
|
17039
|
-
var ClaudecodeRuleFrontmatterSchema =
|
|
17040
|
-
paths:
|
|
17446
|
+
var import_node_path120 = require("path");
|
|
17447
|
+
var import_mini67 = require("zod/mini");
|
|
17448
|
+
var ClaudecodeRuleFrontmatterSchema = import_mini67.z.object({
|
|
17449
|
+
paths: import_mini67.z.optional(import_mini67.z.array(import_mini67.z.string()))
|
|
17041
17450
|
});
|
|
17042
17451
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
17043
17452
|
frontmatter;
|
|
@@ -17075,7 +17484,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
17075
17484
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
17076
17485
|
if (!result.success) {
|
|
17077
17486
|
throw new Error(
|
|
17078
|
-
`Invalid frontmatter in ${(0,
|
|
17487
|
+
`Invalid frontmatter in ${(0, import_node_path120.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
17079
17488
|
);
|
|
17080
17489
|
}
|
|
17081
17490
|
}
|
|
@@ -17105,7 +17514,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
17105
17514
|
if (isRoot) {
|
|
17106
17515
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
17107
17516
|
const fileContent2 = await readFileContent(
|
|
17108
|
-
(0,
|
|
17517
|
+
(0, import_node_path120.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
|
|
17109
17518
|
);
|
|
17110
17519
|
return new _ClaudecodeRule({
|
|
17111
17520
|
baseDir,
|
|
@@ -17120,8 +17529,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
17120
17529
|
if (!paths.nonRoot) {
|
|
17121
17530
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
17122
17531
|
}
|
|
17123
|
-
const relativePath = (0,
|
|
17124
|
-
const filePath = (0,
|
|
17532
|
+
const relativePath = (0, import_node_path120.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17533
|
+
const filePath = (0, import_node_path120.join)(baseDir, relativePath);
|
|
17125
17534
|
const fileContent = await readFileContent(filePath);
|
|
17126
17535
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
17127
17536
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -17232,7 +17641,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
17232
17641
|
return {
|
|
17233
17642
|
success: false,
|
|
17234
17643
|
error: new Error(
|
|
17235
|
-
`Invalid frontmatter in ${(0,
|
|
17644
|
+
`Invalid frontmatter in ${(0, import_node_path120.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
17236
17645
|
)
|
|
17237
17646
|
};
|
|
17238
17647
|
}
|
|
@@ -17252,10 +17661,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
17252
17661
|
};
|
|
17253
17662
|
|
|
17254
17663
|
// src/features/rules/cline-rule.ts
|
|
17255
|
-
var
|
|
17256
|
-
var
|
|
17257
|
-
var ClineRuleFrontmatterSchema =
|
|
17258
|
-
description:
|
|
17664
|
+
var import_node_path121 = require("path");
|
|
17665
|
+
var import_mini68 = require("zod/mini");
|
|
17666
|
+
var ClineRuleFrontmatterSchema = import_mini68.z.object({
|
|
17667
|
+
description: import_mini68.z.string()
|
|
17259
17668
|
});
|
|
17260
17669
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
17261
17670
|
static getSettablePaths(_options = {}) {
|
|
@@ -17298,7 +17707,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
17298
17707
|
validate = true
|
|
17299
17708
|
}) {
|
|
17300
17709
|
const fileContent = await readFileContent(
|
|
17301
|
-
(0,
|
|
17710
|
+
(0, import_node_path121.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
17302
17711
|
);
|
|
17303
17712
|
return new _ClineRule({
|
|
17304
17713
|
baseDir,
|
|
@@ -17324,7 +17733,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
17324
17733
|
};
|
|
17325
17734
|
|
|
17326
17735
|
// src/features/rules/codexcli-rule.ts
|
|
17327
|
-
var
|
|
17736
|
+
var import_node_path122 = require("path");
|
|
17328
17737
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
17329
17738
|
static getSettablePaths({
|
|
17330
17739
|
global,
|
|
@@ -17359,7 +17768,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
17359
17768
|
if (isRoot) {
|
|
17360
17769
|
const relativePath2 = paths.root.relativeFilePath;
|
|
17361
17770
|
const fileContent2 = await readFileContent(
|
|
17362
|
-
(0,
|
|
17771
|
+
(0, import_node_path122.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
17363
17772
|
);
|
|
17364
17773
|
return new _CodexcliRule({
|
|
17365
17774
|
baseDir,
|
|
@@ -17373,8 +17782,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
17373
17782
|
if (!paths.nonRoot) {
|
|
17374
17783
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
17375
17784
|
}
|
|
17376
|
-
const relativePath = (0,
|
|
17377
|
-
const fileContent = await readFileContent((0,
|
|
17785
|
+
const relativePath = (0, import_node_path122.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17786
|
+
const fileContent = await readFileContent((0, import_node_path122.join)(baseDir, relativePath));
|
|
17378
17787
|
return new _CodexcliRule({
|
|
17379
17788
|
baseDir,
|
|
17380
17789
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -17433,12 +17842,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
17433
17842
|
};
|
|
17434
17843
|
|
|
17435
17844
|
// src/features/rules/copilot-rule.ts
|
|
17436
|
-
var
|
|
17437
|
-
var
|
|
17438
|
-
var CopilotRuleFrontmatterSchema =
|
|
17439
|
-
description:
|
|
17440
|
-
applyTo:
|
|
17441
|
-
excludeAgent:
|
|
17845
|
+
var import_node_path123 = require("path");
|
|
17846
|
+
var import_mini69 = require("zod/mini");
|
|
17847
|
+
var CopilotRuleFrontmatterSchema = import_mini69.z.object({
|
|
17848
|
+
description: import_mini69.z.optional(import_mini69.z.string()),
|
|
17849
|
+
applyTo: import_mini69.z.optional(import_mini69.z.string()),
|
|
17850
|
+
excludeAgent: import_mini69.z.optional(import_mini69.z.union([import_mini69.z.literal("code-review"), import_mini69.z.literal("coding-agent")]))
|
|
17442
17851
|
});
|
|
17443
17852
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
17444
17853
|
frontmatter;
|
|
@@ -17470,7 +17879,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
17470
17879
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
17471
17880
|
if (!result.success) {
|
|
17472
17881
|
throw new Error(
|
|
17473
|
-
`Invalid frontmatter in ${(0,
|
|
17882
|
+
`Invalid frontmatter in ${(0, import_node_path123.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
17474
17883
|
);
|
|
17475
17884
|
}
|
|
17476
17885
|
}
|
|
@@ -17560,8 +17969,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
17560
17969
|
const paths = this.getSettablePaths({ global });
|
|
17561
17970
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
17562
17971
|
if (isRoot) {
|
|
17563
|
-
const relativePath2 = (0,
|
|
17564
|
-
const filePath2 = (0,
|
|
17972
|
+
const relativePath2 = (0, import_node_path123.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
17973
|
+
const filePath2 = (0, import_node_path123.join)(baseDir, relativePath2);
|
|
17565
17974
|
const fileContent2 = await readFileContent(filePath2);
|
|
17566
17975
|
return new _CopilotRule({
|
|
17567
17976
|
baseDir,
|
|
@@ -17576,8 +17985,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
17576
17985
|
if (!paths.nonRoot) {
|
|
17577
17986
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
17578
17987
|
}
|
|
17579
|
-
const relativePath = (0,
|
|
17580
|
-
const filePath = (0,
|
|
17988
|
+
const relativePath = (0, import_node_path123.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17989
|
+
const filePath = (0, import_node_path123.join)(baseDir, relativePath);
|
|
17581
17990
|
const fileContent = await readFileContent(filePath);
|
|
17582
17991
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
17583
17992
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -17623,7 +18032,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
17623
18032
|
return {
|
|
17624
18033
|
success: false,
|
|
17625
18034
|
error: new Error(
|
|
17626
|
-
`Invalid frontmatter in ${(0,
|
|
18035
|
+
`Invalid frontmatter in ${(0, import_node_path123.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
17627
18036
|
)
|
|
17628
18037
|
};
|
|
17629
18038
|
}
|
|
@@ -17679,12 +18088,12 @@ var CopilotcliRule = class _CopilotcliRule extends CopilotRule {
|
|
|
17679
18088
|
};
|
|
17680
18089
|
|
|
17681
18090
|
// src/features/rules/cursor-rule.ts
|
|
17682
|
-
var
|
|
17683
|
-
var
|
|
17684
|
-
var CursorRuleFrontmatterSchema =
|
|
17685
|
-
description:
|
|
17686
|
-
globs:
|
|
17687
|
-
alwaysApply:
|
|
18091
|
+
var import_node_path124 = require("path");
|
|
18092
|
+
var import_mini70 = require("zod/mini");
|
|
18093
|
+
var CursorRuleFrontmatterSchema = import_mini70.z.object({
|
|
18094
|
+
description: import_mini70.z.optional(import_mini70.z.string()),
|
|
18095
|
+
globs: import_mini70.z.optional(import_mini70.z.string()),
|
|
18096
|
+
alwaysApply: import_mini70.z.optional(import_mini70.z.boolean())
|
|
17688
18097
|
});
|
|
17689
18098
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
17690
18099
|
frontmatter;
|
|
@@ -17701,7 +18110,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
17701
18110
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
17702
18111
|
if (!result.success) {
|
|
17703
18112
|
throw new Error(
|
|
17704
|
-
`Invalid frontmatter in ${(0,
|
|
18113
|
+
`Invalid frontmatter in ${(0, import_node_path124.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
17705
18114
|
);
|
|
17706
18115
|
}
|
|
17707
18116
|
}
|
|
@@ -17817,7 +18226,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
17817
18226
|
relativeFilePath,
|
|
17818
18227
|
validate = true
|
|
17819
18228
|
}) {
|
|
17820
|
-
const filePath = (0,
|
|
18229
|
+
const filePath = (0, import_node_path124.join)(
|
|
17821
18230
|
baseDir,
|
|
17822
18231
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
17823
18232
|
relativeFilePath
|
|
@@ -17827,7 +18236,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
17827
18236
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
17828
18237
|
if (!result.success) {
|
|
17829
18238
|
throw new Error(
|
|
17830
|
-
`Invalid frontmatter in ${(0,
|
|
18239
|
+
`Invalid frontmatter in ${(0, import_node_path124.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
17831
18240
|
);
|
|
17832
18241
|
}
|
|
17833
18242
|
return new _CursorRule({
|
|
@@ -17864,7 +18273,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
17864
18273
|
return {
|
|
17865
18274
|
success: false,
|
|
17866
18275
|
error: new Error(
|
|
17867
|
-
`Invalid frontmatter in ${(0,
|
|
18276
|
+
`Invalid frontmatter in ${(0, import_node_path124.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
17868
18277
|
)
|
|
17869
18278
|
};
|
|
17870
18279
|
}
|
|
@@ -17884,7 +18293,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
17884
18293
|
};
|
|
17885
18294
|
|
|
17886
18295
|
// src/features/rules/deepagents-rule.ts
|
|
17887
|
-
var
|
|
18296
|
+
var import_node_path125 = require("path");
|
|
17888
18297
|
var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
17889
18298
|
constructor({ fileContent, root, ...rest }) {
|
|
17890
18299
|
super({
|
|
@@ -17911,8 +18320,8 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
17911
18320
|
}) {
|
|
17912
18321
|
const settablePaths = this.getSettablePaths();
|
|
17913
18322
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
17914
|
-
const relativePath = isRoot ? (0,
|
|
17915
|
-
const fileContent = await readFileContent((0,
|
|
18323
|
+
const relativePath = isRoot ? (0, import_node_path125.join)(".deepagents", "AGENTS.md") : (0, import_node_path125.join)(".deepagents", "memories", relativeFilePath);
|
|
18324
|
+
const fileContent = await readFileContent((0, import_node_path125.join)(baseDir, relativePath));
|
|
17916
18325
|
return new _DeepagentsRule({
|
|
17917
18326
|
baseDir,
|
|
17918
18327
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -17967,7 +18376,7 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
17967
18376
|
};
|
|
17968
18377
|
|
|
17969
18378
|
// src/features/rules/factorydroid-rule.ts
|
|
17970
|
-
var
|
|
18379
|
+
var import_node_path126 = require("path");
|
|
17971
18380
|
var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
17972
18381
|
constructor({ fileContent, root, ...rest }) {
|
|
17973
18382
|
super({
|
|
@@ -18007,8 +18416,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
18007
18416
|
const paths = this.getSettablePaths({ global });
|
|
18008
18417
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
18009
18418
|
if (isRoot) {
|
|
18010
|
-
const relativePath2 = (0,
|
|
18011
|
-
const fileContent2 = await readFileContent((0,
|
|
18419
|
+
const relativePath2 = (0, import_node_path126.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
18420
|
+
const fileContent2 = await readFileContent((0, import_node_path126.join)(baseDir, relativePath2));
|
|
18012
18421
|
return new _FactorydroidRule({
|
|
18013
18422
|
baseDir,
|
|
18014
18423
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -18021,8 +18430,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
18021
18430
|
if (!paths.nonRoot) {
|
|
18022
18431
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18023
18432
|
}
|
|
18024
|
-
const relativePath = (0,
|
|
18025
|
-
const fileContent = await readFileContent((0,
|
|
18433
|
+
const relativePath = (0, import_node_path126.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18434
|
+
const fileContent = await readFileContent((0, import_node_path126.join)(baseDir, relativePath));
|
|
18026
18435
|
return new _FactorydroidRule({
|
|
18027
18436
|
baseDir,
|
|
18028
18437
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18081,7 +18490,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
18081
18490
|
};
|
|
18082
18491
|
|
|
18083
18492
|
// src/features/rules/geminicli-rule.ts
|
|
18084
|
-
var
|
|
18493
|
+
var import_node_path127 = require("path");
|
|
18085
18494
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
18086
18495
|
static getSettablePaths({
|
|
18087
18496
|
global,
|
|
@@ -18116,7 +18525,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
18116
18525
|
if (isRoot) {
|
|
18117
18526
|
const relativePath2 = paths.root.relativeFilePath;
|
|
18118
18527
|
const fileContent2 = await readFileContent(
|
|
18119
|
-
(0,
|
|
18528
|
+
(0, import_node_path127.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
18120
18529
|
);
|
|
18121
18530
|
return new _GeminiCliRule({
|
|
18122
18531
|
baseDir,
|
|
@@ -18130,8 +18539,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
18130
18539
|
if (!paths.nonRoot) {
|
|
18131
18540
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18132
18541
|
}
|
|
18133
|
-
const relativePath = (0,
|
|
18134
|
-
const fileContent = await readFileContent((0,
|
|
18542
|
+
const relativePath = (0, import_node_path127.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18543
|
+
const fileContent = await readFileContent((0, import_node_path127.join)(baseDir, relativePath));
|
|
18135
18544
|
return new _GeminiCliRule({
|
|
18136
18545
|
baseDir,
|
|
18137
18546
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18190,7 +18599,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
18190
18599
|
};
|
|
18191
18600
|
|
|
18192
18601
|
// src/features/rules/goose-rule.ts
|
|
18193
|
-
var
|
|
18602
|
+
var import_node_path128 = require("path");
|
|
18194
18603
|
var GooseRule = class _GooseRule extends ToolRule {
|
|
18195
18604
|
static getSettablePaths({
|
|
18196
18605
|
global,
|
|
@@ -18225,7 +18634,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
18225
18634
|
if (isRoot) {
|
|
18226
18635
|
const relativePath2 = paths.root.relativeFilePath;
|
|
18227
18636
|
const fileContent2 = await readFileContent(
|
|
18228
|
-
(0,
|
|
18637
|
+
(0, import_node_path128.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
18229
18638
|
);
|
|
18230
18639
|
return new _GooseRule({
|
|
18231
18640
|
baseDir,
|
|
@@ -18239,8 +18648,8 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
18239
18648
|
if (!paths.nonRoot) {
|
|
18240
18649
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18241
18650
|
}
|
|
18242
|
-
const relativePath = (0,
|
|
18243
|
-
const fileContent = await readFileContent((0,
|
|
18651
|
+
const relativePath = (0, import_node_path128.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18652
|
+
const fileContent = await readFileContent((0, import_node_path128.join)(baseDir, relativePath));
|
|
18244
18653
|
return new _GooseRule({
|
|
18245
18654
|
baseDir,
|
|
18246
18655
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18299,7 +18708,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
18299
18708
|
};
|
|
18300
18709
|
|
|
18301
18710
|
// src/features/rules/junie-rule.ts
|
|
18302
|
-
var
|
|
18711
|
+
var import_node_path129 = require("path");
|
|
18303
18712
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
18304
18713
|
static getSettablePaths(_options = {}) {
|
|
18305
18714
|
return {
|
|
@@ -18328,8 +18737,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
18328
18737
|
}) {
|
|
18329
18738
|
const isRoot = _JunieRule.isRootRelativeFilePath(relativeFilePath);
|
|
18330
18739
|
const settablePaths = this.getSettablePaths();
|
|
18331
|
-
const relativePath = isRoot ? (0,
|
|
18332
|
-
const fileContent = await readFileContent((0,
|
|
18740
|
+
const relativePath = isRoot ? (0, import_node_path129.join)(settablePaths.root.relativeDirPath, settablePaths.root.relativeFilePath) : (0, import_node_path129.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18741
|
+
const fileContent = await readFileContent((0, import_node_path129.join)(baseDir, relativePath));
|
|
18333
18742
|
return new _JunieRule({
|
|
18334
18743
|
baseDir,
|
|
18335
18744
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -18384,7 +18793,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
18384
18793
|
};
|
|
18385
18794
|
|
|
18386
18795
|
// src/features/rules/kilo-rule.ts
|
|
18387
|
-
var
|
|
18796
|
+
var import_node_path130 = require("path");
|
|
18388
18797
|
var KiloRule = class _KiloRule extends ToolRule {
|
|
18389
18798
|
static getSettablePaths({
|
|
18390
18799
|
global,
|
|
@@ -18419,7 +18828,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
18419
18828
|
if (isRoot) {
|
|
18420
18829
|
const relativePath2 = paths.root.relativeFilePath;
|
|
18421
18830
|
const fileContent2 = await readFileContent(
|
|
18422
|
-
(0,
|
|
18831
|
+
(0, import_node_path130.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
18423
18832
|
);
|
|
18424
18833
|
return new _KiloRule({
|
|
18425
18834
|
baseDir,
|
|
@@ -18433,8 +18842,8 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
18433
18842
|
if (!paths.nonRoot) {
|
|
18434
18843
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18435
18844
|
}
|
|
18436
|
-
const relativePath = (0,
|
|
18437
|
-
const fileContent = await readFileContent((0,
|
|
18845
|
+
const relativePath = (0, import_node_path130.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18846
|
+
const fileContent = await readFileContent((0, import_node_path130.join)(baseDir, relativePath));
|
|
18438
18847
|
return new _KiloRule({
|
|
18439
18848
|
baseDir,
|
|
18440
18849
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18493,7 +18902,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
18493
18902
|
};
|
|
18494
18903
|
|
|
18495
18904
|
// src/features/rules/kiro-rule.ts
|
|
18496
|
-
var
|
|
18905
|
+
var import_node_path131 = require("path");
|
|
18497
18906
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
18498
18907
|
static getSettablePaths(_options = {}) {
|
|
18499
18908
|
return {
|
|
@@ -18508,7 +18917,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
18508
18917
|
validate = true
|
|
18509
18918
|
}) {
|
|
18510
18919
|
const fileContent = await readFileContent(
|
|
18511
|
-
(0,
|
|
18920
|
+
(0, import_node_path131.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
18512
18921
|
);
|
|
18513
18922
|
return new _KiroRule({
|
|
18514
18923
|
baseDir,
|
|
@@ -18562,7 +18971,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
18562
18971
|
};
|
|
18563
18972
|
|
|
18564
18973
|
// src/features/rules/opencode-rule.ts
|
|
18565
|
-
var
|
|
18974
|
+
var import_node_path132 = require("path");
|
|
18566
18975
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
18567
18976
|
static getSettablePaths({
|
|
18568
18977
|
global,
|
|
@@ -18597,7 +19006,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
18597
19006
|
if (isRoot) {
|
|
18598
19007
|
const relativePath2 = paths.root.relativeFilePath;
|
|
18599
19008
|
const fileContent2 = await readFileContent(
|
|
18600
|
-
(0,
|
|
19009
|
+
(0, import_node_path132.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
18601
19010
|
);
|
|
18602
19011
|
return new _OpenCodeRule({
|
|
18603
19012
|
baseDir,
|
|
@@ -18611,8 +19020,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
18611
19020
|
if (!paths.nonRoot) {
|
|
18612
19021
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18613
19022
|
}
|
|
18614
|
-
const relativePath = (0,
|
|
18615
|
-
const fileContent = await readFileContent((0,
|
|
19023
|
+
const relativePath = (0, import_node_path132.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
19024
|
+
const fileContent = await readFileContent((0, import_node_path132.join)(baseDir, relativePath));
|
|
18616
19025
|
return new _OpenCodeRule({
|
|
18617
19026
|
baseDir,
|
|
18618
19027
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18671,7 +19080,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
18671
19080
|
};
|
|
18672
19081
|
|
|
18673
19082
|
// src/features/rules/qwencode-rule.ts
|
|
18674
|
-
var
|
|
19083
|
+
var import_node_path133 = require("path");
|
|
18675
19084
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
18676
19085
|
static getSettablePaths(_options = {}) {
|
|
18677
19086
|
return {
|
|
@@ -18690,8 +19099,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
18690
19099
|
validate = true
|
|
18691
19100
|
}) {
|
|
18692
19101
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
18693
|
-
const relativePath = isRoot ? "QWEN.md" : (0,
|
|
18694
|
-
const fileContent = await readFileContent((0,
|
|
19102
|
+
const relativePath = isRoot ? "QWEN.md" : (0, import_node_path133.join)(".qwen", "memories", relativeFilePath);
|
|
19103
|
+
const fileContent = await readFileContent((0, import_node_path133.join)(baseDir, relativePath));
|
|
18695
19104
|
return new _QwencodeRule({
|
|
18696
19105
|
baseDir,
|
|
18697
19106
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -18743,7 +19152,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
18743
19152
|
};
|
|
18744
19153
|
|
|
18745
19154
|
// src/features/rules/replit-rule.ts
|
|
18746
|
-
var
|
|
19155
|
+
var import_node_path134 = require("path");
|
|
18747
19156
|
var ReplitRule = class _ReplitRule extends ToolRule {
|
|
18748
19157
|
static getSettablePaths(_options = {}) {
|
|
18749
19158
|
return {
|
|
@@ -18765,7 +19174,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
18765
19174
|
}
|
|
18766
19175
|
const relativePath = paths.root.relativeFilePath;
|
|
18767
19176
|
const fileContent = await readFileContent(
|
|
18768
|
-
(0,
|
|
19177
|
+
(0, import_node_path134.join)(baseDir, paths.root.relativeDirPath, relativePath)
|
|
18769
19178
|
);
|
|
18770
19179
|
return new _ReplitRule({
|
|
18771
19180
|
baseDir,
|
|
@@ -18831,7 +19240,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
18831
19240
|
};
|
|
18832
19241
|
|
|
18833
19242
|
// src/features/rules/roo-rule.ts
|
|
18834
|
-
var
|
|
19243
|
+
var import_node_path135 = require("path");
|
|
18835
19244
|
var RooRule = class _RooRule extends ToolRule {
|
|
18836
19245
|
static getSettablePaths(_options = {}) {
|
|
18837
19246
|
return {
|
|
@@ -18846,7 +19255,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
18846
19255
|
validate = true
|
|
18847
19256
|
}) {
|
|
18848
19257
|
const fileContent = await readFileContent(
|
|
18849
|
-
(0,
|
|
19258
|
+
(0, import_node_path135.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
18850
19259
|
);
|
|
18851
19260
|
return new _RooRule({
|
|
18852
19261
|
baseDir,
|
|
@@ -18915,7 +19324,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
18915
19324
|
};
|
|
18916
19325
|
|
|
18917
19326
|
// src/features/rules/rovodev-rule.ts
|
|
18918
|
-
var
|
|
19327
|
+
var import_node_path136 = require("path");
|
|
18919
19328
|
var DISALLOWED_ROVODEV_MODULAR_RULE_BASENAMES = /* @__PURE__ */ new Set(["agents.md", "agents.local.md"]);
|
|
18920
19329
|
var RovodevRule = class _RovodevRule extends ToolRule {
|
|
18921
19330
|
/**
|
|
@@ -18959,7 +19368,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
18959
19368
|
root: rovodevAgents,
|
|
18960
19369
|
alternativeRoots: [{ relativeDirPath: ".", relativeFilePath: "AGENTS.md" }],
|
|
18961
19370
|
nonRoot: {
|
|
18962
|
-
relativeDirPath: (0,
|
|
19371
|
+
relativeDirPath: (0, import_node_path136.join)(".rovodev", ".rulesync", "modular-rules")
|
|
18963
19372
|
}
|
|
18964
19373
|
};
|
|
18965
19374
|
}
|
|
@@ -18998,10 +19407,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
18998
19407
|
}) {
|
|
18999
19408
|
if (!this.isAllowedModularRulesRelativePath(relativeFilePath)) {
|
|
19000
19409
|
throw new Error(
|
|
19001
|
-
`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${(0,
|
|
19410
|
+
`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${(0, import_node_path136.join)(relativeDirPath, relativeFilePath)}`
|
|
19002
19411
|
);
|
|
19003
19412
|
}
|
|
19004
|
-
const fileContent = await readFileContent((0,
|
|
19413
|
+
const fileContent = await readFileContent((0, import_node_path136.join)(baseDir, relativeDirPath, relativeFilePath));
|
|
19005
19414
|
return new _RovodevRule({
|
|
19006
19415
|
baseDir,
|
|
19007
19416
|
relativeDirPath,
|
|
@@ -19021,10 +19430,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
19021
19430
|
paths
|
|
19022
19431
|
}) {
|
|
19023
19432
|
const relativeDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
19024
|
-
const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${(0,
|
|
19433
|
+
const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${(0, import_node_path136.join)(paths.root.relativeDirPath, paths.root.relativeFilePath)} or project root` : (0, import_node_path136.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
19025
19434
|
if (relativeFilePath !== "AGENTS.md") {
|
|
19026
19435
|
throw new Error(
|
|
19027
|
-
`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${(0,
|
|
19436
|
+
`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${(0, import_node_path136.join)(relativeDirPath, relativeFilePath)}`
|
|
19028
19437
|
);
|
|
19029
19438
|
}
|
|
19030
19439
|
const allowed = relativeDirPath === paths.root.relativeDirPath || "alternativeRoots" in paths && paths.alternativeRoots?.some(
|
|
@@ -19032,10 +19441,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
19032
19441
|
);
|
|
19033
19442
|
if (!allowed) {
|
|
19034
19443
|
throw new Error(
|
|
19035
|
-
`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${(0,
|
|
19444
|
+
`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${(0, import_node_path136.join)(relativeDirPath, relativeFilePath)}`
|
|
19036
19445
|
);
|
|
19037
19446
|
}
|
|
19038
|
-
const fileContent = await readFileContent((0,
|
|
19447
|
+
const fileContent = await readFileContent((0, import_node_path136.join)(baseDir, relativeDirPath, relativeFilePath));
|
|
19039
19448
|
return new _RovodevRule({
|
|
19040
19449
|
baseDir,
|
|
19041
19450
|
relativeDirPath,
|
|
@@ -19149,7 +19558,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
19149
19558
|
};
|
|
19150
19559
|
|
|
19151
19560
|
// src/features/rules/warp-rule.ts
|
|
19152
|
-
var
|
|
19561
|
+
var import_node_path137 = require("path");
|
|
19153
19562
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
19154
19563
|
constructor({ fileContent, root, ...rest }) {
|
|
19155
19564
|
super({
|
|
@@ -19175,8 +19584,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
19175
19584
|
validate = true
|
|
19176
19585
|
}) {
|
|
19177
19586
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
19178
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0,
|
|
19179
|
-
const fileContent = await readFileContent((0,
|
|
19587
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path137.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
19588
|
+
const fileContent = await readFileContent((0, import_node_path137.join)(baseDir, relativePath));
|
|
19180
19589
|
return new _WarpRule({
|
|
19181
19590
|
baseDir,
|
|
19182
19591
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -19231,7 +19640,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
19231
19640
|
};
|
|
19232
19641
|
|
|
19233
19642
|
// src/features/rules/windsurf-rule.ts
|
|
19234
|
-
var
|
|
19643
|
+
var import_node_path138 = require("path");
|
|
19235
19644
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
19236
19645
|
static getSettablePaths(_options = {}) {
|
|
19237
19646
|
return {
|
|
@@ -19246,7 +19655,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
19246
19655
|
validate = true
|
|
19247
19656
|
}) {
|
|
19248
19657
|
const fileContent = await readFileContent(
|
|
19249
|
-
(0,
|
|
19658
|
+
(0, import_node_path138.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
19250
19659
|
);
|
|
19251
19660
|
return new _WindsurfRule({
|
|
19252
19661
|
baseDir,
|
|
@@ -19344,11 +19753,11 @@ var rulesProcessorToolTargets = [
|
|
|
19344
19753
|
"warp",
|
|
19345
19754
|
"windsurf"
|
|
19346
19755
|
];
|
|
19347
|
-
var RulesProcessorToolTargetSchema =
|
|
19348
|
-
var formatRulePaths = (rules) => rules.map((r) => (0,
|
|
19349
|
-
var RulesFeatureOptionsSchema =
|
|
19350
|
-
ruleDiscoveryMode:
|
|
19351
|
-
includeLocalRoot:
|
|
19756
|
+
var RulesProcessorToolTargetSchema = import_mini71.z.enum(rulesProcessorToolTargets);
|
|
19757
|
+
var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path139.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
|
|
19758
|
+
var RulesFeatureOptionsSchema = import_mini71.z.looseObject({
|
|
19759
|
+
ruleDiscoveryMode: import_mini71.z.optional(import_mini71.z.enum(["none", "explicit"])),
|
|
19760
|
+
includeLocalRoot: import_mini71.z.optional(import_mini71.z.boolean())
|
|
19352
19761
|
});
|
|
19353
19762
|
var resolveRuleDiscoveryMode = ({
|
|
19354
19763
|
defaultMode,
|
|
@@ -19369,8 +19778,8 @@ var resolveRuleDiscoveryMode = ({
|
|
|
19369
19778
|
}
|
|
19370
19779
|
return parsed.data.ruleDiscoveryMode === "none" ? "auto" : "toon";
|
|
19371
19780
|
};
|
|
19372
|
-
var IncludeLocalRootSchema =
|
|
19373
|
-
includeLocalRoot:
|
|
19781
|
+
var IncludeLocalRootSchema = import_mini71.z.looseObject({
|
|
19782
|
+
includeLocalRoot: import_mini71.z.optional(import_mini71.z.boolean())
|
|
19374
19783
|
});
|
|
19375
19784
|
var resolveIncludeLocalRoot = (options) => {
|
|
19376
19785
|
if (!options) return true;
|
|
@@ -19813,7 +20222,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
19813
20222
|
}).relativeDirPath;
|
|
19814
20223
|
return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
|
|
19815
20224
|
const frontmatter = skill.getFrontmatter();
|
|
19816
|
-
const relativePath = (0,
|
|
20225
|
+
const relativePath = (0, import_node_path139.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
|
|
19817
20226
|
return {
|
|
19818
20227
|
name: frontmatter.name,
|
|
19819
20228
|
description: frontmatter.description,
|
|
@@ -19942,12 +20351,12 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
19942
20351
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
19943
20352
|
*/
|
|
19944
20353
|
async loadRulesyncFiles() {
|
|
19945
|
-
const rulesyncBaseDir = (0,
|
|
19946
|
-
const files = await findFilesByGlobs((0,
|
|
20354
|
+
const rulesyncBaseDir = (0, import_node_path139.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
20355
|
+
const files = await findFilesByGlobs((0, import_node_path139.join)(rulesyncBaseDir, "**", "*.md"));
|
|
19947
20356
|
this.logger.debug(`Found ${files.length} rulesync files`);
|
|
19948
20357
|
const rulesyncRules = await Promise.all(
|
|
19949
20358
|
files.map((file) => {
|
|
19950
|
-
const relativeFilePath = (0,
|
|
20359
|
+
const relativeFilePath = (0, import_node_path139.relative)(rulesyncBaseDir, file);
|
|
19951
20360
|
checkPathTraversal({
|
|
19952
20361
|
relativePath: relativeFilePath,
|
|
19953
20362
|
intendedRootDir: rulesyncBaseDir
|
|
@@ -20022,7 +20431,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20022
20431
|
global: this.global
|
|
20023
20432
|
});
|
|
20024
20433
|
const resolveRelativeDirPath = (filePath) => {
|
|
20025
|
-
const dirName = (0,
|
|
20434
|
+
const dirName = (0, import_node_path139.dirname)((0, import_node_path139.relative)(this.baseDir, filePath));
|
|
20026
20435
|
return dirName === "" ? "." : dirName;
|
|
20027
20436
|
};
|
|
20028
20437
|
const buildDeletionRulesFromPaths = (filePaths, opts) => {
|
|
@@ -20030,7 +20439,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20030
20439
|
const effectiveBaseDir = isNonRoot ? opts.baseDirOverride : this.baseDir;
|
|
20031
20440
|
return filePaths.map((filePath) => {
|
|
20032
20441
|
const relativeDirPath = isNonRoot ? opts.relativeDirPathOverride : resolveRelativeDirPath(filePath);
|
|
20033
|
-
const relativeFilePath = isNonRoot ? (0,
|
|
20442
|
+
const relativeFilePath = isNonRoot ? (0, import_node_path139.relative)(effectiveBaseDir, filePath) : (0, import_node_path139.basename)(filePath);
|
|
20034
20443
|
checkPathTraversal({
|
|
20035
20444
|
relativePath: isNonRoot ? relativeFilePath : relativeDirPath,
|
|
20036
20445
|
intendedRootDir: effectiveBaseDir
|
|
@@ -20058,13 +20467,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20058
20467
|
return [];
|
|
20059
20468
|
}
|
|
20060
20469
|
const uniqueRootFilePaths = await findFilesWithFallback(
|
|
20061
|
-
(0,
|
|
20470
|
+
(0, import_node_path139.join)(
|
|
20062
20471
|
this.baseDir,
|
|
20063
20472
|
settablePaths.root.relativeDirPath ?? ".",
|
|
20064
20473
|
settablePaths.root.relativeFilePath
|
|
20065
20474
|
),
|
|
20066
20475
|
settablePaths.alternativeRoots,
|
|
20067
|
-
(alt) => (0,
|
|
20476
|
+
(alt) => (0, import_node_path139.join)(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
|
|
20068
20477
|
);
|
|
20069
20478
|
if (forDeletion) {
|
|
20070
20479
|
return buildDeletionRulesFromPaths(uniqueRootFilePaths);
|
|
@@ -20078,7 +20487,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20078
20487
|
});
|
|
20079
20488
|
return factory.class.fromFile({
|
|
20080
20489
|
baseDir: this.baseDir,
|
|
20081
|
-
relativeFilePath: (0,
|
|
20490
|
+
relativeFilePath: (0, import_node_path139.basename)(filePath),
|
|
20082
20491
|
relativeDirPath,
|
|
20083
20492
|
global: this.global
|
|
20084
20493
|
});
|
|
@@ -20095,7 +20504,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20095
20504
|
return [];
|
|
20096
20505
|
}
|
|
20097
20506
|
const uniqueLocalRootFilePaths2 = await findFilesByGlobs(
|
|
20098
|
-
(0,
|
|
20507
|
+
(0, import_node_path139.join)(this.baseDir, "AGENTS.local.md")
|
|
20099
20508
|
);
|
|
20100
20509
|
return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths2);
|
|
20101
20510
|
}
|
|
@@ -20106,9 +20515,9 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20106
20515
|
return [];
|
|
20107
20516
|
}
|
|
20108
20517
|
const uniqueLocalRootFilePaths = await findFilesWithFallback(
|
|
20109
|
-
(0,
|
|
20518
|
+
(0, import_node_path139.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
|
|
20110
20519
|
settablePaths.alternativeRoots,
|
|
20111
|
-
(alt) => (0,
|
|
20520
|
+
(alt) => (0, import_node_path139.join)(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
|
|
20112
20521
|
);
|
|
20113
20522
|
return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths);
|
|
20114
20523
|
})();
|
|
@@ -20119,20 +20528,20 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20119
20528
|
if (!forDeletion || this.toolTarget !== "rovodev" || this.global) {
|
|
20120
20529
|
return [];
|
|
20121
20530
|
}
|
|
20122
|
-
const primaryPaths = await findFilesByGlobs((0,
|
|
20531
|
+
const primaryPaths = await findFilesByGlobs((0, import_node_path139.join)(this.baseDir, ".rovodev", "AGENTS.md"));
|
|
20123
20532
|
if (primaryPaths.length === 0) {
|
|
20124
20533
|
return [];
|
|
20125
20534
|
}
|
|
20126
|
-
const mirrorPaths = await findFilesByGlobs((0,
|
|
20535
|
+
const mirrorPaths = await findFilesByGlobs((0, import_node_path139.join)(this.baseDir, "AGENTS.md"));
|
|
20127
20536
|
return buildDeletionRulesFromPaths(mirrorPaths);
|
|
20128
20537
|
})();
|
|
20129
20538
|
const nonRootToolRules = await (async () => {
|
|
20130
20539
|
if (!settablePaths.nonRoot) {
|
|
20131
20540
|
return [];
|
|
20132
20541
|
}
|
|
20133
|
-
const nonRootBaseDir = (0,
|
|
20542
|
+
const nonRootBaseDir = (0, import_node_path139.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
|
|
20134
20543
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
20135
|
-
(0,
|
|
20544
|
+
(0, import_node_path139.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
|
|
20136
20545
|
);
|
|
20137
20546
|
if (forDeletion) {
|
|
20138
20547
|
return buildDeletionRulesFromPaths(nonRootFilePaths, {
|
|
@@ -20142,18 +20551,18 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20142
20551
|
}
|
|
20143
20552
|
const modularRootRelative = settablePaths.nonRoot.relativeDirPath;
|
|
20144
20553
|
const nonRootPathsForImport = this.toolTarget === "rovodev" ? nonRootFilePaths.filter((filePath) => {
|
|
20145
|
-
const relativeFilePath = (0,
|
|
20554
|
+
const relativeFilePath = (0, import_node_path139.relative)(nonRootBaseDir, filePath);
|
|
20146
20555
|
const ok = RovodevRule.isAllowedModularRulesRelativePath(relativeFilePath);
|
|
20147
20556
|
if (!ok) {
|
|
20148
20557
|
this.logger.warn(
|
|
20149
|
-
`Skipping reserved Rovodev path under modular-rules (import): ${(0,
|
|
20558
|
+
`Skipping reserved Rovodev path under modular-rules (import): ${(0, import_node_path139.join)(modularRootRelative, relativeFilePath)}`
|
|
20150
20559
|
);
|
|
20151
20560
|
}
|
|
20152
20561
|
return ok;
|
|
20153
20562
|
}) : nonRootFilePaths;
|
|
20154
20563
|
return await Promise.all(
|
|
20155
20564
|
nonRootPathsForImport.map((filePath) => {
|
|
20156
|
-
const relativeFilePath = (0,
|
|
20565
|
+
const relativeFilePath = (0, import_node_path139.relative)(nonRootBaseDir, filePath);
|
|
20157
20566
|
checkPathTraversal({
|
|
20158
20567
|
relativePath: relativeFilePath,
|
|
20159
20568
|
intendedRootDir: nonRootBaseDir
|
|
@@ -20272,14 +20681,14 @@ s/<command> [arguments]
|
|
|
20272
20681
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
20273
20682
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
20274
20683
|
|
|
20275
|
-
When users call a custom slash command, you have to look for the markdown file, \`${(0,
|
|
20684
|
+
When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path139.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
20276
20685
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
20277
20686
|
|
|
20278
20687
|
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.
|
|
20279
20688
|
|
|
20280
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0,
|
|
20689
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path139.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
20281
20690
|
|
|
20282
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0,
|
|
20691
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path139.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
20283
20692
|
const skillsSection = skills ? this.generateSkillsSection(skills) : "";
|
|
20284
20693
|
const result = [
|
|
20285
20694
|
overview,
|
|
@@ -20379,7 +20788,7 @@ function warnUnsupportedTargets(params) {
|
|
|
20379
20788
|
}
|
|
20380
20789
|
}
|
|
20381
20790
|
async function checkRulesyncDirExists(params) {
|
|
20382
|
-
return fileExists((0,
|
|
20791
|
+
return fileExists((0, import_node_path140.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
|
|
20383
20792
|
}
|
|
20384
20793
|
async function generate(params) {
|
|
20385
20794
|
const { config, logger } = params;
|