use "rule profiles" instead of "rules profiles"
This commit is contained in:
@@ -5,7 +5,7 @@ import {
|
||||
// isSilentMode // Not used directly here
|
||||
} from '../../../../scripts/modules/utils.js';
|
||||
import os from 'os'; // Import os module for home directory check
|
||||
import { RULES_PROFILES } from '../../../../src/constants/profiles.js';
|
||||
import { RULE_PROFILES } from '../../../../src/constants/profiles.js';
|
||||
import { convertAllRulesToProfileRules } from '../../../../src/utils/rule-transformer.js';
|
||||
|
||||
/**
|
||||
@@ -76,9 +76,9 @@ export async function initializeProjectDirect(args, log, context = {}) {
|
||||
options.rules = args.rules;
|
||||
log.info(`Including rules: ${args.rules.join(', ')}`);
|
||||
} else {
|
||||
options.rules = RULES_PROFILES;
|
||||
options.rules = RULE_PROFILES;
|
||||
log.info(
|
||||
`No rules profiles specified, defaulting to: ${RULES_PROFILES.join(', ')}`
|
||||
`No rule profiles specified, defaulting to: ${RULE_PROFILES.join(', ')}`
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
getRulesProfile,
|
||||
isValidProfile
|
||||
} from '../../../../src/utils/rule-transformer.js';
|
||||
import { RULES_PROFILES } from '../../../../src/constants/profiles.js';
|
||||
import { RULE_PROFILES } from '../../../../src/constants/profiles.js';
|
||||
import { RULES_ACTIONS } from '../../../../src/constants/rules-actions.js';
|
||||
import {
|
||||
wouldRemovalLeaveNoProfiles,
|
||||
@@ -56,7 +56,7 @@ export async function rulesDirect(args, log, context = {}) {
|
||||
const addResults = [];
|
||||
|
||||
if (action === RULES_ACTIONS.REMOVE) {
|
||||
// Safety check: Ensure this won't remove all rules profiles (unless forced)
|
||||
// Safety check: Ensure this won't remove all rule profiles (unless forced)
|
||||
if (!force && wouldRemovalLeaveNoProfiles(projectRoot, profiles)) {
|
||||
const installedProfiles = getInstalledProfiles(projectRoot);
|
||||
const remainingProfiles = installedProfiles.filter(
|
||||
@@ -66,7 +66,7 @@ export async function rulesDirect(args, log, context = {}) {
|
||||
success: false,
|
||||
error: {
|
||||
code: 'CRITICAL_REMOVAL_BLOCKED',
|
||||
message: `CRITICAL: This operation would remove ALL remaining rules profiles (${profiles.join(', ')}), leaving your project with no rules configurations. This could significantly impact functionality. Currently installed profiles: ${installedProfiles.join(', ')}. If you're certain you want to proceed, set force: true or use the CLI with --force flag.`
|
||||
message: `CRITICAL: This operation would remove ALL remaining rule profiles (${profiles.join(', ')}), leaving your project with no rules configurations. This could significantly impact functionality. Currently installed profiles: ${installedProfiles.join(', ')}. If you're certain you want to proceed, set force: true or use the CLI with --force flag.`
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -76,7 +76,7 @@ export async function rulesDirect(args, log, context = {}) {
|
||||
removalResults.push({
|
||||
profileName: profile,
|
||||
success: false,
|
||||
error: `The requested rules profile for '${profile}' is unavailable. Supported profiles are: ${RULES_PROFILES.join(', ')}.`
|
||||
error: `The requested rules profile for '${profile}' is unavailable. Supported profiles are: ${RULE_PROFILES.join(', ')}.`
|
||||
});
|
||||
continue;
|
||||
}
|
||||
@@ -121,7 +121,7 @@ export async function rulesDirect(args, log, context = {}) {
|
||||
addResults.push({
|
||||
profileName: profile,
|
||||
success: false,
|
||||
error: `Profile not found: static import missing for '${profile}'. Valid profiles: ${RULES_PROFILES.join(', ')}`
|
||||
error: `Profile not found: static import missing for '${profile}'. Valid profiles: ${RULE_PROFILES.join(', ')}`
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
withNormalizedProjectRoot
|
||||
} from './utils.js';
|
||||
import { initializeProjectDirect } from '../core/task-master-core.js';
|
||||
import { RULES_PROFILES } from '../../../src/constants/profiles.js';
|
||||
import { RULE_PROFILES } from '../../../src/constants/profiles.js';
|
||||
|
||||
export function registerInitializeProjectTool(server) {
|
||||
server.addTool({
|
||||
@@ -38,10 +38,10 @@ export function registerInitializeProjectTool(server) {
|
||||
'The root directory for the project. ALWAYS SET THIS TO THE PROJECT ROOT DIRECTORY. IF NOT SET, THE TOOL WILL NOT WORK.'
|
||||
),
|
||||
rules: z
|
||||
.array(z.enum(RULES_PROFILES))
|
||||
.array(z.enum(RULE_PROFILES))
|
||||
.optional()
|
||||
.describe(
|
||||
`List of rules profiles to include at initialization. If omitted, defaults to all available profiles. Available options: ${RULES_PROFILES.join(', ')}`
|
||||
`List of rule profiles to include at initialization. If omitted, defaults to all available profiles. Available options: ${RULE_PROFILES.join(', ')}`
|
||||
)
|
||||
}),
|
||||
execute: withNormalizedProjectRoot(async (args, context) => {
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
withNormalizedProjectRoot
|
||||
} from './utils.js';
|
||||
import { rulesDirect } from '../core/direct-functions/rules.js';
|
||||
import { RULES_PROFILES } from '../../../src/constants/profiles.js';
|
||||
import { RULE_PROFILES } from '../../../src/constants/profiles.js';
|
||||
|
||||
/**
|
||||
* Register the rules tool with the MCP server
|
||||
@@ -19,16 +19,16 @@ import { RULES_PROFILES } from '../../../src/constants/profiles.js';
|
||||
export function registerRulesTool(server) {
|
||||
server.addTool({
|
||||
name: 'rules',
|
||||
description: 'Add or remove rules profiles from the project.',
|
||||
description: 'Add or remove rule profiles from the project.',
|
||||
parameters: z.object({
|
||||
action: z
|
||||
.enum(['add', 'remove'])
|
||||
.describe('Whether to add or remove rules profiles.'),
|
||||
.describe('Whether to add or remove rule profiles.'),
|
||||
profiles: z
|
||||
.array(z.enum(RULES_PROFILES))
|
||||
.array(z.enum(RULE_PROFILES))
|
||||
.min(1)
|
||||
.describe(
|
||||
`List of rules profiles to add or remove (e.g., [\"cursor\", \"roo\"]). Available options: ${RULES_PROFILES.join(', ')}`
|
||||
`List of rule profiles to add or remove (e.g., [\"cursor\", \"roo\"]). Available options: ${RULE_PROFILES.join(', ')}`
|
||||
),
|
||||
projectRoot: z
|
||||
.string()
|
||||
@@ -40,7 +40,7 @@ export function registerRulesTool(server) {
|
||||
.optional()
|
||||
.default(false)
|
||||
.describe(
|
||||
'DANGEROUS: Force removal even if it would leave no rules profiles. Only use if you are absolutely certain.'
|
||||
'DANGEROUS: Force removal even if it would leave no rule profiles. Only use if you are absolutely certain.'
|
||||
)
|
||||
}),
|
||||
execute: withNormalizedProjectRoot(async (args, { log, session }) => {
|
||||
|
||||
Reference in New Issue
Block a user