Spaces:
Running
Running
Merge 003-chatgpt-app-integration into master - resolve conflicts
Browse files- .gitignore +3 -0
- CLAUDE.md +1 -1
- backend/src/api/routes/index.py +4 -1
- backend/src/mcp/server.py +0 -1
- backend/src/services/seed.py +1 -1
.gitignore
CHANGED
|
@@ -72,4 +72,7 @@ Ai-notes/
|
|
| 72 |
*.jpg
|
| 73 |
*.jpeg
|
| 74 |
*.gif
|
|
|
|
|
|
|
| 75 |
AUDIT_REPORT.md
|
|
|
|
|
|
| 72 |
*.jpg
|
| 73 |
*.jpeg
|
| 74 |
*.gif
|
| 75 |
+
|
| 76 |
+
# Generated reports
|
| 77 |
AUDIT_REPORT.md
|
| 78 |
+
BACKEND_AUDIT_REPORT.md
|
CLAUDE.md
CHANGED
|
@@ -107,7 +107,7 @@ uv run python -c "from src.services.database import DatabaseService; DatabaseSer
|
|
| 107 |
- `database.py`: SQLite connection manager + schema DDL
|
| 108 |
|
| 109 |
3. **API/MCP** (`backend/src/api/` and `backend/src/mcp/`):
|
| 110 |
-
- `api/routes/`: FastAPI endpoints (
|
| 111 |
- `api/middleware/auth_middleware.py`: JWT Bearer token validation
|
| 112 |
- `mcp/server.py`: FastMCP tools (7 tools: list, read, write, delete, search, backlinks, tags)
|
| 113 |
|
|
|
|
| 107 |
- `database.py`: SQLite connection manager + schema DDL
|
| 108 |
|
| 109 |
3. **API/MCP** (`backend/src/api/` and `backend/src/mcp/`):
|
| 110 |
+
- `api/routes/`: FastAPI endpoints (18 routes: auth, notes CRUD, search, backlinks, tags, index health/rebuild, graph, demo, system)
|
| 111 |
- `api/middleware/auth_middleware.py`: JWT Bearer token validation
|
| 112 |
- `mcp/server.py`: FastMCP tools (7 tools: list, read, write, delete, search, backlinks, tags)
|
| 113 |
|
backend/src/api/routes/index.py
CHANGED
|
@@ -3,9 +3,12 @@
|
|
| 3 |
from __future__ import annotations
|
| 4 |
|
| 5 |
from datetime import datetime
|
|
|
|
| 6 |
import time
|
| 7 |
|
| 8 |
from fastapi import APIRouter, Depends, HTTPException
|
|
|
|
|
|
|
| 9 |
from pydantic import BaseModel
|
| 10 |
|
| 11 |
from ...models.index import IndexHealth
|
|
@@ -120,7 +123,7 @@ async def rebuild_index(auth: AuthContext = Depends(get_auth_context)):
|
|
| 120 |
indexer_service.index_note(user_id, note_data)
|
| 121 |
indexed_count += 1
|
| 122 |
except Exception as e:
|
| 123 |
-
|
| 124 |
|
| 125 |
# Update index health
|
| 126 |
conn = db_service.connect()
|
|
|
|
| 3 |
from __future__ import annotations
|
| 4 |
|
| 5 |
from datetime import datetime
|
| 6 |
+
import logging
|
| 7 |
import time
|
| 8 |
|
| 9 |
from fastapi import APIRouter, Depends, HTTPException
|
| 10 |
+
|
| 11 |
+
logger = logging.getLogger(__name__)
|
| 12 |
from pydantic import BaseModel
|
| 13 |
|
| 14 |
from ...models.index import IndexHealth
|
|
|
|
| 123 |
indexer_service.index_note(user_id, note_data)
|
| 124 |
indexed_count += 1
|
| 125 |
except Exception as e:
|
| 126 |
+
logger.error(f"Failed to index {note['path']}: {e}")
|
| 127 |
|
| 128 |
# Update index health
|
| 129 |
conn = db_service.connect()
|
backend/src/mcp/server.py
CHANGED
|
@@ -172,7 +172,6 @@ def read_note(
|
|
| 172 |
..., description="Relative '.md' path ≤256 chars (no '..' or '\\')."
|
| 173 |
),
|
| 174 |
) -> dict:
|
| 175 |
-
print(f"!!! READ_NOTE CALLED: {path} !!!", flush=True)
|
| 176 |
start_time = time.time()
|
| 177 |
user_id = _current_user_id()
|
| 178 |
|
|
|
|
| 172 |
..., description="Relative '.md' path ≤256 chars (no '..' or '\\')."
|
| 173 |
),
|
| 174 |
) -> dict:
|
|
|
|
| 175 |
start_time = time.time()
|
| 176 |
user_id = _current_user_id()
|
| 177 |
|
backend/src/services/seed.py
CHANGED
|
@@ -270,7 +270,7 @@ For **HTTP mode** (HF Space), use:
|
|
| 270 |
{
|
| 271 |
"mcpServers": {
|
| 272 |
"obsidian-docs": {
|
| 273 |
-
"url": "https://
|
| 274 |
"headers": {
|
| 275 |
"Authorization": "Bearer YOUR_JWT_TOKEN"
|
| 276 |
}
|
|
|
|
| 270 |
{
|
| 271 |
"mcpServers": {
|
| 272 |
"obsidian-docs": {
|
| 273 |
+
"url": "https://YOUR_USERNAME-Document-MCP.hf.space/mcp",
|
| 274 |
"headers": {
|
| 275 |
"Authorization": "Bearer YOUR_JWT_TOKEN"
|
| 276 |
}
|