Skip to content

Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors

Rust

feat(web): show pending cross-project mail in the web UI

Peterson Salmed7ae7f4a9bf3
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f5a41ded..51d95da8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
+- The web UI shows pending cross-project mail. Project cards carry an amber
+ `N inbox` badge when messages are waiting for an agent in that project, the
+ home page summarises the total and links the projects holding mail, and the
+ project page gains a read-only Mailbox section listing up to five of them
+ (subject, sender, a snippet, age; "5 of N" when more are waiting), with an
+ empty state when there are none. A sender the viewer may not read is shown as
+ "a project you cannot read", and the page never pops or cancels a message.
- `install-mcp --client prime-agent` registers ai-memory with Prime Agent
(PrimeIntellect-ai/prime-agent), merging an HTTP entry into the `mcpServers`
map of `$PRIME_AGENT_CODING_AGENT_DIR/settings.json` (default
diff --git a/crates/ai-memory-store/src/lib.rs b/crates/ai-memory-store/src/lib.rs
index 5290cfd6..7c902338 100644
--- a/crates/ai-memory-store/src/lib.rs
+++ b/crates/ai-memory-store/src/lib.rs
@@ -86,9 +86,9 @@ pub use reader::{
AutoImproveParkedClaim, BriefPageBody, BriefingPage, BriefingSnapshot, ClientActivity,
ContaminationFinding, ContaminationReport, ContaminationSummary, ContradictionEdge,
DecayCandidate, DecayTombstone, DerivedIndexStatus, EmbeddingTripleCount, FeedbackFinding,
- GraphVia, HealthDetail, HealthPage, ObservationHit, ObservationOrder, ObservationPage,
- ObservationPageResult, ObservationRecord, OpenSession, PageAuthor, PageHit, PageHitWithMeta,
- PageLinks, PageMeta, PageSummary, ProjectCoordinateCollisionReason,
+ GraphVia, HealthDetail, HealthPage, InboxCount, InboxEntry, ObservationHit, ObservationOrder,
+ ObservationPage, ObservationPageResult, ObservationRecord, OpenSession, PageAuthor, PageHit,
+ PageHitWithMeta, PageLinks, PageMeta, PageSummary, ProjectCoordinateCollisionReason,
ProjectCoordinateDiagnostic, ProjectCoordinateStatus, ProjectSummary, RELATED_WALK_MAX_DEPTH,
RELATED_WALK_MAX_NODES, ReaderPool, ReindexTargetStatus, RelatedNode, RelatedPage,
RrfContributions, ScopeRow, SearchExplain, SessionConsolidationSummary, SessionDependentRows,
diff --git a/crates/ai-memory-store/src/reader.rs b/crates/ai-memory-store/src/reader.rs
index 30e1c360..64567abb 100644
--- a/crates/ai-memory-store/src/reader.rs
+++ b/crates/ai-memory-store/src/reader.rs
@@ -1462,6 +1462,31 @@ pub struct ProjectSummary {
pub last_updated: Option<String>,
}
+/// Pending inbox depth for one recipient project. Returned by
+/// [`ReaderPool::pending_inbox_counts`]; projects with nothing pending have no
+/// row.
+#[derive(Debug, Clone, PartialEq, Eq)]
+pub struct InboxCount {
+ /// Name of the recipient workspace.
+ pub workspace_name: String,
+ /// Name of the recipient project.
+ pub project_name: String,
+ /// Number of `pending` messages addressed to it.
+ pub pending: u64,
+}
+
+/// A pending inbox message with its sender named for display. Returned by
+/// [`ReaderPool::list_inbox_with_senders`].
+#[derive(Debug, Clone)]
+pub struct InboxEntry {
+ /// The message row.
+ pub message: AgentMessage,
+ /// `(workspace, project)` names of the sender, or `None` when the viewer
+ /// may not read the sender's repository (or it no longer exists). A
+ /// repository's name is itself what a restricted project hides.
+ pub sender: Option<(String, String)>,
+}
+
/// One workspace scope with the id + name needed to write its
/// self-describing `_meta.md` manifest. Returned by
/// [`ReaderPool::list_all_workspace_scopes`].
@@ -6148,6 +6173,102 @@ impl ReaderPool {
.await
}
+ /// Count pending messages per recipient project, in one grouped query.
+ ///
+ /// Backs the web project cards, which would otherwise pay one
+ /// [`Self::pending_message_count`] per card. `viewer` filters recipients
+ /// like [`Self::list_projects_with_stats`], so a repository the viewer may
+ /// not read gets no row either.
+ ///
+ /// # Errors
+ /// Propagates any SQL or pool error.
+ pub async fn pending_inbox_counts(
+ &self,
+ viewer: Option<UserId>,
+ ) -> StoreResult<Vec<InboxCount>> {
+ self.with_conn(move |conn| {
+ let visible = readable_repository_predicate("p.id", viewer);
+ let mut stmt = conn.prepare(&format!(
+ "SELECT w.name, p.name, COUNT(*) \
+ FROM agent_messages m \
+ JOIN projects p ON p.id = m.to_project_id AND p.workspace_id = m.to_workspace_id \
+ JOIN workspaces w ON w.id = p.workspace_id \
+ WHERE m.state = 'pending'{visible} \
+ GROUP BY p.id"
+ ))?;
+ let rows = stmt.query_map([], |row| {
+ let pending: i64 = row.get(2)?;
+ Ok(InboxCount {
+ workspace_name: row.get(0)?,
+ project_name: row.get(1)?,
+ pending: u64::try_from(pending).unwrap_or(0),
+ })
+ })?;
+ let mut out = Vec::new();
+ for row in rows {
+ out.push(row?);
+ }
+ Ok(out)
+ })
+ .await
+ }
+
+ /// List a project's pending inbox with each sender named for display,
+ /// oldest first, capped at `limit`.
+ ///
+ /// The sender's names come back only when `viewer` may read the sender's
+ /// repository: the recipient is entitled to the message, not to learn the
+ /// name of a restricted project it came from. See
+ /// [`Self::list_messages`] for the unnamed form agents use.
+ ///
+ /// # Errors
+ /// Propagates any SQL or pool error.
+ pub async fn list_inbox_with_senders(
+ &self,
+ workspace_id: WorkspaceId,
+ project_id: ProjectId,
+ viewer: Option<UserId>,
+ limit: usize,
+ ) -> StoreResult<Vec<InboxEntry>> {
+ let limit = limit.clamp(1, 200);
+ self.with_conn(move |conn| {
+ let sender_visible = readable_repository_predicate("sp.id", viewer);
+ let columns = crate::ops::MESSAGE_COLUMNS
+ .split(',')
+ .map(|column| format!("m.{}", column.trim()))
+ .collect::<Vec<_>>()
+ .join(", ");
+ let mut stmt = conn.prepare(&format!(
+ "SELECT {columns}, sw.name, sp.name \
+ FROM agent_messages m \
+ LEFT JOIN projects sp ON sp.id = m.from_project_id \
+ AND sp.workspace_id = m.from_workspace_id{sender_visible} \
+ LEFT JOIN workspaces sw ON sw.id = sp.workspace_id \
+ WHERE m.to_workspace_id = ?1 AND m.to_project_id = ?2 AND m.state = 'pending' \
+ ORDER BY m.created_at ASC LIMIT {limit}"
+ ))?;
+ let rows = stmt.query_map(
+ params![workspace_id.as_bytes(), project_id.as_bytes()],
+ |row| {
+ let message = crate::ops::row_to_agent_message(row)?;
+ let workspace: Option<String> = row.get(12)?;
+ let project: Option<String> = row.get(13)?;
+ Ok((message, workspace.zip(project)))
+ },
+ )?;
+ let mut out = Vec::new();
+ for row in rows {
+ let (message, sender) = row?;
+ out.push(InboxEntry {
+ message: message?,
+ sender,
+ });
+ }
+ Ok(out)
+ })
+ .await
+ }
+
/// Count pending messages addressed to a project's inbox (V64). Backs the
/// on-start inbox notice and `memory_briefing`'s `pending_message_count`.
///
diff --git a/crates/ai-memory-web/src/routes/index.rs b/crates/ai-memory-web/src/routes/index.rs
index 10caca2f..d901c101 100644
--- a/crates/ai-memory-web/src/routes/index.rs
+++ b/crates/ai-memory-web/src/routes/index.rs
@@ -1,5 +1,6 @@
//! `GET /` — project list cards.
+use std::collections::HashMap;
use std::sync::Arc;
use askama::Template;
@@ -8,7 +9,12 @@ use axum::http::StatusCode;
use axum::response::Html;
use crate::state::WebState;
-use crate::templates::{OkfDialog, ProjectCard, ProjectsView, humanize, project_href};
+use crate::templates::{
+ MailSummaryItem, OkfDialog, ProjectCard, ProjectsView, humanize, project_href,
+};
+
+/// Projects the home page's mail summary names before saying "and N more".
+const MAIL_SUMMARY_PROJECTS: usize = 5;
/// Handler for `GET /`.
///
@@ -19,31 +25,73 @@ pub(crate) async fn handler(
State(state): State<Arc<WebState>>,
viewer: Option<axum::Extension<ai_memory_core::AuthorizedViewer>>,
) -> Result<Html<String>, StatusCode> {
+ let viewer_id = viewer.map(|axum::Extension(viewer)| viewer.user());
let summaries = state
.reader
- .list_projects_with_stats(viewer.map(|axum::Extension(viewer)| viewer.user()))
+ .list_projects_with_stats(viewer_id)
.await
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
- let projects = summaries
+ // One grouped query for every card; the badge shows only where mail waits.
+ let pending: HashMap<(String, String), u64> = state
+ .reader
+ .pending_inbox_counts(viewer_id)
+ .await
+ .map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?
+ .into_iter()
+ .map(|c| ((c.workspace_name, c.project_name), c.pending))
+ .collect();
+
+ let projects: Vec<ProjectCard> = summaries
.into_iter()
.map(|s| {
let last_updated_relative = s.last_updated.as_deref().map(humanize).unwrap_or_default();
let href = project_href(&s.workspace_name, &s.project_name);
+ let pending_inbox = pending
+ .get(&(s.workspace_name.clone(), s.project_name.clone()))
+ .copied()
+ .unwrap_or(0);
ProjectCard {
workspace: s.workspace_name,
project: s.project_name,
page_count: s.page_count,
last_updated_relative,
+ pending_inbox,
href,
}
})
.collect();
+ // The summary reads from the cards the viewer may see, so it can never
+ // name a project the grid below it does not.
+ let mut with_mail: Vec<&ProjectCard> = projects
+ .iter()
+ .filter(|card| card.pending_inbox > 0)
+ .collect();
+ with_mail.sort_by(|a, b| {
+ b.pending_inbox
+ .cmp(&a.pending_inbox)
+ .then_with(|| a.project.cmp(&b.project))
+ });
+ let mail_total: u64 = with_mail.iter().map(|card| card.pending_inbox).sum();
+ let mail_hidden = with_mail.len().saturating_sub(MAIL_SUMMARY_PROJECTS);
+ let mail_projects = with_mail
+ .into_iter()
+ .take(MAIL_SUMMARY_PROJECTS)
+ .map(|card| MailSummaryItem {
+ label: format!("{}/{}", card.workspace, card.project),
+ href: card.href.clone(),
+ pending: card.pending_inbox,
+ })
+ .collect();
+
let okf_dialog = okf_dialog(&state);
let html = ProjectsView {
projects,
okf_dialog,
+ mail_total,
+ mail_projects,
+ mail_hidden,
}
.render()
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
diff --git a/crates/ai-memory-web/src/routes/project.rs b/crates/ai-memory-web/src/routes/project.rs
index 8e93ecee..7caf7026 100644
--- a/crates/ai-memory-web/src/routes/project.rs
+++ b/crates/ai-memory-web/src/routes/project.rs
@@ -9,7 +9,15 @@ use axum::http::StatusCode;
use axum::response::{Html, IntoResponse, Response};
use crate::state::WebState;
-use crate::templates::{Folder, PageRow, ProjectView, humanize, page_href};
+use crate::templates::{
+ Folder, MailboxRow, PageRow, ProjectView, humanize, page_href, project_href,
+};
+
+/// Pending messages listed on the project page before it says there are more.
+const MAILBOX_LIMIT: usize = 5;
+
+/// Leading body characters shown per message.
+const SNIPPET_CHARS: usize = 160;
/// Handler for `GET /w/:workspace/:project`.
pub(crate) async fn handler(
@@ -17,16 +25,20 @@ pub(crate) async fn handler(
viewer: Option<axum::Extension<ai_memory_core::AuthorizedViewer>>,
Path((workspace, project)): Path<(String, String)>,
) -> Response {
+ let viewer_id = viewer.as_ref().map(|axum::Extension(viewer)| viewer.user());
if let Err(refusal) = super::authorize_read(&state, viewer, &workspace, &project).await {
return super::page::refusal_response(&refusal);
}
- render(&state, workspace, project).await.into_response()
+ render(&state, workspace, project, viewer_id)
+ .await
+ .into_response()
}
async fn render(
state: &WebState,
workspace: String,
project: String,
+ viewer: Option<ai_memory_core::UserId>,
) -> Result<Html<String>, StatusCode> {
let pages = state
.reader
@@ -100,18 +112,87 @@ async fn render(
})
.collect();
+ let (mailbox, mailbox_total) = mailbox(state, &workspace, &project, viewer).await?;
+
+ let mailbox_capped = mailbox_total > mailbox.len() as u64;
let html = ProjectView {
workspace,
project,
folders,
system,
recent,
+ mailbox,
+ mailbox_total,
+ mailbox_capped,
}
.render()
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
Ok(Html(html))
}
+/// The project's pending inbox, read-only: this page never pops or cancels,
+/// so the claim-once queue stays the agents' alone.
+///
+/// Returns the rows to list and how many messages are pending in all, so the
+/// page can say "5 of 12" rather than hide the rest. The route has
+/// already authorized the viewer for this project; sender names are filtered
+/// again per row in the store.
+async fn mailbox(
+ state: &WebState,
+ workspace: &str,
+ project: &str,
+ viewer: Option<ai_memory_core::UserId>,
+) -> Result<(Vec<MailboxRow>, u64), StatusCode> {
+ let scope = ai_memory_store::lookup_existing_scope(&state.reader, workspace, project)
+ .await
+ .map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
+ let entries = state
+ .reader
+ .list_inbox_with_senders(scope.workspace_id, scope.project_id, viewer, MAILBOX_LIMIT)
+ .await
+ .map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
+ let total = state
+ .reader
+ .pending_message_count(scope.workspace_id, scope.project_id)
+ .await
+ .map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?
+ .max(entries.len() as u64);
+ let rows = entries
+ .into_iter()
+ .map(|entry| {
+ let (sender, sender_href) = match entry.sender {
+ Some((workspace, project)) => (
+ format!("{workspace}/{project}"),
+ Some(project_href(&workspace, &project)),
+ ),
+ None => ("a project you cannot read".to_owned(), None),
+ };
+ MailboxRow {
+ subject: entry
+ .message
+ .subject
+ .filter(|subject| !subject.trim().is_empty())
+ .unwrap_or_else(|| "(no subject)".to_owned()),
+ sender,
+ sender_href,
+ snippet: snippet(&entry.message.body),
+ created_relative: humanize(&entry.message.created_at.to_string()),
+ }
+ })
+ .collect();
+ Ok((rows, total))
+}
+
+/// First [`SNIPPET_CHARS`] characters of `body` on one line.
+fn snippet(body: &str) -> String {
+ let flat = body.split_whitespace().collect::<Vec<_>>().join(" ");
+ if flat.chars().count() <= SNIPPET_CHARS {
+ return flat;
+ }
+ let cut: String = flat.chars().take(SNIPPET_CHARS).collect();
+ format!("{cut}…")
+}
+
/// Machinery rather than knowledge: hidden from Recent Activity and
/// collapsed into the sidebar's System section. Underscore-prefixed
/// trees are system surfaces — except `_rules`, which holds standing
diff --git a/crates/ai-memory-web/src/templates.rs b/crates/ai-memory-web/src/templates.rs
index f892a1e4..05e1a1e3 100644
--- a/crates/ai-memory-web/src/templates.rs
+++ b/crates/ai-memory-web/src/templates.rs
@@ -112,10 +112,23 @@ pub(crate) struct ProjectCard {
pub page_count: u64,
/// Humanised timestamp (e.g. "3 hours ago"), or empty string.
pub last_updated_relative: String,
+ /// Messages from other projects waiting for an agent here; `0` hides the
+ /// badge.
+ pub pending_inbox: u64,
/// Link target (`w/{ws}/{proj}`, relative to `<base href>`).
pub href: String,
}
+/// One project named in the home page's pending-mail summary.
+pub(crate) struct MailSummaryItem {
+ /// `workspace/project`.
+ pub label: String,
+ /// Link target (`w/{ws}/{proj}`, relative to `<base href>`).
+ pub href: String,
+ /// Pending messages waiting there.
+ pub pending: u64,
+}
+
/// The one-time 2.0 migration explainer dialog (docs/okf.md): shown
/// whenever a migration receipt exists, dismissed per browser via a
/// "do not show me again" checkbox persisted in localStorage keyed by
@@ -140,6 +153,13 @@ pub(crate) struct ProjectsView {
/// Present whenever a migration receipt exists (dialog dismissal is
/// client-side, per browser).
pub okf_dialog: Option<OkfDialog>,
+ /// Pending messages across the projects listed in `projects`; `0` hides
+ /// the summary strip.
+ pub mail_total: u64,
+ /// Projects the strip names, most mail first, capped.
+ pub mail_projects: Vec<MailSummaryItem>,
+ /// Projects with mail beyond the ones `mail_projects` names.
+ pub mail_hidden: usize,
}
// ---------------------------------------------------------------------------
@@ -160,6 +180,22 @@ pub(crate) struct PageRow {
pub updated_relative: String,
}
+/// One pending inbox message on the project page.
+pub(crate) struct MailboxRow {
+ /// Subject line, or a placeholder when the sender gave none.
+ pub subject: String,
+ /// `workspace/project` of the sender, or a neutral label when the viewer
+ /// may not read it.
+ pub sender: String,
+ /// Link to the sender's project; `None` when the viewer may not read it.
+ pub sender_href: Option<String>,
+ /// Leading characters of the body. Untrusted cross-project text: the
+ /// template escapes it and never renders it as markup.
+ pub snippet: String,
+ /// Humanised creation timestamp.
+ pub created_relative: String,
+}
+
/// A folder in the sidebar tree (groups pages by first path segment).
pub(crate) struct Folder {
/// Folder name (first path segment, without trailing slash).
@@ -183,6 +219,13 @@ pub(crate) struct ProjectView {
pub system: Vec<Folder>,
/// N most-recent knowledge pages for the right column.
pub recent: Vec<PageRow>,
+ /// Pending inbox messages, oldest first, capped at the route's limit.
+ pub mailbox: Vec<MailboxRow>,
+ /// All pending messages for the project; exceeds `mailbox.len()` when the
+ /// list is capped.
+ pub mailbox_total: u64,
+ /// `mailbox` lists fewer messages than are pending.
+ pub mailbox_capped: bool,
}
/// View-model for a namespace (directory) listing — `GET
diff --git a/crates/ai-memory-web/static/tailwind.css b/crates/ai-memory-web/static/tailwind.css
index 21b5b349..0c5956e1 100644
--- a/crates/ai-memory-web/static/tailwind.css
+++ b/crates/ai-memory-web/static/tailwind.css
@@ -1 +1 @@
-*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.right-2{right:.5rem}.top-0{top:0}.top-2{top:.5rem}.z-10{z-index:10}.z-50{z-index:50}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mt-16{margin-top:4rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-14{height:3.5rem}.h-4{height:1rem}.h-7{height:1.75rem}.h-full{height:100%}.max-h-96{max-height:24rem}.min-h-full{min-height:100%}.w-4{width:1rem}.w-40{width:10rem}.w-auto{width:auto}.w-full{width:100%}.min-w-0{min-width:0}.max-w-3xl{max-width:48rem}.max-w-7xl{max-width:80rem}.max-w-md{max-width:28rem}.max-w-xl{max-width:36rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-8{gap:2rem}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-y-1{row-gap:.25rem}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.125rem*var(--tw-space-y-reverse));margin-top:calc(.125rem*(1 - var(--tw-space-y-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.25rem*var(--tw-space-y-reverse));margin-top:calc(.25rem*(1 - var(--tw-space-y-reverse)))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.divide-slate-100>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(241 245 249/var(--tw-divide-opacity,1))}.overflow-auto{overflow:auto}.truncate{overflow:hidden;text-overflow:ellipsis}.truncate,.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-amber-200{--tw-border-opacity:1;border-color:rgb(253 230 138/var(--tw-border-opacity,1))}.border-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity,1))}.border-slate-100{--tw-border-opacity:1;border-color:rgb(241 245 249/var(--tw-border-opacity,1))}.border-slate-200{--tw-border-opacity:1;border-color:rgb(226 232 240/var(--tw-border-opacity,1))}.border-slate-300{--tw-border-opacity:1;border-color:rgb(203 213 225/var(--tw-border-opacity,1))}.bg-amber-100{--tw-bg-opacity:1;background-color:rgb(254 243 199/var(--tw-bg-opacity,1))}.bg-amber-50{--tw-bg-opacity:1;background-color:rgb(255 251 235/var(--tw-bg-opacity,1))}.bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity,1))}.bg-green-50{--tw-bg-opacity:1;background-color:rgb(240 253 244/var(--tw-bg-opacity,1))}.bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.bg-red-600{--tw-bg-opacity:1;background-color:rgb(220 38 38/var(--tw-bg-opacity,1))}.bg-slate-100{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.bg-slate-50{--tw-bg-opacity:1;background-color:rgb(248 250 252/var(--tw-bg-opacity,1))}.bg-slate-900{--tw-bg-opacity:1;background-color:rgb(15 23 42/var(--tw-bg-opacity,1))}.bg-slate-900\/50{background-color:rgba(15,23,42,.5)}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.p-1{padding:.25rem}.p-12{padding:3rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-0\.5{padding-bottom:.125rem;padding-top:.125rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-1\.5{padding-bottom:.375rem;padding-top:.375rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-20{padding-bottom:5rem;padding-top:5rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-4{padding-bottom:1rem;padding-top:1rem}.py-8{padding-bottom:2rem;padding-top:2rem}.pl-2{padding-left:.5rem}.pr-10{padding-right:2.5rem}.text-center{text-align:center}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-6xl{font-size:3.75rem;line-height:1}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-relaxed{line-height:1.625}.tracking-wide{letter-spacing:.025em}.text-amber-700{--tw-text-opacity:1;color:rgb(180 83 9/var(--tw-text-opacity,1))}.text-amber-800{--tw-text-opacity:1;color:rgb(146 64 14/var(--tw-text-opacity,1))}.text-amber-900{--tw-text-opacity:1;color:rgb(120 53 15/var(--tw-text-opacity,1))}.text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity,1))}.text-green-800{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity,1))}.text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity,1))}.text-slate-200{--tw-text-opacity:1;color:rgb(226 232 240/var(--tw-text-opacity,1))}.text-slate-400{--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity,1))}.text-slate-500{--tw-text-opacity:1;color:rgb(100 116 139/var(--tw-text-opacity,1))}.text-slate-600{--tw-text-opacity:1;color:rgb(71 85 105/var(--tw-text-opacity,1))}.text-slate-700{--tw-text-opacity:1;color:rgb(51 65 85/var(--tw-text-opacity,1))}.text-slate-800{--tw-text-opacity:1;color:rgb(30 41 59/var(--tw-text-opacity,1))}.text-slate-900{--tw-text-opacity:1;color:rgb(15 23 42/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.underline{text-decoration-line:underline}.placeholder-slate-400::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(148 163 184/var(--tw-placeholder-opacity,1))}.placeholder-slate-400::placeholder{--tw-placeholder-opacity:1;color:rgb(148 163 184/var(--tw-placeholder-opacity,1))}.shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.hover\:border-blue-400:hover{--tw-border-opacity:1;border-color:rgb(96 165 250/var(--tw-border-opacity,1))}.hover\:bg-amber-100:hover{--tw-bg-opacity:1;background-color:rgb(254 243 199/var(--tw-bg-opacity,1))}.hover\:bg-blue-700:hover{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity,1))}.hover\:bg-red-700:hover{--tw-bg-opacity:1;background-color:rgb(185 28 28/var(--tw-bg-opacity,1))}.hover\:bg-slate-700:hover{--tw-bg-opacity:1;background-color:rgb(51 65 85/var(--tw-bg-opacity,1))}.hover\:text-blue-600:hover{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:shadow-sm:hover{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\:ring-blue-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity,1))}.disabled\:opacity-50:disabled{opacity:.5}@media (min-width:640px){.sm\:inline{display:inline}.sm\:w-64{width:16rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}}@media (min-width:768px){.md\:w-56{width:14rem}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-row{flex-direction:row}}@media (min-width:1024px){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:px-8{padding-left:2rem;padding-right:2rem}}@media (prefers-color-scheme:dark){.dark\:divide-slate-800>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(30 41 59/var(--tw-divide-opacity,1))}.dark\:border-amber-800{--tw-border-opacity:1;border-color:rgb(146 64 14/var(--tw-border-opacity,1))}.dark\:border-amber-900\/50{border-color:rgba(120,53,15,.5)}.dark\:border-blue-800{--tw-border-opacity:1;border-color:rgb(30 64 175/var(--tw-border-opacity,1))}.dark\:border-slate-600{--tw-border-opacity:1;border-color:rgb(71 85 105/var(--tw-border-opacity,1))}.dark\:border-slate-700{--tw-border-opacity:1;border-color:rgb(51 65 85/var(--tw-border-opacity,1))}.dark\:border-slate-800{--tw-border-opacity:1;border-color:rgb(30 41 59/var(--tw-border-opacity,1))}.dark\:bg-amber-900{--tw-bg-opacity:1;background-color:rgb(120 53 15/var(--tw-bg-opacity,1))}.dark\:bg-amber-900\/40{background-color:rgba(120,53,15,.4)}.dark\:bg-amber-950{--tw-bg-opacity:1;background-color:rgb(69 26 3/var(--tw-bg-opacity,1))}.dark\:bg-amber-950\/30{background-color:rgba(69,26,3,.3)}.dark\:bg-blue-950{--tw-bg-opacity:1;background-color:rgb(23 37 84/var(--tw-bg-opacity,1))}.dark\:bg-slate-100{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.dark\:bg-slate-800{--tw-bg-opacity:1;background-color:rgb(30 41 59/var(--tw-bg-opacity,1))}.dark\:bg-slate-800\/60{background-color:rgba(30,41,59,.6)}.dark\:bg-slate-900{--tw-bg-opacity:1;background-color:rgb(15 23 42/var(--tw-bg-opacity,1))}.dark\:bg-slate-950{--tw-bg-opacity:1;background-color:rgb(2 6 23/var(--tw-bg-opacity,1))}.dark\:text-amber-200{--tw-text-opacity:1;color:rgb(253 230 138/var(--tw-text-opacity,1))}.dark\:text-amber-300{--tw-text-opacity:1;color:rgb(252 211 77/var(--tw-text-opacity,1))}.dark\:text-amber-300\/90{color:rgba(252,211,77,.9)}.dark\:text-blue-300{--tw-text-opacity:1;color:rgb(147 197 253/var(--tw-text-opacity,1))}.dark\:text-blue-400{--tw-text-opacity:1;color:rgb(96 165 250/var(--tw-text-opacity,1))}.dark\:text-slate-100{--tw-text-opacity:1;color:rgb(241 245 249/var(--tw-text-opacity,1))}.dark\:text-slate-200{--tw-text-opacity:1;color:rgb(226 232 240/var(--tw-text-opacity,1))}.dark\:text-slate-300{--tw-text-opacity:1;color:rgb(203 213 225/var(--tw-text-opacity,1))}.dark\:text-slate-400{--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity,1))}.dark\:text-slate-500{--tw-text-opacity:1;color:rgb(100 116 139/var(--tw-text-opacity,1))}.dark\:text-slate-600{--tw-text-opacity:1;color:rgb(71 85 105/var(--tw-text-opacity,1))}.dark\:text-slate-800{--tw-text-opacity:1;color:rgb(30 41 59/var(--tw-text-opacity,1))}.dark\:text-slate-900{--tw-text-opacity:1;color:rgb(15 23 42/var(--tw-text-opacity,1))}.dark\:hover\:border-blue-600:hover{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity,1))}.dark\:hover\:bg-amber-900\/40:hover{background-color:rgba(120,53,15,.4)}.dark\:hover\:bg-slate-300:hover{--tw-bg-opacity:1;background-color:rgb(203 213 225/var(--tw-bg-opacity,1))}.dark\:hover\:text-blue-400:hover{--tw-text-opacity:1;color:rgb(96 165 250/var(--tw-text-opacity,1))}}.\[\&_a\]\:text-blue-600 a{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.\[\&_a\]\:underline a{text-decoration-line:underline}@media (prefers-color-scheme:dark){.\[\&_a\]\:dark\:text-blue-400 a{--tw-text-opacity:1;color:rgb(96 165 250/var(--tw-text-opacity,1))}}.\[\&_blockquote\]\:my-3 blockquote{margin-bottom:.75rem;margin-top:.75rem}.\[\&_blockquote\]\:border-l-4 blockquote{border-left-width:4px}.\[\&_blockquote\]\:border-slate-300 blockquote{--tw-border-opacity:1;border-color:rgb(203 213 225/var(--tw-border-opacity,1))}.\[\&_blockquote\]\:pl-4 blockquote{padding-left:1rem}.\[\&_blockquote\]\:italic blockquote{font-style:italic}.\[\&_blockquote\]\:text-slate-600 blockquote{--tw-text-opacity:1;color:rgb(71 85 105/var(--tw-text-opacity,1))}@media (prefers-color-scheme:dark){.\[\&_blockquote\]\:dark\:border-slate-700 blockquote{--tw-border-opacity:1;border-color:rgb(51 65 85/var(--tw-border-opacity,1))}.\[\&_blockquote\]\:dark\:text-slate-400 blockquote{--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity,1))}}.\[\&_code\]\:rounded code{border-radius:.25rem}.\[\&_code\]\:bg-slate-100 code{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.\[\&_code\]\:px-1 code{padding-left:.25rem;padding-right:.25rem}.\[\&_code\]\:py-0\.5 code{padding-bottom:.125rem;padding-top:.125rem}.\[\&_code\]\:font-mono code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.\[\&_code\]\:text-sm code{font-size:.875rem;line-height:1.25rem}@media (prefers-color-scheme:dark){.\[\&_code\]\:dark\:bg-slate-800 code{--tw-bg-opacity:1;background-color:rgb(30 41 59/var(--tw-bg-opacity,1))}}.\[\&_h1\]\:mb-3 h1{margin-bottom:.75rem}.\[\&_h1\]\:mt-6 h1{margin-top:1.5rem}.\[\&_h1\]\:text-3xl h1{font-size:1.875rem;line-height:2.25rem}.\[\&_h1\]\:font-bold h1{font-weight:700}.\[\&_h2\]\:mb-2 h2{margin-bottom:.5rem}.\[\&_h2\]\:mt-5 h2{margin-top:1.25rem}.\[\&_h2\]\:text-2xl h2{font-size:1.5rem;line-height:2rem}.\[\&_h2\]\:font-semibold h2{font-weight:600}.\[\&_h3\]\:mb-2 h3{margin-bottom:.5rem}.\[\&_h3\]\:mt-4 h3{margin-top:1rem}.\[\&_h3\]\:text-xl h3{font-size:1.25rem;line-height:1.75rem}.\[\&_h3\]\:font-semibold h3{font-weight:600}.\[\&_h4\]\:mb-1 h4{margin-bottom:.25rem}.\[\&_h4\]\:mt-3 h4{margin-top:.75rem}.\[\&_h4\]\:text-lg h4{font-size:1.125rem;line-height:1.75rem}.\[\&_h4\]\:font-semibold h4{font-weight:600}.\[\&_hr\]\:my-6 hr{margin-bottom:1.5rem;margin-top:1.5rem}.\[\&_hr\]\:border-slate-200 hr{--tw-border-opacity:1;border-color:rgb(226 232 240/var(--tw-border-opacity,1))}@media (prefers-color-scheme:dark){.\[\&_hr\]\:dark\:border-slate-800 hr{--tw-border-opacity:1;border-color:rgb(30 41 59/var(--tw-border-opacity,1))}}.\[\&_li\]\:my-1 li{margin-bottom:.25rem;margin-top:.25rem}.\[\&_mark\]\:bg-yellow-200 mark{--tw-bg-opacity:1;background-color:rgb(254 240 138/var(--tw-bg-opacity,1))}.\[\&_mark\]\:px-0\.5 mark{padding-left:.125rem;padding-right:.125rem}@media (prefers-color-scheme:dark){.\[\&_mark\]\:dark\:bg-yellow-800 mark{--tw-bg-opacity:1;background-color:rgb(133 77 14/var(--tw-bg-opacity,1))}}.\[\&_ol\]\:my-3 ol{margin-bottom:.75rem;margin-top:.75rem}.\[\&_ol\]\:list-decimal ol{list-style-type:decimal}.\[\&_ol\]\:pl-5 ol{padding-left:1.25rem}.\[\&_p\]\:my-3 p{margin-bottom:.75rem;margin-top:.75rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_pre\]\:my-3 pre{margin-bottom:.75rem;margin-top:.75rem}.\[\&_pre\]\:overflow-x-auto pre{overflow-x:auto}.\[\&_pre\]\:rounded pre{border-radius:.25rem}.\[\&_pre\]\:bg-slate-100 pre{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.\[\&_pre\]\:p-3 pre{padding:.75rem}@media (prefers-color-scheme:dark){.\[\&_pre\]\:dark\:bg-slate-800 pre{--tw-bg-opacity:1;background-color:rgb(30 41 59/var(--tw-bg-opacity,1))}}.\[\&_pre_code\]\:bg-transparent pre code{background-color:transparent}.\[\&_pre_code\]\:p-0 pre code{padding:0}.\[\&_table\]\:my-3 table{margin-bottom:.75rem;margin-top:.75rem}.\[\&_table\]\:w-full table{width:100%}.\[\&_table\]\:border-collapse table{border-collapse:collapse}.\[\&_td\]\:border td{border-width:1px}.\[\&_td\]\:border-slate-300 td{--tw-border-opacity:1;border-color:rgb(203 213 225/var(--tw-border-opacity,1))}.\[\&_td\]\:px-3 td{padding-left:.75rem;padding-right:.75rem}.\[\&_td\]\:py-2 td{padding-bottom:.5rem;padding-top:.5rem}@media (prefers-color-scheme:dark){.\[\&_td\]\:dark\:border-slate-700 td{--tw-border-opacity:1;border-color:rgb(51 65 85/var(--tw-border-opacity,1))}}.\[\&_th\]\:border th{border-width:1px}.\[\&_th\]\:border-slate-300 th{--tw-border-opacity:1;border-color:rgb(203 213 225/var(--tw-border-opacity,1))}.\[\&_th\]\:bg-slate-50 th{--tw-bg-opacity:1;background-color:rgb(248 250 252/var(--tw-bg-opacity,1))}.\[\&_th\]\:px-3 th{padding-left:.75rem;padding-right:.75rem}.\[\&_th\]\:py-2 th{padding-bottom:.5rem;padding-top:.5rem}.\[\&_th\]\:text-left th{text-align:left}@media (prefers-color-scheme:dark){.\[\&_th\]\:dark\:border-slate-700 th{--tw-border-opacity:1;border-color:rgb(51 65 85/var(--tw-border-opacity,1))}.\[\&_th\]\:dark\:bg-slate-800 th{--tw-bg-opacity:1;background-color:rgb(30 41 59/var(--tw-bg-opacity,1))}}.\[\&_ul\]\:my-3 ul{margin-bottom:.75rem;margin-top:.75rem}.\[\&_ul\]\:list-disc ul{list-style-type:disc}.\[\&_ul\]\:pl-5 ul{padding-left:1.25rem}
\ No newline at end of file
+*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.right-2{right:.5rem}.top-0{top:0}.top-2{top:.5rem}.z-10{z-index:10}.z-50{z-index:50}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mt-16{margin-top:4rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-14{height:3.5rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-7{height:1.75rem}.h-full{height:100%}.max-h-96{max-height:24rem}.min-h-full{min-height:100%}.w-4{width:1rem}.w-40{width:10rem}.w-auto{width:auto}.w-full{width:100%}.min-w-0{min-width:0}.max-w-3xl{max-width:48rem}.max-w-7xl{max-width:80rem}.max-w-md{max-width:28rem}.max-w-xl{max-width:36rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-8{gap:2rem}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-y-1{row-gap:.25rem}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.125rem*var(--tw-space-y-reverse));margin-top:calc(.125rem*(1 - var(--tw-space-y-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.25rem*var(--tw-space-y-reverse));margin-top:calc(.25rem*(1 - var(--tw-space-y-reverse)))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.divide-slate-100>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(241 245 249/var(--tw-divide-opacity,1))}.overflow-auto{overflow:auto}.truncate{overflow:hidden;text-overflow:ellipsis}.truncate,.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-amber-200{--tw-border-opacity:1;border-color:rgb(253 230 138/var(--tw-border-opacity,1))}.border-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity,1))}.border-slate-100{--tw-border-opacity:1;border-color:rgb(241 245 249/var(--tw-border-opacity,1))}.border-slate-200{--tw-border-opacity:1;border-color:rgb(226 232 240/var(--tw-border-opacity,1))}.border-slate-300{--tw-border-opacity:1;border-color:rgb(203 213 225/var(--tw-border-opacity,1))}.bg-amber-100{--tw-bg-opacity:1;background-color:rgb(254 243 199/var(--tw-bg-opacity,1))}.bg-amber-50{--tw-bg-opacity:1;background-color:rgb(255 251 235/var(--tw-bg-opacity,1))}.bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity,1))}.bg-green-50{--tw-bg-opacity:1;background-color:rgb(240 253 244/var(--tw-bg-opacity,1))}.bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.bg-red-600{--tw-bg-opacity:1;background-color:rgb(220 38 38/var(--tw-bg-opacity,1))}.bg-slate-100{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.bg-slate-50{--tw-bg-opacity:1;background-color:rgb(248 250 252/var(--tw-bg-opacity,1))}.bg-slate-900{--tw-bg-opacity:1;background-color:rgb(15 23 42/var(--tw-bg-opacity,1))}.bg-slate-900\/50{background-color:rgba(15,23,42,.5)}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.p-1{padding:.25rem}.p-12{padding:3rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-0\.5{padding-bottom:.125rem;padding-top:.125rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-1\.5{padding-bottom:.375rem;padding-top:.375rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-20{padding-bottom:5rem;padding-top:5rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-4{padding-bottom:1rem;padding-top:1rem}.py-8{padding-bottom:2rem;padding-top:2rem}.pl-2{padding-left:.5rem}.pr-10{padding-right:2.5rem}.text-center{text-align:center}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-6xl{font-size:3.75rem;line-height:1}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-relaxed{line-height:1.625}.tracking-wide{letter-spacing:.025em}.text-amber-700{--tw-text-opacity:1;color:rgb(180 83 9/var(--tw-text-opacity,1))}.text-amber-800{--tw-text-opacity:1;color:rgb(146 64 14/var(--tw-text-opacity,1))}.text-amber-900{--tw-text-opacity:1;color:rgb(120 53 15/var(--tw-text-opacity,1))}.text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity,1))}.text-green-800{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity,1))}.text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity,1))}.text-slate-200{--tw-text-opacity:1;color:rgb(226 232 240/var(--tw-text-opacity,1))}.text-slate-400{--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity,1))}.text-slate-500{--tw-text-opacity:1;color:rgb(100 116 139/var(--tw-text-opacity,1))}.text-slate-600{--tw-text-opacity:1;color:rgb(71 85 105/var(--tw-text-opacity,1))}.text-slate-700{--tw-text-opacity:1;color:rgb(51 65 85/var(--tw-text-opacity,1))}.text-slate-800{--tw-text-opacity:1;color:rgb(30 41 59/var(--tw-text-opacity,1))}.text-slate-900{--tw-text-opacity:1;color:rgb(15 23 42/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.underline{text-decoration-line:underline}.placeholder-slate-400::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(148 163 184/var(--tw-placeholder-opacity,1))}.placeholder-slate-400::placeholder{--tw-placeholder-opacity:1;color:rgb(148 163 184/var(--tw-placeholder-opacity,1))}.shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.hover\:border-blue-400:hover{--tw-border-opacity:1;border-color:rgb(96 165 250/var(--tw-border-opacity,1))}.hover\:bg-amber-100:hover{--tw-bg-opacity:1;background-color:rgb(254 243 199/var(--tw-bg-opacity,1))}.hover\:bg-blue-700:hover{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity,1))}.hover\:bg-red-700:hover{--tw-bg-opacity:1;background-color:rgb(185 28 28/var(--tw-bg-opacity,1))}.hover\:bg-slate-700:hover{--tw-bg-opacity:1;background-color:rgb(51 65 85/var(--tw-bg-opacity,1))}.hover\:text-amber-950:hover{--tw-text-opacity:1;color:rgb(69 26 3/var(--tw-text-opacity,1))}.hover\:text-blue-600:hover{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:shadow-sm:hover{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\:ring-blue-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity,1))}.disabled\:opacity-50:disabled{opacity:.5}@media (min-width:640px){.sm\:inline{display:inline}.sm\:w-64{width:16rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}}@media (min-width:768px){.md\:w-56{width:14rem}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-row{flex-direction:row}}@media (min-width:1024px){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:px-8{padding-left:2rem;padding-right:2rem}}@media (prefers-color-scheme:dark){.dark\:divide-slate-800>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(30 41 59/var(--tw-divide-opacity,1))}.dark\:border-amber-800{--tw-border-opacity:1;border-color:rgb(146 64 14/var(--tw-border-opacity,1))}.dark\:border-amber-900\/50{border-color:rgba(120,53,15,.5)}.dark\:border-blue-800{--tw-border-opacity:1;border-color:rgb(30 64 175/var(--tw-border-opacity,1))}.dark\:border-slate-600{--tw-border-opacity:1;border-color:rgb(71 85 105/var(--tw-border-opacity,1))}.dark\:border-slate-700{--tw-border-opacity:1;border-color:rgb(51 65 85/var(--tw-border-opacity,1))}.dark\:border-slate-800{--tw-border-opacity:1;border-color:rgb(30 41 59/var(--tw-border-opacity,1))}.dark\:bg-amber-900{--tw-bg-opacity:1;background-color:rgb(120 53 15/var(--tw-bg-opacity,1))}.dark\:bg-amber-900\/40{background-color:rgba(120,53,15,.4)}.dark\:bg-amber-950{--tw-bg-opacity:1;background-color:rgb(69 26 3/var(--tw-bg-opacity,1))}.dark\:bg-amber-950\/30{background-color:rgba(69,26,3,.3)}.dark\:bg-blue-950{--tw-bg-opacity:1;background-color:rgb(23 37 84/var(--tw-bg-opacity,1))}.dark\:bg-slate-100{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.dark\:bg-slate-800{--tw-bg-opacity:1;background-color:rgb(30 41 59/var(--tw-bg-opacity,1))}.dark\:bg-slate-800\/60{background-color:rgba(30,41,59,.6)}.dark\:bg-slate-900{--tw-bg-opacity:1;background-color:rgb(15 23 42/var(--tw-bg-opacity,1))}.dark\:bg-slate-950{--tw-bg-opacity:1;background-color:rgb(2 6 23/var(--tw-bg-opacity,1))}.dark\:text-amber-200{--tw-text-opacity:1;color:rgb(253 230 138/var(--tw-text-opacity,1))}.dark\:text-amber-300{--tw-text-opacity:1;color:rgb(252 211 77/var(--tw-text-opacity,1))}.dark\:text-amber-300\/90{color:rgba(252,211,77,.9)}.dark\:text-blue-300{--tw-text-opacity:1;color:rgb(147 197 253/var(--tw-text-opacity,1))}.dark\:text-blue-400{--tw-text-opacity:1;color:rgb(96 165 250/var(--tw-text-opacity,1))}.dark\:text-slate-100{--tw-text-opacity:1;color:rgb(241 245 249/var(--tw-text-opacity,1))}.dark\:text-slate-200{--tw-text-opacity:1;color:rgb(226 232 240/var(--tw-text-opacity,1))}.dark\:text-slate-300{--tw-text-opacity:1;color:rgb(203 213 225/var(--tw-text-opacity,1))}.dark\:text-slate-400{--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity,1))}.dark\:text-slate-500{--tw-text-opacity:1;color:rgb(100 116 139/var(--tw-text-opacity,1))}.dark\:text-slate-600{--tw-text-opacity:1;color:rgb(71 85 105/var(--tw-text-opacity,1))}.dark\:text-slate-800{--tw-text-opacity:1;color:rgb(30 41 59/var(--tw-text-opacity,1))}.dark\:text-slate-900{--tw-text-opacity:1;color:rgb(15 23 42/var(--tw-text-opacity,1))}.dark\:hover\:border-blue-600:hover{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity,1))}.dark\:hover\:bg-amber-900\/40:hover{background-color:rgba(120,53,15,.4)}.dark\:hover\:bg-slate-300:hover{--tw-bg-opacity:1;background-color:rgb(203 213 225/var(--tw-bg-opacity,1))}.dark\:hover\:text-amber-100:hover{--tw-text-opacity:1;color:rgb(254 243 199/var(--tw-text-opacity,1))}.dark\:hover\:text-blue-400:hover{--tw-text-opacity:1;color:rgb(96 165 250/var(--tw-text-opacity,1))}}.\[\&_a\]\:text-blue-600 a{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.\[\&_a\]\:underline a{text-decoration-line:underline}@media (prefers-color-scheme:dark){.\[\&_a\]\:dark\:text-blue-400 a{--tw-text-opacity:1;color:rgb(96 165 250/var(--tw-text-opacity,1))}}.\[\&_blockquote\]\:my-3 blockquote{margin-bottom:.75rem;margin-top:.75rem}.\[\&_blockquote\]\:border-l-4 blockquote{border-left-width:4px}.\[\&_blockquote\]\:border-slate-300 blockquote{--tw-border-opacity:1;border-color:rgb(203 213 225/var(--tw-border-opacity,1))}.\[\&_blockquote\]\:pl-4 blockquote{padding-left:1rem}.\[\&_blockquote\]\:italic blockquote{font-style:italic}.\[\&_blockquote\]\:text-slate-600 blockquote{--tw-text-opacity:1;color:rgb(71 85 105/var(--tw-text-opacity,1))}@media (prefers-color-scheme:dark){.\[\&_blockquote\]\:dark\:border-slate-700 blockquote{--tw-border-opacity:1;border-color:rgb(51 65 85/var(--tw-border-opacity,1))}.\[\&_blockquote\]\:dark\:text-slate-400 blockquote{--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity,1))}}.\[\&_code\]\:rounded code{border-radius:.25rem}.\[\&_code\]\:bg-slate-100 code{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.\[\&_code\]\:px-1 code{padding-left:.25rem;padding-right:.25rem}.\[\&_code\]\:py-0\.5 code{padding-bottom:.125rem;padding-top:.125rem}.\[\&_code\]\:font-mono code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.\[\&_code\]\:text-sm code{font-size:.875rem;line-height:1.25rem}@media (prefers-color-scheme:dark){.\[\&_code\]\:dark\:bg-slate-800 code{--tw-bg-opacity:1;background-color:rgb(30 41 59/var(--tw-bg-opacity,1))}}.\[\&_h1\]\:mb-3 h1{margin-bottom:.75rem}.\[\&_h1\]\:mt-6 h1{margin-top:1.5rem}.\[\&_h1\]\:text-3xl h1{font-size:1.875rem;line-height:2.25rem}.\[\&_h1\]\:font-bold h1{font-weight:700}.\[\&_h2\]\:mb-2 h2{margin-bottom:.5rem}.\[\&_h2\]\:mt-5 h2{margin-top:1.25rem}.\[\&_h2\]\:text-2xl h2{font-size:1.5rem;line-height:2rem}.\[\&_h2\]\:font-semibold h2{font-weight:600}.\[\&_h3\]\:mb-2 h3{margin-bottom:.5rem}.\[\&_h3\]\:mt-4 h3{margin-top:1rem}.\[\&_h3\]\:text-xl h3{font-size:1.25rem;line-height:1.75rem}.\[\&_h3\]\:font-semibold h3{font-weight:600}.\[\&_h4\]\:mb-1 h4{margin-bottom:.25rem}.\[\&_h4\]\:mt-3 h4{margin-top:.75rem}.\[\&_h4\]\:text-lg h4{font-size:1.125rem;line-height:1.75rem}.\[\&_h4\]\:font-semibold h4{font-weight:600}.\[\&_hr\]\:my-6 hr{margin-bottom:1.5rem;margin-top:1.5rem}.\[\&_hr\]\:border-slate-200 hr{--tw-border-opacity:1;border-color:rgb(226 232 240/var(--tw-border-opacity,1))}@media (prefers-color-scheme:dark){.\[\&_hr\]\:dark\:border-slate-800 hr{--tw-border-opacity:1;border-color:rgb(30 41 59/var(--tw-border-opacity,1))}}.\[\&_li\]\:my-1 li{margin-bottom:.25rem;margin-top:.25rem}.\[\&_mark\]\:bg-yellow-200 mark{--tw-bg-opacity:1;background-color:rgb(254 240 138/var(--tw-bg-opacity,1))}.\[\&_mark\]\:px-0\.5 mark{padding-left:.125rem;padding-right:.125rem}@media (prefers-color-scheme:dark){.\[\&_mark\]\:dark\:bg-yellow-800 mark{--tw-bg-opacity:1;background-color:rgb(133 77 14/var(--tw-bg-opacity,1))}}.\[\&_ol\]\:my-3 ol{margin-bottom:.75rem;margin-top:.75rem}.\[\&_ol\]\:list-decimal ol{list-style-type:decimal}.\[\&_ol\]\:pl-5 ol{padding-left:1.25rem}.\[\&_p\]\:my-3 p{margin-bottom:.75rem;margin-top:.75rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_pre\]\:my-3 pre{margin-bottom:.75rem;margin-top:.75rem}.\[\&_pre\]\:overflow-x-auto pre{overflow-x:auto}.\[\&_pre\]\:rounded pre{border-radius:.25rem}.\[\&_pre\]\:bg-slate-100 pre{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.\[\&_pre\]\:p-3 pre{padding:.75rem}@media (prefers-color-scheme:dark){.\[\&_pre\]\:dark\:bg-slate-800 pre{--tw-bg-opacity:1;background-color:rgb(30 41 59/var(--tw-bg-opacity,1))}}.\[\&_pre_code\]\:bg-transparent pre code{background-color:transparent}.\[\&_pre_code\]\:p-0 pre code{padding:0}.\[\&_table\]\:my-3 table{margin-bottom:.75rem;margin-top:.75rem}.\[\&_table\]\:w-full table{width:100%}.\[\&_table\]\:border-collapse table{border-collapse:collapse}.\[\&_td\]\:border td{border-width:1px}.\[\&_td\]\:border-slate-300 td{--tw-border-opacity:1;border-color:rgb(203 213 225/var(--tw-border-opacity,1))}.\[\&_td\]\:px-3 td{padding-left:.75rem;padding-right:.75rem}.\[\&_td\]\:py-2 td{padding-bottom:.5rem;padding-top:.5rem}@media (prefers-color-scheme:dark){.\[\&_td\]\:dark\:border-slate-700 td{--tw-border-opacity:1;border-color:rgb(51 65 85/var(--tw-border-opacity,1))}}.\[\&_th\]\:border th{border-width:1px}.\[\&_th\]\:border-slate-300 th{--tw-border-opacity:1;border-color:rgb(203 213 225/var(--tw-border-opacity,1))}.\[\&_th\]\:bg-slate-50 th{--tw-bg-opacity:1;background-color:rgb(248 250 252/var(--tw-bg-opacity,1))}.\[\&_th\]\:px-3 th{padding-left:.75rem;padding-right:.75rem}.\[\&_th\]\:py-2 th{padding-bottom:.5rem;padding-top:.5rem}.\[\&_th\]\:text-left th{text-align:left}@media (prefers-color-scheme:dark){.\[\&_th\]\:dark\:border-slate-700 th{--tw-border-opacity:1;border-color:rgb(51 65 85/var(--tw-border-opacity,1))}.\[\&_th\]\:dark\:bg-slate-800 th{--tw-bg-opacity:1;background-color:rgb(30 41 59/var(--tw-bg-opacity,1))}}.\[\&_ul\]\:my-3 ul{margin-bottom:.75rem;margin-top:.75rem}.\[\&_ul\]\:list-disc ul{list-style-type:disc}.\[\&_ul\]\:pl-5 ul{padding-left:1.25rem}
\ No newline at end of file
diff --git a/crates/ai-memory-web/templates/project.html b/crates/ai-memory-web/templates/project.html
index 46c7d32c..525eddbc 100644
--- a/crates/ai-memory-web/templates/project.html
+++ b/crates/ai-memory-web/templates/project.html
@@ -64,6 +64,39 @@
<!-- Main: recent pages -->
<div class="flex-1 min-w-0">
+ <section class="mb-8" aria-labelledby="mailbox-heading">
+ <div class="flex items-center gap-2 mb-3">
+ <h2 id="mailbox-heading" class="text-xs font-semibold uppercase tracking-wide text-slate-400 dark:text-slate-500">Mailbox</h2>
+ {% if !mailbox.is_empty() %}
+ <span class="inline-flex items-center rounded px-1.5 py-0.5 text-xs font-medium border border-amber-200 dark:border-amber-900/50 bg-amber-50 dark:bg-amber-950/30 text-amber-800 dark:text-amber-300">{% if mailbox_capped %}{{ mailbox.len() }} of {{ mailbox_total }}{% else %}{{ mailbox_total }}{% endif %} pending</span>
+ {% endif %}
+ </div>
+ {% if mailbox.is_empty() %}
+ <p class="text-sm text-slate-400 dark:text-slate-600">No pending messages for this project.</p>
+ {% else %}
+ <ul class="divide-y divide-slate-100 dark:divide-slate-800">
+ {% for message in mailbox %}
+ <li class="py-3 flex items-start justify-between gap-4">
+ <div class="min-w-0">
+ <div class="text-sm font-medium text-slate-800 dark:text-slate-100 truncate">{{ message.subject }}</div>
+ <div class="flex items-center gap-2 mt-1">
+ {% if let Some(href) = message.sender_href %}
+ <a href="{{ href }}" class="inline-flex items-center rounded px-1.5 py-0.5 text-xs font-medium bg-slate-100 dark:bg-slate-800 text-slate-600 dark:text-slate-400 hover:text-blue-600 dark:hover:text-blue-400 shrink-0">from {{ message.sender }}</a>
+ {% else %}
+ <span class="inline-flex items-center rounded px-1.5 py-0.5 text-xs font-medium bg-slate-100 dark:bg-slate-800 text-slate-600 dark:text-slate-400 shrink-0">from {{ message.sender }}</span>
+ {% endif %}
+ <span class="text-xs text-slate-400 dark:text-slate-500 truncate">{{ message.snippet }}</span>
+ </div>
+ </div>
+ <span class="text-xs text-slate-400 dark:text-slate-500 whitespace-nowrap shrink-0">{{ message.created_relative }}</span>
+ </li>
+ {% endfor %}
+ </ul>
+ <p class="mt-2 text-xs text-slate-400 dark:text-slate-500">
+ {% if mailbox_capped %}Showing the oldest {{ mailbox.len() }} of {{ mailbox_total }}; <code class="font-mono">ai-memory message list</code> shows the rest. {% endif %}An agent in this project reads them with <code class="font-mono">memory_message_pop</code>.
+ </p>
+ {% endif %}
+ </section>
<h2 class="text-xs font-semibold uppercase tracking-wide text-slate-400 dark:text-slate-500 mb-3">Recent Activity</h2>
{% if recent.is_empty() %}
<p class="text-sm text-slate-400 dark:text-slate-600">No pages yet.</p>
diff --git a/crates/ai-memory-web/templates/projects.html b/crates/ai-memory-web/templates/projects.html
index c398d1df..db96f5d9 100644
--- a/crates/ai-memory-web/templates/projects.html
+++ b/crates/ai-memory-web/templates/projects.html
@@ -8,6 +8,14 @@
<p class="mt-1 text-sm text-slate-500 dark:text-slate-400">All workspaces and projects in your wiki.</p>
</div>
+{% if mail_total > 0 %}
+<div class="mb-6 rounded-md border border-amber-200 dark:border-amber-900/50 bg-amber-50 dark:bg-amber-950/30 px-4 py-3 text-sm text-amber-900 dark:text-amber-200">
+ <span class="font-medium">{{ mail_total }} message{% if mail_total != 1 %}s{% endif %} waiting for agents</span>
+ <span class="text-amber-800 dark:text-amber-300/90">in
+ {% for item in mail_projects %}<a href="{{ item.href }}" class="font-medium underline hover:text-amber-950 dark:hover:text-amber-100">{{ item.label }}</a> ({{ item.pending }}){% if !loop.last %}, {% endif %}{% endfor %}{% if mail_hidden > 0 %} and {{ mail_hidden }} more project{% if mail_hidden != 1 %}s{% endif %}{% endif %}.</span>
+</div>
+{% endif %}
+
<div id="llm-notice" class="mb-6 hidden relative rounded-md border border-amber-200 dark:border-amber-900/50 bg-amber-50 dark:bg-amber-950/30 p-4 pr-10 text-sm text-amber-900 dark:text-amber-200">
<button id="llm-notice-close" type="button" aria-label="Dismiss permanently" title="Don't show this again"
class="absolute top-2 right-2 rounded p-1 text-amber-700 dark:text-amber-300 hover:bg-amber-100 dark:hover:bg-amber-900/40">
@@ -120,7 +128,12 @@
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
{% for card in projects %}
<a href="{{ card.href }}" class="block rounded-lg border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 p-5 hover:border-blue-400 dark:hover:border-blue-600 hover:shadow-sm transition-all">
- <div class="text-xs font-medium text-slate-400 dark:text-slate-500 mb-1">{{ card.workspace }}</div>
+ <div class="flex items-center justify-between gap-2 h-5 mb-1">
+ <div class="min-w-0 truncate text-xs font-medium text-slate-400 dark:text-slate-500">{{ card.workspace }}</div>
+ {% if card.pending_inbox > 0 %}
+ <span class="shrink-0 inline-flex items-center rounded px-1.5 py-0.5 text-xs font-medium border border-amber-200 dark:border-amber-900/50 bg-amber-50 dark:bg-amber-950/30 text-amber-800 dark:text-amber-300" title="Messages from other projects waiting for an agent here">{{ card.pending_inbox }} inbox</span>
+ {% endif %}
+ </div>
<div class="text-base font-semibold text-slate-800 dark:text-slate-100 truncate">{{ card.project }}</div>
<div class="mt-3 flex items-center justify-between text-xs text-slate-500 dark:text-slate-400">
<span>{{ card.page_count }} page{% if card.page_count != 1 %}s{% endif %}</span>
diff --git a/crates/ai-memory-web/tests/suite/routes.rs b/crates/ai-memory-web/tests/suite/routes.rs
index 855157a7..321a3e0f 100644
--- a/crates/ai-memory-web/tests/suite/routes.rs
+++ b/crates/ai-memory-web/tests/suite/routes.rs
@@ -4064,3 +4064,306 @@ async fn api_recent_incremental_rechecks_restricted_scope_on_cursor() {
"a cursor cannot retain access after its user's grant is revoked"
);
}
+
+/// Send one pending message `from` -> `to` through the writer, as an agent would.
+async fn send_mail(
+ store: &Store,
+ from: (ai_memory_core::WorkspaceId, ai_memory_core::ProjectId),
+ to: (ai_memory_core::WorkspaceId, ai_memory_core::ProjectId),
+ subject: &str,
+ body: &str,
+) {
+ store
+ .writer
+ .insert_message(ai_memory_core::NewAgentMessage {
+ from_workspace_id: from.0,
+ from_project_id: from.1,
+ from_agent: AgentKind::Other,
+ from_session_id: None,
+ from_owner_user: None,
+ to_workspace_id: to.0,
+ to_project_id: to.1,
+ subject: Some(subject.to_owned()),
+ body: body.to_owned(),
+ })
+ .await
+ .unwrap();
+}
+
+async fn get_text(
+ app: &axum::Router,
+ uri: &str,
+ viewer: Option<ai_memory_core::UserId>,
+) -> (StatusCode, String) {
+ let mut req = Request::builder().uri(uri);
+ if let Some(viewer) = viewer {
+ req = req.extension(ai_memory_core::AuthorizedViewer(viewer));
+ }
+ let resp = app
+ .clone()
+ .oneshot(req.body(Body::empty()).unwrap())
+ .await
+ .unwrap();
+ let status = resp.status();
+ let body = axum::body::to_bytes(resp.into_body(), usize::MAX)
+ .await
+ .unwrap();
+ (status, String::from_utf8_lossy(&body).into_owned())
+}
+
+/// The mailbox shows a project only mail addressed TO it, escapes the
+/// untrusted body, and viewing it never consumes the message.
+#[tokio::test]
+async fn web_mailbox_lists_only_this_projects_inbox_and_never_consumes_it() {
+ let (_tmp, store, wiki) = setup().await;
+ let ws = store
+ .writer
+ .get_or_create_workspace("default")
+ .await
+ .unwrap();
+ let mut ids = Vec::new();
+ for name in ["sender", "recipient", "bystander"] {
+ let id = store
+ .writer
+ .get_or_create_project(ws, name, None)
+ .await
+ .unwrap();
+ ids.push((ws, id));
+ }
+ let (sender, recipient) = (ids[0], ids[1]);
+ send_mail(
+ &store,
+ sender,
+ recipient,
+ "Add retry to relay",
+ "please <script>alert(1)</script> retry on 429",
+ )
+ .await;
+
+ let web = router(store.reader.clone(), wiki.clone());
+
+ let (status, body) = get_text(&web, "/w/default/recipient", None).await;
+ assert_eq!(status, StatusCode::OK);
+ assert!(body.contains("Add retry to relay"), "{body}");
+ assert!(body.contains("from default/sender"), "{body}");
+ assert!(body.contains("1 pending"), "{body}");
+ assert!(
+ body.contains("&lt;script&gt;") || body.contains("&#60;script&#62;"),
+ "message body must be escaped: {body}"
+ );
+ assert!(!body.contains("<script>alert(1)"), "{body}");
+
+ // Mail addressed to `recipient` is invisible on the sender's and on an
+ // uninvolved project's page; each shows the empty state instead.
+ for project in ["sender", "bystander"] {
+ let (status, body) = get_text(&web, &format!("/w/default/{project}"), None).await;
+ assert_eq!(status, StatusCode::OK, "{project}");
+ assert!(!body.contains("Add retry to relay"), "{project}: {body}");
+ assert!(
+ body.contains("No pending messages for this project."),
+ "{project}: {body}"
+ );
+ }
+
+ // Only the recipient's card carries the badge.
+ let (_, index) = get_text(&web, "/", None).await;
+ assert_eq!(index.matches("1 inbox").count(), 1, "{index}");
+ assert!(
+ index.contains("1 message waiting for agents"),
+ "summary strip missing: {index}"
+ );
+ assert!(index.contains("default/recipient"), "{index}");
+
+ // Read-only: no write verb reaches the page, and the message is still
+ // there for the agent to pop.
+ let resp = web
+ .clone()
+ .oneshot(
+ Request::builder()
+ .method(Method::POST)
+ .uri("/w/default/recipient")
+ .body(Body::empty())
+ .unwrap(),
+ )
+ .await
+ .unwrap();
+ assert_eq!(resp.status(), StatusCode::METHOD_NOT_ALLOWED);
+ let still = store
+ .reader
+ .list_messages(
+ recipient.0,
+ recipient.1,
+ ai_memory_core::MessageBox::Inbox,
+ 10,
+ )
+ .await
+ .unwrap();
+ assert_eq!(still.len(), 1);
+}
+
+/// A recipient is entitled to its mail, not to the name of a restricted
+/// project it came from, and a card the viewer may not read carries no count.
+#[tokio::test]
+async fn web_mailbox_hides_restricted_sender_names_and_cards() {
+ use ai_memory_core::{NewUser, UserRole};
+ use ai_memory_store::GrantLevel;
+
+ let (_tmp, store, wiki) = setup().await;
+ store
+ .writer
+ .set_new_project_mode(ai_memory_store::AccessMode::Restricted)
+ .await
+ .unwrap();
+ let ws = store
+ .writer
+ .get_or_create_workspace("default")
+ .await
+ .unwrap();
+ let inbox = store
+ .writer
+ .get_or_create_project(ws, "shared-tools", None)
+ .await
+ .unwrap();
+ let secret = store
+ .writer
+ .get_or_create_project(ws, "acme-client-work", None)
+ .await
+ .unwrap();
+ let human = |name: &'static str| {
+ let writer = store.writer.clone();
+ async move {
+ writer
+ .create_human_user(
+ NewUser {
+ username: name.into(),
+ name: None,
+ email: None,
+ },
+ UserRole::User,
+ None,
+ false,
+ )
+ .await
+ .unwrap()
+ }
+ };
+ let alice = human("alice").await;
+ let bob = human("bob").await;
+ for (user, project) in [(alice, inbox), (alice, secret), (bob, inbox)] {
+ store
+ .writer
+ .grant_memory(user, project, GrantLevel::Read, None)
+ .await
+ .unwrap();
+ }
+ send_mail(
+ &store,
+ (ws, secret),
+ (ws, inbox),
+ "Rotate the shared token",
+ "from the client project",
+ )
+ .await;
+ send_mail(
+ &store,
+ (ws, inbox),
+ (ws, secret),
+ "Confidential reply",
+ "to the client project",
+ )
+ .await;
+
+ let web = router(store.reader.clone(), wiki.clone());
+
+ // Bob reads the message addressed to a project he may read, but is not
+ // told which restricted project it came from.
+ let (status, body) = get_text(&web, "/w/default/shared-tools", Some(bob)).await;
+ assert_eq!(status, StatusCode::OK);
+ assert!(body.contains("Rotate the shared token"), "{body}");
+ assert!(body.contains("a project you cannot read"), "{body}");
+ assert!(!body.contains("acme-client-work"), "{body}");
+ assert!(!body.contains("w/default/acme-client-work"), "{body}");
+
+ // Control: alice may read the sender, so it is named.
+ let (_, body) = get_text(&web, "/w/default/shared-tools", Some(alice)).await;
+ assert!(body.contains("from default/acme-client-work"), "{body}");
+ assert!(
+ body.contains("href=\"w/default/acme-client-work\""),
+ "{body}"
+ );
+
+ // Bob's card grid has no trace of the restricted project, nor of the
+ // mail waiting in it; his own card still shows its count.
+ let (_, index) = get_text(&web, "/", Some(bob)).await;
+ assert!(!index.contains("acme-client-work"), "{index}");
+ assert_eq!(index.matches("1 inbox").count(), 1, "{index}");
+
+ // The count query applies the same filter itself, rather than leaning on
+ // the card list: bob's counts name only the project he may read.
+ let counts = store.reader.pending_inbox_counts(Some(bob)).await.unwrap();
+ assert_eq!(
+ counts
+ .iter()
+ .map(|c| c.project_name.as_str())
+ .collect::<Vec<_>>(),
+ ["shared-tools"]
+ );
+ assert_eq!(
+ store
+ .reader
+ .pending_inbox_counts(Some(alice))
+ .await
+ .unwrap()
+ .len(),
+ 2
+ );
+
+ // Control: alice sees both cards and both counts.
+ let (_, index) = get_text(&web, "/", Some(alice)).await;
+ assert!(index.contains("acme-client-work"), "{index}");
+ assert_eq!(index.matches("1 inbox").count(), 2, "{index}");
+ assert!(index.contains("2 messages waiting for agents"), "{index}");
+
+ // And bob is still refused the restricted project's own page.
+ let (status, body) = get_text(&web, "/w/default/acme-client-work", Some(bob)).await;
+ assert_eq!(status, StatusCode::FORBIDDEN);
+ assert!(!body.contains("Confidential reply"), "{body}");
+}
+
+/// A long inbox is capped on the page, and the page says how many it hides.
+#[tokio::test]
+async fn web_mailbox_says_how_many_pending_messages_it_does_not_list() {
+ let (_tmp, store, wiki) = setup().await;
+ let ws = store
+ .writer
+ .get_or_create_workspace("default")
+ .await
+ .unwrap();
+ let sender = store
+ .writer
+ .get_or_create_project(ws, "sender", None)
+ .await
+ .unwrap();
+ let recipient = store
+ .writer
+ .get_or_create_project(ws, "recipient", None)
+ .await
+ .unwrap();
+ for n in 1..=7 {
+ send_mail(
+ &store,
+ (ws, sender),
+ (ws, recipient),
+ &format!("request {n}"),
+ "body",
+ )
+ .await;
+ }
+
+ let web = router(store.reader.clone(), wiki.clone());
+ let (_, body) = get_text(&web, "/w/default/recipient", None).await;
+ assert!(body.contains("5 of 7 pending"), "{body}");
+ assert!(body.contains("request 1"), "oldest first: {body}");
+ assert!(body.contains("request 5"), "{body}");
+ assert!(!body.contains("request 6"), "capped at five: {body}");
+}
diff --git a/docs/agent-messaging.md b/docs/agent-messaging.md
index 110efde3..0328e409 100644
--- a/docs/agent-messaging.md
+++ b/docs/agent-messaging.md
@@ -130,6 +130,25 @@ is a bounded, best-effort signal, not a durable queue, processing acknowledgment
or automatic agent wakeup. Consumers still need their own deduplication and
recovery policy. This does not add a notification for raw Stop observations.
+## In the web UI
+
+The `/web` UI is read-only here too. A project card shows an amber `N inbox`
+badge when messages are pending for that project, and nothing when there are
+none. The home page adds a one-line summary of the total with links to the
+projects holding mail. The project page has a Mailbox section above Recent
+Activity listing up to five pending messages, oldest first, with the subject,
+the sender, a 160-character snippet and the age; when more are pending it says
+"5 of N" and points at `ai-memory message list`, and when none are waiting it
+says so. The section never pops or cancels: consuming a message stays an agent
+action (`memory_message_pop`), so the claim-once queue is not reachable from a
+browser. Only the inbox is shown; sent mail is still `memory_message_list`
+with `box=outbox`.
+
+A message is addressed to a project, so anyone who can read that project sees
+it. The sender's name is a separate matter: if the viewer may not read the
+sender's repository the page shows "a project you cannot read" instead of its
+name and does not link it.
+
## Security — a popped message is untrusted input
A popped message was composed by an agent in **another** project. Treat the body
diff --git a/docs/security-boundaries.md b/docs/security-boundaries.md
index 0df75944..e64dd206 100644
--- a/docs/security-boundaries.md
+++ b/docs/security-boundaries.md
@@ -58,6 +58,7 @@ means the boundary is not built yet.
| 8c | Messaging: pop-exactly-once | `ai-memory-store/src/ops.rs` `pop_message_in_transaction` atomic CAS `WHERE state='pending'` | `agent_messages.rs` — sequential **and** `tokio::join!` concurrent double-pop yields exactly one `Some` | STRONG |
| 8d | Messaging: an inferred scope never changes a queue; a read names it (#854) | `scope.rs` `ScopeSource::is_inferred`; `ai-memory-mcp/src/server.rs` `refuse_inferred_message_scope`, called by `memory_message_pop` and `memory_message_cancel` (mailbox scope) and `memory_message_send` (sender scope) before admission or any writer call, so a `shared_slot`/`startup_seed`/`default`/`default_after_mismatch` scope is refused with nothing claimed, cancelled, or delivered; `inferred_scope_hint` on every inferred `memory_message_list` (inbox and outbox, empty or not); the SessionStart notice (`ai-memory-hooks/src/router.rs` `render_inbox_notice`) and `memory_briefing` `scope` name the inbox from server-side names only | `agent_messages_scope.rs` `unscoped_pop_from_the_shared_slot_is_refused_and_claims_nothing`, `unscoped_cancel_from_the_shared_slot_is_refused_and_the_outbox_survives`, `unscoped_send_from_the_shared_slot_is_refused_and_explicit_sender_is_stamped` (each with the shared slot on another project; session-bound and explicit callers as controls; each fails with the guard removed), `unscoped_list_names_the_mailbox_it_read_even_when_not_empty`; `agent_messages_briefing.rs` `no_scope_pop_is_refused_and_the_briefing_names_the_inbox_to_pop`, `no_scope_inbox_list_that_misses_the_mail_names_the_inferred_scope`; router `session_start_notice_surfaces_pending_mail_without_consuming_it` (names the inbox, carries no message text) | STRONG |
| 8e | Messaging: admission is the same for MCP and admin sends (#756) | `ai-memory-mcp/src/admin.rs` `handle_send_message` runs `Wiki::authorize_operation(.., AdmissionOp::MessageSend, ..)` at the recipient scope before `insert_message` (a refusal is 403 and stores nothing) and calls `notify_operation_observers` only after a successful commit; skipping webhooks needs `Capability::SkipAdmissionChain` (`skip_webhooks_for_admin_request`); the MCP path is `server.rs` `memory_message_send` | `admin.rs` `admin_message_send_reject_leaves_inbox_empty` (a rejecting webhook gets 403 and an empty inbox; fails with the admission call removed), controls `admin_message_send_observer_sees_commit_without_blocking_response` and `admin_message_send_full_inbox_does_not_notify_observer` | STRONG |
+| 8f | Messaging: the web mailbox shows a restricted sender's name and a card's count only to a reader of that repository; it never consumes mail | `ai-memory-store/src/reader.rs` `list_inbox_with_senders` (`readable_repository_predicate("sp.id", viewer)` on the sender join, so the name is `NULL` for an unreadable sender) and `pending_inbox_counts` (`readable_repository_predicate("p.id", viewer)`); `ai-memory-web/src/routes/project.rs` `mailbox` is `list`-only, no pop/cancel route exists | `routes.rs` `web_mailbox_hides_restricted_sender_names_and_cards` (a granted reader of the recipient is shown "a project you cannot read", the restricted sender's name and card never reach the grid, alice as the control; fails with either predicate removed), `web_mailbox_lists_only_this_projects_inbox_and_never_consumes_it` (sender and bystander pages show nothing of the recipient's mail, a POST is 405 and the message is still pending, the body is HTML-escaped) | STRONG |
| 9 | Scope resolution fail-closed | `ai-memory-store/src/scope.rs` no-create `lookup_existing_*`; identity-aware lookup accepts exact/canonical/v2-basename keys only when they deduplicate to one UUID; `ops.rs` `resolve_project_name_for_write` performs write authorization, optional name-only promotion, and audit in one writer transaction; create only via `create_explicit_scope`. `ProjectNameAmbiguous` refuses cross-forge/multi-candidate keys before mutation; its message names each holder and the key it matched by, but a restricted holder only as "a restricted project", because the lookup runs before any caller is authorized and the project list hides restricted names from callers without a grant; an audit failure after the name UPDATE rolls the transaction back. V76's derived-key indexes bound hot lookup to exact/canonical/legacy equality probes with at most four rows. Promoting public APIs return `ResolvedWriteScope` metadata (no untraced promotion API); MCP, admin, and managed-workstream write entry points make Wiki refresh/checkpoint the committed scope manifest after promotion and surface `manifest_warning` on success or any later operation failure; pure managed-run input validation precedes promotion. A managed run whose `project` is the name its checkout's git remote derives (`PrepareManagedRunRequest.repository_identity`, accepted only through `accept_wire_identity` and only when `path_style_name` equals the requested name) resolves through `resolve_project_by_identity_for_capture` — the identity holder, else the cwd-prefix project with `$HOME` excluded, claimed or renamed only for a writer — and then `authorize_scope_for(Write)` on the writer connection, so an identity can neither redirect a differently named run nor open, claim, or create a project the caller may not write; Project manifests persist the typed full identity/source and derived keys so clean reindex restores the same UUID and lookup behavior. Also `ai-memory-hooks/src/router.rs` `workspace_override_is_rescope` — the hook router's session-sticky gate resolves a marker's `workspace` override via this same no-create `lookup_existing_workspace` (never a hand-rolled lookup) and fails closed (treats it as a rescope, disqualifying sticky) on a different or unresolvable workspace; only an override that resolves to the session's OWN workspace is not a rescope (#976) | `scope.rs` `read_resolution_table_driven`, `multi_scope_resolution_deduplicates_and_validates`, `a_slashed_label_reaches_only_a_project_the_caller_may_use` (a `workspace/project` label passed as the project is authorized as the pair it names and creates nothing when refused; granted control), `a_slashed_write_resolves_its_own_pair_and_never_creates`, `an_existing_slashed_project_wins_over_the_split`, no-auto-create + `unscoped_write_with_unresolvable_coordinate_errors`; `dual_key_scope.rs` `page_write_failure_after_promotion_preserves_manifest_warning`, `handoff_failure_after_promotion_preserves_manifest_warning`; `workstream.rs` `managed_run_rejects_mutually_exclusive_selection_before_promotion`, `managed_run_downstream_failure_after_promotion_preserves_manifest_warning`; `identity_resolution.rs` `canonical_and_legacy_reads_resolve_one_legacy_row_without_renaming`, `authorized_write_promotes_in_place_and_preserves_dependents_and_legacy_lookup`, `read_only_user_cannot_promote_a_legacy_name`, `canonical_target_conflict_rolls_back_the_promotion`, `audit_failure_rolls_back_promotion_and_keeps_the_writer_alive`, `exact_name_that_is_another_forges_canonical_key_fails_closed`, `an_ambiguous_name_names_its_holders_but_not_a_restricted_one` (restricted holder unnamed; open holder named as the control), `concurrent_legacy_and_canonical_resolve_or_create_converge_on_one_uuid`; `project_coordinates.rs` `shared_candidate_query_deduplicates_before_bound_and_uses_only_indexes`; wiki `promoted_identity_round_trips_through_manifest_and_clean_reindex`, `old_project_manifest_without_identity_still_reindexes`, `reindex_rejects_project_coordinate_fields_that_do_not_match_identity`; admin `write_page_surfaces_manifest_failure_after_promotion`, `bootstrap_surfaces_manifest_failure_after_promotion`, `move_project_merge_surfaces_destination_promotion_manifest_warning`, `move_session_create_surfaces_destination_promotion_manifest_warning`; `multi_session.rs` `two_operators_promote_two_clone_keys_to_one_uuid_without_moving_active_pointers`; MCP `dual_key_scope.rs`; hooks `workstream.rs` `managed_run_by_remote_identity_claims_the_folder_named_project`, `managed_run_by_remote_identity_routes_past_an_identityless_twin` (name-only control is ambiguous), `managed_run_identity_never_redirects_another_project_name`, `managed_run_by_remote_identity_refuses_a_viewer_without_write` (outsider refused with no project created; granted member admitted as the control), `managed_run_identity_never_claims_a_restricted_legacy_project` (an outsider whose cwd sits in a restricted identity-less project is refused, the identity stays unrecorded and no twin appears; fails with either the writer's claim check or the route's write check removed; a granted member claims it as the control), `managed_run_identity_routing_stays_inside_the_requested_workspace`, `concurrent_identity_runs_on_a_legacy_project_converge_on_it` (invariant #16), `managed_run_promotion_refreshes_the_scope_manifest`, `managed_run_discloses_manifest_failure_after_committed_promotion` static read/write/authz/cross-workspace/cross-forge cases; `router.rs` `workspace_override_is_rescope_only_on_a_genuine_workspace_change` (same/different/unresolvable workspace cases), `sticky_routing_keeps_the_session_project_across_a_sibling_checkout` (regression: same workspace forwarded on every event + `project_src=repo-root` from a nested checkout stays sticky), `sticky_routing_still_rescopes_when_marker_names_a_different_workspace_mid_session` (opposite direction: a genuinely different workspace still rescopes even under `sticky`) | STRONG |
| 10 | Destructive-op live-process refusal + confirm flags (invariant #9); `purge-project`'s `dry_run` always wins over `confirm` so a preview request can never become destructive | `ai-memory-cli/src/commands/process_guard.rs` `sibling_processes` + confirm flags in `reset`/`restore`/`reindex`/`uninstall --purge-data`/`purge_project`; `admin.rs` `handle_purge_project` checks `req.dry_run` unconditionally, before `req.confirm`, mirroring `reclaim-ledger-versions` | `admin_purge.rs` confirm→400; `removal.rs` — injected live-sibling makes each destructive command bail before touching the data dir; `admin_purge.rs` `purge_project_confirm_true_and_dry_run_true_still_only_previews` — `{"confirm": true, "dry_run": true}` deletes nothing (the regression this row now also covers); `ops.rs` `purge_project_dry_run_changes_nothing` — every project-scoped row count, the `purged_scopes` tombstone, and the `audit_log` row are identical before/after a `PurgeMode::Preview` run; `ops.rs` `purge_project_counts_collateral_damage_in_another_project` and `admin_purge.rs` `purge_project_dry_run_and_confirmed_purge_both_report_collateral_damage_in_another_project` — a purge of project P collaterally deletes an observation, and orphans a handoff's session reference, in a *different* project Q (via `sessions` cascading out of P), and both the preview and the confirmed report count it | STRONG |
| 10b | Session purge is scope+owner-bound (no cross-session/project over-delete); `purge-session`'s `dry_run` always wins over `confirm`, same as `purge-project` | `ai-memory-store/src/ops.rs` `purge_session` — selection scoped to `(workspace_id, project_id)` and keyed on this session's own `summary_page_id` **or** `path='sessions/<sid>.md'` + `json_extract(frontmatter_json,'$.session_id')=<sid>` (frontmatter owner, not the recursive latest-chain); `in_scope==0 → NotFound` fail-closed; the session's prompt `profile_candidates` (`source_ref = 'session:<sid>'`, a globally unique id) are deleted in whichever project the harvest filed them, matching the `observations` cascade they were harvested from; whole op in one transaction, and the tombstone it leaves is checked by `begin_session_row` and by the new-session arm of `admit_hook_session_event`; `move_project_workspace` re-stamps the `purged_sessions` tombstone with the rest of the project so it still matches after a move; `admin.rs` `handle_purge_session` checks `req.dry_run` unconditionally, before `req.confirm` | `ops.rs` `purge_session_leaves_a_sibling_session_in_the_same_project_intact`, `…refuses_a_session_from_another_project_and_deletes_nothing`, `…refuses_a_session_from_another_workspace`, `…does_not_delete_an_identically_pathed_page_in_another_project`, `…removes_older_summary_versions_without_deleting_prior_manual_page` (#862); `admin_purge.rs` `purge_session_confirm_true_and_dry_run_true_still_only_previews` — `{"confirm": true, "dry_run": true}` deletes nothing; `ops.rs` `purge_session_dry_run_changes_nothing` — every table a session purge touches, the `purged_sessions` tombstone, and the `audit_log` row are identical before/after a `PurgeMode::Preview` run; `ops.rs` `purge_session_counts_collateral_damage_in_another_project` and `admin_purge.rs` `purge_session_dry_run_and_confirmed_purge_both_report_collateral_damage_in_another_project` — purging session S collaterally deletes an observation, and orphans a handoff's session reference, in a *different* project (via `S`'s own id cascading), and both the preview and the confirmed report count it; `admin_purge.rs` `purge_session_dry_run_refuses_a_session_outside_its_named_scope` — the same session previewed under a different real project (same workspace) or a different real workspace whose project shares the name both 404 with no counts in the body, with the session's own scope as the 200 control; the `purged_sessions` tombstone holds against live hook ingest as well as `begin_session`: `ops.rs` `a_purged_session_is_not_recreated_by_hook_admission` (`admit_hook_session_event` refuses a purged session and writes nothing, with a sibling session and the same id in another project admitted as controls) and `router.rs` `async_processing_drops_events_of_a_purged_session` (the late delivery is a terminal `dropped_invalid`, not a failure the client retries) and `batch_drops_a_purged_session_then_commits_next_item` (the batch endpoint acknowledges it as `dropped_invalid` and commits the next item instead of stopping fail-fast); the user's own sentences the profile harvested from the session's prompts go with it: `ops.rs` `purge_session_deletes_the_profile_candidates_harvested_from_it` (including the candidate harvested from a prompt the session recorded in another project, whose observation the purge deletes through the cascade; a sibling session's candidates in both projects and a page candidate survive); `ops.rs` `a_purged_session_stays_purged_after_its_project_moves` (after `move-project`, `begin_session` for the purged id in the destination is refused with `SessionPurged`; a fresh session there is admitted as the control) | STRONG |