andy-stack_vaultkeeper-ai/AIPrompts/IPrompt.ts
Andrew Beal 2de8109a74 refactor: restructure AI prompt and agent architecture for multi-agent planning support
- Move prompts from AIClasses to AIPrompts directory
- Replace centralized IPrompt injection with direct property setters on IAIClass
- Remove allowDestructiveActions parameter from streamRequest methods
- Add toolDefinitions, systemPrompt, and userInstruction properties to IAIClass
- Refactor AIFunctionDefinitions to static methods with agent-specific tool sets
- Add planning agent function definitions (CreatePlan, Replan, CompleteStep, SubmitPlan)
- Create AIControllerService to handle agent orchestration
- Add execution plan related copy strings and replacement utility
- Update all AI providers (Claude, Gemini, OpenAI) to use new architecture
2025-12-30 19:07:00 +00:00

36 lines
No EOL
1.2 KiB
TypeScript

import { Resolve } from "Services/DependencyService";
import { Services } from "Services/Services";
import { SystemInstruction } from "./SystemPrompt";
import type { FileSystemService } from "Services/FileSystemService";
import type { SettingsService } from "Services/SettingsService";
import { PlanningAgentSystemPrompt } from "AIPrompts/PlanningAgentSystemPrompt";
export interface IPrompt {
systemInstruction(): string;
planningInstruction(): string;
userInstruction(): Promise<string>;
}
export class AIPrompt implements IPrompt {
private readonly settingsService: SettingsService;
private readonly fileSystemService: FileSystemService;
public constructor() {
this.settingsService = Resolve<SettingsService>(Services.SettingsService);
this.fileSystemService = Resolve<FileSystemService>(Services.FileSystemService);
}
public systemInstruction(): string {
return SystemInstruction;
}
public planningInstruction(): string {
return PlanningAgentSystemPrompt;
}
public async userInstruction(): Promise<string> {
const result = await this.fileSystemService.readFile(this.settingsService.settings.userInstruction, true);
return result instanceof Error ? "" : result;
}
}