This document provides detailed API reference for MAIASS's internal modules and functions.
Main orchestration module that coordinates the complete MAIASS workflow.
Executes the complete 4-phase MAIASS workflow.
Parameters:
options(Object): Pipeline configuration optionscommitsOnly(boolean): Only run commit workflow, skip version managementautoStage(boolean): Automatically stage all changes before committingversionBump(string): Version bump type ('major', 'minor', 'patch', or specific version)dryRun(boolean): Preview changes without applying themtag(boolean): Create git tag for new versionforce(boolean): Skip confirmation prompts
Returns:
Promise<Object>: Pipeline result with success status and phase results
Example:
import { runMaiassPipeline } from './lib/maiass-pipeline.js';
const result = await runMaiassPipeline({
versionBump: 'minor',
tag: true,
dryRun: false
});
if (result.success) {
console.log('Pipeline completed successfully');
}Git repository information and operations module.
Retrieves comprehensive Git repository information.
Returns:
Promise<Object>: Git information objectisRepository(boolean): Whether current directory is a Git repositorycurrentBranch(string): Current branch namegitAuthor(string): Git author name and emailjiraTicket(string|null): JIRA ticket extracted from branch namehasChanges(boolean): Whether there are uncommitted changesstagedChanges(Array): List of staged filesunstagedChanges(Array): List of unstaged files
Gets the current Git branch name.
Returns:
string: Current branch name
Classifies a branch according to Git flow conventions.
Parameters:
branchName(string): Branch name to classifyoptions(Object): Branch configurationdevelopBranch(string): Develop branch namemainBranch(string): Main branch namestagingBranch(string): Staging branch name
Returns:
Object: Branch classificationisFeature(boolean): Is feature branchisRelease(boolean): Is release branchisHotfix(boolean): Is hotfix branchisDevelop(boolean): Is develop branchisMain(boolean): Is main branch
Semantic version management and file operations.
Detects and returns current project version information.
Returns:
Promise<Object>: Version informationcurrent(string|null): Current version stringhasVersionFiles(boolean): Whether version files were foundfiles(Array): Detected version filesprimary(Object): Primary version file info
Calculates new version based on semantic versioning rules.
Parameters:
currentVersion(string): Current version (e.g., "1.2.3")bumpType(string): Bump type ('major', 'minor', 'patch', or specific version)
Returns:
string: New version string
Example:
import { bumpVersion } from './lib/version-manager.js';
const newVersion = bumpVersion('1.2.3', 'minor');
// Returns: '1.3.0'Updates version in all detected version files.
Parameters:
newVersion(string): New version to setoptions(Object): Update optionsdryRun(boolean): Preview changes without applying
Returns:
Promise<Object>: Update resultsuccess(boolean): Whether update succeededfilesUpdated(Array): List of updated fileserrors(Array): Any errors encountered
AI-powered commit workflow management.
Executes the complete commit workflow with AI assistance.
Parameters:
options(Object): Commit optionsautoStage(boolean): Automatically stage all changescommitsOnly(boolean): Commit-only mode flag
Returns:
Promise<void>: Resolves when commit workflow completes
Configuration file management and environment variable handling.
Loads configuration from all sources with proper priority.
Returns:
Object: Loaded configuration with source tracking
Gets a configuration value with fallback to defaults.
Parameters:
key(string): Configuration key (e.g., 'MAIASS_DEBUG')
Returns:
string: Configuration value
Sets a configuration value in the specified scope.
Parameters:
key(string): Configuration keyvalue(string): Configuration valuescope(string): Configuration scope ('global' or 'project')
Returns:
Promise<boolean>: Whether the operation succeeded
Terminal color and formatting utilities.
Exports:
Red(text): Red textGreen(text): Green textYellow(text): Yellow textBlue(text): Blue textCyan(text): Cyan textWhite(text): White textGray(text): Gray textBRed(text): Bright red textBGreen(text): Bright green textBYellow(text): Bright yellow textBBlue(text): Bright blue textBCyan(text): Bright cyan textBWhite(text): Bright white text
Cross-platform console symbols with Unicode/ASCII fallback.
Exports:
SYMBOLS.CHECKMARK: ✅ or [✓]SYMBOLS.CROSS: ❌ or [✗]SYMBOLS.INFO: ℹ️ or [i]SYMBOLS.WARNING:⚠️ or [!]SYMBOLS.GEAR: ⚙️ or [*]SYMBOLS.ROCKET: 🚀 or [>]
User input handling utilities.
Gets a single character input from user.
Parameters:
prompt(string): Input prompt to display
Returns:
Promise<string>: Single character entered by user
Gets a line of input from user.
Parameters:
prompt(string): Input prompt to display
Returns:
Promise<string>: Line entered by user
Gets multi-line input from user.
Parameters:
prompt(string): Input prompt to display
Returns:
Promise<string>: Multi-line text entered by user
Defines all MAIASS configuration variables with defaults and descriptions.
Object containing all configuration variable definitions:
{
'MAIASS_DEBUG': {
default: 'false',
description: 'Enable debug mode',
sensitive: false
},
'MAIASS_AI_TOKEN': {
default: '',
description: 'MAIASS API key for AI features',
sensitive: true
}
// ... more variables
}Main command handler for the MAIASS pipeline.
Parameters:
args(Object): Parsed command-line arguments from yargs
Command handler for commit-only workflow.
Parameters:
args(Object): Parsed command-line arguments
Command handler for version management operations.
Parameters:
args(Object): Parsed command-line arguments
Command handler for configuration management.
Parameters:
args(Object): Parsed command-line arguments
All modules use consistent error handling patterns:
// Success result
{
success: true,
data: { /* result data */ }
}
// Error result
{
success: false,
error: 'Error message',
details: { /* additional error info */ }
}NOT_GIT_REPOSITORY: Current directory is not a Git repositoryNO_VERSION_FILES: No version files detected in projectMERGE_CONFLICT: Git merge conflict encounteredINVALID_VERSION: Invalid version format providedCONFIG_ERROR: Configuration file errorAI_ERROR: AI API error
For testing, modules provide mock implementations:
// Mock git operations
import { mockGitInfo } from './lib/git-info.js';
mockGitInfo({
currentBranch: 'feature/test',
hasChanges: true,
stagedChanges: ['src/test.js']
});// Create test repository
import { createTestRepo } from './test/helpers.js';
const testRepo = await createTestRepo({
branch: 'develop',
files: ['package.json', 'src/app.js'],
version: '1.0.0'
});All file operations and Git commands are asynchronous:
// Good: Proper async handling
const gitInfo = await getGitInfo();
const version = await getCurrentVersion();
// Bad: Blocking operations
const gitInfo = getGitInfoSync(); // Does not existLarge repositories are handled efficiently:
- Git operations use streaming where possible
- File operations are batched
- Memory usage is monitored in debug mode
Configuration and Git information is cached appropriately:
- Config values cached per session
- Git branch info cached until changed
- Version file detection cached per run
💡 Pro Tip: Use TypeScript definitions for better IDE support and type safety when integrating MAIASS into your projects.