diff --git a/path/to/CONVENTIONS.md b/path/to/CONVENTIONS.md new file mode 100644 index 000000000..2763ec6e7 --- /dev/null +++ b/path/to/CONVENTIONS.md @@ -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 \ No newline at end of file diff --git a/path/to/graph-ui/src/api/rpc.ts b/path/to/graph-ui/src/api/rpc.ts new file mode 100644 index 000000000..664784dfd --- /dev/null +++ b/path/to/graph-ui/src/api/rpc.ts @@ -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 }; \ No newline at end of file diff --git a/path/to/install.ps1 b/path/to/install.ps1 new file mode 100644 index 000000000..e84c0b053 --- /dev/null +++ b/path/to/install.ps1 @@ -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 \ No newline at end of file diff --git a/path/to/install.sh b/path/to/install.sh new file mode 100644 index 000000000..d8056fc1d --- /dev/null +++ b/path/to/install.sh @@ -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 \ No newline at end of file