open-index/open-npm huggingface dataset:
npm package: @openhub2/metaframework-analog
Description: OpenHub integration for Analog
Latest version: 0.0.1

# @openhub2/metaframework-analog

OpenHub integration for Analog. Enables Analog applications to use real cloud bindings in development.

## Installation

```bash
pnpm add @openhub2/metaframework-analog
```

Then add a provider:

```bash
pnpm add @openhub2/provider-cloudflare
```

Requires `@analogjs/platform` as a peer:

```bash
pnpm add @analogjs/platform
```

## Usage

Add the OpenHub plugin to your Vite configuration:

```typescript
// vite.config.ts
import { defineConfig } from 'vite'
import analog from '@analogjs/platform'
import { openhubPlugin } from '@openhub2/metaframework-analog'

export default defineConfig({
  plugins: [
    analog(),
    openhubPlugin({
      provider: '@openhub2/provider-cloudflare',
      remote: true, // or 'production' or 'preview'
    })
  ]
})
```

## Configuration

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `provider` | `string` | - | Provider package name |
| `remote` | `boolean \| 'production' \| 'preview'` | `false` | Enable remote mode |

## Environment Variables

| Variable | Required | Description |
|----------|----------|-------------|
| `OPENHUB_REMOTE_URL` | In remote mode | Deployed worker URL |
| `OPENHUB_REMOTE_SECRET` | In remote mode | Shared auth secret |

## How It Works

1. Plugin registers `@openhub2/runtime-nitro` with Analog's Nitro server
2. Runtime registers your chosen provider
3. In remote mode, bindings proxy to deployed worker
4. In production, bindings are extracted from platform context

## Using Bindings in Your Code

```typescript
// src/server/routes/api/users.ts
import { eventHandler } from 'h3'

export default eventHandler(async (event) => {
  const { database, kv, blob } = event.context.openhub.bindings
  
  // SQL
  const users = await database.prepare('SELECT * FROM users').all()
  
  // KV
  const session = await kv.get('session:123')
  
  // Blob
  const avatar = await blob.get('avatars/user-1.png')
  
  return users
})
```

## Devtools

OpenHub adds a devtools panel accessible at `/__openhub2/devtools` showing:

- Current mode (local / remote / production)
- Connected provider
- Available bindings
- Proxy endpoint status

## What's Included

This package includes `@openhub2/runtime-nitro` and `@openhub2/dharma` as dependencies. You only need to install a provider separately.

## License

Apache-2.0
npm package: @openhub2/metaframework-nuxt
Description: OpenHub integration for Nuxt
Latest version: 0.0.4

# @openhub2/metaframework-nuxt

OpenHub integration for Nuxt. Enables `nuxt dev --remote` against real cloud bindings.

## Installation

```bash
pnpm add @openhub2/metaframework-nuxt
```

Then add a provider:

```bash
pnpm add @openhub2/provider-cloudflare
```

Requires `nuxt` as a peer:

```bash
pnpm add nuxt
```

## Usage

```typescript
// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@openhub2/metaframework-nuxt'],
  openhub: {
    provider: '@openhub2/provider-cloudflare',
    remote: true, // or 'production' or 'preview'
  }
})
```

## CLI

```bash
# Run dev server with remote bindings
nuxt dev --remote

# Run dev server with specific environment
nuxt dev --remote=production
nuxt dev --remote=preview
```

## Configuration

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `provider` | `string` | - | Provider package name |
| `remote` | `boolean \| 'production' \| 'preview'` | `false` | Enable remote mode |

## Environment Variables

| Variable | Required | Description |
|----------|----------|-------------|
| `OPENHUB_REMOTE_URL` | In remote mode | Deployed worker URL |
| `OPENHUB_REMOTE_SECRET` | In remote mode | Shared auth secret |

## How It Works

1. Module registers `@openhub2/runtime-nitro` with Nuxt
2. Runtime registers your chosen provider
3. In remote mode, bindings proxy to deployed worker
4. In production, bindings are extracted from platform context

## Devtools

OpenHub adds a panel to Nuxt Devtools showing:

- Current mode (local / remote / production)
- Connected provider
- Available bindings
- Proxy endpoint status

## What's Included

This package includes `@openhub2/runtime-nitro` and `@openhub2/types` as dependencies. You only need to install a provider separately.

## License

Apache-2.0
npm package: @openhub2/metaframework-solidstart
Description: OpenHub integration for SolidStart
Latest version: 0.0.1

# @openhub2/metaframework-solidstart

OpenHub integration for SolidStart. Enables `solid-start dev --remote` against real cloud bindings.

## Installation

```bash
pnpm add @openhub2/metaframework-solidstart
```

Then add a provider:

```bash
pnpm add @openhub2/provider-cloudflare
```

Requires `@solidjs/start` as a peer:

```bash
pnpm add @solidjs/start
```

## Usage

```typescript
// app.config.ts
import { defineConfig } from "@solidjs/start/config";
import openhub from "@openhub2/metaframework-solidstart";

export default defineConfig({
  plugins: [
    openhub({
      provider: "@openhub2/provider-cloudflare",
      remote: true, // or 'production' or 'preview'
    }),
  ],
});
```

## CLI

```bash
# Run dev server with remote bindings
solid-start dev --remote

# Run dev server with specific environment
solid-start dev --remote=production
solid-start dev --remote=preview
```

## Configuration

| Option     | Type                                   | Default | Description           |
| ---------- | -------------------------------------- | ------- | --------------------- |
| `provider` | `string`                               | -       | Provider package name |
| `remote`   | `boolean \| 'production' \| 'preview'` | `false` | Enable remote mode    |

## Environment Variables

| Variable                | Required       | Description         |
| ----------------------- | -------------- | ------------------- |
| `OPENHUB_REMOTE_URL`    | In remote mode | Deployed worker URL |
| `OPENHUB_REMOTE_SECRET` | In remote mode | Shared auth secret  |

## How It Works

1. Plugin registers `@openhub2/runtime-nitro` with Vinxi/Nitro
2. Runtime registers your chosen provider
3. In remote mode, bindings proxy to deployed worker
4. In production, bindings are extracted from platform context

## Devtools

OpenHub adds a panel to SolidStart Devtools showing:

- Current mode (local / remote / production)
- Connected provider
- Available bindings
- Proxy endpoint status

## What's Included

This package includes `@openhub2/runtime-nitro` and `@openhub2/dharma` as dependencies. You only need to install a provider separately.

## License

Apache-2.0
npm package: @openhub2/provider-aws
Description: OpenHub provider for AWS: RDS, DynamoDB, S3
Latest version: 0.0.1

# @openhub2/provider-aws

OpenHub provider for AWS: RDS, DynamoDB, S3.

## Installation

```bash
pnpm add @openhub2/provider-aws
```

## Usage

With `@openhub2/runtime-nitro`:

```typescript
import { awsProvider } from '@openhub2/provider-aws'
import { createRuntime } from '@openhub2/runtime-nitro'

const runtime = createRuntime()
runtime.registerProvider(awsProvider)
```

With `@openhub2/metaframework-nuxt`:

```typescript
// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@openhub2/metaframework-nuxt'],
  openhub: {
    provider: '@openhub2/provider-aws',
    remote: true,
  }
})
```

## Supported Bindings

| Binding | AWS Service | Dharma Type |
|---------|-------------|-------------|
| database | RDS | `DatabaseBinding` |
| kv | DynamoDB | `KVBinding` |
| blob | S3 | `BlobBinding` |

## Remote Mode

In remote mode, this provider creates proxy clients that forward requests to your deployed application's `/__openhub2/proxy` endpoint.

Required environment variables:

```bash
OPENHUB_REMOTE_URL=https://your-api.execute-api.us-east-1.amazonaws.com
OPENHUB_REMOTE_SECRET=your-shared-secret
```

## Production Mode

In production, this provider extracts real bindings from AWS platform context:

```typescript
// Expects these bindings in environment
// RDS -> RDS database connection
// DYNAMODB -> DynamoDB table
// S3 -> S3 bucket
```

## License

Apache-2.0
npm package: @openhub2/provider-azure
Description: OpenHub provider for Azure: Cosmos DB, Redis Cache, Blob Storage
Latest version: 0.0.1

# @openhub2/provider-azure

OpenHub provider for Azure: Cosmos DB, Redis Cache, Blob Storage.

## Installation

```bash
pnpm add @openhub2/provider-azure
```

## Usage

```typescript
import { azureProvider } from '@openhub2/provider-azure'

// Use with your OpenHub runtime
```

## Supported Bindings

- **database**: Azure Cosmos DB
- **kv**: Azure Redis Cache
- **blob**: Azure Blob Storage

## License

Apache-2.0
npm package: @openhub2/provider-cloudflare
Description: OpenHub provider for Cloudflare Workers bindings: D1, KV, R2
Latest version: 0.0.3

# @openhub2/provider-cloudflare

OpenHub provider for Cloudflare Workers bindings: D1, KV, R2.

## Installation

```bash
pnpm add @openhub2/provider-cloudflare
```

## Usage

With `@openhub2/runtime-nitro`:

```typescript
import { cloudflareProvider } from '@openhub2/provider-cloudflare'
import { createRuntime } from '@openhub2/runtime-nitro'

const runtime = createRuntime()
runtime.registerProvider(cloudflareProvider)
```

With `@openhub2/metaframework-nuxt`:

```typescript
// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@openhub2/metaframework-nuxt'],
  openhub: {
    provider: '@openhub2/provider-cloudflare',
    remote: true,
  }
})
```

## Supported Bindings

| Binding | Cloudflare Service | the type system Type |
|---------|-------------------|-------------|
| database | D1 | `DatabaseBinding` |
| kv | Workers KV | `KVBinding` |
| blob | R2 | `BlobBinding` |

## Remote Mode

In remote mode, this provider creates proxy clients that forward requests to your deployed worker's `/__openhub2/proxy` endpoint.

Required environment variables:

```bash
OPENHUB_REMOTE_URL=https://your-worker.pages.dev
OPENHUB_REMOTE_SECRET=your-shared-secret
```

## Production Mode

In production, this provider extracts real bindings from Cloudflare's platform context:

```typescript
// Expects these bindings in wrangler.toml / wrangler.json
// DB -> D1 database
// KV -> KV namespace
// BLOB -> R2 bucket
```

## License

Apache-2.0
npm package: @openhub2/provider-google
Description: OpenHub provider for Google Cloud: Cloud SQL, Firestore, Cloud Storage
Latest version: 0.0.1

# @openhub2/provider-google

OpenHub provider for Google Cloud: Cloud SQL, Firestore, Cloud Storage.

## Installation

```bash
pnpm add @openhub2/provider-google
```

## Usage

With `@openhub2/runtime-nitro`:

```typescript
import { googleProvider } from '@openhub2/provider-google'
import { createRuntime } from '@openhub2/runtime-nitro'

const runtime = createRuntime()
runtime.registerProvider(googleProvider)
```

With `@openhub2/metaframework-nuxt`:

```typescript
// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@openhub2/metaframework-nuxt'],
  openhub: {
    provider: '@openhub2/provider-google',
    remote: true,
  }
})
```

## Supported Bindings

| Binding | Google Cloud Service | Dharma Type |
|---------|---------------------|-------------|
| database | Cloud SQL / Firestore | `DatabaseBinding` |
| kv | Firestore / Memorystore | `KVBinding` |
| blob | Cloud Storage | `BlobBinding` |

## Remote Mode

In remote mode, this provider creates proxy clients that forward requests to your deployed function's `/__openhub2/proxy` endpoint.

Required environment variables:

```bash
OPENHUB_REMOTE_URL=https://your-function.cloudfunctions.net
OPENHUB_REMOTE_SECRET=your-shared-secret
```

## Production Mode

In production, this provider extracts real bindings from Google Cloud's platform context:

```typescript
// Expects these bindings in your Google Cloud configuration
// DB -> Cloud SQL or Firestore database
// KV -> Firestore or Memorystore instance
// BLOB -> Cloud Storage bucket
```

## License

Apache-2.0
npm package: @openhub2/provider-supabase
Description: OpenHub provider for Supabase: Postgres, Redis, Storage
Latest version: 0.0.1

# @openhub2/provider-supabase

OpenHub provider for Supabase bindings.

## Supported Bindings

| Binding | Supabase Service |
|---------|------------------|
| `database` | Postgres |
| `kv` | Redis (via Upstash) |
| `blob` | Storage |

## Usage

```typescript
import { supabaseProvider } from '@openhub2/provider-supabase'

// Provider is automatically detected when using OpenHub
```

## Configuration

Set these environment variables:

```bash
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your-anon-or-service-role-key
SUPABASE_DB_URL=postgresql://postgres:[password]@db.your-project.supabase.co:5432/postgres
```

## License

Apache-2.0
npm package: @openhub2/runtime-hono
Description: OpenHub runtime integration for Hono
Latest version: 0.0.1

# @openhub2/runtime-hono

OpenHub runtime integration for Hono. Manages bindings and provides middleware for context injection.

## Installation

```bash
pnpm add @openhub2/runtime-hono
```

Requires `hono` as a peer:

```bash
pnpm add hono
```

## Usage

### With Hono Middleware

```typescript
import { Hono } from 'hono'
import { createRuntime, openhubMiddleware } from '@openhub2/runtime-hono'
import { cloudflareProvider } from '@openhub2/provider-cloudflare'

const app = new Hono()
const runtime = createRuntime()

// Register provider
runtime.registerProvider(cloudflareProvider)

// Create bindings (in production, extract from platform context)
const bindings = cloudflareProvider.extractBindings(env)

// Apply middleware
app.use('*', openhubMiddleware(bindings))

// Use bindings in handlers
app.get('/users', async (c) => {
  const { database } = c.get('openhub').bindings
  const stmt = database.prepare('SELECT * FROM users')
  const users = await stmt.all()
  return c.json(users)
})
```

### Programmatic

```typescript
import { createRuntime } from '@openhub2/runtime-hono'
import { cloudflareProvider } from '@openhub2/provider-cloudflare'

const runtime = createRuntime()
runtime.registerProvider(cloudflareProvider)
```

## What It Does

1. **Registers provider** — accepts any Dharma-conforming provider
2. **Provides middleware** — `openhubMiddleware` injects bindings into Hono context
3. **Context injection** — bindings available via `c.get('openhub').bindings`
4. **Detects remote mode** — via environment or config

## Middleware

The `openhubMiddleware` function creates a Hono middleware that:

- Injects bindings into the Hono context variable store
- Makes bindings available in all downstream handlers
- Supports multiple binding types (database, kv, blob)

```typescript
import { openhubMiddleware, getBindings } from '@openhub2/runtime-hono'

// Apply middleware
app.use('*', openhubMiddleware(bindings))

// Access bindings in handlers
app.get('/api/data', async (c) => {
  const { database, kv, blob } = getBindings(c)
  // Use bindings...
})
```

## Context Access

Bindings are available in handlers via Hono's context:

```typescript
app.get('/users', async (c) => {
  // Direct access
  const { database, kv, blob } = c.get('openhub').bindings
  
  // Or use helper
  const bindings = getBindings(c)
  
  const stmt = database.prepare('SELECT * FROM users')
  const users = await stmt.all()
  
  return c.json(users)
})
```

## Environment Variables

| Variable | Required | Description |
|----------|----------|-------------|
| `OPENHUB_REMOTE` | No | Enable remote mode (`true`/`false`) |
| `OPENHUB_REMOTE_URL` | In remote mode | Deployed worker URL |
| `OPENHUB_REMOTE_SECRET` | In remote mode | Shared auth secret |

## License

Apache-2.0
npm package: @openhub2/runtime-nitro
Description: OpenHub runtime integration for Nitro
Latest version: 0.0.2

# @openhub2/runtime-nitro

OpenHub runtime integration for Nitro. Manages bindings and exposes proxy endpoint.

## Installation

```bash
pnpm add @openhub2/runtime-nitro
```

Requires `nitropack` as a peer:

```bash
pnpm add nitropack
```

## Usage

### As Nitro Module

```typescript
// nitro.config.ts
import { openhubModule } from '@openhub2/runtime-nitro'

export default defineNitroConfig({
  modules: [openhubModule],
})
```

### Programmatic

```typescript
import { createRuntime } from '@openhub2/runtime-nitro'
import { cloudflareProvider } from '@openhub2/provider-cloudflare'

const runtime = createRuntime()
runtime.registerProvider(cloudflareProvider)
```

## What It Does

1. **Registers provider** — accepts any the type system-conforming provider
2. **Exposes proxy endpoint** — `/__openhub2/proxy` for remote requests
3. **Injects bindings** — into `event.context.openhub.bindings`
4. **Detects remote mode** — via environment or config

## Proxy Endpoint

In production, exposes `/__openhub2/proxy` that:

- Validates `x-openhub-secret` header
- Parses `ProxyRequest` from body
- Executes against real bindings
- Returns `ProxyResponse`

```typescript
// Request
POST /__openhub2/proxy
x-openhub-secret: your-secret
{
  "binding": "database",
  "method": "prepare",
  "args": ["SELECT * FROM users"]
}

// Response
{
  "success": true,
  "data": { ... }
}
```

## Context Injection

Bindings available in handlers:

```typescript
export default defineEventHandler((event) => {
  const { database, kv, blob } = event.context.openhub.bindings
  
  const stmt = database.prepare('SELECT * FROM users')
  const users = await stmt.all()
  
  return users
})
```

## Environment Variables

| Variable | Required | Description |
|----------|----------|-------------|
| `OPENHUB_REMOTE` | No | Enable remote mode (`true`/`false`) |
| `OPENHUB_REMOTE_URL` | In remote mode | Deployed worker URL |
| `OPENHUB_REMOTE_SECRET` | In remote mode | Shared auth secret |

## License

Apache-2.0
npm package: @openhub2/types
Description: Type constraints for the OpenHub ecosystem
Latest version: 0.0.8

# @openhub2/types

Type constraints for the OpenHub ecosystem.

## What is the type system?

The type system defines the law that all OpenHub layers must conform to:

- **Layers**: Provider, Runtime, Metaframework
- **Boundaries**: What crosses between layers
- **Bindings**: Database, KV, Blob

## Installation

If you're using an OpenHub metaframework or runtime, types is included as a transitive dependency. You only need to install it directly if you're building a Provider, Runtime, or Metaframework.

```bash
pnpm add -D @openhub2/types
```

## Usage

### Layer Types

```typescript
import type { Provider, Runtime, Metaframework } from '@openhub2/types'
```

### Binding Types

```typescript
import type { 
  DatabaseBinding, 
  KVBinding, 
  BlobBinding,
  Bindings 
} from '@openhub2/types/subtypes'
```

### Boundary Types

```typescript
import type { ProxyRequest, ProxyResponse } from '@openhub2/types/boundaries'
```

## Exports

| Export | Path | Contents |
|--------|------|----------|
| Main | `@openhub2/types` | `Provider`, `Runtime`, `Metaframework` |
| Layers | `@openhub2/types/layers` | Layer type definitions |
| Boundaries | `@openhub2/types/boundaries` | `ProxyRequest`, `ProxyResponse`, cross-layer contracts |
| Subtypes | `@openhub2/types/subtypes` | `Bindings`, `DatabaseBinding`, `KVBinding`, `BlobBinding` |

## For Implementers

If you are building a Provider, Runtime, or Metaframework, your implementation must satisfy the types defined here.

### Provider

```typescript
import type { Provider } from '@openhub2/types'

export const myProvider: Provider = {
  name: 'my-provider',
  supportedBindings: ['database', 'kv', 'blob'],
  createLocalBindings(transport) { /* ... */ },
  createProxyHandler() { /* ... */ },
  extractBindings(platformContext) { /* ... */ },
}
```

### Runtime

```typescript
import type { Runtime } from '@openhub2/types'

export const myRuntime: Runtime = {
  name: 'my-runtime',
  registerProvider(provider) { /* ... */ },
  registerProxyEndpoint(handler) { /* ... */ },
  injectBindings(context, bindings) { /* ... */ },
  isRemoteMode() { /* ... */ },
}
```

### Metaframework

```typescript
import type { Metaframework } from '@openhub2/types'

export const myMetaframework: Metaframework = {
  name: 'my-metaframework',
  configureRuntime(runtime, config) { /* ... */ },
  defineConfig(schema) { /* ... */ },
  registerCLI(cli) { /* ... */ },
  registerDevtools(devtools) { /* ... */ },
}
```

See [constitution.md](../../constitution.md) for the full constitution.

## License

Apache-2.0
npm package: @openhud/api
Description: OpenHUD API
Author: Danny Leshem
Latest version: 1.0.1

# OpenHUD API

## HUD modules
A HUD module is an HTTPS endpoint that returns JSON and supports the following operations:

### Metadata
An HTTP GET request to the module's endpoint should return the module's metadata:

```javascript
{
    "title": "Your module's title",             // identifies your module in HUD tips
    "description": "Your module's description", // shown when configuring your module
    "games": [{                                 // list of supported games ("*" for any)
        "type": "texas-holdem",
        "bet": "no-limit",
        "format": "*"
    }],
    "author": {                                 // identifies module creator, email & URL are optional
        "name": "Your name",
        "email": "youremail@example.org",
        "url": "https://www.example.org/"
    }
}
```

### Tips
An HTTP POST request to the module's endpoint should return tips for a given situation.

POST body describes the situation:
```javascript
{
    "game": {                          // game
        "type": "texas-holdem",
        "bet": "no-limit",
        "format": "cash"
    },
    "bb": 2,                           // bb amount
    "community": ["As", "Kd", "Jc"],   // community cards (empty if none yet)
    "seats": [{                        // players by seat id, use isButton for positions
        "playerName": "playerName1",
        "stack": 48,
        "pot": 2,
        "isMe": true,
        "cards": ["Ad", "6s"]
    }, {
        "playerName": "playerName2",
        "stack": 98,
        "pot": 2
    }, {
        "playerName": "playerName3",
        "stack": 100,
        "pot": 0,
        "isButton": true,
        "isFolded": true
    }]
}
```

Above example describes the situation on the flop after the button folded pre-flop, hero called in SB and BB checked.

Response describes the tips to show next to each player (no tip shown for omitted players):
```javascript
{
    "players": {
        "playerName1": "Some tip",
        "playerName2": "Some other tip"
    }
}
```

### Errors
On any error, the endpoint should respond with an HTTP status code indicating error, and an error body in accordance with [RFC 7807](https://tools.ietf.org/html/rfc7807).