@morodomi/ait3
Version:
AIT³ Development Platform - AI + Ticket + Test + Tool driven development methodology
72 lines (71 loc) • 2.05 kB
JavaScript
// Application constants
export const TICKET_CONSTANTS = {
// File system paths
DEFAULT_BASE_PATH: '.tickets',
LOCK_FILE_NAME: '.lock',
CONFIG_FILE_NAME: 'config.json',
// Directory names
DIRECTORIES: {
TODO: 'todo',
DOING: 'doing',
DONE: 'done'
},
// Ticket ID format
ID_FORMAT: {
LENGTH: 4,
PAD_CHAR: '0'
},
// File locking configuration
LOCK_CONFIG: {
RETRIES: 5,
STALE_TIME: 5000, // 5 seconds
REALPATH: false
},
// Validation limits
VALIDATION: {
TITLE_MIN_LENGTH: 1,
TITLE_MAX_LENGTH: 200
},
// File extensions
FILE_EXTENSIONS: {
MARKDOWN: '.md'
},
// Time formats
TIME_FORMATS: {
ISO: 'YYYY-MM-DD HH:mm:ss'
}
};
// Default ticket configuration
export const DEFAULT_TICKET_CONFIG = {
backend: 'local',
path: '.tickets',
numbering: {
format: '0000',
increment: 1,
next: 1
},
templates: {
feature: 'templates/feature-ticket.md',
bug: 'templates/bug-ticket.md',
task: 'templates/task-ticket.md'
},
labels: {
priority: ['low', 'medium', 'high', 'critical'],
type: ['feature', 'bug', 'task', 'spike'],
status: ['todo', 'doing', 'done']
}
};
// Validation constants
export const VALID_STATUSES = ['todo', 'doing', 'done'];
export const VALID_PRIORITIES = ['low', 'medium', 'high', 'critical'];
// Error messages
export const ERROR_MESSAGES = {
EMPTY_TITLE: 'Ticket title cannot be empty',
INVALID_PRIORITY: `Invalid priority. Must be one of: ${VALID_PRIORITIES.join(', ')}`,
INVALID_STATUS: `Invalid status. Must be one of: ${VALID_STATUSES.join(', ')}`,
CONFIG_READ_ERROR: 'Failed to read configuration file',
CONFIG_WRITE_ERROR: 'Failed to write configuration file',
DIRECTORY_CREATE_ERROR: 'Failed to create directory structure',
FILE_WRITE_ERROR: 'Failed to write ticket file',
FILE_LOCK_ERROR: 'Failed to acquire file lock'
};