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

mythik

v0.2.0

Published

AI-first JSON-native core runtime for validated applications, APIs, editor sessions, state, actions, validation, and versioning.

Readme

mythik

The Mythik contract runtime: types, validation, expressions, actions, spec stores, versioning, editor sessions, and Reveal context contracts. This is the foundation every Mythik consumer imports. It also ships the canonical AI documentation bundled inside the npm tarball, so the docs an agent reads always match the installed version of the framework.

See the framework README on GitHub for the full Mythik architecture and design philosophy. This file documents what mythik gives you and how to use it.


What Mythik is, briefly

Mythik is an AI-first JSON-native app framework. Most of your app lives as validated JSON specs loaded at runtime from your database, not source code that must be regenerated and redeployed for every change. AI agents compose those specs from a documented vocabulary; Mythik validates the shape, references, actions, state paths, and cross-contract assumptions before the change reaches runtime. This package is the runtime that makes that contract work.

Install

npm install mythik

mythik has no peer dependency. It's the foundation.

When to install this

You install mythik whenever you're building anything Mythik-related:

| You want to... | Install | |---|---| | Render specs as a React app | mythik + mythik-react | | Render specs in React Native or Expo | mythik + mythik-react-native | | Build a REST API from an ApiSpec | mythik + mythik-server | | Author or patch specs from the command line | mythik + mythik-cli (dev) | | Validate or query specs from a Node script | mythik alone |

What you get

  • Strict TypeScript types for Spec, AppSpec, ApiSpec, primitives, expressions, actions, and validation results.

  • The validation gatevalidateSpec() and validateApiSpec() are the atomic checks that run on every push and promote. Call them directly to validate offline, in CI, or in a test.

  • Spec stores — load and save specs through a swappable backend interface:

    • Browser-safe entry: MemorySpecStore, SupabaseSpecStore
    • Node-only entry (mythik/server): FileSpecStore, SqlSpecStore, SqlVersionedSpecStore, SqlEnvironmentStore, and SQL Server compatibility stores
    • Versioned variants (SupabaseVersionedSpecStore, SupabaseEnvironmentStore, SqlVersionedSpecStore, SqlEnvironmentStore) add snapshot+patch-chain history, structural diffs, and atomic promote gates
  • Expression and action engines — the runtime that resolves $token, $state, $template, and dispatches action chains, transactions, forms, auth, derive, dataSources, uploads, and exports. Specs reference these by name; this package implements the resolution.

  • App engine — navigation, auth integration, and screen lifecycle. Most consumers reach the app engine through <MythikApp> in mythik-react, but the runtime lives here and can be used directly for non-React shells or custom integrations.

  • Mythik Reveal contracts — typed runtime context, redaction, truncation, event recorder, and protocol shapes used by the React, React Native, and CLI Reveal integrations. Reveal lets a running app expose its live contract, selected state, events, diagnostics, and environment as structured context for AI agents.

Browser-safe vs Node-only entries

// Browser-safe (works in any runtime)
import { MemorySpecStore, SupabaseSpecStore } from 'mythik';

// Node-only (file system and SQL drivers)
import { FileSpecStore, SqlSpecStore, createSqlDriver } from 'mythik/server';

Bundlers like Vite or Webpack should always import from mythik (the main entry). The mythik/server subpath is for Node scripts and server processes only. It uses Node APIs and dynamically loads the SQL driver package you installed for the selected database.

SQL adapters are optional peer dependencies. Install only the adapter you use:

npm install pg              # PostgreSQL
npm install mysql2          # MySQL
npm install mssql           # SQL Server
npm install better-sqlite3  # SQLite

SQLite uses the native better-sqlite3 adapter. If npm prints warnings from that adapter's transitive native-build helpers, the warning belongs to the SQLite adapter install path, not to Mythik's browser/runtime install. Missing SQL adapter errors include the package name and install command for the selected dialect.

SQL-backed stores use one dialect-aware driver boundary:

import { SqlSpecStore, createSqlDriver } from 'mythik/server';

const driver = createSqlDriver({
  dialect: 'postgres', // 'sqlserver' | 'postgres' | 'mysql' | 'sqlite'
  connection: process.env.DATABASE_URL!,
});

const store = new SqlSpecStore({ driver });

Initialize the required tables with the CLI:

npx mythik init-store --dialect sqlite --target ./mythik.db
npx mythik init-store --dialect postgres --dry-run

MySQL generated upsert SQL targets MySQL 8.0.19+.

Minimal example

Validate a spec in-process:

import { validateSpec, MemorySpecStore, type Spec } from 'mythik';

const homeSpec: Spec = {
  root: 'root',
  elements: {
    root: {
      type: 'box',
      props: { style: { padding: 24 } },
      children: ['title'],
    },
    title: {
      type: 'text',
      props: { content: 'Hello, world', variant: 'heading' },
    },
  },
};

const result = validateSpec(homeSpec);

if (!result.valid) {
  for (const err of result.errors) {
    console.error(`[${err.ruleId}] ${err.path}: ${err.message}`);
  }
  process.exit(1);
}

const store = new MemorySpecStore({ home: homeSpec });
const loaded = await store.load('home');
console.log('Loaded spec for screen:', loaded?.root);

validateSpec() is the same function the CLI calls when it runs mythik validate <spec-id> and the same gate that mythik patch enforces atomically. Same machine, three surfaces.

For rendering specs as a React UI, see mythik-react. For an AI agent surface to read, validate, patch, and promote specs from the command line, see mythik-cli.

AI documentation, bundled

This package ships the canonical AI documentation inside the npm tarball — so the docs travel with the framework (no external doc fetching, no version drift between docs and runtime):

node_modules/mythik/docs/
├── consumer/
│   ├── ai-context.md                    # spec-generation primer
│   ├── ai-context-primitives.md         # every primitive's props
│   ├── ai-context-runtime-semantics.md  # render-time behavior
│   ├── ai-context-custom-elements.md    # custom expressions/actions
│   ├── reference-doc.md                 # full rule catalog
│   └── WHERE-TO-LOOK.md                 # navigation guide
├── wiki/compiled/                       # atomic per-concept articles
└── llms.txt                             # index for LLM tooling

mythik-cli adds a small helper to locate or copy these into your project:

$ npx mythik docs path
/your-project/node_modules/mythik/docs

$ npx mythik docs copy ./mythik-docs

Point your AI agent at the printed path before asking it to author or modify specs.

For runtime debugging, pair these docs with Mythik Reveal:

npx mythik reveal start
npx mythik reveal apps --json
npx mythik reveal context --app <app-name>

Docs explain the contract; Reveal shows what the running app actually mounted.

For fresh AI agents, install the local operating protocol before asking for spec changes. agent init currently supports codex, claude, and all. codex creates/updates AGENTS.md, claude creates/updates CLAUDE.md, and all updates both. Existing agent files are preserved outside the Mythik-managed block delimited by <!-- mythik-agent-protocol:start --> and <!-- mythik-agent-protocol:end -->.

The adapters point the agent to shared .mythik/agent/* instructions:

npx mythik agent init codex
npx mythik agent context --app <app-id> --include-screens --out .mythik/agent/context.md

The generated protocol names the active Mythik store as the source of truth and keeps existing spec edits on manifest -> elements -> patch --from-file --author -> validate -> verify.

Related packages

  • mythik-react — render the specs as a React app
  • mythik-cliAgent Protocol, patch workflow, validation, versioning, environments, and Reveal commands
  • mythik-server — declarative REST server from an ApiSpec
  • mythik-react-native — render supported Mythik primitives in Expo and React Native

Status

Public release line. APIs are documented for real-world feedback as the framework evolves.

Releases

Release notes and patch details are published in the CHANGELOG and on GitHub Releases.

License

Apache-2.0.