open-index/open-npm huggingface dataset:
npm package: @runnablejs/app
Description: React Router (Remix) UI for Runnable. Used internally by `@runnablejs/express` and `@runnablejs/hono`.
Latest version: 0.6.0

# @runnablejs/app

React Router (Remix) UI for Runnable. Used internally by `@runnablejs/express` and `@runnablejs/hono`.

## Usage

This package is not meant to be used directly. Use `@runnablejs/express` or `@runnablejs/hono` instead.

## Development

```bash
pnpm dev
```

## Build

```bash
pnpm build
```
npm package: @runnablejs/express
Description: Express middleware for Runnable.
Latest version: 0.6.0

# @runnablejs/express

Express middleware for Runnable.

## Install

```bash
npm install @runnablejs/express
```

## Usage

```typescript
import express from 'express';
import { installRunnable } from '@runnablejs/express';
import type { RunnableWorkflows } from '@runnablejs/express';

const app = express();

const workflows: RunnableWorkflows = {
  create_user: {
    title: 'Create User',
    description: 'Create a new user',
    icon: 'fa6-solid:user-plus',
    category: 'Users',
    execute: async (io) => {
      const { name, email } = await io.form({
        name: io.input.text({ label: 'Name', type: 'text' }),
        email: io.input.text({ label: 'Email', type: 'email' }),
      });

      // your logic here
      console.log('Creating user:', { name, email });

      await io.message.success({
        title: 'Success',
        message: `User ${name} created`,
      });
    },
  },
};

installRunnable(app, workflows, {
  auth: {
    form: {
      verifyLogin: async ({ email, password }) => {
        // verify credentials
        return { id: '123', email };
      },
    },
  },
});

app.listen(3000);
```

Access at `http://localhost:3000/admin`.

## Configuration

### Base URL

Set `RUNNABLE_BASE_URL` to change from `/admin`:

```bash
RUNNABLE_BASE_URL=runnable node app.js
```

### Auth

```typescript
installRunnable(app, workflows, {
  auth: {
    form: {
      verifyLogin: async ({ email, password }) => {
        const user = await verifyCredentials(email, password);
        if (!user) throw new Error('Invalid credentials');
        return { id: user.id, email: user.email };
      },
    },
  },
  logger: console, // optional
});
```

## API

### `installRunnable(app, workflows, context)`

- `app` - Express instance
- `workflows` - Workflow definitions
- `context` - Config object:
  - `auth.form.verifyLogin` - Credential verification function
  - `logger` (optional) - Custom logger

## License

MIT
npm package: @runnablejs/hono
Description: Hono middleware for Runnable.
Latest version: 0.6.0

# @runnablejs/hono

Hono middleware for Runnable.

## Install

```bash
npm install @runnablejs/hono
```

## Usage

```typescript
import { Hono } from 'hono';
import { serve } from '@hono/node-server';
import { installRunnable } from '@runnablejs/hono';
import type { RunnableWorkflows } from '@runnablejs/hono';

const app = new Hono();

const workflows: RunnableWorkflows = {
  create_user: {
    title: 'Create User',
    description: 'Create a new user',
    icon: 'fa6-solid:user-plus',
    category: 'Users',
    execute: async (io) => {
      const { name, email } = await io.form({
        name: io.input.text({ label: 'Name', type: 'text' }),
        email: io.input.text({ label: 'Email', type: 'email' }),
      });

      // your logic here
      console.log('Creating user:', { name, email });

      await io.message.success({
        title: 'Success',
        message: `User ${name} created`,
      });
    },
  },
};

installRunnable(app, workflows, {
  auth: {
    form: {
      verifyLogin: async ({ email, password }) => {
        // verify credentials
        return { id: '123', email };
      },
    },
  },
});

app.get('/', (c) => c.text('Hello Hono!'));

serve({ fetch: app.fetch, port: 3000 });
```

Access at `http://localhost:3000/admin`.

## Configuration

### Base URL

Set `RUNNABLE_BASE_URL` to change from `/admin`:

```bash
RUNNABLE_BASE_URL=runnable node app.js
```

### Auth

```typescript
installRunnable(app, workflows, {
  auth: {
    form: {
      verifyLogin: async ({ email, password }) => {
        const user = await verifyCredentials(email, password);
        if (!user) throw new Error('Invalid credentials');
        return { id: user.id, email: user.email };
      },
    },
  },
  logger: console, // optional
});
```

## API

### `installRunnable(app, workflows, context)`

- `app` - Hono instance
- `workflows` - Workflow definitions
- `context` - Config object:
  - `auth.form.verifyLogin` - Credential verification function
  - `logger` (optional) - Custom logger

## License

MIT
npm package: @runnablejs/sdk
Description: Core SDK for creating and running Runnable workflows.
Latest version: 0.6.0

# @runnablejs/sdk

Core SDK for creating and running Runnable workflows.

## Install

```bash
npm install @runnablejs/sdk
```

## Usage

For most use cases, use `@runnablejs/express` or `@runnablejs/hono` instead, which bundle this SDK with a UI.

### Define Workflows

```typescript
import type { RunnableWorkflows } from '@runnablejs/sdk';

const workflows: RunnableWorkflows = {
  my_workflow: {
    title: 'My Workflow',
    description: 'What this workflow does',
    icon: 'fa6-solid:star',
    category: 'Category',
    execute: async (io, context) => {
      const input = await io.input.text({
        label: 'Name',
        type: 'text',
      });

      // your logic
      console.log('Input:', input);

      await io.message.success({
        title: 'Done',
        message: 'Workflow completed',
      });
    },
  },
};
```

### Run Workflows

```typescript
import { Runnable } from '@runnablejs/sdk';

const client = new Runnable(workflows, { logger: console });

// Programmatic execution
await client.run('my_workflow', context);
```

## Classes

### `Runnable`

Core workflow runner.

```typescript
const client = new Runnable(workflows, options);
```

### `NamespacedRunnable`

Workflow runner with namespace support for multi-tenant setups.

```typescript
const client = new NamespacedRunnable(runnable, namespaceId);
```

### `RunnableWs`

WebSocket client for connecting to Runnable servers.

## Types

### `RunnableWorkflow`

```typescript
interface RunnableWorkflow {
  title: string;
  description: string;
  icon: string; // Iconify icon name
  category: string;
  execute: (io: InputOutput, context: RunnableContext) => Promise<void>;
}
```

### `InputOutput`

The `io` object provides methods for user interaction:

- `io.input.*` - Input components (text, number, select, etc.)
- `io.form()` - Multi-input forms
- `io.select.*` - Selection components (table, dropdown, etc.)
- `io.message.*` - Display messages (success, error, info)

## License

MIT