mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-30 06:12:03 +00:00
Resolves merge conflicts: - apps/server/src/routes/terminal/common.ts: Keep randomBytes import, use @automaker/utils for createLogger - apps/ui/eslint.config.mjs: Use main's explicit globals list with XMLHttpRequest and MediaQueryListEvent additions - apps/ui/src/components/views/terminal-view.tsx: Keep our terminal improvements (killAllSessions, beforeunload, better error handling) - apps/ui/src/config/terminal-themes.ts: Keep our search highlight colors for all themes - apps/ui/src/store/app-store.ts: Keep our terminal settings persistence improvements (merge function) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
35 lines
947 B
TypeScript
35 lines
947 B
TypeScript
/**
|
|
* Common utilities and state for suggestions routes
|
|
*/
|
|
|
|
import { createLogger } from '@automaker/utils';
|
|
import { getErrorMessage as getErrorMessageShared, createLogError } from '../common.js';
|
|
|
|
const logger = createLogger('Suggestions');
|
|
|
|
// Shared state for tracking generation status - private
|
|
let isRunning = false;
|
|
let currentAbortController: AbortController | null = null;
|
|
|
|
/**
|
|
* Get the current running state
|
|
*/
|
|
export function getSuggestionsStatus(): {
|
|
isRunning: boolean;
|
|
currentAbortController: AbortController | null;
|
|
} {
|
|
return { isRunning, currentAbortController };
|
|
}
|
|
|
|
/**
|
|
* Set the running state and abort controller
|
|
*/
|
|
export function setRunningState(running: boolean, controller: AbortController | null = null): void {
|
|
isRunning = running;
|
|
currentAbortController = controller;
|
|
}
|
|
|
|
// Re-export shared utilities
|
|
export { getErrorMessageShared as getErrorMessage };
|
|
export const logError = createLogError(logger);
|