mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-17 10:03:08 +00:00
* feat: Add PR review comments and resolution endpoints, improve prompt handling * Feature: File Editor (#789) * feat: Add file management feature * feat: Add auto-save functionality to file editor * fix: Replace HardDriveDownload icon with Save icon for consistency * fix: Prevent recursive copy/move and improve shell injection prevention * refactor: Extract editor settings form into separate component * ``` fix: Improve error handling and stabilize async operations - Add error event handlers to GraphQL process spawns to prevent unhandled rejections - Replace execAsync with execFile for safer command execution and better control - Fix timeout cleanup in withTimeout generator to prevent memory leaks - Improve outdated comment detection logic by removing redundant condition - Use resolveModelString for consistent model string handling - Replace || with ?? for proper falsy value handling in dialog initialization - Add comments clarifying branch name resolution logic for local branches with slashes - Add catch handler for project selection to handle async errors gracefully ``` * refactor: Extract PR review comments logic to dedicated service * fix: Improve robustness and UX for PR review and file operations * fix: Consolidate exec utilities and improve type safety * refactor: Replace ScrollArea with div and improve file tree layout
71 lines
2.5 KiB
TypeScript
71 lines
2.5 KiB
TypeScript
/**
|
|
* GitHub routes - HTTP API for GitHub integration
|
|
*/
|
|
|
|
import { Router } from 'express';
|
|
import type { EventEmitter } from '../../lib/events.js';
|
|
import { validatePathParams } from '../../middleware/validate-paths.js';
|
|
import { createCheckGitHubRemoteHandler } from './routes/check-github-remote.js';
|
|
import { createListIssuesHandler } from './routes/list-issues.js';
|
|
import { createListPRsHandler } from './routes/list-prs.js';
|
|
import { createListCommentsHandler } from './routes/list-comments.js';
|
|
import { createListPRReviewCommentsHandler } from './routes/list-pr-review-comments.js';
|
|
import { createResolvePRCommentHandler } from './routes/resolve-pr-comment.js';
|
|
import { createValidateIssueHandler } from './routes/validate-issue.js';
|
|
import {
|
|
createValidationStatusHandler,
|
|
createValidationStopHandler,
|
|
createGetValidationsHandler,
|
|
createDeleteValidationHandler,
|
|
createMarkViewedHandler,
|
|
} from './routes/validation-endpoints.js';
|
|
import type { SettingsService } from '../../services/settings-service.js';
|
|
|
|
export function createGitHubRoutes(
|
|
events: EventEmitter,
|
|
settingsService?: SettingsService
|
|
): Router {
|
|
const router = Router();
|
|
|
|
router.post('/check-remote', validatePathParams('projectPath'), createCheckGitHubRemoteHandler());
|
|
router.post('/issues', validatePathParams('projectPath'), createListIssuesHandler());
|
|
router.post('/prs', validatePathParams('projectPath'), createListPRsHandler());
|
|
router.post('/issue-comments', validatePathParams('projectPath'), createListCommentsHandler());
|
|
router.post(
|
|
'/pr-review-comments',
|
|
validatePathParams('projectPath'),
|
|
createListPRReviewCommentsHandler()
|
|
);
|
|
router.post(
|
|
'/resolve-pr-comment',
|
|
validatePathParams('projectPath'),
|
|
createResolvePRCommentHandler()
|
|
);
|
|
router.post(
|
|
'/validate-issue',
|
|
validatePathParams('projectPath'),
|
|
createValidateIssueHandler(events, settingsService)
|
|
);
|
|
|
|
// Validation management endpoints
|
|
router.post(
|
|
'/validation-status',
|
|
validatePathParams('projectPath'),
|
|
createValidationStatusHandler()
|
|
);
|
|
router.post('/validation-stop', validatePathParams('projectPath'), createValidationStopHandler());
|
|
router.post('/validations', validatePathParams('projectPath'), createGetValidationsHandler());
|
|
router.post(
|
|
'/validation-delete',
|
|
validatePathParams('projectPath'),
|
|
createDeleteValidationHandler()
|
|
);
|
|
router.post(
|
|
'/validation-mark-viewed',
|
|
validatePathParams('projectPath'),
|
|
createMarkViewedHandler(events)
|
|
);
|
|
|
|
return router;
|
|
}
|