UNPKG

ai-dev-diary

Version:

Intelligent development diary system for AI-assisted projects

41 lines • 1.69 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.createQuickEntry = createQuickEntry; const chalk_1 = __importDefault(require("chalk")); const diary_manager_1 = require("../core/diary-manager"); const entry_builder_1 = require("../core/entry-builder"); async function createQuickEntry(type, title, description, correction, author) { const diaryManager = new diary_manager_1.DiaryManager('.ai-diary', author); if (!diaryManager.isInitialized()) { console.log(chalk_1.default.red('āŒ Diary not initialized. Run "ai-diary init" first.')); process.exit(1); } try { const entryBuilder = new entry_builder_1.EntryBuilder(); const entry = entryBuilder.quickEntry(type, title, description); if (author) { entry.metadata.author = author; } if (correction && type === 'mistake') { entry.metadata.correction = correction; } await diaryManager.saveEntry(entry); const emoji = { journey: 'šŸš€', insight: 'šŸ’”', mistake: 'āŒ', breakthrough: 'šŸŽÆ', context: 'šŸ“‹', }[type]; console.log(chalk_1.default.green(`\nāœ… ${emoji} ${type.charAt(0).toUpperCase() + type.slice(1)} entry saved!`)); console.log(chalk_1.default.gray(`Title: ${title}`)); } catch (error) { console.error(chalk_1.default.red('Failed to create entry:'), error); process.exit(1); } } //# sourceMappingURL=quick-entry.js.map