chore: clean up repo for public release
- Remove BMAD framework, IDE configs, dev screenshots, test files, internal docs, and backup files - Rename keep-notes/ to memento-note/ - Update all references from keep-notes to memento-note - Add Apache 2.0 license with Commons Clause (non-commercial restriction) - Add clean .gitignore and .env.docker.example
This commit is contained in:
49
memento-note/app/actions/paragraph-refactor.ts
Normal file
49
memento-note/app/actions/paragraph-refactor.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
'use server'
|
||||
|
||||
import { paragraphRefactorService, RefactorMode, RefactorResult } from '@/lib/ai/services/paragraph-refactor.service'
|
||||
|
||||
export interface RefactorResponse {
|
||||
result: RefactorResult
|
||||
}
|
||||
|
||||
/**
|
||||
* Refactor a paragraph with a specific mode
|
||||
*/
|
||||
export async function refactorParagraph(
|
||||
content: string,
|
||||
mode: RefactorMode
|
||||
): Promise<RefactorResponse> {
|
||||
try {
|
||||
const result = await paragraphRefactorService.refactor(content, mode)
|
||||
|
||||
return { result }
|
||||
} catch (error) {
|
||||
console.error('Error refactoring paragraph:', error)
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all 3 refactor options at once
|
||||
*/
|
||||
export async function refactorParagraphAllModes(
|
||||
content: string
|
||||
): Promise<{ results: RefactorResult[] }> {
|
||||
try {
|
||||
const results = await paragraphRefactorService.refactorAllModes(content)
|
||||
|
||||
return { results }
|
||||
} catch (error) {
|
||||
console.error('Error refactoring paragraph in all modes:', error)
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate word count before refactoring
|
||||
*/
|
||||
export async function validateRefactorWordCount(
|
||||
content: string
|
||||
): Promise<{ valid: boolean; error?: string }> {
|
||||
return paragraphRefactorService.validateWordCount(content)
|
||||
}
|
||||
Reference in New Issue
Block a user