2025-10-03 07:25:37 +08:00
|
|
|
import analyticsEngineerAgentPrompt from './analytics-engineer-agent-prompt.txt';
|
2025-08-06 12:11:48 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Template parameters for the docs agent prompt
|
|
|
|
*/
|
|
|
|
export interface DocsAgentTemplateParams {
|
|
|
|
folderStructure: string;
|
|
|
|
date: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Loads the docs agent prompt template and replaces variables
|
|
|
|
*/
|
|
|
|
function loadAndProcessPrompt(params: DocsAgentTemplateParams): string {
|
2025-10-03 07:25:37 +08:00
|
|
|
return analyticsEngineerAgentPrompt
|
2025-08-13 04:57:23 +08:00
|
|
|
.replace(/\{\{folder_structure\}\}/g, params.folderStructure)
|
|
|
|
.replace(/\{\{date\}\}/g, params.date);
|
2025-08-06 12:11:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Export the template function for use in agent files
|
|
|
|
*/
|
|
|
|
export const getDocsAgentSystemPrompt = (folderStructure: string): string => {
|
|
|
|
if (!folderStructure.trim()) {
|
|
|
|
throw new Error('Folder structure is required');
|
|
|
|
}
|
|
|
|
|
|
|
|
const currentDate = new Date().toISOString();
|
|
|
|
|
|
|
|
return loadAndProcessPrompt({
|
|
|
|
folderStructure,
|
|
|
|
date: currentDate,
|
|
|
|
});
|
|
|
|
};
|