UNPKG

simple-task-master

Version:
145 lines 5.14 kB
/** * Constants and default values for Simple Task Master */ /** * Current schema version */ export declare const CURRENT_SCHEMA_VERSION = 1; /** * Default configuration values */ export declare const DEFAULT_CONFIG: { /** Default lock timeout in milliseconds (30 seconds) */ readonly LOCK_TIMEOUT_MS: 30000; /** Default maximum task file size in bytes (1MB) */ readonly MAX_TASK_SIZE_BYTES: 1048576; /** Lock check interval in milliseconds */ readonly LOCK_CHECK_INTERVAL_MS: 100; /** Maximum lock acquisition retries (5 seconds total wait) */ readonly MAX_LOCK_RETRIES: 50; /** Schema version */ readonly SCHEMA_VERSION: 1; }; /** * File size limits */ export declare const FILE_LIMITS: { /** Maximum task file size in bytes (1MB) */ readonly MAX_TASK_SIZE: 1048576; /** Maximum title length in characters */ readonly MAX_TITLE_LENGTH: 200; /** Maximum description length in bytes (64KB) */ readonly MAX_DESCRIPTION_LENGTH: 65536; /** Maximum number of tags per task */ readonly MAX_TAGS: 50; /** Maximum number of dependencies per task */ readonly MAX_DEPENDENCIES: 100; /** Maximum number of total fields (including unknown fields) per task */ readonly MAX_TOTAL_FIELDS: 100; }; /** * Path constants */ export declare const PATHS: { /** Base directory name for STM */ readonly BASE_DIR: ".simple-task-master"; /** Tasks subdirectory */ readonly TASKS_DIR: "tasks"; /** Config file name */ readonly CONFIG_FILE: "config.json"; /** Lock file name */ readonly LOCK_FILE: "lock"; /** Get full base directory path */ readonly getBaseDir: (projectRoot: string) => string; /** Get full tasks directory path */ readonly getTasksDir: (projectRoot: string) => string; /** Get full config file path */ readonly getConfigPath: (projectRoot: string) => string; /** Get full lock file path */ readonly getLockPath: (projectRoot: string) => string; }; /** * Error messages */ export declare const ERROR_MESSAGES: { readonly TITLE_REQUIRED: "Task title is required"; readonly TITLE_TOO_LONG: "Task title exceeds 200 characters"; readonly TITLE_INVALID_CHARS: "Task title contains invalid filesystem characters"; readonly DESCRIPTION_TOO_LONG: "Task description exceeds 65536 bytes"; readonly INVALID_STATUS: "Task status must be one of: pending, in-progress, done"; readonly INVALID_TASK_ID: "Invalid task ID"; readonly TASK_NOT_FOUND: "Task not found"; readonly DEPENDENCY_NOT_FOUND: "Dependency task not found"; readonly CIRCULAR_DEPENDENCY: "Circular dependency detected"; readonly TOO_MANY_TAGS: "Task cannot have more than 50 tags"; readonly TOO_MANY_DEPENDENCIES: "Task cannot have more than 100 dependencies"; readonly TOO_MANY_FIELDS: "Task cannot have more than 100 total fields"; readonly TASK_FILE_TOO_LARGE: "Task file exceeds maximum size of 1048576 bytes"; readonly DIRECTORY_NOT_INITIALIZED: "STM directory not initialized. Run \"stm init\" first"; readonly CONFIG_NOT_FOUND: "Configuration file not found"; readonly INVALID_CONFIG: "Invalid configuration file"; readonly LOCK_ACQUISITION_FAILED: "Failed to acquire lock after maximum retries"; readonly LOCK_ALREADY_HELD: "Lock is already held by another process"; readonly STALE_LOCK_DETECTED: "Stale lock detected and removed"; readonly UNSUPPORTED_SCHEMA: "Unsupported schema version"; readonly SCHEMA_MISMATCH: "Task schema version does not match current version"; readonly UNKNOWN_ERROR: "An unknown error occurred"; readonly PERMISSION_DENIED: "Permission denied"; readonly DISK_FULL: "Disk space exhausted"; }; /** * File name patterns */ export declare const FILE_PATTERNS: { /** Pattern for task files */ readonly TASK_FILE: RegExp; /** Invalid filename characters (filesystem-specific) */ readonly INVALID_FILENAME_CHARS: RegExp; /** ISO 8601 timestamp pattern */ readonly ISO_8601: RegExp; }; /** * CLI constants */ export declare const CLI: { /** Default command timeout in milliseconds */ readonly DEFAULT_TIMEOUT: 5000; /** Exit codes */ readonly EXIT_CODES: { readonly SUCCESS: 0; readonly ERROR: 1; readonly INVALID_USAGE: 2; readonly NOT_FOUND: 3; readonly LOCK_FAILED: 4; }; }; /** * Output format constants */ export declare const OUTPUT_FORMATS: { /** Newline-delimited JSON */ readonly NDJSON: "ndjson"; /** Pretty table format */ readonly PRETTY: "pretty"; /** YAML format */ readonly YAML: "yaml"; /** Markdown format */ readonly MARKDOWN: "markdown"; /** CSV format */ readonly CSV: "csv"; /** JSON format */ readonly JSON: "json"; }; /** * Task status values */ export declare const TASK_STATUS: { readonly PENDING: "pending"; readonly IN_PROGRESS: "in-progress"; readonly DONE: "done"; }; /** * Type for task status values */ export type TaskStatusValue = (typeof TASK_STATUS)[keyof typeof TASK_STATUS]; //# sourceMappingURL=constants.d.ts.map