Repository: stitionai/devika Branch: main Commit: 80bb343cbe4a Files: 156 Total size: 905.3 KB Directory structure: gitextract_y706qbmn/ ├── .github/ │ ├── ISSUE_TEMPLATE/ │ │ ├── bug_report.md │ │ ├── feature_request.md │ │ └── issue.md │ └── pull_request_template.md ├── .gitignore ├── ARCHITECTURE.md ├── CONTRIBUTING.md ├── LICENSE ├── Makefile ├── README.md ├── ROADMAP.md ├── app.dockerfile ├── benchmarks/ │ ├── BENCHMARKS.md │ └── SWE-bench.md ├── devika.dockerfile ├── devika.py ├── docker-compose.yaml ├── docs/ │ ├── Installation/ │ │ ├── ollama.md │ │ └── search_engine.md │ └── architecture/ │ ├── ARCHITECTURE.md │ ├── README.md │ └── UNDER_THE_HOOD.md ├── requirements.txt ├── sample.config.toml ├── setup.sh ├── src/ │ ├── agents/ │ │ ├── __init__.py │ │ ├── action/ │ │ │ ├── __init__.py │ │ │ ├── action.py │ │ │ └── prompt.jinja2 │ │ ├── agent.py │ │ ├── answer/ │ │ │ ├── __init__.py │ │ │ ├── answer.py │ │ │ └── prompt.jinja2 │ │ ├── coder/ │ │ │ ├── __init__.py │ │ │ ├── coder.py │ │ │ └── prompt.jinja2 │ │ ├── decision/ │ │ │ ├── __init__.py │ │ │ ├── decision.py │ │ │ └── prompt.jinja2 │ │ ├── feature/ │ │ │ ├── __init__.py │ │ │ ├── feature.py │ │ │ └── prompt.jinja2 │ │ ├── formatter/ │ │ │ ├── __init__.py │ │ │ ├── formatter.py │ │ │ └── prompt.jinja2 │ │ ├── internal_monologue/ │ │ │ ├── __init__.py │ │ │ ├── internal_monologue.py │ │ │ └── prompt.jinja2 │ │ ├── patcher/ │ │ │ ├── __init__.py │ │ │ ├── patcher.py │ │ │ └── prompt.jinja2 │ │ ├── planner/ │ │ │ ├── __init__.py │ │ │ ├── planner.py │ │ │ └── prompt.jinja2 │ │ ├── reporter/ │ │ │ ├── __init__.py │ │ │ ├── prompt.jinja2 │ │ │ └── reporter.py │ │ ├── researcher/ │ │ │ ├── __init__.py │ │ │ ├── prompt.jinja2 │ │ │ └── researcher.py │ │ └── runner/ │ │ ├── __init__.py │ │ ├── prompt.jinja2 │ │ ├── rerunner.jinja2 │ │ └── runner.py │ ├── apis/ │ │ └── project.py │ ├── bert/ │ │ └── sentence.py │ ├── browser/ │ │ ├── __init__.py │ │ ├── browser.py │ │ ├── interaction.py │ │ └── search.py │ ├── config.py │ ├── documenter/ │ │ ├── graphwiz.py │ │ ├── pdf.py │ │ └── uml.py │ ├── experts/ │ │ ├── __UNIMPLEMENTED__ │ │ ├── chemistry.py │ │ ├── game-dev.py │ │ ├── math.py │ │ ├── medical.py │ │ ├── physics.py │ │ ├── stackoverflow.py │ │ └── web-design.py │ ├── filesystem/ │ │ ├── __init__.py │ │ └── read_code.py │ ├── init.py │ ├── llm/ │ │ ├── __init__.py │ │ ├── claude_client.py │ │ ├── gemini_client.py │ │ ├── groq_client.py │ │ ├── llm.py │ │ ├── lm_studio_client.py │ │ ├── mistral_client.py │ │ ├── ollama_client.py │ │ └── openai_client.py │ ├── logger.py │ ├── memory/ │ │ ├── __init__.py │ │ ├── knowledge_base.py │ │ └── rag.py │ ├── project.py │ ├── sandbox/ │ │ ├── code_runner.py │ │ └── firejail.py │ ├── services/ │ │ ├── __init__.py │ │ ├── git.py │ │ ├── github.py │ │ ├── netlify.py │ │ └── utils.py │ ├── socket_instance.py │ └── state.py └── ui/ ├── .gitignore ├── .npmrc ├── bun.lockb ├── components.json ├── package.json ├── postcss.config.cjs ├── src/ │ ├── app.html │ ├── app.pcss │ ├── lib/ │ │ ├── api.js │ │ ├── components/ │ │ │ ├── BrowserWidget.svelte │ │ │ ├── ControlPanel.svelte │ │ │ ├── EditorWidget.svelte │ │ │ ├── MessageContainer.svelte │ │ │ ├── MessageInput.svelte │ │ │ ├── MonacoEditor.js │ │ │ ├── Sidebar.svelte │ │ │ ├── TerminalWidget.svelte │ │ │ └── ui/ │ │ │ ├── Seperator.svelte │ │ │ ├── SidebarButton.svelte │ │ │ ├── resizable/ │ │ │ │ ├── index.js │ │ │ │ ├── resizable-handle.svelte │ │ │ │ └── resizable-pane-group.svelte │ │ │ ├── select/ │ │ │ │ ├── index.js │ │ │ │ ├── select-content.svelte │ │ │ │ ├── select-item.svelte │ │ │ │ ├── select-label.svelte │ │ │ │ ├── select-separator.svelte │ │ │ │ └── select-trigger.svelte │ │ │ ├── sonner/ │ │ │ │ ├── index.js │ │ │ │ └── sonner.svelte │ │ │ └── tabs/ │ │ │ ├── index.js │ │ │ ├── tabs-content.svelte │ │ │ ├── tabs-list.svelte │ │ │ └── tabs-trigger.svelte │ │ ├── icons.js │ │ ├── sockets.js │ │ ├── store.js │ │ ├── token.js │ │ └── utils.js │ └── routes/ │ ├── +layout.js │ ├── +layout.svelte │ ├── +page.svelte │ ├── logs/ │ │ └── +page.svelte │ └── settings/ │ └── +page.svelte ├── static/ │ └── assets/ │ └── loading-lottie.json ├── svelte.config.js ├── tailwind.config.js └── vite.config.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/ISSUE_TEMPLATE/bug_report.md ================================================ --- name: Bug report about: Create a report to help us improve title: '[Bug]' labels: '' assignees: '' --- ### Describe the bug A clear and concise description of what the bug is. ### How To Reproduce Steps to reproduce the behavior (example): 1. {steps_1} 2. {steps_2} 3. {steps_3} ### Expected behavior A clear and concise description of what you expected to happen. ### Screenshots and logs must share logs from frontend or backend. also If applicable, add screenshots to help explain your problem. ### Configuration ``` - OS: [e.g. Windows, Linux, MacOS] - Python version: [e.g. 3.10] - Node version: [e.g. 18.0.0] - bun version: [e.g. 0.1.0] - search engine: [e.g. google] - Model: [e.g. gpt, cluade] ``` #### Additional context Add any other context about the problem here. ================================================ FILE: .github/ISSUE_TEMPLATE/feature_request.md ================================================ --- name: Feature request about: Suggest an idea for this project title: '[FEATURE]' labels: '' assignees: '' --- ## Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] ## Describe the solution you'd like A clear and concise description of what you want to happen. ## Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. ### Additional context Add any other context or screenshots about the feature request here. ================================================ FILE: .github/ISSUE_TEMPLATE/issue.md ================================================ --- name: Issue about: Create a report to help us improve title: '[ISSUE]' labels: '' assignees: '' --- ### Describe your issue A clear and concise description of what the issue is. ### How To Reproduce Steps to reproduce the behavior (example): 1. {steps_1} 2. {steps_2} 3. {steps_3} ### Expected behavior A clear and concise description of what you expected to happen. ### Screenshots and logs must share logs from frontend or backend. also If applicable, add screenshots to help explain your problem. ### Configuration ``` - OS: [e.g. Windows, Linux, MacOS] - Python version: [e.g. 3.10] - Node version: [e.g. 18.0.0] - bun version: [e.g. 0.1.0] - search engine: [e.g. google] - Model: [e.g. gpt, cluade] ``` #### Additional context Add any other context about the problem here. ================================================ FILE: .github/pull_request_template.md ================================================ ### Description for e.g. * [ ] Bug 1 * [ ] Bug 2 * [ ] Feature 1 * [ ] Feature 2 * [ ] Breaking changes Explain what existing problem does the pull request solve? ### Test plan (required) Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI. ### Closing issues (optional) Fixes # ================================================ FILE: .gitignore ================================================ # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class # C extensions *.so # Distribution / packaging .Python build/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ lib64/ parts/ sdist/ var/ wheels/ share/python-wheels/ *.egg-info/ .installed.cfg *.egg MANIFEST # PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest *.spec # Installer logs pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ .nox/ .coverage .coverage.* .cache nosetests.xml coverage.xml *.cover *.py,cover .hypothesis/ .pytest_cache/ cover/ # Translations *.mo *.pot # Django stuff: *.log local_settings.py db.sqlite3 db.sqlite3-journal # Flask stuff: instance/ .webassets-cache # Scrapy stuff: .scrapy # Sphinx documentation docs/_build/ # PyBuilder .pybuilder/ target/ # Jupyter Notebook .ipynb_checkpoints # IPython profile_default/ ipython_config.py # pyenv # For a library or package, you might want to ignore these files since the code is # intended to run in multiple environments; otherwise, check them in: # .python-version # pipenv # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. # However, in case of collaboration, if having platform-specific dependencies or dependencies # having no cross-platform support, pipenv may install dependencies that don't work, or not # install all needed dependencies. #Pipfile.lock # poetry # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. # This is especially recommended for binary packages to ensure reproducibility, and is more # commonly ignored for libraries. # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control #poetry.lock # pdm # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. #pdm.lock # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it # in version control. # https://pdm.fming.dev/#use-with-ide .pdm.toml # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm __pypackages__/ # Celery stuff celerybeat-schedule celerybeat.pid # SageMath parsed files *.sage.py # Environments .env .venv env/ venv/ ENV/ env.bak/ venv.bak/ config.toml # Spyder project settings .spyderproject .spyproject # Rope project settings .ropeproject # mkdocs documentation /site # mypy .mypy_cache/ .dmypy.json dmypy.json # Pyre type checker .pyre/ # pytype static type analyzer .pytype/ # Cython debug symbols cython_debug/ # PyCharm # JetBrains specific template is maintained in a separate JetBrains.gitignore that can # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. .idea/ notes.md data/ ================================================ FILE: ARCHITECTURE.md ================================================ # Devika Architecture Devika is an advanced AI software engineer that can understand high-level human instructions, break them down into steps, research relevant information, and write code to achieve a given objective. This document provides a detailed technical overview of Devika's system architecture and how the various components work together. ## Table of Contents 1. [Overview](#overview) 2. [Agent Core](#agent-core) 3. [Agents](#agents) - [Planner](#planner) - [Researcher](#researcher) - [Coder](#coder) - [Action](#action) - [Runner](#runner) - [Feature](#feature) - [Patcher](#patcher) - [Reporter](#reporter) - [Decision](#decision) 4. [Language Models](#language-models) 5. [Browser Interaction](#browser-interaction) 6. [Project Management](#project-management) 7. [Agent State Management](#agent-state-management) 8. [Services](#services) 9. [Utilities](#utilities) 10. [Conclusion](#conclusion) ## Overview At a high level, Devika consists of the following key components: - **Agent Core**: Orchestrates the overall AI planning, reasoning and execution process. Communicates with various sub-agents. - **Agents**: Specialized sub-agents that handle specific tasks like planning, research, coding, patching, reporting etc. - **Language Models**: Leverages large language models (LLMs) like Claude, GPT-4, GPT-3 for natural language understanding and generation. - **Browser Interaction**: Enables web browsing, information gathering, and interaction with web elements. - **Project Management**: Handles organization and persistence of project-related data. - **Agent State Management**: Tracks and persists the dynamic state of the AI agent across interactions. - **Services**: Integrations with external services like GitHub, Netlify for enhanced capabilities. - **Utilities**: Supporting modules for configuration, logging, vector search, PDF generation etc. Let's dive into each of these components in more detail. ## Agent Core The `Agent` class serves as the central engine that drives Devika's AI planning and execution loop. Here's how it works: 1. When a user provides a high-level prompt, the `execute` method is invoked on the Agent. 2. The prompt is first passed to the Planner agent to generate a step-by-step plan. 3. The Researcher agent then takes this plan and extracts relevant search queries and context. 4. The Agent performs web searches using Bing Search API and crawls the top results. 5. The raw crawled content is passed through the Formatter agent to extract clean, relevant information. 6. This researched context, along with the step-by-step plan, is fed to the Coder agent to generate code. 7. The generated code is saved to the project directory on disk. 8. If the user interacts further with a follow-up prompt, the `subsequent_execute` method is invoked. 9. The Action agent determines the appropriate action to take based on the user's message (run code, deploy, write tests, add feature, fix bug, write report etc.) 10. The corresponding specialized agent is invoked to perform the action (Runner, Feature, Patcher, Reporter). 11. Results are communicated back to the user and the project files are updated. Throughout this process, the Agent Core is responsible for: - Managing conversation history and project-specific context - Updating agent state and internal monologue - Accumulating context keywords across agent prompts - Emulating the "thinking" process of the AI through timed agent state updates - Handling special commands through the Decision agent (e.g. git clone, browser interaction session) ## Agents Devika's cognitive abilities are powered by a collection of specialized sub-agents. Each agent is implemented as a separate Python class. Agents communicate with the underlying LLMs through prompt templates defined in Jinja2 format. Key agents include: ### Planner - Generates a high-level step-by-step plan based on the user's prompt - Extracts focus area and provides a summary - Uses few-shot prompting to provide examples of the expected response format ### Researcher - Takes the generated plan and extracts relevant search queries - Ranks and filters queries based on relevance and specificity - Prompts the user for additional context if required - Aims to maximize information gain while minimizing number of searches ### Coder - Generates code based on the step-by-step plan and researched context - Segments code into appropriate files and directories - Includes informative comments and documentation - Handles a variety of languages and frameworks - Validates code syntax and style ### Action - Determines the appropriate action to take based on the user's follow-up prompt - Maps user intent to a specific action keyword (run, test, deploy, fix, implement, report) - Provides a human-like confirmation of the action to the user ### Runner - Executes the written code in a sandboxed environment - Handles different OS environments (Mac, Linux, Windows) - Streams command output to user in real-time - Gracefully handles errors and exceptions ### Feature - Implements a new feature based on user's specification - Modifies existing project files while maintaining code structure and style - Performs incremental testing to verify feature is working as expected ### Patcher - Debugs and fixes issues based on user's description or error message - Analyzes existing code to identify potential root causes - Suggests and implements fix, with explanation of the changes made ### Reporter - Generates a comprehensive report summarizing the project - Includes high-level overview, technical design, setup instructions, API docs etc. - Formats report in a clean, readable structure with table of contents - Exports report as a PDF document ### Decision - Handles special command-like instructions that don't fit other agents - Maps commands to specific functions (git clone, browser interaction etc.) - Executes the corresponding function with provided arguments Each agent follows a common pattern: 1. Prepare a prompt by rendering the Jinja2 template with current context 2. Query the LLM to get a response based on the prompt 3. Validate and parse the LLM's response to extract structured output 4. Perform any additional processing or side-effects (e.g. save to disk) 5. Return the result to the Agent Core for further action Agents aim to be stateless and idempotent where possible. State and history is managed by the Agent Core and passed into the agents as needed. This allows for a modular, composable design. ## Language Models Devika's natural language processing capabilities are driven by state-of-the-art LLMs. The `LLM` class provides a unified interface to interact with different language models: - **Claude** (Anthropic): Claude models like claude-v1.3, claude-instant-v1.0 etc. - **GPT-4/GPT-3** (OpenAI): Models like gpt-4, gpt-3.5-turbo etc. - **Self-hosted models** (via [Ollama](https://ollama.com/)): Allows using open-source models in a self-hosted environment The `LLM` class abstracts out the specifics of each provider's API, allowing agents to interact with the models in a consistent way. It supports: - Listing available models - Generating completions based on a prompt - Tracking and accumulating token usage over time Choosing the right model for a given use case depends on factors like desired quality, speed, cost etc. The modular design allows swapping out models easily. ## Browser Interaction Devika can interact with webpages in an automated fashion to gather information and perform actions. This is powered by the `Browser` and `Crawler` classes. The `Browser` class uses Playwright to provide high-level web automation primitives: - Spawning a browser instance (Chromium) - Navigating to a URL - Querying DOM elements - Extracting page content as text, Markdown, PDF etc. - Taking a screenshot of the page The `Crawler` class defines an agent that can interact with a webpage based on natural language instructions. It leverages: - Pre-defined browser actions like scroll, click, type etc. - A prompt template that provides examples of how to use these actions - LLM to determine the best action to take based on current page content and objective The `start_interaction` function sets up a loop where: 1. The current page content and objective is passed to the LLM 2. The LLM returns the next best action to take (e.g. "CLICK 12" or "TYPE 7 machine learning") 3. The Crawler executes this action on the live page 4. The process repeats from the updated page state This allows performing a sequence of actions to achieve a higher-level objective (e.g. research a topic, fill out a form, interact with an app etc.) ## Project Management The `ProjectManager` class is responsible for creating, updating and querying projects and their associated metadata. Key functions include: - Creating a new project and initializing its directory structure - Deleting a project and its associated files - Adding a message to a project's conversation history - Retrieving messages for a given project - Getting the latest user/AI message in a conversation - Listing all projects - Zipping a project's files for export Project metadata is persisted in a SQLite database using SQLModel. The `Projects` table stores: - Project name - JSON-serialized conversation history This allows the agent to work on multiple projects simultaneously and retain conversation history across sessions. ## Agent State Management As the AI agent works on a task, we need to track and display its internal state to the user. The `AgentState` class handles this by providing an interface to: - Initialize a new agent state - Add a state to the current sequence of states for a project - Update the latest state for a project - Query the latest state or entire state history for a project - Mark the agent as active/inactive or task as completed Agent state includes information like: - Current step or action being executed - Internal monologue reflecting the agent's current "thoughts" - Browser interactions (URL visited, screenshot) - Terminal interactions (command executed, output) - Token usage so far Like projects, agent states are also persisted in the SQLite DB using SQLModel. The `AgentStateModel` table stores: - Project name - JSON-serialized list of states Having a persistent log of agent states is useful for: - Providing real-time visibility to the user - Auditing and debugging agent behavior - Resuming from interruptions or failures ## Services Devika integrates with external services to augment its capabilities: - **GitHub**: Performing git operations like clone/pull, listing repos/commits/files etc. - **Netlify**: Deploying web apps and sites seamlessly The `GitHub` and `Netlify` classes provide lightweight wrappers around the respective service APIs. They handle authentication, making HTTP requests, and parsing responses. This allows Devika to perform actions like: - Cloning a repo given a GitHub URL - Listing a user's GitHub repos - Creating a new Netlify site - Deploying a directory to Netlify - Providing the deployed site URL to the user Integrations are done in a modular way so that new services can be added easily. ## Utilities Devika makes use of several utility modules to support its functioning: - `Config`: Loads and provides access to configuration settings (API keys, folder paths etc.) - `Logger`: Sets up logging to console and file, with support for log levels and colors - `ReadCode`: Recursively reads code files in a directory and converts them into a Markdown format - `SentenceBERT`: Extracts keywords and semantic information from text using SentenceBERT embeddings - `Experts`: A collection of domain-specific knowledge bases to assist in certain areas (e.g. webdev, physics, chemistry, math) The utility modules aim to provide reusable functionality that is used across different parts of the system. ## Conclusion Devika is a complex system that combines multiple AI and automation techniques to deliver an intelligent programming assistant. Key design principles include: - Modularity: Breaking down functionality into specialized agents and services - Flexibility: Supporting different LLMs, services and domains in a pluggable fashion - Persistence: Storing project and agent state in a DB to enable pause/resume and auditing - Transparency: Surfacing agent thought process and interactions to user in real-time By understanding how the different components work together, we can extend, optimize and scale Devika to take on increasingly sophisticated software engineering tasks. The agent-based architecture provides a strong foundation to build more advanced AI capabilities in the future. ================================================ FILE: CONTRIBUTING.md ================================================ # Welcome Contributors We welcome contributions to enhance Devika's capabilities and improve its performance. To report bugs, create a [GitHub issue](https://github.com/stitionai/devika/issues). > Before contributing, read through the existing issues and pull requests to see if someone else is already working on something similar. That way you can avoid duplicating efforts. To contribute, please follow these steps: 1. Fork the Devika repository on GitHub. 2. Create a new branch for your feature or bug fix. 3. Make your changes and ensure that the code passes all tests. 4. Submit a pull request describing your changes and their benefits. ### Pull Request Guidelines When submitting a pull request, please follow these guidelines: 1. **Title**: please include following prefixes: - `Feature:` for new features - `Fix:` for bug fixes - `Docs:` for documentation changes - `Refactor:` for code refactoring - `Improve:` for performance improvements - `Other:` for other changes for example: - `Feature: added new feature to the code` - `Fix: fixed the bug in the code` 2. **Description**: Provide a clear and detailed description of your changes in the pull request. Explain the problem you are solving, the approach you took, and any potential side effects or limitations of your changes. 3. **Documentation**: Update the relevant documentation to reflect your changes. This includes the README file, code comments, and any other relevant documentation. 4. **Dependencies**: If your changes require new dependencies, ensure that they are properly documented and added to the `requirements.txt` or `package.json` files. 5. if the pull request does not meet the above guidelines, it may be closed without merging. **Note**: Please ensure that you have the latest version of the code before creating a pull request. If you have an existing fork, just sync your fork with the latest version of the Devika repository. Please adhere to the coding conventions, maintain clear documentation, and provide thorough testing for your contributions. ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2024 stition Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: Makefile ================================================ .PHONY = setup deps compose-up compose-down compose-destroy # to check if docker is installed on the machine DOCKER := $(shell command -v docker) DOCKER_COMPOSE := $(shell command -v docker-compose) deps: ifndef DOCKER @echo "Docker is not available. Please install docker" @echo "try running sudo apt-get install docker" @exit 1 endif ifndef DOCKER_COMPOSE @echo "docker-compose is not available. Please install docker-compose" @echo "try running sudo apt-get install docker-compose" @exit 1 endif setup: sh +x build compose-down: deps docker volume ls docker-compose ps docker images docker-compose down; compose-up: deps compose-down docker-compose up --build compose-destroy: deps docker images | grep -i devika | awk '{print $$3}' | xargs docker rmi -f docker volume prune ================================================ FILE: README.md ================================================
${Icons.Folder}${" "}${filename}
`; // TODO implement folder collapse/expand to the element sidebarElement } else { sidebarElement.innerHTML = `${Icons.File}${" "}${filename}
`; } return sidebarElement; }; const changeTabColor = (index) => { const allTabElements = document.querySelectorAll("#tabContainer")[0].children; for (let i = 0; i < allTabElements?.length; i++) { allTabElements[i].classList.remove("bg-secondary"); } allTabElements[index].classList.add("bg-secondary"); } const folders = {}; Object.entries(models).forEach(([filename, model], modelIndex) => { const parts = filename.split('/'); let currentFolder = sidebarContainer; parts.forEach((part, index) => { if (index === parts.length - 1) { const fileElement = createSidebarElement(part, false); fileElement.addEventListener("click", () => { editor.setModel(model); changeTabColor(modelIndex); }); currentFolder.appendChild(fileElement); } else { const folderName = part; if (!folders[folderName]) { const folderElement = createSidebarElement(part, true); currentFolder.appendChild(folderElement); folders[folderName] = folderElement; currentFolder = folderElement; } else { currentFolder = folders[folderName]; } } }); }); } ================================================ FILE: ui/src/lib/components/Sidebar.svelte ================================================{@html log}
{/each}{@html log}
{/each}{key.toLowerCase()}
settings["API_KEYS"][key] = e.target.value} name={key} class="p-2 border-2 w-1/2 rounded-lg {editMode ? '' : ' text-gray-500'}" readonly={!editMode} />{key.toLowerCase()}
settings["API_ENDPOINTS"][key] = e.target.value} name={key} class="p-2 border-2 w-1/2 rounded-lg {editMode ? '' : 'text-gray-500'}" readonly={!editMode} />{key.toLowerCase()}
{key.toLowerCase()}