feat: Implement wiki editing functionalities and UI components
- Added new tools for wiki page editing, including writing, replacing text, renaming, and deleting pages, with corresponding data structures for each action. - Enhanced the frontend with a new `WikiEditResult` component to display results of wiki edits, supporting multiple languages for improved accessibility. - Updated localization files for English and Chinese to include new strings related to wiki actions. - Modified existing tools to return structured data for wiki actions, improving the clarity and usability of the output messages. These changes significantly enhance the wiki editing capabilities, providing users with a more robust and user-friendly experience when managing wiki content.
This commit is contained in:
@@ -106,10 +106,20 @@ func (t *wikiDeletePageTool) Execute(ctx context.Context, args json.RawMessage)
|
||||
}
|
||||
}
|
||||
|
||||
outputMsg := fmt.Sprintf("Successfully deleted page %s and cleaned up %d incoming links.", params.Slug, updatedCount)
|
||||
outputMsg := fmt.Sprintf("Successfully deleted page [[%s]] and cleaned up %d incoming links.", params.Slug, updatedCount)
|
||||
if updatedCount > 0 {
|
||||
outputMsg += fmt.Sprintf(" Affected pages: %s", strings.Join(updatedSlugs, ", "))
|
||||
outputMsg += fmt.Sprintf("\n- Affected pages: %s", strings.Join(updatedSlugs, ", "))
|
||||
}
|
||||
|
||||
return &types.ToolResult{Success: true, Output: outputMsg}, nil
|
||||
return &types.ToolResult{
|
||||
Success: true,
|
||||
Output: outputMsg,
|
||||
Data: map[string]interface{}{
|
||||
"display_type": "wiki_delete_page",
|
||||
"slug": params.Slug,
|
||||
"title": existingPage.Title,
|
||||
"updated_count": updatedCount,
|
||||
"affected_pages": updatedSlugs,
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user