@adobe-commerce/aio-toolkit 1.2.4 → 1.2.6
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/CHANGELOG.md +145 -0
- package/README.md +169 -0
- package/dist/aio-toolkit-cli-workflow/bin/cli.js +2048 -0
- package/dist/aio-toolkit-cli-workflow/bin/cli.js.map +1 -0
- package/dist/aio-toolkit-cursor-context/bin/cli.js +16 -0
- package/dist/aio-toolkit-cursor-context/bin/cli.js.map +1 -1
- package/dist/index.d.mts +51 -6
- package/dist/index.d.ts +51 -6
- package/dist/index.js +209 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +213 -0
- package/dist/index.mjs.map +1 -1
- package/files/cursor-context/commands/aio-toolkit-analyze-adobe-commerce-module.md +612 -0
- package/files/cursor-context/commands/aio-toolkit-create-amazon-sqs-consumer.md +445 -0
- package/files/cursor-context/commands/aio-toolkit-create-event-consumer-action.md +6 -0
- package/files/cursor-context/commands/aio-toolkit-create-graphql-action.md +21 -7
- package/files/cursor-context/commands/aio-toolkit-create-openwhisk-action.md +326 -0
- package/files/cursor-context/commands/aio-toolkit-create-runtime-action.md +15 -5
- package/files/cursor-context/commands/aio-toolkit-create-shipping-carrier.md +681 -0
- package/files/cursor-context/commands/aio-toolkit-create-webhook-action.md +22 -9
- package/files/cursor-context/rules/aio-toolkit-create-adobe-commerce-client.mdc +252 -116
- package/files/cursor-context/rules/aio-toolkit-oop-best-practices.mdc +10 -4
- package/files/cursor-context/rules/aio-toolkit-setup-new-relic-telemetry.mdc +167 -2
- package/files/cursor-context/rules/aio-toolkit-use-abdb-collection.mdc +610 -0
- package/files/cursor-context/rules/aio-toolkit-use-abdb-repository.mdc +705 -0
- package/files/cursor-context/rules/aio-toolkit-use-adobe-auth.mdc +442 -0
- package/files/cursor-context/rules/aio-toolkit-use-amazon-sqs-publish.mdc +397 -0
- package/files/cursor-context/rules/aio-toolkit-use-file-repository.mdc +502 -0
- package/files/cursor-context/rules/aio-toolkit-use-publish-event.mdc +510 -0
- package/files/cursor-context/rules/aio-toolkit-use-runtime-api-gateway-service.mdc +542 -0
- package/package.json +4 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/commands/framework/command/abstract/index.ts","../../../src/commands/framework/command/base-help/index.ts","../../../src/commands/cursor-context/lib/help/index.ts","../../../src/commands/framework/helpers/package-rules-path/index.ts","../../../src/commands/framework/helpers/rule-files/index.ts","../../../src/commands/framework/helpers/directory-exists/index.ts","../../../src/commands/framework/helpers/format-messages/index.ts","../../../src/commands/framework/helpers/package-path/index.ts","../../../src/commands/framework/helpers/mcp-config/index.ts","../../../src/commands/framework/helpers/cursor-ide-detector/index.ts","../../../src/commands/framework/helpers/index.ts","../../../src/commands/framework/command/ai-agent/base-check/index.ts","../../../src/commands/cursor-context/lib/check/index.ts","../../../src/commands/framework/command/ai-agent/base-apply/index.ts","../../../src/commands/cursor-context/lib/apply/index.ts","../../../src/commands/framework/command/registry/index.ts","../../../src/commands/cursor-context/lib/index.ts","../../../src/commands/cursor-context/bin/cli.ts"],"sourcesContent":["/**\n * <license header>\n */\n\nimport { CommandResult } from '../registry/types';\n\n/**\n * CommandAbstract class\n * Abstract class for commands\n */\nexport abstract class CommandAbstract {\n /**\n * Method to get the name of the command\n * @returns {string} The name of the command\n */\n public static getName(): string {\n throw new Error('getName() must be implemented by subclass');\n }\n\n /**\n * Method to get the description of the command\n * @returns {string} The description of the command\n */\n public static getDescription(): string {\n throw new Error('getDescription() must be implemented by subclass');\n }\n\n /**\n * Method to execute the command\n * @param {...any} args - Command arguments\n * @returns {Promise<CommandResult>} The execution result\n */\n public static execute(...args: any[]): Promise<CommandResult> | CommandResult {\n throw new Error(`execute() must be implemented by subclass: ${args.join(', ')}`);\n }\n}\n","/**\n * <license header>\n */\n\nimport { CommandAbstract } from '../abstract';\nimport { CommandDescriptor, CommandResult } from '../registry/types';\n\n/**\n * BaseHelpCommand class\n * Provides help text for the base rules CLI\n */\nexport class BaseHelpCommand extends CommandAbstract {\n /**\n * Static command name\n */\n private static readonly NAME = 'help';\n\n /**\n * Static repository URL\n */\n private static readonly repositoryUrl = 'https://github.com/adobe-commerce/aio-toolkit';\n\n /**\n * Method to get the description of the command\n * @returns {string} The description of the command\n */\n public static override getName(): string {\n return this.NAME;\n }\n\n /**\n * Static method to get the commands - must be implemented by subclasses\n *\n * @returns {CommandDescriptor[]} The commands\n */\n public static getCliName(): string {\n throw new Error('getCliName() must be implemented by subclass');\n }\n\n /**\n * Get the commands dynamically\n *\n * @returns {CommandDescriptor[]} The commands array\n */\n public static getCommands(): CommandDescriptor[] {\n throw new Error('getCommands() must be implemented by subclass');\n }\n\n /**\n * Method to execute the command\n * @param {...any} _args - Command arguments (unused)\n * @returns {Promise<CommandResult>} The execution result\n */\n public static override execute(..._args: any[]): Promise<CommandResult> | CommandResult {\n const helpText = [\n this.getUsageSection(),\n this.getCommandsSection(),\n this.getExamplesSection(),\n this.getFooterSection(),\n ].join('\\n');\n\n return {\n success: true,\n message: helpText,\n };\n }\n\n /**\n * Get the usage section\n *\n * @returns {string} The usage section\n */\n private static getUsageSection(): string {\n return `Usage: npx ${this.getCliName()} <command>`;\n }\n\n /**\n * Get the commands section\n *\n * @returns {string} The commands section\n */\n private static getCommandsSection(): string {\n const commands = this.getCommands();\n const maxNameLength = Math.max(...commands.map((cmd: CommandDescriptor) => cmd.name.length));\n const commandsList = commands\n .map((cmd: CommandDescriptor) => ` ${cmd.name.padEnd(maxNameLength + 2)}${cmd.description}`)\n .join('\\n');\n return `\\nCommands:\\n${commandsList}`;\n }\n\n /**\n * Get the examples section\n *\n * @returns {string} The examples section\n */\n private static getExamplesSection(): string {\n const commands = this.getCommands();\n const examples = commands\n .map((cmd: CommandDescriptor) => ` npx ${this.getCliName()} ${cmd.name}`)\n .join('\\n');\n return `\\nExamples:\\n${examples}`;\n }\n\n /**\n * Get the footer section with additional information\n *\n * @returns {string} The footer section\n */\n private static getFooterSection(): string {\n return `\\nFor more information, visit:\\n ${this.repositoryUrl}\\n`;\n }\n}\n","/**\n * <license header>\n */\n\nimport { CommandDescriptor } from '../../../framework/command/registry/types';\nimport { BaseHelpCommand } from '../../../framework/command/base-help/index';\n\n/**\n * CursorContextHelp class\n * Provides help text for the aio-toolkit-cursor-context CLI\n */\nexport class CursorContextHelp extends BaseHelpCommand {\n /**\n * Static command description\n */\n private static readonly DESCRIPTION = 'Show help for the rules commands';\n\n /**\n * Get the CLI name\n * This is used to display the correct help text for the CLI.\n *\n * @returns {string} The CLI name\n */\n public static override getCliName(): string {\n return 'aio-toolkit-cursor-context';\n }\n\n /**\n * Method to get the description of the command\n * @returns {string} The description of the command\n */\n public static override getDescription(): string {\n return this.DESCRIPTION;\n }\n\n /**\n * Get commands dynamically to avoid circular dependency\n * This will be populated when CursorRules is initialized\n *\n * @returns {CommandDescriptor[]} The commands array\n */\n public static override getCommands(): CommandDescriptor[] {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { CursorRules } = require('../index');\n return CursorRules.getCommands();\n }\n}\n","/**\n * PackageRulesPath helper class\n * Finds the package rules path from the installed package\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\n\nexport class PackageRulesPath {\n /**\n * Get the package rules path\n * @param {string} rulesPath - The relative path to rules within the package (e.g., 'src/cursor/rules')\n * @returns {string | null} The absolute path to rules in the installed package, or null if not found\n */\n static get(rulesPath: string): string | null {\n try {\n // Find the package root directory\n const packageRoot = this.findPackageRoot();\n\n if (packageRoot) {\n const fullRulesPath = path.join(packageRoot, rulesPath);\n\n // Verify the rules path exists\n if (fs.existsSync(fullRulesPath)) {\n return fullRulesPath;\n }\n }\n\n return null;\n } catch {\n return null;\n }\n }\n\n /**\n * Find the package root directory\n * @returns {string | null} The package root path or null if not found\n */\n private static findPackageRoot(): string | null {\n // Start from current file location\n let currentDir = __dirname;\n\n // Go up directories until we find package.json with our package name\n for (let i = 0; i < 10; i++) {\n const packageJsonPath = path.join(currentDir, 'package.json');\n\n if (fs.existsSync(packageJsonPath)) {\n try {\n const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));\n // Check if this is our package\n if (packageJson.name === '@adobe-commerce/aio-toolkit') {\n return currentDir;\n }\n } catch {\n // Continue searching\n }\n }\n\n const parentDir = path.dirname(currentDir);\n /* istanbul ignore next */ // Both branches are covered, but Jest has trouble tracking coverage in loops\n if (parentDir === currentDir) break; // Reached root\n currentDir = parentDir;\n }\n\n return null;\n }\n}\n","/**\n * RuleFiles helper class\n * Gets rule files from a directory\n */\n\nimport * as fs from 'fs';\n\nexport class RuleFiles {\n private static readonly ruleExtensions = ['.mdc', '.md'];\n\n /**\n * Get all rule files from a directory\n * @param {string} dirPath - The path to the directory containing rule files\n * @returns {string[]} Array of rule file names\n */\n static get(dirPath: string): string[] {\n try {\n if (!fs.existsSync(dirPath)) {\n return [];\n }\n\n const files = fs.readdirSync(dirPath);\n return files.filter(file => this.ruleExtensions.some(ext => file.endsWith(ext)));\n } catch {\n return [];\n }\n }\n}\n","/**\n * DirectoryExists helper class\n * Checks and ensures directory existence\n */\n\nimport * as fs from 'fs';\n\nexport class DirectoryExists {\n /**\n * Check if a directory exists\n * @param {string} dirPath - The directory path to check\n * @returns {boolean} True if directory exists and is a directory\n */\n static is(dirPath: string): boolean {\n try {\n return fs.existsSync(dirPath) && fs.statSync(dirPath).isDirectory();\n } catch {\n return false;\n }\n }\n\n /**\n * Ensure a directory exists, create if it doesn't\n * @param {string} dirPath - The directory path to ensure\n * @returns {void}\n */\n static ensure(dirPath: string): void {\n if (!this.is(dirPath)) {\n fs.mkdirSync(dirPath, { recursive: true });\n }\n }\n}\n","/**\n * FormatMessages helper class\n * Formats an array of messages into a single string\n */\n\nexport class FormatMessages {\n /**\n * Format an array of messages into a single string\n * @param {string[]} messages - Array of message lines\n * @returns {string} Formatted message string\n */\n static execute(messages: string[]): string {\n return messages.join('\\n');\n }\n}\n","/**\n * PackagePath helper\n * Finds the path to a package in node_modules\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\n\nexport class PackagePath {\n /**\n * Find the path to a package in node_modules\n *\n * @param {string} packageName - The name of the package to find (e.g., '@adobe-commerce/commerce-extensibility-tools')\n * @param {string} projectPath - The project root path (defaults to current directory)\n * @returns {string | null} The absolute path to the package, or null if not found\n */\n static find(packageName: string, projectPath: string = process.cwd()): string | null {\n try {\n // Start from the project root and traverse up to find node_modules\n let currentDir = projectPath;\n const maxIterations = 10; // Prevent infinite loop\n\n for (let i = 0; i < maxIterations; i++) {\n // Check if node_modules exists in current directory\n const nodeModulesPath = path.join(currentDir, 'node_modules');\n\n if (fs.existsSync(nodeModulesPath)) {\n // Check if package exists in this node_modules\n const packagePath = path.join(nodeModulesPath, packageName);\n\n if (fs.existsSync(packagePath)) {\n return packagePath;\n }\n }\n\n // Move up one directory\n const parentDir = path.dirname(currentDir);\n\n // If we've reached the root, stop\n if (parentDir === currentDir) {\n break;\n }\n\n currentDir = parentDir;\n }\n\n return null;\n } catch (error) {\n return null;\n }\n }\n\n /**\n * Get the entry point file path for a package\n *\n * @param {string} packageName - The name of the package\n * @param {string} projectPath - The project root path (defaults to current directory)\n * @returns {string | null} The relative path from project root to the package entry point, or null if not found\n */\n static getEntryPoint(packageName: string, projectPath: string = process.cwd()): string | null {\n try {\n const packagePath = this.find(packageName, projectPath);\n\n if (!packagePath) {\n return null;\n }\n\n // Read package.json to get the entry point\n const packageJsonPath = path.join(packagePath, 'package.json');\n\n if (!fs.existsSync(packageJsonPath)) {\n // Default to index.js if package.json doesn't exist\n const defaultEntry = path.join(packagePath, 'index.js');\n if (fs.existsSync(defaultEntry)) {\n // Return relative path from project root\n return path.relative(projectPath, defaultEntry);\n }\n return null;\n }\n\n const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));\n const entryPoint = packageJson.main || 'index.js';\n\n // Build absolute path to entry point\n const entryPointPath = path.join(packagePath, entryPoint);\n\n if (!fs.existsSync(entryPointPath)) {\n return null;\n }\n\n // Return relative path from project root\n return path.relative(projectPath, entryPointPath);\n } catch (error) {\n return null;\n }\n }\n}\n","/**\n * McpConfig helper\n * Generates and manages MCP (Model Context Protocol) configuration for Cursor IDE\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { PackagePath } from '../package-path';\nimport type { McpServerConfig, McpConfigStructure, McpConfigResult } from './types';\n\nexport type { McpServerConfig, McpConfigStructure, McpConfigResult } from './types';\n\nexport class McpConfig {\n /**\n * Create or update MCP configuration file\n *\n * @param {string} projectPath - The project root path (defaults to current directory)\n * @returns {McpConfigResult} Result object with success status and reason\n */\n static createOrUpdate(projectPath: string = process.cwd()): McpConfigResult {\n try {\n const mcpFilePath = path.join(projectPath, '.cursor', 'mcp.json');\n\n // Find the commerce-extensibility-tools package\n const packageName = '@adobe-commerce/commerce-extensibility-tools';\n const packageEntryPoint = PackagePath.getEntryPoint(packageName, projectPath);\n\n if (!packageEntryPoint) {\n // Package not found, return with warning\n return {\n success: false,\n reason: 'peer-dependency-missing',\n message: `Package '${packageName}' not found. Install it to enable MCP server integration:\\n npm install ${packageName}`,\n };\n }\n\n // Build commerce-extensibility server configuration\n const commerceExtensibilityConfig: McpServerConfig = {\n command: 'node',\n args: [packageEntryPoint.replace(/\\\\/g, '/')], // Normalize path separators for cross-platform\n env: {},\n };\n\n // Check if mcp.json already exists\n let existingConfig: McpConfigStructure | null = null;\n const fileExists = fs.existsSync(mcpFilePath);\n\n if (fileExists) {\n try {\n const existingContent = fs.readFileSync(mcpFilePath, 'utf-8');\n existingConfig = JSON.parse(existingContent);\n } catch (error) {\n // If parsing fails, we'll overwrite with new config\n existingConfig = null;\n }\n }\n\n // Build final MCP configuration\n const mcpConfig: McpConfigStructure = {\n mcpServers: existingConfig?.mcpServers\n ? {\n ...existingConfig.mcpServers,\n 'commerce-extensibility': commerceExtensibilityConfig,\n }\n : {\n 'commerce-extensibility': commerceExtensibilityConfig,\n },\n };\n\n // Write the configuration file\n fs.writeFileSync(mcpFilePath, JSON.stringify(mcpConfig, null, 2) + '\\n', 'utf-8');\n\n return {\n success: true,\n reason: fileExists ? 'updated' : 'created',\n message: fileExists\n ? 'MCP configuration updated at .cursor/mcp.json'\n : 'MCP configuration created at .cursor/mcp.json',\n };\n } catch (error) {\n return {\n success: false,\n reason: 'error',\n message: `Failed to create MCP config: ${error instanceof Error ? error.message : String(error)}`,\n };\n }\n }\n\n /**\n * Check if MCP configuration exists\n *\n * @param {string} projectPath - The project root path (defaults to current directory)\n * @returns {boolean} True if mcp.json exists, false otherwise\n */\n static exists(projectPath: string = process.cwd()): boolean {\n const mcpFilePath = path.join(projectPath, '.cursor', 'mcp.json');\n return fs.existsSync(mcpFilePath);\n }\n\n /**\n * Get the path to the MCP configuration file\n *\n * @param {string} projectPath - The project root path (defaults to current directory)\n * @returns {string} The path to mcp.json\n */\n static getPath(projectPath: string = process.cwd()): string {\n return path.join(projectPath, '.cursor', 'mcp.json');\n }\n}\n","/**\n * CursorIdeDetector helper class\n * Detects if the current IDE is Cursor IDE\n */\n\nimport * as os from 'os';\n\nexport class CursorIdeDetector {\n /**\n * Check if Cursor IDE is being used\n * @returns {boolean} True if Cursor IDE is detected, false otherwise\n */\n static isCursorIde(): boolean {\n try {\n // Method 1: Check for Cursor-specific environment variables (most reliable)\n // Cursor IDE sets these when launching terminal/commands:\n // - CURSOR_TRACE_ID: Trace ID for Cursor operations\n // - CURSOR_AGENT: Indicates Cursor agent is running\n // - __CFBundleIdentifier: macOS bundle identifier (com.todesktop.*)\n // - CURSOR or CURSOR_IDE: Legacy/alternative variables\n if (\n process.env.CURSOR ||\n process.env.CURSOR_IDE ||\n process.env.CURSOR_TRACE_ID ||\n process.env.CURSOR_AGENT ||\n (process.env.__CFBundleIdentifier &&\n process.env.__CFBundleIdentifier.startsWith('com.todesktop.'))\n ) {\n return true;\n }\n\n // Method 2: Check if running from Cursor's installation directory\n // This checks if Node.js was launched from within Cursor.app\n const execPath = process.execPath.toLowerCase();\n const cursorPaths = ['cursor.app', 'cursor.exe'];\n // Check for cursor.app/cursor.exe but exclude macOS-specific paths\n // (those are checked in Method 4 for better platform-specific detection)\n const isMacOsSpecificPath = execPath.includes('/applications/cursor.app/contents');\n if (cursorPaths.some(cursorPath => execPath.includes(cursorPath)) && !isMacOsSpecificPath) {\n return true;\n }\n\n // Method 3: Check parent process name (if available)\n // On macOS, check if parent process is Cursor\n if (process.env._) {\n const parentProcess = process.env._.toLowerCase();\n // Only match if it's clearly Cursor, not just containing \"cursor\" (could be false positive)\n if (\n parentProcess.includes('cursor.app') ||\n parentProcess.includes('cursor.exe') ||\n parentProcess.endsWith('/cursor')\n ) {\n return true;\n }\n }\n\n // Method 4: Check if we're running from Cursor's embedded Node.js\n // Cursor IDE includes its own Node.js runtime\n const platform = os.platform();\n if (platform === 'darwin') {\n // On macOS, Cursor's Node.js is typically at:\n // /Applications/Cursor.app/Contents/Resources/app/bin/cursor or similar\n if (execPath.includes('/applications/cursor.app/contents')) {\n return true;\n }\n } else if (platform === 'win32') {\n // On Windows, check if execPath is within Cursor installation\n if (\n execPath.includes('cursor') &&\n (execPath.includes('program files') ||\n execPath.includes('localappdata') ||\n execPath.includes('appdata'))\n ) {\n return true;\n }\n } else if (platform === 'linux') {\n // On Linux, check if execPath is within Cursor installation\n if (\n execPath.includes('cursor') &&\n (execPath.includes('/opt/cursor') ||\n execPath.includes('/usr/share/cursor') ||\n execPath.includes('/.local/share/cursor'))\n ) {\n return true;\n }\n }\n\n // Don't check if Cursor is just installed - only check if we're running FROM Cursor\n // This prevents false positives when Cursor is installed but not being used\n return false;\n } catch {\n // If detection fails, assume false\n return false;\n }\n }\n\n /**\n * Get a user-friendly message about Cursor IDE detection\n * @returns {string} Message about Cursor IDE status\n */\n static getDetectionMessage(): string {\n if (this.isCursorIde()) {\n return '✅ Cursor IDE detected';\n }\n return '⚠️ Cursor IDE not detected - cursor rules may not work in other IDEs';\n }\n}\n","/**\n * Helpers index\n * Export all helper classes\n */\n\nexport { PackageRulesPath } from './package-rules-path/index';\nexport { RuleFiles } from './rule-files/index';\nexport { DirectoryExists } from './directory-exists/index';\nexport { FormatMessages } from './format-messages/index';\nexport { PackagePath } from './package-path/index';\nexport { McpConfig } from './mcp-config/index';\nexport { CursorIdeDetector } from './cursor-ide-detector/index';\n","/**\n * <license header>\n */\n\nimport * as path from 'path';\nimport { CommandResult } from '../../registry/types';\nimport {\n RuleFiles,\n DirectoryExists,\n FormatMessages,\n McpConfig,\n CursorIdeDetector,\n} from '../../../helpers/index';\nimport { CommandAbstract } from '../../abstract';\n\n/**\n * AIAgentBaseCheck class\n * Checks if cursor contexts are being applied to the project\n */\nexport abstract class AIAgentBaseCheck extends CommandAbstract {\n /**\n * Static command name\n */\n private static readonly NAME = 'check';\n\n /**\n * Method to get the description of the command\n * @returns {string} The description of the command\n */\n public static override getName(): string {\n return this.NAME;\n }\n\n /**\n * Get the directory paths to check\n * This is used to check if the context directories exist.\n *\n * @returns {string[]} Array of directory paths relative to project root\n */\n public static getDirs(): string[] {\n throw new Error('getDirs() must be implemented by subclass');\n }\n\n /**\n * Static execute method to check and return the result\n *\n * @param {string} projectPath - The path to the project root (defaults to current directory)\n * @returns {Promise<CommandResult>} The check result\n */\n public static override async execute(\n projectPath: string = process.cwd()\n ): Promise<CommandResult> {\n const dirs = this.getDirs();\n const missingDirs: string[] = [];\n const existingDirs: string[] = [];\n const allContextFiles: Array<{ dir: string; files: string[] }> = [];\n\n // Check all directories\n for (const dir of dirs) {\n const contextPath = path.join(projectPath, dir);\n if (!DirectoryExists.is(contextPath)) {\n missingDirs.push(dir);\n } else {\n existingDirs.push(dir);\n // Check for context files in this directory\n const contextFiles = RuleFiles.get(contextPath);\n if (contextFiles.length > 0) {\n allContextFiles.push({ dir, files: contextFiles });\n }\n }\n }\n\n // If no directories exist, return error\n if (existingDirs.length === 0) {\n return {\n success: false,\n message: FormatMessages.execute([\n '❌ Context directories not found',\n '--------------------------------',\n CursorIdeDetector.getDetectionMessage(),\n '',\n `The following directories do not exist:`,\n ...missingDirs.map(dir => ` - ${dir}`),\n 'Run: npx aio-toolkit-cursor-context apply',\n ]),\n };\n }\n\n // If directories exist but no context files found\n if (allContextFiles.length === 0) {\n return {\n success: false,\n message: FormatMessages.execute([\n '❌ No context files found',\n '--------------------------------',\n CursorIdeDetector.getDetectionMessage(),\n '',\n `No context files (.mdc, .md) found in:`,\n ...existingDirs.map(dir => ` - ${dir}`),\n 'Run: npx aio-toolkit-cursor-context apply',\n ]),\n };\n }\n\n // Success - contexts are applied\n const totalFiles = allContextFiles.reduce((sum, item) => sum + item.files.length, 0);\n const messages: string[] = [\n '✅ Contexts are applied to the project',\n '--------------------------------',\n CursorIdeDetector.getDetectionMessage(),\n '',\n `Found ${totalFiles} context file${totalFiles > 1 ? 's' : ''} across ${allContextFiles.length} director${allContextFiles.length > 1 ? 'ies' : 'y'}:`,\n ];\n\n // Add files grouped by directory\n for (const { dir, files } of allContextFiles) {\n messages.push(`\\n${dir}:`);\n files.forEach(file => messages.push(` - ${file}`));\n }\n\n // Warn about missing directories if any\n if (missingDirs.length > 0) {\n messages.push('\\n⚠️ Missing directories:');\n missingDirs.forEach(dir => messages.push(` - ${dir}`));\n }\n\n // Check MCP server configuration\n const mcpExists = McpConfig.exists(projectPath);\n messages.push('');\n if (mcpExists) {\n messages.push('✅ MCP server configuration found at .cursor/mcp.json');\n } else {\n messages.push('⚠️ MCP server configuration not found');\n messages.push(' Run: npx aio-toolkit-cursor-context apply');\n }\n\n return {\n success: true,\n message: FormatMessages.execute(messages),\n };\n }\n}\n","/**\n * <license header>\n */\n\nimport * as path from 'path';\nimport { AIAgentBaseCheck } from '../../../framework/command/ai-agent/base-check/index';\n\n/**\n * CursorContextCheck class\n * Checks if cursor context directories exist\n */\nexport class CursorContextCheck extends AIAgentBaseCheck {\n /**\n * Static command description\n */\n private static readonly DESCRIPTION = 'Check cursor context applied to the project';\n\n /**\n * Method to get the description of the command\n * @returns {string} The description of the command\n */\n public static override getDescription(): string {\n return this.DESCRIPTION;\n }\n\n /**\n * Get the directory paths to check\n * This is used to check if the context directories exist.\n *\n * @returns {string[]} Array of directory paths relative to project root\n */\n public static override getDirs(): string[] {\n return [path.join('.cursor', 'rules'), path.join('.cursor', 'commands')];\n }\n}\n","/**\n * <license header>\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { FormatMessages } from '../../../helpers/format-messages';\nimport {\n PackageRulesPath,\n RuleFiles,\n DirectoryExists,\n McpConfig,\n CursorIdeDetector,\n} from '../../../helpers/index';\nimport { CommandResult } from '../../registry/types';\nimport { CommandAbstract } from '../../abstract';\n\n/**\n * AIAgentBaseApply class\n * Applies AI agents to the project\n */\nexport abstract class AIAgentBaseApply extends CommandAbstract {\n /**\n * Static command name\n */\n private static readonly NAME = 'apply';\n\n /**\n * Method to get the description of the command\n * @returns {string} The description of the command\n */\n public static override getName(): string {\n return this.NAME;\n }\n\n /**\n * Get the copy directories configuration\n * @returns {Record<string, { from: string; to: string }>} Object with directory pairs to copy\n */\n public static getCopyDirs(): Record<string, { from: string; to: string }> {\n throw new Error('getCopyDirs() must be implemented by subclass');\n }\n\n /**\n * Check if IDE detection is required before applying contexts\n * Override this method in subclasses to enable IDE detection\n * @returns {boolean} True if IDE detection should be performed\n */\n public static shouldCheckIde(): boolean {\n return false;\n }\n\n /**\n * Static execute method to apply contexts\n * @param {string} projectPath - The path to the project root (defaults to current directory)\n * @param {string[]} args - Command arguments\n * @returns {Promise<CommandResult>} The apply result\n */\n public static override async execute(\n projectPath: string = process.cwd(),\n args: string[] = []\n ): Promise<CommandResult> {\n // Handle case where first argument is a flag (e.g., 'apply -f')\n // If projectPath starts with '-', it's actually a flag, not a path\n let actualProjectPath = projectPath;\n let actualArgs = args;\n\n if (projectPath.startsWith('-')) {\n // First argument is a flag, treat it as part of args\n actualProjectPath = process.cwd();\n actualArgs = [projectPath, ...args];\n }\n\n // Check for force flag\n const forceOverwrite = actualArgs.includes('--force') || actualArgs.includes('-f');\n\n // Check IDE detection if required (skip if force flag is set)\n if (!forceOverwrite && this.shouldCheckIde() && !CursorIdeDetector.isCursorIde()) {\n return {\n success: false,\n message: FormatMessages.execute([\n '❌ Cursor IDE not detected',\n '--------------------------------',\n CursorIdeDetector.getDetectionMessage(),\n '',\n 'Cursor contexts can only be applied when using Cursor IDE.',\n 'Please run this command from within Cursor IDE.',\n '',\n 'ℹ️ Use --force or -f to bypass this check and apply contexts anyway.',\n ]),\n };\n }\n\n try {\n const copyDirs = this.getCopyDirs();\n const dirKeys = Object.keys(copyDirs);\n\n if (dirKeys.length === 0) {\n return {\n success: false,\n message: FormatMessages.execute([\n '❌ No directories configured',\n '--------------------------------',\n 'The getCopyDirs() method must return at least one directory pair',\n ]),\n };\n }\n\n // Track results for all directories\n const allResults: Record<\n string,\n {\n copiedFiles: string[];\n skippedFiles: string[];\n overwrittenFiles: string[];\n sourcePath: string | null;\n destPath: string;\n }\n > = {};\n\n // Process each directory pair\n for (const dirKey of dirKeys) {\n const dirConfig = copyDirs[dirKey];\n if (!dirConfig) {\n continue;\n }\n const { from: sourceRelativePath, to: destRelativePath } = dirConfig;\n\n // Get the source directory path from this package using helper\n const sourcePath = PackageRulesPath.get(sourceRelativePath);\n\n if (!sourcePath) {\n return {\n success: false,\n message: FormatMessages.execute([\n '❌ Could not find contexts in package',\n '--------------------------------',\n 'The package context directory does not exist',\n `Expected at: ${sourceRelativePath}`,\n ]),\n };\n }\n\n // Get context files from source using helper\n const contextFiles = RuleFiles.get(sourcePath);\n\n if (contextFiles.length === 0) {\n return {\n success: false,\n message: FormatMessages.execute([\n '❌ No contexts found to apply',\n '--------------------------------',\n 'The package does not contain any context files',\n `Checked directory: ${sourceRelativePath}`,\n ]),\n };\n }\n\n // Create destination directory using helper\n const destPath = path.join(actualProjectPath, destRelativePath);\n DirectoryExists.ensure(destPath);\n\n // Initialize results for this directory\n allResults[dirKey] = {\n copiedFiles: [],\n skippedFiles: [],\n overwrittenFiles: [],\n sourcePath,\n destPath: destRelativePath,\n };\n\n // Copy context files (skip existing unless force flag is set)\n for (const file of contextFiles) {\n const sourceFilePath = path.join(sourcePath, file);\n const destFilePath = path.join(destPath, file);\n\n const fileExists = fs.existsSync(destFilePath);\n\n if (forceOverwrite) {\n // Force mode: copy all files (overwrite if exists)\n fs.copyFileSync(sourceFilePath, destFilePath);\n if (fileExists) {\n allResults[dirKey].overwrittenFiles.push(file);\n } else {\n allResults[dirKey].copiedFiles.push(file);\n }\n } else {\n // Normal mode: only copy if file doesn't exist\n if (!fileExists) {\n fs.copyFileSync(sourceFilePath, destFilePath);\n allResults[dirKey].copiedFiles.push(file);\n } else {\n allResults[dirKey].skippedFiles.push(file);\n }\n }\n }\n }\n\n // Create or update MCP configuration\n const mcpResult = McpConfig.createOrUpdate(actualProjectPath);\n\n // Build success message\n const messages: string[] = [];\n\n // Calculate totals across all directories\n const totalCopied = Object.values(allResults).reduce(\n (sum, r) => sum + r.copiedFiles.length,\n 0\n );\n const totalSkipped = Object.values(allResults).reduce(\n (sum, r) => sum + r.skippedFiles.length,\n 0\n );\n\n if (forceOverwrite) {\n // Force mode messages\n messages.push(\n '✅ Contexts applied successfully (force mode)!',\n '--------------------------------'\n );\n\n // Show results for each directory\n for (const dirKey of dirKeys) {\n const result = allResults[dirKey];\n if (!result) {\n continue;\n }\n /* istanbul ignore next */ // Unreachable: In force mode, files are always either copied or overwritten\n if (result.copiedFiles.length > 0 || result.overwrittenFiles.length > 0) {\n messages.push(`\\n${dirKey.toUpperCase()}:`);\n\n if (result.copiedFiles.length > 0) {\n messages.push(\n ` Copied ${result.copiedFiles.length} new context file${result.copiedFiles.length > 1 ? 's' : ''} to ${result.destPath}:`,\n ...result.copiedFiles.map(file => ` ✓ ${file}`)\n );\n }\n\n if (result.overwrittenFiles.length > 0) {\n if (result.copiedFiles.length > 0) {\n messages.push('');\n }\n messages.push(\n ` Overwritten ${result.overwrittenFiles.length} existing context file${result.overwrittenFiles.length > 1 ? 's' : ''}:`,\n ...result.overwrittenFiles.map(file => ` ↻ ${file}`)\n );\n }\n }\n }\n\n messages.push('');\n\n // Add MCP config message\n if (mcpResult.success) {\n messages.push(`✓ ${mcpResult.message}`, '');\n } else if (mcpResult.reason === 'peer-dependency-missing') {\n messages.push(`⚠️ ${mcpResult.message}`, '');\n }\n\n messages.push('⚠️ Please restart your IDE to load the updated contexts');\n } else {\n // Normal mode messages\n if (totalCopied === 0 && totalSkipped > 0) {\n // All files already exist\n messages.push('✅ All contexts are already applied!', '--------------------------------');\n\n // Show skipped files for each directory\n for (const dirKey of dirKeys) {\n const result = allResults[dirKey];\n if (!result) {\n continue;\n }\n /* istanbul ignore next */ // Unreachable: In \"all files already exist\" branch, directories with results must have skipped files\n if (result.skippedFiles.length > 0) {\n messages.push(\n `\\n${dirKey.toUpperCase()}:`,\n ` All ${result.skippedFiles.length} context file${result.skippedFiles.length > 1 ? 's' : ''} already exist in ${result.destPath}:`,\n ...result.skippedFiles.map(file => ` ⊝ ${file}`)\n );\n }\n }\n\n // Add MCP config message\n if (mcpResult.success) {\n messages.push('', `✓ ${mcpResult.message}`);\n } else if (mcpResult.reason === 'peer-dependency-missing') {\n messages.push('', `⚠️ ${mcpResult.message}`);\n }\n\n messages.push('', 'ℹ️ Use --force or -f to overwrite existing contexts');\n } else {\n // Some or all files were copied\n messages.push('✅ Contexts applied successfully!', '--------------------------------');\n\n // Show results for each directory\n for (const dirKey of dirKeys) {\n const result = allResults[dirKey];\n if (!result) {\n continue;\n }\n /* istanbul ignore next */ // Unreachable: Directories with results always have copied or skipped files\n if (result.copiedFiles.length > 0 || result.skippedFiles.length > 0) {\n messages.push(`\\n${dirKey.toUpperCase()}:`);\n\n if (result.copiedFiles.length > 0) {\n messages.push(\n ` Copied ${result.copiedFiles.length} new context file${result.copiedFiles.length > 1 ? 's' : ''} to ${result.destPath}:`,\n ...result.copiedFiles.map(file => ` ✓ ${file}`)\n );\n }\n\n if (result.skippedFiles.length > 0) {\n if (result.copiedFiles.length > 0) {\n messages.push('');\n }\n messages.push(\n ` Skipped ${result.skippedFiles.length} existing context file${result.skippedFiles.length > 1 ? 's' : ''}:`,\n ...result.skippedFiles.map(file => ` ⊝ ${file}`),\n '',\n ' ℹ️ Use --force or -f to overwrite existing contexts'\n );\n }\n }\n }\n\n /* istanbul ignore next */ // Unreachable: In else branch, totalCopied > 0 must be true (otherwise would fail earlier)\n if (totalCopied > 0) {\n messages.push('');\n\n // Add MCP config message\n if (mcpResult.success) {\n messages.push(`✓ ${mcpResult.message}`, '');\n } else if (mcpResult.reason === 'peer-dependency-missing') {\n messages.push(`⚠️ ${mcpResult.message}`, '');\n }\n\n messages.push('⚠️ Please restart your IDE to load the new contexts');\n }\n }\n }\n\n // Success\n return {\n success: true,\n message: FormatMessages.execute(messages),\n };\n } catch (error) {\n return {\n success: false,\n message: FormatMessages.execute([\n '❌ Failed to apply contexts to the project',\n '--------------------------------',\n `Error: ${error instanceof Error ? error.message : String(error)}`,\n ]),\n };\n }\n }\n}\n","/**\n * CursorContextApply class\n * Applies cursor context to the project by copying from package\n */\n\nimport * as path from 'path';\nimport { AIAgentBaseApply } from '../../../framework/command/ai-agent/base-apply/index';\n\n/**\n * CursorContextApply class\n * Applies cursor context to the project by copying from package\n */\nexport class CursorContextApply extends AIAgentBaseApply {\n /**\n * Static command description\n */\n private static readonly DESCRIPTION =\n 'Apply contexts to your project (use --force or -f to overwrite existing)';\n\n /**\n * Method to get the description of the command\n * @returns {string} The description of the command\n */\n public static override getDescription(): string {\n return this.DESCRIPTION;\n }\n\n /**\n * Enable IDE detection for Cursor-specific contexts\n * @returns {boolean} True to enable IDE detection\n */\n public static override shouldCheckIde(): boolean {\n return true;\n }\n\n /**\n * Get the rules directory path\n * @returns {string} The rules directory path\n */\n public static override getCopyDirs(): Record<string, { from: string; to: string }> {\n return {\n rules: {\n from: path.join('files', 'cursor-context', 'rules'),\n to: path.join('.cursor', 'rules'),\n },\n commands: {\n from: path.join('files', 'cursor-context', 'commands'),\n to: path.join('.cursor', 'commands'),\n },\n };\n }\n}\n","/**\n * <license header>\n */\n\nimport { CommandResult, CommandDescriptor } from './types';\n\n/**\n * CommandRegistry class\n * Manages the registration of commands and their execution\n */\nexport abstract class CommandRegistry {\n /**\n * Static method to get the commands - must be implemented by subclasses\n *\n * @returns {CommandDescriptor[]} The commands\n */\n public static getCommands(): CommandDescriptor[] {\n throw new Error('getCommands() must be implemented by subclass');\n }\n\n /**\n * Static execute method to execute a command\n *\n * @param {string} type - The name of the command to execute\n * @param {...any} args - The arguments to pass to the command\n * @returns {Promise<CommandResult>} The execution result\n */\n static async execute(type: string = 'help', ...args: any[]): Promise<CommandResult> {\n const command = this.getCommands().find((cmd: CommandDescriptor) => cmd.name === type);\n if (!command) {\n return {\n success: false,\n message: `Unknown command: ${type}`,\n };\n }\n return await command.execute(...args);\n }\n}\n","/**\n * <license header>\n */\n\nimport { CursorContextHelp } from './help/index';\nimport { CursorContextCheck } from './check/index';\nimport { CursorContextApply } from './apply/index';\nimport { CommandDescriptor } from '../../framework/command/registry/types';\nimport { CommandRegistry } from '../../framework/command/registry/index';\n\n/**\n * CursorRules class\n * Manages the execution of cursor rules commands\n */\nexport class CursorRules extends CommandRegistry {\n /**\n * Static commands array\n *\n * @returns {CommandDescriptor[]} The commands array\n */\n public static override getCommands(): CommandDescriptor[] {\n return [\n {\n name: CursorContextHelp.getName(),\n description: CursorContextHelp.getDescription(),\n execute: CursorContextHelp.execute.bind(CursorContextHelp),\n },\n {\n name: CursorContextCheck.getName(),\n description: CursorContextCheck.getDescription(),\n execute: CursorContextCheck.execute.bind(CursorContextCheck),\n },\n {\n name: CursorContextApply.getName(),\n description: CursorContextApply.getDescription(),\n execute: CursorContextApply.execute.bind(CursorContextApply),\n },\n ];\n }\n}\n","/**\n * <license header>\n */\n\n/**\n * CLI entry point for aio-toolkit-cursor-context\n *\n * This will handle commands like:\n * - npx aio-toolkit-cursor-context apply\n * - npx aio-toolkit-cursor-context check\n * - npx aio-toolkit-cursor-context help\n */\n\nimport { CursorRules } from '../lib/index';\n\n/**\n * Command to execute\n * @type {string}\n */\nconst command = process.argv[2] || 'help';\n\n/**\n * Additional arguments (flags and options)\n * @type {string[]}\n */\nconst args = process.argv.slice(3);\n\n/**\n * Main function to execute the command\n * @returns {Promise<void>}\n */\nasync function main(): Promise<void> {\n const result = await CursorRules.execute(command, ...args);\n console.log(result.message);\n if (!result.success) {\n process.exit(1);\n }\n}\n\n/**\n * Main function to execute the command\n * @param {Error} error - The error to log\n * @returns {Promise<void>}\n */\nmain().catch((error: Error) => {\n console.error('Error:', error.message);\n process.exit(1);\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAUsB;AAVtB;AAAA;AAAA;AAUO,IAAe,mBAAf,MAAe,iBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA,MAKpC,OAAc,UAAkB;AAC9B,cAAM,IAAI,MAAM,2CAA2C;AAAA,MAC7D;AAAA;AAAA;AAAA;AAAA;AAAA,MAMA,OAAc,iBAAyB;AACrC,cAAM,IAAI,MAAM,kDAAkD;AAAA,MACpE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOA,OAAc,WAAWA,OAAqD;AAC5E,cAAM,IAAI,MAAM,8CAA8CA,MAAK,KAAK,IAAI,CAAC,EAAE;AAAA,MACjF;AAAA,IACF;AAzBsC;AAA/B,IAAe,kBAAf;AAAA;AAAA;;;ACVP,IAWa;AAXb;AAAA;AAAA;AAIA;AAOO,IAAM,mBAAN,MAAM,yBAAwB,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA,MAenD,OAAuB,UAAkB;AACvC,eAAO,KAAK;AAAA,MACd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOA,OAAc,aAAqB;AACjC,cAAM,IAAI,MAAM,8CAA8C;AAAA,MAChE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOA,OAAc,cAAmC;AAC/C,cAAM,IAAI,MAAM,+CAA+C;AAAA,MACjE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOA,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AAQ,KAAK,CAAC;AAAA,EAChB;AACF;AANe;AAaf,KAAK,EAAE,MAAM,CAAC,UAAiB;AAC7B,UAAQ,MAAM,UAAU,MAAM,OAAO;AACrC,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["args","CursorRules","fs","fs","fs","path","fs","path","platform","path","path","fs","path","args","path","args","command"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/commands/framework/command/abstract/index.ts","../../../src/commands/framework/command/base-help/index.ts","../../../src/commands/cursor-context/lib/help/index.ts","../../../src/commands/framework/helpers/package-rules-path/index.ts","../../../src/commands/framework/helpers/rule-files/index.ts","../../../src/commands/framework/helpers/directory-exists/index.ts","../../../src/commands/framework/helpers/format-messages/index.ts","../../../src/commands/framework/helpers/package-path/index.ts","../../../src/commands/framework/helpers/mcp-config/index.ts","../../../src/commands/framework/helpers/cursor-ide-detector/index.ts","../../../src/commands/framework/helpers/aio-cli-detector/index.ts","../../../src/commands/framework/helpers/parse-cli-flag/index.ts","../../../src/commands/framework/helpers/index.ts","../../../src/commands/framework/command/ai-agent/base-check/index.ts","../../../src/commands/cursor-context/lib/check/index.ts","../../../src/commands/framework/command/ai-agent/base-apply/index.ts","../../../src/commands/cursor-context/lib/apply/index.ts","../../../src/commands/framework/command/registry/index.ts","../../../src/commands/cursor-context/lib/index.ts","../../../src/commands/cursor-context/bin/cli.ts"],"sourcesContent":["/**\n * <license header>\n */\n\nimport { CommandResult } from '../registry/types';\n\n/**\n * CommandAbstract class\n * Abstract class for commands\n */\nexport abstract class CommandAbstract {\n /**\n * Method to get the name of the command\n * @returns {string} The name of the command\n */\n public static getName(): string {\n throw new Error('getName() must be implemented by subclass');\n }\n\n /**\n * Method to get the description of the command\n * @returns {string} The description of the command\n */\n public static getDescription(): string {\n throw new Error('getDescription() must be implemented by subclass');\n }\n\n /**\n * Method to execute the command\n * @param {...any} args - Command arguments\n * @returns {Promise<CommandResult>} The execution result\n */\n public static execute(...args: any[]): Promise<CommandResult> | CommandResult {\n throw new Error(`execute() must be implemented by subclass: ${args.join(', ')}`);\n }\n}\n","/**\n * <license header>\n */\n\nimport { CommandAbstract } from '../abstract';\nimport { CommandDescriptor, CommandResult } from '../registry/types';\n\n/**\n * BaseHelpCommand class\n * Provides help text for the base rules CLI\n */\nexport class BaseHelpCommand extends CommandAbstract {\n /**\n * Static command name\n */\n private static readonly NAME = 'help';\n\n /**\n * Static repository URL\n */\n private static readonly repositoryUrl = 'https://github.com/adobe-commerce/aio-toolkit';\n\n /**\n * Method to get the description of the command\n * @returns {string} The description of the command\n */\n public static override getName(): string {\n return this.NAME;\n }\n\n /**\n * Static method to get the commands - must be implemented by subclasses\n *\n * @returns {CommandDescriptor[]} The commands\n */\n public static getCliName(): string {\n throw new Error('getCliName() must be implemented by subclass');\n }\n\n /**\n * Get the commands dynamically\n *\n * @returns {CommandDescriptor[]} The commands array\n */\n public static getCommands(): CommandDescriptor[] {\n throw new Error('getCommands() must be implemented by subclass');\n }\n\n /**\n * Method to execute the command\n * @param {...any} _args - Command arguments (unused)\n * @returns {Promise<CommandResult>} The execution result\n */\n public static override execute(..._args: any[]): Promise<CommandResult> | CommandResult {\n const helpText = [\n this.getUsageSection(),\n this.getCommandsSection(),\n this.getExamplesSection(),\n this.getFooterSection(),\n ].join('\\n');\n\n return {\n success: true,\n message: helpText,\n };\n }\n\n /**\n * Get the usage section\n *\n * @returns {string} The usage section\n */\n private static getUsageSection(): string {\n return `Usage: npx ${this.getCliName()} <command>`;\n }\n\n /**\n * Get the commands section\n *\n * @returns {string} The commands section\n */\n private static getCommandsSection(): string {\n const commands = this.getCommands();\n const maxNameLength = Math.max(...commands.map((cmd: CommandDescriptor) => cmd.name.length));\n const commandsList = commands\n .map((cmd: CommandDescriptor) => ` ${cmd.name.padEnd(maxNameLength + 2)}${cmd.description}`)\n .join('\\n');\n return `\\nCommands:\\n${commandsList}`;\n }\n\n /**\n * Get the examples section\n *\n * @returns {string} The examples section\n */\n private static getExamplesSection(): string {\n const commands = this.getCommands();\n const examples = commands\n .map((cmd: CommandDescriptor) => ` npx ${this.getCliName()} ${cmd.name}`)\n .join('\\n');\n return `\\nExamples:\\n${examples}`;\n }\n\n /**\n * Get the footer section with additional information\n *\n * @returns {string} The footer section\n */\n private static getFooterSection(): string {\n return `\\nFor more information, visit:\\n ${this.repositoryUrl}\\n`;\n }\n}\n","/**\n * <license header>\n */\n\nimport { CommandDescriptor } from '../../../framework/command/registry/types';\nimport { BaseHelpCommand } from '../../../framework/command/base-help/index';\n\n/**\n * CursorContextHelp class\n * Provides help text for the aio-toolkit-cursor-context CLI\n */\nexport class CursorContextHelp extends BaseHelpCommand {\n /**\n * Static command description\n */\n private static readonly DESCRIPTION = 'Show help for the rules commands';\n\n /**\n * Get the CLI name\n * This is used to display the correct help text for the CLI.\n *\n * @returns {string} The CLI name\n */\n public static override getCliName(): string {\n return 'aio-toolkit-cursor-context';\n }\n\n /**\n * Method to get the description of the command\n * @returns {string} The description of the command\n */\n public static override getDescription(): string {\n return this.DESCRIPTION;\n }\n\n /**\n * Get commands dynamically to avoid circular dependency\n * This will be populated when CursorRules is initialized\n *\n * @returns {CommandDescriptor[]} The commands array\n */\n public static override getCommands(): CommandDescriptor[] {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { CursorRules } = require('../index');\n return CursorRules.getCommands();\n }\n}\n","/**\n * PackageRulesPath helper class\n * Finds the package rules path from the installed package\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\n\nexport class PackageRulesPath {\n /**\n * Get the package rules path\n * @param {string} rulesPath - The relative path to rules within the package (e.g., 'src/cursor/rules')\n * @returns {string | null} The absolute path to rules in the installed package, or null if not found\n */\n static get(rulesPath: string): string | null {\n try {\n // Find the package root directory\n const packageRoot = this.findPackageRoot();\n\n if (packageRoot) {\n const fullRulesPath = path.join(packageRoot, rulesPath);\n\n // Verify the rules path exists\n if (fs.existsSync(fullRulesPath)) {\n return fullRulesPath;\n }\n }\n\n return null;\n } catch {\n return null;\n }\n }\n\n /**\n * Find the package root directory\n * @returns {string | null} The package root path or null if not found\n */\n private static findPackageRoot(): string | null {\n // Start from current file location\n let currentDir = __dirname;\n\n // Go up directories until we find package.json with our package name\n for (let i = 0; i < 10; i++) {\n const packageJsonPath = path.join(currentDir, 'package.json');\n\n if (fs.existsSync(packageJsonPath)) {\n try {\n const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));\n // Check if this is our package\n if (packageJson.name === '@adobe-commerce/aio-toolkit') {\n return currentDir;\n }\n } catch {\n // Continue searching\n }\n }\n\n const parentDir = path.dirname(currentDir);\n /* istanbul ignore next */ // Both branches are covered, but Jest has trouble tracking coverage in loops\n if (parentDir === currentDir) break; // Reached root\n currentDir = parentDir;\n }\n\n return null;\n }\n}\n","/**\n * RuleFiles helper class\n * Gets rule files from a directory\n */\n\nimport * as fs from 'fs';\n\nexport class RuleFiles {\n private static readonly ruleExtensions = ['.mdc', '.md'];\n\n /**\n * Get all rule files from a directory\n * @param {string} dirPath - The path to the directory containing rule files\n * @returns {string[]} Array of rule file names\n */\n static get(dirPath: string): string[] {\n try {\n if (!fs.existsSync(dirPath)) {\n return [];\n }\n\n const files = fs.readdirSync(dirPath);\n return files.filter(file => this.ruleExtensions.some(ext => file.endsWith(ext)));\n } catch {\n return [];\n }\n }\n}\n","/**\n * DirectoryExists helper class\n * Checks and ensures directory existence\n */\n\nimport * as fs from 'fs';\n\nexport class DirectoryExists {\n /**\n * Check if a directory exists\n * @param {string} dirPath - The directory path to check\n * @returns {boolean} True if directory exists and is a directory\n */\n static is(dirPath: string): boolean {\n try {\n return fs.existsSync(dirPath) && fs.statSync(dirPath).isDirectory();\n } catch {\n return false;\n }\n }\n\n /**\n * Ensure a directory exists, create if it doesn't\n * @param {string} dirPath - The directory path to ensure\n * @returns {void}\n */\n static ensure(dirPath: string): void {\n if (!this.is(dirPath)) {\n fs.mkdirSync(dirPath, { recursive: true });\n }\n }\n}\n","/**\n * FormatMessages helper class\n * Formats an array of messages into a single string\n */\n\nexport class FormatMessages {\n /**\n * Format an array of messages into a single string\n * @param {string[]} messages - Array of message lines\n * @returns {string} Formatted message string\n */\n static execute(messages: string[]): string {\n return messages.join('\\n');\n }\n}\n","/**\n * PackagePath helper\n * Finds the path to a package in node_modules\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\n\nexport class PackagePath {\n /**\n * Find the path to a package in node_modules\n *\n * @param {string} packageName - The name of the package to find (e.g., '@adobe-commerce/commerce-extensibility-tools')\n * @param {string} projectPath - The project root path (defaults to current directory)\n * @returns {string | null} The absolute path to the package, or null if not found\n */\n static find(packageName: string, projectPath: string = process.cwd()): string | null {\n try {\n // Start from the project root and traverse up to find node_modules\n let currentDir = projectPath;\n const maxIterations = 10; // Prevent infinite loop\n\n for (let i = 0; i < maxIterations; i++) {\n // Check if node_modules exists in current directory\n const nodeModulesPath = path.join(currentDir, 'node_modules');\n\n if (fs.existsSync(nodeModulesPath)) {\n // Check if package exists in this node_modules\n const packagePath = path.join(nodeModulesPath, packageName);\n\n if (fs.existsSync(packagePath)) {\n return packagePath;\n }\n }\n\n // Move up one directory\n const parentDir = path.dirname(currentDir);\n\n // If we've reached the root, stop\n if (parentDir === currentDir) {\n break;\n }\n\n currentDir = parentDir;\n }\n\n return null;\n } catch (error) {\n return null;\n }\n }\n\n /**\n * Get the entry point file path for a package\n *\n * @param {string} packageName - The name of the package\n * @param {string} projectPath - The project root path (defaults to current directory)\n * @returns {string | null} The relative path from project root to the package entry point, or null if not found\n */\n static getEntryPoint(packageName: string, projectPath: string = process.cwd()): string | null {\n try {\n const packagePath = this.find(packageName, projectPath);\n\n if (!packagePath) {\n return null;\n }\n\n // Read package.json to get the entry point\n const packageJsonPath = path.join(packagePath, 'package.json');\n\n if (!fs.existsSync(packageJsonPath)) {\n // Default to index.js if package.json doesn't exist\n const defaultEntry = path.join(packagePath, 'index.js');\n if (fs.existsSync(defaultEntry)) {\n // Return relative path from project root\n return path.relative(projectPath, defaultEntry);\n }\n return null;\n }\n\n const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));\n const entryPoint = packageJson.main || 'index.js';\n\n // Build absolute path to entry point\n const entryPointPath = path.join(packagePath, entryPoint);\n\n if (!fs.existsSync(entryPointPath)) {\n return null;\n }\n\n // Return relative path from project root\n return path.relative(projectPath, entryPointPath);\n } catch (error) {\n return null;\n }\n }\n}\n","/**\n * McpConfig helper\n * Generates and manages MCP (Model Context Protocol) configuration for Cursor IDE\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { PackagePath } from '../package-path';\nimport type { McpServerConfig, McpConfigStructure, McpConfigResult } from './types';\n\nexport type { McpServerConfig, McpConfigStructure, McpConfigResult } from './types';\n\nexport class McpConfig {\n /**\n * Create or update MCP configuration file\n *\n * @param {string} projectPath - The project root path (defaults to current directory)\n * @returns {McpConfigResult} Result object with success status and reason\n */\n static createOrUpdate(projectPath: string = process.cwd()): McpConfigResult {\n try {\n const mcpFilePath = path.join(projectPath, '.cursor', 'mcp.json');\n\n // Find the commerce-extensibility-tools package\n const packageName = '@adobe-commerce/commerce-extensibility-tools';\n const packageEntryPoint = PackagePath.getEntryPoint(packageName, projectPath);\n\n if (!packageEntryPoint) {\n // Package not found, return with warning\n return {\n success: false,\n reason: 'peer-dependency-missing',\n message: `Package '${packageName}' not found. Install it to enable MCP server integration:\\n npm install ${packageName}`,\n };\n }\n\n // Build commerce-extensibility server configuration\n const commerceExtensibilityConfig: McpServerConfig = {\n command: 'node',\n args: [packageEntryPoint.replace(/\\\\/g, '/')], // Normalize path separators for cross-platform\n env: {},\n };\n\n // Check if mcp.json already exists\n let existingConfig: McpConfigStructure | null = null;\n const fileExists = fs.existsSync(mcpFilePath);\n\n if (fileExists) {\n try {\n const existingContent = fs.readFileSync(mcpFilePath, 'utf-8');\n existingConfig = JSON.parse(existingContent);\n } catch (error) {\n // If parsing fails, we'll overwrite with new config\n existingConfig = null;\n }\n }\n\n // Build final MCP configuration\n const mcpConfig: McpConfigStructure = {\n mcpServers: existingConfig?.mcpServers\n ? {\n ...existingConfig.mcpServers,\n 'commerce-extensibility': commerceExtensibilityConfig,\n }\n : {\n 'commerce-extensibility': commerceExtensibilityConfig,\n },\n };\n\n // Write the configuration file\n fs.writeFileSync(mcpFilePath, JSON.stringify(mcpConfig, null, 2) + '\\n', 'utf-8');\n\n return {\n success: true,\n reason: fileExists ? 'updated' : 'created',\n message: fileExists\n ? 'MCP configuration updated at .cursor/mcp.json'\n : 'MCP configuration created at .cursor/mcp.json',\n };\n } catch (error) {\n return {\n success: false,\n reason: 'error',\n message: `Failed to create MCP config: ${error instanceof Error ? error.message : String(error)}`,\n };\n }\n }\n\n /**\n * Check if MCP configuration exists\n *\n * @param {string} projectPath - The project root path (defaults to current directory)\n * @returns {boolean} True if mcp.json exists, false otherwise\n */\n static exists(projectPath: string = process.cwd()): boolean {\n const mcpFilePath = path.join(projectPath, '.cursor', 'mcp.json');\n return fs.existsSync(mcpFilePath);\n }\n\n /**\n * Get the path to the MCP configuration file\n *\n * @param {string} projectPath - The project root path (defaults to current directory)\n * @returns {string} The path to mcp.json\n */\n static getPath(projectPath: string = process.cwd()): string {\n return path.join(projectPath, '.cursor', 'mcp.json');\n }\n}\n","/**\n * CursorIdeDetector helper class\n * Detects if the current IDE is Cursor IDE\n */\n\nimport * as os from 'os';\n\nexport class CursorIdeDetector {\n /**\n * Check if Cursor IDE is being used\n * @returns {boolean} True if Cursor IDE is detected, false otherwise\n */\n static isCursorIde(): boolean {\n try {\n // Method 1: Check for Cursor-specific environment variables (most reliable)\n // Cursor IDE sets these when launching terminal/commands:\n // - CURSOR_TRACE_ID: Trace ID for Cursor operations\n // - CURSOR_AGENT: Indicates Cursor agent is running\n // - __CFBundleIdentifier: macOS bundle identifier (com.todesktop.*)\n // - CURSOR or CURSOR_IDE: Legacy/alternative variables\n if (\n process.env.CURSOR ||\n process.env.CURSOR_IDE ||\n process.env.CURSOR_TRACE_ID ||\n process.env.CURSOR_AGENT ||\n (process.env.__CFBundleIdentifier &&\n process.env.__CFBundleIdentifier.startsWith('com.todesktop.'))\n ) {\n return true;\n }\n\n // Method 2: Check if running from Cursor's installation directory\n // This checks if Node.js was launched from within Cursor.app\n const execPath = process.execPath.toLowerCase();\n const cursorPaths = ['cursor.app', 'cursor.exe'];\n // Check for cursor.app/cursor.exe but exclude macOS-specific paths\n // (those are checked in Method 4 for better platform-specific detection)\n const isMacOsSpecificPath = execPath.includes('/applications/cursor.app/contents');\n if (cursorPaths.some(cursorPath => execPath.includes(cursorPath)) && !isMacOsSpecificPath) {\n return true;\n }\n\n // Method 3: Check parent process name (if available)\n // On macOS, check if parent process is Cursor\n if (process.env._) {\n const parentProcess = process.env._.toLowerCase();\n // Only match if it's clearly Cursor, not just containing \"cursor\" (could be false positive)\n if (\n parentProcess.includes('cursor.app') ||\n parentProcess.includes('cursor.exe') ||\n parentProcess.endsWith('/cursor')\n ) {\n return true;\n }\n }\n\n // Method 4: Check if we're running from Cursor's embedded Node.js\n // Cursor IDE includes its own Node.js runtime\n const platform = os.platform();\n if (platform === 'darwin') {\n // On macOS, Cursor's Node.js is typically at:\n // /Applications/Cursor.app/Contents/Resources/app/bin/cursor or similar\n if (execPath.includes('/applications/cursor.app/contents')) {\n return true;\n }\n } else if (platform === 'win32') {\n // On Windows, check if execPath is within Cursor installation\n if (\n execPath.includes('cursor') &&\n (execPath.includes('program files') ||\n execPath.includes('localappdata') ||\n execPath.includes('appdata'))\n ) {\n return true;\n }\n } else if (platform === 'linux') {\n // On Linux, check if execPath is within Cursor installation\n if (\n execPath.includes('cursor') &&\n (execPath.includes('/opt/cursor') ||\n execPath.includes('/usr/share/cursor') ||\n execPath.includes('/.local/share/cursor'))\n ) {\n return true;\n }\n }\n\n // Don't check if Cursor is just installed - only check if we're running FROM Cursor\n // This prevents false positives when Cursor is installed but not being used\n return false;\n } catch {\n // If detection fails, assume false\n return false;\n }\n }\n\n /**\n * Get a user-friendly message about Cursor IDE detection\n * @returns {string} Message about Cursor IDE status\n */\n static getDetectionMessage(): string {\n if (this.isCursorIde()) {\n return '✅ Cursor IDE detected';\n }\n return '⚠️ Cursor IDE not detected - cursor rules may not work in other IDEs';\n }\n}\n","/**\n * <license header>\n */\n\nimport { spawnSync } from 'child_process';\n\n/** Docs reference shown in install instructions */\nconst INSTALL_DOCS_URL =\n 'https://developer.adobe.com/app-builder/docs/guides/runtime_guides/tools/cli-install';\n\n/** The npm package that provides the aio CLI */\nconst AIO_CLI_PACKAGE = '@adobe/aio-cli';\n\nexport interface AioCliStatus {\n /** Whether the aio CLI binary is available on PATH */\n installed: boolean;\n /** Installed version string, or null if not installed */\n version: string | null;\n /** Map of checked sub-commands to their availability */\n commands: Record<string, boolean>;\n}\n\n/**\n * Detects whether the Adobe I/O CLI (`aio`) is installed and whether\n * specific sub-commands are available.\n *\n * Uses `spawnSync` with a fixed binary name and no shell interpolation,\n * so no user-controlled input is ever passed to the shell.\n */\nexport class AioCliDetector {\n /**\n * Returns the full status of the aio CLI installation.\n *\n * @param commandsToCheck - Optional list of aio sub-commands to probe (e.g. ['app', 'rt'])\n */\n static getStatus(commandsToCheck: string[] = []): AioCliStatus {\n const installed = this.isInstalled();\n const version = installed ? this.getVersion() : null;\n\n const commands: Record<string, boolean> = {};\n if (installed) {\n for (const cmd of commandsToCheck) {\n commands[cmd] = this.isCommandAvailable(cmd);\n }\n }\n\n return { installed, version, commands };\n }\n\n /**\n * Returns true if the `aio` binary is resolvable on the current PATH.\n */\n static isInstalled(): boolean {\n try {\n const result = spawnSync('aio', ['--version'], {\n encoding: 'utf8',\n shell: false,\n timeout: 5000,\n });\n // ENOENT means the binary does not exist; any other exit is still \"installed\"\n return result.error?.message?.includes('ENOENT') !== true && result.pid !== 0;\n } catch {\n return false;\n }\n }\n\n /**\n * Returns the installed `aio` version string, or null if unavailable.\n */\n static getVersion(): string | null {\n try {\n const result = spawnSync('aio', ['--version'], {\n encoding: 'utf8',\n shell: false,\n timeout: 5000,\n });\n const output = (result.stdout ?? '').trim();\n return output.length > 0 ? output : null;\n } catch {\n return null;\n }\n }\n\n /**\n * Returns true if the given aio sub-command is available (exit code 0 on --help).\n *\n * @param command - Sub-command name, e.g. 'app', 'rt', 'event'\n */\n static isCommandAvailable(command: string): boolean {\n try {\n const result = spawnSync('aio', [command, '--help'], {\n encoding: 'utf8',\n shell: false,\n timeout: 5000,\n });\n return result.status === 0;\n } catch {\n return false;\n }\n }\n\n /**\n * Returns a formatted, human-readable installation guide for the aio CLI.\n */\n static getInstallMessage(): string {\n return (\n '❌ Adobe I/O CLI (aio) is not installed or not found on your PATH.\\n\\n' +\n 'To install it, run:\\n\\n' +\n ` npm install -g ${AIO_CLI_PACKAGE}\\n\\n` +\n 'After installation, verify it is working:\\n\\n' +\n ' aio help\\n\\n' +\n `For full setup instructions, see:\\n ${INSTALL_DOCS_URL}`\n );\n }\n\n /**\n * Returns a formatted message for one or more missing aio sub-commands.\n *\n * @param missingCommands - Sub-commands that were not found\n */\n static getMissingCommandsMessage(missingCommands: string[]): string {\n const list = missingCommands.map(cmd => ` - aio ${cmd}`).join('\\n');\n return (\n `⚠️ The following aio command(s) are required but not available:\\n\\n${list}\\n\\n` +\n 'Make sure the relevant aio plugin(s) are installed. To see all plugins:\\n\\n' +\n ' aio plugins\\n\\n' +\n 'To install a missing plugin:\\n\\n' +\n ' aio plugins:install <plugin-name>\\n\\n' +\n `For more information, see:\\n ${INSTALL_DOCS_URL}`\n );\n }\n}\n","/**\n * <license header>\n */\n\n/**\n * Parses named flags from a CLI args array.\n *\n * Supports both `--flag=<value>` and `--flag <value>` syntaxes.\n */\nexport class ParseCliFlag {\n /**\n * Returns the value of a named flag from a CLI args array, or `null` if absent.\n *\n * Supports both `--flag=<value>` and `--flag <value>` syntaxes.\n * Returns `null` when the flag is absent or has an empty value.\n *\n * @param args - Raw CLI arguments after the command name\n * @param flag - Flag name without leading dashes (e.g. `\"env\"`, `\"config-file\"`)\n * @returns The flag value, or `null` if the flag was not provided\n */\n static parse(args: string[], flag: string): string | null {\n const prefix = `--${flag}=`;\n for (let i = 0; i < args.length; i++) {\n const arg = args[i] as string;\n if (arg.startsWith(prefix)) {\n return arg.slice(prefix.length) || null;\n }\n if (arg === `--${flag}` && i + 1 < args.length) {\n return args[i + 1] as string;\n }\n }\n return null;\n }\n}\n","/**\n * Helpers index\n * Export all helper classes\n */\n\nexport { PackageRulesPath } from './package-rules-path/index';\nexport { RuleFiles } from './rule-files/index';\nexport { DirectoryExists } from './directory-exists/index';\nexport { FormatMessages } from './format-messages/index';\nexport { PackagePath } from './package-path/index';\nexport { McpConfig } from './mcp-config/index';\nexport { CursorIdeDetector } from './cursor-ide-detector/index';\nexport { AioCliDetector } from './aio-cli-detector/index';\nexport type { AioCliStatus } from './aio-cli-detector/index';\nexport { ParseCliFlag } from './parse-cli-flag/index';\n","/**\n * <license header>\n */\n\nimport * as path from 'path';\nimport { CommandResult } from '../../registry/types';\nimport {\n RuleFiles,\n DirectoryExists,\n FormatMessages,\n McpConfig,\n CursorIdeDetector,\n} from '../../../helpers/index';\nimport { CommandAbstract } from '../../abstract';\n\n/**\n * AIAgentBaseCheck class\n * Checks if cursor contexts are being applied to the project\n */\nexport abstract class AIAgentBaseCheck extends CommandAbstract {\n /**\n * Static command name\n */\n private static readonly NAME = 'check';\n\n /**\n * Method to get the description of the command\n * @returns {string} The description of the command\n */\n public static override getName(): string {\n return this.NAME;\n }\n\n /**\n * Get the directory paths to check\n * This is used to check if the context directories exist.\n *\n * @returns {string[]} Array of directory paths relative to project root\n */\n public static getDirs(): string[] {\n throw new Error('getDirs() must be implemented by subclass');\n }\n\n /**\n * Static execute method to check and return the result\n *\n * @param {string} projectPath - The path to the project root (defaults to current directory)\n * @returns {Promise<CommandResult>} The check result\n */\n public static override async execute(\n projectPath: string = process.cwd()\n ): Promise<CommandResult> {\n const dirs = this.getDirs();\n const missingDirs: string[] = [];\n const existingDirs: string[] = [];\n const allContextFiles: Array<{ dir: string; files: string[] }> = [];\n\n // Check all directories\n for (const dir of dirs) {\n const contextPath = path.join(projectPath, dir);\n if (!DirectoryExists.is(contextPath)) {\n missingDirs.push(dir);\n } else {\n existingDirs.push(dir);\n // Check for context files in this directory\n const contextFiles = RuleFiles.get(contextPath);\n if (contextFiles.length > 0) {\n allContextFiles.push({ dir, files: contextFiles });\n }\n }\n }\n\n // If no directories exist, return error\n if (existingDirs.length === 0) {\n return {\n success: false,\n message: FormatMessages.execute([\n '❌ Context directories not found',\n '--------------------------------',\n CursorIdeDetector.getDetectionMessage(),\n '',\n `The following directories do not exist:`,\n ...missingDirs.map(dir => ` - ${dir}`),\n 'Run: npx aio-toolkit-cursor-context apply',\n ]),\n };\n }\n\n // If directories exist but no context files found\n if (allContextFiles.length === 0) {\n return {\n success: false,\n message: FormatMessages.execute([\n '❌ No context files found',\n '--------------------------------',\n CursorIdeDetector.getDetectionMessage(),\n '',\n `No context files (.mdc, .md) found in:`,\n ...existingDirs.map(dir => ` - ${dir}`),\n 'Run: npx aio-toolkit-cursor-context apply',\n ]),\n };\n }\n\n // Success - contexts are applied\n const totalFiles = allContextFiles.reduce((sum, item) => sum + item.files.length, 0);\n const messages: string[] = [\n '✅ Contexts are applied to the project',\n '--------------------------------',\n CursorIdeDetector.getDetectionMessage(),\n '',\n `Found ${totalFiles} context file${totalFiles > 1 ? 's' : ''} across ${allContextFiles.length} director${allContextFiles.length > 1 ? 'ies' : 'y'}:`,\n ];\n\n // Add files grouped by directory\n for (const { dir, files } of allContextFiles) {\n messages.push(`\\n${dir}:`);\n files.forEach(file => messages.push(` - ${file}`));\n }\n\n // Warn about missing directories if any\n if (missingDirs.length > 0) {\n messages.push('\\n⚠️ Missing directories:');\n missingDirs.forEach(dir => messages.push(` - ${dir}`));\n }\n\n // Check MCP server configuration\n const mcpExists = McpConfig.exists(projectPath);\n messages.push('');\n if (mcpExists) {\n messages.push('✅ MCP server configuration found at .cursor/mcp.json');\n } else {\n messages.push('⚠️ MCP server configuration not found');\n messages.push(' Run: npx aio-toolkit-cursor-context apply');\n }\n\n return {\n success: true,\n message: FormatMessages.execute(messages),\n };\n }\n}\n","/**\n * <license header>\n */\n\nimport * as path from 'path';\nimport { AIAgentBaseCheck } from '../../../framework/command/ai-agent/base-check/index';\n\n/**\n * CursorContextCheck class\n * Checks if cursor context directories exist\n */\nexport class CursorContextCheck extends AIAgentBaseCheck {\n /**\n * Static command description\n */\n private static readonly DESCRIPTION = 'Check cursor context applied to the project';\n\n /**\n * Method to get the description of the command\n * @returns {string} The description of the command\n */\n public static override getDescription(): string {\n return this.DESCRIPTION;\n }\n\n /**\n * Get the directory paths to check\n * This is used to check if the context directories exist.\n *\n * @returns {string[]} Array of directory paths relative to project root\n */\n public static override getDirs(): string[] {\n return [path.join('.cursor', 'rules'), path.join('.cursor', 'commands')];\n }\n}\n","/**\n * <license header>\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { FormatMessages } from '../../../helpers/format-messages';\nimport {\n PackageRulesPath,\n RuleFiles,\n DirectoryExists,\n McpConfig,\n CursorIdeDetector,\n} from '../../../helpers/index';\nimport { CommandResult } from '../../registry/types';\nimport { CommandAbstract } from '../../abstract';\n\n/**\n * AIAgentBaseApply class\n * Applies AI agents to the project\n */\nexport abstract class AIAgentBaseApply extends CommandAbstract {\n /**\n * Static command name\n */\n private static readonly NAME = 'apply';\n\n /**\n * Method to get the description of the command\n * @returns {string} The description of the command\n */\n public static override getName(): string {\n return this.NAME;\n }\n\n /**\n * Get the copy directories configuration\n * @returns {Record<string, { from: string; to: string }>} Object with directory pairs to copy\n */\n public static getCopyDirs(): Record<string, { from: string; to: string }> {\n throw new Error('getCopyDirs() must be implemented by subclass');\n }\n\n /**\n * Check if IDE detection is required before applying contexts\n * Override this method in subclasses to enable IDE detection\n * @returns {boolean} True if IDE detection should be performed\n */\n public static shouldCheckIde(): boolean {\n return false;\n }\n\n /**\n * Static execute method to apply contexts\n * @param {string} projectPath - The path to the project root (defaults to current directory)\n * @param {string[]} args - Command arguments\n * @returns {Promise<CommandResult>} The apply result\n */\n public static override async execute(\n projectPath: string = process.cwd(),\n args: string[] = []\n ): Promise<CommandResult> {\n // Handle case where first argument is a flag (e.g., 'apply -f')\n // If projectPath starts with '-', it's actually a flag, not a path\n let actualProjectPath = projectPath;\n let actualArgs = args;\n\n if (projectPath.startsWith('-')) {\n // First argument is a flag, treat it as part of args\n actualProjectPath = process.cwd();\n actualArgs = [projectPath, ...args];\n }\n\n // Check for force flag\n const forceOverwrite = actualArgs.includes('--force') || actualArgs.includes('-f');\n\n // Check IDE detection if required (skip if force flag is set)\n if (!forceOverwrite && this.shouldCheckIde() && !CursorIdeDetector.isCursorIde()) {\n return {\n success: false,\n message: FormatMessages.execute([\n '❌ Cursor IDE not detected',\n '--------------------------------',\n CursorIdeDetector.getDetectionMessage(),\n '',\n 'Cursor contexts can only be applied when using Cursor IDE.',\n 'Please run this command from within Cursor IDE.',\n '',\n 'ℹ️ Use --force or -f to bypass this check and apply contexts anyway.',\n ]),\n };\n }\n\n try {\n const copyDirs = this.getCopyDirs();\n const dirKeys = Object.keys(copyDirs);\n\n if (dirKeys.length === 0) {\n return {\n success: false,\n message: FormatMessages.execute([\n '❌ No directories configured',\n '--------------------------------',\n 'The getCopyDirs() method must return at least one directory pair',\n ]),\n };\n }\n\n // Track results for all directories\n const allResults: Record<\n string,\n {\n copiedFiles: string[];\n skippedFiles: string[];\n overwrittenFiles: string[];\n sourcePath: string | null;\n destPath: string;\n }\n > = {};\n\n // Process each directory pair\n for (const dirKey of dirKeys) {\n const dirConfig = copyDirs[dirKey];\n if (!dirConfig) {\n continue;\n }\n const { from: sourceRelativePath, to: destRelativePath } = dirConfig;\n\n // Get the source directory path from this package using helper\n const sourcePath = PackageRulesPath.get(sourceRelativePath);\n\n if (!sourcePath) {\n return {\n success: false,\n message: FormatMessages.execute([\n '❌ Could not find contexts in package',\n '--------------------------------',\n 'The package context directory does not exist',\n `Expected at: ${sourceRelativePath}`,\n ]),\n };\n }\n\n // Get context files from source using helper\n const contextFiles = RuleFiles.get(sourcePath);\n\n if (contextFiles.length === 0) {\n return {\n success: false,\n message: FormatMessages.execute([\n '❌ No contexts found to apply',\n '--------------------------------',\n 'The package does not contain any context files',\n `Checked directory: ${sourceRelativePath}`,\n ]),\n };\n }\n\n // Create destination directory using helper\n const destPath = path.join(actualProjectPath, destRelativePath);\n DirectoryExists.ensure(destPath);\n\n // Initialize results for this directory\n allResults[dirKey] = {\n copiedFiles: [],\n skippedFiles: [],\n overwrittenFiles: [],\n sourcePath,\n destPath: destRelativePath,\n };\n\n // Copy context files (skip existing unless force flag is set)\n for (const file of contextFiles) {\n const sourceFilePath = path.join(sourcePath, file);\n const destFilePath = path.join(destPath, file);\n\n const fileExists = fs.existsSync(destFilePath);\n\n if (forceOverwrite) {\n // Force mode: copy all files (overwrite if exists)\n fs.copyFileSync(sourceFilePath, destFilePath);\n if (fileExists) {\n allResults[dirKey].overwrittenFiles.push(file);\n } else {\n allResults[dirKey].copiedFiles.push(file);\n }\n } else {\n // Normal mode: only copy if file doesn't exist\n if (!fileExists) {\n fs.copyFileSync(sourceFilePath, destFilePath);\n allResults[dirKey].copiedFiles.push(file);\n } else {\n allResults[dirKey].skippedFiles.push(file);\n }\n }\n }\n }\n\n // Create or update MCP configuration\n const mcpResult = McpConfig.createOrUpdate(actualProjectPath);\n\n // Build success message\n const messages: string[] = [];\n\n // Calculate totals across all directories\n const totalCopied = Object.values(allResults).reduce(\n (sum, r) => sum + r.copiedFiles.length,\n 0\n );\n const totalSkipped = Object.values(allResults).reduce(\n (sum, r) => sum + r.skippedFiles.length,\n 0\n );\n\n if (forceOverwrite) {\n // Force mode messages\n messages.push(\n '✅ Contexts applied successfully (force mode)!',\n '--------------------------------'\n );\n\n // Show results for each directory\n for (const dirKey of dirKeys) {\n const result = allResults[dirKey];\n if (!result) {\n continue;\n }\n /* istanbul ignore next */ // Unreachable: In force mode, files are always either copied or overwritten\n if (result.copiedFiles.length > 0 || result.overwrittenFiles.length > 0) {\n messages.push(`\\n${dirKey.toUpperCase()}:`);\n\n if (result.copiedFiles.length > 0) {\n messages.push(\n ` Copied ${result.copiedFiles.length} new context file${result.copiedFiles.length > 1 ? 's' : ''} to ${result.destPath}:`,\n ...result.copiedFiles.map(file => ` ✓ ${file}`)\n );\n }\n\n if (result.overwrittenFiles.length > 0) {\n if (result.copiedFiles.length > 0) {\n messages.push('');\n }\n messages.push(\n ` Overwritten ${result.overwrittenFiles.length} existing context file${result.overwrittenFiles.length > 1 ? 's' : ''}:`,\n ...result.overwrittenFiles.map(file => ` ↻ ${file}`)\n );\n }\n }\n }\n\n messages.push('');\n\n // Add MCP config message\n if (mcpResult.success) {\n messages.push(`✓ ${mcpResult.message}`, '');\n } else if (mcpResult.reason === 'peer-dependency-missing') {\n messages.push(`⚠️ ${mcpResult.message}`, '');\n }\n\n messages.push('⚠️ Please restart your IDE to load the updated contexts');\n } else {\n // Normal mode messages\n if (totalCopied === 0 && totalSkipped > 0) {\n // All files already exist\n messages.push('✅ All contexts are already applied!', '--------------------------------');\n\n // Show skipped files for each directory\n for (const dirKey of dirKeys) {\n const result = allResults[dirKey];\n if (!result) {\n continue;\n }\n /* istanbul ignore next */ // Unreachable: In \"all files already exist\" branch, directories with results must have skipped files\n if (result.skippedFiles.length > 0) {\n messages.push(\n `\\n${dirKey.toUpperCase()}:`,\n ` All ${result.skippedFiles.length} context file${result.skippedFiles.length > 1 ? 's' : ''} already exist in ${result.destPath}:`,\n ...result.skippedFiles.map(file => ` ⊝ ${file}`)\n );\n }\n }\n\n // Add MCP config message\n if (mcpResult.success) {\n messages.push('', `✓ ${mcpResult.message}`);\n } else if (mcpResult.reason === 'peer-dependency-missing') {\n messages.push('', `⚠️ ${mcpResult.message}`);\n }\n\n messages.push('', 'ℹ️ Use --force or -f to overwrite existing contexts');\n } else {\n // Some or all files were copied\n messages.push('✅ Contexts applied successfully!', '--------------------------------');\n\n // Show results for each directory\n for (const dirKey of dirKeys) {\n const result = allResults[dirKey];\n if (!result) {\n continue;\n }\n /* istanbul ignore next */ // Unreachable: Directories with results always have copied or skipped files\n if (result.copiedFiles.length > 0 || result.skippedFiles.length > 0) {\n messages.push(`\\n${dirKey.toUpperCase()}:`);\n\n if (result.copiedFiles.length > 0) {\n messages.push(\n ` Copied ${result.copiedFiles.length} new context file${result.copiedFiles.length > 1 ? 's' : ''} to ${result.destPath}:`,\n ...result.copiedFiles.map(file => ` ✓ ${file}`)\n );\n }\n\n if (result.skippedFiles.length > 0) {\n if (result.copiedFiles.length > 0) {\n messages.push('');\n }\n messages.push(\n ` Skipped ${result.skippedFiles.length} existing context file${result.skippedFiles.length > 1 ? 's' : ''}:`,\n ...result.skippedFiles.map(file => ` ⊝ ${file}`),\n '',\n ' ℹ️ Use --force or -f to overwrite existing contexts'\n );\n }\n }\n }\n\n /* istanbul ignore next */ // Unreachable: In else branch, totalCopied > 0 must be true (otherwise would fail earlier)\n if (totalCopied > 0) {\n messages.push('');\n\n // Add MCP config message\n if (mcpResult.success) {\n messages.push(`✓ ${mcpResult.message}`, '');\n } else if (mcpResult.reason === 'peer-dependency-missing') {\n messages.push(`⚠️ ${mcpResult.message}`, '');\n }\n\n messages.push('⚠️ Please restart your IDE to load the new contexts');\n }\n }\n }\n\n // Success\n return {\n success: true,\n message: FormatMessages.execute(messages),\n };\n } catch (error) {\n return {\n success: false,\n message: FormatMessages.execute([\n '❌ Failed to apply contexts to the project',\n '--------------------------------',\n `Error: ${error instanceof Error ? error.message : String(error)}`,\n ]),\n };\n }\n }\n}\n","/**\n * CursorContextApply class\n * Applies cursor context to the project by copying from package\n */\n\nimport * as path from 'path';\nimport { AIAgentBaseApply } from '../../../framework/command/ai-agent/base-apply/index';\n\n/**\n * CursorContextApply class\n * Applies cursor context to the project by copying from package\n */\nexport class CursorContextApply extends AIAgentBaseApply {\n /**\n * Static command description\n */\n private static readonly DESCRIPTION =\n 'Apply contexts to your project (use --force or -f to overwrite existing)';\n\n /**\n * Method to get the description of the command\n * @returns {string} The description of the command\n */\n public static override getDescription(): string {\n return this.DESCRIPTION;\n }\n\n /**\n * Enable IDE detection for Cursor-specific contexts\n * @returns {boolean} True to enable IDE detection\n */\n public static override shouldCheckIde(): boolean {\n return true;\n }\n\n /**\n * Get the rules directory path\n * @returns {string} The rules directory path\n */\n public static override getCopyDirs(): Record<string, { from: string; to: string }> {\n return {\n rules: {\n from: path.join('files', 'cursor-context', 'rules'),\n to: path.join('.cursor', 'rules'),\n },\n commands: {\n from: path.join('files', 'cursor-context', 'commands'),\n to: path.join('.cursor', 'commands'),\n },\n };\n }\n}\n","/**\n * <license header>\n */\n\nimport { CommandResult, CommandDescriptor } from './types';\n\n/**\n * CommandRegistry class\n * Manages the registration of commands and their execution\n */\nexport abstract class CommandRegistry {\n /**\n * Static method to get the commands - must be implemented by subclasses\n *\n * @returns {CommandDescriptor[]} The commands\n */\n public static getCommands(): CommandDescriptor[] {\n throw new Error('getCommands() must be implemented by subclass');\n }\n\n /**\n * Static execute method to execute a command\n *\n * @param {string} type - The name of the command to execute\n * @param {...any} args - The arguments to pass to the command\n * @returns {Promise<CommandResult>} The execution result\n */\n static async execute(type: string = 'help', ...args: any[]): Promise<CommandResult> {\n const command = this.getCommands().find((cmd: CommandDescriptor) => cmd.name === type);\n if (!command) {\n return {\n success: false,\n message: `Unknown command: ${type}`,\n };\n }\n return await command.execute(...args);\n }\n}\n","/**\n * <license header>\n */\n\nimport { CursorContextHelp } from './help/index';\nimport { CursorContextCheck } from './check/index';\nimport { CursorContextApply } from './apply/index';\nimport { CommandDescriptor } from '../../framework/command/registry/types';\nimport { CommandRegistry } from '../../framework/command/registry/index';\n\n/**\n * CursorRules class\n * Manages the execution of cursor rules commands\n */\nexport class CursorRules extends CommandRegistry {\n /**\n * Static commands array\n *\n * @returns {CommandDescriptor[]} The commands array\n */\n public static override getCommands(): CommandDescriptor[] {\n return [\n {\n name: CursorContextHelp.getName(),\n description: CursorContextHelp.getDescription(),\n execute: CursorContextHelp.execute.bind(CursorContextHelp),\n },\n {\n name: CursorContextCheck.getName(),\n description: CursorContextCheck.getDescription(),\n execute: CursorContextCheck.execute.bind(CursorContextCheck),\n },\n {\n name: CursorContextApply.getName(),\n description: CursorContextApply.getDescription(),\n execute: CursorContextApply.execute.bind(CursorContextApply),\n },\n ];\n }\n}\n","/**\n * <license header>\n */\n\n/**\n * CLI entry point for aio-toolkit-cursor-context\n *\n * This will handle commands like:\n * - npx aio-toolkit-cursor-context apply\n * - npx aio-toolkit-cursor-context check\n * - npx aio-toolkit-cursor-context help\n */\n\nimport { CursorRules } from '../lib/index';\n\n/**\n * Command to execute\n * @type {string}\n */\nconst command = process.argv[2] || 'help';\n\n/**\n * Additional arguments (flags and options)\n * @type {string[]}\n */\nconst args = process.argv.slice(3);\n\n/**\n * Main function to execute the command\n * @returns {Promise<void>}\n */\nasync function main(): Promise<void> {\n const result = await CursorRules.execute(command, ...args);\n console.log(result.message);\n if (!result.success) {\n process.exit(1);\n }\n}\n\n/**\n * Main function to execute the command\n * @param {Error} error - The error to log\n * @returns {Promise<void>}\n */\nmain().catch((error: Error) => {\n console.error('Error:', error.message);\n process.exit(1);\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAUsB;AAVtB;AAAA;AAAA;AAUO,IAAe,mBAAf,MAAe,iBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA,MAKpC,OAAc,UAAkB;AAC9B,cAAM,IAAI,MAAM,2CAA2C;AAAA,MAC7D;AAAA;AAAA;AAAA;AAAA;AAAA,MAMA,OAAc,iBAAyB;AACrC,cAAM,IAAI,MAAM,kDAAkD;AAAA,MACpE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOA,OAAc,WAAWA,OAAqD;AAC5E,cAAM,IAAI,MAAM,8CAA8CA,MAAK,KAAK,IAAI,CAAC,EAAE;AAAA,MACjF;AAAA,IACF;AAzBsC;AAA/B,IAAe,kBAAf;AAAA;AAAA;;;ACVP,IAWa;AAXb;AAAA;AAAA;AAIA;AAOO,IAAM,mBAAN,MAAM,yBAAwB,gBAAgB;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,aAAa,mBAAmB,eAAe;AAAA,YAC/C,SAAS,mBAAmB,QAAQ,KAAK,kBAAkB;AAAA,UAC7D;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAzBiD;AAA1C,IAAM,cAAN;AAAA;AAAA;;;ACDP;AAMA,IAAM,UAAU,QAAQ,KAAK,CAAC,KAAK;AAMnC,IAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;AAMjC,eAAe,OAAsB;AACnC,QAAM,SAAS,MAAM,YAAY,QAAQ,SAAS,GAAG,IAAI;AACzD,UAAQ,IAAI,OAAO,OAAO;AAC1B,MAAI,CAAC,OAAO,SAAS;AACnB,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF;AANe;AAaf,KAAK,EAAE,MAAM,CAAC,UAAiB;AAC7B,UAAQ,MAAM,UAAU,MAAM,OAAO;AACrC,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["args","CursorRules","fs","fs","fs","path","fs","path","platform","path","path","fs","path","args","path","args","command"]}
|
package/dist/index.d.mts
CHANGED
|
@@ -812,8 +812,8 @@ type RabbitMQConsumeOptions = {
|
|
|
812
812
|
nackRequeue?: boolean;
|
|
813
813
|
exchange?: string;
|
|
814
814
|
};
|
|
815
|
-
type MessageHandler = (queueName: string, content: string) => Promise<void> | void;
|
|
816
|
-
type ConsumeStats = {
|
|
815
|
+
type MessageHandler$1 = (queueName: string, content: string) => Promise<void> | void;
|
|
816
|
+
type ConsumeStats$1 = {
|
|
817
817
|
consumed: number;
|
|
818
818
|
acked: number;
|
|
819
819
|
nacked: number;
|
|
@@ -822,7 +822,7 @@ type ConsumeStats = {
|
|
|
822
822
|
error: unknown;
|
|
823
823
|
}>;
|
|
824
824
|
};
|
|
825
|
-
type PublishStats = {
|
|
825
|
+
type PublishStats$1 = {
|
|
826
826
|
published: number;
|
|
827
827
|
failed: number;
|
|
828
828
|
errors: Array<{
|
|
@@ -834,14 +834,59 @@ type PublishStats = {
|
|
|
834
834
|
declare class RabbitMQClient {
|
|
835
835
|
private readonly credentials;
|
|
836
836
|
constructor(credentials: RabbitMQCredentials);
|
|
837
|
-
consume(queueName: string, options: RabbitMQConsumeOptions, handler: MessageHandler): Promise<ConsumeStats>;
|
|
838
|
-
publish(queueName: string, payloads: string[]): Promise<PublishStats>;
|
|
837
|
+
consume(queueName: string, options: RabbitMQConsumeOptions, handler: MessageHandler$1): Promise<ConsumeStats$1>;
|
|
838
|
+
publish(queueName: string, payloads: string[]): Promise<PublishStats$1>;
|
|
839
839
|
private publishBatch;
|
|
840
840
|
private buildConnectionUrl;
|
|
841
841
|
private processBatch;
|
|
842
842
|
private processMessage;
|
|
843
843
|
}
|
|
844
844
|
|
|
845
|
+
type AmazonSQSConfig = {
|
|
846
|
+
region: string;
|
|
847
|
+
accessKeyId: string;
|
|
848
|
+
secretAccessKey: string;
|
|
849
|
+
queueUrl: string;
|
|
850
|
+
visibilityTimeout?: number;
|
|
851
|
+
waitTimeSeconds?: number;
|
|
852
|
+
messageGroupId?: string;
|
|
853
|
+
};
|
|
854
|
+
type MessageHandler = (messageId: string, body: string) => Promise<void> | void;
|
|
855
|
+
type PublishStats = {
|
|
856
|
+
published: number;
|
|
857
|
+
failed: number;
|
|
858
|
+
errors: Array<{
|
|
859
|
+
payload: string;
|
|
860
|
+
error: unknown;
|
|
861
|
+
}>;
|
|
862
|
+
};
|
|
863
|
+
type ConsumeStats = {
|
|
864
|
+
received: number;
|
|
865
|
+
processed: number;
|
|
866
|
+
deleted: number;
|
|
867
|
+
failed: number;
|
|
868
|
+
errors: Array<{
|
|
869
|
+
messageId: string;
|
|
870
|
+
error: unknown;
|
|
871
|
+
}>;
|
|
872
|
+
};
|
|
873
|
+
|
|
874
|
+
declare class AmazonSQSClient {
|
|
875
|
+
private readonly client;
|
|
876
|
+
private readonly queueUrl;
|
|
877
|
+
private readonly isFifo;
|
|
878
|
+
private readonly visibilityTimeout;
|
|
879
|
+
private readonly waitTimeSeconds;
|
|
880
|
+
private readonly messageGroupId;
|
|
881
|
+
constructor(config: AmazonSQSConfig);
|
|
882
|
+
publish(payloads: string[]): Promise<PublishStats>;
|
|
883
|
+
consume(batchSize: number, handler: MessageHandler): Promise<ConsumeStats>;
|
|
884
|
+
private receiveMessages;
|
|
885
|
+
private deleteMessages;
|
|
886
|
+
private sendBatch;
|
|
887
|
+
private chunk;
|
|
888
|
+
}
|
|
889
|
+
|
|
845
890
|
declare class AdobeAuth {
|
|
846
891
|
static getToken(clientId: string, clientSecret: string, technicalAccountId: string, technicalAccountEmail: string, imsOrgId: string, scopes: string[], currentContext?: string): Promise<string>;
|
|
847
892
|
}
|
|
@@ -1137,4 +1182,4 @@ declare class AdminUiSdk {
|
|
|
1137
1182
|
getRegistration(): AdminUiSdkRegistration;
|
|
1138
1183
|
}
|
|
1139
1184
|
|
|
1140
|
-
export { AbdbCollection, type AbdbCollectionCallback, AbdbColumn, type AbdbColumnJson, type AbdbColumnOptions, AbdbColumnType, type AbdbFindOptions, type AbdbFindSort, type AbdbFindSortDirection, type AbdbRecord, AbdbRepository, type AbdbRepositoryFilter, type AbdbRunCallback, type AddColumnOptions, AdminUiSdk, type AdminUiSdkRegistration, AdobeAuth, AdobeCommerceClient, type AdobeIMSConfig, type BaseTelemetry, type BaseTelemetryValidator, BasicAuthConnection, BearerToken, type BearerTokenInfo, type CommerceEvent, type CommerceEventConfig, type CommerceEventField, type Connection, type ConsumeStats, type CreateEventResult, CreateEvents, type CreateProviderParams, type CreateProviderResult, type CreateRegistrationResult, CreateRegistrations, type ErrorResponse, EventConsumerAction, type EventData, type EventMetadata, type EventMetadataInputModel, type EventMetadataListResponse, EventMetadataManager, type ExtendedRequestError, type FileMetadata, type FileRecord, FileRepository, GenerateBasicAuthToken, type GetProviderQueryParams, type GetRegistrationQueryParams, GraphQlAction, type HALLink, type Headers, HttpMethod, HttpStatus, IOEventsApiError, type IOEventsError, ImsConnection, ImsToken, type ImsTokenResult, InfiniteLoopBreaker, type InfiniteLoopData, IoEventsGlobals, JsonMessageProcessor, type ListProvidersQueryParams, type ListRegistrationQueryParams, type MenuItem, type MessageHandler, Oauth1aConnection, OnboardCommerce, type OnboardCommerceConfig, type OnboardCommerceResult, OnboardEvents, type OnboardEventsInput, type OnboardEventsResponse, OnboardEvents as OnboardIOEvents, Openwhisk, OpenwhiskAction, type OpenwhiskConfig, type Page, Parameters, type Provider, type ProviderInputModel, ProviderManager, PublishEvent, type PublishEventResult, type PublishStats, RabbitMQClient, type RabbitMQConsumeOptions, type RabbitMQCredentials, type Registration, type RegistrationCreateModel, type RegistrationListResponse, RegistrationManager, RestClient, RuntimeAction, RuntimeActionResponse, type RuntimeActionResponseType, RuntimeApiGatewayService, ShippingCarrier, type ShippingCarrierData, ShippingCarrierMethod, type ShippingCarrierMethodAdditionalData, type ShippingCarrierMethodData, ShippingCarrierResponse, SignatureVerification, SuccessChecker, type SuccessResponse, Telemetry, TelemetryInputError, type TokenResult, Validator, WebhookAction, type WebhookActionAddResponse, type WebhookActionExceptionResponse, WebhookActionOperation, type WebhookActionRemoveResponse, type WebhookActionReplaceResponse, WebhookActionResponse, type WebhookActionResponseType, type WebhookActionSuccessResponse, type WorkspaceConfig };
|
|
1185
|
+
export { AbdbCollection, type AbdbCollectionCallback, AbdbColumn, type AbdbColumnJson, type AbdbColumnOptions, AbdbColumnType, type AbdbFindOptions, type AbdbFindSort, type AbdbFindSortDirection, type AbdbRecord, AbdbRepository, type AbdbRepositoryFilter, type AbdbRunCallback, type AddColumnOptions, AdminUiSdk, type AdminUiSdkRegistration, AdobeAuth, AdobeCommerceClient, type AdobeIMSConfig, AmazonSQSClient, type AmazonSQSConfig, type ConsumeStats as AmazonSQSConsumeStats, type MessageHandler as AmazonSQSMessageHandler, type PublishStats as AmazonSQSPublishStats, type BaseTelemetry, type BaseTelemetryValidator, BasicAuthConnection, BearerToken, type BearerTokenInfo, type CommerceEvent, type CommerceEventConfig, type CommerceEventField, type Connection, type ConsumeStats$1 as ConsumeStats, type CreateEventResult, CreateEvents, type CreateProviderParams, type CreateProviderResult, type CreateRegistrationResult, CreateRegistrations, type ErrorResponse, EventConsumerAction, type EventData, type EventMetadata, type EventMetadataInputModel, type EventMetadataListResponse, EventMetadataManager, type ExtendedRequestError, type FileMetadata, type FileRecord, FileRepository, GenerateBasicAuthToken, type GetProviderQueryParams, type GetRegistrationQueryParams, GraphQlAction, type HALLink, type Headers, HttpMethod, HttpStatus, IOEventsApiError, type IOEventsError, ImsConnection, ImsToken, type ImsTokenResult, InfiniteLoopBreaker, type InfiniteLoopData, IoEventsGlobals, JsonMessageProcessor, type ListProvidersQueryParams, type ListRegistrationQueryParams, type MenuItem, type MessageHandler$1 as MessageHandler, Oauth1aConnection, OnboardCommerce, type OnboardCommerceConfig, type OnboardCommerceResult, OnboardEvents, type OnboardEventsInput, type OnboardEventsResponse, OnboardEvents as OnboardIOEvents, Openwhisk, OpenwhiskAction, type OpenwhiskConfig, type Page, Parameters, type Provider, type ProviderInputModel, ProviderManager, PublishEvent, type PublishEventResult, type PublishStats$1 as PublishStats, RabbitMQClient, type RabbitMQConsumeOptions, type RabbitMQCredentials, type Registration, type RegistrationCreateModel, type RegistrationListResponse, RegistrationManager, RestClient, RuntimeAction, RuntimeActionResponse, type RuntimeActionResponseType, RuntimeApiGatewayService, ShippingCarrier, type ShippingCarrierData, ShippingCarrierMethod, type ShippingCarrierMethodAdditionalData, type ShippingCarrierMethodData, ShippingCarrierResponse, SignatureVerification, SuccessChecker, type SuccessResponse, Telemetry, TelemetryInputError, type TokenResult, Validator, WebhookAction, type WebhookActionAddResponse, type WebhookActionExceptionResponse, WebhookActionOperation, type WebhookActionRemoveResponse, type WebhookActionReplaceResponse, WebhookActionResponse, type WebhookActionResponseType, type WebhookActionSuccessResponse, type WorkspaceConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -812,8 +812,8 @@ type RabbitMQConsumeOptions = {
|
|
|
812
812
|
nackRequeue?: boolean;
|
|
813
813
|
exchange?: string;
|
|
814
814
|
};
|
|
815
|
-
type MessageHandler = (queueName: string, content: string) => Promise<void> | void;
|
|
816
|
-
type ConsumeStats = {
|
|
815
|
+
type MessageHandler$1 = (queueName: string, content: string) => Promise<void> | void;
|
|
816
|
+
type ConsumeStats$1 = {
|
|
817
817
|
consumed: number;
|
|
818
818
|
acked: number;
|
|
819
819
|
nacked: number;
|
|
@@ -822,7 +822,7 @@ type ConsumeStats = {
|
|
|
822
822
|
error: unknown;
|
|
823
823
|
}>;
|
|
824
824
|
};
|
|
825
|
-
type PublishStats = {
|
|
825
|
+
type PublishStats$1 = {
|
|
826
826
|
published: number;
|
|
827
827
|
failed: number;
|
|
828
828
|
errors: Array<{
|
|
@@ -834,14 +834,59 @@ type PublishStats = {
|
|
|
834
834
|
declare class RabbitMQClient {
|
|
835
835
|
private readonly credentials;
|
|
836
836
|
constructor(credentials: RabbitMQCredentials);
|
|
837
|
-
consume(queueName: string, options: RabbitMQConsumeOptions, handler: MessageHandler): Promise<ConsumeStats>;
|
|
838
|
-
publish(queueName: string, payloads: string[]): Promise<PublishStats>;
|
|
837
|
+
consume(queueName: string, options: RabbitMQConsumeOptions, handler: MessageHandler$1): Promise<ConsumeStats$1>;
|
|
838
|
+
publish(queueName: string, payloads: string[]): Promise<PublishStats$1>;
|
|
839
839
|
private publishBatch;
|
|
840
840
|
private buildConnectionUrl;
|
|
841
841
|
private processBatch;
|
|
842
842
|
private processMessage;
|
|
843
843
|
}
|
|
844
844
|
|
|
845
|
+
type AmazonSQSConfig = {
|
|
846
|
+
region: string;
|
|
847
|
+
accessKeyId: string;
|
|
848
|
+
secretAccessKey: string;
|
|
849
|
+
queueUrl: string;
|
|
850
|
+
visibilityTimeout?: number;
|
|
851
|
+
waitTimeSeconds?: number;
|
|
852
|
+
messageGroupId?: string;
|
|
853
|
+
};
|
|
854
|
+
type MessageHandler = (messageId: string, body: string) => Promise<void> | void;
|
|
855
|
+
type PublishStats = {
|
|
856
|
+
published: number;
|
|
857
|
+
failed: number;
|
|
858
|
+
errors: Array<{
|
|
859
|
+
payload: string;
|
|
860
|
+
error: unknown;
|
|
861
|
+
}>;
|
|
862
|
+
};
|
|
863
|
+
type ConsumeStats = {
|
|
864
|
+
received: number;
|
|
865
|
+
processed: number;
|
|
866
|
+
deleted: number;
|
|
867
|
+
failed: number;
|
|
868
|
+
errors: Array<{
|
|
869
|
+
messageId: string;
|
|
870
|
+
error: unknown;
|
|
871
|
+
}>;
|
|
872
|
+
};
|
|
873
|
+
|
|
874
|
+
declare class AmazonSQSClient {
|
|
875
|
+
private readonly client;
|
|
876
|
+
private readonly queueUrl;
|
|
877
|
+
private readonly isFifo;
|
|
878
|
+
private readonly visibilityTimeout;
|
|
879
|
+
private readonly waitTimeSeconds;
|
|
880
|
+
private readonly messageGroupId;
|
|
881
|
+
constructor(config: AmazonSQSConfig);
|
|
882
|
+
publish(payloads: string[]): Promise<PublishStats>;
|
|
883
|
+
consume(batchSize: number, handler: MessageHandler): Promise<ConsumeStats>;
|
|
884
|
+
private receiveMessages;
|
|
885
|
+
private deleteMessages;
|
|
886
|
+
private sendBatch;
|
|
887
|
+
private chunk;
|
|
888
|
+
}
|
|
889
|
+
|
|
845
890
|
declare class AdobeAuth {
|
|
846
891
|
static getToken(clientId: string, clientSecret: string, technicalAccountId: string, technicalAccountEmail: string, imsOrgId: string, scopes: string[], currentContext?: string): Promise<string>;
|
|
847
892
|
}
|
|
@@ -1137,4 +1182,4 @@ declare class AdminUiSdk {
|
|
|
1137
1182
|
getRegistration(): AdminUiSdkRegistration;
|
|
1138
1183
|
}
|
|
1139
1184
|
|
|
1140
|
-
export { AbdbCollection, type AbdbCollectionCallback, AbdbColumn, type AbdbColumnJson, type AbdbColumnOptions, AbdbColumnType, type AbdbFindOptions, type AbdbFindSort, type AbdbFindSortDirection, type AbdbRecord, AbdbRepository, type AbdbRepositoryFilter, type AbdbRunCallback, type AddColumnOptions, AdminUiSdk, type AdminUiSdkRegistration, AdobeAuth, AdobeCommerceClient, type AdobeIMSConfig, type BaseTelemetry, type BaseTelemetryValidator, BasicAuthConnection, BearerToken, type BearerTokenInfo, type CommerceEvent, type CommerceEventConfig, type CommerceEventField, type Connection, type ConsumeStats, type CreateEventResult, CreateEvents, type CreateProviderParams, type CreateProviderResult, type CreateRegistrationResult, CreateRegistrations, type ErrorResponse, EventConsumerAction, type EventData, type EventMetadata, type EventMetadataInputModel, type EventMetadataListResponse, EventMetadataManager, type ExtendedRequestError, type FileMetadata, type FileRecord, FileRepository, GenerateBasicAuthToken, type GetProviderQueryParams, type GetRegistrationQueryParams, GraphQlAction, type HALLink, type Headers, HttpMethod, HttpStatus, IOEventsApiError, type IOEventsError, ImsConnection, ImsToken, type ImsTokenResult, InfiniteLoopBreaker, type InfiniteLoopData, IoEventsGlobals, JsonMessageProcessor, type ListProvidersQueryParams, type ListRegistrationQueryParams, type MenuItem, type MessageHandler, Oauth1aConnection, OnboardCommerce, type OnboardCommerceConfig, type OnboardCommerceResult, OnboardEvents, type OnboardEventsInput, type OnboardEventsResponse, OnboardEvents as OnboardIOEvents, Openwhisk, OpenwhiskAction, type OpenwhiskConfig, type Page, Parameters, type Provider, type ProviderInputModel, ProviderManager, PublishEvent, type PublishEventResult, type PublishStats, RabbitMQClient, type RabbitMQConsumeOptions, type RabbitMQCredentials, type Registration, type RegistrationCreateModel, type RegistrationListResponse, RegistrationManager, RestClient, RuntimeAction, RuntimeActionResponse, type RuntimeActionResponseType, RuntimeApiGatewayService, ShippingCarrier, type ShippingCarrierData, ShippingCarrierMethod, type ShippingCarrierMethodAdditionalData, type ShippingCarrierMethodData, ShippingCarrierResponse, SignatureVerification, SuccessChecker, type SuccessResponse, Telemetry, TelemetryInputError, type TokenResult, Validator, WebhookAction, type WebhookActionAddResponse, type WebhookActionExceptionResponse, WebhookActionOperation, type WebhookActionRemoveResponse, type WebhookActionReplaceResponse, WebhookActionResponse, type WebhookActionResponseType, type WebhookActionSuccessResponse, type WorkspaceConfig };
|
|
1185
|
+
export { AbdbCollection, type AbdbCollectionCallback, AbdbColumn, type AbdbColumnJson, type AbdbColumnOptions, AbdbColumnType, type AbdbFindOptions, type AbdbFindSort, type AbdbFindSortDirection, type AbdbRecord, AbdbRepository, type AbdbRepositoryFilter, type AbdbRunCallback, type AddColumnOptions, AdminUiSdk, type AdminUiSdkRegistration, AdobeAuth, AdobeCommerceClient, type AdobeIMSConfig, AmazonSQSClient, type AmazonSQSConfig, type ConsumeStats as AmazonSQSConsumeStats, type MessageHandler as AmazonSQSMessageHandler, type PublishStats as AmazonSQSPublishStats, type BaseTelemetry, type BaseTelemetryValidator, BasicAuthConnection, BearerToken, type BearerTokenInfo, type CommerceEvent, type CommerceEventConfig, type CommerceEventField, type Connection, type ConsumeStats$1 as ConsumeStats, type CreateEventResult, CreateEvents, type CreateProviderParams, type CreateProviderResult, type CreateRegistrationResult, CreateRegistrations, type ErrorResponse, EventConsumerAction, type EventData, type EventMetadata, type EventMetadataInputModel, type EventMetadataListResponse, EventMetadataManager, type ExtendedRequestError, type FileMetadata, type FileRecord, FileRepository, GenerateBasicAuthToken, type GetProviderQueryParams, type GetRegistrationQueryParams, GraphQlAction, type HALLink, type Headers, HttpMethod, HttpStatus, IOEventsApiError, type IOEventsError, ImsConnection, ImsToken, type ImsTokenResult, InfiniteLoopBreaker, type InfiniteLoopData, IoEventsGlobals, JsonMessageProcessor, type ListProvidersQueryParams, type ListRegistrationQueryParams, type MenuItem, type MessageHandler$1 as MessageHandler, Oauth1aConnection, OnboardCommerce, type OnboardCommerceConfig, type OnboardCommerceResult, OnboardEvents, type OnboardEventsInput, type OnboardEventsResponse, OnboardEvents as OnboardIOEvents, Openwhisk, OpenwhiskAction, type OpenwhiskConfig, type Page, Parameters, type Provider, type ProviderInputModel, ProviderManager, PublishEvent, type PublishEventResult, type PublishStats$1 as PublishStats, RabbitMQClient, type RabbitMQConsumeOptions, type RabbitMQCredentials, type Registration, type RegistrationCreateModel, type RegistrationListResponse, RegistrationManager, RestClient, RuntimeAction, RuntimeActionResponse, type RuntimeActionResponseType, RuntimeApiGatewayService, ShippingCarrier, type ShippingCarrierData, ShippingCarrierMethod, type ShippingCarrierMethodAdditionalData, type ShippingCarrierMethodData, ShippingCarrierResponse, SignatureVerification, SuccessChecker, type SuccessResponse, Telemetry, TelemetryInputError, type TokenResult, Validator, WebhookAction, type WebhookActionAddResponse, type WebhookActionExceptionResponse, WebhookActionOperation, type WebhookActionRemoveResponse, type WebhookActionReplaceResponse, WebhookActionResponse, type WebhookActionResponseType, type WebhookActionSuccessResponse, type WorkspaceConfig };
|