mirror of
https://github.com/andy-stack/vaultkeeper-ai.git
synced 2026-07-22 06:42:03 +00:00
- Remove unused agentExecutionDefinitions and gatedDefinitions methods - Delete obsolete CreatePlan.ts (replaced by ExecuteWorkflow.ts) - Rename PlanningAgentSystemPrompt to PlanningPrompt for consistency - Fix orchestration agent promise returns and replan flag handling - Make saveConversation calls async throughout AIController - Simplify vault cache delete event handling - Change debug logging from console.log to console.debug - Fix function name references in execution and main agents
48 lines
No EOL
1.5 KiB
TypeScript
48 lines
No EOL
1.5 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 { PlanningPrompt } from "AIPrompts/PlanningPrompt";
|
|
import { ExecutionPrompt } from "./ExecutionPrompt";
|
|
import { OrchestrationPrompt } from "./OrchestrationPrompt";
|
|
|
|
export interface IPrompt {
|
|
systemInstruction(): string;
|
|
orchestrationInstruction(): string;
|
|
planningInstruction(): string;
|
|
executionInstruction(): 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 orchestrationInstruction(): string {
|
|
return OrchestrationPrompt;
|
|
}
|
|
|
|
public planningInstruction(): string {
|
|
return PlanningPrompt;
|
|
}
|
|
|
|
public executionInstruction(): string {
|
|
return ExecutionPrompt;
|
|
}
|
|
|
|
public async userInstruction(): Promise<string> {
|
|
const result = await this.fileSystemService.readFile(this.settingsService.settings.userInstruction, true);
|
|
return result instanceof Error ? "" : result;
|
|
}
|
|
} |