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

@l1r1h28/sweep-core

v1.2.0

Published

Shared catalog, scan, backup, and clean engine for AI coding tool storage.

Readme

@l1r1h28/sweep-core ⚙️

The headless engine for Sweep — providing AI tool catalogs, cross-platform path resolution, disk scanning, granular session parsing, backup creation, and safety-guarded cleaning routines.

License: MIT npm version Node Version

@l1r1h28/sweep-core is the core foundation used by both @l1r1h28/sweep-cli and sweep-aicleaner (VS Code Extension). It provides browser-safe metadata/catalog utilities as well as Node.js-based filesystem scanning, session extraction, and execution capabilities.


📦 Features

  • 🗂️ 15 AI Tool Product Line Catalogs: Dedicated definitions and adapters for Google Antigravity (IDE/2.0/CLI), OpenAI Codex (CLI/Desktop), Claude Code & Desktop, Codeium Windsurf & Cascade, AWS Kiro (IDE/CLI), and ByteDance Trae (IDE/SOLO).
  • 🗺️ Cross-Platform Path Resolution: Automatically expands ~, %USERPROFILE%, %APPDATA%, and %LOCALAPPDATA% across Windows, macOS, and Linux.
  • 🛡️ Never-Delete Guard & Whitelisting: Regex-based protection layer safeguarding config files (settings.json, auth.json, config.toml, mcp_config.json, CLAUDE.md), extensions, and runtime environments (.sandbox-bin/, ~/.kiro/extensions, skills/).
  • 💾 Safe vs. Destructive Separation: Strict distinction between cache (low risk) and conversations (high risk).
  • 📦 Automatic Backup & Restore System: Creates timestamped backup archives before removing conversation history (~/.sweep/backups/<timestamp>) with one-click restore.
  • 💬 Granular Session Parsing Engine: Extracts chat titles, token counts, timestamps, and project scopes for JSONL, SQLite WAL, .chat, and .pb archives with CJK 26-column alignment.

🚀 Installation & Usage

npm install @l1r1h28/sweep-core

TypeScript / JavaScript Example

import {
  TOOLS,
  formatBytes,
  scanDisk,
  planClean,
  runClean,
  scanSessions,
  cleanSessions,
} from "@l1r1h28/sweep-core";

// 1. Scan AI tool storage
const report = scanDisk({
  toolIds: ["codex", "antigravity", "windsurf"],
});

console.log(`Total found: ${formatBytes(report.totalBytes)}`);
console.log(`Cache: ${formatBytes(report.cacheBytes)}`);
console.log(`Conversations: ${formatBytes(report.conversationBytes)}`);

// 2. Scan granular conversation sessions
const sessions = scanSessions();
console.log(`Discovered ${sessions.length} conversation sessions across tools.`);

// 3. Plan a clean operation (Dry-run preview)
const plan = planClean(report, {
  dryRun: true,
  backup: false,
  kinds: ["cache"],
});

console.log(`Planned targets:`, plan);

// 4. Execute real cleaning with automated backup
const result = runClean(report, {
  dryRun: false,
  backup: true,
  kinds: ["conversations"],
});

console.log(`Freed ${formatBytes(result.freedBytes)} bytes.`);
if (result.backupDir) {
  console.log(`Backup saved to: ${result.backupDir}`);
}

🧩 Key API Reference

Catalog & Path Resolver

  • TOOLS: ToolDef[] — Full metadata list of supported AI IDEs and CLI agents (15 product lines).
  • getTool(id: string): ToolDef | undefined — Retrieve a tool definition by ID.
  • detectPlatform(): 'win' | 'mac' | 'linux' — Detect host OS platform.
  • expandPath(template, platform, home, env): string — Resolve system path tokens.
  • resolveTargets(platform, home, env, tools?): ResolvedTarget[] — Batch resolve targets to absolute paths.

Disk Operations

  • scanDisk(options?): ScanReport — Scan targets recursively and measure sizes/file counts.
  • planClean(report, options): CleanItem[] — Filter valid clean targets while applying NEVER_DELETE_GLOBS and whitelist rules.
  • runClean(report, options): CleanResult — Perform deletion and optional backup archive creation.

Session Inspection & Cleaning

  • scanSessions(options?): ConversationSession[] — Parse individual conversation sessions across tools.
  • filterSessions(sessions, filters): ConversationSession[] — Filter sessions by duration, size, project, or keyword.
  • cleanSessions(sessions, options?): CleanResult — Clean selected sessions with safety guards.
  • exportSessionToMarkdown(session): string — Convert session transcript to readable Markdown.
  • exportSessionToJson(session): string — Convert session transcript to structured JSON.

Backups & Configuration

  • listBackups(): BackupSummary[] — List local backups in ~/.sweep/backups/.
  • restoreBackup(timestamp, options?): RestoreResult — Restore previous snapshot.
  • pruneBackups(options): PruneResult — Prune expired backups.
  • loadConfig() / saveConfig(config) — Manage persistent user preferences and whitelist.

🛠️ Development

# Type check and build
npm run build

# Run unit tests (Vitest)
npm run test

📄 License

MIT © L1r1h28