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