vestige/apps/dashboard/.svelte-kit/output/server/chunks/api.js
Sam Valladares c2d28f3433 feat: Vestige v2.0.0 "Cognitive Leap" — 3D dashboard, HyDE search, WebSocket events
The biggest release in Vestige history. Complete visual and cognitive overhaul.

Dashboard:
- SvelteKit 2 + Three.js 3D neural visualization at localhost:3927/dashboard
- 7 interactive pages: Graph, Memories, Timeline, Feed, Explore, Intentions, Stats
- WebSocket event bus with 16 event types, real-time 3D animations
- Bloom post-processing, GPU instanced rendering, force-directed layout
- Dream visualization mode, FSRS retention curves, command palette (Cmd+K)
- Keyboard shortcuts, responsive mobile layout, PWA installable
- Single binary deployment via include_dir! (22MB)

Engine:
- HyDE query expansion (intent classification + 3-5 semantic variants + centroid)
- fastembed 5.11 with optional Nomic v2 MoE + Qwen3 reranker + Metal GPU
- Emotional memory module (#29)
- Criterion benchmark suite

Backend:
- Axum WebSocket at /ws with heartbeat + event broadcast
- 7 new REST endpoints for cognitive operations
- Event emission from MCP tools via shared broadcast channel
- CORS for SvelteKit dev mode

Distribution:
- GitHub issue templates (bug report, feature request)
- CHANGELOG with comprehensive v2.0 release notes
- README updated with dashboard docs, architecture diagram, comparison table

734 tests passing, zero warnings, 22MB release binary.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 03:07:25 -06:00

54 lines
1.9 KiB
JavaScript

const BASE = "/api";
async function fetcher(path, options) {
const res = await fetch(`${BASE}${path}`, {
headers: { "Content-Type": "application/json" },
...options
});
if (!res.ok) throw new Error(`API ${res.status}: ${res.statusText}`);
return res.json();
}
const api = {
// Memories
memories: {
list: (params) => {
const qs = params ? "?" + new URLSearchParams(params).toString() : "";
return fetcher(`/memories${qs}`);
},
get: (id) => fetcher(`/memories/${id}`),
delete: (id) => fetcher(`/memories/${id}`, { method: "DELETE" }),
promote: (id) => fetcher(`/memories/${id}/promote`, { method: "POST" }),
demote: (id) => fetcher(`/memories/${id}/demote`, { method: "POST" })
},
// Search
search: (q, limit = 20) => fetcher(`/search?q=${encodeURIComponent(q)}&limit=${limit}`),
// Stats & Health
stats: () => fetcher("/stats"),
health: () => fetcher("/health"),
// Timeline
timeline: (days = 7, limit = 200) => fetcher(`/timeline?days=${days}&limit=${limit}`),
// Graph
graph: (params) => {
const qs = params ? "?" + new URLSearchParams(
Object.entries(params).filter(([, v]) => v !== void 0).map(([k, v]) => [k, String(v)])
).toString() : "";
return fetcher(`/graph${qs}`);
},
// Cognitive operations
dream: () => fetcher("/dream", { method: "POST" }),
explore: (fromId, action = "associations", toId, limit = 10) => fetcher("/explore", {
method: "POST",
body: JSON.stringify({ from_id: fromId, action, to_id: toId, limit })
}),
predict: () => fetcher("/predict", { method: "POST" }),
importance: (content) => fetcher("/importance", {
method: "POST",
body: JSON.stringify({ content })
}),
consolidate: () => fetcher("/consolidate", { method: "POST" }),
retentionDistribution: () => fetcher("/retention-distribution"),
// Intentions
intentions: (status = "active") => fetcher(`/intentions?status=${status}`)
};
export {
api as a
};