@posthog/agent
Version:
TypeScript agent framework wrapping Claude Agent SDK with Git-based task execution for PostHog
49 lines • 1.77 kB
TypeScript
import type { TemplateVariables } from "./template-manager.js";
import type { PostHogResource, SupportingFile, Task, UrlMention } from "./types.js";
import { Logger } from "./utils/logger.js";
export interface PromptBuilderDeps {
getTaskFiles: (taskId: string) => Promise<SupportingFile[]>;
generatePlanTemplate: (vars: TemplateVariables) => Promise<string>;
posthogClient?: {
fetchResourceByUrl: (mention: UrlMention) => Promise<PostHogResource>;
};
logger?: Logger;
}
export declare class PromptBuilder {
private getTaskFiles;
private generatePlanTemplate;
private posthogClient?;
private logger;
constructor(deps: PromptBuilderDeps);
/**
* Extract file paths from XML tags in description
* Format: <file path="relative/path.ts" />
*/
private extractFilePaths;
/**
* Read file contents from repository
*/
private readFileContent;
/**
* Extract URL mentions from XML tags in description
* Formats: <error id="..." />, <experiment id="..." />, <url href="..." />
*/
private extractUrlMentions;
/**
* Generate a display label for a URL mention
*/
private generateUrlLabel;
/**
* Process URL references and fetch their content
*/
private processUrlReferences;
/**
* Process description to extract file tags and read contents
* Returns processed description and referenced file contents
*/
private processFileReferences;
buildResearchPrompt(task: Task, repositoryPath?: string): Promise<string>;
buildPlanningPrompt(task: Task, repositoryPath?: string): Promise<string>;
buildExecutionPrompt(task: Task, repositoryPath?: string): Promise<string>;
}
//# sourceMappingURL=prompt-builder.d.ts.map