mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-31 20:03:37 +00:00
- Introduced a new utility function `loadContextFiles` to load project-specific context files from the `.automaker/context/` directory, enhancing agent prompts with project rules and guidelines. - Updated `AgentService` and `AutoModeService` to utilize the new context loading functionality, combining context prompts with existing system prompts for improved agent performance. - Added comprehensive documentation on the context files system, including usage examples and metadata structure, to facilitate better understanding and implementation. - Removed redundant context loading logic from `AutoModeService`, streamlining the codebase. These changes aim to improve the agent's contextual awareness and adherence to project-specific conventions.
57 lines
1.2 KiB
TypeScript
57 lines
1.2 KiB
TypeScript
/**
|
|
* @automaker/utils
|
|
* Shared utility functions for AutoMaker
|
|
*/
|
|
|
|
// Error handling
|
|
export {
|
|
isAbortError,
|
|
isCancellationError,
|
|
isAuthenticationError,
|
|
classifyError,
|
|
getUserFriendlyErrorMessage,
|
|
getErrorMessage,
|
|
} 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, LogLevel } from './logger.js';
|
|
|
|
// File system utilities
|
|
export { mkdirSafe, existsSafe } from './fs-utils.js';
|
|
|
|
// Path utilities
|
|
export { normalizePath, pathsEqual } from './path-utils.js';
|
|
|
|
// Context file loading
|
|
export {
|
|
loadContextFiles,
|
|
getContextFilesSummary,
|
|
type ContextMetadata,
|
|
type ContextFileInfo,
|
|
type ContextFilesResult,
|
|
type LoadContextFilesOptions,
|
|
} from './context-loader.js';
|