Skip to content

Commit 8369656

Browse files
author
GitHub Agent
committed
Solution for #1032: Aider CONVENTIONS.md
1 parent ae95649 commit 8369656

4 files changed

Lines changed: 70 additions & 0 deletions

File tree

path/to/CONVENTIONS.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Conventions
2+
3+
## Aider Integration
4+
5+
To use Aider with codebase-memory-mcp, follow these steps:
6+
7+
1. Install the Aider integration by running `npm install @aider/ai`
8+
2. Update the `graph-ui/src/api/rpc.ts` file to include the Aider integration
9+
3. Run the installation script to complete the setup
10+
11+
## RPC API
12+
13+
The RPC API for Aider integration is defined in `graph-ui/src/api/rpc.ts`. It provides the following methods:
14+
15+
* `indexRepository()`: Indexes the repository
16+
* `searchGraph(query: string)`: Searches the graph for a query
17+
* `tracePath(query: string)`: Traces a path in the graph for a query

path/to/graph-ui/src/api/rpc.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* RPC API for Aider integration
3+
*/
4+
import { RPC } from './rpc';
5+
6+
interface AiderIntegration {
7+
indexRepository: () => void;
8+
searchGraph: (query: string) => void;
9+
tracePath: (query: string) => void;
10+
}
11+
12+
class AiderRPC extends RPC {
13+
private aiderIntegration: AiderIntegration;
14+
15+
constructor(aiderIntegration: AiderIntegration) {
16+
super();
17+
this.aiderIntegration = aiderIntegration;
18+
}
19+
20+
indexRepository(): void {
21+
this.aiderIntegration.indexRepository();
22+
}
23+
24+
searchGraph(query: string): void {
25+
this.aiderIntegration.searchGraph(query);
26+
}
27+
28+
tracePath(query: string): void {
29+
this.aiderIntegration.tracePath(query);
30+
}
31+
}
32+
33+
export { AiderRPC };

path/to/install.ps1

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Add Aider integration to RPC API
2+
$aiderIntegration = Get-Content -Path graph-ui/src/api/rpc.ts | Select-String -Pattern '(?<=AiderIntegration {).*?(?=})'
3+
$aiderIntegration = $aiderIntegration.Matches.Value
4+
$aiderIntegration = $aiderIntegration -replace '}$'
5+
$aiderIntegration = " $aiderIntegration}"
6+
$aiderIntegration = "}"
7+
$aiderIntegration = "AiderIntegration { $aiderIntegration"
8+
9+
Set-Content -Path graph-ui/src/api/rpc.ts -Value ($aiderIntegration + (Get-Content -Path graph-ui/src/api/rpc.ts))
10+
11+
# Install Aider integration
12+
npm install @aider/ai

path/to/install.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
# Add Aider integration to RPC API
4+
AIDER_INTEGRATION=$(cat graph-ui/src/api/rpc.ts | grep -oP '(?<=AiderIntegration {).*?(?=})')
5+
sed -i "s/}/\n$AIDER_INTEGRATION}/g" graph-ui/src/api/rpc.ts
6+
7+
# Install Aider integration
8+
npm install @aider/ai

0 commit comments

Comments
 (0)