memorix 0.6.1 → 0.6.2
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/dist/cli/index.js +17 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +17 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2520,6 +2520,12 @@ var KiroAdapter = class {
|
|
|
2520
2520
|
return rules.map((rule, i) => {
|
|
2521
2521
|
const fm = {};
|
|
2522
2522
|
if (rule.description) fm.description = rule.description;
|
|
2523
|
+
if (rule.paths && rule.paths.length > 0) {
|
|
2524
|
+
fm.inclusion = "fileMatch";
|
|
2525
|
+
fm.fileMatchPattern = rule.paths.length === 1 ? rule.paths[0] : rule.paths;
|
|
2526
|
+
} else if (rule.alwaysApply) {
|
|
2527
|
+
fm.inclusion = "always";
|
|
2528
|
+
}
|
|
2523
2529
|
const fileName = rule.id.replace(/^kiro:/, "").replace(/[^a-zA-Z0-9-_]/g, "-") || `rule-${i}`;
|
|
2524
2530
|
const body = Object.keys(fm).length > 0 ? matter7.stringify(rule.content, fm) : rule.content;
|
|
2525
2531
|
return {
|
|
@@ -2532,15 +2538,22 @@ var KiroAdapter = class {
|
|
|
2532
2538
|
const { data, content: body } = matter7(content);
|
|
2533
2539
|
const trimmed = body.trim();
|
|
2534
2540
|
if (!trimmed) return [];
|
|
2535
|
-
const
|
|
2536
|
-
const alwaysApply =
|
|
2541
|
+
const inclusion = data.inclusion ?? "always";
|
|
2542
|
+
const alwaysApply = inclusion === "always" || inclusion === "auto";
|
|
2543
|
+
let paths;
|
|
2544
|
+
if (inclusion === "fileMatch" && data.fileMatchPattern) {
|
|
2545
|
+
paths = Array.isArray(data.fileMatchPattern) ? data.fileMatchPattern : [data.fileMatchPattern];
|
|
2546
|
+
}
|
|
2547
|
+
let scope = "project";
|
|
2548
|
+
if (alwaysApply) scope = "global";
|
|
2549
|
+
else if (paths && paths.length > 0) scope = "path-specific";
|
|
2537
2550
|
return [{
|
|
2538
2551
|
id: generateRuleId("kiro", filePath),
|
|
2539
2552
|
content: trimmed,
|
|
2540
2553
|
description: data.description,
|
|
2541
2554
|
source: "kiro",
|
|
2542
|
-
scope
|
|
2543
|
-
paths
|
|
2555
|
+
scope,
|
|
2556
|
+
paths,
|
|
2544
2557
|
alwaysApply,
|
|
2545
2558
|
priority: alwaysApply ? 10 : 5,
|
|
2546
2559
|
hash: hashContent(trimmed)
|