open-index/open-npm huggingface dataset:
npm package: @runhare/next
Description: Node wrapper for NextJS (https://nextjs.org/) based consumers of RunHare events.
Author: Ernesto F.
Latest version: 0.2.1

# @runhare/next

Node wrapper for NextJS (https://nextjs.org/) based consumers of RunHare events.

## Create a Consumer

Inside your API folder create a new file.

```typescript
// 'src/pages/api/send-email.ts'
import consumer from '@runhare/next'

interface SendEmail {
  to: string
  subject: string
  content: string
}

interface DemoEvents {
  'send-email': SendEmail
}

export default consumer<RunHareEvents>(
  ['send-email'],
  process.env.CLIENT_SECRET,
  async (event, payload, headers) => {
    console.log(
      `Received Event: ${event} with payload: ${JSON.stringify(payload)}`
    )

    // TODO: Process event

    return { result: 'sucess' }
  }
)
```

### API Reference

Exported types

```typescript
import { ConsumerOptions, ConsumerResponse } from '@runhare/node'
import { NextApiRequest, NextApiResponse } from 'next'
declare const consumer: <T, K extends keyof T = keyof T>(
  events: (keyof T)[],
  sendKey: string,
  consumerHandler: (
    event: K,
    payload: T[K],
    headers: any
  ) => Promise<ConsumerResponse>,
  options?: ConsumerOptions | undefined
) => (req: NextApiRequest, res: NextApiResponse) => Promise<void>
export default consumer
```

`consumer<T>([events], sendKey, handler) -> nextApiHandler`

- **\[events\]** : Events this consumer will be processing.
- **sendKey** : Shared secret used to authenticate request
- **consumerHandler** : Async function that does the actual message processing.
- **options.rejectUnregisteredMessages** : If set, messages received not in the subscription list will be marked as failed (potentially retrying them)

### Using next-connect

next-connect (https://www.npmjs.com/package/next-connect) is a cool project to allow method routing on API routes on NextJS.

Make sure you use the helper functions `.use(...)` since the RunHare SDK for Nextjs handles both GET and POST requests (POST to consumer events, GET to get health and stack info)

```typescript
// 'src/pages/api/send-email.ts'
import { NextApiRequest, NextApiResponse } from 'next'
import nc from 'next-connect'
import consumer from '@runhare/next'

interface SendEmail {
  to: string
  subject: string
  content: string
}

interface DemoEvents {
  'send-email': SendEmail
}

export default nc<NextApiRequest, NextApiResponse>({
  onError: onErrorHandler
}).use(
  consumer<DemoEvents>(
    ['send-email'],
    process.env.CLIENT_SECRET,
    async (event, payload, headers) => {
      console.log(
        `Received Event: ${event} with payload: ${JSON.stringify(payload)}`
      )

      // TODO: Process event

      return { result: 'sucess' }
    }
  )
)
```
npm package: @runic-rpc/cli
Description: CLI tools for RunicRPC
Author: RunicRPC
Latest version: 0.1.4

# @runic-rpc/cli

CLI tools for RunicRPC.

## Installation

```bash
pnpm add -g @runic-rpc/cli
```

## Commands

### `runic-rpc init`

Generate a `runic.config.json` template:

```bash
runic-rpc init
```

### `runic-rpc test`

Test RPC providers:

```bash
# Test all configured providers
runic-rpc test

# Test specific providers
runic-rpc test --providers helius,alchemy

# Use custom .env file
runic-rpc test --env .env.production
```

## Configuration

Create a `.env` file with your API keys:

```env
HELIUS_API_KEY=your-key-here
ALCHEMY_API_KEY=your-key-here
```

## License

MIT
npm package: @runicjs/runic-react
Description: Tools for working with Runic in React
Latest version: 0.1.9

# Runic

Runic React provides tools for working with Runic in React.

> **Warning**
> Runic React is in its infancy. It's not safe to use in production at this time.

## Roadmap

- [x] Implement `useStore`
- [x] Publish a proper build to NPM (https://www.npmjs.com/package/@runicjs/runic-react)
- [x] Write tests
- [x] Implement `useStores`
- [ ] Test selector that relies on a value from another selector that just changed
- [ ] Test default selector (entire state)
- [ ] Test creating stores dynamically (e.g. in a Context) and destroying them
- [ ] Implement TodoMVC using runic-react
- [ ] Verify that there are no unnecessary rerenders
- [ ] Implement a larger app with more complex state using runic. RealWorld perhaps?

## Usage

### `useStore`

```tsx
import { createStore } from '@runicjs/runic';
import { useStore } from '@runicjs/runic-react';

type Counter = {
  count: number;
};

export const counterStore = createStore<Counter>({
  count: 0,
});

export const increment = () => {
  updateState(counterStore, (counter) => {
    counter.count++;
  });
};

export const decrement = () => {
  updateState(counterStore, (counter) => {
    counter.count--;
  });
};

function Counter() {
  // Only re-renders when count changes
  const count = useStore(counterStore, (counter) => counter.count);

  // "Computed" value
  const doubled = useStore(counterStore, (counter) => counter.count * 2);

  return (
    <div>
      <div>
        {count} * 2 = {doubled}
      </div>
      <button onClick={decrement}>-</button>
      <button onClick={increment}>+</button>
    </div>
  );
}
```

### `useStores`

```ts
import { createStore } from '@runicjs/runic';
import { useStores } from '@runicjs/runic-react';
import deepEqual from 'fast-deep-equal';

type User = {
  id: number;
};

const userStore = createStore<User>({
  id: 1,
});

type Todo = { userId: number; id: number; text: string; done: boolean };
type TodoList = {
  todos: Array<Todo>;
};

const todoListStore = createStore<TodoList>({
  todos: [
    { userId: 1, id: 1, text: 'First task', done: false },
    { userId: 2, id: 2, text: 'Second task', done: true },
    { userId: 1, id: 3, text: 'Third task', done: false },
  ],
});

const UserTodos = () => {
  const userTodos = useStores<IncompleteTodos>(
    // Listen for changes to any store that is passed in.
    [userStore, todoListStore],
    ([user, todoList]) => {
      return todoList.todos.filter((todo) => todo.userId === user.id);
    },
    // Gives you control over whether to rerender after the selector runs.
    deepEqual,
  );
};
```
npm package: @runics/cli
Description: Command-line interface for the Runics semantic skill search API
Author: OpenMason
Latest version: 0.2.0

# runics

[![npm version](https://img.shields.io/npm/v/runics)](https://www.npmjs.com/package/runics)
[![npm downloads](https://img.shields.io/npm/dm/runics)](https://www.npmjs.com/package/runics)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Command-line interface for the Runics semantic skill search API.

## Installation

```bash
npm install -g runics
```

## Quick Start

```bash
# Search for skills
runics search "check license compliance"

# Get detailed skill info
runics inspect cargo-deny

# Show configuration
runics config
```

## Commands

### `runics search <query>`

Search for skills by natural language query.

**Options:**
- `--limit, -l <number>` — Max results (default: 5)
- `--min-trust, -t <number>` — Minimum trust score 0.0-1.0 (default: 0.0)
- `--max-tier <1|2|3>` — Cap search tier to skip LLM invocation
- `--trace` — Show full search trace and debug info
- `--json` — Output raw JSON for piping
- `--execution-layer <layer>` — Filter by execution layer
- `--url <url>` — Override API URL

**Example:**

```bash
runics search "lint rust code" --limit 3 --trace
```

### `runics inspect <slug>`

Display full skill details by slug.

**Options:**
- `--json` — Output raw JSON
- `--url <url>` — Override API URL

**Example:**

```bash
runics inspect cargo-deny
```

### `runics feedback <event-id> <skill-id> <type>`

Submit quality feedback for a search result.

**Type values:** `click`, `use`, `dismiss`, `explicit_good`, `explicit_bad`

**Options:**
- `--position, -p <number>` — Result position (default: 0)
- `--url <url>` — Override API URL

**Example:**

```bash
runics feedback evt_123 skill_456 click --position 0
```

### `runics mcp-serve`

Start a local MCP server exposing Runics tools.

**Options:**
- `--transport <stdio|sse>` — Transport type (default: stdio)
- `--port <number>` — Port for SSE transport (default: 3100)
- `--url <url>` — Override API URL

**Example:**

```bash
# Use with Claude Code or any MCP-compatible agent
runics mcp-serve

# SSE mode for networked agents
runics mcp-serve --transport sse --port 3100
```

### `runics config`

Show resolved configuration (helpful for debugging).

## Configuration

Priority order (highest wins):
1. CLI flags
2. Environment variables
3. Config file

### Config File

Create `.runicsrc.json` in your current directory or home directory:

```json
{
  "url": "https://runics.example.com",
  "apiKey": "rk_...",
  "defaultLimit": 5,
  "defaultMinTrust": 0.0
}
```

### Environment Variables

- `RUNICS_URL` — API endpoint URL
- `RUNICS_API_KEY` — API key for authentication (future)

## Examples

### Basic search with custom limits

```bash
runics search "deploy to cloudflare workers" --limit 10 --min-trust 0.8
```

### Debug search trace

```bash
runics search "fix security issues" --trace
```

### JSON output for scripting

```bash
runics search "run tests" --json | jq '.results[0].name'
```

### Inspect skill details

```bash
runics inspect fossa-scan
```

## License

MIT
npm package: @runics/client
Description: TypeScript SDK for the Runics semantic skill search API
Author: OpenMason
Latest version: 0.2.0

# runics-client

[![npm version](https://img.shields.io/npm/v/runics-client)](https://www.npmjs.com/package/runics-client)
[![npm downloads](https://img.shields.io/npm/dm/runics-client)](https://www.npmjs.com/package/runics-client)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

TypeScript SDK for the Runics semantic skill search API.

## Installation

```bash
npm install runics-client
```

## Usage

### Basic Search

```typescript
import { RunicsClient } from 'runics-client';

const client = new RunicsClient({
  baseUrl: 'https://runics.example.com'
});

const response = await client.findSkill('check license compliance', {
  limit: 5,
  minTrustScore: 0.7
});

console.log(response.results);
```

### Get Skill Details

```typescript
const skill = await client.getSkill('cargo-deny');
console.log(skill.description);
console.log(skill.agentSummary);
```

### Submit Feedback

```typescript
await client.submitFeedback({
  searchEventId: 'evt_123',
  skillId: 'skill_456',
  feedbackType: 'click',
  position: 0
});
```

### MCP Server

Create an MCP server that exposes Runics as tools for any MCP-compatible agent runtime:

```typescript
import { RunicsClient, createRunicsMcpServer } from 'runics-client';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio';

const client = new RunicsClient();
const server = createRunicsMcpServer(client);

const transport = new StdioServerTransport();
await server.connect(transport);
```

## API Reference

### `RunicsClient`

#### Constructor Options

```typescript
interface RunicsClientOptions {
  baseUrl?: string;           // defaults to http://localhost:8787
  retry?: number;             // max retries, default 3
  retryDelay?: number;        // base delay ms, default 500
  timeout?: number;           // request timeout ms, default 10000
  onRequest?: (ctx) => void;  // request interceptor
  onResponse?: (ctx) => void; // response interceptor
}
```

#### Methods

- `findSkill(query, options?)` — Search for skills by natural language query
- `getSkill(slug)` — Get full skill details by slug
- `submitFeedback(params)` — Submit quality feedback (fire-and-forget)
- `listSkills(options?)` — Paginated skill browsing
- `health()` — Check API health status

### MCP Tools

The MCP server exposes two tools:

- `findSkill` — Search for skills by natural language query
- `getSkillDetails` — Get full details of a skill by its slug

## Error Handling

The SDK throws typed errors:

- `RunicsNetworkError` — Network/timeout errors
- `RunicsRateLimitError` — 429 rate limit (includes retryAfter)
- `RunicsNotFoundError` — 404 not found
- `RunicsServerError` — 5xx server errors
- `RunicsValidationError` — Response validation failed (includes zodErrors)

All errors extend `RunicsError` with `code`, `statusCode`, and `responseBody` properties.

## License

MIT
npm package: @runinbrowser/theme
Description: Default theme preset for websites under RunInBrowser
Author: Cole
Latest version: 0.0.4

# theme

[![npm](https://img.shields.io/npm/v/@runinbrowser/theme?color=red&label=npm)](https://www.npmjs.com/package/@runinbrowser/theme)
[![CI](https://github.com/runinbrowser/theme/workflows/CI/badge.svg)](https://github.com/runinbrowser/theme/actions)
[![LICENSE](https://shields.io/github/license/runinbrowser/theme)](https://github.com/runinbrowser/theme/blob/master/LICENSE)

The default theme for websites under RunInBrowser.

Click [HERE](https://theme-generator.keke.cc/?template=N4IgbgpgTgzglgewHYgFwAYA0IkEMC2EaIASgK5ICSSAQlAgO4zQjYAuAFhIWqAMYIANgli8QAI1x8A1gHN6FACZjBcWRzbEAxAFEArDoCcAMXSsQi3FGnaATAEEAzOkcBhEAF9sAMxER5CEoqahp2Oo4ALBFm2JbW2uJ8io6KfJ7YAA5QcPhWAJ7B6pqoIFoGABwAjPbusVY2JWU6VTXpIFk5%2BcZ%2BAUGooKpF2t64IyPmcQ2licmpbcwCSHEF-SCDoY0tla6VE-XaWzvzEIvL3VD%2BCkuFG6Vjo7h78Y0Ozm5tUnwQSMUDIcWlPh6RQRCC2J5TLSOcp6PQAdjMXhAn2%2BbHOl0C11W6wBWls4SiMQs%2B0a93GSPwZDYEGU2P%2Bwz03kZeghdgAbLYOWy2pTqYp0b0sX8ho04Y4xWLWaSHuTsOIRIoWHSRYDynwkiy6s9SnpxGzxdykXAkL4brjKhA2V9dlrIRarRBdkaTQgBVdacLblpvD7fVK7r6ffMyOqIDAYGbtOh0LhDGzvP6tNHY-Hg6Hw27MR61vTSYGE7bhvm2gwrEhjbJI3nDIZHI5Ez6a3WS2WK5m%2Bp7cfmC8Ttd7i0joPQoFW7ug9I49OUG%2BPJ9PB1Bh%2B2hTmVf3Aw2B0ioLhFHAyBGSugAHTivQXfCeDxAA) to get a live preview.

Color variables can be found in [HERE](https://github.com/runinbrowser/theme/blob/master/src/theme.json).

## Install

```sh
pnpm i @runinbrowser/theme
```

## Usage

### Default usage

```ts
// main.ts
import "@runinbrowser/theme/css/none/index.css";
```

With UnoCSS

```ts
// uno.config.ts
import { presetNone } from "@runinbrowser/theme";
import { defineConfig, presetUno } from "unocss";

export default defineConfig({
  presets: [presetUno()],
  theme: {
    ...presetNone.unocss,
  },
});
```

Or with TailwindCSS

```js
// tailwind.config.js
import { presetNone } from "@runinbrowser/theme";

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: ["./src/**/*.{html,js}"],
  theme: {
    ...presetNone.tailwind,
  },
  plugins: [],
};
```

```html
<div class="text-primary-foreground bg-primary">
  Hello world!
</div>
```

```css
.usage-in-css {
  color: rgb(var(--primary-foreground));
  background-color: rgb(var(--primary));
}
```

### Using with Shadcn

```ts
// main.ts
import "@runinbrowser/theme/css/shadcn/index.css";
```

```js
// tailwind.config.js
import { presetShadcn } from "@runinbrowser/theme";

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: ["./src/**/*.{html,js}"],
  theme: {
    ...presetShadcn.tailwind,
  },
  plugins: [],
};
```

```html
<div class="text-primary-foreground bg-primary">
  Hello world!
</div>
```

```css
.usage-in-css {
  color: hsl(var(--primary-foreground));
  background-color: hsl(var(--primary));
}
```
npm package: @runiq/export-bpmn
Description: BPMN XML exporter/importer (minimal subset) for Runiq diagrams
Author: Runiq Team
Latest version: 1.2.0

# @runiq/export-bpmn

Minimal BPMN 2.0 XML exporter/importer scaffolding for Runiq diagrams.

## Features

- Exports basic BPMN elements (pools, lanes, tasks, events, gateways)
- Emits sequence flows within pools and message flows across pools
- Provides a lightweight import stub (placeholder for future XML parsing)

## Installation

```bash
pnpm add @runiq/export-bpmn
```

## Usage

```ts
import { toBpmnXml, fromBpmnXml } from '@runiq/export-bpmn';
import type { DiagramAst } from '@runiq/core';

const diagram: DiagramAst = {
  astVersion: '1.0',
  nodes: [],
  edges: [],
};

const exportResult = toBpmnXml(diagram);
console.log(exportResult.xml);

const importResult = fromBpmnXml(exportResult.xml);
console.log(importResult.diagram);
```

## Notes

- The exporter focuses on BPMN 2.0 core elements and can be extended.
- The importer currently returns an empty diagram with warnings.
npm package: @runiq/export-latex
Description: LaTeX/TikZ exporter for Runiq Control system diagrams
Author: Runiq Team
Latest version: 1.2.0

# @runiq/export-latex

LaTeX/TikZ exporter for Runiq Control system block diagrams

## Features

- ✅ Exports block diagrams to LaTeX/TikZ format
- ✅ Generates standalone LaTeX documents ready to compile
- ✅ Converts transfer functions to LaTeX fractions (`\frac{num}{den}`)
- ✅ Supports all block diagram shapes (transfer functions, gains, integrators, etc.)
- ✅ Automatic positioning from layout information
- ✅ Color-coded blocks (integrator=blue, differentiator=orange, etc.)
- ✅ Professional control system diagrams for academic papers

## Installation

```bash
pnpm add @runiq/export-latex
```

## Usage

```typescript
import { toLatex } from '@runiq/export-latex';
import type { DiagramAst, LaidOutDiagram } from '@runiq/core';

// Your diagram and layout from parser + layout engine
const diagram: DiagramAst = {
  /* ... */
};
const layout: LaidOutDiagram = {
  /* ... */
};

// Export to LaTeX
const result = toLatex(diagram, layout);

// result.latex contains the complete LaTeX document
console.log(result.latex);

// Check for warnings
if (result.warnings.length > 0) {
  console.warn('Warnings:', result.warnings);
}
```

## Output Example

The exporter generates a standalone LaTeX document using the TikZ library:

```latex
\documentclass[tikz,border=2mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes.geometric,arrows.meta,calc}

\tikzset{
  block/.style={rectangle, draw, fill=white, text centered, minimum width=2cm, minimum height=1cm},
  gain/.style={regular polygon, regular polygon sides=3, draw, fill=white},
  sum/.style={circle, draw, fill=white, minimum size=0.8cm}
}

\begin{document}
\begin{tikzpicture}[auto, node distance=2cm, >=Stealth]
  \node[block] (tf1) at (2.54cm,1.27cm) {$\frac{K}{s+1}$};
  \node[gain] (g1) at (5.08cm,1.27cm) {$K=10$};
  \draw[->,>=Stealth] (tf1) -- (g1) node[above] {$signal$};
\end{tikzpicture}
\end{document}
```

## Compiling LaTeX Output

Save the output to a `.tex` file and compile with:

```bash
pdflatex diagram.tex
```

Or use online tools like Overleaf.

## Supported Shapes

- **transfer-fn**: Transfer function blocks with fraction notation
- **gain**: Amplifier/gain blocks (triangular)
- **integrator**: Integration blocks (blue-tinted, 1/s)
- **differentiator**: Differentiation blocks (orange-tinted, s)
- **time-delay**: Time delay blocks (pink-tinted, e^-sT)
- **saturation**: Saturation blocks (yellow-tinted)
- **compare-junction**: Summing junctions with +/- operators
- **multiply-junction**: Multiplication junctions (×)
- **divide-junction**: Division junctions (÷)
- **Plus all standard flowchart shapes**

## API

### `toLatex(diagram, layout): LatexResult`

**Parameters:**

- `diagram` (DiagramAst): The diagram AST from parser
- `layout` (LaidOutDiagram): The positioned nodes/edges from layout engine

**Returns:** `LatexResult`

- `latex` (string): Complete LaTeX document
- `warnings` (string[]): Array of warning messages

## Testing

```bash
pnpm test       # Run tests
pnpm build      # Build package
```

## License

MIT
npm package: @runiq/web
Description: Browser-friendly SDK to parse, layout, and render Runiq diagrams to SVG
Author: Runiq Team
Latest version: 1.2.0

# @runiq/web

Browser-friendly SDK to parse, layout, and render Runiq DSL to SVG.

- Tiny ESM bundle, tree-shakeable
- Works in modern bundlers (Vite, SvelteKit, Next.js, etc.)
- High-level helpers: parse → layout → render
- Powered by the same parser/layout/renderer used by the Runiq editor

## Install

```bash
# npm
npm i @runiq/web

# pnpm
pnpm add @runiq/web

# yarn
yarn add @runiq/web
```

## Quick start

```ts
import { renderRuniqToSvg } from '@runiq/web';

const text = `diagram "My Diagram" {
  direction TB
  style s1 fill: "#eef"
  shape A as @rectangle label:"Hello" style: s1
  shape B as @rectangle label:"World"
  A -link-> B
}`;

const { svg, warnings } = await renderRuniqToSvg(
  text,
  { direction: 'TB' },
  { title: 'Sample' }
);

// svg is an <svg> string you can insert into the DOM
// warnings contains non-fatal renderer notes (e.g., missing layout nodes)
```

## Lower-level control

```ts
import { parseRuniq, layoutRuniq, renderRuniq } from '@runiq/web';

const ast = parseRuniq(text);
const layout = await layoutRuniq(ast, { spacing: 100, direction: 'LR' });
const { svg } = renderRuniq(ast, layout, { title: 'Custom Title' });
```

## API

- `parseRuniq(text: string): DiagramAst`
- `layoutRuniq(ast: DiagramAst, opts?: { direction?: 'TB'|'LR'|'BT'|'RL'; spacing?: number }): Promise<LaidOutDiagram>`
- `renderRuniq(ast: DiagramAst, layout: LaidOutDiagram, opts?: { strict?: boolean; title?: string }): { svg: string; warnings: string[] }`
- `renderRuniqToSvg(text: string, layoutOpts?, renderOpts?): Promise<{ svg: string; warnings: string[] }>`

## Notes

- Common shapes are registered automatically; for custom/advanced shapes, import and register from `@runiq/core` before calling layout.
- The layout engine uses ELK for high-quality graph layouts.

## License

MIT © Runiq Team