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

@lanonasis/secret-prescan

v0.1.0

Published

Pre-extraction security gate for MIRA context extraction pipeline. Wraps @lanonasis/privacy-sdk with value-stripping, extended secret patterns, and configurable output.

Readme

@lanonasis/secret-prescan

Pre-extraction security gate for the MIRA context extraction pipeline.

MIRA should only see sanitized/cataloged context, never raw transcripts by default.

What It Does

Wraps @lanonasis/privacy-sdk with three additions:

  1. Value stripping — scan reports never store raw detected values. Only: type, count, confidence, hash (SHA-256, truncated), masked sample, line hint.
  2. Extended secret patterns — 25+ patterns beyond built-in PII: OpenAI/Anthropic/Stripe/GitHub/AWS/GCP/Supabase/Vercel/Netlify/Slack/npm keys, JWTs, bearer tokens, private keys, connection strings, .env assignments, high-entropy strings.
  3. Configurable output — reports go to ~/.hermes/private/context-scans/ by default (never iCloud-backed paths). Owner-only permissions (0o700 dirs, 0o600 files).

Pipeline Integration

Raw Source (JSONL / context files)
    ↓
secret-prescan.prescan(sdk, config) → ScanReport
    ↓
Classification: SAFE / FLAGGED / QUARANTINED
    ↓
If SAFE  → extract metadata (MIRA proceeds)
If FLAGGED → log for manual review (VERA)
If QUARANTINED → blocked, quarantine path logged

Usage

import { prescan, prescanAndSave, getSafeFiles, printSummary } from '@lanonasis/secret-prescan';
import { PrivacySDK } from '@lanonasis/privacy-sdk';

const sdk = new PrivacySDK();

// Full directory scan with report saved to disk
const reportPath = prescanAndSave(sdk, {
  target_path: '/path/to/context-convergence',
  output_dir: '~/.hermes/private/context-scans/', // optional, this is the default
});

// Or get the report object directly
const report = prescan(sdk, {
  target_path: '/path/to/project',
  exclude_patterns: ['.git', 'node_modules', 'dist'],
});

// Get files safe for MIRA extraction
const safeFiles = getSafeFiles(report);

// Print human-readable summary
printSummary(report);

Single file check

import { isSafeForExtraction } from '@lanonasis/secret-prescan';

if (isSafeForExtraction(sdk, '/path/to/session.jsonl')) {
  // Safe for MIRA to extract
} else {
  // Block extraction, log for review
}

Custom patterns

const report = prescan(sdk, {
  target_path: '/path/to/project',
  custom_patterns: [
    {
      type: 'internal-token',
      pattern: /INTERNAL_[A-Z0-9]{32}/g,
      sensitivity: 'critical',
      regulations: ['Internal'],
    },
  ],
});

Report Schema

Reports are JSON files with this structure:

{
  "version": "1.0.0",
  "scanned_at": "2026-04-12T15:30:00.000Z",
  "scan_root": "/path/to/context-convergence",
  "total_files": 142,
  "summary": {
    "safe": 135,
    "flagged": 5,
    "quarantined": 2,
    "errors": 0,
    "total_detections": 14,
    "detection_types": {
      "openai-api-key": 3,
      "stripe-secret-key": 2,
      "env-secret-assignment": 5,
      "email": 4
    }
  },
  "files": [
    {
      "path": "source/.zshrc.backup",
      "classification": "QUARANTINED",
      "detection_count": 5,
      "detections": [
        {
          "type": "stripe-secret-key",
          "confidence": 0.99,
          "hash": "a1b2c3d4e5f6g7h8",
          "masked_sample": "sk_live_************",
          "sensitivity": "critical",
          "line_hint": 47,
          "regulations": ["PCI-DSS", "Internal"]
        }
      ]
    }
  ]
}

Note: absolute_path is redacted in saved reports. Raw values are never stored.

Monorepo Placement

lan-onasis-monorepo/
├── packages/
│   ├── secret-prescan/      ← this module
│   │   ├── src/
│   │   │   ├── index.ts     # barrel export
│   │   │   ├── scanner.ts   # core logic
│   │   │   ├── patterns.ts  # 25+ secret patterns
│   │   │   └── types.ts     # type definitions
│   │   ├── package.json
│   │   └── tsconfig.json
│   └── privacy-sdk/         # scaffold (not canonical)
├── apps/
│   └── v-secure/
│       └── privacy-sdk/     # canonical SDK (published to npm)

Design Decisions

  • No raw values in reports: The advanced SDK returns value in detections. This wrapper strips it and stores only hash + masked sample. This prevents secret leakage through scan artifacts.
  • No iCloud-backed output paths: Default output is ~/.hermes/private/context-scans/ with 0o700 directory permissions. Desktop/Documents paths are explicitly avoided.
  • No hardcoded user paths: Everything is configurable via ScanConfig. No /Users/seyederick/... assumptions.
  • Peer dependency on privacy-sdk: This module wraps but does not bundle the SDK. Install both.
  • Quarantine threshold: Default is 1 critical detection = QUARANTINED. Configurable per scan.