npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

magic-context-web

v0.1.0

Published

Unofficial local web dashboard for CortexKit Magic Context

Readme

Magic Context Web Dashboard

An unofficial, lightweight web dashboard for Magic Context, modeled on the official Tauri desktop app. It provides a browser-based alternative for environments where the desktop runtime is unavailable.

Reads and writes Magic Context's SQLite database using the same direct-access approach as the official dashboard, then serves a single-page web UI.

Requirements

  • Node.js 18+ (for the npx launcher)
  • Python 3.8+ (dashboard backend; stdlib only, no dependencies)

Quick start

npx magic-context-web

The command downloads the package, starts the dashboard at http://127.0.0.1:9077/, and opens it in the default browser. Stop it with Ctrl+C. Magic Context must already be installed so its local context.db is available.

npx magic-context-web --port 8080
npx magic-context-web --db /path/to/context.db
npx magic-context-web --no-open

Local development

npm test
node bin/magic-context-web.cjs --no-open

Binds to 127.0.0.1 by default. Passing a non-loopback --host prints a warning (session data is served over plain HTTP; use an SSH tunnel instead). This package is community-maintained and is not an official CortexKit release.

Views

| View | Source tables | |---|---| | Overview | counts + DB/WAL sizes | | Memories | memories (search, status/category filters, pagination, bulk archive/restore, optimistic edit locking) | | Sessions | session_meta + related tables (search, harness filter, pagination, facts, notes, subagents, compartments, tags) | | Compartments | compartments | | Notes | notes | | Primers | primers | | Dreamer | dream_runs | | Historian | historian_runs | | Git Commits | git_commits | | Diagnostics | tags + pending_ops (drop timeline) | | Config | ~/.config/cortexkit/magic-context.jsonc |

Live updates

The page updates in real time: a background thread watches the DB/WAL files for changes (1 s polling) and pushes change events to all connected browsers over SSE (/api/events). On receipt, the frontend re-fetches and re-renders the current view (1200 ms debounce), so new memories, compartments, dream/historian runs, etc. appear automatically.

  • Top-right dot: green = SSE connected, grey = reconnecting (fallback polling of nav counts every 30 s still applies).
  • Works while editing files in Magic Context sessions, after /ctx-dream runs, or when the historian compacts history.

Editing

The dashboard can also write:

  • Memories — create and edit; filter Active/Archived/All; bulk archive or restore; paged browsing; and stale-editor conflict detection via updated_at. Archive is reversible and makes the live plugin stop using the record.
  • Notes — create, edit (content / surface condition / status), delete.
  • Config — edit magic-context.jsonc in the browser (atomic write).

Write endpoints are POST /api/memories/{create,update,delete,status}, POST /api/notes/{create,update,delete}, and POST /api/config/save. All input is validated against field whitelists; SQL is parameterized. Writes use a separate mode=rw connection with a 5 s busy timeout, so they queue safely behind the live Magic Context process (SQLite WAL).

Note: editing the DB directly does not update the plugin's in-memory cache until it reloads; new sessions pick changes up immediately.

Safety

  • Read endpoints open the DB with mode=ro; write endpoints use a dedicated mode=rw connection with busy timeout — never a live lock.
  • Loopback-only by default; static file serving has a path-traversal guard.

Architecture

Feature domains are separated from the HTTP shell:

  • mcweb/memories.py — paged queries, validation, optimistic locking, bulk status mutations.
  • mcweb/sessions.py — paged session discovery and aggregated session detail.
  • static/modules/memories.js — Memory Browser state, rendering, forms, and actions.
  • static/modules/sessions.js — Session History list and detail rendering.
  • server.py — HTTP/SSE/static serving plus legacy read models being migrated incrementally.
  • static/app.js — application shell, routing, and remaining views.

Tests

npm test

Differences vs. the official desktop app

  • No dream triggering, no log tailing (the official app's dreamer management and log viewer are not reimplemented).
  • The official app ships a built-in --serve web mode (same UI over HTTP with bearer-token auth) — if you're on a machine where the desktop binary runs (glibc ≥ 2.32 + webkit2gtk), prefer that: magic-context-dashboard --serve.

Theme

The first visit follows the system preference. Toggle light/dark with the sun/moon button in the top bar. Choice is persisted in localStorage (mc-theme).