Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
325 changes: 263 additions & 62 deletions astro.config.mjs

Large diffs are not rendered by default.

Binary file added public/videos/enable_rollback.mp4
Binary file not shown.
Binary file added public/videos/use_rollback.mp4
Binary file not shown.
8 changes: 8 additions & 0 deletions src/components/Head.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
import type { Props } from '@astrojs/starlight/props';
import Default from '@astrojs/starlight/components/Head.astro';
import PageTransitions from './PageTransitions.astro';
---

<Default {...Astro.props}><slot /></Default>
<PageTransitions />
14 changes: 14 additions & 0 deletions src/components/Navigation.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
---

<script>
// This script runs once and persists across page navigations
document.addEventListener('astro:page-load', () => {
// Your initialization code here
}, { once: true });

// This script runs on every page navigation
document.addEventListener('astro:page-load', () => {
// Your per-page update code here
});
</script>
24 changes: 24 additions & 0 deletions src/components/PageTransitions.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
import { ViewTransitions } from 'astro:transitions';
---

<ViewTransitions fallback="swap" />

<script>
// To preserve scroll position across page navigations
const scrollPositions = new Map();

// Before the new page's content is prepared, store the current scrollY
document.addEventListener('astro:before-preparation', () => {
scrollPositions.set(window.location.pathname, window.scrollY);
});

// Once the new page loads, restore the scroll position if available
document.addEventListener('astro:page-load', () => {
const pos = scrollPositions.get(window.location.pathname);
if (pos !== undefined) {
window.scrollTo(0, pos);
scrollPositions.delete(window.location.pathname);
}
});
</script>
40 changes: 16 additions & 24 deletions src/components/Search.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,24 @@
import "@docsearch/css";
---

<div id="docsearch"></div>
<div id="docsearch" transition:persist></div>

<script>
import docsearch from "@docsearch/js";

let searchInstance: ReturnType<typeof docsearch> | null = null;

docsearch({
container: "#docsearch",
appId: "ANAV9NA8H5",
indexName: "refact",
apiKey: "2bae895dcb109e0a9b87ee935c121c85",
});
</script>

<style>
div {
display: contents;
}

div[data-open-modal] {
width: 100%;
}

@media (min-width: 50rem) {
:global(.DocSearch-Button) {
width: 100%;
max-width: 22rem;
const initSearch = () => {
if (!searchInstance) {
searchInstance = docsearch({
container: "#docsearch",
appId: "ANAV9NA8H5",
indexName: "refact",
apiKey: "2bae895dcb109e0a9b87ee935c121c85",
});
}
}
</style>
};

// Initialize on first load only
document.addEventListener('astro:page-load', initSearch, { once: true });
</script>
29 changes: 24 additions & 5 deletions src/content/docs/features/autonomous-agent/integrations/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ title: Agent Integrations
description: Overview of available integrations for the Refact.ai Agent
---

The Refact.ai Agent supports various integrations to enhance your development workflow. Here's a list of available integrations:
The Refact.ai Agent supports various integrations to enhance your development workflow. These integrations extend the Agent's [core tools](../tools) with external services and capabilities.

## Development Tools
- [Chrome](./chrome) - Control Chrome browser for testing and automation
- [Shell](./shell-commands) - Execute terminal commands
- [Chrome](./chrome) - Control Chrome browser for testing
- [Command-line Tool](./command-line-tool) - Configure and use custom command-line tools
- [Command-line Service](./command-line-service) - Run and manage background processes
- [MCP Server](./mcp) - Connect to Model Context Protocol servers
- [Shell Commands](./shell-commands) - Execute terminal commands with user confirmation

## Version Control
- [GitHub](./github) - Interact with GitHub repositories through GitHub CLI
Expand All @@ -23,6 +24,24 @@ The Refact.ai Agent supports various integrations to enhance your development wo
- [MySQL](./mysql) - Work with MySQL databases

## Debugging
- [Pdb](./pdb) -Aallows interaction with the Python debugger
- [Pdb](./pdb) - Allows interaction with the Python debugger

Each integration can be configured and customized to suit your specific needs. Click on the links above to learn more about each integration's features and configuration options.
Each integration can be configured and customized to suit your specific needs. Click on the links above to learn more about each integration's features and configuration options.

## Configuring Integrations

You can configure the integrations in two ways:

### 1. Through Chat Interface

Click on the integrations button in the chat interface to quickly enable or disable specific integrations.

### 2. Through Settings

Access integrations through the settings menu for more detailed configuration options.

## Next Steps

- Review our [security best practices](../security) when setting up integrations
- Learn about [authentication methods](../authentication) for different services
- Check the [troubleshooting guide](../troubleshooting) if you encounter any issues
55 changes: 55 additions & 0 deletions src/content/docs/features/autonomous-agent/integrations/mcp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: MCP Server
description: Configure and use Model Context Protocol server integration
---

The MCP (Model Context Protocol) Server integration enables the Refact.ai Agent to connect to local or remote MCP servers, enhancing the agent's context understanding and capabilities. This integration supports various MCP server implementations and configurations.

## What is MCP?

MCP (Model Context Protocol) is a protocol designed to provide structured context to language models. It allows for standardized communication between applications and language models, enabling more effective context management and improved model responses.

Learn more about MCP at [Anthropic's Model Context Protocol documentation](https://www.anthropic.com/news/model-context-protocol).

## Basic Configurations

### Command Settings
- **Command**: Specify the MCP command to execute
- Examples:
- `npx -y <some-mcp-server>`
- `/my/path/venv/python -m <some-mcp-server>`
- `docker run -i --rm <some-mcp-image>`
- On Windows, use `npx.cmd` or `npm.cmd` instead of `npx` or `npm`

### Environment Variables
- Add environment variables required by the MCP server
- Define variable names and values to configure server behavior

### Actions
- **Test**: Verifies the connection and functionality of the MCP server integration
- **Open mcp_test.yaml**: Opens the configuration file for editing

## Advanced Configuration

### Confirmation Rules
Define rules to control execution:
- **Ask User**: Commands matching these patterns will prompt the user for confirmation
- Use this for potentially sensitive operations
- **Deny**: Commands matching these patterns are automatically blocked
- Use this to prevent execution of potentially harmful commands



## Security Considerations

- Always verify the source and security of MCP servers before connecting
- Use confirmation rules to prevent execution of potentially harmful commands
- Consider using environment variables to pass sensitive configuration rather than command-line arguments
- For production environments, consider setting up access controls for your MCP servers

## Troubleshooting

- If the connection fails, verify that the MCP server is running and accessible
- Check that any required environment variables are correctly set
- Ensure that the command path is correct and executable
- For Docker-based servers, verify that Docker is running and the image is available
58 changes: 58 additions & 0 deletions src/content/docs/features/autonomous-agent/rollback.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: Agent Rollback
description: Learn how to use Refact.ai Agent's rollback functionality to revert repository changes
---

The Refact.ai Agent provides a powerful rollback feature that allows you to revert your repository to the state it was in at any specific point in your chat conversation. This feature is particularly useful when experimenting with different solutions or when you need to undo a series of changes.

## Overview

The rollback functionality enables you to:
- Return to any previous state in your development session
- Review changes before applying the rollback
- Maintain a clear history of your development process

## Enabling Rollback

The rollback feature is enabled by default in Agent chat mode. However, you should verify that the toggle is properly set:

<div class="video-frame">
<video controls width="100%">
<source src="/videos/enable_rollback.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>

## Using Rollback

To rollback to a specific point in your conversation:

1. Navigate to the message you want to rollback to in the chat history
2. Look for the rollback icon next to the message
3. Click the icon to initiate the rollback process
4. Review the summary of changes that will occur
5. Confirm the rollback if you agree with the changes

Here's how to use the rollback feature:

<div class="video-frame">
<video controls width="100%">
<source src="/videos/use_rollback.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>

## Important Considerations

:::caution[Warning]
Any changes made to your repository after the selected message point will be removed during rollback. This includes:
- Changes made by the Agent
- Manual changes you've made
- Any file modifications or additions
:::

## Next Steps

- Learn about [Agent Tools](../tools) to better understand how changes are made
- Explore [Agent Integrations](../integrations) for enhanced development workflow
- Check out the [FAQ](/faq) for common questions about Agent features
94 changes: 94 additions & 0 deletions src/content/docs/features/autonomous-agent/tools.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
title: Agent Tools
description: Overview of available tools and use cases for the autonomous Refact.ai Agent
---

The Refact.ai Agent is designed to operate autonomously, extending its capabilities beyond simple integrations. While integrations allow external services to be connected, Agent Tools empower the agent to perform key operations using built-in functionalities. Below is an overview of the available Agent Tools, typical use cases, and how they can enhance your development workflow.

## Core Tools

The Agent has access to several powerful tools that help it understand and modify your codebase:

### Context and Search Tools

- **search**
Find similar pieces of code or text using vector database.
*Use Case:* When you ask the Agent to modify code, it uses this tool to find similar patterns across your codebase to maintain consistency.

- **definition**
Read definition of symbols in the project using AST.
*Use Case:* The Agent uses this to understand function signatures, class structures, and type definitions when working with your code.

- **references**
Find usages of symbols within the project using AST.
*Use Case:* Before modifying a function or class, the Agent checks all its usages to ensure changes won't break existing code.

- **tree**
Get a files tree with symbols for the project.
*Use Case:* The Agent uses this to understand project structure and locate relevant files.

### File Operations

- **cat**
Read multiple files and understand their content.
*Use Case:* The Agent can read and analyze multiple files at once, including images and skeletonized code views.

- **locate**
Find relevant files for a specific task.
*Use Case:* When given a task, the Agent can quickly identify which files need to be modified.

### Code Modification

- **patch**
Apply changes to files in a controlled manner.
*Use Case:* The Agent uses this to make actual changes to your codebase, with your approval.

### Planning and Analysis

- **think**
Analyze complex problems and create execution plans using o3 mini reasoning model.
*Use Case:* Before making changes, the Agent plans out the steps needed to complete a task successfully. The o3 mini model helps break down complex problems into manageable steps and create a clear execution strategy.

### Web Interaction

- **web**
Fetch and read web pages in plain text format.
*Use Case:* The Agent can read documentation, specifications, or other web resources to help solve problems.

## How Agent Tools Work Together

The Agent combines these tools strategically to complete complex tasks. Here's a typical workflow:

1. **Understanding Phase**
- Uses `tree` to understand project structure
- Uses `locate` to find relevant files
- Uses `search` to find similar patterns
- Uses `definition` and `references` to understand code context

2. **Planning Phase**
- Uses `think` to create a detailed plan
- Uses `web` if external documentation is needed

3. **Execution Phase**
- Uses `cat` to read necessary files
- Creates changes using `patch` tool
- Verifies changes using `search` and `references`

## Best Practices

When working with the Agent, consider these tips:

- Let the Agent gather context before making changes
- Review proposed patches carefully before approving
- Use the Agent's planning capabilities for complex tasks
- Provide clear, specific instructions for best results

## Next Steps

Once you're familiar with the core tools, you might want to explore:

- [Agent Overview](../overview) - Learn more about the Agent's capabilities
- [Getting Started](../getting-started) - Start using the Agent effectively
- [Integrations](../integrations) - Connect with external services and tools

For specific integration guides and advanced usage scenarios, refer to our detailed documentation sections.
Loading