mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-17 10:03:08 +00:00
* Changes from fix/fetch-before-pull-fetch * feat: Improve pull request flow, add branch selection for worktree creation, fix for automode concurrency count * feat: Add validation for remote names and improve error handling * Address PR comments and mobile layout fixes * ``` refactor: Extract PR target resolution logic into dedicated service ``` * feat: Add app shell UI and improve service imports. Address PR comments * fix: Improve security validation and cache handling in git operations * feat: Add GET /list endpoint and improve parameter handling * chore: Improve validation, accessibility, and error handling across apps * chore: Format vite server port configuration * fix: Add error handling for gh pr list command and improve offline fallbacks * fix: Preserve existing PR creation time and improve remote handling
123 lines
2.5 KiB
TypeScript
123 lines
2.5 KiB
TypeScript
/**
|
|
* @automaker/utils
|
|
* Shared utility functions for AutoMaker
|
|
*/
|
|
|
|
// Error handling
|
|
export {
|
|
isAbortError,
|
|
isCancellationError,
|
|
isAuthenticationError,
|
|
isRateLimitError,
|
|
isQuotaExhaustedError,
|
|
isModelNotFoundError,
|
|
isStreamDisconnectedError,
|
|
extractRetryAfter,
|
|
classifyError,
|
|
getUserFriendlyErrorMessage,
|
|
getErrorMessage,
|
|
logError,
|
|
} from './error-handler.js';
|
|
|
|
// Conversation utilities
|
|
export {
|
|
extractTextFromContent,
|
|
normalizeContentBlocks,
|
|
formatHistoryAsText,
|
|
convertHistoryToMessages,
|
|
} from './conversation-utils.js';
|
|
|
|
// Image handling
|
|
export {
|
|
getMimeTypeForImage,
|
|
readImageAsBase64,
|
|
convertImagesToContentBlocks,
|
|
formatImagePathsForPrompt,
|
|
} from './image-handler.js';
|
|
|
|
// Prompt building
|
|
export {
|
|
buildPromptWithImages,
|
|
type PromptContent,
|
|
type PromptWithImages,
|
|
} from './prompt-builder.js';
|
|
|
|
// Logger
|
|
export {
|
|
createLogger,
|
|
getLogLevel,
|
|
setLogLevel,
|
|
setColorsEnabled,
|
|
setTimestampsEnabled,
|
|
LogLevel,
|
|
type Logger,
|
|
} from './logger.js';
|
|
|
|
// File system utilities
|
|
export { mkdirSafe, existsSafe } from './fs-utils.js';
|
|
|
|
// Atomic file operations
|
|
export {
|
|
atomicWriteJson,
|
|
readJsonFile,
|
|
updateJsonAtomically,
|
|
readJsonWithRecovery,
|
|
rotateBackups,
|
|
logRecoveryWarning,
|
|
DEFAULT_BACKUP_COUNT,
|
|
type AtomicWriteOptions,
|
|
type ReadJsonRecoveryResult,
|
|
type ReadJsonRecoveryOptions,
|
|
} from './atomic-writer.js';
|
|
|
|
// Path utilities
|
|
export { normalizePath, pathsEqual, sanitizeFilename } from './path-utils.js';
|
|
|
|
// Context file loading
|
|
export {
|
|
loadContextFiles,
|
|
getContextFilesSummary,
|
|
type ContextMetadata,
|
|
type ContextFileInfo,
|
|
type ContextFilesResult,
|
|
type ContextFsModule,
|
|
type LoadContextFilesOptions,
|
|
type MemoryFileInfo,
|
|
type TaskContext,
|
|
} from './context-loader.js';
|
|
|
|
// Memory loading
|
|
export {
|
|
loadRelevantMemory,
|
|
initializeMemoryFolder,
|
|
appendLearning,
|
|
recordMemoryUsage,
|
|
getMemoryDir,
|
|
parseFrontmatter,
|
|
serializeFrontmatter,
|
|
extractTerms,
|
|
calculateUsageScore,
|
|
countMatches,
|
|
incrementUsageStat,
|
|
formatLearning,
|
|
type MemoryFsModule,
|
|
type MemoryMetadata,
|
|
type MemoryFile,
|
|
type MemoryLoadResult,
|
|
type UsageStats,
|
|
type LearningEntry,
|
|
type SimpleMemoryFile,
|
|
} from './memory-loader.js';
|
|
|
|
// Debounce and throttle utilities
|
|
export {
|
|
debounce,
|
|
throttle,
|
|
type DebounceOptions,
|
|
type ThrottleOptions,
|
|
type DebouncedFunction,
|
|
} from './debounce.js';
|
|
|
|
// Git validation utilities
|
|
export { isValidBranchName, isValidRemoteName, MAX_BRANCH_NAME_LENGTH } from './git-validation.js';
|