open-index/open-npm huggingface dataset:
npm package: @saferx/callable-subject
Description: Subjects that can be called
Author: Rinat Arsaev
Latest version: 0.2.1
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# Callable Subject

[![npm version](https://badge.fury.io/js/%40saferx%2Fcallable-subject.svg)](https://badge.fury.io/js/%40saferx%2Fcallable-subject)

[Subjects](https://rxjs-dev.firebaseapp.com/guide/subject) that can be called:

-   CallableSubject
-   CallableReplaySubject
-   CallableAsyncSubject
-   CallableBehaviorSubject

Rather, like a Subject. Is not a true extension of the Subject.

Accessible methods: `pipe`, `subscribe`, `complete`, `next` and `source$` (source Subject)

> [Other "safe" extensions and utilities for RxJS](https://github.com/KrickRay/saferx)

## Installation

```sh
npm i @saferx/callable-subject
```

## Usage

```ts
import { CallableSubject } from "@saferx/callable-subject";

const callableSubject = new CallableSubject<number>();

callableSubject(7); // the same as callableSubject.next(7)
callableSubject.pipe(map((v) => v + 1)).subscribe((v) => console.log(v)); // logs: 8
```

## Best practices

-   Better to pass an object to know the names of the parameters:

    ```ts
    const loadUser = new CallableSubject<{ id: number }>();
    // clearer than
    const loadUser = new CallableSubject<number>(); // here it is not clear what is the argument "number"
    ```
npm package: @saferx/multi-observable
Description: Wrapper for several observables at once
Author: Rinat Arsaev
Latest version: 0.3.1
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# Multi Observable

[![npm version](https://badge.fury.io/js/%40saferx%2Fmulti-observable.svg)](https://badge.fury.io/js/%40saferx%2Fmulti-observable)

Wrapper for several observables at once

> [Other "safe" extensions and utilities for RxJS](https://github.com/KrickRay/saferx)

## Installation

```sh
npm i @saferx/multi-observable
```

## Usage

```ts
import { MultiObservable } from "@saferx/multi-observable";
import { of } from "rxjs";

const multiObservableName$ = new MultiObservable(of({ name: "Test", age: 20 }), "name"); // return only 'name': 'Test'
const age$ = multiObservableName$.get("age"); // return only 'age': 20
```
npm package: @saferx/observe
Description: Observe class property to subject
Author: Rinat Arsaev
Latest version: 0.2.1
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# Observe

[![npm version](https://badge.fury.io/js/%40saferx%2Fobserve.svg)](https://badge.fury.io/js/%40saferx%2Fobserve)

Observe class property to subject

> [Other "safe" extensions and utilities for RxJS](https://github.com/KrickRay/saferx)

## Installation

```sh
npm i @saferx/observe
```

## Usage

```ts
import { Observable } from "rxjs";
import { observe } from "@saferx/observe";

export class User {
    @observe("name$") name: string;
    name$: Observable<string>;
}
```
npm package: @saferx/safe
Description: Wrapper for several observables at once
Author: Rinat Arsaev
Latest version: 0.4.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# Safe operators

[![npm version](https://badge.fury.io/js/%40saferx%2Fsafe.svg)](https://badge.fury.io/js/%40saferx%2Fsafe)

Materialize start and end of operator

Contains ready-made operators:

-   Safe operators - ready-made safe operators:
    -   `safeSwitchMap`
    -   `safeConcatMap`
    -   `safeMergeMap`
    -   ~~`safeExhaustMap`~~ (TODO)
    -   `safeMergeScan`
-   Part operators - ready-made data-enriching operators:
    -   `ProgressPart`
    -   `UpdatedAtPart`

> [Other "safe" extensions and utilities for RxJS](https://github.com/KrickRay/saferx)

## Installation

```sh
npm i @saferx/safe
```

## Usage

```ts
import { safeSwitchMap, ProgressPart, UpdatedAtPart, Safe } from "@saferx/safe";
import { of } from "rxjs";
import { delay, shareReplay } from "rxjs/operators";

const helloWorld$ = of("world").pipe(
    safeSwitchMap((name) => of(`Hello, ${name}!`).pipe(delay(1000))),
    ProgressPart.Add(),
    UpdatedAtPart.Add(),
    shareReplay(1)
);

helloWorld$.pipe(ProgressPart.Select()).subscribe((value) => console.log("progress:", value));
helloWorld$.pipe(UpdatedAtPart.Select()).subscribe((value) => console.log("updatedAt:", value));
helloWorld$.pipe(Safe.SelectValue()).subscribe((value) => console.log("value:", value));
helloWorld$.pipe(Safe.SelectError()).subscribe((value) => console.log("error:", value));

// progress: false
// progress: true
// value: Hello, world!
// progress: false
// updatedAt: 2021-04-10T22:34:31.790Z
// error: undefined
```
npm package: @saferx_pharma/mcp-server
Description: SafeRx Drug Safety API — Model Context Protocol Server
Author: SafeRx
Latest version: 1.3.3

# SafeRx MCP Server

Model Context Protocol server for the [SafeRx Drug Safety API](https://saferx.online). Enables AI assistants (Claude Desktop, Claude Code, Cursor) to check drug safety across 66,000+ Egyptian pharmaceutical products.

## Tools

| Tool | Description |
|------|-------------|
| `check_drug_safety` | Screen 1-20 drugs across 6 safety domains |
| `get_drug_metadata` | Get available populations, conditions, and database versions |

## Quick Start

```bash
SAFERX_API_KEY=sfx_free_... npx @saferx_pharma/mcp-server
```

Get a free API key at [docs.saferx.online](https://docs.saferx.online/api-reference/authentication/api-keys).

## Configuration

### Claude Desktop

Add to `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "saferx": {
      "command": "npx",
      "args": ["-y", "@saferx_pharma/mcp-server"],
      "env": {
        "SAFERX_API_KEY": "sfx_free_..."
      }
    }
  }
}
```

### Environment Variables

| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| `SAFERX_API_KEY` | **Yes** | — | API key (free/pro/enterprise). Get one at [docs.saferx.online](https://docs.saferx.online/api-reference/authentication/api-keys). |
| `SAFERX_BASE_URL` | No | `https://saferx.online` | API base URL |

## Build from Source

```bash
git clone https://github.com/KaRamHelal/SafeRx_Pharma.git
cd SafeRx_Pharma/mcp-server
npm install
npm run build
npm start
```

## Safety Domains

| Domain | Code | Description |
|--------|------|-------------|
| Adverse Effects | `ae` | Black Box Warnings, side effects, monitoring |
| Drug Interactions | `ddi` | 337K+ interaction pairs with severity |
| Pregnancy & Lactation | `pllr` | 0-7 risk scale, 24K+ products |
| Food Interactions | `food` | Meal timing, food-drug conflicts |
| Clinical | `clinical` | 5 populations, 14 conditions |
| Dosing | `dose` | Max daily dose (WHO DDD) |

## License

MIT
npm package: @safestack/eslint-config
Description: Basic eslint config for typescript-driven nodejs and frontend projects
Author: Yannick Stachelscheid
Latest version: 1.0.0

# eslint-config

Opinionated eslint config for typescript driven nodejs and frontend projects

## Installation

```
npm i -D @safestack/eslint-config

yarn add --dev @safestack/eslint-config

pnpm install --dev @safestack/eslint-config
```

Create a `.eslintrc.js` file in the root directory of your project and add the following content:

```javascript
const baseConfig = require('@safestack/eslint-config')

module.exports = baseConfig
```
npm package: @safestack/prettier-config
Description: Opinionated prettier config
Author: Yannick Stachelscheid
Latest version: 1.0.1

# prettier-config

Opinionated prettier config

## Installation

```
npm i -D @safestack/prettier-config

yarn add --dev @safestack/prettier-config

pnpm install --dev @safestack/prettier-config
```

Create a `.prettierrc` file in the root directory of your project and add the following content:

```
"@safestack/prettier-config"
```
npm package: @safestudio/vuepress-plugin-enhanced-search
Description: Enhanced search plugin for VuePress
Author: Le Minh Tri
Latest version: 0.0.1

# vuepress-plugin-enhanced-search

> enhanced header-based search plugin for VuePress

## Install

```bash
yarn add -D @safestudio/vuepress-plugin-enhanced-search
# OR npm install -D @safestudio/vuepress-plugin-enhanced-search
```

> ## Tip
> Note that this plugin has been included in **default theme**, the search box you see now is powered by the plugin.

## Usage

1. Enable this plugin:

```js
// .vuepress/config.js or themePath/index.js
module.exports = {
  plugins: [
    ['enhanced-search', {
      searchMaxSuggestions: 10
    }]
  ]
}
```

2. This plugin will automatically inject a webpack alias `@EnhancedSearchBox` pointing to the search component so that you can use it directly in your layout component:

```vue
<template>
  <div class="foo-layout">
    <header>
      <EnhancedSearchBox/>
    </header>
    <main>
      ...
    </main>
  </div>
</template>

<script>
import EnhancedSearchBox from '@EnhancedSearchBox'

export default {
  components: { EnhancedSearchBox }
}
</script>
```

## Options

### searchMaxSuggestions

- Type: `number`
- Default: 5

Set the maximum number of results for search.

### test

- Type: `RegExp` | `Array<RegExp>`
- Default: `null`

Set up searchable paths with regular expressions. If no test expression is provided it will search on all paths. Considering you have this structure:

```bash
docs/
├── .vuepress/
│    └── ...
│
├── master/
│    └── ...
│
├── 1.0/
│    └── ...
│
└── 2.0/
     └── ...
```

You can set up searchable paths with `test` as:

- RegExp: `'/1\.0/'`
- Array of RegExp: `['/1\.0/', '/2\.0/']`


Otherwise,  the default search will return duplicates, once you can have similar content between folders `/master/`, `/1.0/` and `/2.0/`.

## Tips

### Tweak the default colors.

Since the Search component leverages the built-in palette, you can tweak the default colors via `styles/palette.styl`:

```stylus
// colors of the enhanced search box you see now:
$accentColor = #3eaf7c
$textColor = #2c3e50
$borderColor = #eaecef
$codeBgColor = #282c34
$arrowBgColor = #ccc
```
npm package: @safestudio/vuepress-theme-ebook
Description: VuePress ebook theme
Author: Le Minh Tri
Latest version: 1.0.2

# vuepress-theme-ebook

> This theme was forked from default vuepress

## Plugins

The theme has the following plugin built in:

- [@vuepress/plugin-active-header-links](https://github.com/vuejs/vuepress/tree/master/packages/@vuepress/plugin-active-header-links)
- [@vuepress/plugin-google-analytics](https://github.com/vuejs/vuepress/tree/master/packages/%40vuepress/plugin-google-analytics)
npm package: @safeswaponline/eslint-config-safeswap
Description: Eslint config for SafeSwap
Author: RabbitDoge
Latest version: 1.2.0

# eslint-config-pancake

Pancake Eslint config with:

- Airbnb config
- Typescript
- Prettier

## Usage

```
npx install-peerdeps --dev @pancakeswap/eslint-config-pancake
```

Add `"extends": "@pancakeswap/eslint-config-pancake"` to your eslint config file.
npm package: @safeswaponline/uikit
Description: Set of UI components for safeswap projects
Latest version: 0.49.6

# 🥞 Pancake UIkit

[![Version](https://img.shields.io/npm/v/@pancakeswap-libs/uikit)](https://www.npmjs.com/package/@pancakeswap-libs/uikit) [![Size](https://img.shields.io/bundlephobia/min/@pancakeswap-libs/uikit)](https://www.npmjs.com/package/@pancakeswap-libs/uikit)

Pancake UIkit is a set of React components and hooks used to build pages on Pancake's apps. It also contains a theme file for dark and light mode.

## Install

`yarn add @pancakeswap-libs/uikit`

## Setup

### Theme

Before using Pancake UIkit, you need to provide the theme file to styled-component.

```
import { ThemeProvider } from 'styled-components'
import { light, dark } from '@pancakeswap-libs/uikit'
...
<ThemeProvider theme={isDark}>...</ThemeProvider>
```

### Reset

A reset CSS is available as a global styled component.

```
import { ResetCSS } from '@pancakeswap-libs/uikit'
...
<ResetCSS />
```

### Types

This project is built with Typescript and export all the relevant types.

## How to use the UIkit

If you want to use components from the UIkit, check the [Storybook documentation](https://pancakeswap.github.io/pancake-uikit/)
npm package: @safetech/inheriti-client-sdk
Description: The **Inheriti Client SDK** is a TypeScript library that enables developers to integrate Inheriti's digital inheritance and protection plan features into their own applications.
Latest version: 1.17.0

# Inheriti Client SDK

The **Inheriti Client SDK** is a TypeScript library that enables developers to integrate Inheriti's digital inheritance
and protection plan features into their own applications.

## Purpose

This SDK abstracts and simplifies communication with the Inheriti platform by exposing a clean, typed API for:

- Creating and managing protection plans
- Handling secure authentication and client keys
- Triggering and validating access conditions
- Working with encrypted shares and backup configurations

## Features

- ✅ Written in TypeScript with full typings
- ✅ React support
- ✅ Built-in support for authentication and session handling
- ✅ Modular and composable architecture
- ✅ Compatible with browser and server environments
npm package: @safetech/inheriti-core-sdk
Description: The **Inheriti Core SDK** is a TypeScript library that provides the foundational logic for integrating with the Inheriti platform. It is intended to be used internally by other SDKs, such as the `@safetech/inheriti-client-sdk`.
Latest version: 2.10.0

# Inheriti Core SDK

The **Inheriti Core SDK** is a TypeScript library that provides the foundational logic for integrating with the Inheriti platform. It is intended to be used internally by other SDKs, such as the `@safetech/inheriti-client-sdk`.

## Purpose

This SDK encapsulates the core logic for interacting with the Inheriti infrastructure and offers a clean, typed API for:

- Creating and managing protection plans
- Triggering and validating access conditions
- Working with encrypted shares and backup configurations

> 🧩 **Note:** This SDK is not designed for direct use by application developers. Instead, it serves as a shared core layer for SDKs like the Client SDK, which expose user-facing APIs.

## Features

- ✅ Written in TypeScript with full typings
- ✅ Modular and composable architecture
- ✅ Designed for integration into higher-level SDKs
- ✅ Supports both browser and Node.js environments
- ✅ Built-in utilities for authentication, session, and encryption
npm package: @safetica-ui/ui
Description: This is UI components library for Safetica.
Author: Štefan Pružinský
Latest version: 0.0.3

# Safetica UI

This is UI components library for Safetica.

## Installation

Run `npm install safetica-ui`

## Building library

Run `npx nx build ui`

## Start SUI-tester app

Run `npx nx serve`

You can also append `--watch` to see changes instantly.

## To create new UI component:

Run `npx nx g @nrwl/angular:component new-component --project=ui --export`

## To use existing component

In *app.module.ts* insert:

`import { UiModule } from '@safetica-ui/ui';`

Component tag starts with **safetica-ui**:

`<safetica-ui-new-component>Hello friends!</safetica-ui-new-component>`
npm package: @safeticsinc/dra
Description: digital risk assessment system algorithm and formula
Latest version: 0.0.216
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @safeticsinc/dra

Digital Risk Assessment System Algorithm and Formula library.

## Installation

```bash
npm install @safeticsinc/dra
# or
yarn add @safeticsinc/dra
```

## Usage

### CommonJS

```javascript
const { /* your imports */ } = require('@safeticsinc/dra');
```

### ES Modules

```javascript
import { /* your imports */ } from '@safeticsinc/dra';
```

## Features

- 🎯 Digital Risk Assessment algorithms
- 📐 Mathematical formulas for risk calculations
- 🔧 Core utilities and error handling
- 📦 Dual module support (CommonJS & ESM)
- 📝 Full TypeScript support

## Project Structure

- `src/algorithm/` - Risk assessment formulas and algorithms
- `src/core/` - Core functionality and error handling
- `src/cli/` - Command-line interface
- `src/schema/` - Robot schema definitions
- `src/types/` - Type definitions
- `src/util/` - Utility functions

## Scripts

- `npm run build` - Build the library
- `npm run docs` - Generate TypeDoc documentation
- `npm run type-check` - Check TypeScript types
- `npm run cli-dev` - Run CLI in development mode

## Requirements

- Node.js >= 18.0.0

## Dependencies

- `mathjs` - Mathematical computations
- `seedrandom` - Seeded random number generator
- `three` - 3D graphics library

## License

[LICENSE](https://github.com/mtkim-safetics/dra_math/blob/master/LICENSE)

## Repository

[https://github.com/mtkim-safetics/dra_math](https://github.com/mtkim-safetics/dra_math)
[@mtkim-safetics](https://github.com/mtkim-safetics)
npm package: @safetnsr/ai-ready
Description: Pre-session codebase AI-readiness scorer for Claude Code and agent workflows
Author: safetnsr
Latest version: 1.3.0

# ai-ready

Pre-session codebase AI-readiness scorer — **know before you claude**.

Analyzes your codebase and tells you which files will hit the AI complexity wall before you start a Claude Code session.

## Install

```bash
npx @safetnsr/ai-ready
```

## Usage

```bash
ai-ready [dir] [options]
```

### Sample Output

```
ai-ready — codebase scan complete

FILE                    SCORE  TOP ISSUE              FIX
src/auth/index.ts        12    function too long      split into smaller functions
src/api/middleware.ts    34    high coupling           extract shared utils
src/utils/helpers.ts     87    ✓ AI-ready

overall: 54/100 ⚠️  some modules need work before AI sessions
→ split src/auth/index.ts into smaller files first (biggest win)
→ high coupling in src/api/middleware.ts
```

## Flags

| Flag | Description |
|------|-------------|
| `[dir]` | Directory to scan (default: `.`) |
| `--json` | Machine-readable JSON output |
| `--top N` | Show only worst N files |
| `--min-score N` | Only show files below score N |
| `--ci` | Exit 1 if overall < 60, exit 0 if ≥ 60 |
| `--explain` | Show per-signal breakdown per file |
| `--ext LIST` | Comma-separated extensions (default: `.ts,.js,.tsx,.jsx`) |
| `-h, --help` | Show help |

## Scoring

Each file is scored 0-100 based on five signals:

| Signal | Weight | What it measures |
|--------|--------|-----------------|
| Function length | 30% | Average function length (< 20 lines = 100) |
| Coupling | 25% | Import count (≤ 3 = 100) |
| Test coverage | 25% | Matching test file exists |
| Comment density | 10% | Comment-to-code ratio |
| File size | 10% | Total line count (≤ 150 = 100) |

## Agent Interface (`--json`)

```bash
ai-ready --json | jq '.files[] | select(.score < 40)'
```

JSON schema:

```json
{
  "files": [
    {
      "path": "src/auth/index.ts",
      "score": 12,
      "issues": ["function too long", "split into smaller functions"],
      "signals": {
        "functionLength": 0,
        "coupling": 0,
        "testCoverage": 0,
        "commentDensity": 10,
        "fileSize": 40
      }
    }
  ],
  "overall": 54,
  "recommendations": ["split src/auth/index.ts into smaller files first (biggest win)"]
}
```

## CI Integration

```yaml
# .github/workflows/ai-ready.yml
- name: Check AI readiness
  run: npx @safetnsr/ai-ready --ci
```

Exit codes:
- `0` — overall score ≥ 60 (ready for AI sessions)
- `1` — overall score < 60 (refactor first)

## Pair With

- [vibe-check](https://github.com/safetnsr/vibe-check) — post-session risk scanner
- [session-distill](https://github.com/safetnsr/session-distill) — generate CLAUDE.md from session history
- [human-edge](https://github.com/safetnsr/human-edge) — your AI-replaceability score

## License

MIT
npm package: @safetnsr/clone-safe
Description: Scan cloned repos for malicious AI agent configs before you open them
Author: safetnsr
Latest version: 0.1.1
Deprecated: merged into @safetnsr/vet — use: npx @safetnsr/vet (scan check)

# clone-safe

scan cloned repos for malicious AI agent configs before you open them.

claude code CVEs (CVE-2025-59536, CVE-2026-21852) proved it: clone a repo, open it in your coding agent, and malicious config files execute before you see a trust prompt. clone-safe catches them first.

## install

```
npx @safetnsr/clone-safe
```

## usage

```bash
# scan current directory
clone-safe

# scan specific directory
clone-safe --dir ./suspicious-repo

# json output for CI
clone-safe --json

# strict mode (exit 1 on any HIGH+ finding)
clone-safe --strict
```

## what it scans

| platform | files |
|----------|-------|
| claude code | .claude/, CLAUDE.md, AGENTS.md |
| cursor | .cursorrules, .cursor/ |
| github copilot | .github/copilot-instructions.md |
| aider | .aider.conf.yml |
| continue | .continue/config.json |
| mcp | .mcp/ |
| roo | .roomodes, .roo/ |

## what it detects

| severity | examples |
|----------|----------|
| 🔴 critical | base64-encoded URLs, curl/wget in configs, shell injection |
| 🟡 high | prompt injection, env var exfiltration, permission escalation |
| ℹ️ info | external URLs, sensitive path references |

## agent interface (--json)

```json
[{
  "file": ".claude/settings.json",
  "line": 12,
  "severity": "critical",
  "pattern": "base64-encoded-url",
  "description": "Base64-encoded URL found in config value",
  "context": "\"callback\": \"aHR0cHM6Ly9ldmlsLmNvbS9leGZpbA==\""
}]
```

## exit codes

| code | meaning |
|------|---------|
| 0 | clean — no findings |
| 1 | findings detected |
| 2 | critical findings detected |

## pair with

- [@safetnsr/sub-audit](https://github.com/safetnsr/sub-audit) — scan your dev env for exposed API keys
- [@safetnsr/vibe-check](https://github.com/safetnsr/vibe-check) — scan git diffs for AI anti-patterns
npm package: @safetnsr/front-leak
Description: scan your frontend build for leaked secrets — catches what .env misses
Author: safetnsr
Latest version: 0.1.0
Deprecated: merged into @safetnsr/vet — use: npx @safetnsr/vet (secrets check)

# front-leak

scan your frontend build for leaked secrets — catches what .env misses

## why

your `.env` protects secrets in source. your `.gitignore` keeps them out of git. but when webpack/vite/esbuild bundles your app, environment variables get **inlined into the JavaScript your users download**. front-leak scans the actual build output.

> your Google Maps API key is in dist/bundle.js. it was safe last month — then Google retroactively enabled Gemini on 2,863+ public keys. front-leak catches this.

## install

```
npx @safetnsr/front-leak
```

## usage

```
front-leak scan
```

auto-detects dist/, build/, .next/static/, out/ — scans all JS/CSS/HTML/JSON files.

## what it catches

| pattern | severity | example |
|---------|----------|---------|
| Stripe secret key | critical | `sk_live_...` |
| AWS access key | critical | `AKIA...` |
| Private keys | critical | `-----BEGIN PRIVATE KEY-----` |
| GitHub tokens | critical | `ghp_...` |
| Anthropic API key | critical | `sk-ant-...` |
| OpenAI API key | critical | `sk-...` |
| Google API key | high | `AIza...` (Gemini risk) |
| Connection strings | high | `postgres://user:pass@...` |
| JWT tokens | medium | `eyJ...` |
| Source maps | medium | `.map` files leak source |
| Stripe publishable | info | `pk_live_...` (intended for client) |

## flags

| flag | description |
|------|-------------|
| `--dir <path>` | explicit directory to scan |
| `--json` | JSON output for agents |
| `--ci` | exit 1 on critical/high findings |
| `--severity <level>` | minimum severity to show |
| `--help` | show help |

## agent interface (--json)

```json
{
  "findings": [
    {
      "type": "Stripe Secret Key",
      "severity": "critical",
      "file": "dist/bundle.js",
      "line": 1847,
      "preview": "sk_live_****...****"
    }
  ],
  "summary": {
    "total": 3,
    "critical": 1,
    "high": 1,
    "medium": 1,
    "info": 0,
    "filesScanned": 24
  }
}
```

## pair with

- [@safetnsr/clone-safe](https://github.com/safetnsr/clone-safe) — scan repo configs before opening in agent
- [@safetnsr/sub-audit](https://github.com/safetnsr/sub-audit) — scan dev environment for exposed keys
- [@safetnsr/dep-ghost](https://github.com/safetnsr/dep-ghost) — detect hallucinated package imports
npm package: @safetnsr/ground
Description: local docs grounding for AI agents — pipe-friendly, zero config
Author: safetnsr
Latest version: 0.1.0

# ground

local docs grounding for AI agents — pipe-friendly, zero config

## why

context7 needs an MCP server running. `ground stripe payment_intents | pbcopy` works in 2 seconds.

your agent hallucinating API calls? ground it on real docs.

## install

```
npx @safetnsr/ground stripe --update
npx @safetnsr/ground stripe payment_intents
```

## usage

```bash
# index a platform's docs (first time or refresh)
ground stripe --update

# query
ground stripe "payment intents create"

# pipe into clipboard
ground stripe payment_intents | pbcopy

# pipe into claude
echo "$(ground stripe webhooks) now implement webhook handling" | claude

# json output for agents
ground nextjs "app router" --json
```

## flags

| flag | description |
|------|-------------|
| `--update` | fetch/refresh docs for a platform |
| `--list` | show indexed platforms |
| `--json` | structured JSON output |
| `--tokens N` | max tokens per result (default: 500) |
| `--limit N` | number of results (default: 3) |

## supported platforms

| platform | docs source |
|----------|------------|
| stripe | docs.stripe.com/api |
| nextjs | nextjs.org/docs |
| react | react.dev/reference |
| node | nodejs.org/api |
| hono | hono.dev/docs |

more coming in v0.2.0.

## agent interface (--json)

```json
{
  "platform": "stripe",
  "query": "payment intents",
  "results": [
    {
      "title": "Create a PaymentIntent",
      "content": "...",
      "url": "https://docs.stripe.com/api/payment_intents/create",
      "tokens": 487
    }
  ]
}
```

## pair with

- `@safetnsr/vet` — audit your AI code
- `@safetnsr/pinch` — track AI costs
- `@safetnsr/mcp-tracer` — debug MCP servers
npm package: @safetnsr/mcp-tracer
Description: wireshark for MCP — intercept, log, and visualize every tool call your agent makes
Author: safetnsr
Latest version: 0.1.0

# mcp-tracer

wireshark for MCP — intercept, log, and visualize every tool call your agent makes.

## install

```
npx @safetnsr/mcp-tracer
```

## usage

### trace an MCP server

```bash
mcp-tracer proxy -- npx @modelcontextprotocol/server-filesystem .
```

### view the report

```bash
mcp-tracer report
```

Output:
```
┌──────────────────┬───────┬──────────────┬─────────────┬───────────┐
│ Tool             │ Calls │ Total Latency│ Avg Latency │ Bytes     │
├──────────────────┼───────┼──────────────┼─────────────┼───────────┤
│ read_file        │   847 │      4,235ms │       5.0ms │   2.1 MB  │
│ write_file       │    12 │        156ms │      13.0ms │  45.2 KB  │
│ list_directory   │     3 │         18ms │       6.0ms │   1.2 KB  │
└──────────────────┴───────┴──────────────┴─────────────┴───────────┘

Session: 862 calls | 4.4s total | 2.1 MB transferred
```

### list sessions

```bash
mcp-tracer list
```

### use with Claude Desktop

In your `claude_desktop_config.json`, change:
```json
"command": "npx @modelcontextprotocol/server-filesystem ."
```
to:
```json
"command": "npx @safetnsr/mcp-tracer proxy -- npx @modelcontextprotocol/server-filesystem ."
```

One line change. Full tracing.

## flags

| flag | description |
|------|------------|
| `--help` | show help |
| `--version` | show version |
| `--json` | output report as JSON |

## agent interface (--json)

```json
{
  "session": "2026-03-08_17-30-00",
  "totalCalls": 862,
  "totalDurationMs": 4409,
  "tools": [
    { "method": "read_file", "calls": 847, "totalLatencyMs": 4235, "avgLatencyMs": 5.0, "totalBytes": 2100000 }
  ]
}
```

## pair with

- `@safetnsr/vet` — audit your agent's code changes
- `@safetnsr/pinch` — track session costs
npm package: @safetnsr/model-drift
Description: receipts for model nerfs — benchmark LLMs against saved prompt baselines, track quality drift
Author: safetnsr
Latest version: 0.1.1

# model-drift

receipts for model nerfs — benchmark any LLM against saved prompt baselines, track quality drift over time.

## install

```
npx @safetnsr/model-drift init --model claude-sonnet-4-6
```

## usage

### save a baseline
```
model-drift init --model gpt-5.4
```
runs 10 coding prompts against the model. saves scores as your baseline.

### check for drift
```
model-drift check --model gpt-5.4
```
re-runs the same prompts. diffs against your baseline. shows what regressed.

### view report
```
model-drift report --model gpt-5.4
```
full markdown report with all historical runs.

### list baselines
```
model-drift list
```

## flags

| flag | description |
|------|-------------|
| --model | target model name (required for init/check) |
| --since | compare against baseline from specific date |
| --json | machine-readable JSON output |
| --help | show help |
| --version | show version |

## supported models

any model accessible via:
- OpenAI API (set OPENAI_API_KEY) — gpt-*, o1-*, o3-*
- Anthropic API (set ANTHROPIC_API_KEY) — claude-*
- Google AI (set GOOGLE_API_KEY) — gemini-*
- any OpenAI-compatible endpoint (set OPENAI_BASE_URL)

## agent interface (--json)

```json
{
  "model": "claude-sonnet-4-6",
  "baseline": "2026-03-01",
  "current": "2026-03-08",
  "total": { "baseline": 8, "current": 6, "delta": -2 },
  "prompts": [
    { "id": "binary-search-edge", "baseline": 1, "current": 0, "delta": -1 }
  ]
}
```

## prompt suite

model-drift ships with 10 hardcoded prompts covering:
- algorithm implementation (binary search, fibonacci, CSV parser)
- security (SQL injection fix)
- validation (IPv4 regex)
- async patterns (fetch with retry)
- knowledge (event loop explanation)
- refactoring (reduce complexity)
- framework-specific (React useEffect deps)
- type system (TypeScript generics)

scoring is objective: code execution tests, pattern matching, keyword checks. no LLM-as-judge.

## pair with

- [@safetnsr/vet](https://github.com/safetnsr/vet) — audit your AI coding workflow
- [@safetnsr/pinch](https://github.com/safetnsr/pinch) — track AI session costs
npm package: @safetnsr/session-distill
Description: distill recurring context from AI agent sessions into CLAUDE.md
Author: safetnsr
Latest version: 0.3.2

# session-distill

distill recurring context from AI agent sessions into CLAUDE.md.

**stop re-explaining yourself every session.**

## install

```bash
npx @safetnsr/session-distill
```

zero dependencies beyond chalk. no config. no network calls.

## usage

```bash
# auto-detect agent sessions, output to stdout
npx @safetnsr/session-distill

# write directly to CLAUDE.md
npx @safetnsr/session-distill --out CLAUDE.md

# preview top 10 recurring patterns
npx @safetnsr/session-distill --top 10

# show what would change without writing
npx @safetnsr/session-distill --diff

# pipe any chatlog
cat chat.md | npx @safetnsr/session-distill

# machine-readable output
npx @safetnsr/session-distill --json
```

## supported agents

- **claude code** — reads `~/.claude/projects/` JSONL files automatically
- **aider** — reads `.aider.chat.history.md` from cwd or parent dirs
- **any chatlog** — pipe markdown-formatted chatlogs via stdin

## how it works

session-distill runs a 4-step pipeline, 100% local:

1. **extract** — heuristic pattern matching finds facts in your messages: explicit instructions ("always use typescript"), stack mentions, conventions ("we use X"), and corrections ("no, we use npm not pip")
2. **cluster** — Jaccard similarity groups related facts across sessions (threshold > 0.6)
3. **rank** — frequency × recency scoring surfaces the most important recurring patterns
4. **render** — generates a structured CLAUDE.md with sections: stack, workflow, preferences, context

every line includes `(seen in X/Y sessions)` so you can verify what matters.

## options

```
--adapter <name>    force adapter: claude-code | aider | markdown | stdin
--project <path>    path to sessions directory or file
--top <n>           show top N patterns without generating CLAUDE.md
--merge             merge with existing CLAUDE.md instead of replacing
--diff              show what would change without writing
--json              machine-readable output
--all               scan all sessions (default: 20 most recent)
--out <file>        write to file instead of stdout (default: stdout)
--version, -v       show version
--help, -h          show help
```

## privacy

100% local. zero network calls. your sessions never leave your machine.

session-distill reads files from your local filesystem, processes them in memory, and outputs to stdout or a local file. nothing is sent anywhere.

## license

MIT
npm package: @safetnsr/spend-cap
Description: Client-side hard cap for AI API spending — no provider support needed
Author: safetnsr
Latest version: 0.1.0

# spend-cap

client-side hard cap for AI API spending — no provider support needed

## install

```
npm install @safetnsr/spend-cap
```

## usage

```bash
# add to any Node.js app that calls AI APIs
SPEND_CAP=5 node --import @safetnsr/spend-cap/register app.js

# or with --require for CJS
SPEND_CAP=5 node -r @safetnsr/spend-cap/register app.js
```

when your daily spend hits $5, the next API call throws `SpendCapError` instead of making the request.

## how it works

patches `globalThis.fetch` to intercept requests to:
- api.openai.com
- api.anthropic.com
- generativelanguage.googleapis.com

tracks cumulative daily spend in `~/.spend-cap-state.json`. resets at midnight UTC.

## cli

```bash
# check today's spend
spend-cap status

# reset spend counter
spend-cap reset
```

## flags

| env var | description | default |
|---------|------------|---------|
| SPEND_CAP | daily cap in USD | (required) |
| SPEND_CAP_STATE_PATH | custom state file path | ~/.spend-cap-state.json |

## supported models

accurate pricing for: gpt-4o, gpt-4o-mini, gpt-4.1, gpt-5.4, claude-sonnet, claude-opus, claude-haiku, gemini-flash, gemini-pro. fallback estimation for unknown models.

## agent interface (--json)

`spend-cap status --json` outputs:
```json
{
  "date": "2026-03-07",
  "spentUsd": 3.42,
  "capUsd": 5.00,
  "remainingUsd": 1.58,
  "percentUsed": 68.4
}
```

## pair with

- [@safetnsr/vet](https://github.com/safetnsr/vet) — audit your AI coding workflow
- [@safetnsr/pinch](https://github.com/safetnsr/pinch) — track AI costs over time
npm package: @safetnsr/sub-audit
Description: AI API key security audit — scan your dev environment for exposed keys
Author: safetnsr
Latest version: 0.1.0
Deprecated: merged into @safetnsr/vet — use: npx @safetnsr/vet (secrets check)

# sub-audit

AI API key security audit — scan your dev environment for exposed keys.

```bash
npx @safetnsr/sub-audit
```

## What it does

Scans your dev environment for AI API keys, identifies providers, checks git exposure, and estimates cost risk. Zero dependencies, 100% local.

## Install

```bash
# Run directly
npx @safetnsr/sub-audit

# Or install globally
npm install -g @safetnsr/sub-audit
sub-audit
```

## Usage

```bash
# Scan current directory + home dotfiles
sub-audit

# Scan specific directory
sub-audit --dir ./my-project

# Skip home directory scan
sub-audit --no-home

# JSON output (for CI/agent integration)
sub-audit --json

# Show help
sub-audit --help
```

## What it scans

- `.env`, `.env.*`, `*.env` files (recursive, 3 levels deep)
- Home dotfiles: `~/.bashrc`, `~/.zshrc`, `~/.bash_profile`, `~/.profile`, `~/.zprofile`
- Config directory: `~/.config/` (1 level deep)
- AWS credentials: `~/.aws/credentials`

## Detected providers

| Provider | Detection |
|----------|-----------|
| OpenAI | `sk-proj-` prefix |
| Anthropic | `sk-ant-` prefix |
| Google AI | `AIza` prefix |
| Replicate | `r8_` prefix |
| HuggingFace | `hf_` prefix |
| Groq | `gsk_` prefix |
| Fireworks | `fw_` prefix |
| Cohere | `COHERE_API_KEY` env var |
| Mistral | `MISTRAL_API_KEY` env var |
| Together | `TOGETHER_API_KEY` env var |
| DeepSeek | `DEEPSEEK_API_KEY` env var |

## Risk levels

| Level | Meaning |
|-------|---------|
| 🔴 CRITICAL | Key in git-tracked file — rotate immediately |
| 🟡 HIGH | World-readable file permissions |
| 🔵 MEDIUM | User-accessible file |
| 🟢 LOW | Secure location |

## Agent interface

```bash
sub-audit --json
```

Returns structured JSON with findings array and summary object. Exit code 1 if any CRITICAL or HIGH risk keys found.

```json
{
  "version": "0.1.0",
  "findings": [...],
  "summary": {
    "totalKeys": 3,
    "totalFiles": 2,
    "totalProviders": 2,
    "critical": 1,
    "high": 0,
    "medium": 2,
    "low": 0
  }
}
```

## Pair with

- [`@safetnsr/ai-ready`](https://www.npmjs.com/package/@safetnsr/ai-ready) — AI-readiness scorer for codebases
- [`@safetnsr/vibe-check`](https://www.npmjs.com/package/@safetnsr/vibe-check) — vibe check your AI workflow
- [`@safetnsr/pinch`](https://www.npmjs.com/package/@safetnsr/pinch) — AI cost tracking

## License

MIT
npm package: @safetnsr/tasks
Description: open source copilot tasks — define coding tasks as markdown, run with any agent, get a report
Author: safetnsr
Latest version: 0.1.1

# tasks

open source copilot tasks — define coding tasks as markdown, run with any agent, get a report.

## install

```
npx @safetnsr/tasks init
```

## usage

define tasks in `.tasks/*.md`:

```markdown
---
name: add-auth
timeout: 600
---

## task
Add JWT auth middleware to the Express server.

## context
- src/server.ts
- src/routes/

## acceptance
- [ ] src/middleware/auth.ts exists
- [ ] src/middleware/auth.ts > 20 lines
- [ ] test:pass
```

run them:

```
npx @safetnsr/tasks run --parallel 2
```

```
┌──────────────┬────────┬──────────┬─────────────┐
│ task         │ status │ duration │ acceptance  │
├──────────────┼────────┼──────────┼─────────────┤
│ add-auth     │ ✓ pass │ 45s      │ 3/3         │
│ fix-tests    │ ✓ pass │ 22s      │ 2/2         │
│ add-logging  │ ✗ fail │ 60s      │ 1/3         │
│ refactor-db  │ ✓ pass │ 38s      │ 4/4         │
│ update-docs  │ ⏱ timeout │ 300s │ 0/2         │
└──────────────┴────────┴──────────┴─────────────┘

summary: 3/5 passed | 1 failed | 1 timeout | 165s total
```

## commands

| command | description |
|---------|-------------|
| `tasks init` | scaffold .tasks/ directory with example |
| `tasks run` | execute all tasks and validate |
| `tasks report` | show results from last run |
| `tasks list` | list all task specs |

## flags

| flag | description | default |
|------|-------------|---------|
| `--parallel N` | run N tasks simultaneously | 1 |
| `--timeout N` | per-task timeout in seconds | 600 |
| `--json` | output as JSON | false |
| `--format` | report format (terminal/json/md) | terminal |

## agent interface (--json)

```json
{
  "tasks": [
    {
      "name": "add-auth",
      "status": "passed",
      "duration": 45000,
      "acceptance": [
        { "criterion": "src/middleware/auth.ts exists", "passed": true }
      ]
    }
  ],
  "summary": { "total": 5, "passed": 3, "failed": 1, "errors": 0, "duration": 165000 }
}
```

## pair with

- `@safetnsr/vet` — audit the code your tasks generated
- `@safetnsr/pinch` — track what the tasks cost
- `@safetnsr/spend-cap` — set a budget cap for task runs
npm package: @safety-first/require
Description: javascript module management! brings node's require statement to the browser
Author: Marcus Westin
Latest version: 2.4.20

require brings `require` to the browser
=======================================

Node's `require()` is the de facto javascript dependency statement.

`npm` is the de facto javascript module manager.

require brings both of them to the browser.

tl;dr
=====
"Just give me some code that runs"

	mkdir app; cd app
	echo '{ "name":"app" }' > package.json
	sudo npm install require
	sudo npm install raphael
	curl -O https://raw.github.com/gist/975866/little_server.js
	curl -O https://raw.github.com/gist/975868/little_client.js
	node little_server.js

Now go to http://localhost:8080

Install
=======

	sudo npm install -g require

Run
===
Start dev server

	require serve ./example --port 1234 --host localhost

In your HTML:

	<script src="//localhost:1234/require/client"></script>

This is like calling require('client') from inside ./example.
[Read more on node's require path resolution](http://nodejs.org/api/modules.html)

Compile
=======
(You'll want to do this before you deploy to production)

	require compile ./example/client.js > client.min.js

Use programmatically
====================
In node:

	require('require/server').listen(1234)

or mount it on an http server you're already running

	var server = http.createServer(function(req, res) { })
	require('require/server').mount(server)
	server.listen(8080, 'localhost')

or, as connect middleware

	connect.createServer(
		connect.static(__dirname + '/example'),
		require('require/server').connect()
	)

Compile programmatically:

	var compiler = require('require/compiler')
	console.log(compiler.compile('./example/client.js'))
	console.log(compiler.compileCode('require("./example/client")'))

The compiler supports all the options of https://github.com/mishoo/UglifyJS, e.g.

	compiler.compile('./example/client.js', { beautify:true, ascii_only:true })