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

@artkit-ai/core

v0.2.0

Published

Artifact envelope, kind registry, operation engine, versioning, migrations, diff, lint, projection and store contracts for AI-generated artifacts.

Readme

@artkit-ai/core

The runtime-neutral heart of artkit: artifact envelope, kind contract and registry, the atomic operation engine, versioning with automatic rebase, migrations, diff, lint and projection helpers, the error catalog, store/asset/event contracts and the high-level artifact service.

Its only dependency is zod. It runs in browsers, Node 22+, edge runtimes and workers (no DOM, no Node APIs).

npm install @artkit-ai/core

Usage

import { createArtifactService, createMemoryStore, createRegistry } from '@artkit-ai/core';
import { documentKind } from '@artkit-ai/kind-document';

const registry = createRegistry({ kinds: [documentKind] });
const service = createArtifactService({
  registry,
  store: createMemoryStore(),
  authorize: (action, artifact, scope) => scope.workspaceId === 'acme',
  locale: 'pt-BR',
});

const scope = { workspaceId: 'acme', actor: { type: 'agent', id: 'agent-proposals' } } as const;
const { artifact } = await service.create(scope, {
  kind: 'document',
  title: 'Proposta técnica',
  input: { format: 'markdown', source: '# Proposta\n\n## Escopo\n\nPortal de fornecedores.' },
});

const result = await service.apply(scope, {
  artifactId: artifact.id,
  baseVersion: artifact.version,
  operations: [{ op: 'set_title', title: 'Proposta técnica v2' }],
});
console.log(result.version, result.diff, result.lint);

What is inside

| Area | API | | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Envelope | Artifact, envelopeSchema, statuses and lifecycle transitions | | Kinds | ArtifactKind, defineKind, createRegistry (kinds, themes, exporters, limits) | | Engine | applyOperations (validate → clone → apply → derive → revalidate → limits → diff → lint, all or nothing), prepareContent, envelope operations set_title, set_theme, set_locale, replace_content | | Service | createArtifactService: authorization hook, baseVersion with automatic rebase or VERSION_CONFLICT, idempotency keys, locks, approval policy, history and restore, export orchestration with timeout | | Projection | projectItems, paginate (token budget and cursor), selectRange, delimitProjection | | Diff | diffCollection (added, removed, changed, moved), diffFields | | Errors | ArtifactError, toModelError (never leaks stack traces), pt-BR and English catalogs | | Security | sanitizeDeep (control characters, NFC), linkSchema, checkAsset (magic-byte MIME sniffing, size, domains), sanitizeSvg | | Schemas | toJsonSchema with default, strict and compact profiles; stripNulls | | Stores | ArtifactStore, AssetStore contracts; createMemoryStore, createMemoryAssetStore (reference adapters) | | UI contracts | RenderContext, EditorBindings, themeCssVariables (shared by renderers, editors and @artkit-ai/react) | | Events & logs | createEventBus, Logger (metadata only), metric hooks |

@artkit-ai/core/testing exports defineStoreContractTests (every store adapter must pass it) and defineKindConformanceTests (every kind, native or third-party).

Notes

  • apply is pure and deterministic: no clock, network or randomness. Replays always produce the same content.
  • The memory store lives here (not in @artkit-ai/node) so it also works in the browser playground and in edge runtimes; @artkit-ai/node re-exports it.
  • INTERNAL_ERROR extends the spec's error catalog for unexpected failures, so details never reach the model.

License: Apache-2.0.