rulesync 16.15.0 → 16.16.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/dist/cli/index.cjs +203 -54
- package/dist/cli/index.js +203 -54
- package/dist/cli/index.js.map +1 -1
- package/dist/{import-BPTCMtUS.js → import-DimKwtQ6.js} +1660 -399
- package/dist/import-DimKwtQ6.js.map +1 -0
- package/dist/{import-nfDFI5X1.cjs → import-NiPCjH6E.cjs} +1684 -411
- package/dist/index.cjs +4 -3
- package/dist/index.d.cts +26 -4
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +26 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/import-BPTCMtUS.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_import = require("./import-
|
|
2
|
+
const require_import = require("./import-NiPCjH6E.cjs");
|
|
3
3
|
//#region src/index.ts
|
|
4
4
|
async function generate(options = {}) {
|
|
5
5
|
const { silent = true, verbose = false, ...rest } = options;
|
|
@@ -12,8 +12,9 @@ async function generate(options = {}) {
|
|
|
12
12
|
verbose,
|
|
13
13
|
silent
|
|
14
14
|
});
|
|
15
|
-
const
|
|
16
|
-
|
|
15
|
+
const inputRoots = config.getInputRoots();
|
|
16
|
+
const inputRootInspection = await require_import.inspectInputRoots(inputRoots);
|
|
17
|
+
if (inputRootInspection.message !== void 0) throw new Error(inputRootInspection.message);
|
|
17
18
|
return require_import.generate({
|
|
18
19
|
config,
|
|
19
20
|
logger
|
package/dist/index.d.cts
CHANGED
|
@@ -364,6 +364,10 @@ declare const RulesyncSkillFrontmatterSchemaInternal: z.ZodMiniObject<{
|
|
|
364
364
|
"user-invocable": z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
365
365
|
enabled: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
366
366
|
"allowed-tools": z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
367
|
+
license: z.ZodMiniOptional<z.ZodMiniUnknown>;
|
|
368
|
+
compatibility: z.ZodMiniOptional<z.ZodMiniUnknown>;
|
|
369
|
+
metadata: z.ZodMiniOptional<z.ZodMiniUnknown>;
|
|
370
|
+
version: z.ZodMiniOptional<z.ZodMiniUnknown>;
|
|
367
371
|
}, z.core.$loose>>;
|
|
368
372
|
grokcli: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
369
373
|
"disable-model-invocation": z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
@@ -543,6 +547,10 @@ type RulesyncSkillFrontmatterInput = {
|
|
|
543
547
|
"user-invocable"?: boolean;
|
|
544
548
|
enabled?: boolean;
|
|
545
549
|
"allowed-tools"?: string | string[];
|
|
550
|
+
license?: unknown;
|
|
551
|
+
compatibility?: unknown;
|
|
552
|
+
metadata?: unknown;
|
|
553
|
+
version?: unknown;
|
|
546
554
|
};
|
|
547
555
|
"kimi-code"?: {
|
|
548
556
|
type?: "prompt" | "inline" | "flow";
|
|
@@ -653,10 +661,24 @@ type GenerateOptions = BaseOptions & {
|
|
|
653
661
|
features?: Feature[];
|
|
654
662
|
outputRoots?: string[];
|
|
655
663
|
/**
|
|
656
|
-
*
|
|
657
|
-
*
|
|
658
|
-
*
|
|
659
|
-
*
|
|
664
|
+
* Ordered list of rulesync source-tree directories (e.g. `.rulesync`,
|
|
665
|
+
* `.rulesync.local`). Each entry is a source tree itself — the directory
|
|
666
|
+
* that directly contains `rules/`, `skills/`, `mcp.jsonc`, etc. No
|
|
667
|
+
* implicit `.rulesync/` join is applied. Defaults to
|
|
668
|
+
* `[join(process.cwd(), ".rulesync")]`. The first root is required; later
|
|
669
|
+
* roots are optional overlays and may be absent. Later entries override
|
|
670
|
+
* earlier ones when the same relative source path appears in more than one
|
|
671
|
+
* root. Mirrors the CLI's `--input-roots` option.
|
|
672
|
+
*
|
|
673
|
+
* Cannot be combined with `inputRoot`; use one or the other.
|
|
674
|
+
*/
|
|
675
|
+
inputRoots?: string[];
|
|
676
|
+
/**
|
|
677
|
+
* @deprecated Use `inputRoots` instead. Kept as a backward-compatibility
|
|
678
|
+
* alias: the value is the PARENT directory of the default `.rulesync/`
|
|
679
|
+
* source tree, and internally expands to
|
|
680
|
+
* `inputRoots: [join(inputRoot, ".rulesync")]`. Mirrors the CLI's
|
|
681
|
+
* `--input-root` option. Cannot be combined with `inputRoots`.
|
|
660
682
|
*/
|
|
661
683
|
inputRoot?: string;
|
|
662
684
|
delete?: boolean;
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types/features.ts","../src/types/tool-target-tuples.ts","../src/types/tool-targets.ts","../src/lib/convert.ts","../src/types/ai-dir.ts","../src/features/skills/rulesync-skill.ts","../src/lib/generate.ts","../src/lib/import.ts","../src/index.ts"],"mappings":";;cAaa;cA+BP,eAAa,EAAA,uBAAA,EAAA;;;;;;;;;IAAoE,EAAA;KAE3E,UAAU,EAAE,aAAa;;;cCiQxB;;;KCrSR,wBAAwB;cAEhB,4BAA4B,kBAAkB;cAM9C,kBAAgB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEjB,aAAa,EAAE,aAAa;;;KCJ5B;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;KCrBU;EAEN;EACA;;EAGA;EACA,OAAO;;KAGD;EACV;EACA,YAAY;;;;;;;;EAQZ;;KAGU;EACV;EACA;EACA;EACA;IACE;IACA;IACA,cAAc;;EAEhB,aAAa;EACb;;KAGU,qBAAqB,KAC/B;uBAIoB;;;;qBAID;;;;qBAKA;;;;qBAKA;;;;YAKT;IACR;IACA;IACA,cAAc;;;;;YAMN,YAAY;;;;qBAKH;EAEnB,cACE,YACA,iBACA,SACA,UACA,YACA,UACC;SAcU,QAAQ,SAAS,qBAAqB,QAAQ;EAI3D;EAIA;EAIA;EAIA;EAqBA;IAEM;IACA;IACA,cAAc;;EAMpB,iBAAiB;;;;EAOjB;EAIA;EAIA,YAAY,cAAc,cAAc,cAAc;;;;;;;;;;;mBAc/B,kBACrB,oBACA,yBACA,iBACA,0BACC,QAAQ;WAmBF,YAAY;;;;cC7LjB,wCAAsC,EAAA
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types/features.ts","../src/types/tool-target-tuples.ts","../src/types/tool-targets.ts","../src/lib/convert.ts","../src/types/ai-dir.ts","../src/features/skills/rulesync-skill.ts","../src/lib/generate.ts","../src/lib/import.ts","../src/index.ts"],"mappings":";;cAaa;cA+BP,eAAa,EAAA,uBAAA,EAAA;;;;;;;;;IAAoE,EAAA;KAE3E,UAAU,EAAE,aAAa;;;cCiQxB;;;KCrSR,wBAAwB;cAEhB,4BAA4B,kBAAkB;cAM9C,kBAAgB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEjB,aAAa,EAAE,aAAa;;;KCJ5B;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;KCrBU;EAEN;EACA;;EAGA;EACA,OAAO;;KAGD;EACV;EACA,YAAY;;;;;;;;EAQZ;;KAGU;EACV;EACA;EACA;EACA;IACE;IACA;IACA,cAAc;;EAEhB,aAAa;EACb;;KAGU,qBAAqB,KAC/B;uBAIoB;;;;qBAID;;;;qBAKA;;;;qBAKA;;;;YAKT;IACR;IACA;IACA,cAAc;;;;;YAMN,YAAY;;;;qBAKH;EAEnB,cACE,YACA,iBACA,SACA,UACA,YACA,UACC;SAcU,QAAQ,SAAS,qBAAqB,QAAQ;EAI3D;EAIA;EAIA;EAIA;EAqBA;IAEM;IACA;IACA,cAAc;;EAMpB,iBAAiB;;;;EAOjB;EAIA;EAIA,YAAY,cAAc,cAAc,cAAc;;;;;;;;;;;mBAc/B,kBACrB,oBACA,yBACA,iBACA,0BACC,QAAQ;WAmBF,YAAY;;;;cC7LjB,wCAAsC,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8R1C,EAAA,KAAA;KAMU;EACV;EACA;EACA;EACA;EACA;EACA;IACE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,QAAQ;IACR;IACA;IACA;IACA;IACA;IACA;IACA,yBAAyB;IACzB,WAAW;;EAEb;IACE;IACA;;EAEF;IACE;IACA;MACE;MACA;MACA;MACA;MACA;MACA;;IAEF;MACE;;IAEF;MACE,QAAQ;QACN;QACA;QACA;QACA;QACA;;;;EAIN;IACE;IACA;IACA,yBAAyB;IACzB,WAAW;;EAEb;IACE;;EAEF;IACE;IACA,yBAAyB;IACzB,WAAW;;EAEb;IACE;IACA;IACA,yBAAyB;IACzB,WAAW;;EAEb;IACE;IACA;IACA;IACA;IACA;IACA;;EAEF;IACE;IACA;IACA;IACA;IACA;;EAEF;IACE;IACA;IACA;IACA,yBAAyB;IACzB,WAAW;;EAEb;IACE;;EAEF;IACE;IACA;IACA,yBAAyB;IACzB,WAAW;;EAEb,MAAM;EACN,QAAQ;EACR,MAAM;EACN;IACE;IACA;IACA;IACA;IACA;IACA,cAAc;IACd;;EAEF;IACE;IACA;IACA;IACA;IACA;IACA;IACA,QAAQ;IACR;IACA;;EAEF;IACE;IACA;IACA,yBAAyB;IACzB,WAAW;;EAEb;IACE;IACA;IACA;IACA,WAAW;;EAEb;IACE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEF;IACE;IACA;IACA;IACA;;EAEF;IACE;IACA,yBAAyB;IACzB,WAAW;IACX;;EAEF,cAAc;EACd;IACE;IACA,yBAAyB;IACzB,WAAW;IACX;IACA;;EAEF;IACE;IACA;;;KAKQ,2BAA2B,EAAE,aAAa;KAO1C;EACV;EACA;EACA;EACA,aAAa;EACb;EACA,aAAa;EACb;EACA;;KAGU;EACV;;KAGU;EACV;EACA;EACA;EACA;;;;;;cAOW,sBAAsB;EACjC,cACE,YACA,iBACA,SACA,aACA,MACA,YACA,UACA,UACC;SAsBI,oBAAoB;EAU3B,kBAAkB;EAQlB;EAIA,YAAY;SAcC,UACX,YACA,iBACA,SACA,UACC,6BAA6B,QAAQ;;;;KC/hB9B;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ;EACR;;;;KCTU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;KC9CG;EACH;EACA;EACA;EACA;;KAGU,kBAAkB;EAC5B,UAAU;EACV,WAAW;EACX;;;;;;;;;;;;;EAaA;;;;;;;;EAQA;EACA;EACA;EACA;EACA;EACA;EACA;;KAGU,gBAAgB;EAC1B,QAAQ;EACR,WAAW;;KAGD,iBAAiB;EAC3B,MAAM;EACN,IAAI;EACJ,WAAW;EACX;;iBAGoB,SAAS,UAAS,kBAAuB,QAAQ;iBAyBjD,eAAe,SAAS,gBAAgB,QAAQ;iBAehD,gBAAgB,SAAS,iBAAiB,QAAQ"}
|
package/dist/index.d.ts
CHANGED
|
@@ -364,6 +364,10 @@ declare const RulesyncSkillFrontmatterSchemaInternal: z.ZodMiniObject<{
|
|
|
364
364
|
"user-invocable": z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
365
365
|
enabled: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
366
366
|
"allowed-tools": z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
367
|
+
license: z.ZodMiniOptional<z.ZodMiniUnknown>;
|
|
368
|
+
compatibility: z.ZodMiniOptional<z.ZodMiniUnknown>;
|
|
369
|
+
metadata: z.ZodMiniOptional<z.ZodMiniUnknown>;
|
|
370
|
+
version: z.ZodMiniOptional<z.ZodMiniUnknown>;
|
|
367
371
|
}, z.core.$loose>>;
|
|
368
372
|
grokcli: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
369
373
|
"disable-model-invocation": z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
@@ -543,6 +547,10 @@ type RulesyncSkillFrontmatterInput = {
|
|
|
543
547
|
"user-invocable"?: boolean;
|
|
544
548
|
enabled?: boolean;
|
|
545
549
|
"allowed-tools"?: string | string[];
|
|
550
|
+
license?: unknown;
|
|
551
|
+
compatibility?: unknown;
|
|
552
|
+
metadata?: unknown;
|
|
553
|
+
version?: unknown;
|
|
546
554
|
};
|
|
547
555
|
"kimi-code"?: {
|
|
548
556
|
type?: "prompt" | "inline" | "flow";
|
|
@@ -653,10 +661,24 @@ type GenerateOptions = BaseOptions & {
|
|
|
653
661
|
features?: Feature[];
|
|
654
662
|
outputRoots?: string[];
|
|
655
663
|
/**
|
|
656
|
-
*
|
|
657
|
-
*
|
|
658
|
-
*
|
|
659
|
-
*
|
|
664
|
+
* Ordered list of rulesync source-tree directories (e.g. `.rulesync`,
|
|
665
|
+
* `.rulesync.local`). Each entry is a source tree itself — the directory
|
|
666
|
+
* that directly contains `rules/`, `skills/`, `mcp.jsonc`, etc. No
|
|
667
|
+
* implicit `.rulesync/` join is applied. Defaults to
|
|
668
|
+
* `[join(process.cwd(), ".rulesync")]`. The first root is required; later
|
|
669
|
+
* roots are optional overlays and may be absent. Later entries override
|
|
670
|
+
* earlier ones when the same relative source path appears in more than one
|
|
671
|
+
* root. Mirrors the CLI's `--input-roots` option.
|
|
672
|
+
*
|
|
673
|
+
* Cannot be combined with `inputRoot`; use one or the other.
|
|
674
|
+
*/
|
|
675
|
+
inputRoots?: string[];
|
|
676
|
+
/**
|
|
677
|
+
* @deprecated Use `inputRoots` instead. Kept as a backward-compatibility
|
|
678
|
+
* alias: the value is the PARENT directory of the default `.rulesync/`
|
|
679
|
+
* source tree, and internally expands to
|
|
680
|
+
* `inputRoots: [join(inputRoot, ".rulesync")]`. Mirrors the CLI's
|
|
681
|
+
* `--input-root` option. Cannot be combined with `inputRoots`.
|
|
660
682
|
*/
|
|
661
683
|
inputRoot?: string;
|
|
662
684
|
delete?: boolean;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types/features.ts","../src/types/tool-target-tuples.ts","../src/types/tool-targets.ts","../src/lib/convert.ts","../src/types/ai-dir.ts","../src/features/skills/rulesync-skill.ts","../src/lib/generate.ts","../src/lib/import.ts","../src/index.ts"],"mappings":";;cAaa;cA+BP,eAAa,EAAA,uBAAA,EAAA;;;;;;;;;IAAoE,EAAA;KAE3E,UAAU,EAAE,aAAa;;;cCiQxB;;;KCrSR,wBAAwB;cAEhB,4BAA4B,kBAAkB;cAM9C,kBAAgB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEjB,aAAa,EAAE,aAAa;;;KCJ5B;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;KCrBU;EAEN;EACA;;EAGA;EACA,OAAO;;KAGD;EACV;EACA,YAAY;;;;;;;;EAQZ;;KAGU;EACV;EACA;EACA;EACA;IACE;IACA;IACA,cAAc;;EAEhB,aAAa;EACb;;KAGU,qBAAqB,KAC/B;uBAIoB;;;;qBAID;;;;qBAKA;;;;qBAKA;;;;YAKT;IACR;IACA;IACA,cAAc;;;;;YAMN,YAAY;;;;qBAKH;EAEnB,cACE,YACA,iBACA,SACA,UACA,YACA,UACC;SAcU,QAAQ,SAAS,qBAAqB,QAAQ;EAI3D;EAIA;EAIA;EAIA;EAqBA;IAEM;IACA;IACA,cAAc;;EAMpB,iBAAiB;;;;EAOjB;EAIA;EAIA,YAAY,cAAc,cAAc,cAAc;;;;;;;;;;;mBAc/B,kBACrB,oBACA,yBACA,iBACA,0BACC,QAAQ;WAmBF,YAAY;;;;cC7LjB,wCAAsC,EAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types/features.ts","../src/types/tool-target-tuples.ts","../src/types/tool-targets.ts","../src/lib/convert.ts","../src/types/ai-dir.ts","../src/features/skills/rulesync-skill.ts","../src/lib/generate.ts","../src/lib/import.ts","../src/index.ts"],"mappings":";;cAaa;cA+BP,eAAa,EAAA,uBAAA,EAAA;;;;;;;;;IAAoE,EAAA;KAE3E,UAAU,EAAE,aAAa;;;cCiQxB;;;KCrSR,wBAAwB;cAEhB,4BAA4B,kBAAkB;cAM9C,kBAAgB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEjB,aAAa,EAAE,aAAa;;;KCJ5B;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;KCrBU;EAEN;EACA;;EAGA;EACA,OAAO;;KAGD;EACV;EACA,YAAY;;;;;;;;EAQZ;;KAGU;EACV;EACA;EACA;EACA;IACE;IACA;IACA,cAAc;;EAEhB,aAAa;EACb;;KAGU,qBAAqB,KAC/B;uBAIoB;;;;qBAID;;;;qBAKA;;;;qBAKA;;;;YAKT;IACR;IACA;IACA,cAAc;;;;;YAMN,YAAY;;;;qBAKH;EAEnB,cACE,YACA,iBACA,SACA,UACA,YACA,UACC;SAcU,QAAQ,SAAS,qBAAqB,QAAQ;EAI3D;EAIA;EAIA;EAIA;EAqBA;IAEM;IACA;IACA,cAAc;;EAMpB,iBAAiB;;;;EAOjB;EAIA;EAIA,YAAY,cAAc,cAAc,cAAc;;;;;;;;;;;mBAc/B,kBACrB,oBACA,yBACA,iBACA,0BACC,QAAQ;WAmBF,YAAY;;;;cC7LjB,wCAAsC,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8R1C,EAAA,KAAA;KAMU;EACV;EACA;EACA;EACA;EACA;EACA;IACE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,QAAQ;IACR;IACA;IACA;IACA;IACA;IACA;IACA,yBAAyB;IACzB,WAAW;;EAEb;IACE;IACA;;EAEF;IACE;IACA;MACE;MACA;MACA;MACA;MACA;MACA;;IAEF;MACE;;IAEF;MACE,QAAQ;QACN;QACA;QACA;QACA;QACA;;;;EAIN;IACE;IACA;IACA,yBAAyB;IACzB,WAAW;;EAEb;IACE;;EAEF;IACE;IACA,yBAAyB;IACzB,WAAW;;EAEb;IACE;IACA;IACA,yBAAyB;IACzB,WAAW;;EAEb;IACE;IACA;IACA;IACA;IACA;IACA;;EAEF;IACE;IACA;IACA;IACA;IACA;;EAEF;IACE;IACA;IACA;IACA,yBAAyB;IACzB,WAAW;;EAEb;IACE;;EAEF;IACE;IACA;IACA,yBAAyB;IACzB,WAAW;;EAEb,MAAM;EACN,QAAQ;EACR,MAAM;EACN;IACE;IACA;IACA;IACA;IACA;IACA,cAAc;IACd;;EAEF;IACE;IACA;IACA;IACA;IACA;IACA;IACA,QAAQ;IACR;IACA;;EAEF;IACE;IACA;IACA,yBAAyB;IACzB,WAAW;;EAEb;IACE;IACA;IACA;IACA,WAAW;;EAEb;IACE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEF;IACE;IACA;IACA;IACA;;EAEF;IACE;IACA,yBAAyB;IACzB,WAAW;IACX;;EAEF,cAAc;EACd;IACE;IACA,yBAAyB;IACzB,WAAW;IACX;IACA;;EAEF;IACE;IACA;;;KAKQ,2BAA2B,EAAE,aAAa;KAO1C;EACV;EACA;EACA;EACA,aAAa;EACb;EACA,aAAa;EACb;EACA;;KAGU;EACV;;KAGU;EACV;EACA;EACA;EACA;;;;;;cAOW,sBAAsB;EACjC,cACE,YACA,iBACA,SACA,aACA,MACA,YACA,UACA,UACC;SAsBI,oBAAoB;EAU3B,kBAAkB;EAQlB;EAIA,YAAY;SAcC,UACX,YACA,iBACA,SACA,UACC,6BAA6B,QAAQ;;;;KC/hB9B;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ;EACR;;;;KCTU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;KC9CG;EACH;EACA;EACA;EACA;;KAGU,kBAAkB;EAC5B,UAAU;EACV,WAAW;EACX;;;;;;;;;;;;;EAaA;;;;;;;;EAQA;EACA;EACA;EACA;EACA;EACA;EACA;;KAGU,gBAAgB;EAC1B,QAAQ;EACR,WAAW;;KAGD,iBAAiB;EAC3B,MAAM;EACN,IAAI;EACJ,WAAW;EACX;;iBAGoB,SAAS,UAAS,kBAAuB,QAAQ;iBAyBjD,eAAe,SAAS,gBAAgB,QAAQ;iBAehD,gBAAgB,SAAS,iBAAiB,QAAQ"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mt as ALL_TOOL_TARGETS, a as convertFromTool$1, n as generate$1, q as ConfigResolver, r as inspectInputRoots, t as importFromTool$1, tt as ConsoleLogger, un as ALL_FEATURES } from "./import-DimKwtQ6.js";
|
|
2
2
|
//#region src/index.ts
|
|
3
3
|
async function generate(options = {}) {
|
|
4
4
|
const { silent = true, verbose = false, ...rest } = options;
|
|
@@ -11,8 +11,9 @@ async function generate(options = {}) {
|
|
|
11
11
|
verbose,
|
|
12
12
|
silent
|
|
13
13
|
});
|
|
14
|
-
const
|
|
15
|
-
|
|
14
|
+
const inputRoots = config.getInputRoots();
|
|
15
|
+
const inputRootInspection = await inspectInputRoots(inputRoots);
|
|
16
|
+
if (inputRootInspection.message !== void 0) throw new Error(inputRootInspection.message);
|
|
16
17
|
return generate$1({
|
|
17
18
|
config,
|
|
18
19
|
logger
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["coreGenerate","coreImportFromTool","coreConvertFromTool"],"sources":["../src/index.ts"],"sourcesContent":["import { ConfigResolver } from \"./config/config-resolver.js\";\nimport { convertFromTool as coreConvertFromTool, type ConvertResult } from \"./lib/convert.js\";\nimport {\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["coreGenerate","coreImportFromTool","coreConvertFromTool"],"sources":["../src/index.ts"],"sourcesContent":["import { ConfigResolver } from \"./config/config-resolver.js\";\nimport { convertFromTool as coreConvertFromTool, type ConvertResult } from \"./lib/convert.js\";\nimport {\n generate as coreGenerate,\n inspectInputRoots,\n type GenerateResult,\n} from \"./lib/generate.js\";\nimport { importFromTool as coreImportFromTool, type ImportResult } from \"./lib/import.js\";\nimport type { Feature } from \"./types/features.js\";\nimport type { ToolTarget } from \"./types/tool-targets.js\";\nimport { ConsoleLogger } from \"./utils/logger.js\";\n\nexport type { Feature } from \"./types/features.js\";\nexport type { ToolTarget } from \"./types/tool-targets.js\";\nexport { ALL_FEATURES } from \"./types/features.js\";\nexport { ALL_TOOL_TARGETS } from \"./types/tool-targets.js\";\nexport type { GenerateResult } from \"./lib/generate.js\";\nexport type { ImportResult } from \"./lib/import.js\";\nexport type { ConvertResult } from \"./lib/convert.js\";\n\ntype BaseOptions = {\n configPath?: string;\n verbose?: boolean;\n silent?: boolean;\n global?: boolean;\n};\n\nexport type GenerateOptions = BaseOptions & {\n targets?: ToolTarget[];\n features?: Feature[];\n outputRoots?: string[];\n /**\n * Ordered list of rulesync source-tree directories (e.g. `.rulesync`,\n * `.rulesync.local`). Each entry is a source tree itself — the directory\n * that directly contains `rules/`, `skills/`, `mcp.jsonc`, etc. No\n * implicit `.rulesync/` join is applied. Defaults to\n * `[join(process.cwd(), \".rulesync\")]`. The first root is required; later\n * roots are optional overlays and may be absent. Later entries override\n * earlier ones when the same relative source path appears in more than one\n * root. Mirrors the CLI's `--input-roots` option.\n *\n * Cannot be combined with `inputRoot`; use one or the other.\n */\n inputRoots?: string[];\n /**\n * @deprecated Use `inputRoots` instead. Kept as a backward-compatibility\n * alias: the value is the PARENT directory of the default `.rulesync/`\n * source tree, and internally expands to\n * `inputRoots: [join(inputRoot, \".rulesync\")]`. Mirrors the CLI's\n * `--input-root` option. Cannot be combined with `inputRoots`.\n */\n inputRoot?: string;\n delete?: boolean;\n simulateCommands?: boolean;\n simulateSubagents?: boolean;\n simulateSkills?: boolean;\n dryRun?: boolean;\n check?: boolean;\n};\n\nexport type ImportOptions = BaseOptions & {\n target: ToolTarget;\n features?: Feature[];\n};\n\nexport type ConvertOptions = BaseOptions & {\n from: ToolTarget;\n to: ToolTarget[];\n features?: Feature[];\n dryRun?: boolean;\n};\n\nexport async function generate(options: GenerateOptions = {}): Promise<GenerateResult> {\n const { silent = true, verbose = false, ...rest } = options;\n const logger = new ConsoleLogger({ verbose, silent });\n\n const config = await ConfigResolver.resolve({\n ...rest,\n verbose,\n silent,\n });\n\n // The pre-flight check probes the input source roots rather than each output\n // root. This matches the CLI's behavior and the way features load content\n // relative to `config.getInputRoots()`. Empty source roots are allowed so\n // `generate --delete --check` can still detect orphaned outputs.\n const inputRoots = config.getInputRoots();\n\n const inputRootInspection = await inspectInputRoots(inputRoots);\n\n if (inputRootInspection.message !== undefined) {\n throw new Error(inputRootInspection.message);\n }\n\n return coreGenerate({ config, logger });\n}\n\nexport async function importFromTool(options: ImportOptions): Promise<ImportResult> {\n const { target, features, silent = true, verbose = false, ...rest } = options;\n const logger = new ConsoleLogger({ verbose, silent });\n\n const config = await ConfigResolver.resolve({\n ...rest,\n targets: [target],\n features,\n verbose,\n silent,\n });\n\n return coreImportFromTool({ config, tool: target, logger });\n}\n\nexport async function convertFromTool(options: ConvertOptions): Promise<ConvertResult> {\n const { from, to, features, silent = true, verbose = false, ...rest } = options;\n\n if (!from) {\n throw new Error(\"from is required. Please specify a source tool to convert from.\");\n }\n\n if (!to || to.length === 0) {\n throw new Error(\"to is required and must not be empty. Please specify destination tools.\");\n }\n\n const toTools = Array.from(new Set(to));\n\n if (toTools.includes(from)) {\n throw new Error(\n `Destination tools must not include the source tool '${from}'. ` +\n `Converting a tool onto itself is likely a mistake and may cause lossy round-trips.`,\n );\n }\n\n const logger = new ConsoleLogger({ verbose, silent });\n\n // NOTE: The CLI and MCP wrappers pass `[from, ...to]` as `targets` so that\n // per-target feature overrides in `rulesync.jsonc` apply to destinations too.\n // The JS API intentionally passes only `[from]` here because the public\n // contract for `convertFromTool` (issue #1557) prescribes this shape:\n // programmatic callers are expected to supply `features` explicitly when\n // they need fine-grained control, rather than relying on config-file\n // per-target maps. Defaulting `features` to `[\"*\"]` below matches the CLI's\n // \"attempt every feature both tools support\" behavior so callers who omit\n // `features` get the same effective coverage as the CLI.\n const config = await ConfigResolver.resolve({\n ...rest,\n targets: [from],\n features: features ?? [\"*\"],\n verbose,\n silent,\n });\n\n return coreConvertFromTool({ config, fromTool: from, toTools, logger });\n}\n"],"mappings":";;AAwEA,eAAsB,SAAS,UAA2B,CAAC,GAA4B;CACrF,MAAM,EAAE,SAAS,MAAM,UAAU,OAAO,GAAG,SAAS;CACpD,MAAM,SAAS,IAAI,cAAc;EAAE;EAAS;CAAO,CAAC;CAEpD,MAAM,SAAS,MAAM,eAAe,QAAQ;EAC1C,GAAG;EACH;EACA;CACF,CAAC;CAMD,MAAM,aAAa,OAAO,cAAc;CAExC,MAAM,sBAAsB,MAAM,kBAAkB,UAAU;CAE9D,IAAI,oBAAoB,YAAY,KAAA,GAClC,MAAM,IAAI,MAAM,oBAAoB,OAAO;CAG7C,OAAOA,WAAa;EAAE;EAAQ;CAAO,CAAC;AACxC;AAEA,eAAsB,eAAe,SAA+C;CAClF,MAAM,EAAE,QAAQ,UAAU,SAAS,MAAM,UAAU,OAAO,GAAG,SAAS;CACtE,MAAM,SAAS,IAAI,cAAc;EAAE;EAAS;CAAO,CAAC;CAEpD,MAAM,SAAS,MAAM,eAAe,QAAQ;EAC1C,GAAG;EACH,SAAS,CAAC,MAAM;EAChB;EACA;EACA;CACF,CAAC;CAED,OAAOC,iBAAmB;EAAE;EAAQ,MAAM;EAAQ;CAAO,CAAC;AAC5D;AAEA,eAAsB,gBAAgB,SAAiD;CACrF,MAAM,EAAE,MAAM,IAAI,UAAU,SAAS,MAAM,UAAU,OAAO,GAAG,SAAS;CAExE,IAAI,CAAC,MACH,MAAM,IAAI,MAAM,iEAAiE;CAGnF,IAAI,CAAC,MAAM,GAAG,WAAW,GACvB,MAAM,IAAI,MAAM,yEAAyE;CAG3F,MAAM,UAAU,MAAM,KAAK,IAAI,IAAI,EAAE,CAAC;CAEtC,IAAI,QAAQ,SAAS,IAAI,GACvB,MAAM,IAAI,MACR,uDAAuD,KAAK,sFAE9D;CAGF,MAAM,SAAS,IAAI,cAAc;EAAE;EAAS;CAAO,CAAC;CAWpD,MAAM,SAAS,MAAM,eAAe,QAAQ;EAC1C,GAAG;EACH,SAAS,CAAC,IAAI;EACd,UAAU,YAAY,CAAC,GAAG;EAC1B;EACA;CACF,CAAC;CAED,OAAOC,kBAAoB;EAAE;EAAQ,UAAU;EAAM;EAAS;CAAO,CAAC;AACxE"}
|