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

@timoconnellaus/ai-ui-annotate-core

v0.0.1

Published

Core runtime package for AI UI Annotate. This package provides the foundational client-side functionality for highlighting components, creating comments, and communicating with the WebSocket server.

Readme

@timoconnellaus/ai-ui-annotate-core

Core runtime package for AI UI Annotate. This package provides the foundational client-side functionality for highlighting components, creating comments, and communicating with the WebSocket server.

Installation

bun add @timoconnellaus/ai-ui-annotate-core

Usage

import { init } from '@timoconnellaus/ai-ui-annotate-core';

// Initialize the runtime
const runtime = init({
  hotkey: 'Alt',           // Key to hold for annotation mode (default: 'Alt')
  websocketPort: 3001,     // WebSocket server port (default: 3001)
});

// Later, to clean up:
runtime.destroy();

How It Works

  1. Hold the hotkey (Alt by default) to enter annotation mode
  2. Hover over components with data-component attribute to highlight them
  3. Click a highlighted component to open the comment box
  4. Write your comment and press Save (or Cmd/Ctrl+Enter)
  5. Comment is sent to the WebSocket server for processing

Required HTML Attributes

For components to be annotatable, they must have these attributes:

<div
  data-component="MyComponent"
  data-source-file="src/components/MyComponent.tsx"
  data-source-line="42"
>
  <!-- component content -->
</div>

Framework-specific plugins (e.g., for Next.js, Vite) can automatically add these attributes during development builds.

Configuration

| Option | Type | Default | Description | |--------|------|---------|-------------| | hotkey | 'Alt' \| 'Control' \| 'Meta' \| 'Shift' | 'Alt' | Key to hold for annotation mode | | websocketPort | number | 3001 | WebSocket server port | | websocketUrl | string | - | Full WebSocket URL (overrides port) |

API

init(config?: Config): AnnotateRuntime

Initialize the annotation runtime.

const runtime = init({
  hotkey: 'Alt',
  websocketPort: 3001,
});

destroy(): void

Destroy the active runtime and clean up all resources.

import { destroy } from '@timoconnellaus/ai-ui-annotate-core';

destroy();

Types

interface Comment {
  componentName: string;
  sourceFile: string;
  sourceLine: number;
  text: string;
  timestamp: number;
}

interface Config {
  hotkey?: 'Alt' | 'Control' | 'Meta' | 'Shift';
  websocketPort?: number;
  websocketUrl?: string;
}

WebSocket Message Format

Comments are sent to the server as JSON:

{
  "type": "comment",
  "payload": {
    "componentName": "MyComponent",
    "sourceFile": "src/components/MyComponent.tsx",
    "sourceLine": 42,
    "text": "This button should be bigger",
    "timestamp": 1699999999999
  }
}

Development

# Install dependencies
bun install

# Run tests
bun test

# Build
bun run build

# Lint
bun run lint

License

MIT