open-index/open-npm huggingface dataset:
npm package: @sapo-ui/react
Description: Conjunto de todos os componentes
Author: Joao
Latest version: 1.0.4

<p align="center">
  <img src="https://housi-images.s3.amazonaws.com/retriever/logo.png" alt="Retriever logo" width="500" />
</p>

[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)
[![styled with emotion](https://img.shields.io/badge/styled_with-emotion-ff69b4.svg)](https://github.com/emotion-js/emotion)
[![NPM](https://img.shields.io/npm/v/@sapo-ui/react?color=%23eee111&label=version)](https://www.npmjs.com/package/@sapo-ui/react)

This package are using

- Emotion
- Framer-Motion
- Jest
- Typescript

## Install

```bash
yarn add @sapo-ui/react
```

## Usage

```tsx
// app.tsx
import React from 'react'
import { RetrieverProvider } from '@sapo-ui/react'

const App = () => {
  return <RetrieverProvider>your code...</RetrieverProvider>
}

export default App
```

## setting our theme in your project

```tsx
// styles/styled.d.ts
import { ITheme } from '@sapo-ui/react'
import '@emotion/react'

declare module '@emotion/react' {
  export interface Theme extends ITheme {}
}
```
npm package: @sapo/cordova-plugin-sapo-pub-navigation
Description: Cordova SAPO Pub Navigation Plugin
Latest version: 0.1.2

---
title: SAPO Pub Navigation
description: Open ads in an in-app browser window.
---

Quick and dirty solution to the issue of opening links from iframes into an inapp browser instead of going back into the app.

Only support for iOS, and it's specifically set up to capture ad links from SmartAdServer and SAPO AdWords.
npm package: @sapper-ai/core
Description: Core security engine for SapperAI - rules-based threat detection and policy enforcement
Author: SapperAI
Latest version: 0.4.0

# @sapper-ai/core

Core security engine for SapperAI - rules-based threat detection and policy enforcement for AI systems.

## Installation

```bash
pnpm add @sapper-ai/core
```

## Quick Start

```typescript
import { RulesDetector, DecisionEngine, Guard } from '@sapper-ai/core'
import type { Policy } from '@sapper-ai/types'

// 1. Configure policy
const policy: Policy = {
  mode: 'enforce',
  defaultAction: 'allow',
  failOpen: true,
}

// 2. Set up detection pipeline
const detector = new RulesDetector()
const engine = new DecisionEngine([detector])

// 3. Create guard
const guard = new Guard(engine, policy)

// 4. Scan tool calls
const decision = await guard.assessToolCall(
  'executeCommand',
  { command: 'rm -rf /' },
  {}
)

console.log(decision.action) // 'block'
console.log(decision.risk)   // 0.95
console.log(decision.reasons) // ['Detected pattern: rm rf root']
```

## API Summary

### Detectors
- **`RulesDetector`** - Pattern-based threat detection (60+ patterns)
- **`LlmDetector`** - LLM-based detection interface (requires LlmConfig)

### Engine
- **`DecisionEngine`** - Runs detectors and produces final decision
- **`PolicyManager`** - Manages policy configuration and validation
- **`validatePolicy(policy)`** - Validates policy structure with Zod

### Guards
- **`Guard`** - High-level API for tool call/result scanning
- **`Scanner`** - Low-level API for custom assessment contexts

### Audit
- **`AuditLogger`** - Structured logging of security decisions

## Performance

Rules-only pipeline benchmarks (vitest bench):

```
RulesDetector.run - small payload (50 bytes)    737,726 ops/sec  p99: 0.0018ms
DecisionEngine.assess - small payload           391,201 ops/sec  p99: 0.0030ms
```

Run benchmarks:
```bash
pnpm run bench
```

## License

MIT
npm package: @sapper-ai/mcp
Description: Model Context Protocol (MCP) security proxy for SapperAI
Author: SapperAI
Latest version: 0.3.3

# @sapper-ai/mcp

Model Context Protocol (MCP) security proxy for SapperAI. Wraps any MCP server with real-time threat detection.

## Installation

```bash
pnpm add @sapper-ai/mcp
```

## Quick Start

### CLI Usage

```bash
# Run security proxy in front of any MCP server
sapperai-proxy -- npx @modelcontextprotocol/server-example

# With custom policy
sapperai-proxy --policy ./policy.yaml -- npx mcp-server

# Watch local skill/plugin/config files and auto-quarantine blocked content
sapperai-proxy watch

# Override watched paths (repeatable)
sapperai-proxy watch --path ~/.claude/plugins --path ~/.config/claude-code

# List quarantined files
sapperai-proxy quarantine list

# Restore quarantined file
sapperai-proxy quarantine restore <id>
```

### Programmatic Usage

```typescript
import { StdioSecurityProxy } from '@sapper-ai/mcp'
import { RulesDetector, DecisionEngine } from '@sapper-ai/core'
import type { Policy } from '@sapper-ai/types'

const policy: Policy = {
  mode: 'enforce',
  defaultAction: 'allow',
  failOpen: true,
}

const detector = new RulesDetector()
const engine = new DecisionEngine([detector])

const proxy = new StdioSecurityProxy({
  policy,
  upstreamCommand: 'npx',
  upstreamArgs: ['@modelcontextprotocol/server-example'],
})

await proxy.start()
```

### Watch + Quarantine Behavior

- `watch` monitors `~/.claude/plugins`, `~/.config/claude-code`, and current working directory by default.
- On file add/change, SapperAI scans text/config surfaces via install-scan pipeline.
- If decision is `block` and policy mode is `enforce`, file is moved to `~/.sapperai/quarantine`.
- Quarantine records are stored in `~/.sapperai/quarantine/index.json`.

## Policy Configuration

Create `policy.yaml`:

```yaml
mode: enforce
defaultAction: allow
failOpen: true

toolOverrides:
  executeCommand:
    mode: enforce
    detectors: [rules]
    thresholds:
      blockMinConfidence: 0.8
```

## API Summary

- **`StdioSecurityProxy`** - Transparent MCP proxy with security scanning
- **`FileWatcher`** - Real-time file monitor for skill/plugin/config scanning
- **`runCli()`** - CLI entrypoint for standalone proxy
- **`parseCliArgs(argv)`** - CLI argument parser
- **`resolvePolicy(path)`** - Load policy from YAML/JSON file
- **`runWatchCommand()`** - Starts watch mode
- **`runQuarantineListCommand()`** - Prints quarantine records
- **`runQuarantineRestoreCommand()`** - Restores one quarantine record by id

## License

MIT
npm package: @sapper-ai/openai
Description: OpenAI Agents SDK integration for SapperAI - tool input/output guardrails
Author: SapperAI
Latest version: 0.2.2

# @sapper-ai/openai

OpenAI Agents SDK integration for SapperAI - drop-in tool input/output guardrails.

## Installation

```bash
pnpm add @sapper-ai/openai
```

## Quick Start

```typescript
import { createToolInputGuardrail, createToolOutputGuardrail } from '@sapper-ai/openai'
import { RulesDetector, DecisionEngine } from '@sapper-ai/core'
import { Agent } from '@openai/agents'

// 1. Set up detection pipeline
const detector = new RulesDetector()
const engine = new DecisionEngine([detector])

// 2. Create guardrails
const inputGuardrail = createToolInputGuardrail(engine, {
  mode: 'enforce',
  defaultAction: 'allow',
  failOpen: true,
})

const outputGuardrail = createToolOutputGuardrail(engine, {
  mode: 'monitor',
  defaultAction: 'allow',
  failOpen: true,
})

// 3. Attach to OpenAI Agent
const agent = new Agent({
  model: 'gpt-4',
  tools: [myTool],
  inputGuardrail,
  outputGuardrail,
})

// Tool calls are now automatically scanned
const response = await agent.run('Execute command: rm -rf /')
```

## API Summary

- **`createToolInputGuardrail(engine, policy)`** - Creates input guardrail for OpenAI Agents
- **`createToolOutputGuardrail(engine, policy)`** - Creates output guardrail for OpenAI Agents

Both functions return guardrail functions compatible with `@openai/agents` SDK.

## How It Works

1. **Input Guardrail**: Scans tool arguments before execution
2. **Output Guardrail**: Scans tool results before returning to LLM
3. **Action**: Blocks malicious calls in `enforce` mode, logs in `monitor` mode
4. **Fail-Open**: On detector errors, allows execution to maintain availability

## License

MIT
npm package: @sapper-ai/types
Description: TypeScript type definitions for SapperAI security framework
Author: SapperAI
Latest version: 0.4.0

# @sapper-ai/types

TypeScript type definitions for the SapperAI security framework.

## Installation

```bash
pnpm add @sapper-ai/types
```

## Usage

Import shared types for building custom detectors, integrations, or policies:

```typescript
import type {
  AssessmentContext,
  Detector,
  DetectorOutput,
  Decision,
  Policy,
  GuardAction,
} from '@sapper-ai/types'

// Example: Custom detector implementation
export class CustomDetector implements Detector {
  id = 'custom'

  appliesTo(ctx: AssessmentContext): boolean {
    return ctx.kind === 'pre_tool_call'
  }

  async run(ctx: AssessmentContext): Promise<DetectorOutput | null> {
    // Your detection logic
    return {
      detectorId: this.id,
      risk: 0.5,
      confidence: 0.8,
      reasons: ['Detected pattern X'],
    }
  }
}
```

## Exported Types

### Core Types
- **`GuardAction`** - `'allow' | 'block'` - Action to take on tool execution
- **`AssessmentContext`** - Context for security evaluation (tool call, result, policy)
- **`Decision`** - Final security decision with risk score, confidence, and reasons

### Detection Types
- **`Detector`** - Interface for implementing custom threat detectors
- **`DetectorOutput`** - Output from detector runs (risk, confidence, evidence)

### Policy Types
- **`Policy`** - Guard configuration (mode, thresholds, detectors)
- **`ToolPolicy`** - Per-tool policy overrides
- **`LlmConfig`** - LLM provider configuration for LlmDetector

### Audit Types
- **`AuditLogEntry`** - Structured log entry for decision tracking

## License

MIT
npm package: @sapper-dragon/json
Description: Decorate your Sapper project with generated dummy JSON.
Author: Robert Hall
Latest version: 0.1.4

# @sapper-dragon/json

Decorate your [Sapper](https://sapper.svelte.dev/) project with generated dummy JSON.

## Installation

```
npm install @sapper-dragon/json --save-dev
# or
yarn add @sapper-dragon/json --dev
```

## Usage

This project requires the [@sapper-dragon/trimmings](https://github.com/sapper-dragon/trimmings) lib, so look there first for instructions, then come back. 💫

### JSON Ipsum

After installing, `@sapper-dragon/json` will watch for changes to `*.js` files in `src/trimmings/json`, and generate a resulting `*.json` file in `static/json` based on the rules setup in your js file.

Rules are simple. In your `src/trimmings/json/*.js` file, export a `compile` function like so:

```js
export const compile = () => {
	const result = // create your json here...
	console.log(JSON.stringify(result))
}
```

Note the critical

```js
console.log(JSON.stringify(result))
```

at the end of the `compile` function. `@sapper-dragon/json` needs this to read the output of `compile` and save it to a `*.json` file. In other words, the rest of the contents of the `compile` function can be anything you like, as long as the logged result is valid stringified JSON data.

### Config

You can place a `trimmings.config.js` file in the root of your project to set configutations. These are the defaults:

```js
export default {
	json: {
		input: 'src/trimmings/json', // path to watch *.js files
		filter: /\.js$/, // pattern for files to watch
		outputStatic: 'static/json', // output path
	},
	// ... additional settings from other @sapper-dragon packages...
}
```
npm package: @sapper-dragon/lilypond
Description: Decorate your Sapper project with LilyPond.
Author: Robert Hall
Latest version: 0.1.4

# @sapper-dragon/lilypond

Decorate your [Sapper](https://sapper.svelte.dev/) project with LilyPond.

`@sapper-dragon/lilypond` utilizes [LilyPond](http://lilypond.org/) under the surface, a tool for transforming `*.ly` LilyPond code files to music engraving and MIDI files.

## Installation

```
npm install @sapper-dragon/lilypond --save-dev
# or
yarn add @sapper-dragon/lilypond --dev
```

## Usage

This project requires the [@sapper-dragon/trimmings](https://github.com/sapper-dragon/trimmings) lib, so look there first for instructions, then come back. 💫

### LilyPond CLI

This package requires the cli tools to be installed. 


Instructions can be found here for [Unix](http://lilypond.org/doc/v2.18/Documentation/web/unix), [MacOS X](http://lilypond.org/doc/v2.18/Documentation/web/macos-x), and [Windows](http://lilypond.org/doc/v2.18/Documentation/web/windows).

After installing, `@sapper-dragon/lilypond` will watch for `*.ly` file changes in `src/trimmings/lilypond`, call the lilypond processor, and save the transformed music files (`*.pdf` and `*.midi) to `static/music`.

### Config

You can place a `trimmings.config.js` file in the root of your project to set configutations. These are the defaults:

```js
export default {
	lilypond: {
		input: 'src/trimmings/lilypond', // path to watch *.ly files
		filter: /\.ly$/, // pattern for files to watch
		outputStatic: 'static/music', // output path
	},
	// ... additional settings from other @sapper-dragon packages...
}
```
npm package: @sapper-dragon/postcss
Description: Decorate your Sapper project with PostCSS.
Author: Robert Hall
Latest version: 0.1.5

# @sapper-dragon/postcss

Decorate your [Sapper](https://sapper.svelte.dev/) project with PostCSS.

`@sapper-dragon/postcss` utilizes [PostCSS](https://postcss.org/) under the surface, a tool for transforming CSS with JavaScript.

## Installation

```
npm install @sapper-dragon/postcss --save-dev
# or
yarn add @sapper-dragon/postcss --dev
```

## Usage

This project requires the [@sapper-dragon/trimmings](https://github.com/sapper-dragon/trimmings) lib, so look there first for instructions, then come back. 💫

### Svelte Preprocessor

This package includes a PostCSS preprocessor. To use it, import it in your `rollup.config.js` file, and add it as a preproccesor like so:

```js
import { preprocess } from '@sapper-dragon/postcss/tools'
// ... 
	plugins: [
		// ...
		svelte({
			// ...
			preprocess: preprocess(),
		}),
	],
```

NOTE: this preprocessor expects to find a file at `./src/trimmings/postcss/svelte-pre-imports.postcss` (depending on your settings). Make sure it exists. DO NOT include actual compiled CSS in this preprended file. That will bundle CSS into every component, which you most likely won't want. (Maybe there's such a relevant use case?) This mostly allows you to prepend variables or mixins or other `*.postcss` files into every component processed.

### Global file

`@sapper-dragon/postcss` will also convert a `global.postcss` files from a `postcss` folder and output it to the `static/css` folder as `global.css`.

### Config

You can place a `trimmings.config.js` file in the root of your project to set configutations. These are the defaults:

```js
export default {
	postcss: {
		input: 'src/trimmings/postcss', // path to watch *.postcss files
		filename: 'global', // name of file without extension
		filter: /\.(postcss|css|scss)$/, // pattern for files to watch
		outputStatic: 'static/css', // output path
		preImport: 'svelte-pre-imports', // filename without extension for pre-importing postcss vars and mixins
	},
	// ... additional settings from other @sapper-dragon packages...
}
```

If `preImport` is set to `false`, no file will be prepended to the compile.
npm package: @sapper-dragon/remark
Description: Decorate your Sapper project with Remark.
Author: Robert Hall
Latest version: 0.1.0

# @sapper-dragon/remark

Decorate your [Sapper](https://sapper.svelte.dev/) project with Remark.

`@sapper-dragon/remark` utilizes [Remark](https://remark.js.org/) under the surface, which is a tool for converting markdown files to HTML.

## Installation

```
npm install @sapper-dragon/remark --save-dev
# or
yarn add @sapper-dragon/remark --dev
```

## Usage

This project requires the [@sapper-dragon/trimmings](https://github.com/sapper-dragon/trimmings) lib, so look there first for instructions, then come back. 💫

`@sapper-dragon/remark` converts files from an `remark` folder and outputs them to importable `*.svelte` files.

### Config

You can place a `trimmings.config.js` file in the root of your project to set configutations. These are the defaults:

```js
export default {
	remark: {
		input: 'src/trimmings/remark', // path to watch *.md files
		filter: /\.md$/, // pattern for files to watch
		outputSvelte: 'src/routes/_markdown', // svelte output path
	},
	// ... additional settings from other @sapper-dragon packages...
}
```
npm package: @sapper-dragon/svgo
Description: Decorate your Sapper project with SVGO.
Author: Robert Hall
Latest version: 0.1.4

# @sapper-dragon/svgo

Decorate your [Sapper](https://sapper.svelte.dev/) project with SVGO.

`@sapper-dragon/svgo` utilizes [SVGO](https://github.com/svg/svgo) under the surface, which is a tool for optimizing Scalable Vector Graphics files.

## Installation

```
npm install @sapper-dragon/svgo --save-dev
# or
yarn add @sapper-dragon/svgo --dev
```

## Usage

This project requires the [@sapper-dragon/trimmings](https://github.com/sapper-dragon/trimmings) lib, so look there first for instructions, then come back. 💫

`@sapper-dragon/svgo` converts files from an `SVGO` folder and outputs them to optimized and importable `*.svelte` files and static `*.svg` files.

### Config

You can place a `trimmings.config.js` file in the root of your project to set configutations. These are the defaults:

```js
export default {
	svgo: {
		input: 'src/trimmings/svgo', // path to watch *.svg files
		filter: /\.(svg)$/, // pattern for files to watch
		outputSvelte: 'src/routes/_svg', // svelte output path
		outputStatic: 'static/svg', // static output path
	},
	// ... additional settings from other @sapper-dragon packages...
}
```

If `outputSvelte` or `outputStatic` are set to `false`, files will not be saved to those paths.
npm package: @sapphi-red/dtln-web
Description: Use [DTLN real time speech denoising model](https://github.com/breizhn/DTLN) and [DTLN-aec model for real-time acoustic echo cancellation](https://github.com/breizhn/DTLN-aec) in web.
Author: sapphi-red
Latest version: 0.1.4

# DTLN-web

Use [DTLN real time speech denoising model](https://github.com/breizhn/DTLN) and [DTLN-aec model for real-time acoustic echo cancellation](https://github.com/breizhn/DTLN-aec) in web.

[Demo](https://dtln-web.sapphi.red/)

## Install

```
npm i @sapphi-red/dtln-web # yarn add @sapphi-red/dtln-web
```

## Usage

See demo source code.

- [DTLN (noise reduction) demo source code](https://github.com/sapphi-red/DTLN-web/blob/main/demo/src/index.ts)
- [DTLN-aec (acoustic echo cancellation) demo source code](https://github.com/sapphi-red/DTLN-web/blob/main/demo/aec/src/index.ts)

Also you will need to copy files.
Use CopyWebpackPlugin or vite-plugin-static-copy or something simillar.

See [vite.config.ts used in demo](https://github.com/sapphi-red/DTLN-web/blob/main/demo/vite.config.ts).
npm package: @sapphi-red/speex-preprocess-wasm
Description: WebAssembly build of SpeexDSP proprocess
Author: sapphi-red
Latest version: 0.4.0

# @sapphi-red/speex-preprocess-wasm

[![npm version](https://badge.fury.io/js/@sapphi-red%2Fspeex-preprocess-wasm.svg)](https://badge.fury.io/js/@sapphi-red%2Fspeex-preprocess-wasm) ![CI](https://github.com/sapphi-red/speex-preprocess-wasm/workflows/CI/badge.svg)

WebAssembly build of [SpeexDSP preprocess](https://github.com/xiph/speexdsp/blob/master/include/speex/speex_preprocess.h).

## Install

```shell
npm i @sapphi-red/speex-preprocess-wasm # yarn add @sapphi-red/speex-preprocess-wasm
```

## Usage

```ts
import {
  loadSpeexModule,
  SpeexPreprocessor
} from '@sapphi-red/speex-preprocess-wasm'

const speexModule = await loadSpeexModule()
const bufferSize = 128
const sampleRate = 44100
const speexPreprocessor = new SpeexPreprocessor(
  speexModule,
  bufferSize,
  sampleRate
)
```
npm package: @sapphi-red/ts-transformer-for-of
Description: A TypeScript custom transformer which transforms multiple array methods to one for-of loop.
Author: sapphi-red
Latest version: 0.6.1

# ts-transformer-for-of
A TypeScript custom transformer which transforms multiple array methods to one for loop.
Also this transforms `for-of` to a traditional `for` loop.

For now, `Array::filter`, `Array::map` and `Array::forEach` are only supported.

# How to use the custom transformer

Unfortunately, TypeScript itself does not currently provide any easy way to use custom transformers (See [Microsoft/TypeScript#14419](https://github.com/Microsoft/TypeScript/issues/14419)).
The followings are the example usage of the custom transformer.

See [kimamula/ts-transformer-keys](https://github.com/kimamula/ts-transformer-keys/blob/master/README.md#how-to-use-the-custom-transformer).  
You can use this as it.

# Caveats
## Sparse arrays are not supported
Using this transformer with Sparse arrays, arrays with unfilled slots, may lead to unintended behavior.
Before transforming the code, Array iteration methods will skip unfilled slots, but after transforming the code it will work as if it is filled with `undefined`.

# License

MIT

Some code are from [kimamula/ts-transformer-keys](https://github.com/kimamula/ts-transformer-keys/blob/master/README.md#how-to-use-the-custom-transformer).  
Copyright (c) 2017 Kenji Imamula  
[kimamula/ts-transformer-keys:/LICENSE](https://github.com/kimamula/ts-transformer-keys/blob/master/LICENSE)
npm package: @sapphi-red/web-noise-suppressor
Description: Noise suppressor nodes for Web Audio API.
Author: sapphi-red
Latest version: 0.3.5

# @sapphi-red/web-noise-suppressor

[![npm version](https://badge.fury.io/js/@sapphi-red%2Fweb-noise-suppressor.svg)](https://badge.fury.io/js/@sapphi-red%2Fweb-noise-suppressor) ![CI](https://github.com/sapphi-red/web-noise-suppressor/workflows/CI/badge.svg)

Noise suppressor nodes for Web Audio API.

[Demo](https://web-noise-suppressor.sapphi.red)

This package provides three noise suppression nodes.

- NoiseGateWorkletNode: A simple noise gate implementation
- RnnoiseWorkletNode: Based on [xiph/rnnoise](https://github.com/xiph/rnnoise)
  - Using [shiguredo/rnnoise-wasm](https://github.com/shiguredo/rnnoise-wasm)
- SpeexWorkletNode: Based on [xiph/speexdsp](https://github.com/xiph/speexdsp)'s `preprocess` function
  - Using [sapphi-red/speex-preprocess-wasm](https://github.com/sapphi-red/speex-preprocess-wasm)

**This package requires AudioWorklet to work.**

## Install

```shell
npm i @sapphi-red/web-noise-suppressor # yarn add @sapphi-red/web-noise-suppressor
```

## Usage

This section is written only for vite users.

```ts
import { SpeexWorkletNode } from '@sapphi-red/web-noise-suppressor'
import speexWorkletPath from '@sapphi-red/web-noise-suppressor/speexWorklet.js?url'
import speexWasmPath from '@sapphi-red/web-noise-suppressor/speex.wasm?url' // you can use `vite-plugin-static-copy` instead of this

const ctx = new AudioContext()

const speexWasmBinary = await loadSpeex({ url: speexWasmPath })
await ctx.audioWorklet.addModule(speexWorkletPath)

const stream = await navigator.mediaDevices.getUserMedia({
  audio: true
})

const source = ctx.createMediaStreamSource(stream)
const speex = new SpeexWorkletNode(ctx, {
  wasmBinary: speexWasmBinary,
  maxChannels: 2
})

source.connect(speex)
speex.connect(ctx.destination)
```

For more details, see [demo source code](https://github.com/sapphi-red/web-noise-suppressor/blob/main/demo/src/index.ts).