@graphikartistry/cursor-doc-automation
Version:
Cursor IDE extension for autonomous documentation and ticket management
66 lines (65 loc) • 2.88 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.activate = activate;
exports.deactivate = deactivate;
const documentationService_1 = require("./services/documentationService");
const githubClient_1 = require("./github/githubClient");
const jiraClient_1 = require("./jira/jiraClient");
const fuelixClient_1 = require("./fuelix/fuelixClient");
// Cursor extension entry point
function activate() {
console.log('Documentation Automation extension is now active!');
// Get configuration from Cursor's settings
const config = {
githubToken: process.env.GITHUB_TOKEN || '',
jiraToken: process.env.JIRA_TOKEN || ''
};
const githubClient = new githubClient_1.GitHubClient(config.githubToken);
const jiraClient = new jiraClient_1.JiraClient(config.jiraToken);
const fuelixClient = new fuelixClient_1.FuelixClient();
const documentationService = new documentationService_1.DocumentationService(githubClient, jiraClient, fuelixClient);
// Register commands with Cursor
return {
'documentation.generate': async () => {
try {
// Get current file content from Cursor's API
const content = await cursor.getActiveFileContent();
const analysis = await documentationService.analyzeChanges(content);
cursor.showNotification('Documentation generated successfully!');
return analysis;
}
catch (error) {
cursor.showError(`Failed to generate documentation: ${error}`);
throw error;
}
},
'documentation.createPR': async () => {
try {
const content = await cursor.getActiveFileContent();
const analysis = await documentationService.analyzeChanges(content);
const prUrl = await documentationService.createDocumentationPR(analysis);
cursor.showNotification('Documentation PR created successfully!');
return prUrl;
}
catch (error) {
cursor.showError(`Failed to create PR: ${error}`);
throw error;
}
},
'documentation.createJiraTicket': async () => {
try {
const content = await cursor.getActiveFileContent();
const analysis = await documentationService.analyzeChanges(content);
await documentationService.createJiraBacklogItem(analysis);
cursor.showNotification('Jira ticket created successfully!');
}
catch (error) {
cursor.showError(`Failed to create Jira ticket: ${error}`);
throw error;
}
}
};
}
function deactivate() {
console.log('Documentation Automation extension is now deactivated!');
}