Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors
Rust
fix(web): replace bloated logo PNG and serve favicon
pedrofjrc57656297db6
diff --git a/README.md b/README.mdindex d5132b5f..e76b0d33 100644--- a/README.md+++ b/README.md@@ -1,7 +1,7 @@<p align="center"><picture><source media="(prefers-color-scheme: dark)" srcset="docs/logo-dark.png">- <img alt="ai-memory" src="docs/logo.png" width="480">+ <img alt="ai-memory" src="docs/logo-light.png" width="480"></picture></p>diff --git a/crates/ai-memory-web/src/lib.rs b/crates/ai-memory-web/src/lib.rsindex 586d1fcb..7e98f37e 100644--- a/crates/ai-memory-web/src/lib.rs+++ b/crates/ai-memory-web/src/lib.rs@@ -12,7 +12,7 @@//! - `GET /w/:workspace/:project` → page tree + recent activity//! - `GET /w/:workspace/:project/p/*path` → rendered markdown + metadata//! - `GET /search?q=…` → FTS5 hit list-//! - `GET /static/*` → embedded CSS + logos+//! - `GET /static/*` → embedded CSS + logo//!//! The companion `api_router` exposes the same read-only data as JSON//! for custom frontends. It intentionally does not expose write/admindiff --git a/crates/ai-memory-web/src/routes/mod.rs b/crates/ai-memory-web/src/routes/mod.rsindex 3e675d8d..608c7a3b 100644--- a/crates/ai-memory-web/src/routes/mod.rs+++ b/crates/ai-memory-web/src/routes/mod.rs@@ -22,8 +22,8 @@ pub(crate) fn build(state: Arc<WebState>) -> Router {.route("/w/{workspace}/{project}/p/{*path}", get(page::handler)).route("/search", get(search::handler)).route("/static/tailwind.css", get(statics::tailwind_css))- .route("/static/logo.png", get(statics::logo_light))- .route("/static/logo-dark.png", get(statics::logo_dark))+ .route("/static/logo.png", get(statics::logo))+ .route("/favicon.ico", get(statics::favicon)).with_state(state)}diff --git a/crates/ai-memory-web/src/routes/statics.rs b/crates/ai-memory-web/src/routes/statics.rsindex 6b3161b7..7a4f1201 100644--- a/crates/ai-memory-web/src/routes/statics.rs+++ b/crates/ai-memory-web/src/routes/statics.rs@@ -1,4 +1,4 @@-//! Static asset handlers: Tailwind CSS and logo images.+//! Static asset handlers: Tailwind CSS and logo image.//!//! Assets are embedded at compile time so the binary is fully//! self-contained — no runtime file access needed.@@ -10,11 +10,8 @@ use axum::response::IntoResponse;/// `AI_MEMORY_WEB_TAILWIND_CSS` cargo env var.static TAILWIND_CSS: &str = include_str!(env!("AI_MEMORY_WEB_TAILWIND_CSS"));-/// Light-mode logo (PNG).-static LOGO_LIGHT: &[u8] = include_bytes!("../../../../docs/logo.png");--/// Dark-mode logo (PNG).-static LOGO_DARK: &[u8] = include_bytes!("../../../../docs/logo-dark.png");+/// Logo (PNG), embedded at compile time from `docs/logo.png`.+static LOGO: &[u8] = include_bytes!("../../../../docs/logo.png");/// `GET /static/tailwind.css`pub(crate) async fn tailwind_css() -> impl IntoResponse {@@ -27,15 +24,17 @@ pub(crate) async fn tailwind_css() -> impl IntoResponse {}/// `GET /static/logo.png`-pub(crate) async fn logo_light() -> impl IntoResponse {- let mut headers = HeaderMap::new();- headers.insert(header::CONTENT_TYPE, HeaderValue::from_static("image/png"));- (StatusCode::OK, headers, LOGO_LIGHT)+pub(crate) async fn logo() -> impl IntoResponse {+ png_response(LOGO)+}++/// `GET /favicon.ico` — same PNG as the header logo (browsers request this path by default).+pub(crate) async fn favicon() -> impl IntoResponse {+ png_response(LOGO)}-/// `GET /static/logo-dark.png`-pub(crate) async fn logo_dark() -> impl IntoResponse {+fn png_response(bytes: &'static [u8]) -> (StatusCode, HeaderMap, &'static [u8]) {let mut headers = HeaderMap::new();headers.insert(header::CONTENT_TYPE, HeaderValue::from_static("image/png"));- (StatusCode::OK, headers, LOGO_DARK)+ (StatusCode::OK, headers, bytes)}diff --git a/crates/ai-memory-web/templates/base.html b/crates/ai-memory-web/templates/base.htmlindex db5c31d0..24fc8a64 100644--- a/crates/ai-memory-web/templates/base.html+++ b/crates/ai-memory-web/templates/base.html@@ -4,16 +4,14 @@<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>{% block title %}ai-memory{% endblock %}</title>+ <link rel="icon" href="static/logo.png" type="image/png"><link rel="stylesheet" href="static/tailwind.css"></head><body class="min-h-full bg-white text-slate-900 dark:bg-slate-950 dark:text-slate-100"><header class="border-b border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-950 sticky top-0 z-10"><div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 flex items-center gap-4 h-14"><a href="." class="flex items-center gap-2 shrink-0">- <picture>- <source media="(prefers-color-scheme: dark)" srcset="static/logo-dark.png">- <img src="static/logo.png" alt="ai-memory logo" class="h-7 w-auto">- </picture>+ <img src="static/logo.png" alt="ai-memory logo" class="h-7 w-auto"><span class="font-semibold text-slate-800 dark:text-slate-100 text-sm hidden sm:inline">ai-memory</span></a><div class="flex-1"></div>diff --git a/docs/logo-light.png b/docs/logo-light.pngnew file mode 100644index 00000000..e4ff2908Binary files /dev/null and b/docs/logo-light.png differdiff --git a/docs/logo.png b/docs/logo.pngindex e4ff2908..4ec89ee3 100644Binary files a/docs/logo.png and b/docs/logo.png differ