mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-31 06:42:03 +00:00
feat: add @automaker/utils package
- Extract error handling utilities (isAbortError, classifyError, etc.) - Extract conversation utilities (formatHistoryAsText, etc.) - Extract image handling utilities (readImageAsBase64, etc.) - Extract prompt building utilities (buildPromptWithImages) - Extract logger utilities (createLogger, setLogLevel) - Extract file system utilities (mkdirSafe, existsSafe) All utilities now use @automaker/types for type imports. Provides shared utility functions for both server and UI. Dependencies: @automaker/types 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
50
libs/utils/src/index.ts
Normal file
50
libs/utils/src/index.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* @automaker/utils
|
||||
* Shared utility functions for AutoMaker
|
||||
*/
|
||||
|
||||
// Error handling
|
||||
export {
|
||||
isAbortError,
|
||||
isCancellationError,
|
||||
isAuthenticationError,
|
||||
classifyError,
|
||||
getUserFriendlyErrorMessage,
|
||||
} from './error-handler';
|
||||
|
||||
// Conversation utilities
|
||||
export {
|
||||
extractTextFromContent,
|
||||
normalizeContentBlocks,
|
||||
formatHistoryAsText,
|
||||
convertHistoryToMessages,
|
||||
} from './conversation-utils';
|
||||
|
||||
// Image handling
|
||||
export {
|
||||
getMimeTypeForImage,
|
||||
readImageAsBase64,
|
||||
convertImagesToContentBlocks,
|
||||
formatImagePathsForPrompt,
|
||||
} from './image-handler';
|
||||
|
||||
// Prompt building
|
||||
export {
|
||||
buildPromptWithImages,
|
||||
type PromptContent,
|
||||
type PromptWithImages,
|
||||
} from './prompt-builder';
|
||||
|
||||
// Logger
|
||||
export {
|
||||
createLogger,
|
||||
getLogLevel,
|
||||
setLogLevel,
|
||||
LogLevel,
|
||||
} from './logger';
|
||||
|
||||
// File system utilities
|
||||
export {
|
||||
mkdirSafe,
|
||||
existsSafe,
|
||||
} from './fs-utils';
|
||||
Reference in New Issue
Block a user