chore(FEEDBACK-0001): linting
This commit is contained in:
78
README.md
78
README.md
@@ -38,13 +38,13 @@ TrueRef is under active development. The current codebase already includes:
|
||||
TrueRef is organized into four main layers:
|
||||
|
||||
1. Web UI
|
||||
SvelteKit application for adding repositories, monitoring indexing, searching content, and configuring embeddings.
|
||||
SvelteKit application for adding repositories, monitoring indexing, searching content, and configuring embeddings.
|
||||
2. REST API
|
||||
Endpoints under `/api/v1/*` for repository management, search, schema discovery, job status, and settings.
|
||||
Endpoints under `/api/v1/*` for repository management, search, schema discovery, job status, and settings.
|
||||
3. Indexing pipeline
|
||||
Crawlers, parsers, chunking logic, snippet storage, and optional embedding generation.
|
||||
Crawlers, parsers, chunking logic, snippet storage, and optional embedding generation.
|
||||
4. MCP server
|
||||
A thin compatibility layer that forwards `resolve-library-id` and `query-docs` requests to the TrueRef REST API.
|
||||
A thin compatibility layer that forwards `resolve-library-id` and `query-docs` requests to the TrueRef REST API.
|
||||
|
||||
At runtime, the app uses SQLite via `better-sqlite3` and Drizzle, plus optional embedding providers for semantic retrieval.
|
||||
|
||||
@@ -367,9 +367,9 @@ The tool names and argument shapes intentionally mirror context7 so existing wor
|
||||
The MCP server uses:
|
||||
|
||||
- `TRUEREF_API_URL`
|
||||
Base URL of the TrueRef web app. Default: `http://localhost:5173`
|
||||
Base URL of the TrueRef web app. Default: `http://localhost:5173`
|
||||
- `PORT`
|
||||
Used only for HTTP transport. Default: `3001`
|
||||
Used only for HTTP transport. Default: `3001`
|
||||
|
||||
### Start MCP over stdio
|
||||
|
||||
@@ -602,6 +602,7 @@ alwaysApply: true
|
||||
---
|
||||
|
||||
When answering questions about indexed libraries, always use the TrueRef MCP tools:
|
||||
|
||||
1. Call `resolve-library-id` with the library name and the user's question to get the library ID.
|
||||
2. Call `query-docs` with the library ID and question to retrieve relevant documentation.
|
||||
3. Use the returned documentation to answer accurately.
|
||||
@@ -614,9 +615,9 @@ Never rely on training data alone for library APIs that may have changed.
|
||||
Whether you are using VS Code, IntelliJ, or Claude Code, the expected retrieval flow is:
|
||||
|
||||
1. `resolve-library-id`
|
||||
Find the correct repository or version identifier.
|
||||
Find the correct repository or version identifier.
|
||||
2. `query-docs`
|
||||
Retrieve the actual documentation and code snippets for the user question.
|
||||
Retrieve the actual documentation and code snippets for the user question.
|
||||
|
||||
Example:
|
||||
|
||||
@@ -638,10 +639,10 @@ docker compose up --build
|
||||
|
||||
This builds the image and starts two services:
|
||||
|
||||
| Service | Default port | Purpose |
|
||||
|---------|-------------|---------|
|
||||
| `web` | `3000` | SvelteKit web UI and REST API |
|
||||
| `mcp` | `3001` | MCP HTTP server |
|
||||
| Service | Default port | Purpose |
|
||||
| ------- | ------------ | ----------------------------- |
|
||||
| `web` | `3000` | SvelteKit web UI and REST API |
|
||||
| `mcp` | `3001` | MCP HTTP server |
|
||||
|
||||
The SQLite database is stored in a named Docker volume (`trueref-data`) and persists across restarts.
|
||||
|
||||
@@ -687,10 +688,10 @@ services:
|
||||
- ${USERPROFILE:-$HOME}/.gitconfig:/root/.gitconfig:ro
|
||||
- ${CORP_CA_CERT}:/certs/corp-ca.crt:ro
|
||||
environment:
|
||||
BITBUCKET_HOST: "${BITBUCKET_HOST}"
|
||||
GITLAB_HOST: "${GITLAB_HOST}"
|
||||
GIT_TOKEN_BITBUCKET: "${GIT_TOKEN_BITBUCKET}"
|
||||
GIT_TOKEN_GITLAB: "${GIT_TOKEN_GITLAB}"
|
||||
BITBUCKET_HOST: '${BITBUCKET_HOST}'
|
||||
GITLAB_HOST: '${GITLAB_HOST}'
|
||||
GIT_TOKEN_BITBUCKET: '${GIT_TOKEN_BITBUCKET}'
|
||||
GIT_TOKEN_GITLAB: '${GIT_TOKEN_GITLAB}'
|
||||
```
|
||||
|
||||
5. **Start the services**:
|
||||
@@ -708,6 +709,7 @@ The Docker entrypoint script (`docker-entrypoint.sh`) runs these steps in order:
|
||||
3. **Configure git credentials**: Sets up per-host credential helpers that provide the correct username and token for each remote.
|
||||
|
||||
This setup works for:
|
||||
|
||||
- HTTPS cloning with personal access tokens
|
||||
- SSH cloning with mounted SSH keys
|
||||
- On-premise servers with custom CA certificates
|
||||
@@ -718,6 +720,7 @@ This setup works for:
|
||||
For long-lived deployments, SSH authentication is recommended:
|
||||
|
||||
1. Generate an SSH key pair if you don't have one:
|
||||
|
||||
```sh
|
||||
ssh-keygen -t ed25519 -C "trueref@your-company.com"
|
||||
```
|
||||
@@ -727,6 +730,7 @@ For long-lived deployments, SSH authentication is recommended:
|
||||
- GitLab: User Settings → SSH Keys
|
||||
|
||||
3. Ensure your `~/.ssh/config` has the correct host entries:
|
||||
|
||||
```
|
||||
Host bitbucket.corp.example.com
|
||||
IdentityFile ~/.ssh/id_ed25519
|
||||
@@ -737,13 +741,13 @@ For long-lived deployments, SSH authentication is recommended:
|
||||
|
||||
### Environment variables
|
||||
|
||||
| Variable | Default | Description |
|
||||
|----------|---------|-------------|
|
||||
| `DATABASE_URL` | `/data/trueref.db` | Path to the SQLite database inside the container |
|
||||
| `PORT` | `3000` | Port the web app listens on |
|
||||
| `HOST` | `0.0.0.0` | Bind address for the web app |
|
||||
| Variable | Default | Description |
|
||||
| ----------------- | ----------------------- | -------------------------------------------------- |
|
||||
| `DATABASE_URL` | `/data/trueref.db` | Path to the SQLite database inside the container |
|
||||
| `PORT` | `3000` | Port the web app listens on |
|
||||
| `HOST` | `0.0.0.0` | Bind address for the web app |
|
||||
| `TRUEREF_API_URL` | `http://localhost:3000` | Base URL the MCP server uses to reach the REST API |
|
||||
| `MCP_PORT` | `3001` | Port the MCP HTTP server listens on |
|
||||
| `MCP_PORT` | `3001` | Port the MCP HTTP server listens on |
|
||||
|
||||
Override them in `docker-compose.yml` or pass them with `-e` flags.
|
||||
|
||||
@@ -770,12 +774,12 @@ Once both containers are running, point VS Code at the MCP HTTP endpoint:
|
||||
|
||||
```json
|
||||
{
|
||||
"servers": {
|
||||
"trueref": {
|
||||
"type": "http",
|
||||
"url": "http://localhost:3001/mcp"
|
||||
}
|
||||
}
|
||||
"servers": {
|
||||
"trueref": {
|
||||
"type": "http",
|
||||
"url": "http://localhost:3001/mcp"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -783,12 +787,12 @@ Once both containers are running, point VS Code at the MCP HTTP endpoint:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"trueref": {
|
||||
"type": "http",
|
||||
"url": "http://localhost:3001/mcp"
|
||||
}
|
||||
}
|
||||
"mcpServers": {
|
||||
"trueref": {
|
||||
"type": "http",
|
||||
"url": "http://localhost:3001/mcp"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -806,10 +810,10 @@ Verify the connection inside Claude Code:
|
||||
|
||||
### Health checks
|
||||
|
||||
| Endpoint | Expected response |
|
||||
|----------|------------------|
|
||||
| Endpoint | Expected response |
|
||||
| ----------------------------------- | ------------------------------- |
|
||||
| `http://localhost:3000/api/v1/libs` | JSON array of indexed libraries |
|
||||
| `http://localhost:3001/ping` | `{"ok":true}` |
|
||||
| `http://localhost:3001/ping` | `{"ok":true}` |
|
||||
|
||||
### Mounting a local repository
|
||||
|
||||
|
||||
Reference in New Issue
Block a user