feat: add vector viz template and chunk context endpoint
Extracted vector visualization HTML template to separate file to resolve syntax conflicts between Jinja2, Alpine.js, and CSS. Added chunk context endpoint for fetching matched chunks with surrounding text. Changes: - Moved vector_viz.html to templates/ directory (separates Jinja2/Alpine.js/CSS) - Added /app/chunk-context endpoint for retrieving chunk text with context - Updated .dockerignore to include HTML files in Docker builds - Moved anthropic and boto3 to main dependencies (needed for production features) - Added jinja2 dependency for template rendering Fixes Jinja2 TemplateSyntaxError caused by CSS colons being parsed as Jinja2 syntax when template was inline in Python code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -5,3 +5,4 @@
|
|||||||
!uv.lock
|
!uv.lock
|
||||||
|
|
||||||
!nextcloud_mcp_server/**/*.py
|
!nextcloud_mcp_server/**/*.py
|
||||||
|
!nextcloud_mcp_server/**/*.html
|
||||||
|
|||||||
@@ -1478,6 +1478,7 @@ def get_app(transport: str = "sse", enabled_apps: list[str] | None = None):
|
|||||||
vector_sync_status_fragment,
|
vector_sync_status_fragment,
|
||||||
)
|
)
|
||||||
from nextcloud_mcp_server.auth.viz_routes import (
|
from nextcloud_mcp_server.auth.viz_routes import (
|
||||||
|
chunk_context_endpoint,
|
||||||
vector_visualization_html,
|
vector_visualization_html,
|
||||||
vector_visualization_search,
|
vector_visualization_search,
|
||||||
)
|
)
|
||||||
@@ -1509,6 +1510,11 @@ def get_app(transport: str = "sse", enabled_apps: list[str] | None = None):
|
|||||||
vector_visualization_search,
|
vector_visualization_search,
|
||||||
methods=["GET"],
|
methods=["GET"],
|
||||||
), # /app/vector-viz/search
|
), # /app/vector-viz/search
|
||||||
|
Route(
|
||||||
|
"/chunk-context",
|
||||||
|
chunk_context_endpoint,
|
||||||
|
methods=["GET"],
|
||||||
|
), # /app/chunk-context
|
||||||
# Webhook management routes (admin-only)
|
# Webhook management routes (admin-only)
|
||||||
Route("/webhooks", webhook_management_pane, methods=["GET"]), # /app/webhooks
|
Route("/webhooks", webhook_management_pane, methods=["GET"]), # /app/webhooks
|
||||||
Route(
|
Route(
|
||||||
|
|||||||
+5
-4
@@ -12,7 +12,7 @@ keywords = ["nextcloud", "mcp", "model-context-protocol", "llm", "ai", "claude",
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"mcp[cli] (>=1.21,<1.22)",
|
"mcp[cli] (>=1.21,<1.22)",
|
||||||
"httpx (>=0.28.1,<0.29.0)",
|
"httpx (>=0.28.1,<0.29.0)",
|
||||||
"pillow (>=10.3.0,<12.0.0)", # Compatible with fastembed
|
"pillow (>=10.3.0,<12.0.0)", # Compatible with fastembed
|
||||||
"icalendar (>=6.0.0,<7.0.0)",
|
"icalendar (>=6.0.0,<7.0.0)",
|
||||||
"pythonvcard4>=0.2.0",
|
"pythonvcard4>=0.2.0",
|
||||||
"pydantic>=2.11.4",
|
"pydantic>=2.11.4",
|
||||||
@@ -22,7 +22,9 @@ dependencies = [
|
|||||||
"aiosqlite>=0.20.0", # Async SQLite for refresh token storage
|
"aiosqlite>=0.20.0", # Async SQLite for refresh token storage
|
||||||
"authlib>=1.6.5",
|
"authlib>=1.6.5",
|
||||||
"qdrant-client>=1.7.0",
|
"qdrant-client>=1.7.0",
|
||||||
"fastembed>=0.4.2", # BM25 sparse vector embeddings for hybrid search
|
"fastembed>=0.4.2", # BM25 sparse vector embeddings for hybrid search
|
||||||
|
"anthropic>=0.42.0", # For RAG evaluation with Anthropic LLMs
|
||||||
|
"boto3>=1.35.0", # For Amazon Bedrock provider (optional)
|
||||||
# Observability dependencies
|
# Observability dependencies
|
||||||
"prometheus-client>=0.21.0", # Prometheus metrics
|
"prometheus-client>=0.21.0", # Prometheus metrics
|
||||||
"opentelemetry-api>=1.28.2", # OpenTelemetry API
|
"opentelemetry-api>=1.28.2", # OpenTelemetry API
|
||||||
@@ -32,6 +34,7 @@ dependencies = [
|
|||||||
"opentelemetry-instrumentation-logging>=0.49b2", # Logging integration
|
"opentelemetry-instrumentation-logging>=0.49b2", # Logging integration
|
||||||
"opentelemetry-exporter-otlp-proto-grpc>=1.28.2", # OTLP gRPC exporter
|
"opentelemetry-exporter-otlp-proto-grpc>=1.28.2", # OTLP gRPC exporter
|
||||||
"python-json-logger>=3.2.0", # Structured JSON logging
|
"python-json-logger>=3.2.0", # Structured JSON logging
|
||||||
|
"jinja2>=3.1.6",
|
||||||
]
|
]
|
||||||
classifiers = [
|
classifiers = [
|
||||||
"Development Status :: 4 - Beta",
|
"Development Status :: 4 - Beta",
|
||||||
@@ -103,8 +106,6 @@ module-root = ""
|
|||||||
|
|
||||||
[dependency-groups]
|
[dependency-groups]
|
||||||
dev = [
|
dev = [
|
||||||
"anthropic>=0.42.0", # For RAG evaluation with Anthropic LLMs
|
|
||||||
"boto3>=1.35.0", # For Amazon Bedrock provider (optional)
|
|
||||||
"commitizen>=4.8.2",
|
"commitizen>=4.8.2",
|
||||||
"datasets>=3.3.0", # For BeIR nfcorpus dataset loading
|
"datasets>=3.3.0", # For BeIR nfcorpus dataset loading
|
||||||
"ipython>=9.2.0",
|
"ipython>=9.2.0",
|
||||||
|
|||||||
@@ -1861,12 +1861,15 @@ version = "0.40.0"
|
|||||||
source = { editable = "." }
|
source = { editable = "." }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "aiosqlite" },
|
{ name = "aiosqlite" },
|
||||||
|
{ name = "anthropic" },
|
||||||
{ name = "authlib" },
|
{ name = "authlib" },
|
||||||
|
{ name = "boto3" },
|
||||||
{ name = "caldav" },
|
{ name = "caldav" },
|
||||||
{ name = "click" },
|
{ name = "click" },
|
||||||
{ name = "fastembed" },
|
{ name = "fastembed" },
|
||||||
{ name = "httpx" },
|
{ name = "httpx" },
|
||||||
{ name = "icalendar" },
|
{ name = "icalendar" },
|
||||||
|
{ name = "jinja2" },
|
||||||
{ name = "mcp", extra = ["cli"] },
|
{ name = "mcp", extra = ["cli"] },
|
||||||
{ name = "opentelemetry-api" },
|
{ name = "opentelemetry-api" },
|
||||||
{ name = "opentelemetry-exporter-otlp-proto-grpc" },
|
{ name = "opentelemetry-exporter-otlp-proto-grpc" },
|
||||||
@@ -1885,8 +1888,6 @@ dependencies = [
|
|||||||
|
|
||||||
[package.dev-dependencies]
|
[package.dev-dependencies]
|
||||||
dev = [
|
dev = [
|
||||||
{ name = "anthropic" },
|
|
||||||
{ name = "boto3" },
|
|
||||||
{ name = "commitizen" },
|
{ name = "commitizen" },
|
||||||
{ name = "datasets" },
|
{ name = "datasets" },
|
||||||
{ name = "ipython" },
|
{ name = "ipython" },
|
||||||
@@ -1904,12 +1905,15 @@ dev = [
|
|||||||
[package.metadata]
|
[package.metadata]
|
||||||
requires-dist = [
|
requires-dist = [
|
||||||
{ name = "aiosqlite", specifier = ">=0.20.0" },
|
{ name = "aiosqlite", specifier = ">=0.20.0" },
|
||||||
|
{ name = "anthropic", specifier = ">=0.42.0" },
|
||||||
{ name = "authlib", specifier = ">=1.6.5" },
|
{ name = "authlib", specifier = ">=1.6.5" },
|
||||||
|
{ name = "boto3", specifier = ">=1.35.0" },
|
||||||
{ name = "caldav", git = "https://github.com/cbcoutinho/caldav?branch=feature%2Fhttpx" },
|
{ name = "caldav", git = "https://github.com/cbcoutinho/caldav?branch=feature%2Fhttpx" },
|
||||||
{ name = "click", specifier = ">=8.1.8" },
|
{ name = "click", specifier = ">=8.1.8" },
|
||||||
{ name = "fastembed", specifier = ">=0.4.2" },
|
{ name = "fastembed", specifier = ">=0.4.2" },
|
||||||
{ name = "httpx", specifier = ">=0.28.1,<0.29.0" },
|
{ name = "httpx", specifier = ">=0.28.1,<0.29.0" },
|
||||||
{ name = "icalendar", specifier = ">=6.0.0,<7.0.0" },
|
{ name = "icalendar", specifier = ">=6.0.0,<7.0.0" },
|
||||||
|
{ name = "jinja2", specifier = ">=3.1.6" },
|
||||||
{ name = "mcp", extras = ["cli"], specifier = ">=1.21,<1.22" },
|
{ name = "mcp", extras = ["cli"], specifier = ">=1.21,<1.22" },
|
||||||
{ name = "opentelemetry-api", specifier = ">=1.28.2" },
|
{ name = "opentelemetry-api", specifier = ">=1.28.2" },
|
||||||
{ name = "opentelemetry-exporter-otlp-proto-grpc", specifier = ">=1.28.2" },
|
{ name = "opentelemetry-exporter-otlp-proto-grpc", specifier = ">=1.28.2" },
|
||||||
@@ -1928,8 +1932,6 @@ requires-dist = [
|
|||||||
|
|
||||||
[package.metadata.requires-dev]
|
[package.metadata.requires-dev]
|
||||||
dev = [
|
dev = [
|
||||||
{ name = "anthropic", specifier = ">=0.42.0" },
|
|
||||||
{ name = "boto3", specifier = ">=1.35.0" },
|
|
||||||
{ name = "commitizen", specifier = ">=4.8.2" },
|
{ name = "commitizen", specifier = ">=4.8.2" },
|
||||||
{ name = "datasets", specifier = ">=3.3.0" },
|
{ name = "datasets", specifier = ">=3.3.0" },
|
||||||
{ name = "ipython", specifier = ">=9.2.0" },
|
{ name = "ipython", specifier = ">=9.2.0" },
|
||||||
|
|||||||
Reference in New Issue
Block a user