mirror of
https://github.com/andy-stack/vaultkeeper-ai.git
synced 2026-07-22 06:42:03 +00:00
- 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
36 lines
No EOL
1.2 KiB
TypeScript
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;
|
|
}
|
|
} |