rulesync 3.7.0 → 3.8.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 +22 -17
- package/dist/index.cjs +127 -43
- package/dist/index.js +127 -43
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -77,8 +77,8 @@ Rulesync supports both **generation** and **import** for All of the major AI cod
|
|
|
77
77
|
| Warp | ✅ | | | | |
|
|
78
78
|
|
|
79
79
|
* ✅: Supports project mode
|
|
80
|
-
* 🌏: Supports global mode
|
|
81
|
-
* 🎮: Supports simulated commands/subagents (Project mode only
|
|
80
|
+
* 🌏: Supports global mode
|
|
81
|
+
* 🎮: Supports simulated commands/subagents (Project mode only)
|
|
82
82
|
|
|
83
83
|
## Why Rulesync?
|
|
84
84
|
|
|
@@ -98,10 +98,10 @@ Avoid lock-in completely. If you decide to stop using Rulesync, you can continue
|
|
|
98
98
|
Apply consistent rules across all AI tools, improving code quality and development experience for the entire team.
|
|
99
99
|
|
|
100
100
|
### 🌏 **Global Mode**
|
|
101
|
-
You can use global mode via Rulesync by enabling `--
|
|
101
|
+
You can use global mode via Rulesync by enabling `--global` option.
|
|
102
102
|
|
|
103
103
|
### 🎮 **Simulated Commands and Subagents**
|
|
104
|
-
Simulated commands and subagents
|
|
104
|
+
Simulated commands and subagents allow you to generate simulated commands and subagents for copilot, cursor and codexcli. This is useful for shortening your prompts.
|
|
105
105
|
|
|
106
106
|
## Quick Commands
|
|
107
107
|
|
|
@@ -122,8 +122,8 @@ npx rulesync generate --targets claudecode --features rules,subagents
|
|
|
122
122
|
# Generate only rules (no MCP, ignore files, commands, or subagents)
|
|
123
123
|
npx rulesync generate --targets "*" --features rules
|
|
124
124
|
|
|
125
|
-
# Generate simulated commands and subagents
|
|
126
|
-
npx rulesync generate --targets copilot,cursor,codexcli --features commands,subagents --
|
|
125
|
+
# Generate simulated commands and subagents
|
|
126
|
+
npx rulesync generate --targets copilot,cursor,codexcli --features commands,subagents --simulated-commands --simulated-subagents
|
|
127
127
|
|
|
128
128
|
# Add generated files to .gitignore
|
|
129
129
|
npx rulesync gitignore
|
|
@@ -155,10 +155,15 @@ Example:
|
|
|
155
155
|
// Verbose output
|
|
156
156
|
"verbose": false,
|
|
157
157
|
|
|
158
|
-
//
|
|
159
|
-
"
|
|
160
|
-
"
|
|
161
|
-
"
|
|
158
|
+
// Advanced options
|
|
159
|
+
"global": false, // Generate for global(user scope) configuration files
|
|
160
|
+
"simulatedCommands": false, // Generate simulated commands
|
|
161
|
+
"simulatedSubagents": false // Generate simulated subagents
|
|
162
|
+
|
|
163
|
+
// Deprecated experimental options (for backward compatibility)
|
|
164
|
+
// "experimentalGlobal": false,
|
|
165
|
+
// "experimentalSimulateCommands": false,
|
|
166
|
+
// "experimentalSimulateSubagents": false
|
|
162
167
|
}
|
|
163
168
|
```
|
|
164
169
|
|
|
@@ -281,9 +286,9 @@ tmp/
|
|
|
281
286
|
credentials/
|
|
282
287
|
```
|
|
283
288
|
|
|
284
|
-
## Global Mode
|
|
289
|
+
## Global Mode
|
|
285
290
|
|
|
286
|
-
You can use global mode via Rulesync by enabling `--
|
|
291
|
+
You can use global mode via Rulesync by enabling `--global` option. It can also be called as user scope mode.
|
|
287
292
|
|
|
288
293
|
Currently, supports rules and commands generation for Claude Code. Import for global files is supported for rules and commands.
|
|
289
294
|
|
|
@@ -299,7 +304,7 @@ Currently, supports rules and commands generation for Claude Code. Import for gl
|
|
|
299
304
|
3. Edit `~/.aiglobal/rulesync.jsonc` to enable global mode.
|
|
300
305
|
```jsonc
|
|
301
306
|
{
|
|
302
|
-
"
|
|
307
|
+
"global": true
|
|
303
308
|
}
|
|
304
309
|
```
|
|
305
310
|
4. Edit `~/.aiglobal/.rulesync/rules/overview.md` to your preferences.
|
|
@@ -322,9 +327,9 @@ Currently, supports rules and commands generation for Claude Code. Import for gl
|
|
|
322
327
|
> * `rules/*.md` only supports single file has `root: true`, and frontmatter parameters without `root` are ignored.
|
|
323
328
|
> * Only Claude Code is supported for global mode commands.
|
|
324
329
|
|
|
325
|
-
## Simulate Commands and Subagents
|
|
330
|
+
## Simulate Commands and Subagents
|
|
326
331
|
|
|
327
|
-
Simulated commands and subagents
|
|
332
|
+
Simulated commands and subagents allow you to generate simulated commands and subagents for copilot, cursor, codexcli and etc. This is useful for shortening your prompts.
|
|
328
333
|
|
|
329
334
|
1. Prepare `.rulesync/commands/*.md` and `.rulesync/subagents/*.md` for your purposes.
|
|
330
335
|
2. Generate simulated commands and subagents for specific tools that are included in copilot, cursor, codexcli and etc.
|
|
@@ -332,8 +337,8 @@ Simulated commands and subagents are experimental features that allow you to gen
|
|
|
332
337
|
npx rulesync generate \
|
|
333
338
|
--targets copilot,cursor,codexcli \
|
|
334
339
|
--features commands,subagents \
|
|
335
|
-
--
|
|
336
|
-
--
|
|
340
|
+
--simulated-commands \
|
|
341
|
+
--simulated-subagents
|
|
337
342
|
```
|
|
338
343
|
3. Use simulated commands and subagents in your prompts.
|
|
339
344
|
- Prompt examples:
|
package/dist/index.cjs
CHANGED
|
@@ -1648,15 +1648,18 @@ var Config = class {
|
|
|
1648
1648
|
features;
|
|
1649
1649
|
verbose;
|
|
1650
1650
|
delete;
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1651
|
+
global;
|
|
1652
|
+
simulatedCommands;
|
|
1653
|
+
simulatedSubagents;
|
|
1654
1654
|
constructor({
|
|
1655
1655
|
baseDirs,
|
|
1656
1656
|
targets,
|
|
1657
1657
|
features,
|
|
1658
1658
|
verbose,
|
|
1659
1659
|
delete: isDelete,
|
|
1660
|
+
global,
|
|
1661
|
+
simulatedCommands,
|
|
1662
|
+
simulatedSubagents,
|
|
1660
1663
|
experimentalGlobal,
|
|
1661
1664
|
experimentalSimulateCommands,
|
|
1662
1665
|
experimentalSimulateSubagents
|
|
@@ -1666,9 +1669,9 @@ var Config = class {
|
|
|
1666
1669
|
this.features = features;
|
|
1667
1670
|
this.verbose = verbose;
|
|
1668
1671
|
this.delete = isDelete;
|
|
1669
|
-
this.
|
|
1670
|
-
this.
|
|
1671
|
-
this.
|
|
1672
|
+
this.global = global ?? experimentalGlobal ?? false;
|
|
1673
|
+
this.simulatedCommands = simulatedCommands ?? experimentalSimulateCommands ?? false;
|
|
1674
|
+
this.simulatedSubagents = simulatedSubagents ?? experimentalSimulateSubagents ?? false;
|
|
1672
1675
|
}
|
|
1673
1676
|
getBaseDirs() {
|
|
1674
1677
|
return this.baseDirs;
|
|
@@ -1691,14 +1694,27 @@ var Config = class {
|
|
|
1691
1694
|
getDelete() {
|
|
1692
1695
|
return this.delete;
|
|
1693
1696
|
}
|
|
1697
|
+
getGlobal() {
|
|
1698
|
+
return this.global;
|
|
1699
|
+
}
|
|
1700
|
+
getSimulatedCommands() {
|
|
1701
|
+
return this.simulatedCommands;
|
|
1702
|
+
}
|
|
1703
|
+
getSimulatedSubagents() {
|
|
1704
|
+
return this.simulatedSubagents;
|
|
1705
|
+
}
|
|
1706
|
+
// Deprecated getters for backward compatibility
|
|
1707
|
+
/** @deprecated Use getGlobal() instead */
|
|
1694
1708
|
getExperimentalGlobal() {
|
|
1695
|
-
return this.
|
|
1709
|
+
return this.global;
|
|
1696
1710
|
}
|
|
1711
|
+
/** @deprecated Use getSimulatedCommands() instead */
|
|
1697
1712
|
getExperimentalSimulateCommands() {
|
|
1698
|
-
return this.
|
|
1713
|
+
return this.simulatedCommands;
|
|
1699
1714
|
}
|
|
1715
|
+
/** @deprecated Use getSimulatedSubagents() instead */
|
|
1700
1716
|
getExperimentalSimulateSubagents() {
|
|
1701
|
-
return this.
|
|
1717
|
+
return this.simulatedSubagents;
|
|
1702
1718
|
}
|
|
1703
1719
|
};
|
|
1704
1720
|
|
|
@@ -1710,6 +1726,9 @@ var defaults = {
|
|
|
1710
1726
|
delete: false,
|
|
1711
1727
|
baseDirs: ["."],
|
|
1712
1728
|
configPath: "rulesync.jsonc",
|
|
1729
|
+
global: false,
|
|
1730
|
+
simulatedCommands: false,
|
|
1731
|
+
simulatedSubagents: false,
|
|
1713
1732
|
experimentalGlobal: false,
|
|
1714
1733
|
experimentalSimulateCommands: false,
|
|
1715
1734
|
experimentalSimulateSubagents: false
|
|
@@ -1722,11 +1741,26 @@ var ConfigResolver = class {
|
|
|
1722
1741
|
delete: isDelete,
|
|
1723
1742
|
baseDirs,
|
|
1724
1743
|
configPath = defaults.configPath,
|
|
1744
|
+
global,
|
|
1745
|
+
simulatedCommands,
|
|
1746
|
+
simulatedSubagents,
|
|
1725
1747
|
experimentalGlobal,
|
|
1726
1748
|
experimentalSimulateCommands,
|
|
1727
1749
|
experimentalSimulateSubagents
|
|
1728
1750
|
}) {
|
|
1729
1751
|
if (!await fileExists(configPath)) {
|
|
1752
|
+
if (experimentalGlobal !== void 0) {
|
|
1753
|
+
warnDeprecatedOptions({ experimentalGlobal });
|
|
1754
|
+
}
|
|
1755
|
+
if (experimentalSimulateCommands !== void 0) {
|
|
1756
|
+
warnDeprecatedOptions({ experimentalSimulateCommands });
|
|
1757
|
+
}
|
|
1758
|
+
if (experimentalSimulateSubagents !== void 0) {
|
|
1759
|
+
warnDeprecatedOptions({ experimentalSimulateSubagents });
|
|
1760
|
+
}
|
|
1761
|
+
const resolvedGlobal2 = global ?? experimentalGlobal ?? defaults.global;
|
|
1762
|
+
const resolvedSimulatedCommands2 = simulatedCommands ?? experimentalSimulateCommands ?? defaults.simulatedCommands;
|
|
1763
|
+
const resolvedSimulatedSubagents2 = simulatedSubagents ?? experimentalSimulateSubagents ?? defaults.simulatedSubagents;
|
|
1730
1764
|
return new Config({
|
|
1731
1765
|
targets: targets ?? defaults.targets,
|
|
1732
1766
|
features: features ?? defaults.features,
|
|
@@ -1734,11 +1768,11 @@ var ConfigResolver = class {
|
|
|
1734
1768
|
delete: isDelete ?? defaults.delete,
|
|
1735
1769
|
baseDirs: getBaseDirsInLightOfGlobal({
|
|
1736
1770
|
baseDirs: baseDirs ?? defaults.baseDirs,
|
|
1737
|
-
global:
|
|
1771
|
+
global: resolvedGlobal2
|
|
1738
1772
|
}),
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1773
|
+
global: resolvedGlobal2,
|
|
1774
|
+
simulatedCommands: resolvedSimulatedCommands2,
|
|
1775
|
+
simulatedSubagents: resolvedSimulatedSubagents2
|
|
1742
1776
|
});
|
|
1743
1777
|
}
|
|
1744
1778
|
const loadOptions = {
|
|
@@ -1753,6 +1787,21 @@ var ConfigResolver = class {
|
|
|
1753
1787
|
loadOptions.configFile = configPath;
|
|
1754
1788
|
}
|
|
1755
1789
|
const { config: configByFile } = await (0, import_c12.loadConfig)(loadOptions);
|
|
1790
|
+
const deprecatedGlobal = experimentalGlobal ?? configByFile.experimentalGlobal;
|
|
1791
|
+
const deprecatedCommands = experimentalSimulateCommands ?? configByFile.experimentalSimulateCommands;
|
|
1792
|
+
const deprecatedSubagents = experimentalSimulateSubagents ?? configByFile.experimentalSimulateSubagents;
|
|
1793
|
+
if (deprecatedGlobal !== void 0) {
|
|
1794
|
+
warnDeprecatedOptions({ experimentalGlobal: deprecatedGlobal });
|
|
1795
|
+
}
|
|
1796
|
+
if (deprecatedCommands !== void 0) {
|
|
1797
|
+
warnDeprecatedOptions({ experimentalSimulateCommands: deprecatedCommands });
|
|
1798
|
+
}
|
|
1799
|
+
if (deprecatedSubagents !== void 0) {
|
|
1800
|
+
warnDeprecatedOptions({ experimentalSimulateSubagents: deprecatedSubagents });
|
|
1801
|
+
}
|
|
1802
|
+
const resolvedGlobal = global ?? configByFile.global ?? experimentalGlobal ?? configByFile.experimentalGlobal ?? defaults.global;
|
|
1803
|
+
const resolvedSimulatedCommands = simulatedCommands ?? configByFile.simulatedCommands ?? experimentalSimulateCommands ?? configByFile.experimentalSimulateCommands ?? defaults.simulatedCommands;
|
|
1804
|
+
const resolvedSimulatedSubagents = simulatedSubagents ?? configByFile.simulatedSubagents ?? experimentalSimulateSubagents ?? configByFile.experimentalSimulateSubagents ?? defaults.simulatedSubagents;
|
|
1756
1805
|
const configParams = {
|
|
1757
1806
|
targets: targets ?? configByFile.targets ?? defaults.targets,
|
|
1758
1807
|
features: features ?? configByFile.features ?? defaults.features,
|
|
@@ -1760,15 +1809,34 @@ var ConfigResolver = class {
|
|
|
1760
1809
|
delete: isDelete ?? configByFile.delete ?? defaults.delete,
|
|
1761
1810
|
baseDirs: getBaseDirsInLightOfGlobal({
|
|
1762
1811
|
baseDirs: baseDirs ?? configByFile.baseDirs ?? defaults.baseDirs,
|
|
1763
|
-
global:
|
|
1812
|
+
global: resolvedGlobal
|
|
1764
1813
|
}),
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1814
|
+
global: resolvedGlobal,
|
|
1815
|
+
simulatedCommands: resolvedSimulatedCommands,
|
|
1816
|
+
simulatedSubagents: resolvedSimulatedSubagents
|
|
1768
1817
|
};
|
|
1769
1818
|
return new Config(configParams);
|
|
1770
1819
|
}
|
|
1771
1820
|
};
|
|
1821
|
+
function warnDeprecatedOptions({
|
|
1822
|
+
experimentalGlobal,
|
|
1823
|
+
experimentalSimulateCommands,
|
|
1824
|
+
experimentalSimulateSubagents
|
|
1825
|
+
}) {
|
|
1826
|
+
if (experimentalGlobal !== void 0) {
|
|
1827
|
+
logger.warn("'experimentalGlobal' option is deprecated. Please use 'global' instead.");
|
|
1828
|
+
}
|
|
1829
|
+
if (experimentalSimulateCommands !== void 0) {
|
|
1830
|
+
logger.warn(
|
|
1831
|
+
"'experimentalSimulateCommands' option is deprecated. Please use 'simulatedCommands' instead."
|
|
1832
|
+
);
|
|
1833
|
+
}
|
|
1834
|
+
if (experimentalSimulateSubagents !== void 0) {
|
|
1835
|
+
logger.warn(
|
|
1836
|
+
"'experimentalSimulateSubagents' option is deprecated. Please use 'simulatedSubagents' instead."
|
|
1837
|
+
);
|
|
1838
|
+
}
|
|
1839
|
+
}
|
|
1772
1840
|
function getBaseDirsInLightOfGlobal({
|
|
1773
1841
|
baseDirs,
|
|
1774
1842
|
global
|
|
@@ -6783,15 +6851,15 @@ async function generateRules(config) {
|
|
|
6783
6851
|
}
|
|
6784
6852
|
let totalRulesOutputs = 0;
|
|
6785
6853
|
logger.info("Generating rule files...");
|
|
6786
|
-
const toolTargets = config.
|
|
6854
|
+
const toolTargets = config.getGlobal() ? (0, import_es_toolkit2.intersection)(config.getTargets(), RulesProcessor.getToolTargetsGlobal()) : (0, import_es_toolkit2.intersection)(config.getTargets(), RulesProcessor.getToolTargets());
|
|
6787
6855
|
for (const baseDir of config.getBaseDirs()) {
|
|
6788
6856
|
for (const toolTarget of toolTargets) {
|
|
6789
6857
|
const processor = new RulesProcessor({
|
|
6790
6858
|
baseDir,
|
|
6791
6859
|
toolTarget,
|
|
6792
|
-
global: config.
|
|
6793
|
-
simulateCommands: config.
|
|
6794
|
-
simulateSubagents: config.
|
|
6860
|
+
global: config.getGlobal(),
|
|
6861
|
+
simulateCommands: config.getSimulatedCommands(),
|
|
6862
|
+
simulateSubagents: config.getSimulatedSubagents()
|
|
6795
6863
|
});
|
|
6796
6864
|
if (config.getDelete()) {
|
|
6797
6865
|
const oldToolFiles = await processor.loadToolFilesToDelete();
|
|
@@ -6814,7 +6882,7 @@ async function generateIgnore(config) {
|
|
|
6814
6882
|
logger.debug("Skipping ignore file generation (not in --features)");
|
|
6815
6883
|
return 0;
|
|
6816
6884
|
}
|
|
6817
|
-
if (config.
|
|
6885
|
+
if (config.getGlobal()) {
|
|
6818
6886
|
logger.debug("Skipping ignore file generation (not supported in global mode)");
|
|
6819
6887
|
return 0;
|
|
6820
6888
|
}
|
|
@@ -6856,13 +6924,13 @@ async function generateMcp(config) {
|
|
|
6856
6924
|
}
|
|
6857
6925
|
let totalMcpOutputs = 0;
|
|
6858
6926
|
logger.info("Generating MCP files...");
|
|
6859
|
-
const toolTargets = config.
|
|
6927
|
+
const toolTargets = config.getGlobal() ? (0, import_es_toolkit2.intersection)(config.getTargets(), McpProcessor.getToolTargetsGlobal()) : (0, import_es_toolkit2.intersection)(config.getTargets(), McpProcessor.getToolTargets());
|
|
6860
6928
|
for (const baseDir of config.getBaseDirs()) {
|
|
6861
6929
|
for (const toolTarget of toolTargets) {
|
|
6862
6930
|
const processor = new McpProcessor({
|
|
6863
6931
|
baseDir,
|
|
6864
6932
|
toolTarget,
|
|
6865
|
-
global: config.
|
|
6933
|
+
global: config.getGlobal()
|
|
6866
6934
|
});
|
|
6867
6935
|
if (config.getDelete()) {
|
|
6868
6936
|
const oldToolFiles = await processor.loadToolFilesToDelete();
|
|
@@ -6884,10 +6952,10 @@ async function generateCommands(config) {
|
|
|
6884
6952
|
}
|
|
6885
6953
|
let totalCommandOutputs = 0;
|
|
6886
6954
|
logger.info("Generating command files...");
|
|
6887
|
-
const toolTargets = config.
|
|
6955
|
+
const toolTargets = config.getGlobal() ? (0, import_es_toolkit2.intersection)(config.getTargets(), CommandsProcessor.getToolTargetsGlobal()) : (0, import_es_toolkit2.intersection)(
|
|
6888
6956
|
config.getTargets(),
|
|
6889
6957
|
CommandsProcessor.getToolTargets({
|
|
6890
|
-
includeSimulated: config.
|
|
6958
|
+
includeSimulated: config.getSimulatedCommands()
|
|
6891
6959
|
})
|
|
6892
6960
|
);
|
|
6893
6961
|
for (const baseDir of config.getBaseDirs()) {
|
|
@@ -6895,7 +6963,7 @@ async function generateCommands(config) {
|
|
|
6895
6963
|
const processor = new CommandsProcessor({
|
|
6896
6964
|
baseDir,
|
|
6897
6965
|
toolTarget,
|
|
6898
|
-
global: config.
|
|
6966
|
+
global: config.getGlobal()
|
|
6899
6967
|
});
|
|
6900
6968
|
if (config.getDelete()) {
|
|
6901
6969
|
const oldToolFiles = await processor.loadToolFilesToDelete();
|
|
@@ -6917,10 +6985,10 @@ async function generateSubagents(config) {
|
|
|
6917
6985
|
}
|
|
6918
6986
|
let totalSubagentOutputs = 0;
|
|
6919
6987
|
logger.info("Generating subagent files...");
|
|
6920
|
-
const toolTargets = config.
|
|
6988
|
+
const toolTargets = config.getGlobal() ? (0, import_es_toolkit2.intersection)(config.getTargets(), SubagentsProcessor.getToolTargetsGlobal()) : (0, import_es_toolkit2.intersection)(
|
|
6921
6989
|
config.getTargets(),
|
|
6922
6990
|
SubagentsProcessor.getToolTargets({
|
|
6923
|
-
includeSimulated: config.
|
|
6991
|
+
includeSimulated: config.getSimulatedSubagents()
|
|
6924
6992
|
})
|
|
6925
6993
|
);
|
|
6926
6994
|
for (const baseDir of config.getBaseDirs()) {
|
|
@@ -6928,7 +6996,7 @@ async function generateSubagents(config) {
|
|
|
6928
6996
|
const processor = new SubagentsProcessor({
|
|
6929
6997
|
baseDir,
|
|
6930
6998
|
toolTarget,
|
|
6931
|
-
global: config.
|
|
6999
|
+
global: config.getGlobal()
|
|
6932
7000
|
});
|
|
6933
7001
|
if (config.getDelete()) {
|
|
6934
7002
|
const oldToolFiles = await processor.loadToolFilesToDelete();
|
|
@@ -7060,7 +7128,7 @@ async function importRules(config, tool) {
|
|
|
7060
7128
|
if (!config.getFeatures().includes("rules")) {
|
|
7061
7129
|
return 0;
|
|
7062
7130
|
}
|
|
7063
|
-
const global = config.
|
|
7131
|
+
const global = config.getGlobal();
|
|
7064
7132
|
const supportedTargets = global ? RulesProcessor.getToolTargetsGlobal() : RulesProcessor.getToolTargets();
|
|
7065
7133
|
if (!supportedTargets.includes(tool)) {
|
|
7066
7134
|
return 0;
|
|
@@ -7085,7 +7153,7 @@ async function importIgnore(config, tool) {
|
|
|
7085
7153
|
if (!config.getFeatures().includes("ignore")) {
|
|
7086
7154
|
return 0;
|
|
7087
7155
|
}
|
|
7088
|
-
if (config.
|
|
7156
|
+
if (config.getGlobal()) {
|
|
7089
7157
|
logger.debug("Skipping ignore file import (not supported in global mode)");
|
|
7090
7158
|
return 0;
|
|
7091
7159
|
}
|
|
@@ -7114,7 +7182,7 @@ async function importMcp(config, tool) {
|
|
|
7114
7182
|
if (!config.getFeatures().includes("mcp")) {
|
|
7115
7183
|
return 0;
|
|
7116
7184
|
}
|
|
7117
|
-
const global = config.
|
|
7185
|
+
const global = config.getGlobal();
|
|
7118
7186
|
const supportedTargets = global ? McpProcessor.getToolTargetsGlobal() : McpProcessor.getToolTargets();
|
|
7119
7187
|
if (!supportedTargets.includes(tool)) {
|
|
7120
7188
|
return 0;
|
|
@@ -7139,7 +7207,7 @@ async function importCommands(config, tool) {
|
|
|
7139
7207
|
if (!config.getFeatures().includes("commands")) {
|
|
7140
7208
|
return 0;
|
|
7141
7209
|
}
|
|
7142
|
-
const global = config.
|
|
7210
|
+
const global = config.getGlobal();
|
|
7143
7211
|
const supportedTargets = global ? CommandsProcessor.getToolTargetsGlobal() : CommandsProcessor.getToolTargets({ includeSimulated: false });
|
|
7144
7212
|
if (!supportedTargets.includes(tool)) {
|
|
7145
7213
|
return 0;
|
|
@@ -7171,7 +7239,7 @@ async function importSubagents(config, tool) {
|
|
|
7171
7239
|
const subagentsProcessor = new SubagentsProcessor({
|
|
7172
7240
|
baseDir: config.getBaseDirs()[0] ?? ".",
|
|
7173
7241
|
toolTarget: tool,
|
|
7174
|
-
global: config.
|
|
7242
|
+
global: config.getGlobal()
|
|
7175
7243
|
});
|
|
7176
7244
|
const toolFiles = await subagentsProcessor.loadToolFiles();
|
|
7177
7245
|
if (toolFiles.length === 0) {
|
|
@@ -7211,9 +7279,9 @@ async function createConfigFile() {
|
|
|
7211
7279
|
baseDirs: ["."],
|
|
7212
7280
|
delete: true,
|
|
7213
7281
|
verbose: false,
|
|
7214
|
-
|
|
7215
|
-
|
|
7216
|
-
|
|
7282
|
+
global: false,
|
|
7283
|
+
simulatedCommands: false,
|
|
7284
|
+
simulatedSubagents: false
|
|
7217
7285
|
},
|
|
7218
7286
|
null,
|
|
7219
7287
|
2
|
|
@@ -7384,7 +7452,7 @@ Attention, again, you are just the planner, so though you can read any files and
|
|
|
7384
7452
|
}
|
|
7385
7453
|
|
|
7386
7454
|
// src/cli/index.ts
|
|
7387
|
-
var getVersion = () => "3.
|
|
7455
|
+
var getVersion = () => "3.8.0";
|
|
7388
7456
|
var main = async () => {
|
|
7389
7457
|
const program = new import_commander.Command();
|
|
7390
7458
|
const version = getVersion();
|
|
@@ -7408,13 +7476,17 @@ var main = async () => {
|
|
|
7408
7476
|
(value) => {
|
|
7409
7477
|
return value.split(",").map((f) => f.trim());
|
|
7410
7478
|
}
|
|
7411
|
-
).option("-V, --verbose", "Verbose output").option("-g, --
|
|
7479
|
+
).option("-V, --verbose", "Verbose output").option("-g, --global", "Import for global(user scope) configuration files").option(
|
|
7480
|
+
"--experimental-global",
|
|
7481
|
+
"Import for global(user scope) configuration files (deprecated: use --global instead)"
|
|
7482
|
+
).action(async (options) => {
|
|
7412
7483
|
try {
|
|
7413
7484
|
await importCommand({
|
|
7414
7485
|
targets: options.targets,
|
|
7415
7486
|
features: options.features,
|
|
7416
7487
|
verbose: options.verbose,
|
|
7417
7488
|
configPath: options.config,
|
|
7489
|
+
global: options.global,
|
|
7418
7490
|
experimentalGlobal: options.experimentalGlobal
|
|
7419
7491
|
});
|
|
7420
7492
|
} catch (error) {
|
|
@@ -7437,12 +7509,21 @@ var main = async () => {
|
|
|
7437
7509
|
).option("--delete", "Delete all existing files in output directories before generating").option(
|
|
7438
7510
|
"-b, --base-dir <paths>",
|
|
7439
7511
|
"Base directories to generate files (comma-separated for multiple paths)"
|
|
7440
|
-
).option("-V, --verbose", "Verbose output").option("-c, --config <path>", "Path to configuration file").option("-g, --
|
|
7512
|
+
).option("-V, --verbose", "Verbose output").option("-c, --config <path>", "Path to configuration file").option("-g, --global", "Generate for global(user scope) configuration files").option(
|
|
7513
|
+
"--simulated-commands",
|
|
7514
|
+
"Generate simulated commands. This feature is only available for copilot, cursor and codexcli."
|
|
7515
|
+
).option(
|
|
7516
|
+
"--simulated-subagents",
|
|
7517
|
+
"Generate simulated subagents. This feature is only available for copilot, cursor and codexcli."
|
|
7518
|
+
).option(
|
|
7519
|
+
"--experimental-global",
|
|
7520
|
+
"Generate for global(user scope) configuration files (deprecated: use --global instead)"
|
|
7521
|
+
).option(
|
|
7441
7522
|
"--experimental-simulate-commands",
|
|
7442
|
-
"Generate simulated commands (
|
|
7523
|
+
"Generate simulated commands (deprecated: use --simulated-commands instead)"
|
|
7443
7524
|
).option(
|
|
7444
7525
|
"--experimental-simulate-subagents",
|
|
7445
|
-
"Generate simulated subagents (
|
|
7526
|
+
"Generate simulated subagents (deprecated: use --simulated-subagents instead)"
|
|
7446
7527
|
).action(async (options) => {
|
|
7447
7528
|
try {
|
|
7448
7529
|
await generateCommand({
|
|
@@ -7452,6 +7533,9 @@ var main = async () => {
|
|
|
7452
7533
|
delete: options.delete,
|
|
7453
7534
|
baseDirs: options.baseDirs,
|
|
7454
7535
|
configPath: options.config,
|
|
7536
|
+
global: options.global,
|
|
7537
|
+
simulatedCommands: options.simulatedCommands,
|
|
7538
|
+
simulatedSubagents: options.simulatedSubagents,
|
|
7455
7539
|
experimentalGlobal: options.experimentalGlobal,
|
|
7456
7540
|
experimentalSimulateCommands: options.experimentalSimulateCommands,
|
|
7457
7541
|
experimentalSimulateSubagents: options.experimentalSimulateSubagents
|
package/dist/index.js
CHANGED
|
@@ -1625,15 +1625,18 @@ var Config = class {
|
|
|
1625
1625
|
features;
|
|
1626
1626
|
verbose;
|
|
1627
1627
|
delete;
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1628
|
+
global;
|
|
1629
|
+
simulatedCommands;
|
|
1630
|
+
simulatedSubagents;
|
|
1631
1631
|
constructor({
|
|
1632
1632
|
baseDirs,
|
|
1633
1633
|
targets,
|
|
1634
1634
|
features,
|
|
1635
1635
|
verbose,
|
|
1636
1636
|
delete: isDelete,
|
|
1637
|
+
global,
|
|
1638
|
+
simulatedCommands,
|
|
1639
|
+
simulatedSubagents,
|
|
1637
1640
|
experimentalGlobal,
|
|
1638
1641
|
experimentalSimulateCommands,
|
|
1639
1642
|
experimentalSimulateSubagents
|
|
@@ -1643,9 +1646,9 @@ var Config = class {
|
|
|
1643
1646
|
this.features = features;
|
|
1644
1647
|
this.verbose = verbose;
|
|
1645
1648
|
this.delete = isDelete;
|
|
1646
|
-
this.
|
|
1647
|
-
this.
|
|
1648
|
-
this.
|
|
1649
|
+
this.global = global ?? experimentalGlobal ?? false;
|
|
1650
|
+
this.simulatedCommands = simulatedCommands ?? experimentalSimulateCommands ?? false;
|
|
1651
|
+
this.simulatedSubagents = simulatedSubagents ?? experimentalSimulateSubagents ?? false;
|
|
1649
1652
|
}
|
|
1650
1653
|
getBaseDirs() {
|
|
1651
1654
|
return this.baseDirs;
|
|
@@ -1668,14 +1671,27 @@ var Config = class {
|
|
|
1668
1671
|
getDelete() {
|
|
1669
1672
|
return this.delete;
|
|
1670
1673
|
}
|
|
1674
|
+
getGlobal() {
|
|
1675
|
+
return this.global;
|
|
1676
|
+
}
|
|
1677
|
+
getSimulatedCommands() {
|
|
1678
|
+
return this.simulatedCommands;
|
|
1679
|
+
}
|
|
1680
|
+
getSimulatedSubagents() {
|
|
1681
|
+
return this.simulatedSubagents;
|
|
1682
|
+
}
|
|
1683
|
+
// Deprecated getters for backward compatibility
|
|
1684
|
+
/** @deprecated Use getGlobal() instead */
|
|
1671
1685
|
getExperimentalGlobal() {
|
|
1672
|
-
return this.
|
|
1686
|
+
return this.global;
|
|
1673
1687
|
}
|
|
1688
|
+
/** @deprecated Use getSimulatedCommands() instead */
|
|
1674
1689
|
getExperimentalSimulateCommands() {
|
|
1675
|
-
return this.
|
|
1690
|
+
return this.simulatedCommands;
|
|
1676
1691
|
}
|
|
1692
|
+
/** @deprecated Use getSimulatedSubagents() instead */
|
|
1677
1693
|
getExperimentalSimulateSubagents() {
|
|
1678
|
-
return this.
|
|
1694
|
+
return this.simulatedSubagents;
|
|
1679
1695
|
}
|
|
1680
1696
|
};
|
|
1681
1697
|
|
|
@@ -1687,6 +1703,9 @@ var defaults = {
|
|
|
1687
1703
|
delete: false,
|
|
1688
1704
|
baseDirs: ["."],
|
|
1689
1705
|
configPath: "rulesync.jsonc",
|
|
1706
|
+
global: false,
|
|
1707
|
+
simulatedCommands: false,
|
|
1708
|
+
simulatedSubagents: false,
|
|
1690
1709
|
experimentalGlobal: false,
|
|
1691
1710
|
experimentalSimulateCommands: false,
|
|
1692
1711
|
experimentalSimulateSubagents: false
|
|
@@ -1699,11 +1718,26 @@ var ConfigResolver = class {
|
|
|
1699
1718
|
delete: isDelete,
|
|
1700
1719
|
baseDirs,
|
|
1701
1720
|
configPath = defaults.configPath,
|
|
1721
|
+
global,
|
|
1722
|
+
simulatedCommands,
|
|
1723
|
+
simulatedSubagents,
|
|
1702
1724
|
experimentalGlobal,
|
|
1703
1725
|
experimentalSimulateCommands,
|
|
1704
1726
|
experimentalSimulateSubagents
|
|
1705
1727
|
}) {
|
|
1706
1728
|
if (!await fileExists(configPath)) {
|
|
1729
|
+
if (experimentalGlobal !== void 0) {
|
|
1730
|
+
warnDeprecatedOptions({ experimentalGlobal });
|
|
1731
|
+
}
|
|
1732
|
+
if (experimentalSimulateCommands !== void 0) {
|
|
1733
|
+
warnDeprecatedOptions({ experimentalSimulateCommands });
|
|
1734
|
+
}
|
|
1735
|
+
if (experimentalSimulateSubagents !== void 0) {
|
|
1736
|
+
warnDeprecatedOptions({ experimentalSimulateSubagents });
|
|
1737
|
+
}
|
|
1738
|
+
const resolvedGlobal2 = global ?? experimentalGlobal ?? defaults.global;
|
|
1739
|
+
const resolvedSimulatedCommands2 = simulatedCommands ?? experimentalSimulateCommands ?? defaults.simulatedCommands;
|
|
1740
|
+
const resolvedSimulatedSubagents2 = simulatedSubagents ?? experimentalSimulateSubagents ?? defaults.simulatedSubagents;
|
|
1707
1741
|
return new Config({
|
|
1708
1742
|
targets: targets ?? defaults.targets,
|
|
1709
1743
|
features: features ?? defaults.features,
|
|
@@ -1711,11 +1745,11 @@ var ConfigResolver = class {
|
|
|
1711
1745
|
delete: isDelete ?? defaults.delete,
|
|
1712
1746
|
baseDirs: getBaseDirsInLightOfGlobal({
|
|
1713
1747
|
baseDirs: baseDirs ?? defaults.baseDirs,
|
|
1714
|
-
global:
|
|
1748
|
+
global: resolvedGlobal2
|
|
1715
1749
|
}),
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1750
|
+
global: resolvedGlobal2,
|
|
1751
|
+
simulatedCommands: resolvedSimulatedCommands2,
|
|
1752
|
+
simulatedSubagents: resolvedSimulatedSubagents2
|
|
1719
1753
|
});
|
|
1720
1754
|
}
|
|
1721
1755
|
const loadOptions = {
|
|
@@ -1730,6 +1764,21 @@ var ConfigResolver = class {
|
|
|
1730
1764
|
loadOptions.configFile = configPath;
|
|
1731
1765
|
}
|
|
1732
1766
|
const { config: configByFile } = await loadConfig(loadOptions);
|
|
1767
|
+
const deprecatedGlobal = experimentalGlobal ?? configByFile.experimentalGlobal;
|
|
1768
|
+
const deprecatedCommands = experimentalSimulateCommands ?? configByFile.experimentalSimulateCommands;
|
|
1769
|
+
const deprecatedSubagents = experimentalSimulateSubagents ?? configByFile.experimentalSimulateSubagents;
|
|
1770
|
+
if (deprecatedGlobal !== void 0) {
|
|
1771
|
+
warnDeprecatedOptions({ experimentalGlobal: deprecatedGlobal });
|
|
1772
|
+
}
|
|
1773
|
+
if (deprecatedCommands !== void 0) {
|
|
1774
|
+
warnDeprecatedOptions({ experimentalSimulateCommands: deprecatedCommands });
|
|
1775
|
+
}
|
|
1776
|
+
if (deprecatedSubagents !== void 0) {
|
|
1777
|
+
warnDeprecatedOptions({ experimentalSimulateSubagents: deprecatedSubagents });
|
|
1778
|
+
}
|
|
1779
|
+
const resolvedGlobal = global ?? configByFile.global ?? experimentalGlobal ?? configByFile.experimentalGlobal ?? defaults.global;
|
|
1780
|
+
const resolvedSimulatedCommands = simulatedCommands ?? configByFile.simulatedCommands ?? experimentalSimulateCommands ?? configByFile.experimentalSimulateCommands ?? defaults.simulatedCommands;
|
|
1781
|
+
const resolvedSimulatedSubagents = simulatedSubagents ?? configByFile.simulatedSubagents ?? experimentalSimulateSubagents ?? configByFile.experimentalSimulateSubagents ?? defaults.simulatedSubagents;
|
|
1733
1782
|
const configParams = {
|
|
1734
1783
|
targets: targets ?? configByFile.targets ?? defaults.targets,
|
|
1735
1784
|
features: features ?? configByFile.features ?? defaults.features,
|
|
@@ -1737,15 +1786,34 @@ var ConfigResolver = class {
|
|
|
1737
1786
|
delete: isDelete ?? configByFile.delete ?? defaults.delete,
|
|
1738
1787
|
baseDirs: getBaseDirsInLightOfGlobal({
|
|
1739
1788
|
baseDirs: baseDirs ?? configByFile.baseDirs ?? defaults.baseDirs,
|
|
1740
|
-
global:
|
|
1789
|
+
global: resolvedGlobal
|
|
1741
1790
|
}),
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1791
|
+
global: resolvedGlobal,
|
|
1792
|
+
simulatedCommands: resolvedSimulatedCommands,
|
|
1793
|
+
simulatedSubagents: resolvedSimulatedSubagents
|
|
1745
1794
|
};
|
|
1746
1795
|
return new Config(configParams);
|
|
1747
1796
|
}
|
|
1748
1797
|
};
|
|
1798
|
+
function warnDeprecatedOptions({
|
|
1799
|
+
experimentalGlobal,
|
|
1800
|
+
experimentalSimulateCommands,
|
|
1801
|
+
experimentalSimulateSubagents
|
|
1802
|
+
}) {
|
|
1803
|
+
if (experimentalGlobal !== void 0) {
|
|
1804
|
+
logger.warn("'experimentalGlobal' option is deprecated. Please use 'global' instead.");
|
|
1805
|
+
}
|
|
1806
|
+
if (experimentalSimulateCommands !== void 0) {
|
|
1807
|
+
logger.warn(
|
|
1808
|
+
"'experimentalSimulateCommands' option is deprecated. Please use 'simulatedCommands' instead."
|
|
1809
|
+
);
|
|
1810
|
+
}
|
|
1811
|
+
if (experimentalSimulateSubagents !== void 0) {
|
|
1812
|
+
logger.warn(
|
|
1813
|
+
"'experimentalSimulateSubagents' option is deprecated. Please use 'simulatedSubagents' instead."
|
|
1814
|
+
);
|
|
1815
|
+
}
|
|
1816
|
+
}
|
|
1749
1817
|
function getBaseDirsInLightOfGlobal({
|
|
1750
1818
|
baseDirs,
|
|
1751
1819
|
global
|
|
@@ -6760,15 +6828,15 @@ async function generateRules(config) {
|
|
|
6760
6828
|
}
|
|
6761
6829
|
let totalRulesOutputs = 0;
|
|
6762
6830
|
logger.info("Generating rule files...");
|
|
6763
|
-
const toolTargets = config.
|
|
6831
|
+
const toolTargets = config.getGlobal() ? intersection(config.getTargets(), RulesProcessor.getToolTargetsGlobal()) : intersection(config.getTargets(), RulesProcessor.getToolTargets());
|
|
6764
6832
|
for (const baseDir of config.getBaseDirs()) {
|
|
6765
6833
|
for (const toolTarget of toolTargets) {
|
|
6766
6834
|
const processor = new RulesProcessor({
|
|
6767
6835
|
baseDir,
|
|
6768
6836
|
toolTarget,
|
|
6769
|
-
global: config.
|
|
6770
|
-
simulateCommands: config.
|
|
6771
|
-
simulateSubagents: config.
|
|
6837
|
+
global: config.getGlobal(),
|
|
6838
|
+
simulateCommands: config.getSimulatedCommands(),
|
|
6839
|
+
simulateSubagents: config.getSimulatedSubagents()
|
|
6772
6840
|
});
|
|
6773
6841
|
if (config.getDelete()) {
|
|
6774
6842
|
const oldToolFiles = await processor.loadToolFilesToDelete();
|
|
@@ -6791,7 +6859,7 @@ async function generateIgnore(config) {
|
|
|
6791
6859
|
logger.debug("Skipping ignore file generation (not in --features)");
|
|
6792
6860
|
return 0;
|
|
6793
6861
|
}
|
|
6794
|
-
if (config.
|
|
6862
|
+
if (config.getGlobal()) {
|
|
6795
6863
|
logger.debug("Skipping ignore file generation (not supported in global mode)");
|
|
6796
6864
|
return 0;
|
|
6797
6865
|
}
|
|
@@ -6833,13 +6901,13 @@ async function generateMcp(config) {
|
|
|
6833
6901
|
}
|
|
6834
6902
|
let totalMcpOutputs = 0;
|
|
6835
6903
|
logger.info("Generating MCP files...");
|
|
6836
|
-
const toolTargets = config.
|
|
6904
|
+
const toolTargets = config.getGlobal() ? intersection(config.getTargets(), McpProcessor.getToolTargetsGlobal()) : intersection(config.getTargets(), McpProcessor.getToolTargets());
|
|
6837
6905
|
for (const baseDir of config.getBaseDirs()) {
|
|
6838
6906
|
for (const toolTarget of toolTargets) {
|
|
6839
6907
|
const processor = new McpProcessor({
|
|
6840
6908
|
baseDir,
|
|
6841
6909
|
toolTarget,
|
|
6842
|
-
global: config.
|
|
6910
|
+
global: config.getGlobal()
|
|
6843
6911
|
});
|
|
6844
6912
|
if (config.getDelete()) {
|
|
6845
6913
|
const oldToolFiles = await processor.loadToolFilesToDelete();
|
|
@@ -6861,10 +6929,10 @@ async function generateCommands(config) {
|
|
|
6861
6929
|
}
|
|
6862
6930
|
let totalCommandOutputs = 0;
|
|
6863
6931
|
logger.info("Generating command files...");
|
|
6864
|
-
const toolTargets = config.
|
|
6932
|
+
const toolTargets = config.getGlobal() ? intersection(config.getTargets(), CommandsProcessor.getToolTargetsGlobal()) : intersection(
|
|
6865
6933
|
config.getTargets(),
|
|
6866
6934
|
CommandsProcessor.getToolTargets({
|
|
6867
|
-
includeSimulated: config.
|
|
6935
|
+
includeSimulated: config.getSimulatedCommands()
|
|
6868
6936
|
})
|
|
6869
6937
|
);
|
|
6870
6938
|
for (const baseDir of config.getBaseDirs()) {
|
|
@@ -6872,7 +6940,7 @@ async function generateCommands(config) {
|
|
|
6872
6940
|
const processor = new CommandsProcessor({
|
|
6873
6941
|
baseDir,
|
|
6874
6942
|
toolTarget,
|
|
6875
|
-
global: config.
|
|
6943
|
+
global: config.getGlobal()
|
|
6876
6944
|
});
|
|
6877
6945
|
if (config.getDelete()) {
|
|
6878
6946
|
const oldToolFiles = await processor.loadToolFilesToDelete();
|
|
@@ -6894,10 +6962,10 @@ async function generateSubagents(config) {
|
|
|
6894
6962
|
}
|
|
6895
6963
|
let totalSubagentOutputs = 0;
|
|
6896
6964
|
logger.info("Generating subagent files...");
|
|
6897
|
-
const toolTargets = config.
|
|
6965
|
+
const toolTargets = config.getGlobal() ? intersection(config.getTargets(), SubagentsProcessor.getToolTargetsGlobal()) : intersection(
|
|
6898
6966
|
config.getTargets(),
|
|
6899
6967
|
SubagentsProcessor.getToolTargets({
|
|
6900
|
-
includeSimulated: config.
|
|
6968
|
+
includeSimulated: config.getSimulatedSubagents()
|
|
6901
6969
|
})
|
|
6902
6970
|
);
|
|
6903
6971
|
for (const baseDir of config.getBaseDirs()) {
|
|
@@ -6905,7 +6973,7 @@ async function generateSubagents(config) {
|
|
|
6905
6973
|
const processor = new SubagentsProcessor({
|
|
6906
6974
|
baseDir,
|
|
6907
6975
|
toolTarget,
|
|
6908
|
-
global: config.
|
|
6976
|
+
global: config.getGlobal()
|
|
6909
6977
|
});
|
|
6910
6978
|
if (config.getDelete()) {
|
|
6911
6979
|
const oldToolFiles = await processor.loadToolFilesToDelete();
|
|
@@ -7037,7 +7105,7 @@ async function importRules(config, tool) {
|
|
|
7037
7105
|
if (!config.getFeatures().includes("rules")) {
|
|
7038
7106
|
return 0;
|
|
7039
7107
|
}
|
|
7040
|
-
const global = config.
|
|
7108
|
+
const global = config.getGlobal();
|
|
7041
7109
|
const supportedTargets = global ? RulesProcessor.getToolTargetsGlobal() : RulesProcessor.getToolTargets();
|
|
7042
7110
|
if (!supportedTargets.includes(tool)) {
|
|
7043
7111
|
return 0;
|
|
@@ -7062,7 +7130,7 @@ async function importIgnore(config, tool) {
|
|
|
7062
7130
|
if (!config.getFeatures().includes("ignore")) {
|
|
7063
7131
|
return 0;
|
|
7064
7132
|
}
|
|
7065
|
-
if (config.
|
|
7133
|
+
if (config.getGlobal()) {
|
|
7066
7134
|
logger.debug("Skipping ignore file import (not supported in global mode)");
|
|
7067
7135
|
return 0;
|
|
7068
7136
|
}
|
|
@@ -7091,7 +7159,7 @@ async function importMcp(config, tool) {
|
|
|
7091
7159
|
if (!config.getFeatures().includes("mcp")) {
|
|
7092
7160
|
return 0;
|
|
7093
7161
|
}
|
|
7094
|
-
const global = config.
|
|
7162
|
+
const global = config.getGlobal();
|
|
7095
7163
|
const supportedTargets = global ? McpProcessor.getToolTargetsGlobal() : McpProcessor.getToolTargets();
|
|
7096
7164
|
if (!supportedTargets.includes(tool)) {
|
|
7097
7165
|
return 0;
|
|
@@ -7116,7 +7184,7 @@ async function importCommands(config, tool) {
|
|
|
7116
7184
|
if (!config.getFeatures().includes("commands")) {
|
|
7117
7185
|
return 0;
|
|
7118
7186
|
}
|
|
7119
|
-
const global = config.
|
|
7187
|
+
const global = config.getGlobal();
|
|
7120
7188
|
const supportedTargets = global ? CommandsProcessor.getToolTargetsGlobal() : CommandsProcessor.getToolTargets({ includeSimulated: false });
|
|
7121
7189
|
if (!supportedTargets.includes(tool)) {
|
|
7122
7190
|
return 0;
|
|
@@ -7148,7 +7216,7 @@ async function importSubagents(config, tool) {
|
|
|
7148
7216
|
const subagentsProcessor = new SubagentsProcessor({
|
|
7149
7217
|
baseDir: config.getBaseDirs()[0] ?? ".",
|
|
7150
7218
|
toolTarget: tool,
|
|
7151
|
-
global: config.
|
|
7219
|
+
global: config.getGlobal()
|
|
7152
7220
|
});
|
|
7153
7221
|
const toolFiles = await subagentsProcessor.loadToolFiles();
|
|
7154
7222
|
if (toolFiles.length === 0) {
|
|
@@ -7188,9 +7256,9 @@ async function createConfigFile() {
|
|
|
7188
7256
|
baseDirs: ["."],
|
|
7189
7257
|
delete: true,
|
|
7190
7258
|
verbose: false,
|
|
7191
|
-
|
|
7192
|
-
|
|
7193
|
-
|
|
7259
|
+
global: false,
|
|
7260
|
+
simulatedCommands: false,
|
|
7261
|
+
simulatedSubagents: false
|
|
7194
7262
|
},
|
|
7195
7263
|
null,
|
|
7196
7264
|
2
|
|
@@ -7361,7 +7429,7 @@ Attention, again, you are just the planner, so though you can read any files and
|
|
|
7361
7429
|
}
|
|
7362
7430
|
|
|
7363
7431
|
// src/cli/index.ts
|
|
7364
|
-
var getVersion = () => "3.
|
|
7432
|
+
var getVersion = () => "3.8.0";
|
|
7365
7433
|
var main = async () => {
|
|
7366
7434
|
const program = new Command();
|
|
7367
7435
|
const version = getVersion();
|
|
@@ -7385,13 +7453,17 @@ var main = async () => {
|
|
|
7385
7453
|
(value) => {
|
|
7386
7454
|
return value.split(",").map((f) => f.trim());
|
|
7387
7455
|
}
|
|
7388
|
-
).option("-V, --verbose", "Verbose output").option("-g, --
|
|
7456
|
+
).option("-V, --verbose", "Verbose output").option("-g, --global", "Import for global(user scope) configuration files").option(
|
|
7457
|
+
"--experimental-global",
|
|
7458
|
+
"Import for global(user scope) configuration files (deprecated: use --global instead)"
|
|
7459
|
+
).action(async (options) => {
|
|
7389
7460
|
try {
|
|
7390
7461
|
await importCommand({
|
|
7391
7462
|
targets: options.targets,
|
|
7392
7463
|
features: options.features,
|
|
7393
7464
|
verbose: options.verbose,
|
|
7394
7465
|
configPath: options.config,
|
|
7466
|
+
global: options.global,
|
|
7395
7467
|
experimentalGlobal: options.experimentalGlobal
|
|
7396
7468
|
});
|
|
7397
7469
|
} catch (error) {
|
|
@@ -7414,12 +7486,21 @@ var main = async () => {
|
|
|
7414
7486
|
).option("--delete", "Delete all existing files in output directories before generating").option(
|
|
7415
7487
|
"-b, --base-dir <paths>",
|
|
7416
7488
|
"Base directories to generate files (comma-separated for multiple paths)"
|
|
7417
|
-
).option("-V, --verbose", "Verbose output").option("-c, --config <path>", "Path to configuration file").option("-g, --
|
|
7489
|
+
).option("-V, --verbose", "Verbose output").option("-c, --config <path>", "Path to configuration file").option("-g, --global", "Generate for global(user scope) configuration files").option(
|
|
7490
|
+
"--simulated-commands",
|
|
7491
|
+
"Generate simulated commands. This feature is only available for copilot, cursor and codexcli."
|
|
7492
|
+
).option(
|
|
7493
|
+
"--simulated-subagents",
|
|
7494
|
+
"Generate simulated subagents. This feature is only available for copilot, cursor and codexcli."
|
|
7495
|
+
).option(
|
|
7496
|
+
"--experimental-global",
|
|
7497
|
+
"Generate for global(user scope) configuration files (deprecated: use --global instead)"
|
|
7498
|
+
).option(
|
|
7418
7499
|
"--experimental-simulate-commands",
|
|
7419
|
-
"Generate simulated commands (
|
|
7500
|
+
"Generate simulated commands (deprecated: use --simulated-commands instead)"
|
|
7420
7501
|
).option(
|
|
7421
7502
|
"--experimental-simulate-subagents",
|
|
7422
|
-
"Generate simulated subagents (
|
|
7503
|
+
"Generate simulated subagents (deprecated: use --simulated-subagents instead)"
|
|
7423
7504
|
).action(async (options) => {
|
|
7424
7505
|
try {
|
|
7425
7506
|
await generateCommand({
|
|
@@ -7429,6 +7510,9 @@ var main = async () => {
|
|
|
7429
7510
|
delete: options.delete,
|
|
7430
7511
|
baseDirs: options.baseDirs,
|
|
7431
7512
|
configPath: options.config,
|
|
7513
|
+
global: options.global,
|
|
7514
|
+
simulatedCommands: options.simulatedCommands,
|
|
7515
|
+
simulatedSubagents: options.simulatedSubagents,
|
|
7432
7516
|
experimentalGlobal: options.experimentalGlobal,
|
|
7433
7517
|
experimentalSimulateCommands: options.experimentalSimulateCommands,
|
|
7434
7518
|
experimentalSimulateSubagents: options.experimentalSimulateSubagents
|