Skip to content
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
17 changes: 17 additions & 0 deletions path/to/CONVENTIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Conventions

## Aider Integration

To use Aider with codebase-memory-mcp, follow these steps:

1. Install the Aider integration by running `npm install @aider/ai`
2. Update the `graph-ui/src/api/rpc.ts` file to include the Aider integration
3. Run the installation script to complete the setup

## RPC API

The RPC API for Aider integration is defined in `graph-ui/src/api/rpc.ts`. It provides the following methods:

* `indexRepository()`: Indexes the repository
* `searchGraph(query: string)`: Searches the graph for a query
* `tracePath(query: string)`: Traces a path in the graph for a query
33 changes: 33 additions & 0 deletions path/to/graph-ui/src/api/rpc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* RPC API for Aider integration
*/
import { RPC } from './rpc';

interface AiderIntegration {
indexRepository: () => void;
searchGraph: (query: string) => void;
tracePath: (query: string) => void;
}

class AiderRPC extends RPC {
private aiderIntegration: AiderIntegration;

constructor(aiderIntegration: AiderIntegration) {
super();
this.aiderIntegration = aiderIntegration;
}

indexRepository(): void {
this.aiderIntegration.indexRepository();
}

searchGraph(query: string): void {
this.aiderIntegration.searchGraph(query);
}

tracePath(query: string): void {
this.aiderIntegration.tracePath(query);
}
}

export { AiderRPC };
12 changes: 12 additions & 0 deletions path/to/install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Add Aider integration to RPC API
$aiderIntegration = Get-Content -Path graph-ui/src/api/rpc.ts | Select-String -Pattern '(?<=AiderIntegration {).*?(?=})'
$aiderIntegration = $aiderIntegration.Matches.Value
$aiderIntegration = $aiderIntegration -replace '}$'
$aiderIntegration = " $aiderIntegration}"
$aiderIntegration = "}"
$aiderIntegration = "AiderIntegration { $aiderIntegration"

Set-Content -Path graph-ui/src/api/rpc.ts -Value ($aiderIntegration + (Get-Content -Path graph-ui/src/api/rpc.ts))

# Install Aider integration
npm install @aider/ai
8 changes: 8 additions & 0 deletions path/to/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# Add Aider integration to RPC API
AIDER_INTEGRATION=$(cat graph-ui/src/api/rpc.ts | grep -oP '(?<=AiderIntegration {).*?(?=})')
sed -i "s/}/\n$AIDER_INTEGRATION}/g" graph-ui/src/api/rpc.ts

# Install Aider integration
npm install @aider/ai
Loading