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

tasks-sqlite

v1.0.0

Published

A streaming AI agent for project and task management, powered by [Mimic](https://github.com/mimicailab/mimic) synthetic data and the [Vercel AI SDK](https://sdk.vercel.ai). No Docker or external database required — SQLite is file-based.

Readme

Tasks SQLite Example

A streaming AI agent for project and task management, powered by Mimic synthetic data and the Vercel AI SDK. No Docker or external database required — SQLite is file-based.

The agent streams responses using the AI SDK UI Message Stream protocol, and a minimal Next.js chat UI is included to interact with it in the browser.

Prerequisites

  • Node.js >= 22
  • sqlite3 CLI (pre-installed on macOS; apt install sqlite3 on Debian/Ubuntu)
  • An Anthropic API key

Quick Start

1. Install dependencies

# Install the Mimic CLI and SQLite driver
npm install

This installs @mimicai/cli and better-sqlite3 from the root package.json.

2. Create the database

./init-db.sh

This creates tasks.db from schema.sql with tables for projects, tasks, labels, task_labels, and comments.

3. Set your API key

Create a .env file in this directory:

ANTHROPIC_API_KEY=sk-ant-...

Then export it so the CLI can use it:

export $(cat .env | xargs)

4. Generate synthetic data

npx mimic run

This uses the two personas defined in mimic.json (a busy developer and a project manager) to generate realistic data blueprints via the Anthropic API. Blueprints are saved to .mimic/data/.

5. Seed the database

npx mimic seed --verbose

This inserts the generated data into tasks.db. You can inspect what was created:

npx mimic inspect schema   # show tables and columns
npx mimic inspect data     # show row counts per table

6. Start the agent

cd agent
npm install
npm start

The agent starts on http://localhost:3002. You can test it with curl:

curl -X POST http://localhost:3002/chat \
  -H "Content-Type: application/json" \
  -d '{"messages": [{"role": "user", "content": "What projects are active?"}]}'

7. Start the chat UI

Open a new terminal (keep the agent running):

cd ui
npm install
npm run dev

Open http://localhost:3000 in your browser. You should see a chat interface — type a message like "What projects are active?" and hit Send.

How It Works

Browser (localhost:3000)
  └─ useChat hook sends messages to /api/chat
       └─ Next.js proxy converts UIMessage → ModelMessage format
            └─ Forwards to agent (localhost:3002/chat)
                 └─ Agent calls Anthropic API with tools
                      └─ Tools query SQLite database
                           └─ Streams response back through the chain

The UI uses the AI SDK useChat hook from @ai-sdk/react. The Next.js API route at ui/src/app/api/chat/route.ts proxies requests to the agent, converting the UIMessage parts format to simple {role, content} messages that the agent expects.

Testing with curl

# Simple message
curl -X POST http://localhost:3002/chat \
  -H "Content-Type: application/json" \
  -d '{"message": "Show me all blocked tasks"}'

# Multi-turn conversation
curl -X POST http://localhost:3002/chat \
  -H "Content-Type: application/json" \
  -d '{"messages": [
    {"role": "user", "content": "List all projects"},
    {"role": "assistant", "content": "Here are your projects: ..."},
    {"role": "user", "content": "Show me tasks in the first project"}
  ]}'

# Health check
curl http://localhost:3002/health

Configuration

Agent environment variables

| Variable | Default | Description | |---|---|---| | PORT | 3002 | Agent HTTP server port | | MODEL | claude-haiku-4-5 | Anthropic model to use | | DB_PATH | ../tasks.db | Path to the SQLite database | | ANTHROPIC_API_KEY | (required) | Your Anthropic API key |

UI environment variables

Set these in ui/.env.local:

| Variable | Default | Description | |---|---|---| | AGENT_URL | http://localhost:3002 | Agent server URL |

Agent Tools

The agent exposes six tools to the LLM:

| Tool | Description | |---|---| | list_projects | List all projects with task counts, filter by status | | search_tasks | Keyword search across task titles and descriptions | | get_task_details | Full details for a single task including labels | | get_project_tasks | All tasks for a project, ordered by priority | | get_task_comments | Chronological comments on a task | | get_blocked_tasks | All blocked tasks, optionally filtered by project |

Schema

| Table | Description | |---|---| | projects | Top-level containers with name, description, and status | | tasks | Work items with status, priority, assignee, dates, and hour tracking | | labels | Reusable tags with color codes | | task_labels | Many-to-many join between tasks and labels | | comments | Chronological discussion threads on tasks |

Task statuses: todoin_progressreviewdone (or blocked at any stage)

Task priorities: low | medium | high | urgent

Cleanup

rm tasks.db                  # remove the database
npx mimic clean --yes        # also remove generated blueprints