{"_id":"@brinda_yawa/tasks-generator","_rev":"3-0853919a2881988d5e06b206a39e14f1","name":"@brinda_yawa/tasks-generator","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@brinda_yawa/tasks-generator","version":"1.0.0","keywords":["AI","Google GenAI","Tasks Generator"],"author":{"name":"brinda_yawa","email":"mawuviwobrinda@gmail.com"},"license":"ISC","_id":"@brinda_yawa/tasks-generator@1.0.0","maintainers":[{"name":"brinda_yawa","email":"mawuviwobrinda@gmail.com"}],"dist":{"shasum":"3f40cebba19437e4f0fec877fc18e0a1a2aff7cc","tarball":"https://registry.npmjs.org/@brinda_yawa/tasks-generator/-/tasks-generator-1.0.0.tgz","fileCount":6,"integrity":"sha512-ml4FENSCl8i/1M5oEGki3Bk1TBOL5dvwCGiV1iSW6g6L0vOpzP990Utd718njzoZqC9BHNdkgG4Q959Wl0TG7w==","signatures":[{"sig":"MEYCIQDKswaiBYcwXkOK0ShX3EWKoazfDywfL6Ztw8bo3ZSOwAIhAMvzmwdHO0kKOl7g15jMWEFrUe0pF43Qfua10nPLroGd","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2813790},"main":"dist/index.mjs","type":"module","gitHead":"0f8830dc734d73243f73512f0ca5bac039ec78bf","scripts":{"lint":"eslint .","test":"node src/tests/index.js","build":"rollup -c","prepare":"npm run build"},"_npmUser":{"name":"brinda_yawa","email":"mawuviwobrinda@gmail.com"},"_npmVersion":"10.9.2","description":"An AI-powered tasks generator using Google GenAI. ","directories":{},"_nodeVersion":"23.11.0","dependencies":{"dotenv":"^17.3.1","@google/genai":"^1.41.0"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^4.9.6","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-commonjs":"^29.0.0","@rollup/plugin-node-resolve":"^16.0.3"},"_npmOperationalInternal":{"tmp":"tmp/tasks-generator_1.0.0_1771348147294_0.7136869937207435","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@brinda_yawa/tasks-generator","version":"1.0.1","keywords":["AI","Google GenAI","Tasks Generator"],"author":{"name":"brinda_yawa","email":"mawuviwobrinda@gmail.com"},"license":"ISC","_id":"@brinda_yawa/tasks-generator@1.0.1","maintainers":[{"name":"brinda_yawa","email":"mawuviwobrinda@gmail.com"}],"dist":{"shasum":"56c59edfca2a005b32326fc4bc58299d5077e0ac","tarball":"https://registry.npmjs.org/@brinda_yawa/tasks-generator/-/tasks-generator-1.0.1.tgz","fileCount":6,"integrity":"sha512-QayOdHTxKxO2zgRv6ueAHFqA4pQf2cadIz221/QSkLfyOywPWkYa9ysH/hC/6FDzQ107rkhUXC7gL6fmmBkWSg==","signatures":[{"sig":"MEQCIDH00YiU1VX+VIn96LUez7VZvRPrQ70oqxatNw4JBoSlAiB/uwVXZP9mF4K45/m6eOoVhZSpe1jwqMwY/ZPWRu2dFQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2819657},"main":"dist/index.mjs","type":"module","gitHead":"a1b08da86e4683fcf58990bb3591bbb57923d769","scripts":{"lint":"eslint .","test":"node src/tests/index.js","build":"rollup -c","prepare":"npm run build","test-diagnose":"node src/tests/diagnose.js"},"_npmUser":{"name":"brinda_yawa","email":"mawuviwobrinda@gmail.com"},"_npmVersion":"10.9.2","description":"An AI-powered tasks generator using Google GenAI. ","directories":{},"_nodeVersion":"23.11.0","dependencies":{"dotenv":"^17.3.1","@google/genai":"^1.41.0"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^4.9.6","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-commonjs":"^29.0.0","@rollup/plugin-node-resolve":"^16.0.3"},"_npmOperationalInternal":{"tmp":"tmp/tasks-generator_1.0.1_1771410683113_0.2573605937967134","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@brinda_yawa/tasks-generator","version":"1.0.2","description":"An AI-powered tasks generator using Google GenAI. ","type":"module","main":"dist/index.mjs","scripts":{"build":"rollup -c","prepare":"npm run build","lint":"eslint .","test":"node src/tests/index.js","test-diagnose":"node src/tests/diagnose.js"},"keywords":["AI","Google GenAI","Tasks Generator"],"author":{"name":"brinda_yawa","email":"mawuviwobrinda@gmail.com"},"license":"ISC","dependencies":{"@google/genai":"^1.41.0","dotenv":"^17.3.1"},"devDependencies":{"@rollup/plugin-commonjs":"^29.0.0","@rollup/plugin-node-resolve":"^16.0.3","@rollup/plugin-terser":"^0.4.4","rollup":"^4.9.6"},"_id":"@brinda_yawa/tasks-generator@1.0.2","gitHead":"0637e9c33b599aa10da1d5a97a732ba8f9c17db1","_nodeVersion":"23.11.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-L3HGG1MKbiXpDjfRGjECjAYKVcfTi11yhfawFCW52sIV7IvK7HmDZC2jFskx1D5i5KbFe/YZ/ogBO1S3Eg1O/g==","shasum":"da1a4f721296e58e3718943d80ce63308adfbdb8","tarball":"https://registry.npmjs.org/@brinda_yawa/tasks-generator/-/tasks-generator-1.0.2.tgz","fileCount":6,"unpackedSize":2820065,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBMZFrDlPAnYEs5+2p0rJW4ZSCrQIKhLRKjMVPKeXnUpAiEA8p9mMzAPt646uWeINVYkJcy1PGP4JwK8BhSNPbTx2GQ="}]},"_npmUser":{"name":"brinda_yawa","email":"mawuviwobrinda@gmail.com"},"directories":{},"maintainers":[{"name":"brinda_yawa","email":"mawuviwobrinda@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tasks-generator_1.0.2_1771425652999_0.32881588666204764"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-17T17:09:07.202Z","modified":"2026-02-18T14:40:53.352Z","1.0.0":"2026-02-17T17:09:07.489Z","1.0.1":"2026-02-18T10:31:23.320Z","1.0.2":"2026-02-18T14:40:53.216Z"},"author":{"name":"brinda_yawa","email":"mawuviwobrinda@gmail.com"},"license":"ISC","keywords":["AI","Google GenAI","Tasks Generator"],"description":"An AI-powered tasks generator using Google GenAI. ","maintainers":[{"name":"brinda_yawa","email":"mawuviwobrinda@gmail.com"}],"readme":"# 📋 @brinda_yawa/tasks-generator\n\nA powerful Node.js package for automatically generating structured task lists from project titles and descriptions using AI-powered generation with Google's Gemini models.\n\n## ✨ Features\n\n- 🤖 **AI-Powered Generation** - Uses Google's Gemini AI for intelligent task creation\n- 📋 **Structured Output** - Returns clean, structured JSON task arrays\n- 🎯 **Context-Aware** - Generates relevant tasks tailored to your project description\n- ⚙️ **Configurable** - Choose your Gemini model and generation parameters\n- 🔒 **Singleton Pattern** - Efficient resource management across your application\n\n## 📦 Installation\n\n```bash\nnpm install @brinda_yawa/tasks-generator\n```\n\n## 🚀 Quick Start\n\n```javascript\nimport TasksGenerator from '@brinda_yawa/tasks-generator';\n\n// Initialize the singleton instance\nconst generator = TasksGenerator;\ngenerator.init({ apiKey: 'YOUR_API_KEY', model: 'gemini-2.5-flash' });\n\n// Generate tasks from a title and description\nconst tasks = await generator.generateTasks(\n  'Flat Tire',\n  'Roadside assistance following a flat tire. Diagnose the affected wheel, check tire condition, repair with plug or replace if necessary, check pressure and balance the wheel.'\n);\n\nconsole.log(tasks);\n```\n# 📖 API Reference\n\n### `TasksGenerator.init(options)`\n\nInitializes the singleton instance with your API credentials.\n\n**Parameters:**\n- `options.apiKey` (string, required) — Your Google Gemini API key\n- `options.model` (string, optional) — The Gemini model to use. Default: `'gemini-2.5-flash'`\n\n**Example:**\n```javascript\nimport TasksGenerator from '@brinda_yawa/tasks-generator';\n\nconst generator = TasksGenerator;\ngenerator.init({\n  apiKey: process.env.GEMINI_API_KEY,\n  model: 'gemini-2.5-flash'\n});\n```\n---\n\n### `generator.generateTasks(title, description)`\n\nGenerates a structured list of tasks from a title and description.\n\n**Parameters:**\n- `title` (string, required) — The title of the project or intervention\n- `description` (string, required) — A detailed description of what needs to be done\n\n**Returns:** `Promise<Array<Object>>` — An array of structured task objects\n\n**Example:**\n```javascript\nconst tasks = await generator.generateTasks(\n  'Flat Tire',\n  'Roadside assistance following a flat tire. Diagnose the affected wheel, check tire condition, repair with plug or replace if necessary, check pressure and balance the wheel.'\n);\n\n// Returns:\n[\n  {\n    \"title\": \"Diagnose affected wheel\",\n    \"description\": \"Inspect the flat tire to identify the cause of deflation\",\n    \"priority\": \"high\"\n  },\n  {\n    \"title\": \"Assess tire condition\",\n    \"description\": \"Determine whether the tire can be repaired or needs replacing\",\n    \"priority\": \"high\"\n  },\n  {\n    \"title\": \"Repair or replace tire\",\n    \"description\": \"Apply plug repair or mount a replacement tire as needed\",\n    \"priority\": \"high\"\n  },\n  {\n    \"title\": \"Check pressure and balance\",\n    \"description\": \"Verify correct inflation pressure and wheel balance after intervention\",\n    \"priority\": \"medium\"\n  }\n  // ... more tasks\n]\n```\n## 🌍 Environment Variables\n\nCreate a `.env` file at the root of your project:\n\n```env\nGEMINI_API_KEY=your_api_key_here\n```\n\n**Recommendation:** Use `gemini-2.5-flash` for both development and production for the best speed/quality balance.\n\n---\n\n## 💡 Advanced Usage\n\n### Handling Multiple Projects\n\n```javascript\nimport TasksGenerator from '@brinda_yawa/tasks-generator';\nimport dotenv from 'dotenv';\n\ndotenv.config();\n\nconst generator = TasksGenerator;\ngenerator.init({ apiKey: process.env.GEMINI_API_KEY });\n\nconst projects = [\n  {\n    title: 'Flat Tire',\n    description: 'Roadside assistance for a flat tire. Inspect, repair or replace, and verify pressure.'\n  },\n  {\n    title: 'Battery Replacement',\n    description: 'Replace a dead car battery. Diagnose charge level, disconnect old battery, install new one, test electrical system.'\n  }\n];\n\nasync function generateAllTasks(projects) {\n  const results = [];\n\n  for (const project of projects) {\n    const tasks = await generator.generateTasks(project.title, project.description);\n    if (tasks) {\n      results.push({ project: project.title, tasks });\n    }\n  }\n\n  return results;\n}\n\nconst allTasks = await generateAllTasks(projects);\nconsole.log(`Generated tasks for ${allTasks.length} projects`);\n```\n\n---\n\n### Error Handling\n\n```javascript\nimport TasksGenerator from '@brinda_yawa/tasks-generator';\n\nconst generator = TasksGenerator;\ngenerator.init({ apiKey: process.env.GEMINI_API_KEY });\n\ntry {\n  const tasks = await generator.generateTasks(\n    'Oil Change',\n    'Standard vehicle oil change: drain old oil, replace filter, fill with new oil, check levels.'\n  );\n\n  if (!tasks || tasks.length === 0) {\n    console.error('No tasks were generated.');\n  } else {\n    console.log('Tasks generated successfully:', tasks);\n  }\n} catch (error) {\n  if (error.message.includes('quota')) {\n    console.error('API quota exceeded. Please wait or upgrade your plan.');\n  } else if (error.message.includes('API key')) {\n    console.error('Invalid API key. Please check your credentials.');\n  } else if (error.message.includes('obligatoires')) {\n    console.error('Title and description are required fields.');\n  } else {\n    console.error('Generation error:', error.message);\n  }\n}\n```\n\n---\n\n### Using with Express.js\n\n```javascript\nimport express from 'express';\nimport TasksGenerator from '@brinda_yawa/tasks-generator';\n\nconst app = express();\napp.use(express.json());\n\nconst generator = TasksGenerator;\ngenerator.init({ apiKey: process.env.GEMINI_API_KEY });\n\napp.post('/generate-tasks', async (req, res) => {\n  try {\n    const { title, description } = req.body;\n\n    if (!title || !description) {\n      return res.status(400).json({ error: 'Title and description are required.' });\n    }\n\n    const tasks = await generator.generateTasks(title, description);\n\n    if (!tasks) {\n      return res.status(500).json({ error: 'Task generation failed.' });\n    }\n\n    res.json({ success: true, tasks });\n  } catch (error) {\n    res.status(500).json({ error: error.message });\n  }\n});\n\napp.listen(3000, () => console.log('Server running on port 3000'));\n```\n\n---","readmeFilename":"README.md"}