rulesync 7.27.0 → 7.27.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-AZJJUHWM.js → chunk-CJXBVA4E.js} +17 -16
- package/dist/cli/index.cjs +9 -8
- package/dist/cli/index.js +2 -2
- package/dist/index.cjs +11 -9
- package/dist/index.d.cts +18 -20
- package/dist/index.d.ts +18 -20
- package/dist/index.js +4 -3
- package/package.json +1 -1
|
@@ -4213,6 +4213,7 @@ function canonicalToDeepagentsHooks(config) {
|
|
|
4213
4213
|
function deepagentsToCanonicalHooks(hooksEntries) {
|
|
4214
4214
|
const canonical = {};
|
|
4215
4215
|
for (const entry of hooksEntries) {
|
|
4216
|
+
if (typeof entry !== "object" || entry === null) continue;
|
|
4216
4217
|
if (!Array.isArray(entry.command) || entry.command.length === 0) continue;
|
|
4217
4218
|
let command;
|
|
4218
4219
|
if (entry.command.length === 3 && entry.command[0] === "bash" && entry.command[1] === "-c") {
|
|
@@ -8666,7 +8667,7 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
8666
8667
|
};
|
|
8667
8668
|
|
|
8668
8669
|
// src/features/rules/rules-processor.ts
|
|
8669
|
-
import { basename as
|
|
8670
|
+
import { basename as basename10, dirname as dirname3, join as join129, relative as relative5 } from "path";
|
|
8670
8671
|
import { encode } from "@toon-format/toon";
|
|
8671
8672
|
import { z as z64 } from "zod/mini";
|
|
8672
8673
|
|
|
@@ -10791,10 +10792,7 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
10791
10792
|
}
|
|
10792
10793
|
}
|
|
10793
10794
|
}
|
|
10794
|
-
static getSettablePaths(
|
|
10795
|
-
if (options?.global) {
|
|
10796
|
-
throw new Error("DeepagentsSkill does not support global mode.");
|
|
10797
|
-
}
|
|
10795
|
+
static getSettablePaths(_options) {
|
|
10798
10796
|
return {
|
|
10799
10797
|
relativeDirPath: join75(".deepagents", "skills")
|
|
10800
10798
|
};
|
|
@@ -10856,7 +10854,9 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
10856
10854
|
const deepagentsFrontmatter = {
|
|
10857
10855
|
name: rulesyncFrontmatter.name,
|
|
10858
10856
|
description: rulesyncFrontmatter.description,
|
|
10859
|
-
|
|
10857
|
+
...rulesyncFrontmatter.deepagents?.["allowed-tools"] && {
|
|
10858
|
+
"allowed-tools": rulesyncFrontmatter.deepagents["allowed-tools"]
|
|
10859
|
+
}
|
|
10860
10860
|
};
|
|
10861
10861
|
return new _DeepagentsSkill({
|
|
10862
10862
|
baseDir,
|
|
@@ -12704,7 +12704,7 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
|
|
|
12704
12704
|
};
|
|
12705
12705
|
|
|
12706
12706
|
// src/features/subagents/geminicli-subagent.ts
|
|
12707
|
-
import {
|
|
12707
|
+
import { join as join89 } from "path";
|
|
12708
12708
|
import { z as z47 } from "zod/mini";
|
|
12709
12709
|
|
|
12710
12710
|
// src/features/subagents/rulesync-subagent.ts
|
|
@@ -12903,7 +12903,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
12903
12903
|
return new _GeminiCliSubagent({
|
|
12904
12904
|
baseDir,
|
|
12905
12905
|
relativeDirPath: paths.relativeDirPath,
|
|
12906
|
-
relativeFilePath
|
|
12906
|
+
relativeFilePath,
|
|
12907
12907
|
frontmatter: result.data,
|
|
12908
12908
|
body: content.trim(),
|
|
12909
12909
|
fileContent,
|
|
@@ -13101,7 +13101,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
13101
13101
|
};
|
|
13102
13102
|
|
|
13103
13103
|
// src/features/subagents/subagents-processor.ts
|
|
13104
|
-
import { basename as
|
|
13104
|
+
import { basename as basename9, join as join102 } from "path";
|
|
13105
13105
|
import { z as z57 } from "zod/mini";
|
|
13106
13106
|
|
|
13107
13107
|
// src/features/subagents/claudecode-subagent.ts
|
|
@@ -14057,7 +14057,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
14057
14057
|
import { join as join99 } from "path";
|
|
14058
14058
|
|
|
14059
14059
|
// src/features/subagents/opencode-style-subagent.ts
|
|
14060
|
-
import { basename as
|
|
14060
|
+
import { basename as basename8, join as join98 } from "path";
|
|
14061
14061
|
import { z as z55 } from "zod/mini";
|
|
14062
14062
|
var OpenCodeStyleSubagentFrontmatterSchema = z55.looseObject({
|
|
14063
14063
|
description: z55.optional(z55.string()),
|
|
@@ -14092,7 +14092,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
14092
14092
|
const { description, mode, name, ...toolSection } = this.frontmatter;
|
|
14093
14093
|
const rulesyncFrontmatter = {
|
|
14094
14094
|
targets: ["*"],
|
|
14095
|
-
name: name ??
|
|
14095
|
+
name: name ?? basename8(this.getRelativeFilePath(), ".md"),
|
|
14096
14096
|
description,
|
|
14097
14097
|
[this.getToolTarget()]: { mode, ...toolSection }
|
|
14098
14098
|
};
|
|
@@ -14730,7 +14730,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
14730
14730
|
(path3) => factory.class.forDeletion({
|
|
14731
14731
|
baseDir: this.baseDir,
|
|
14732
14732
|
relativeDirPath: paths.relativeDirPath,
|
|
14733
|
-
relativeFilePath:
|
|
14733
|
+
relativeFilePath: basename9(path3),
|
|
14734
14734
|
global: this.global
|
|
14735
14735
|
})
|
|
14736
14736
|
).filter((subagent) => subagent.isDeletable());
|
|
@@ -14743,7 +14743,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
14743
14743
|
subagentFilePaths.map(
|
|
14744
14744
|
(path3) => factory.class.fromFile({
|
|
14745
14745
|
baseDir: this.baseDir,
|
|
14746
|
-
relativeFilePath:
|
|
14746
|
+
relativeFilePath: basename9(path3),
|
|
14747
14747
|
global: this.global
|
|
14748
14748
|
})
|
|
14749
14749
|
)
|
|
@@ -16606,12 +16606,13 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
16606
16606
|
relativeFilePath,
|
|
16607
16607
|
validate = true
|
|
16608
16608
|
}) {
|
|
16609
|
+
const settablePaths = this.getSettablePaths();
|
|
16609
16610
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
16610
16611
|
const relativePath = isRoot ? join115(".deepagents", "AGENTS.md") : join115(".deepagents", "memories", relativeFilePath);
|
|
16611
16612
|
const fileContent = await readFileContent(join115(baseDir, relativePath));
|
|
16612
16613
|
return new _DeepagentsRule({
|
|
16613
16614
|
baseDir,
|
|
16614
|
-
relativeDirPath: isRoot ?
|
|
16615
|
+
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
16615
16616
|
relativeFilePath: isRoot ? "AGENTS.md" : relativeFilePath,
|
|
16616
16617
|
fileContent,
|
|
16617
16618
|
validate,
|
|
@@ -18653,7 +18654,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
18653
18654
|
const effectiveBaseDir = isNonRoot ? opts.baseDirOverride : this.baseDir;
|
|
18654
18655
|
return filePaths.map((filePath) => {
|
|
18655
18656
|
const relativeDirPath = isNonRoot ? opts.relativeDirPathOverride : resolveRelativeDirPath(filePath);
|
|
18656
|
-
const relativeFilePath = isNonRoot ? relative5(effectiveBaseDir, filePath) :
|
|
18657
|
+
const relativeFilePath = isNonRoot ? relative5(effectiveBaseDir, filePath) : basename10(filePath);
|
|
18657
18658
|
checkPathTraversal({
|
|
18658
18659
|
relativePath: isNonRoot ? relativeFilePath : relativeDirPath,
|
|
18659
18660
|
intendedRootDir: effectiveBaseDir
|
|
@@ -18701,7 +18702,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
18701
18702
|
});
|
|
18702
18703
|
return factory.class.fromFile({
|
|
18703
18704
|
baseDir: this.baseDir,
|
|
18704
|
-
relativeFilePath:
|
|
18705
|
+
relativeFilePath: basename10(filePath),
|
|
18705
18706
|
relativeDirPath,
|
|
18706
18707
|
global: this.global
|
|
18707
18708
|
});
|
package/dist/cli/index.cjs
CHANGED
|
@@ -3922,6 +3922,7 @@ function canonicalToDeepagentsHooks(config) {
|
|
|
3922
3922
|
function deepagentsToCanonicalHooks(hooksEntries) {
|
|
3923
3923
|
const canonical = {};
|
|
3924
3924
|
for (const entry of hooksEntries) {
|
|
3925
|
+
if (typeof entry !== "object" || entry === null) continue;
|
|
3925
3926
|
if (!Array.isArray(entry.command) || entry.command.length === 0) continue;
|
|
3926
3927
|
let command;
|
|
3927
3928
|
if (entry.command.length === 3 && entry.command[0] === "bash" && entry.command[1] === "-c") {
|
|
@@ -10500,10 +10501,7 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
10500
10501
|
}
|
|
10501
10502
|
}
|
|
10502
10503
|
}
|
|
10503
|
-
static getSettablePaths(
|
|
10504
|
-
if (options?.global) {
|
|
10505
|
-
throw new Error("DeepagentsSkill does not support global mode.");
|
|
10506
|
-
}
|
|
10504
|
+
static getSettablePaths(_options) {
|
|
10507
10505
|
return {
|
|
10508
10506
|
relativeDirPath: (0, import_node_path76.join)(".deepagents", "skills")
|
|
10509
10507
|
};
|
|
@@ -10565,7 +10563,9 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
10565
10563
|
const deepagentsFrontmatter = {
|
|
10566
10564
|
name: rulesyncFrontmatter.name,
|
|
10567
10565
|
description: rulesyncFrontmatter.description,
|
|
10568
|
-
|
|
10566
|
+
...rulesyncFrontmatter.deepagents?.["allowed-tools"] && {
|
|
10567
|
+
"allowed-tools": rulesyncFrontmatter.deepagents["allowed-tools"]
|
|
10568
|
+
}
|
|
10569
10569
|
};
|
|
10570
10570
|
return new _DeepagentsSkill({
|
|
10571
10571
|
baseDir,
|
|
@@ -12612,7 +12612,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
12612
12612
|
return new _GeminiCliSubagent({
|
|
12613
12613
|
baseDir,
|
|
12614
12614
|
relativeDirPath: paths.relativeDirPath,
|
|
12615
|
-
relativeFilePath
|
|
12615
|
+
relativeFilePath,
|
|
12616
12616
|
frontmatter: result.data,
|
|
12617
12617
|
body: content.trim(),
|
|
12618
12618
|
fileContent,
|
|
@@ -16315,12 +16315,13 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
16315
16315
|
relativeFilePath,
|
|
16316
16316
|
validate = true
|
|
16317
16317
|
}) {
|
|
16318
|
+
const settablePaths = this.getSettablePaths();
|
|
16318
16319
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
16319
16320
|
const relativePath = isRoot ? (0, import_node_path116.join)(".deepagents", "AGENTS.md") : (0, import_node_path116.join)(".deepagents", "memories", relativeFilePath);
|
|
16320
16321
|
const fileContent = await readFileContent((0, import_node_path116.join)(baseDir, relativePath));
|
|
16321
16322
|
return new _DeepagentsRule({
|
|
16322
16323
|
baseDir,
|
|
16323
|
-
relativeDirPath: isRoot ?
|
|
16324
|
+
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
16324
16325
|
relativeFilePath: isRoot ? "AGENTS.md" : relativeFilePath,
|
|
16325
16326
|
fileContent,
|
|
16326
16327
|
validate,
|
|
@@ -24148,7 +24149,7 @@ function wrapCommand({
|
|
|
24148
24149
|
}
|
|
24149
24150
|
|
|
24150
24151
|
// src/cli/index.ts
|
|
24151
|
-
var getVersion = () => "7.27.
|
|
24152
|
+
var getVersion = () => "7.27.1";
|
|
24152
24153
|
function wrapCommand2(name, errorCode, handler) {
|
|
24153
24154
|
return wrapCommand({ name, errorCode, handler, getVersion });
|
|
24154
24155
|
}
|
package/dist/cli/index.js
CHANGED
|
@@ -71,7 +71,7 @@ import {
|
|
|
71
71
|
stringifyFrontmatter,
|
|
72
72
|
toPosixPath,
|
|
73
73
|
writeFileContent
|
|
74
|
-
} from "../chunk-
|
|
74
|
+
} from "../chunk-CJXBVA4E.js";
|
|
75
75
|
|
|
76
76
|
// src/cli/index.ts
|
|
77
77
|
import { Command } from "commander";
|
|
@@ -4460,7 +4460,7 @@ function wrapCommand({
|
|
|
4460
4460
|
}
|
|
4461
4461
|
|
|
4462
4462
|
// src/cli/index.ts
|
|
4463
|
-
var getVersion = () => "7.27.
|
|
4463
|
+
var getVersion = () => "7.27.1";
|
|
4464
4464
|
function wrapCommand2(name, errorCode, handler) {
|
|
4465
4465
|
return wrapCommand({ name, errorCode, handler, getVersion });
|
|
4466
4466
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -4220,6 +4220,7 @@ function canonicalToDeepagentsHooks(config) {
|
|
|
4220
4220
|
function deepagentsToCanonicalHooks(hooksEntries) {
|
|
4221
4221
|
const canonical = {};
|
|
4222
4222
|
for (const entry of hooksEntries) {
|
|
4223
|
+
if (typeof entry !== "object" || entry === null) continue;
|
|
4223
4224
|
if (!Array.isArray(entry.command) || entry.command.length === 0) continue;
|
|
4224
4225
|
let command;
|
|
4225
4226
|
if (entry.command.length === 3 && entry.command[0] === "bash" && entry.command[1] === "-c") {
|
|
@@ -10798,10 +10799,7 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
10798
10799
|
}
|
|
10799
10800
|
}
|
|
10800
10801
|
}
|
|
10801
|
-
static getSettablePaths(
|
|
10802
|
-
if (options?.global) {
|
|
10803
|
-
throw new Error("DeepagentsSkill does not support global mode.");
|
|
10804
|
-
}
|
|
10802
|
+
static getSettablePaths(_options) {
|
|
10805
10803
|
return {
|
|
10806
10804
|
relativeDirPath: (0, import_node_path78.join)(".deepagents", "skills")
|
|
10807
10805
|
};
|
|
@@ -10863,7 +10861,9 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
10863
10861
|
const deepagentsFrontmatter = {
|
|
10864
10862
|
name: rulesyncFrontmatter.name,
|
|
10865
10863
|
description: rulesyncFrontmatter.description,
|
|
10866
|
-
|
|
10864
|
+
...rulesyncFrontmatter.deepagents?.["allowed-tools"] && {
|
|
10865
|
+
"allowed-tools": rulesyncFrontmatter.deepagents["allowed-tools"]
|
|
10866
|
+
}
|
|
10867
10867
|
};
|
|
10868
10868
|
return new _DeepagentsSkill({
|
|
10869
10869
|
baseDir,
|
|
@@ -12910,7 +12910,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
12910
12910
|
return new _GeminiCliSubagent({
|
|
12911
12911
|
baseDir,
|
|
12912
12912
|
relativeDirPath: paths.relativeDirPath,
|
|
12913
|
-
relativeFilePath
|
|
12913
|
+
relativeFilePath,
|
|
12914
12914
|
frontmatter: result.data,
|
|
12915
12915
|
body: content.trim(),
|
|
12916
12916
|
fileContent,
|
|
@@ -16613,12 +16613,13 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
16613
16613
|
relativeFilePath,
|
|
16614
16614
|
validate = true
|
|
16615
16615
|
}) {
|
|
16616
|
+
const settablePaths = this.getSettablePaths();
|
|
16616
16617
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
16617
16618
|
const relativePath = isRoot ? (0, import_node_path118.join)(".deepagents", "AGENTS.md") : (0, import_node_path118.join)(".deepagents", "memories", relativeFilePath);
|
|
16618
16619
|
const fileContent = await readFileContent((0, import_node_path118.join)(baseDir, relativePath));
|
|
16619
16620
|
return new _DeepagentsRule({
|
|
16620
16621
|
baseDir,
|
|
16621
|
-
relativeDirPath: isRoot ?
|
|
16622
|
+
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
16622
16623
|
relativeFilePath: isRoot ? "AGENTS.md" : relativeFilePath,
|
|
16623
16624
|
fileContent,
|
|
16624
16625
|
validate,
|
|
@@ -19650,17 +19651,18 @@ async function generate2(options = {}) {
|
|
|
19650
19651
|
});
|
|
19651
19652
|
for (const baseDir of config.getBaseDirs()) {
|
|
19652
19653
|
if (!await checkRulesyncDirExists({ baseDir })) {
|
|
19653
|
-
throw new Error(
|
|
19654
|
+
throw new Error(`.rulesync directory not found in '${baseDir}'. Run 'rulesync init' first.`);
|
|
19654
19655
|
}
|
|
19655
19656
|
}
|
|
19656
19657
|
return generate({ config, logger });
|
|
19657
19658
|
}
|
|
19658
19659
|
async function importFromTool2(options) {
|
|
19659
|
-
const { target, silent = true, verbose = false, ...rest } = options;
|
|
19660
|
+
const { target, features, silent = true, verbose = false, ...rest } = options;
|
|
19660
19661
|
const logger = new ConsoleLogger({ verbose, silent });
|
|
19661
19662
|
const config = await ConfigResolver.resolve({
|
|
19662
19663
|
...rest,
|
|
19663
19664
|
targets: [target],
|
|
19665
|
+
features,
|
|
19664
19666
|
verbose,
|
|
19665
19667
|
silent
|
|
19666
19668
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -45,16 +45,6 @@ declare const FeatureSchema: z.ZodMiniEnum<{
|
|
|
45
45
|
}>;
|
|
46
46
|
type Feature = z.infer<typeof FeatureSchema>;
|
|
47
47
|
|
|
48
|
-
type ImportResult = {
|
|
49
|
-
rulesCount: number;
|
|
50
|
-
ignoreCount: number;
|
|
51
|
-
mcpCount: number;
|
|
52
|
-
commandsCount: number;
|
|
53
|
-
subagentsCount: number;
|
|
54
|
-
skillsCount: number;
|
|
55
|
-
hooksCount: number;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
48
|
type ValidationResult = {
|
|
59
49
|
success: true;
|
|
60
50
|
error: undefined | null;
|
|
@@ -275,28 +265,36 @@ type GenerateResult = {
|
|
|
275
265
|
hasDiff: boolean;
|
|
276
266
|
};
|
|
277
267
|
|
|
278
|
-
type
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
268
|
+
type ImportResult = {
|
|
269
|
+
rulesCount: number;
|
|
270
|
+
ignoreCount: number;
|
|
271
|
+
mcpCount: number;
|
|
272
|
+
commandsCount: number;
|
|
273
|
+
subagentsCount: number;
|
|
274
|
+
skillsCount: number;
|
|
275
|
+
hooksCount: number;
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
type BaseOptions = {
|
|
282
279
|
configPath?: string;
|
|
283
280
|
verbose?: boolean;
|
|
284
281
|
silent?: boolean;
|
|
285
|
-
delete?: boolean;
|
|
286
282
|
global?: boolean;
|
|
283
|
+
};
|
|
284
|
+
type GenerateOptions = BaseOptions & {
|
|
285
|
+
targets?: ToolTarget[];
|
|
286
|
+
features?: Feature[];
|
|
287
|
+
baseDirs?: string[];
|
|
288
|
+
delete?: boolean;
|
|
287
289
|
simulateCommands?: boolean;
|
|
288
290
|
simulateSubagents?: boolean;
|
|
289
291
|
simulateSkills?: boolean;
|
|
290
292
|
dryRun?: boolean;
|
|
291
293
|
check?: boolean;
|
|
292
294
|
};
|
|
293
|
-
type ImportOptions = {
|
|
295
|
+
type ImportOptions = BaseOptions & {
|
|
294
296
|
target: ToolTarget;
|
|
295
297
|
features?: Feature[];
|
|
296
|
-
configPath?: string;
|
|
297
|
-
verbose?: boolean;
|
|
298
|
-
silent?: boolean;
|
|
299
|
-
global?: boolean;
|
|
300
298
|
};
|
|
301
299
|
declare function generate(options?: GenerateOptions): Promise<GenerateResult>;
|
|
302
300
|
declare function importFromTool(options: ImportOptions): Promise<ImportResult>;
|
package/dist/index.d.ts
CHANGED
|
@@ -45,16 +45,6 @@ declare const FeatureSchema: z.ZodMiniEnum<{
|
|
|
45
45
|
}>;
|
|
46
46
|
type Feature = z.infer<typeof FeatureSchema>;
|
|
47
47
|
|
|
48
|
-
type ImportResult = {
|
|
49
|
-
rulesCount: number;
|
|
50
|
-
ignoreCount: number;
|
|
51
|
-
mcpCount: number;
|
|
52
|
-
commandsCount: number;
|
|
53
|
-
subagentsCount: number;
|
|
54
|
-
skillsCount: number;
|
|
55
|
-
hooksCount: number;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
48
|
type ValidationResult = {
|
|
59
49
|
success: true;
|
|
60
50
|
error: undefined | null;
|
|
@@ -275,28 +265,36 @@ type GenerateResult = {
|
|
|
275
265
|
hasDiff: boolean;
|
|
276
266
|
};
|
|
277
267
|
|
|
278
|
-
type
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
268
|
+
type ImportResult = {
|
|
269
|
+
rulesCount: number;
|
|
270
|
+
ignoreCount: number;
|
|
271
|
+
mcpCount: number;
|
|
272
|
+
commandsCount: number;
|
|
273
|
+
subagentsCount: number;
|
|
274
|
+
skillsCount: number;
|
|
275
|
+
hooksCount: number;
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
type BaseOptions = {
|
|
282
279
|
configPath?: string;
|
|
283
280
|
verbose?: boolean;
|
|
284
281
|
silent?: boolean;
|
|
285
|
-
delete?: boolean;
|
|
286
282
|
global?: boolean;
|
|
283
|
+
};
|
|
284
|
+
type GenerateOptions = BaseOptions & {
|
|
285
|
+
targets?: ToolTarget[];
|
|
286
|
+
features?: Feature[];
|
|
287
|
+
baseDirs?: string[];
|
|
288
|
+
delete?: boolean;
|
|
287
289
|
simulateCommands?: boolean;
|
|
288
290
|
simulateSubagents?: boolean;
|
|
289
291
|
simulateSkills?: boolean;
|
|
290
292
|
dryRun?: boolean;
|
|
291
293
|
check?: boolean;
|
|
292
294
|
};
|
|
293
|
-
type ImportOptions = {
|
|
295
|
+
type ImportOptions = BaseOptions & {
|
|
294
296
|
target: ToolTarget;
|
|
295
297
|
features?: Feature[];
|
|
296
|
-
configPath?: string;
|
|
297
|
-
verbose?: boolean;
|
|
298
|
-
silent?: boolean;
|
|
299
|
-
global?: boolean;
|
|
300
298
|
};
|
|
301
299
|
declare function generate(options?: GenerateOptions): Promise<GenerateResult>;
|
|
302
300
|
declare function importFromTool(options: ImportOptions): Promise<ImportResult>;
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
checkRulesyncDirExists,
|
|
7
7
|
generate,
|
|
8
8
|
importFromTool
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CJXBVA4E.js";
|
|
10
10
|
|
|
11
11
|
// src/index.ts
|
|
12
12
|
async function generate2(options = {}) {
|
|
@@ -19,17 +19,18 @@ async function generate2(options = {}) {
|
|
|
19
19
|
});
|
|
20
20
|
for (const baseDir of config.getBaseDirs()) {
|
|
21
21
|
if (!await checkRulesyncDirExists({ baseDir })) {
|
|
22
|
-
throw new Error(
|
|
22
|
+
throw new Error(`.rulesync directory not found in '${baseDir}'. Run 'rulesync init' first.`);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
return generate({ config, logger });
|
|
26
26
|
}
|
|
27
27
|
async function importFromTool2(options) {
|
|
28
|
-
const { target, silent = true, verbose = false, ...rest } = options;
|
|
28
|
+
const { target, features, silent = true, verbose = false, ...rest } = options;
|
|
29
29
|
const logger = new ConsoleLogger({ verbose, silent });
|
|
30
30
|
const config = await ConfigResolver.resolve({
|
|
31
31
|
...rest,
|
|
32
32
|
targets: [target],
|
|
33
|
+
features,
|
|
33
34
|
verbose,
|
|
34
35
|
silent
|
|
35
36
|
});
|