open-index/open-npm huggingface dataset:
npm package: @openauthjs/example-client-astro
Description: The files to note are - `src/auth.ts` - creates the client that is used to interact with the auth server - `src/middleware.ts` - middleware that runs to verify access tokens, refresh them if out of date, and redirect the user to the auth server if they ar
Latest version: 0.0.0

# OpenAuth Astro Client

The files to note are
- `src/auth.ts` - creates the client that is used to interact with the auth server
- `src/middleware.ts` - middleware that runs to verify access tokens, refresh them if out of date, and redirect the user to the auth server if they are not logged in
- `src/pages/callback.ts` - the callback endpoint that receives the auth code and exchanges it for an access/refresh token
npm package: @openauthjs/examples
Description: To install dependencies:
Latest version: 0.0.0

# @openauthjs/scrap

To install dependencies:

```bash
bun install
```

To run:

```bash
bun run index.ts
```

This project was created using `bun init` in bun v1.1.31. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
npm package: @openauthjs/examples-client-astro
Description: ```sh npm create astro@latest -- --template basics ```
Latest version: 0.0.1

# Astro Starter Kit: Basics

```sh
npm create astro@latest -- --template basics
```

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics)
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/basics)
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/basics/devcontainer.json)

> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!

![just-the-basics](https://github.com/withastro/astro/assets/2244813/a0a5533c-a856-4198-8470-2d67b1d7c554)

## 🚀 Project Structure

Inside of your Astro project, you'll see the following folders and files:

```text
/
├── public/
│   └── favicon.svg
├── src/
│   ├── layouts/
│   │   └── Layout.astro
│   └── pages/
│       └── index.astro
└── package.json
```

To learn more about the folder structure of an Astro project, refer to [our guide on project structure](https://docs.astro.build/en/basics/project-structure/).

## 🧞 Commands

All commands are run from the root of the project, from a terminal:

| Command                   | Action                                           |
| :------------------------ | :----------------------------------------------- |
| `npm install`             | Installs dependencies                            |
| `npm run dev`             | Starts local dev server at `localhost:4321`      |
| `npm run build`           | Build your production site to `./dist/`          |
| `npm run preview`         | Preview your build locally, before deploying     |
| `npm run astro ...`       | Run CLI commands like `astro add`, `astro check` |
| `npm run astro -- --help` | Get help using the Astro CLI                     |

## 👀 Want to learn more?

Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
npm package: @openavg/create-openavg
Description: A CLI tool to create OpenAVG projects
Author: Panzer_Jack
Latest version: 0.1.3

# @openavg/create-openavg

快速创建 OpenAVG 项目的脚手架工具。

## 使用

```bash
npx @openavg/create-openavg my-game
cd my-game
pnpm install
pnpm dev
```

## 功能特性

- 🎮 基于 Vue3 + Vite + Pixi.js 的游戏项目模板
- 🎨 开箱即用的游戏菜单系统
- ⚡️ 快速项目初始化

## 生成的项目结构

```
my-game/
├── src/
│   ├── components/     # Vue 组件
│   ├── composables/    # 组合式函数
│   ├── api/           # API 接口
│   ├── App.vue
│   └── main.ts
├── public/
├── index.html
├── package.json
├── vite.config.ts
└── uno.config.ts
```

## 文档

[OpenAVG 文档](https://github.com/Panzer-Jack/OpenAVG)
npm package: @openbastion-ai/cli
Description: CLI binary for Bastion
Latest version: 0.2.7

# @openbastion-ai/cli

Command-line interface for [Bastion](https://github.com/seanfraserio/bastion) — the open-source AI gateway that secures, governs, and optimizes every LLM API call.

## Install

```bash
npm install -g @openbastion-ai/cli
```

## Quick Start

```bash
# Create a config file
bastion init

# Validate configuration
bastion validate

# Start the proxy
bastion start

# Test with a sample request
bastion test

# Check proxy status
bastion status
```

## Usage

Point your LLM client at the Bastion proxy — zero code changes:

```bash
export ANTHROPIC_BASE_URL=http://localhost:4000
node your-app.js
```

## What Bastion Does

Every request flows through a six-stage middleware pipeline:

```
Rate Limit → Injection Detection → Policy Check → Cache → Provider → Audit
```

- **Rate limiting** — Token bucket per IP/agent with LRU eviction
- **Injection detection** — 12 weighted regex patterns with NFKC normalization
- **Policy enforcement** — Declarative rules from `bastion.yaml`
- **Caching** — SHA-256 keyed, scoped by agent/team/environment
- **Provider fallback** — Automatic failover across Anthropic, OpenAI, Google, Bedrock
- **Audit logging** — Full request/response capture with pluggable exporters

## Configuration

All settings in `bastion.yaml` with Zod schema validation and `${ENV_VAR}` interpolation:

```yaml
providers:
  primary: anthropic
  fallback: [openai, bedrock]
  anthropic:
    api_key: ${ANTHROPIC_API_KEY}

policies:
  - name: block-injection
    on: request
    if: { injection_score: { gt: 0.8 } }
    then: block

cache:
  enabled: true
  ttl: 3600
```

## Related Packages

| Package | Description |
|---------|-------------|
| [@openbastion-ai/proxy](https://www.npmjs.com/package/@openbastion-ai/proxy) | Core proxy server and middleware pipeline |
| [@openbastion-ai/config](https://www.npmjs.com/package/@openbastion-ai/config) | Zod schema and YAML config loader |
| [@openbastion-ai/sdk](https://www.npmjs.com/package/@openbastion-ai/sdk) | Typed admin API client |

## Part of the Trilogy

**Forge** (define agents) + **Bastion** (protect traffic) + **Lantern** (observe traces)

## License

MIT
npm package: @openbastion-ai/config
Description: Configuration schema and loader for Bastion
Latest version: 0.2.7

# @openbastion-ai/config

Configuration schema and YAML loader for [Bastion](https://github.com/seanfraserio/bastion).

## Install

```bash
npm install @openbastion-ai/config
```

## Usage

```typescript
import { loadConfig } from "@openbastion-ai/config";

const config = await loadConfig("./bastion.yaml");
// config is fully validated with Zod
```

## Features

- **Zod schema validation** — every field validated at load time
- **Environment variable interpolation** — `${ENV_VAR}` syntax for secrets
- **Provider references** — validates that referenced providers exist
- **Hot reload** — watch for config changes with `watchConfig()`

## Schema

```yaml
version: "1"

proxy:
  port: 4000
  host: 127.0.0.1

auth:
  enabled: true
  tokens:
    - name: production
      token: ${BASTION_TOKEN}

providers:
  primary: anthropic
  fallback: [openai]
  anthropic:
    api_key: ${ANTHROPIC_API_KEY}

rate_limit:
  requests_per_minute: 60

policies:
  - name: block-injection
    on: request
    if: { injection_score: { gt: 0.8 } }
    then: block

cache:
  enabled: true
  ttl: 3600

audit:
  exporters: [stdout, file]
```

## License

MIT
npm package: @openbastion-ai/proxy
Description: Core proxy server for Bastion
Latest version: 0.2.7

# @openbastion-ai/proxy

Core proxy server for [Bastion](https://github.com/seanfraserio/bastion) — the open-source AI gateway. This package contains the middleware pipeline, provider implementations, and server runtime.

## Install

```bash
npm install @openbastion-ai/proxy
```

## Programmatic Usage

```typescript
import { createServer } from "@openbastion-ai/proxy";

const { app, config } = await createServer("./bastion.yaml");
// Server is now running on the configured port
```

## Architecture

Every request flows through an ordered middleware pipeline:

```
Rate Limit → Injection → Policy(request) → Cache(request)
  → [Provider] →
Cache(response) → Policy(response) → Audit
```

### Middleware

| Middleware | Purpose |
|-----------|---------|
| Rate Limiter | Token bucket per IP/agent, LRU eviction at 10K buckets |
| Injection Detector | 12 weighted patterns, NFKC normalization, leet-speak decoding |
| Policy Engine | Declarative rules with 5 condition types, pre-compiled regexes |
| Cache | SHA-256 keys scoped by agent/team/env, structuredClone isolation |
| Audit | Pluggable exporters (stdout, file, HTTP) with graceful shutdown |

### Providers

| Provider | Endpoint |
|----------|----------|
| Anthropic | Messages API with prompt caching |
| OpenAI | Chat completions with function calling |
| Google | Gemini GenerateContent |
| AWS Bedrock | InvokeModel with cross-region inference |
| Ollama | Local open-source models |

### Security

- Timing-safe auth token comparison (`crypto.timingSafeEqual`)
- Security headers on all responses (nosniff, no-store, DENY)
- Request ID and header validation
- ReDoS protection on policy regexes
- Graceful shutdown with audit log flushing

## License

MIT
npm package: @openbastion-ai/sdk
Description: Typed admin API client for Bastion
Latest version: 0.2.7

# @openbastion-ai/sdk

Typed admin API client for [Bastion](https://github.com/seanfraserio/bastion).

## Install

```bash
npm install @openbastion-ai/sdk
```

## Usage

```typescript
import { BastionClient } from "@openbastion-ai/sdk";

const client = new BastionClient("http://localhost:4000");

// Health check
const health = await client.health();
console.log(health.status); // "ok"

// Get proxy stats
const stats = await client.stats();
console.log(stats.totalRequests);
console.log(stats.cacheHitRate);
```

## API

### `new BastionClient(baseUrl: string)`

Creates a client pointing at a running Bastion proxy.

### `client.health(): Promise<HealthResponse>`

Returns `{ status: "ok", version: string }`.

### `client.stats(): Promise<StatsResponse>`

Returns request counts, error counts, cache hit rates, and provider statistics.

## License

MIT