From 8c9a0a96d01d15b25561ed22616a5f571f31495a Mon Sep 17 00:00:00 2001 From: Sellitus Date: Sat, 1 Feb 2025 03:29:20 -0600 Subject: [PATCH] Patch scripts + first patch (#6) * Add patch and build scripts * Apply patches --------- Co-authored-by: sellitus --- .git-blame-ignore-revs | 2 +- .github/ISSUE_TEMPLATE/config.yml | 2 +- CHANGELOG.md | 6 +- README.md | 20 ++--- bld_and_install.sh | 1 + docs/_config.yml | 4 +- flake.nix | 2 +- package.json | 6 +- rootastic-patch.py | 78 +++++++++++++++++++ rootastic-patch.sh | 16 ++++ src/api/providers/__tests__/unbound.test.ts | 2 +- src/api/providers/unbound.ts | 2 +- src/extension.ts | 6 +- .../src/components/chat/Announcement.tsx | 4 +- .../src/components/settings/ApiOptions.tsx | 2 +- .../src/components/settings/SettingsView.tsx | 8 +- 16 files changed, 128 insertions(+), 33 deletions(-) create mode 100644 bld_and_install.sh create mode 100644 rootastic-patch.py create mode 100644 rootastic-patch.sh diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 93f9eeaa5b..de7efdb08e 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,3 +1,3 @@ -# Ran Prettier on all files - https://github.com/RooVetGit/Roo-Code/pull/404 +# Ran Prettier on all files - https://github.com/RooVetGit/Rootastic/pull/404 60a0a824b96a0b326af4d8871b6903f4ddcfe114 579bdd9dbf6d2d569e5e7adb5ff6292b1e42ea34 diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 70472c2597..d7dee30e76 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,7 +1,7 @@ blank_issues_enabled: false contact_links: - name: Feature Request - url: https://github.com/RooVetGit/Roo-Code/discussions/categories/feature-requests + url: https://github.com/RooVetGit/Rootastic/discussions/categories/feature-requests about: Share and vote on feature requests for Roo Code - name: Leave a Review url: https://marketplace.visualstudio.com/items?itemName=RooVeterinaryInc.roo-cline&ssr=false#review-details diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fd17bd2b9..3b48be1191 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,7 +67,7 @@ - Ask and Architect modes can now edit markdown files - Custom modes can now be restricted to specific file patterns (for example, a technical writer who can only edit markdown files 👋) - Support for configuring the Bedrock provider with AWS Profiles -- New Roo Code community Discord at https://roocode.com/discord! +- New Roo Code community Discord at https://rootastic.com/discord! ## [3.2.8] @@ -107,7 +107,7 @@ - Create specialized assistants for any workflow - Just type "Create a new mode for " or visit the Prompts tab in the top menu to get started -Join us at https://www.reddit.com/r/RooCode to share your custom modes and be part of our next chapter! +Join us at https://www.reddit.com/r/Rootastic to share your custom modes and be part of our next chapter! ## [3.1.7] @@ -160,7 +160,7 @@ Join us at https://www.reddit.com/r/RooCode to share your custom modes and be pa ## [3.0.0] -- This release adds chat modes! Now you can ask Roo Code questions about system architecture or the codebase without immediately jumping into writing code. You can even assign different API configuration profiles to each mode if you prefer to use different models for thinking vs coding. Would love feedback in the new Roo Code Reddit! https://www.reddit.com/r/RooCode +- This release adds chat modes! Now you can ask Roo Code questions about system architecture or the codebase without immediately jumping into writing code. You can even assign different API configuration profiles to each mode if you prefer to use different models for thinking vs coding. Would love feedback in the new Roo Code Reddit! https://www.reddit.com/r/Rootastic ## [2.2.46] diff --git a/README.md b/README.md index c19e0c6b9f..fe074cb32f 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,13 @@ Download on VS Marketplace -Discord +Discord -r/RooCode +r/Rootastic -Feature Requests +Feature Requests Rate & Review @@ -51,7 +51,7 @@ Roo Code now integrates directly with VS Code's native code actions system, prov ### Join Our Discord! -We've launched a new Discord community! Join us at [https://roocode.com/discord](https://roocode.com/discord) to: +We've launched a new Discord community! Join us at [https://rootastic.com/discord](https://rootastic.com/discord) to: - Share your custom modes - Get help and support @@ -75,7 +75,7 @@ To mark this new chapter, we're introducing the power to shape Roo Code into any The best part is that Roo can help you create these new modes! Just type "Create a new mode for " in the chat to get started, and go into the Prompts tab or (carefully) edit the JSON representation to customize the prompt and allowed tools to your liking. -We can't wait to hear more about what you build and how we can continue to evolve the Roo Code platform to support you. Please join us in our new https://www.reddit.com/r/RooCode subreddit to share your custom modes and be part of our next chapter. 🚀 +We can't wait to hear more about what you build and how we can continue to evolve the Roo Code platform to support you. Please join us in our new https://www.reddit.com/r/Rootastic subreddit to share your custom modes and be part of our next chapter. 🚀 ## New in 3.1: Chat Mode Prompt Customization & Prompt Enhancements @@ -240,7 +240,7 @@ Roo Code is available on: 1. **Clone** the repo: ```bash - git clone https://github.com/RooVetGit/Roo-Code.git + git clone https://github.com/RooVetGit/Rootastic.git ``` 2. **Install dependencies**: ```bash @@ -253,7 +253,7 @@ Roo Code is available on: - A `.vsix` file will appear in the `bin/` directory. 4. **Install** the `.vsix` manually if desired: ```bash - code --install-extension bin/roo-code-4.0.0.vsix + code --install-extension bin/rootastic-4.0.0.vsix ``` 5. **Start the webview (Vite/React app with HMR)**: ```bash @@ -278,10 +278,10 @@ We use [changesets](https://github.com/changesets/changesets) for versioning and We love community contributions! Here’s how to get involved: -1. **Check Issues & Requests**: See [open issues](https://github.com/RooVetGit/Roo-Code/issues) or [feature requests](https://github.com/RooVetGit/Roo-Code/discussions/categories/feature-requests). +1. **Check Issues & Requests**: See [open issues](https://github.com/RooVetGit/Rootastic/issues) or [feature requests](https://github.com/RooVetGit/Rootastic/discussions/categories/feature-requests). 2. **Fork & branch** off `main`. 3. **Submit a Pull Request** once your feature or fix is ready. -4. **Join** our [Reddit community](https://www.reddit.com/r/RooCode/) and [Discord](https://roocode.com/discord) for feedback, tips, and announcements. +4. **Join** our [Reddit community](https://www.reddit.com/r/Rootastic/) and [Discord](https://rootastic.com/discord) for feedback, tips, and announcements. --- @@ -291,4 +291,4 @@ We love community contributions! Here’s how to get involved: --- -**Enjoy Roo Code!** Whether you keep it on a short leash or let it roam autonomously, we can’t wait to see what you build. If you have questions or feature ideas, drop by our [Reddit community](https://www.reddit.com/r/RooCode/) or [Discord](https://roocode.com/discord). Happy coding! +**Enjoy Roo Code!** Whether you keep it on a short leash or let it roam autonomously, we can’t wait to see what you build. If you have questions or feature ideas, drop by our [Reddit community](https://www.reddit.com/r/Rootastic/) or [Discord](https://rootastic.com/discord). Happy coding! diff --git a/bld_and_install.sh b/bld_and_install.sh new file mode 100644 index 0000000000..18e6d364a4 --- /dev/null +++ b/bld_and_install.sh @@ -0,0 +1 @@ +npm run build && code --install-extension bin/rootastic-*.vsix \ No newline at end of file diff --git a/docs/_config.yml b/docs/_config.yml index 8d2cfe4a38..7a8756a6c7 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -2,11 +2,11 @@ title: Roo Code Documentation description: Documentation for the Roo Code project remote_theme: just-the-docs/just-the-docs -url: https://docs.roocode.com +url: https://docs.rootastic.com aux_links: "Roo Code on GitHub": - - "//github.com/RooVetGit/Roo-Code" + - "//github.com/RooVetGit/Rootastic" # Enable search search_enabled: true diff --git a/flake.nix b/flake.nix index 74c3c628e2..32bab5cd82 100644 --- a/flake.nix +++ b/flake.nix @@ -13,7 +13,7 @@ mkDevShell = system: let pkgs = import nixpkgs { inherit system; }; in pkgs.mkShell { - name = "roo-code"; + name = "rootastic"; packages = with pkgs; [ zsh diff --git a/package.json b/package.json index a95ace9ee3..5e5485d9af 100644 --- a/package.json +++ b/package.json @@ -17,9 +17,9 @@ }, "repository": { "type": "git", - "url": "https://github.com/RooVetGit/Roo-Code" + "url": "https://github.com/RooVetGit/Rootastic" }, - "homepage": "https://github.com/RooVetGit/Roo-Code", + "homepage": "https://github.com/RooVetGit/Rootastic", "categories": [ "AI", "Chat", @@ -42,7 +42,7 @@ "ai", "llama", "roo code", - "roocode" + "rootastic" ], "activationEvents": [ "onLanguage", diff --git a/rootastic-patch.py b/rootastic-patch.py new file mode 100644 index 0000000000..51be302716 --- /dev/null +++ b/rootastic-patch.py @@ -0,0 +1,78 @@ +import os +import re + + + +replacements = [ + # { + # "start_marker": "CAPABILITIES\n\n", + # "new_content": """ + # Test 1 + # """ + # }, + # { + # "start_marker": "USER'S CUSTOM INSTRUCTIONS\n\n", + # "new_content": """ + # Test 2 + # """ + # }, + # # Add more sections here if desired +] + +def replace_section(text, start_marker, new_content): + pattern = rf"({re.escape(start_marker)})(.*?)(?=(?:\n|\`|\')\s*:\s*\"\"|$)" + return re.sub(pattern, rf"\1{new_content}", text, flags=re.DOTALL) + +def patch_instructions(base_directory): + + if base_directory == "": + base_directory = os.getcwd() + + for root, dirs, files in os.walk(base_directory): + for filename in files: + if filename.endswith(".ts"): + filepath = os.path.join(root, filename) + with open(filepath, "r", encoding="utf-8") as f: + original_text = f.read() + + new_text = original_text + for rep in replacements: + new_text = replace_section( + new_text, + rep["start_marker"], + rep["new_content"], + ) + + if new_text != original_text: + with open(filepath, "w", encoding="utf-8") as f: + f.write(new_text) + print(f"Patched: {filepath}") + +def patch_name(base_directory): + if base_directory == "": + base_directory = os.getcwd() + + for root, dirs, files in os.walk(base_directory): + for filename in files: + filepath = os.path.join(root, filename) + if os.path.isfile(filepath): + try: + with open(filepath, 'r', encoding='utf-8') as f: + content = f.read() + + new_content = re.sub(r'(?i)roo-?code', lambda m: 'rootastic' if m.group().islower() else 'Rootastic', content) + + if new_content != content: + with open(filepath, 'w', encoding='utf-8') as f: + f.write(new_content) + print(f"Renamed Rootastic references in: {filepath}") + except UnicodeDecodeError: + # Skip binary files and files with non-UTF-8 encoding + continue + + +if __name__ == "__main__": + # Adjust the path if necessary + patch_dir = "src/core/prompts/sections" + patch_instructions(patch_dir) + patch_name("") diff --git a/rootastic-patch.sh b/rootastic-patch.sh new file mode 100644 index 0000000000..f77607ef1b --- /dev/null +++ b/rootastic-patch.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -e # exit immediately if a command exits with a non-zero status + +# Step 1: Fetch and merge upstream changes from the master/main branch +git fetch upstream +git checkout main +git merge upstream/main + +# Step 2: Apply the custom patch +if git apply --check myCustom.patch; then + git apply myCustom.patch + echo "Custom patch applied successfully." +else + echo "Error: Patch did not apply cleanly. Please resolve conflicts manually." + exit 1 +fi \ No newline at end of file diff --git a/src/api/providers/__tests__/unbound.test.ts b/src/api/providers/__tests__/unbound.test.ts index 3a0fe4868e..144bbe2261 100644 --- a/src/api/providers/__tests__/unbound.test.ts +++ b/src/api/providers/__tests__/unbound.test.ts @@ -146,7 +146,7 @@ describe("UnboundHandler", () => { }), expect.objectContaining({ headers: { - "X-Unbound-Metadata": expect.stringContaining("roo-code"), + "X-Unbound-Metadata": expect.stringContaining("rootastic"), }, }), ) diff --git a/src/api/providers/unbound.ts b/src/api/providers/unbound.ts index 2bc3d82822..bad5792eae 100644 --- a/src/api/providers/unbound.ts +++ b/src/api/providers/unbound.ts @@ -90,7 +90,7 @@ export class UnboundHandler implements ApiHandler, SingleCompletionHandler { labels: [ { key: "app", - value: "roo-code", + value: "rootastic", }, ], }), diff --git a/src/extension.ts b/src/extension.ts index 719f38d5e8..d96b5ac63e 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -23,10 +23,10 @@ let outputChannel: vscode.OutputChannel // This method is called when your extension is activated // Your extension is activated the very first time the command is executed export function activate(context: vscode.ExtensionContext) { - outputChannel = vscode.window.createOutputChannel("Roo-Code") + outputChannel = vscode.window.createOutputChannel("Rootastic") context.subscriptions.push(outputChannel) - outputChannel.appendLine("Roo-Code extension activated") + outputChannel.appendLine("Rootastic extension activated") // Get default commands from configuration const defaultCommands = vscode.workspace.getConfiguration("roo-cline").get("allowedCommands") || [] @@ -259,5 +259,5 @@ export function activate(context: vscode.ExtensionContext) { // This method is called when your extension is deactivated export function deactivate() { - outputChannel.appendLine("Roo-Code extension deactivated") + outputChannel.appendLine("Rootastic extension deactivated") } diff --git a/webview-ui/src/components/chat/Announcement.tsx b/webview-ui/src/components/chat/Announcement.tsx index a2e96606ef..c8e1bf2516 100644 --- a/webview-ui/src/components/chat/Announcement.tsx +++ b/webview-ui/src/components/chat/Announcement.tsx @@ -54,8 +54,8 @@ const Announcement = ({ version, hideAnnouncement }: AnnouncementProps) => {

We can't wait to see how you'll push Roo Code's potential even further! Share your custom modes and join the discussion at{" "} - - reddit.com/r/RooCode + + reddit.com/r/Rootastic .

diff --git a/webview-ui/src/components/settings/ApiOptions.tsx b/webview-ui/src/components/settings/ApiOptions.tsx index 4bdff0b061..31552e971b 100644 --- a/webview-ui/src/components/settings/ApiOptions.tsx +++ b/webview-ui/src/components/settings/ApiOptions.tsx @@ -1216,7 +1216,7 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage }: ApiOptionsProps) = fontWeight: 500, }}> Note: This is a very experimental integration and may not work as expected. Please report - any issues to the Roo-Code GitHub repository. + any issues to the Rootastic GitHub repository.

diff --git a/webview-ui/src/components/settings/SettingsView.tsx b/webview-ui/src/components/settings/SettingsView.tsx index c81c372ce1..d0f01690f6 100644 --- a/webview-ui/src/components/settings/SettingsView.tsx +++ b/webview-ui/src/components/settings/SettingsView.tsx @@ -712,12 +712,12 @@ const SettingsView = ({ onDone }: SettingsViewProps) => { }}>

If you have any questions or feedback, feel free to open an issue at{" "} - - github.com/RooVetGit/Roo-Code + + github.com/RooVetGit/Rootastic {" "} or join{" "} - - reddit.com/r/RooCode + + reddit.com/r/Rootastic