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:
wizardchen
2026-04-10 21:35:28 +08:00
parent 995e2157cd
commit 84edfa5439
10 changed files with 483 additions and 11 deletions
+13 -3
View File
@@ -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
}