548
method: 'discoverRules.instructions.discover',
549
sources: instructionDiscovery.sources.map(source => ({
551
>
label: source.label,
552
>
sourcePath: source.sourcePath,
553
>
applyTo: source.applyTo,
554
>
type: source.type,
555
})),
556
});
557
558
for (const instruction of instructionDiscovery.sources) {
560
>
if (isAbsolute(instruction.sourcePath)) {
561
>
uri = this._pathToUri(instruction.sourcePath);
562
>
} else {
563
uri = joinPath(this._workingDirectory, instruction.sourcePath);
564
}
566
>
rules.push({
567
>
type: CustomizationType.Rule,
568
>
uri: uriString,
569
>
id: instruction.id,
570
>
name: instruction.label,
571
>
description: instruction.description,
572
>
globs: instruction.applyTo ? [...instruction.applyTo] : undefined,
573
>
alwaysApply: this._isAgentInstructionSource(instruction),
574
>
});
575
>
seenRuleUris.add(uriString);
576
>
}
577
578
for (const directory of this._discoveredDirectories ?? []) {