@e0ipso/ai-task-manager 1.0.1

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/LICENSE ADDED
@@ -0,0 +1,68 @@
1
+ PROPRIETARY SOFTWARE LICENSE WITH REVOCATION RIGHTS
2
+
3
+ Copyright (c) 2025 Mateu Aguiló Bosch
4
+
5
+ NOTICE: This is proprietary software with revocable usage rights.
6
+
7
+ 1. GRANT OF LICENSE
8
+ Subject to the terms and conditions of this License, the copyright holder
9
+ hereby grants you a free, non-exclusive, non-transferable, revocable right
10
+ to use, run, and operate this software ("Software") for any lawful purpose.
11
+
12
+ 2. REVOCATION RIGHTS
13
+ The copyright holder reserves the absolute right to revoke this license at
14
+ any time, for any reason or no reason, with or without cause, by providing
15
+ written notice to you. Such notice may be provided through:
16
+ - Direct communication to known users
17
+ - Public announcement on the project repository
18
+ - Update to this LICENSE file
19
+
20
+ 3. NOTICE PERIOD
21
+ Upon issuance of a revocation notice, you will have thirty (30) days
22
+ ("Notice Period") to cease all use of the Software and remove all copies
23
+ from your systems.
24
+
25
+ 4. CONDITIONS FOR REVOCATION
26
+ While the copyright holder may revoke this license at their sole discretion,
27
+ revocation may particularly occur in cases of:
28
+ - Violation of applicable laws or regulations
29
+ - Use of the Software in a manner harmful to others
30
+ - Commercial use without separate commercial license
31
+ - Any use deemed inappropriate by the copyright holder
32
+
33
+ 5. POST-REVOCATION OBLIGATIONS
34
+ After the Notice Period expires, you must:
35
+ - Immediately cease all use of the Software
36
+ - Delete all copies of the Software from all systems under your control
37
+ - Certify destruction of copies if requested by the copyright holder
38
+
39
+ 6. NO WARRANTY
40
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
41
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
42
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
43
+
44
+ 7. LIMITATION OF LIABILITY
45
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR
46
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
47
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
48
+ DEALINGS IN THE SOFTWARE.
49
+
50
+ 8. ENTIRE AGREEMENT
51
+ This License constitutes the entire agreement between you and the copyright
52
+ holder relating to the Software and supersedes all prior or contemporaneous
53
+ understandings.
54
+
55
+ 9. SEVERABILITY
56
+ If any provision of this License is held to be unenforceable, such provision
57
+ shall be reformed only to the extent necessary to make it enforceable.
58
+
59
+ 10. GOVERNING LAW
60
+ This License shall be governed by the laws of the jurisdiction in which
61
+ the copyright holder resides, without regard to its conflict of law
62
+ provisions.
63
+
64
+ By using this Software, you acknowledge that you have read, understood, and
65
+ agree to be bound by the terms and conditions of this License.
66
+
67
+ For commercial licensing or other arrangements, please contact the copyright
68
+ holder directly.
package/README.md ADDED
@@ -0,0 +1,128 @@
1
+ # AI Task Manager
2
+
3
+ AI-powered task management CLI tool to improve your context. It supports multiple coding assistants including Claude and Gemini for comprehensive development workflow integration.
4
+
5
+ ## Features
6
+
7
+ - **Multi-Assistant Support**: Configure support for Claude, Gemini, or both assistants simultaneously
8
+ - **Intelligent Directory Structure**: Organized file structure with assistant-specific directories
9
+ - **Interactive CLI**: Enhanced user interface with colored output and progress indicators
10
+ - **Template System**: Built-in templates for different project types (basic, development, research)
11
+ - **Task Management**: Create, list, and manage tasks with status tracking
12
+ - **Installation Management**: Comprehensive installation, verification, and repair capabilities
13
+ - **Cross-Platform**: Works on Windows, macOS, and Linux
14
+
15
+ ## Quick Start
16
+
17
+ ### Installation
18
+ ```bash
19
+ # Install globally
20
+ npm install -g @e0ipso/ai-task-manager
21
+
22
+ # Or use with npx (no installation required)
23
+ npx @e0ipso/ai-task-manager --help
24
+ ```
25
+
26
+ ### Initialize a New Workspace
27
+
28
+ The `--assistants` flag is **required** when initializing a workspace. You must specify which coding assistant(s) you want to configure support for.
29
+
30
+ The `--destination-directory` flag allows you to specify an alternative directory for the workspace. By default, the workspace is initialized in the current working directory.
31
+
32
+ ```bash
33
+ # Quick start with Claude
34
+ npx @e0ipso/ai-task-manager init --assistants claude
35
+ ```
36
+
37
+ If the script detects that any of the folders it needs to create already exist it merge the folder structures, but it will overwrite the files in them.
38
+
39
+ ## Assistant Selection
40
+
41
+ AI Task Manager supports multiple coding assistants. You **must** specify which assistant(s) to use during initialization using the `--assistants` flag.
42
+
43
+ ### Supported Assistants
44
+
45
+ - **Claude**: Anthropic's Claude AI assistant
46
+ - **Gemini**: Google's Gemini AI assistant
47
+
48
+ ### Single Assistant Setup
49
+
50
+ ```bash
51
+ # Claude only
52
+ npx @e0ipso/ai-task-manager init --assistants claude
53
+
54
+ # Gemini only
55
+ npx @e0ipso/ai-task-manager init --assistants gemini
56
+ ```
57
+
58
+ ### Multiple Assistant Setup
59
+
60
+ ```bash
61
+ # Both Claude and Gemini
62
+ npx @e0ipso/ai-task-manager init --assistants claude,gemini
63
+ ```
64
+
65
+ ### Directory Structure
66
+
67
+ When you initialize with assistant selection, the following directory structure is created:
68
+
69
+ ```
70
+ project-root/
71
+ ├── .ai/
72
+ │ └── task-manager/ # Claude-specific files (if selected)
73
+ │ ├── plans
74
+ │ ├── TASK_MANAGER_INFO.md # General information to operate the task manager
75
+ │ └── VALIDATION_GATES.md # Validation gates for phase completion
76
+ ├── .claude/
77
+ │ └── commands/ # Custom slash commands for Claude
78
+ │ └── tasks/
79
+ │ ├── create-plan.md
80
+ │ ├── execute-blueprint.md
81
+ │ └── generate-tasks.md
82
+ ├── .gemini/
83
+ │ └── commands/ # Custom slash commands for Gemini
84
+ │ └── tasks/
85
+ │ ├── create-plan.toml
86
+ │ ├── execute-blueprint.toml
87
+ │ └── generate-tasks.toml
88
+ └── project files...
89
+ ```
90
+
91
+ ## Suggested Workflow
92
+
93
+ ### One-time Setup
94
+
95
+ Review and tweak the `.ai/task-manager/TASK_MANAGER_INFO.md` and `.ai/task-manager/VALIDATION_GATES.md`. These files are yours to edit and should reflect your project's tech stack and goals.
96
+
97
+ ### Regular Workflow
98
+
99
+ 1. Create a plan: `/tasks:create-plan Create an authentication workflow for the application using ...`
100
+ 2. Provide additional context if the assistant needs it.
101
+ 3. Manually review the plan and make the necessary edits. You might be tempted to skip this step, **do not skip this step**. Find the plan document in `.ai/task-manager/plans/01--authentication-workflow/plan-01--authentication-workflow.md`
102
+ 4. Create the tasks for the plan: `/tasks:generate-tasks 01`
103
+ 5. Review the list of tasks. This step is important to avoid scope creep. Find the tasks in the folder `.ai/task-manager/plans/01--authentication-workflow/tasks/`
104
+ 6. Execute the tasks: `/tasks:execute-blueprint 01`
105
+ 7. Review the implementation and the generated tests.
106
+
107
+ ### Troubleshooting
108
+
109
+ #### Permission Errors
110
+
111
+ **Error**: File system permission errors during initialization
112
+
113
+ **Solutions**:
114
+ - Ensure you have write permissions to the target directory
115
+ - On Unix systems, check directory ownership: `ls -la`
116
+ - Try running with appropriate permissions or in a user-owned directory
117
+
118
+ ## License
119
+
120
+ Proprietary Software with Revocation Rights.
121
+
122
+ This software is free to use, run, and operate for any lawful purposes. The
123
+ author can revoke the license to use it at any time and by any reason. A license
124
+ revocation notice may be provided through:
125
+
126
+ - Direct communication to known users
127
+ - Public announcement on the project repository
128
+ - Update to the LICENSE file
package/dist/cli.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * CLI Entry Point
4
+ *
5
+ * This file contains the main CLI setup using Commander.js
6
+ * Handles command-line argument parsing and routing to appropriate handlers
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;GAKG"}
package/dist/cli.js ADDED
@@ -0,0 +1,90 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ /**
4
+ * CLI Entry Point
5
+ *
6
+ * This file contains the main CLI setup using Commander.js
7
+ * Handles command-line argument parsing and routing to appropriate handlers
8
+ */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
16
+ }) : (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ o[k2] = m[k];
19
+ }));
20
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
22
+ }) : function(o, v) {
23
+ o["default"] = v;
24
+ });
25
+ var __importStar = (this && this.__importStar) || (function () {
26
+ var ownKeys = function(o) {
27
+ ownKeys = Object.getOwnPropertyNames || function (o) {
28
+ var ar = [];
29
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
30
+ return ar;
31
+ };
32
+ return ownKeys(o);
33
+ };
34
+ return function (mod) {
35
+ if (mod && mod.__esModule) return mod;
36
+ var result = {};
37
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
38
+ __setModuleDefault(result, mod);
39
+ return result;
40
+ };
41
+ })();
42
+ Object.defineProperty(exports, "__esModule", { value: true });
43
+ const commander_1 = require("commander");
44
+ const index_1 = require("./index");
45
+ const logger = __importStar(require("./logger"));
46
+ const program = new commander_1.Command();
47
+ program.name('ai-task-manager').version('0.1.0').description('AI-powered task management CLI tool');
48
+ program
49
+ .command('init')
50
+ .description('Initialize a new AI task management project')
51
+ .requiredOption('--assistants <value>', 'Comma-separated list of assistants to configure (claude,gemini)')
52
+ .option('--destination-directory <path>', 'Directory to create project structure in (default: current directory)')
53
+ .action(async (options) => {
54
+ try {
55
+ // Initialize the logger to ensure colors are available
56
+ await logger.initLogger();
57
+ // Execute the init command
58
+ const result = await (0, index_1.init)(options);
59
+ // Exit with appropriate code based on result
60
+ if (result.success) {
61
+ process.exit(0);
62
+ }
63
+ else {
64
+ process.exit(1);
65
+ }
66
+ }
67
+ catch (error) {
68
+ await logger.error(`Unexpected error: ${error instanceof Error ? error.message : String(error)}`);
69
+ process.exit(1);
70
+ }
71
+ });
72
+ // Handle case where no command is provided
73
+ program.hook('preAction', async (_thisCommand, _actionCommand) => {
74
+ // Initialize logger for all commands
75
+ await logger.initLogger();
76
+ });
77
+ // Error handling for unknown commands
78
+ program.on('command:*', async (operands) => {
79
+ await logger.error(`Unknown command: ${operands[0]}`);
80
+ await logger.info('Use --help to see available commands');
81
+ process.exit(1);
82
+ });
83
+ // Parse command line arguments
84
+ program.parse();
85
+ // If no arguments provided, show help
86
+ if (!process.argv.slice(2).length) {
87
+ program.outputHelp();
88
+ process.exit(0);
89
+ }
90
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;AACA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yCAAoC;AACpC,mCAA+B;AAE/B,iDAAmC;AAEnC,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,qCAAqC,CAAC,CAAC;AAEpG,OAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,6CAA6C,CAAC;KAC1D,cAAc,CACb,sBAAsB,EACtB,iEAAiE,CAClE;KACA,MAAM,CACL,gCAAgC,EAChC,uEAAuE,CACxE;KACA,MAAM,CAAC,KAAK,EAAE,OAAoB,EAAE,EAAE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,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClC,OAAO,CAAC,UAAU,EAAE,CAAC;IACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Main Init Command Implementation
3
+ *
4
+ * This file contains the implementation of the init command
5
+ * Handles initialization of new AI task management projects
6
+ */
7
+ import { InitOptions, Assistant, CommandResult } from './types';
8
+ /**
9
+ * Initialize a new AI Task Manager project
10
+ *
11
+ * Creates directory structures and copies template files based on the selected assistants.
12
+ * Validates input, creates necessary directories, and copies appropriate templates.
13
+ *
14
+ * @param options - Initialization options containing assistant selection
15
+ * @returns CommandResult indicating success or failure with details
16
+ */
17
+ export declare function init(options: InitOptions): Promise<CommandResult>;
18
+ /**
19
+ * Check if a directory already has AI Task Manager initialized
20
+ */
21
+ export declare function isInitialized(baseDir?: string): Promise<boolean>;
22
+ /**
23
+ * Get information about existing initialization
24
+ */
25
+ export declare function getInitInfo(baseDir?: string): Promise<{
26
+ hasAiTaskManager: boolean;
27
+ hasClaudeConfig: boolean;
28
+ hasGeminiConfig: boolean;
29
+ assistants: Assistant[];
30
+ }>;
31
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAmB,aAAa,EAAE,MAAM,SAAS,CAAC;AAiBjF;;;;;;;;GAQG;AACH,wBAAsB,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CA8FvE;AA2ED;;GAEG;AACH,wBAAsB,aAAa,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAGtE;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3D,gBAAgB,EAAE,OAAO,CAAC;IAC1B,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE,SAAS,EAAE,CAAC;CACzB,CAAC,CAgBD"}
package/dist/index.js ADDED
@@ -0,0 +1,219 @@
1
+ "use strict";
2
+ /**
3
+ * Main Init Command Implementation
4
+ *
5
+ * This file contains the implementation of the init command
6
+ * Handles initialization of new AI task management projects
7
+ */
8
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
+ if (k2 === undefined) k2 = k;
10
+ var desc = Object.getOwnPropertyDescriptor(m, k);
11
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
12
+ desc = { enumerable: true, get: function() { return m[k]; } };
13
+ }
14
+ Object.defineProperty(o, k2, desc);
15
+ }) : (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ o[k2] = m[k];
18
+ }));
19
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
20
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
21
+ }) : function(o, v) {
22
+ o["default"] = v;
23
+ });
24
+ var __importStar = (this && this.__importStar) || (function () {
25
+ var ownKeys = function(o) {
26
+ ownKeys = Object.getOwnPropertyNames || function (o) {
27
+ var ar = [];
28
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
29
+ return ar;
30
+ };
31
+ return ownKeys(o);
32
+ };
33
+ return function (mod) {
34
+ if (mod && mod.__esModule) return mod;
35
+ var result = {};
36
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
37
+ __setModuleDefault(result, mod);
38
+ return result;
39
+ };
40
+ })();
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ exports.init = init;
43
+ exports.isInitialized = isInitialized;
44
+ exports.getInitInfo = getInitInfo;
45
+ const types_1 = require("./types");
46
+ const logger = __importStar(require("./logger"));
47
+ const utils_1 = require("./utils");
48
+ /**
49
+ * Initialize a new AI Task Manager project
50
+ *
51
+ * Creates directory structures and copies template files based on the selected assistants.
52
+ * Validates input, creates necessary directories, and copies appropriate templates.
53
+ *
54
+ * @param options - Initialization options containing assistant selection
55
+ * @returns CommandResult indicating success or failure with details
56
+ */
57
+ async function init(options) {
58
+ try {
59
+ // Determine base directory
60
+ const baseDir = options.destinationDirectory || '.';
61
+ const resolvedBaseDir = (0, utils_1.resolvePath)(baseDir);
62
+ // Log start of initialization
63
+ await logger.info(`Initializing AI Task Manager in: ${resolvedBaseDir}...`);
64
+ // Parse and validate assistants
65
+ const assistants = (0, utils_1.parseAssistants)(options.assistants);
66
+ await logger.debug(`Parsed assistants: ${assistants.join(', ')}`);
67
+ // Validate assistants
68
+ (0, utils_1.validateAssistants)(assistants);
69
+ await logger.debug('Assistant validation passed');
70
+ // Create .ai/task-manager structure
71
+ await logger.info('📁 Creating .ai/task-manager directory structure...');
72
+ await (0, utils_1.ensureDir)((0, utils_1.resolvePath)(baseDir, '.ai/task-manager/plans'));
73
+ // Copy common templates to .ai/task-manager
74
+ await logger.info('📋 Copying common template files...');
75
+ await copyCommonTemplates(baseDir);
76
+ // Create assistant-specific directories and copy templates
77
+ for (const assistant of assistants) {
78
+ await logger.info(`🤖 Setting up ${assistant} assistant configuration...`);
79
+ await createAssistantStructure(assistant, baseDir);
80
+ }
81
+ // Show success message with created directories
82
+ const createdDirectories = (0, utils_1.getCreatedDirectories)(assistants, baseDir);
83
+ await logger.success('AI Task Manager initialized successfully!');
84
+ await logger.info('Created directory structure:');
85
+ for (const dir of createdDirectories) {
86
+ await logger.info(` ✓ ${dir}`);
87
+ }
88
+ // Show copied templates
89
+ await logger.info('Template files copied:');
90
+ await logger.info(` ✓ ${(0, utils_1.resolvePath)(baseDir, '.ai/task-manager/TASK_MANAGER_INFO.md')}`);
91
+ await logger.info(` ✓ ${(0, utils_1.resolvePath)(baseDir, '.ai/task-manager/VALIDATION_GATES.md')}`);
92
+ for (const assistant of assistants) {
93
+ const templateFormat = (0, utils_1.getTemplateFormat)(assistant);
94
+ await logger.info(` ✓ ${(0, utils_1.resolvePath)(baseDir, `.${assistant}/commands/tasks/create-plan.${templateFormat}`)}`);
95
+ await logger.info(` ✓ ${(0, utils_1.resolvePath)(baseDir, `.${assistant}/commands/tasks/execute-blueprint.${templateFormat}`)}`);
96
+ await logger.info(` ✓ ${(0, utils_1.resolvePath)(baseDir, `.${assistant}/commands/tasks/generate-tasks.${templateFormat}`)}`);
97
+ }
98
+ await logger.success('Project is ready for AI-powered task management!');
99
+ return {
100
+ success: true,
101
+ message: 'AI Task Manager initialized successfully!',
102
+ data: { assistants },
103
+ };
104
+ }
105
+ catch (error) {
106
+ let errorMessage;
107
+ let errorInstance;
108
+ if (error instanceof Error) {
109
+ errorMessage = error.message;
110
+ errorInstance = error;
111
+ if (error.message.includes('Invalid assistant') ||
112
+ error.message.includes('Assistants parameter')) {
113
+ await logger.error(`Configuration Error: ${error.message}`);
114
+ }
115
+ else if (error instanceof types_1.FileSystemError) {
116
+ await logger.error(`File System Error: ${error.message}`);
117
+ }
118
+ else {
119
+ await logger.error(`Initialization failed: ${error.message}`);
120
+ }
121
+ }
122
+ else {
123
+ errorMessage = 'Initialization failed with unknown error';
124
+ errorInstance = new Error(String(error));
125
+ await logger.error(errorMessage);
126
+ }
127
+ return {
128
+ success: false,
129
+ message: errorMessage,
130
+ error: errorInstance,
131
+ };
132
+ }
133
+ }
134
+ /**
135
+ * Copy common template files to .ai/task-manager directory
136
+ */
137
+ async function copyCommonTemplates(baseDir) {
138
+ const templates = [
139
+ {
140
+ source: (0, utils_1.getTemplatePath)('ai-task-manager/TASK_MANAGER_INFO.md'),
141
+ dest: (0, utils_1.resolvePath)(baseDir, '.ai/task-manager/TASK_MANAGER_INFO.md'),
142
+ },
143
+ {
144
+ source: (0, utils_1.getTemplatePath)('ai-task-manager/VALIDATION_GATES.md'),
145
+ dest: (0, utils_1.resolvePath)(baseDir, '.ai/task-manager/VALIDATION_GATES.md'),
146
+ },
147
+ ];
148
+ for (const template of templates) {
149
+ // Check if source template exists
150
+ if (!(await (0, utils_1.exists)(template.source))) {
151
+ throw new types_1.FileSystemError(`Template file not found: ${template.source}`, {
152
+ templatePath: template.source,
153
+ });
154
+ }
155
+ await (0, utils_1.copyTemplate)(template.source, template.dest);
156
+ await logger.debug(`📤 Copied ${template.source} to ${template.dest}`);
157
+ }
158
+ }
159
+ /**
160
+ * Create directory structure and copy templates for a specific assistant
161
+ */
162
+ async function createAssistantStructure(assistant, baseDir) {
163
+ // Create assistant directory structure
164
+ const tasksDir = (0, utils_1.resolvePath)(baseDir, `.${assistant}/commands/tasks`);
165
+ await (0, utils_1.ensureDir)(tasksDir);
166
+ await logger.debug(`🏗️ Created directory structure for ${assistant} in ${tasksDir}`);
167
+ // Determine template format based on assistant type
168
+ const templateFormat = (0, utils_1.getTemplateFormat)(assistant);
169
+ await logger.debug(`🎨 Using ${templateFormat} template format for ${assistant} assistant`);
170
+ // Copy assistant-specific command templates with appropriate format
171
+ const commandTemplateNames = await (0, utils_1.getMarkdownTemplateNames)('commands/tasks');
172
+ for (const templateName of commandTemplateNames) {
173
+ const templateFile = `${templateName}.${templateFormat}`;
174
+ // Always read from the MD template source (DRY principle)
175
+ const mdSourcePath = (0, utils_1.getTemplatePath)(`commands/tasks/${templateName}.md`);
176
+ const destPath = (0, utils_1.resolvePath)(baseDir, `.${assistant}/commands/tasks/${templateFile}`);
177
+ // Check if MD source template exists
178
+ if (!(await (0, utils_1.exists)(mdSourcePath))) {
179
+ throw new types_1.FileSystemError(`Command template not found: ${mdSourcePath}`, {
180
+ templatePath: mdSourcePath,
181
+ assistant,
182
+ templateFormat,
183
+ });
184
+ }
185
+ // Read and process the template based on target format
186
+ const processedContent = await (0, utils_1.readAndProcessTemplate)(mdSourcePath, templateFormat);
187
+ // Write the processed content to destination
188
+ await (0, utils_1.writeProcessedTemplate)(processedContent, destPath);
189
+ await logger.debug(`⚡ Processed ${templateName}.md and created ${templateFile} for ${assistant} at ${destPath}`);
190
+ }
191
+ }
192
+ /**
193
+ * Check if a directory already has AI Task Manager initialized
194
+ */
195
+ async function isInitialized(baseDir) {
196
+ const targetDir = baseDir || '.';
197
+ return await (0, utils_1.exists)((0, utils_1.resolvePath)(targetDir, '.ai/task-manager'));
198
+ }
199
+ /**
200
+ * Get information about existing initialization
201
+ */
202
+ async function getInitInfo(baseDir) {
203
+ const targetDir = baseDir || '.';
204
+ const hasAiTaskManager = await (0, utils_1.exists)((0, utils_1.resolvePath)(targetDir, '.ai/task-manager'));
205
+ const hasClaudeConfig = await (0, utils_1.exists)((0, utils_1.resolvePath)(targetDir, '.claude/commands/tasks'));
206
+ const hasGeminiConfig = await (0, utils_1.exists)((0, utils_1.resolvePath)(targetDir, '.gemini/commands/tasks'));
207
+ const assistants = [];
208
+ if (hasClaudeConfig)
209
+ assistants.push('claude');
210
+ if (hasGeminiConfig)
211
+ assistants.push('gemini');
212
+ return {
213
+ hasAiTaskManager,
214
+ hasClaudeConfig,
215
+ hasGeminiConfig,
216
+ assistants,
217
+ };
218
+ }
219
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BH,oBA8FC;AA8ED,sCAGC;AAKD,kCAqBC;AAnOD,mCAAiF;AACjF,iDAAmC;AACnC,mCAaiB;AAEjB;;;;;;;;GAQG;AACI,KAAK,UAAU,IAAI,CAAC,OAAoB;IAC7C,IAAI,CAAC;QACH,2BAA2B;QAC3B,MAAM,OAAO,GAAG,OAAO,CAAC,oBAAoB,IAAI,GAAG,CAAC;QACpD,MAAM,eAAe,GAAG,IAAA,mBAAW,EAAC,OAAO,CAAC,CAAC;QAE7C,8BAA8B;QAC9B,MAAM,MAAM,CAAC,IAAI,CAAC,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QACL,gBAAgB;QAChB,eAAe;QACf,eAAe;QACf,UAAU;KACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Simple Logging Utility
3
+ *
4
+ * This file provides a simple logging interface for the CLI
5
+ * Handles different log levels and formatted output with optional color support
6
+ */
7
+ /**
8
+ * Debug mode flag - can be set externally
9
+ */
10
+ export declare let isDebugMode: boolean;
11
+ /**
12
+ * Enable or disable debug mode
13
+ */
14
+ export declare function setDebugMode(enabled: boolean): void;
15
+ /**
16
+ * Log an informational message
17
+ */
18
+ export declare function info(message: string): Promise<void>;
19
+ /**
20
+ * Log a success message
21
+ */
22
+ export declare function success(message: string): Promise<void>;
23
+ /**
24
+ * Log an error message
25
+ */
26
+ export declare function error(message: string): Promise<void>;
27
+ /**
28
+ * Log a warning message
29
+ */
30
+ export declare function warning(message: string): Promise<void>;
31
+ /**
32
+ * Log a debug message (only shown in debug mode)
33
+ */
34
+ export declare function debug(message: string): Promise<void>;
35
+ /**
36
+ * Synchronous versions for cases where async is not suitable
37
+ * These will only use colors if chalk was previously initialized
38
+ */
39
+ export declare const sync: {
40
+ /**
41
+ * Log an informational message (sync)
42
+ */
43
+ info(message: string): void;
44
+ /**
45
+ * Log a success message (sync)
46
+ */
47
+ success(message: string): void;
48
+ /**
49
+ * Log an error message (sync)
50
+ */
51
+ error(message: string): void;
52
+ /**
53
+ * Log a warning message (sync)
54
+ */
55
+ warning(message: string): void;
56
+ /**
57
+ * Log a debug message (sync, only shown in debug mode)
58
+ */
59
+ debug(message: string): void;
60
+ };
61
+ /**
62
+ * Initialize the logger - call this early in your application
63
+ * This pre-loads chalk to avoid delays on first use
64
+ */
65
+ export declare function initLogger(): Promise<void>;
66
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgCH;;GAEG;AACH,eAAO,IAAI,WAAW,SAAQ,CAAC;AAE/B;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAEnD;AAED;;GAEG;AACH,wBAAsB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIzD;AAED;;GAEG;AACH,wBAAsB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI5D;AAED;;GAEG;AACH,wBAAsB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI1D;AAED;;GAEG;AACH,wBAAsB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI5D;AAED;;GAEG;AACH,wBAAsB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAM1D;AAED;;;GAGG;AACH,eAAO,MAAM,IAAI;IACf;;OAEG;kBACW,MAAM,GAAG,IAAI;IAK3B;;OAEG;qBACc,MAAM,GAAG,IAAI;IAK9B;;OAEG;mBACY,MAAM,GAAG,IAAI;IAK5B;;OAEG;qBACc,MAAM,GAAG,IAAI;IAK9B;;OAEG;mBACY,MAAM,GAAG,IAAI;CAM7B,CAAC;AAEF;;;GAGG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAEhD"}