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

@mitii/host

v2.7.158

Published

Shared host kit for Mitii apps: SQLite injection, workspace indexing, repository context, durable ports (checkpoints/memory/skills/search), project rules, provider presets.

Readme

@mitii/host

Shared host kit for Mitii apps (@mitii/cli, VS Code extension).

Durable filesystem adapters, workspace indexing, and host UX helpers that must not live in @mitii/v8 or @mitii/sdk.

apps/cli | apps/vscode
        ↓
  @mitii/host     ← this package
        ↓
  @mitii/sdk
        ↓
  @mitii/v8

Forbidden: host → apps, sdk → host, v8 → host.

Install

npm install @mitii/host

Requires Node.js 20+. Depends on @mitii/sdk and @mitii/v8. Optional: @lancedb/lancedb for vectors. License: AGPL-3.0-or-later.

Until published from this monorepo, consume via the workspace (pnpm --filter @mitii/host).

Intent

V8 is host-neutral. Apps still need:

  1. SQLite (Electron-native in VS Code, better-sqlite3 in CLI)
  2. On-disk workspace state under .mitii/ (indexes, checkpoints, memory, skills)
  3. Wiring of V8 pipelines that touch the filesystem / optional vendors (LanceDB, Brave)
  4. Shared config UX (OpenAI-compatible provider presets)

@mitii/host centralizes those so CLI and VS Code stay thin and do not drift.

Apps still own environment-specific pieces: secrets, settings UI, MCP, diagnostics, git adapters, and (in VS Code) Memento-backed memory if preferred over the file store.

Source layout

src/
  index.ts                 # public barrel — import from `@mitii/host`
  sqlite/                  # injection contract for openDatabase
  indexing/                # embeddings, full index, fingerprint snapshot
  repository-context/      # createHostRepositoryContext
  ports/                   # search, memory, skills, checkpoints
  prompt/                  # project rules loader → start({ projectRules })
  config/                  # provider presets (not a V8 port)
  internal/                # private helpers (not public)

Prefer importing from @mitii/host. Do not import internal/.

Contract

| Host API | Satisfies | Notes | |---|---|---| | OpenHostSqliteDatabase | Host injection | Required by indexing + repository context | | OpenAiCompatibleEmbeddingProvider | V8 EmbeddingProvider | Optional semantic path | | createLanceDbConnection | V8 LanceDbConnectionPort | Optional @lancedb/lancedb | | runFullWorkspaceIndex | Orchestrates V8 index runtime | Writes .mitii/repository-index.sqlite, LanceDB, graph/map | | buildWorkspaceSnapshot | Builds PublishRepositoryStateInput | Fingerprint-only; indexes marked unavailable | | createHostRepositoryContext | V8 RepositoryContextPipeline | Hybrid retrieve + file-map fallback | | createWorkspaceCheckpointStore | SDK checkpoint store | .mitii/checkpoints/ | | createWorkspaceMemoryStore | V8 MemoryStorePort | .mitii/memory/facts.json | | createOptionalSearchPort | V8 SearchPort | Brave when MITII_SEARCH_API_KEY / BRAVE_API_KEY set | | createFileSystemSkillsCatalog | V8 SkillsCatalogPort | .mitii/skills + SDK defaults | | loadProjectRules | SDK projectRules | AGENTS.md, .mitii/rules, MITTII.local.md | | PROVIDER_PRESETS / getProviderPreset | Host config only | Prefills base URL / model / auth style |

How hosts wire it

import {
  createFileSystemSkillsCatalog,
  createHostRepositoryContext,
  createOptionalSearchPort,
  createWorkspaceCheckpointStore,
  createWorkspaceMemoryStore,
  getProviderPreset,
  loadProjectRules,
  runFullWorkspaceIndex,
} from '@mitii/host';
import { createMitiiClient, ToolRuntimePipeline } from '@mitii/sdk';

const openDatabase = /* better-sqlite3 | Electron native */;

const tools = new ToolRuntimePipeline({
  /* … */,
  search: createOptionalSearchPort(process.env),
});

const repositoryContext = createHostRepositoryContext({
  repositoryState,
  workspaceRoot,
  openDatabase,
  semanticIndex,
});

const client = createMitiiClient({
  /* llms… */
  repositoryState,
  repositoryContext,
  tools,
  checkpointStore: createWorkspaceCheckpointStore(workspaceRoot),
  skillsCatalog: createFileSystemSkillsCatalog({
    workspaceRoot,
    contentMode: 'metadata',
  }),
  memoryStore: createWorkspaceMemoryStore(workspaceRoot, workspaceId),
});

const projectRules = await loadProjectRules({ workspaceRoot });
await client.start({ /* … */, projectRules });

Indexing: prefer runFullWorkspaceIndex → publish repository state. If that has not run, fall back to buildWorkspaceSnapshot (honest fingerprint: indexes unavailable).

Naming note: WorkspaceSnapshot

buildWorkspaceSnapshot returns a host fingerprint result. That is not the V8 WorkspaceSnapshot type used inside indexing/retrieval.

What stays outside this package

| Concern | Owner | |---|---| | Provider secrets / API keys | App | | Semantic index settings resolution | App | | VS Code Memento memory | apps/vscode | | MCP, diagnostics, git | App | | Agent algorithms, prompts, tool policy | @mitii/v8 via @mitii/sdk |

On-disk layout (workspace)

<workspace>/.mitii/
  repository-index.sqlite
  lancedb/                 # optional vector store
  index-runtime.json
  checkpoints/
  memory/facts.json
  skills/<id>/SKILL.md
  rules/**/*.md

Development (monorepo)

pnpm --filter @mitii/host typecheck
pnpm --filter @mitii/host test
pnpm --filter @mitii/host build

Links