Spaces:
Running
Running
Solomon7890-jpeg
commited on
Commit
·
88c88a0
1
Parent(s):
d7261e5
feat(ui): update app with futuristic Gold and Blue theme
Browse files- .github/instructions/codacy.instructions.md +72 -0
- .gitignore +4 -0
- app.py +32 -7
.github/instructions/codacy.instructions.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
description: Configuration for AI behavior when interacting with Codacy's MCP Server
|
| 3 |
+
applyTo: '**'
|
| 4 |
+
---
|
| 5 |
+
---
|
| 6 |
+
# Codacy Rules
|
| 7 |
+
Configuration for AI behavior when interacting with Codacy's MCP Server
|
| 8 |
+
|
| 9 |
+
## CRITICAL: After ANY successful `edit_file` or `reapply` operation
|
| 10 |
+
- YOU MUST IMMEDIATELY run the `codacy_cli_analyze` tool from Codacy's MCP Server for each file that was edited, with:
|
| 11 |
+
- `rootPath`: set to the workspace path
|
| 12 |
+
- `file`: set to the path of the edited file
|
| 13 |
+
- `tool`: leave empty or unset
|
| 14 |
+
- If any issues are found in the new edits, propose and apply fixes for them.
|
| 15 |
+
- > NOTE: Failure to follow this rule is considered a critical error.
|
| 16 |
+
|
| 17 |
+
## When you tried to run the `codacy_cli_analyze` tool and the Codacy CLI is not installed
|
| 18 |
+
- Ask the user 'Codacy CLI is not installed. Would you like me to install it now?'
|
| 19 |
+
- If the user responds with "yes", run the `codacy_cli_install` tool and then continue with the original task
|
| 20 |
+
- If the user responds with "no", instruct the user that they can disable automatic analysis in the extension settings
|
| 21 |
+
- Wait for the user to respond before proceeding with any other actions
|
| 22 |
+
|
| 23 |
+
## After every response
|
| 24 |
+
- If you made any file edits in this conversation, verify you ran `codacy_cli_analyze` tool from Codacy's MCP Server
|
| 25 |
+
|
| 26 |
+
## When there are no Codacy MCP Server tools available, or the MCP Server is not reachable
|
| 27 |
+
- Suggest the user the following troubleshooting steps:
|
| 28 |
+
- Try to reset the MCP on the extension
|
| 29 |
+
- If the user is using VSCode, suggest them to review their Copilot > MCP settings in Github, under their organization or personal account. Refer them to Settings > Copilot > Enable MCP servers in Copilot. Suggested URL (https://github.com/settings/copilot/features) or https://github.com/organizations/{organization-name}/settings/copilot/features (This can only be done by their organization admins / owners)
|
| 30 |
+
- If none of the above steps work, suggest the user to contact Codacy support
|
| 31 |
+
|
| 32 |
+
## Trying to call a tool that needs a rootPath as a parameter
|
| 33 |
+
- Always use the standard, non-URL-encoded file system path
|
| 34 |
+
|
| 35 |
+
## CRITICAL: Dependencies and Security Checks
|
| 36 |
+
- IMMEDIATELY after ANY of these actions:
|
| 37 |
+
- Running npm/yarn/pnpm install
|
| 38 |
+
- Adding dependencies to package.json
|
| 39 |
+
- Adding requirements to requirements.txt
|
| 40 |
+
- Adding dependencies to pom.xml
|
| 41 |
+
- Adding dependencies to build.gradle
|
| 42 |
+
- Any other package manager operations
|
| 43 |
+
- You MUST run the `codacy_cli_analyze` tool with:
|
| 44 |
+
- `rootPath`: set to the workspace path
|
| 45 |
+
- `tool`: set to "trivy"
|
| 46 |
+
- `file`: leave empty or unset
|
| 47 |
+
- If any vulnerabilities are found because of the newly added packages:
|
| 48 |
+
- Stop all other operations
|
| 49 |
+
- Propose and apply fixes for the security issues
|
| 50 |
+
- Only continue with the original task after security issues are resolved
|
| 51 |
+
- EXAMPLE:
|
| 52 |
+
- After: npm install react-markdown
|
| 53 |
+
- Do: Run codacy_cli_analyze with trivy
|
| 54 |
+
- Before: Continuing with any other tasks
|
| 55 |
+
|
| 56 |
+
## General
|
| 57 |
+
- Repeat the relevant steps for each modified file.
|
| 58 |
+
- "Propose fixes" means to both suggest and, if possible, automatically apply the fixes.
|
| 59 |
+
- You MUST NOT wait for the user to ask for analysis or remind you to run the tool.
|
| 60 |
+
- Do not run `codacy_cli_analyze` looking for changes in duplicated code or code complexity metrics.
|
| 61 |
+
- Complexity metrics are different from complexity issues. When trying to fix complexity in a repository or file, focus on solving the complexity issues and ignore the complexity metric.
|
| 62 |
+
- Do not run `codacy_cli_analyze` looking for changes in code coverage.
|
| 63 |
+
- Do not try to manually install Codacy CLI using either brew, npm, npx, or any other package manager.
|
| 64 |
+
- If the Codacy CLI is not installed, just run the `codacy_cli_analyze` tool from Codacy's MCP Server.
|
| 65 |
+
- When calling `codacy_cli_analyze`, only send provider, organization and repository if the project is a git repository.
|
| 66 |
+
|
| 67 |
+
## Whenever a call to a Codacy tool that uses `repository` or `organization` as a parameter returns a 404 error
|
| 68 |
+
- Offer to run the `codacy_setup_repository` tool to add the repository to Codacy
|
| 69 |
+
- If the user accepts, run the `codacy_setup_repository` tool
|
| 70 |
+
- Do not ever try to run the `codacy_setup_repository` tool on your own
|
| 71 |
+
- After setup, immediately retry the action that failed (only retry once)
|
| 72 |
+
---
|
.gitignore
CHANGED
|
@@ -7,3 +7,7 @@ __pycache__/
|
|
| 7 |
tmp_*
|
| 8 |
test_*
|
| 9 |
.DS_Store
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
tmp_*
|
| 8 |
test_*
|
| 9 |
.DS_Store
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
#Ignore vscode AI rules
|
| 13 |
+
.github\instructions\codacy.instructions.md
|
app.py
CHANGED
|
@@ -105,25 +105,50 @@ async def respond_with_ultimate_brain(message, history: list, mode: str, ai_prov
|
|
| 105 |
yield f"{response}\n\n❌ Error: {str(e)}"
|
| 106 |
|
| 107 |
# Custom CSS - Simplified with logo styling
|
|
|
|
| 108 |
custom_css = """
|
| 109 |
-
.gradio-container {
|
|
|
|
|
|
|
|
|
|
| 110 |
.header-section {
|
| 111 |
text-align: center; padding: 40px 20px;
|
| 112 |
-
background: linear-gradient(135deg, #
|
| 113 |
-
color:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
}
|
| 115 |
-
.header-section h1 { font-size: 3rem; margin-bottom: 10px; font-weight: 700; }
|
| 116 |
.brain-badge {
|
| 117 |
-
display: inline-block;
|
|
|
|
|
|
|
| 118 |
padding: 8px 16px; border-radius: 20px; font-weight: bold;
|
| 119 |
margin: 10px 5px;
|
|
|
|
|
|
|
| 120 |
}
|
| 121 |
.logo-circle img {
|
| 122 |
border-radius: 50% !important;
|
| 123 |
-
box-shadow: 0
|
| 124 |
-
border: 4px solid #
|
| 125 |
object-fit: cover !important;
|
| 126 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 127 |
"""
|
| 128 |
|
| 129 |
# SEO
|
|
|
|
| 105 |
yield f"{response}\n\n❌ Error: {str(e)}"
|
| 106 |
|
| 107 |
# Custom CSS - Simplified with logo styling
|
| 108 |
+
# Custom CSS - Futuristic Gold and Blue Theme
|
| 109 |
custom_css = """
|
| 110 |
+
.gradio-container {
|
| 111 |
+
max-width: 1400px !important;
|
| 112 |
+
background-color: #0a0e17 !important;
|
| 113 |
+
}
|
| 114 |
.header-section {
|
| 115 |
text-align: center; padding: 40px 20px;
|
| 116 |
+
background: linear-gradient(135deg, #001529 0%, #003366 50%, #8a6e14 100%);
|
| 117 |
+
color: #ffffff;
|
| 118 |
+
border-radius: 12px; margin-bottom: 20px;
|
| 119 |
+
border: 1px solid #D4AF37;
|
| 120 |
+
box-shadow: 0 4px 20px rgba(212, 175, 55, 0.2);
|
| 121 |
+
}
|
| 122 |
+
.header-section h1 {
|
| 123 |
+
font-size: 3rem; margin-bottom: 10px; font-weight: 700;
|
| 124 |
+
text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
|
| 125 |
+
background: linear-gradient(to right, #ffffff, #FFD700);
|
| 126 |
+
-webkit-background-clip: text;
|
| 127 |
+
-webkit-text-fill-color: transparent;
|
| 128 |
+
}
|
| 129 |
+
.header-section p {
|
| 130 |
+
color: #e0e0e0;
|
| 131 |
}
|
|
|
|
| 132 |
.brain-badge {
|
| 133 |
+
display: inline-block;
|
| 134 |
+
background: linear-gradient(45deg, #D4AF37, #FDB931);
|
| 135 |
+
color: #001529;
|
| 136 |
padding: 8px 16px; border-radius: 20px; font-weight: bold;
|
| 137 |
margin: 10px 5px;
|
| 138 |
+
border: 1px solid #ffffff;
|
| 139 |
+
box-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
|
| 140 |
}
|
| 141 |
.logo-circle img {
|
| 142 |
border-radius: 50% !important;
|
| 143 |
+
box-shadow: 0 0 25px rgba(212, 175, 55, 0.6) !important;
|
| 144 |
+
border: 4px solid #D4AF37 !important;
|
| 145 |
object-fit: cover !important;
|
| 146 |
}
|
| 147 |
+
/* Tab Styling */
|
| 148 |
+
.tabs button.selected {
|
| 149 |
+
color: #D4AF37 !important;
|
| 150 |
+
border_bottom: 2px solid #D4AF37 !important;
|
| 151 |
+
}
|
| 152 |
"""
|
| 153 |
|
| 154 |
# SEO
|