andy-stack_vaultkeeper-ai/AIPrompts/IPrompt.ts
Andrew Beal e22cd8698a refactor: implement planning mode with user questions and cross-provider function call improvements
- Add planning mode toggle and AskUserQuestion function for interactive planning
- Fix Gemini cross-provider function call detection using toolId presence
- Update OpenAI naming service to handle new response format
- Improve system prompts by removing complexity gate, streamlining to action-first principle
- Add InputDisplay component and question mode to ChatInput
- Refactor execution plan error messages to show all incomplete steps
- Update tests to reflect cross-provider function call format changes
2026-01-04 18:52:44 +00:00

37 lines
No EOL
1.4 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";
import { PlanningEnabledAppendix } from "./PlanningEnabledAppendix";
export interface IPrompt {
systemInstruction(planningMode?: boolean): 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(planningMode: boolean = false): string {
return planningMode ? SystemInstruction + PlanningEnabledAppendix : 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;
}
}