Skip to content

armgit / xerj

Public Imported from GitHub
0

AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory and RAG. Elasticsearch-compatible API; Corpus Hub serves hundreds of reference memory corpora.

Rename the embedded Console UX dir: playground/ -> xerj-ux/

xerj-orgf5fbf536dcc5
diff --git a/engine/crates/xerj-console-api/Cargo.toml b/engine/crates/xerj-console-api/Cargo.toml
index 339241fae..4a83a5dd1 100644
--- a/engine/crates/xerj-console-api/Cargo.toml
+++ b/engine/crates/xerj-console-api/Cargo.toml
@@ -6,8 +6,8 @@ license.workspace = true
authors.workspace = true
description = "Xerj Console backend API: dashboards, auth, prefs, cluster awareness, and pluggable data sources. Ships compiled into the xerj v1.0 binary; extracts post-v1.0 as a standalone product that can target any data source."
-# Bundles the playground SPA (HTML/CSS/JS) into the binary. Walks the
-# playground/ source tree at compile time and emits a `(url, bytes,
+# Bundles the Xerj Console UX (xerj-ux/) (HTML/CSS/JS) into the binary. Walks the
+# xerj-ux/ source tree at compile time and emits a `(url, bytes,
# content_type)` slice consumed by `src/spa.rs`.
build = "build.rs"
diff --git a/engine/crates/xerj-console-api/build.rs b/engine/crates/xerj-console-api/build.rs
index a68d4cc78..8ca1b1c37 100644
--- a/engine/crates/xerj-console-api/build.rs
+++ b/engine/crates/xerj-console-api/build.rs
@@ -1,19 +1,18 @@
-// Bundle the Xerj Console playground (typography-first observability UI)
+// Bundle the Xerj Console UX (typography-first observability SPA)
// into the xerj binary at compile time.
//
-// We walk a single source directory (the playground repo lives next
-// to the engine in this monorepo: ../../../xerj.ai/playground) and
+// We walk a single source directory (`xerj-ux/` at the repo root) and
// emit `$OUT_DIR/xerj_console_assets.rs` with a const slice of
// (path, bytes) entries. The asset paths are relative to the
-// playground root and used as the URL path under `/_xerj-console/`.
+// xerj-ux root and used as the URL path under `/_xerj-console/`.
//
// We deliberately ship only HTML / CSS / JS / SVG / WOFF — anything
// the runtime would never serve to a browser stays out. Files larger
// than 4 MiB are skipped with a build-script warning so an accidental
-// PDF in the playground tree doesn't bloat the binary.
+// PDF in the UX tree doesn't bloat the binary.
//
// Re-run logic: cargo invokes this script when build.rs itself
-// changes OR when any file under the playground source tree is
+// changes OR when any file under the xerj-ux source tree is
// modified (we emit `cargo:rerun-if-changed` for each one).
use std::env;
@@ -22,14 +21,12 @@ use std::io::Write;
use std::path::{Path, PathBuf};
// Path-resolution strategy: try multiple relative paths so the build
-// works in both the monorepo root layout (xerj.ai/) and the engine-
-// worktree layout (xerj-es-compat-work/engine/, with xerj.ai
-// alongside as a sibling worktree).
-const PLAYGROUND_RELS: &[&str] = &[
- "../../../xerj.ai/playground", // engine/crates/api → root → xerj.ai
- "../../../../xerj.ai/playground", // worktree → parent → xerj.ai (sibling)
- "../../playground", // direct sibling layout
- "../../../playground", // alternate
+// works from the repo-root layout and from an engine-worktree layout
+// (engine/ checked out separately, with the repo root alongside).
+const UX_RELS: &[&str] = &[
+ "../../../xerj-ux", // engine/crates/api → repo root → xerj-ux
+ "../../../../xerj-ux", // worktree → parent → xerj-ux (sibling)
+ "../../xerj-ux", // direct sibling layout
];
const ALLOWED_EXTS: &[&str] = &["html", "css", "js", "svg", "ico", "woff", "woff2", "png"];
const MAX_FILE_BYTES: u64 = 4 * 1024 * 1024;
@@ -39,35 +36,34 @@ fn main() {
let manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
// Walk the candidate list and pick the first one that resolves to
- // an existing playground directory.
- let playground_root_canonical = PLAYGROUND_RELS
+ // an existing xerj-ux directory.
+ let ux_root = UX_RELS
.iter()
.map(|rel| manifest_dir.join(rel))
.find_map(|p| fs::canonicalize(&p).ok())
.or_else(|| {
// Last-ditch: env var override for CI / monorepo packaging.
- env::var("XERJ_CONSOLE_PLAYGROUND_DIR").ok().and_then(|p| fs::canonicalize(p).ok())
+ env::var("XERJ_CONSOLE_UX_DIR").ok().and_then(|p| fs::canonicalize(p).ok())
});
- let playground_root_canonical = match playground_root_canonical {
+ let ux_root = match ux_root {
Some(p) => p,
None => {
- // Playground checkout missing — emit an empty asset table
- // so the engine still builds (e.g. release tarballs that
- // omit the playground source).
+ // xerj-ux checkout missing — emit an empty asset table so the
+ // engine still builds (e.g. release tarballs that omit the UX).
write_assets(&[], &manifest_dir);
println!(
- "cargo:warning=xerj-console playground not found in any of: {:?} — asset table will be empty (set XERJ_CONSOLE_PLAYGROUND_DIR to override)",
- PLAYGROUND_RELS,
+ "cargo:warning=xerj-ux not found in any of: {:?} — Console asset table will be empty (set XERJ_CONSOLE_UX_DIR to override)",
+ UX_RELS,
);
return;
}
};
let mut entries: Vec<(String, PathBuf)> = Vec::new();
- walk(&playground_root_canonical, &playground_root_canonical, &mut entries);
+ walk(&ux_root, &ux_root, &mut entries);
entries.sort();
- write_assets(&entries, &playground_root_canonical);
+ write_assets(&entries, &ux_root);
}
fn walk(root: &Path, dir: &Path, out: &mut Vec<(String, PathBuf)>) {
@@ -77,9 +73,9 @@ fn walk(root: &Path, dir: &Path, out: &mut Vec<(String, PathBuf)>) {
};
for entry in read.flatten() {
let path = entry.path();
- // Skip hidden files / dirs and node_modules (the playground
- // is currently a static SPA but a future build step might
- // pull deps).
+ // Skip hidden files / dirs and node_modules (xerj-ux is
+ // currently a buildless static SPA but a future build step
+ // might pull deps).
let name = path.file_name().and_then(|n| n.to_str()).unwrap_or("");
if name.starts_with('.') || name == "node_modules" {
continue;
@@ -119,14 +115,14 @@ fn walk(root: &Path, dir: &Path, out: &mut Vec<(String, PathBuf)>) {
}
}
-fn write_assets(entries: &[(String, PathBuf)], _playground_root: &Path) {
+fn write_assets(entries: &[(String, PathBuf)], _ux_root: &Path) {
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
let out_path = out_dir.join("xerj_console_assets.rs");
let mut f = fs::File::create(&out_path).expect("create xerj_console_assets.rs");
writeln!(
f,
- "// auto-generated by build.rs — Xerj Console playground asset bundle\n\
+ "// auto-generated by build.rs — Xerj Console UX asset bundle\n\
//\n\
// (url_path, bytes, content_type) tuples. Order is sorted-by-path\n\
// so the runtime can binary-search by path.\n\
diff --git a/engine/crates/xerj-console-api/src/prefs.rs b/engine/crates/xerj-console-api/src/prefs.rs
index 28eef61d3..b88654be7 100644
--- a/engine/crates/xerj-console-api/src/prefs.rs
+++ b/engine/crates/xerj-console-api/src/prefs.rs
@@ -1,6 +1,6 @@
//! Per-user UI preferences — `GET /prefs` and `PUT /prefs`.
//!
-//! Replaces every `localStorage["xerj.*"]` write the playground does
+//! Replaces every `localStorage["xerj.*"]` write the Console UX does
//! today: theme, default cluster, time range, mobile flag, search-box
//! contents. We don't constrain the schema — the doc is whatever
//! key/value pairs the SPA asks us to round-trip — but `_id` is always
diff --git a/engine/crates/xerj-console-api/src/spa.rs b/engine/crates/xerj-console-api/src/spa.rs
index 16657b9dc..966b68eb1 100644
--- a/engine/crates/xerj-console-api/src/spa.rs
+++ b/engine/crates/xerj-console-api/src/spa.rs
@@ -1,6 +1,6 @@
-//! Xerj Console playground — embedded UI bundle served at `/_xerj-console`.
+//! Xerj Console UX — embedded UI bundle served at `/_xerj-console`.
//!
-//! `build.rs` walks the playground source tree at compile time and
+//! `build.rs` walks the xerj-ux source tree at compile time and
//! generates `OUT_DIR/xerj_console_assets.rs` with a sorted slice of
//! `(url_path, bytes, content_type)` tuples. This module includes
//! that slice and exposes one Axum handler that does an O(log n)
@@ -9,8 +9,8 @@
//! ## URL shape
//!
//! ```text
-//! GET /_xerj-console → playground index.html (302 to /_xerj-console/)
-//! GET /_xerj-console/ → playground index.html (200, text/html)
+//! GET /_xerj-console → Console index.html (302 to /_xerj-console/)
+//! GET /_xerj-console/ → Console index.html (200, text/html)
//! GET /_xerj-console/{path*} → static asset by path, 404 if missing
//! ```
//!
@@ -38,7 +38,7 @@ fn find_asset(path: &str) -> Option<&'static (&'static str, &'static [u8], &'sta
XERJ_CONSOLE_ASSETS.iter().find(|(p, _, _)| *p == path)
}
-/// Serve the playground's index.html for `/_xerj-console/`.
+/// Serve the Console's index.html for `/_xerj-console/`.
pub async fn xerj_console_index() -> impl IntoResponse {
serve("index.html", true)
}
@@ -107,7 +107,7 @@ fn serve_asset(
}
/// Number of bundled assets — exposed for the startup banner so
-/// operators see at-a-glance whether the playground was bundled.
+/// operators see at-a-glance whether the Console UX was bundled.
pub fn asset_count() -> usize {
XERJ_CONSOLE_ASSETS.len()
}
diff --git a/engine/crates/xerj-console-api/tests/spa_assets.rs b/engine/crates/xerj-console-api/tests/spa_assets.rs
index 65c5833dd..7ec38cd1f 100644
--- a/engine/crates/xerj-console-api/tests/spa_assets.rs
+++ b/engine/crates/xerj-console-api/tests/spa_assets.rs
@@ -1,6 +1,6 @@
//! Smoke tests for the bundled Xerj Console SPA assets.
//!
-//! `build.rs` walks the playground/ source tree at compile time and
+//! `build.rs` walks the xerj-ux/ source tree at compile time and
//! emits a static `(url_path, bytes, content_type)` slice. These tests
//! confirm the runtime serves the files the demo flow depends on:
//! setup.html, login.html, the auth + sync JS modules, and the
diff --git a/landing/aise-demo.html b/landing/aise-demo.html
index b3905d95f..b784bad0f 100644
--- a/landing/aise-demo.html
+++ b/landing/aise-demo.html
@@ -80,7 +80,7 @@
<h2>Three points the v2 demo answers explicitly</h2>
<ol>
<li><strong>Why does the boot banner say "XERJ CONSOLE"?</strong> Because Xerj Console (the bundled UI) prints its own first-launch claim banner. The server (Xerj) prints its own version line one paragraph above; v2 highlights it.</li>
- <li><strong>Where do the dashboards come from?</strong> Eight templates ship as code under <code>playground/src/dashboards/*.js</code>, bundled into the binary at compile time. The <strong>data</strong> they render comes from whatever you POST to <code>/_bulk</code>; users can rename / hide / clone via the SETTINGS section but the templates are versioned with the code.</li>
+ <li><strong>Where do the dashboards come from?</strong> Eight templates ship as code under <code>xerj-ux/src/dashboards/*.js</code>, bundled into the binary at compile time. The <strong>data</strong> they render comes from whatever you POST to <code>/_bulk</code>; users can rename / hide / clone via the SETTINGS section but the templates are versioned with the code.</li>
<li><strong>How is the data added to a dashboard?</strong> It isn't — pull-based. Drop docs into the <code>chat-events</code> / <code>vector-ops</code> / <code>agent-memory</code> / <code>anomalies</code> / <code>ingest-events</code> / <code>ai-kb</code> indices and the matching dashboards' adapters auto-pick them up via <code>_search</code> aggregations. No "connect data source to dashboard" step required.</li>
</ol>
</div>
diff --git a/landing/demo/index.html b/landing/demo/index.html
index 3e9224a89..f1b21c5ae 100644
--- a/landing/demo/index.html
+++ b/landing/demo/index.html
@@ -759,7 +759,7 @@ node demo/scripts/full-demo-flow.js
the corpus, the dashboard changes. Delete the index, the SPA's
live adapter returns <code>null</code> and the panel collapses to
its mock skeleton (visible difference, no silent fallback). Code
- path: <code><a href="https://github.com/xerj-ai/xerj/blob/main/playground/src/data/backends/xerj.js">playground/src/data/backends/xerj.js</a></code>
+ path: <code><a href="https://github.com/xerj-ai/xerj/blob/main/xerj-ux/src/data/backends/xerj.js">xerj-ux/src/data/backends/xerj.js</a></code>
function <code>liveAiOverview()</code> at line ~378.
</p>
diff --git a/playground/assets/base.css b/xerj-ux/assets/base.css
similarity index 100%
rename from playground/assets/base.css
rename to xerj-ux/assets/base.css
diff --git a/playground/assets/tokens.css b/xerj-ux/assets/tokens.css
similarity index 100%
rename from playground/assets/tokens.css
rename to xerj-ux/assets/tokens.css
diff --git a/playground/docs/api-wiring.md b/xerj-ux/docs/api-wiring.md
similarity index 100%
rename from playground/docs/api-wiring.md
rename to xerj-ux/docs/api-wiring.md
diff --git a/playground/index.html b/xerj-ux/index.html
similarity index 100%
rename from playground/index.html
rename to xerj-ux/index.html
diff --git a/playground/login.html b/xerj-ux/login.html
similarity index 100%
rename from playground/login.html
rename to xerj-ux/login.html
diff --git a/playground/setup.html b/xerj-ux/setup.html
similarity index 100%
rename from playground/setup.html
rename to xerj-ux/setup.html
diff --git a/playground/src/app.js b/xerj-ux/src/app.js
similarity index 100%
rename from playground/src/app.js
rename to xerj-ux/src/app.js
diff --git a/playground/src/dashboards/agent-memory.js b/xerj-ux/src/dashboards/agent-memory.js
similarity index 100%
rename from playground/src/dashboards/agent-memory.js
rename to xerj-ux/src/dashboards/agent-memory.js
diff --git a/playground/src/dashboards/ai-overview.js b/xerj-ux/src/dashboards/ai-overview.js
similarity index 100%
rename from playground/src/dashboards/ai-overview.js
rename to xerj-ux/src/dashboards/ai-overview.js
diff --git a/playground/src/dashboards/alerts.js b/xerj-ux/src/dashboards/alerts.js
similarity index 100%
rename from playground/src/dashboards/alerts.js
rename to xerj-ux/src/dashboards/alerts.js
diff --git a/playground/src/dashboards/anomaly-detect.js b/xerj-ux/src/dashboards/anomaly-detect.js
similarity index 100%
rename from playground/src/dashboards/anomaly-detect.js
rename to xerj-ux/src/dashboards/anomaly-detect.js
diff --git a/playground/src/dashboards/data.js b/xerj-ux/src/dashboards/data.js
similarity index 100%
rename from playground/src/dashboards/data.js
rename to xerj-ux/src/dashboards/data.js
diff --git a/playground/src/dashboards/ingest-pipeline.js b/xerj-ux/src/dashboards/ingest-pipeline.js
similarity index 100%
rename from playground/src/dashboards/ingest-pipeline.js
rename to xerj-ux/src/dashboards/ingest-pipeline.js
diff --git a/playground/src/dashboards/logs-overview.js b/xerj-ux/src/dashboards/logs-overview.js
similarity index 100%
rename from playground/src/dashboards/logs-overview.js
rename to xerj-ux/src/dashboards/logs-overview.js
diff --git a/playground/src/dashboards/rag-quality.js b/xerj-ux/src/dashboards/rag-quality.js
similarity index 100%
rename from playground/src/dashboards/rag-quality.js
rename to xerj-ux/src/dashboards/rag-quality.js
diff --git a/playground/src/dashboards/registry.js b/xerj-ux/src/dashboards/registry.js
similarity index 100%
rename from playground/src/dashboards/registry.js
rename to xerj-ux/src/dashboards/registry.js
diff --git a/playground/src/dashboards/search-discover.js b/xerj-ux/src/dashboards/search-discover.js
similarity index 100%
rename from playground/src/dashboards/search-discover.js
rename to xerj-ux/src/dashboards/search-discover.js
diff --git a/playground/src/dashboards/settings.js b/xerj-ux/src/dashboards/settings.js
similarity index 100%
rename from playground/src/dashboards/settings.js
rename to xerj-ux/src/dashboards/settings.js
diff --git a/playground/src/dashboards/system.js b/xerj-ux/src/dashboards/system.js
similarity index 100%
rename from playground/src/dashboards/system.js
rename to xerj-ux/src/dashboards/system.js
diff --git a/playground/src/dashboards/users.js b/xerj-ux/src/dashboards/users.js
similarity index 100%
rename from playground/src/dashboards/users.js
rename to xerj-ux/src/dashboards/users.js
diff --git a/playground/src/dashboards/vector-index.js b/xerj-ux/src/dashboards/vector-index.js
similarity index 100%
rename from playground/src/dashboards/vector-index.js
rename to xerj-ux/src/dashboards/vector-index.js
diff --git a/playground/src/data/backends/index.js b/xerj-ux/src/data/backends/index.js
similarity index 100%
rename from playground/src/data/backends/index.js
rename to xerj-ux/src/data/backends/index.js
diff --git a/playground/src/data/backends/mock.js b/xerj-ux/src/data/backends/mock.js
similarity index 100%
rename from playground/src/data/backends/mock.js
rename to xerj-ux/src/data/backends/mock.js
diff --git a/playground/src/data/backends/xerj.js b/xerj-ux/src/data/backends/xerj.js
similarity index 100%
rename from playground/src/data/backends/xerj.js
rename to xerj-ux/src/data/backends/xerj.js
diff --git a/playground/src/data/dashboard-store.js b/xerj-ux/src/data/dashboard-store.js
similarity index 100%
rename from playground/src/data/dashboard-store.js
rename to xerj-ux/src/data/dashboard-store.js
diff --git a/playground/src/data/data-sources.js b/xerj-ux/src/data/data-sources.js
similarity index 100%
rename from playground/src/data/data-sources.js
rename to xerj-ux/src/data/data-sources.js
diff --git a/playground/src/data/export.js b/xerj-ux/src/data/export.js
similarity index 100%
rename from playground/src/data/export.js
rename to xerj-ux/src/data/export.js
diff --git a/playground/src/data/feedback-citations.js b/xerj-ux/src/data/feedback-citations.js
similarity index 100%
rename from playground/src/data/feedback-citations.js
rename to xerj-ux/src/data/feedback-citations.js
diff --git a/playground/src/data/mock.js b/xerj-ux/src/data/mock.js
similarity index 100%
rename from playground/src/data/mock.js
rename to xerj-ux/src/data/mock.js
diff --git a/playground/src/data/query.js b/xerj-ux/src/data/query.js
similarity index 100%
rename from playground/src/data/query.js
rename to xerj-ux/src/data/query.js
diff --git a/playground/src/ux/chart-types.js b/xerj-ux/src/ux/chart-types.js
similarity index 100%
rename from playground/src/ux/chart-types.js
rename to xerj-ux/src/ux/chart-types.js
diff --git a/playground/src/ux/charts-ai.js b/xerj-ux/src/ux/charts-ai.js
similarity index 100%
rename from playground/src/ux/charts-ai.js
rename to xerj-ux/src/ux/charts-ai.js
diff --git a/playground/src/ux/charts-ext.js b/xerj-ux/src/ux/charts-ext.js
similarity index 100%
rename from playground/src/ux/charts-ext.js
rename to xerj-ux/src/ux/charts-ext.js
diff --git a/playground/src/ux/charts-ops.js b/xerj-ux/src/ux/charts-ops.js
similarity index 100%
rename from playground/src/ux/charts-ops.js
rename to xerj-ux/src/ux/charts-ops.js
diff --git a/playground/src/ux/charts.js b/xerj-ux/src/ux/charts.js
similarity index 100%
rename from playground/src/ux/charts.js
rename to xerj-ux/src/ux/charts.js
diff --git a/playground/src/ux/chrome.js b/xerj-ux/src/ux/chrome.js
similarity index 100%
rename from playground/src/ux/chrome.js
rename to xerj-ux/src/ux/chrome.js
diff --git a/playground/src/ux/layout.js b/xerj-ux/src/ux/layout.js
similarity index 100%
rename from playground/src/ux/layout.js
rename to xerj-ux/src/ux/layout.js
diff --git a/playground/src/ux/tables.js b/xerj-ux/src/ux/tables.js
similarity index 100%
rename from playground/src/ux/tables.js
rename to xerj-ux/src/ux/tables.js
diff --git a/playground/src/ux/text.js b/xerj-ux/src/ux/text.js
similarity index 100%
rename from playground/src/ux/text.js
rename to xerj-ux/src/ux/text.js
diff --git a/playground/src/xerj-console-auth.js b/xerj-ux/src/xerj-console-auth.js
similarity index 100%
rename from playground/src/xerj-console-auth.js
rename to xerj-ux/src/xerj-console-auth.js
diff --git a/playground/src/xerj-console-sync.js b/xerj-ux/src/xerj-console-sync.js
similarity index 100%
rename from playground/src/xerj-console-sync.js
rename to xerj-ux/src/xerj-console-sync.js