andy-stack_vaultkeeper-ai/AIClasses/FunctionDefinitions/AIFunctionResponse.ts
Andrew Beal 3c9b5f9b73 feat: add mobile support for diff view with accept/reject buttons
- Add mobile-specific controls with Accept/Reject buttons for diff review
- Centralize user rejection/suggestion messages in AIFunctionResponse
- Update VaultService to use centralized message constants
- Style mobile buttons with proper touch targets and theme colors
- Auto-focus main view after accepting/rejecting changes on mobile
2025-12-06 16:38:01 +00:00

30 lines
No EOL
1.2 KiB
TypeScript

// Platform agnostic class for function responses
// Used by AI providers to format function execution results for API calls
export class AIFunctionResponse {
public readonly name: string;
public readonly response: object;
public readonly toolId?: string;
public static readonly UserRejectionMessage: string = `The user has explicitly rejected this change.
They may have changed their mind about the requested change.
**CRITICAL:** Immediately stop all further actions and consult with the user`;
public static readonly UserSuggestionMessage: string = "The user has rejected the change with the following suggestion: ";
constructor(name: string, response: object, toolId?: string) {
this.name = name;
this.response = response;
this.toolId = toolId;
}
public toConversationString(): string {
return JSON.stringify({
id: this.toolId,
functionResponse: {
name: this.name,
response: { result: this.response }
}
});
}
}