open-index/open-npm huggingface dataset:
npm package: @khv/webz-cli
Description: A simple CLI for initializing [webz](https://github.com/mudcrab/webz)
Author: Jevgeni Sillar
Latest version: 1.0.2

# WEBZ CLI

A simple CLI for initializing [webz](https://github.com/mudcrab/webz)

## How?

- `yarn global add @khv/webz-cli`
- `mkdir yourproject ; cd yourproject ; webz -i`

## License

MIT
npm package: @ki1r0y/cache
Description: Simple, fast, least-recently-used cache (specifically, last set) with active time-to-live eviction, optimized for large-string keys and frequent reads, and no dependencies (other than jasmine dev testing).
Author: howard.stearns@gmail.com
Latest version: 1.0.1

# Cache

A simple, fast, least-recently-used cache (specifically, last set) with active time-to-live eviction, optimized for large-string keys and frequent reads.

It has no dependencies, other than a jasmine dev-dependencies for unit tests.

The implementation has identical performance to Map for reading, and slightly longer than Map for writing and deleting.

The API is identical to Map(), except that:

- The constructor takes a required integer `maxSize` and an optional `defaultTimeToLive`.
  - The cache keeps track of the order in which keys are _set_, and will remove the maxSize oldest key as new ones are set. Note that this keeps the size below `maxSize`, but the actual size may be less than maxSize as more recent keys are removed by the client or by timers.
  - The `defaultTimeToLive` is the default for value for `set()`. Defaults to 0.
- `set(key, value, timeToLive = this.defaultTimeToLive)` takes an optional third parameter that actively deletes key from the cache after the specified number of milliseconds. A timeToLive of 0 means that there is no time limit for that particular key. (The key is still subject to maxSize.)
- `clear(newMaxSize = this.maxSize)` takes an optional parameter that is the new maxSize.
npm package: @ki1r0y/storage
Description: Key-value store for Web pages & PWAs.
Author: howard@ki1r0y.com
Latest version: 1.0.8

# @kilroy/storage

Key-value store for Web pages & PWAs;

The api provides four asynchronous operations: `get`, `put`, `delete`, and `list`. 
- In a browser, these are implemented with the Cache API.
- In NodeJS, these are implemented with the file system.

There are no transactions, but everything is queued: within a store, every request to the same tag happens in the order it is called. However, this does mean that the application may itself need to serialize it's own operations. For example, suppose two different asynchronous calls get, modify, and put related items at different tags or even different storage names. The application may itself need to serialize the two activities.

This library does _not_ provide:
- access control, as this is the job of higher-level libraries such as @ki1r0y/distributed-security
- synchronization between distributed stores, as this is the job of higher-level libraries such as @kilroy-code/flexstore

## API

```
import { StorageLocal } from '@kilroy-code/storage';
const storage = new StorageLocal('MyData');
const tag = uuid4(); // For example, but can be any string. URL-safe strings are recommended.
await storage.put(tag, {foo: 1, bar: 2});
const data = await storage.get(tag);
const tags = storage.list(); // Array includes tag.
await storage.delete(tag);   // true because tag exists
await storage.delete(tag);   // false because tag no longer exists
```
npm package: @kialam/pi-is-pi
Description: Use π in place of Math.PI
Latest version: 2.0.1

# pi-is-pi
![GitHub package.json version](https://img.shields.io/github/package-json/v/kialam/pi-is-pi)
[![GitHub license](https://img.shields.io/github/license/kialam/pi-is-pi)](https://github.com/kialam/pi-is-pi/blob/master/LICENSE)
[![GitHub stars](https://img.shields.io/github/stars/kialam/pi-is-pi)](https://github.com/kialam/pi-is-pi/stargazers)
![David](https://img.shields.io/david/kialam/pi-is-pi)

Use π in place of Math.PI.

## Install
```
$ npm install @kialam/pi-is-pi
```

## Usage

```js
const π = require('@kialam/pi-is-pi');

const circumference = d => d * π;
circumference(3)
//=> 3 * Math.PI
// 9.42477796076938
```
npm package: @kianianbohi/fancy
Description: A reusable UI library built with React, TypeScript, Tailwind, and Rollup.
Author: mehrdad kiani
Latest version: 1.0.5

# @kianianbohi/fancy-ui

A reusable UI component library built with **React**, **TypeScript**, **TailwindCSS**, and **React Aria**.

## ✨ Features

- ✅ Built with accessibility in mind (React Aria)
- ✅ Components: `Button`, `Input`, `Modal`, `DatePicker`
- ✅ Typed with TypeScript

## 📦 Installation

```bash
npm install @kianianbohi/fancy-ui
# or
yarn add @kianianbohi/fancy-ui
```
npm package: @kianmusser/n8n-nodes-dave-statemachine
Description: A state machine node that stores state persistently, and uses diagrams generated with StateSmith
Author: Kian Musser
Latest version: 1.0.2

# @kianmusser/n8n-nodes-dave-statemachine

This is an n8n community node for implementing a durable state machine.

The State Machine node allows you to create a state machine that persists across n8n executions by storing states in a PostgreSQL database. It supports generating the state machine code from diagrams drawn using draw.io and stored in GitHub, utilizing a program called StateSmith for code generation.

[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.

[Installation](#installation)  
[Operations](#operations)  
[Credentials](#credentials)  
[Compatibility](#compatibility)  
[Usage](#usage)  
[Resources](#resources)  

## Installation

Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.

## Operations

- Create and manage state machines
- Persist state machine states in PostgreSQL
- Generate state machine code from draw.io diagrams stored in GitHub

## Credentials

This node requires PostgreSQL credentials to store and retrieve state machine states. Also, it requires a webhook it can call with the name of the state machine diagram, which should return a JSON object with the following property: `code`, that is the code that StateSmith generated.

## Compatibility

This node has been tested on n8n version 1.45.1. Compatibility with older versions has not been verified.

## Usage

To use this node, you need to:
1. Draw your state machine diagram using draw.io and store it in GitHub.
2. Setup the StateSmith server.
3. Configure the node with the URL to fetch the state machine code, the diagram name, and the cache folder path.

## Resources

* [n8n community nodes documentation](https://docs.n8n.io/integrations/community-nodes/)
* [StateSmith documentation](https://github.com/StateSmith/StateSmith)
* [draw.io](https://www.diagrams.net/)
npm package: @kiattiwong-jdea/jauthenlog
Description: JCore Authentication Logger - Track and manage login attempts with database logging
Latest version: 1.0.0

# JAuthenLog

Authentication Logger - Track and manage login attempts with database logging

## Installation

```bash
npm install @kiattiwong-jdea/jauthenlog
```

## Environment Variables

```
AUTHENLOG_DB_HOST=localhost
AUTHENLOG_DB_PORT=3306
AUTHENLOG_DB_USERNAME=root
AUTHENLOG_DB_PASSWORD=password
AUTHENLOG_DB_NAME=your_database
```

## Usage

```typescript
import { Authen, DBTYPE, ATTEMPT_UNIT_CONDITION } from '@kiattiwong-jdea/jauthenlog';

const authen = new Authen({
  dbType: DBTYPE.MYSQL,
  limitFailed: 5,
  attemptAmount: 15,
  attemptUnit: ATTEMPT_UNIT_CONDITION.MINUTE
});

// Validate login attempt
const result = await authen.ValidateAuthAttempt({
  username: 'user@example.com',
  ipAddress: '192.168.1.1'
});

// Clear authentication log on successful login
await authen.ClearAuthenLog({
  username: 'user@example.com',
  ipAddress: '192.168.1.1'
});
```

## License

MIT
npm package: @kiattiwong-jdea/jlog
Description: JCore Logger - Console and Database logging utility
Latest version: 1.0.2

# @jcore/jlog

JCore Logger - ไลบรารีสำหรับ logging ทั้งแบบ console และ database

## การติดตั้ง

```bash
npm install @kiattiwong-jdea/jlog
```

## การใช้งาน

### Console Logging

```typescript
import { ConsoleLog } from '@kiattiwong-jdea/jlog';

ConsoleLog.trace('trace message');
ConsoleLog.debug('debug message');
ConsoleLog.info('info message');
ConsoleLog.warn('warning message');
ConsoleLog.error('error message');

// เพิ่ม property
const child = ConsoleLog.child({ userId: '123' });
child.info('user action');
```

### Database Logging

```typescript
import { WriteDBLog, DBLogDataModel } from '@kiattiwong-jdea/jlog';

// ตั้งค่า environment variables
process.env.LOG_DB_HOST = 'localhost';
process.env.LOG_DB_PORT = '3306';
process.env.LOG_DB_USERNAME = 'user';
process.env.LOG_DB_PASSWORD = 'password';
process.env.LOG_DB_NAME = 'logs';
process.env.LOG_DB_TYPE = 'mysql';

// เขียน log ลง database
const logData: DBLogDataModel[] = [
  { fieldName: 'action', fieldValue: 'login' },
  { fieldName: 'userId', fieldValue: '123' }
];

WriteDBLog('user_logs', logData);
```

## Log Levels

- `trace` - ไม่แสดงบน production
- `debug` - ไม่แสดงบน production
- `info` - แสดงทุก environment
- `warn` - แสดงทุก environment
- `error` - แสดงทุก environment

ตั้งค่า `LOG_LEVEL=production` เพื่อแสดงเฉพาะ info, warn, error

## License

MIT
npm package: @kiattiwong-jdea/password-policy
Description: Password policy validation and management library
Latest version: 1.0.0

# @jcore/password-policy

Password policy validation and management library with MySQL support.

## Installation

```bash
npm install @jcore/password-policy
```

## Environment Variables

```
PASSWORD_POLICY_LENGTH=10
PASSWORD_POLICY_UPPERCASE=2
PASSWORD_POLICY_LOWERCASE=2
PASSWORD_POLICY_SPECIAL_CHARACTER=1
PASSWORD_POLICY_NUBMER_CHARACTER=2
PASSWORD_POLICY_EXPIRY_DAYS=90
PASSWORD_POLICY_NOT_DUPLICATE_LATEST=5
PASSWORD_POLICY_SECRET_KEY=your-secret-key

PASSWORD_POLICY_DB_HOST=localhost
PASSWORD_POLICY_DB_PORT=3306
PASSWORD_POLICY_DB_USERNAME=root
PASSWORD_POLICY_DB_PASSWORD=password
PASSWORD_POLICY_DB_NAME=database
```

## Usage

```typescript
import { RandomPassword, ValidatePassword, InsertPasswordHistory, CheckPasswordHistory, VerifyPasswordExpiry } from '@jcore/password-policy';

// Generate random password
const password = RandomPassword();

// Validate password
const result = ValidatePassword({ password: 'MyPass123!' });

// Insert password history
await InsertPasswordHistory({ username: 'user1', password: 'MyPass123!' });

// Check password history
await CheckPasswordHistory({ username: 'user1', password: 'MyPass123!' });

// Verify password expiry
await VerifyPasswordExpiry({ username: 'user1', password: 'MyPass123!' });
```
npm package: @kibadist/agentui-next
Description: AgentUI Next.js integration
Latest version: 0.2.4

# @kibadist/agentui-next

Next.js App Router proxy handlers for the AgentUI protocol. Routes requests between your Next.js frontend and a NestJS (or any) backend.

## Install

```bash
npm install @kibadist/agentui-next
```

## Usage

### SSE stream proxy

```ts
// app/api/agent/[sessionId]/stream/route.ts
import { createSSEProxyHandler } from "@kibadist/agentui-next";

export const GET = createSSEProxyHandler({
  targetUrl: "http://localhost:3001",
});
```

### Action proxy

```ts
// app/api/agent/[sessionId]/action/route.ts
import { createActionProxyHandler } from "@kibadist/agentui-next";

export const POST = createActionProxyHandler({
  targetUrl: "http://localhost:3001",
});
```

### With authentication headers

```ts
export const GET = createSSEProxyHandler({
  targetUrl: process.env.AGENT_API_URL!,
  getHeaders: (req) => ({
    Authorization: req.headers.get("authorization") ?? "",
  }),
});

export const POST = createActionProxyHandler({
  targetUrl: process.env.AGENT_API_URL!,
  getHeaders: (req) => ({
    Authorization: req.headers.get("authorization") ?? "",
  }),
});
```

Then point your React client at the Next.js proxy instead of the backend directly:

```tsx
<AgentRuntimeProvider
  url={`/api/agent/${sessionId}/stream`}
  sessionId={sessionId}
/>
```

## Exports

| Export | Kind | Description |
|---|---|---|
| `createSSEProxyHandler` | function | Creates a Next.js GET handler that proxies SSE streams |
| `createActionProxyHandler` | function | Creates a Next.js POST handler that proxies action requests |
| `SSEProxyOptions` | interface | Options: `targetUrl`, `getHeaders?` |
| `ActionProxyOptions` | interface | Options: `targetUrl`, `getHeaders?` |

## License

MIT
npm package: @kibadist/agentui-openai
Description: DEPRECATED: Use @kibadist/agentui-ai instead
Latest version: 0.2.4
Deprecated: Use @kibadist/agentui-ai instead. This package is no longer maintained.

# @kibadist/agentui-openai

OpenAI function-calling adapter for the AgentUI protocol. Works with any OpenAI-compatible API (OpenAI, DeepSeek, Ollama, vLLM, etc.).

## Install

```bash
npm install @kibadist/agentui-openai
```

**Peer dependency:** `openai` ^4.0.0

## Quick start

```ts
import OpenAI from "openai";
import { runAgentLoop } from "@kibadist/agentui-openai";

const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });

await runAgentLoop({
  openai,
  model: "gpt-4o",
  systemPrompt: "You are a helpful assistant. Use emit_ui_event to render UI.",
  userMessage: "Show me a summary of recent sales",
  allowedTypes: ["text-block", "info-card", "data-table"],
  sessionId: "session-123",
  onUIEvent: (event) => {
    // Forward to SSE stream, save to DB, etc.
    console.log(event);
  },
});
```

## How it works

`runAgentLoop` creates an `emit_ui_event` function tool whose schema constrains the agent to only emit your registered component types. The agent calls this tool to append, replace, remove, toast, or navigate. The loop runs multi-turn until the model stops or `maxRounds` is reached.

## Using different providers

```ts
// OpenAI
new OpenAI({ apiKey: "sk-..." });

// DeepSeek
new OpenAI({ apiKey: "sk-...", baseURL: "https://api.deepseek.com" });

// Local (Ollama, vLLM)
new OpenAI({ apiKey: "none", baseURL: "http://localhost:11434/v1" });
```

## Options

| Option | Type | Default | Description |
|---|---|---|---|
| `openai` | `OpenAI` | required | OpenAI client instance |
| `model` | `string` | `"gpt-4o"` | Model name |
| `systemPrompt` | `string` | required | Agent instructions |
| `userMessage` | `string` | required | Current user message |
| `allowedTypes` | `string[]` | required | Component types the agent can emit |
| `sessionId` | `string` | required | Session ID injected into events |
| `onUIEvent` | `(event: UIEvent) => void` | required | Callback for each emitted UIEvent |
| `extraTools` | `ChatCompletionTool[]` | `[]` | Additional tools beyond the UI emitter |
| `onToolCall` | `(name, args) => string` | - | Handler for extra tool calls |
| `maxRounds` | `number` | `10` | Max tool-call rounds to prevent loops |

## Exports

| Export | Kind | Description |
|---|---|---|
| `runAgentLoop` | function | Multi-turn agent loop with UI event emission |
| `createUIEmitterTool` | function | Generate the `emit_ui_event` tool definition |
| `UI_EMITTER_TOOL_NAME` | constant | `"emit_ui_event"` |
| `RunAgentLoopOptions` | interface | Options for `runAgentLoop` |

## License

MIT
npm package: @kibadist/agentui-protocol
Description: AgentUI protocol types and interfaces
Latest version: 0.2.4

# @kibadist/agentui-protocol

Core TypeScript types for the AgentUI wire protocol.

## Install

```bash
npm install @kibadist/agentui-protocol
```

## Overview

This package defines the event contract for bidirectional communication between an AI agent and a React UI. All events flow as typed, versioned messages with session correlation.

**UI Events** (agent to frontend) describe how to patch the rendered UI:

| Operation | Description |
|---|---|
| `ui.append` | Add a component to the render list |
| `ui.replace` | Update an existing component's props |
| `ui.remove` | Remove a component by key |
| `ui.toast` | Show an ephemeral notification |
| `ui.navigate` | Trigger client-side navigation |

**Action Events** (frontend to agent) capture user interactions:

| Type | Description |
|---|---|
| `action.submit` | Form submission or message send |
| `action.select` | Item selection |
| `action.approve` | Explicit user approval |
| `action.generic` | Custom action |

## Usage

```ts
import type {
  UIEvent,
  ActionEvent,
  UINode,
  UIAppendEvent,
  UIReplaceEvent,
} from "@kibadist/agentui-protocol";

// A UI node the agent wants to render
const node: UINode = {
  key: "card-1",
  type: "info-card",
  props: { title: "Hello", body: "World" },
};

// An append event
const event: UIAppendEvent = {
  v: 1,
  id: "evt-1",
  ts: new Date().toISOString(),
  sessionId: "session-123",
  kind: "ui",
  op: "ui.append",
  node,
};
```

## Exports

| Export | Kind | Description |
|---|---|---|
| `UIEvent` | type | Union of all UI patch operations |
| `ActionEvent` | type | Union of all user action types |
| `AgentUIEvent` | type | `UIEvent \| ActionEvent` |
| `UINode` | interface | Renderable component: key, type, props, optional slot/children/meta |
| `BaseEvent` | interface | Common fields: v, id, ts, sessionId, traceId? |
| `UIAppendEvent` | interface | Append operation |
| `UIReplaceEvent` | interface | Replace operation |
| `UIRemoveEvent` | interface | Remove operation |
| `UIToastEvent` | interface | Toast notification |
| `UINavigateEvent` | interface | Client-side navigation |
| `ActionSubmitEvent` | interface | Submit action |
| `ActionSelectEvent` | interface | Select action |
| `ActionApproveEvent` | interface | Approve action |
| `ActionGenericEvent` | interface | Generic action |

## License

MIT
npm package: @kibadist/agentui-validate
Description: AgentUI validation utilities
Latest version: 0.2.4

# @kibadist/agentui-validate

Runtime validation for the AgentUI protocol using Zod.

## Install

```bash
npm install @kibadist/agentui-validate
```

## Usage

### Safe parsing (recommended)

```ts
import { safeParseUIEvent } from "@kibadist/agentui-validate";

const result = safeParseUIEvent(rawData);
if (result.ok) {
  // result.value is a typed UIEvent
  console.log(result.value.op);
} else {
  console.error(result.error);
}
```

### Strict parsing (throws on invalid data)

```ts
import { parseUIEvent, parseActionEvent } from "@kibadist/agentui-validate";

const uiEvent = parseUIEvent(raw);       // throws ZodError if invalid
const action = parseActionEvent(raw);     // throws ZodError if invalid
```

### Type guards

```ts
import { isUIEvent, isActionEvent } from "@kibadist/agentui-validate";

if (isUIEvent(data)) {
  // data is UIEvent
}
```

### Zod schemas

```ts
import { uiEventSchema, actionEventSchema, uiNodeSchema } from "@kibadist/agentui-validate";

// Use directly with Zod
const parsed = uiEventSchema.parse(data);

// Compose into larger schemas
const mySchema = z.object({
  event: uiEventSchema,
  metadata: z.record(z.unknown()),
});
```

## Exports

| Export | Kind | Description |
|---|---|---|
| `parseUIEvent` | function | Parse and validate a UIEvent, throws on failure |
| `safeParseUIEvent` | function | Parse a UIEvent, returns `{ ok, value }` or `{ ok, error }` |
| `parseActionEvent` | function | Parse and validate an ActionEvent, throws on failure |
| `safeParseActionEvent` | function | Parse an ActionEvent, returns `{ ok, value }` or `{ ok, error }` |
| `isUIEvent` | function | Type guard for UIEvent |
| `isActionEvent` | function | Type guard for ActionEvent |
| `uiEventSchema` | Zod schema | Validates all UI event types |
| `actionEventSchema` | Zod schema | Validates all action event types |
| `uiNodeSchema` | Zod schema | Validates UINode structure |

## License

MIT
npm package: @kibalabs/ui-react-dropzone
Description: React UI component for dropzones
Latest version: 0.3.0

# UI-React-Dropzone

This library is a wrapper around the awesome [React-Dropzone](https://github.com/react-dropzone/react-dropzone/), built to slip into the theming provided by [UI-React](https://github.com/kibalabs/ui-react)
npm package: @kibamail/haraka
Description: An SMTP Server project. A fork of Haraka by Matt Sergeant <helpme@gmail.com> (http://baudehlo.com/) with very little modifications to remove the disk based queue driver.
Author: Matt Sergeant
Latest version: 3.0.4

## Haraka - Kibamail fork

### Goals of the fork:

1. Remove the disk based queue driver
2. Make it possible to handle everything to do with queuing using external plugins
npm package: @kibbleio/kibble-components
Description: Kibble Component Library
Latest version: 0.2.22

![Built With Stencil](https://img.shields.io/badge/-Built%20With%20Stencil-16161d.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI%2BCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI%2BCgkuc3Qwe2ZpbGw6I0ZGRkZGRjt9Cjwvc3R5bGU%2BCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MjQuNywzNzMuOWMwLDM3LjYtNTUuMSw2OC42LTkyLjcsNjguNkgxODAuNGMtMzcuOSwwLTkyLjctMzAuNy05Mi43LTY4LjZ2LTMuNmgzMzYuOVYzNzMuOXoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTQyNC43LDI5Mi4xSDE4MC40Yy0zNy42LDAtOTIuNy0zMS05Mi43LTY4LjZ2LTMuNkgzMzJjMzcuNiwwLDkyLjcsMzEsOTIuNyw2OC42VjI5Mi4xeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNDI0LjcsMTQxLjdIODcuN3YtMy42YzAtMzcuNiw1NC44LTY4LjYsOTIuNy02OC42SDMzMmMzNy45LDAsOTIuNywzMC43LDkyLjcsNjguNlYxNDEuN3oiLz4KPC9zdmc%2BCg%3D%3D&colorA=16161d&style=flat-square)

# Kibble's Component Library

## Getting Started

To start building a new web component using Stencil, clone this repo to a new directory:

```bash
git clone https://github.com/ionic-team/stencil-component-starter.git my-component
cd my-component
git remote rm origin
```

and run:

```bash
npm install
npm start
```

To build the component for production, run:

```bash
npm run build
```

To run the unit tests for the components, run:

```bash
npm test
```

Need help? Check out our docs [here](https://stenciljs.com/docs/my-first-component).


## Naming Components

Use the prefix `kui` for all new components


## Using these components

### Node Modules
- Run `npm install @kibble/components --save`
npm package: @kibcode/tonlib-node
Description: TonLib Node JS implementation based on FFI-NAPI library.
Latest version: 0.0.1-alpha.1

# TonLib Node JS

TonLib Node JS implementation based on FFI-NAPI library.

## Supported Operating Systems
- Ubuntu 18
- Windows x86_64
- Mac OS 10.15

## Installation

### yarn

```bash
yarn add @kibcode/tonlib-node
```

### npm

```bash
npm i @kibcode/tonlib-node
```

## Examples

### Common usage

```typescript
/**
 * This example shows common usage of TonLib Node JS client.
 */

import {Client} from './src';
import {testInitConfig} from './test-init-config';

(async () => {
  // Create tonlib client.
  const client = new Client();

  // Let's listen to all events coming from tonlib. It is worth paying attention
  // to the fact, that you will additionally receive messages which are request
  // responses as long as responses are events.
  //
  // So, when you call client.request, you will see its response event here too.
  client.on(data => console.log('Hey, I got some data!', data));

  // Send command to decrease count of logs, received from tonlib.
  client.send({'@type': 'setLogVerbosityLevel', 'new_verbosity_level': 1});

  // For future examples, lets define function which gets some address
  // information.
  function getAddressInformation(timeout: number) {
    return client
      .request({
        '@type': 'getAccountState',
        account_address: {
          '@type': 'accountAddress',
          account_address: 'EQAogu1aTrj2GWzA3BsHGxadmOTheuRubH5GY54XSRFr497x'
        }
      }, {timeout})
      .then(i => console.log('Address information:', i))
      .catch(e => console.log('Error while getting address information:', e));
  }

  // Then, lets try to get it.
  // At this stage, it is known that we will get an error connected with
  // tonlib internal initialization state.
  await getAddressInformation(10000);

  // So, to solve this problem, we should firstly send init request.
  await client.request(testInitConfig).then(r => console.log('Init result:', r));

  // Finally, we can now get address information.
  await getAddressInformation(30000);
})();
```

### Usage with types generator
```typescript
/**
 * This example shows how to use TonLib Node JS client along with types,
 * generated with TypesGenerator.
 *
 * You can find more information about generating types via separate
 * package @ton.js/types-generator or use already generated types placed in
 * @ton.js/types
 */

import {Client} from './src';
import {TonLib} from '@ton.js/types';

// Create TonLib Node client instance.
const client = new Client();

// Use send method with specified type which we received from generator.
// Type usage will make us to pass all the fields required for this type
// and as a result, we will not receive any error.
client.send<TonLib.Combinators.SetLogVerbosityLevel>({
  '@type': 'setLogVerbosityLevel',
  new_verbosity_level: 1,
});
```
npm package: @kibeo/loaders.gl-3d-tiles
Description: 3D Tiles, an open standard for streaming massive heterogeneous 3D geospatial datasets.
Latest version: 3.0.17

# @kibeo/loaders.gl-3d-tiles (Experimental)

This module contains a loader for [3D tiles](https://github.com/AnalyticalGraphicsInc/3d-tiles).

[loaders.gl](https://loaders.gl/docs) is a collection of loaders for big data visualizations.

For documentation please visit the [website](https://loaders.gl).
npm package: @kibeo/loaders.gl-arrow
Description: Simple columnar table loader for the Apache Arrow format
Latest version: 3.0.17

# @kibeo/loaders.gl-arrow

This module contains a table loader for the Apache Arrow format.

[loaders.gl](https://loaders.gl/docs) is a collection of loaders for big data visualizations.

For documentation please visit the [website](https://loaders.gl).
npm package: @kibeo/loaders.gl-compression
Description: Decompression and compression plugins for loaders.gl
Latest version: 3.0.17

# @kibeo/loaders.gl-compression

This module contains compression/decompression "transforms" for loaders.gl, a collection of framework-independent 3D and geospatial loaders (parsers).

For documentation please visit the [website](https://loaders.gl).
npm package: @kibeo/loaders.gl-crypto
Description: Cryptographic/hashing plugins for loaders.gl
Latest version: 3.0.17

# @kibeo/loaders.gl-crypto

This module contains compression/decompression "transforms" for loaders.gl, a collection of framework-independent 3D and geospatial loaders (parsers).

For documentation please visit the [website](https://loaders.gl).
npm package: @kibeo/loaders.gl-draco
Description: Framework-independent loader and writer for Draco compressed meshes and point clouds
Latest version: 3.0.17

# @kibeo/loaders.gl-draco

[loaders.gl](https://loaders.gl/docs) is a collection of framework-independent 3D and geospatial parsers and encoders.

This module contains loader and writer for Draco compressed meshes and point clouds.

For documentation please visit the [website](https://loaders.gl).
npm package: @kibeo/loaders.gl-geopackage
Description: GeoPackage data loaders
Latest version: 3.0.17

# @kibeo/loaders.gl-geopackage

This module contains a loader for the [GeoPackage](https://www.geopackage.org/) format.

[loaders.gl](https://loaders.gl/docs) is a collection of framework-independent visualization-focused loaders (parsers).
npm package: @kibeo/loaders.gl-geotiff
Description: Framework-independent loaders for tiff and geotiff
Latest version: 3.0.17

# @kibeo/loaders.gl-geotiff

[loaders.gl](https://loaders.gl/docs) is a collection of framework-independent 3D and geospatial parsers and encoders.

This module contains loaders for tiff and geotiff formats.

For documentation please visit the [website](https://loaders.gl).
npm package: @kibeo/loaders.gl-gltf
Description: Framework-independent loader for the glTF format
Latest version: 3.0.17

# @kibeo/loaders.gl-gltf

[loaders.gl](https://loaders.gl/docs) is a collection of framework-independent 3D and geospatial parsers and encoders.

This module contains loader and writers for the glTF format.

For documentation please visit the [website](https://loaders.gl).
npm package: @kibeo/loaders.gl-i3s
Description: i3s .
Latest version: 3.0.17

# @kibeo/loaders.gl-i3s (Experimental)

This module contains a loader for [i3s](https://github.com/Esri/i3s-spec) (Indexed SceneLayers).

[loaders.gl](https://loaders.gl/docs) is a collection of loaders for big data visualizations.

For documentation please visit the [website](https://loaders.gl).
npm package: @kibeo/loaders.gl-images
Description: Framework-independent loaders and writers for images (PNG, JPG, ...)
Latest version: 3.0.17

# @kibeo/loaders.gl-images

[loaders.gl](https://loaders.gl/docs) is a collection of framework-independent 3D and geospatial parsers and encoders.

This module contains loader and writers for images that follow loaders.gl conventions and work under both node and browser.

For documentation please visit the [website](https://loaders.gl).
npm package: @kibeo/loaders.gl-kml
Description: Framework-independent loader for the KML format
Latest version: 3.0.17

# @kibeo/loaders.gl-kml

[loaders.gl](https://loaders.gl/docs) is a collection of framework-independent 3D and geospatial parsers and encoders.

This module contains loaders for the KML format.

For documentation please visit the [website](https://loaders.gl).
npm package: @kibeo/loaders.gl-las
Description: Framework-independent loader for the LAS and LAZ formats
Latest version: 3.0.17

# @kibeo/loaders.gl-las

[loaders.gl](https://loaders.gl/docs) is a collection of framework-independent 3D and geospatial parsers and encoders.

This module contains loaders and writers for the LAS and LAZ formats.

For documentation please visit the [website](https://loaders.gl).
npm package: @kibeo/loaders.gl-loader-utils
Description: Framework-independent loaders for 3D graphics formats
Latest version: 3.0.17

# @kibeo/loaders.gl-loader-utils

This module contains shared utilities for loaders.gl, a collection of framework-independent 3D and geospatial loaders (parsers).

For documentation please visit the [website](https://loaders.gl).
npm package: @kibeo/loaders.gl-math
Description: Experimental math classes for loaders.gl
Latest version: 3.0.17

# @kibeo/loaders.gl-math (Experimental, Temporary)

[loaders.gl](https://loaders.gl/docs) is a collection of framework-independent 3D and geospatial parsers and encoders.

This module contains math utilities for the `@loaders.gl3d-tiles` module. As they mature, these will likely be moved to a math framework (e.g. math.gl).

This code is a fork of a subset of the Cesium math library whcih is Apache 2 licensed.

For documentation please visit the [website](https://loaders.gl).
npm package: @kibeo/loaders.gl-obj
Description: Framework-independent loader for the OBJ format
Latest version: 3.0.17

# @kibeo/loaders.gl-obj

[loaders.gl](https://loaders.gl/docs) is a collection of framework-independent 3D and geospatial parsers and encoders.

This module contains loader for the OBJ format.

For documentation please visit the [website](https://loaders.gl).

Note: The OBJ parser in this module is a port of [three.js](https://github.com/mrdoob/three.js)'s OBJLoader.

The MIT License

Copyright © 2010-2019 three.js authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
npm package: @kibeo/loaders.gl-pcd
Description: Framework-independent loader for the PCD format
Latest version: 3.0.17

# @kibeo/loaders.gl-pcd

[loaders.gl](https://loaders.gl/docs) is a collection of framework-independent 3D and geospatial parsers and encoders.

This module contains loaders for the PCD format.

For documentation please visit the [website](https://loaders.gl).
npm package: @kibeo/loaders.gl-ply
Description: Framework-independent loader for the PLY format
Latest version: 3.0.17

# @kibeo/loaders.gl-ply

[loaders.gl](https://loaders.gl/docs) is a collection of loaders for big data visualizations.

This module contains loaders for the PLY format.

For documentation please visit the [website](https://loaders.gl).
npm package: @kibeo/loaders.gl-polyfills
Description: Polyfills for TextEncoder/TextDecoder
Latest version: 3.0.17

# @kibeo/loaders.gl-polyfills

[loaders.gl](https://loaders.gl/docs) is a collection of framework-independent 3D and geospatial parsers and encoders.

This module contains polyfills for running on older browsers (mainly Edge and IE11) as well as Node.

For documentation please visit the [website](https://loaders.gl).
npm package: @kibeo/loaders.gl-potree
Description: potree loaders for large point clouds.
Latest version: 3.0.17

# @kibeo/loaders.gl-potree (Experimental)

This module contains loaders for the [potree](https://github.com/potree/potree) format.

[loaders.gl](https://loaders.gl/docs) is a collection of framework-independent 3D and geospatial loaders (parsers).

For documentation please visit the [website](https://loaders.gl).
npm package: @kibeo/loaders.gl-schema
Description: Table format APIs for JSON, CSV, etc...
Latest version: 3.0.17

# @kibeo/loaders.gl-schema

This module contains:

- Classes and APIs for manipulating tabular data output from loaders.gl table category loaders (CSV, JSON, ...).

[loaders.gl](https://loaders.gl/docs) is a collection of framework-independent 3D and geospatial parsers and encoders.

Please visit the [website](https://loaders.gl).
npm package: @kibeo/loaders.gl-terrain
Description: Framework-independent loader for terrain raster formats
Latest version: 3.0.17

# @kibeo/loaders.gl-terrain

[loaders.gl](https://loaders.gl/docs) is a collection of framework-independent 3D and geospatial parsers and encoders.

This module reconstructs mesh surfaces from height map images, e.g. [Mapzen Terrain Tiles](https://github.com/tilezen/joerd/blob/master/docs/formats.md), which encodes elevation into R,G,B values.

For documentation please visit the [website](https://loaders.gl).

`@kibeo/loaders.gl-terrain` uses [MARTINI](https://github.com/mapbox/martini) for mesh reconstruction.

ISC License

Copyright (c) 2019, Mapbox

Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
npm package: @kibeo/loaders.gl-textures
Description: Framework-independent loaders for compressed and super compressed (basis) textures 
Latest version: 3.0.17

# @kibeo/loaders.gl-textures

[loaders.gl](https://loaders.gl/docs) is a collection of framework-independent 3D and geospatial parsers and encoders.

This module contains loaders for compressed textures and [basis universal textures](https://github.com/BinomialLLC/basis_universal).

For documentation please visit the [website](https://loaders.gl).
npm package: @kibeo/loaders.gl-tile-converter
Description: Converter
Latest version: 3.0.17

# @kibeo/loaders.gl-tile-converter

[loaders.gl](https://loaders.gl/docs) is a collection of framework independent 3D and geospatial parsers and encoders.

This module contains command line scripts and JavaScript APIs for converting between formats, for instance betwen 3D Tiles and I3S tilesets.

For documentation please visit the [website](https://loaders.gl).

## Installation

```bash
npm install @kibeo/loaders.gl-tile-converter
```
npm package: @kibeo/loaders.gl-tiles
Description: Common components for different tiles loaders.
Latest version: 3.0.17

# @kibeo/loaders.gl-tiles (Experimental)

This module contains the common components for tiles loaders, i.e. [3D tiles](https://github.com/AnalyticalGraphicsInc/3d-tiles).

[loaders.gl](https://loaders.gl/docs) is a collection of loaders for big data visualizations.

For documentation please visit the [website](https://loaders.gl).
npm package: @kibeo/loaders.gl-video
Description: Framework-independent loaders and writers for video (MP4, WEBM, ...)
Latest version: 3.0.17

# @kibeo/loaders.gl-video

[loaders.gl](https://loaders.gl/docs) is a collection of framework-independent 3D and geospatial parsers and encoders.

This module contains loader and writers for video that follow loaders.gl conventions and work under both node and browser.

For documentation please visit the [website](https://loaders.gl).
npm package: @kibeo/loaders.gl-wkt
Description: Loader and Writer for the WKT (Well Known Text) Format
Latest version: 3.0.17

# @kibeo/loaders.gl-wkt

This module contains a geometry loader for the Well-Known Text (WKT) and Well-Known Binary (WKB) formats.

[loaders.gl](https://loaders.gl/docs) is a collection of framework-independent visualization-focused loaders (parsers).
npm package: @kibeo/loaders.gl-zarr
Description: Framework-independent loaders for Zarr
Latest version: 3.0.17

# @kibeo/loaders.gl-zarr

[loaders.gl](https://loaders.gl/docs) is a collection of framework-independent 3D and geospatial parsers and encoders.

This module contains loaders for the Zarr format.

For documentation please visit the [website](https://loaders.gl).
npm package: @kibeo/loaders.gl-zip
Description: Zip Archive Loader
Latest version: 3.0.17

# @kibeo/loaders.gl-zip

[loaders.gl](https://loaders.gl/docs) is a collection of framework-independent 3D and geospatial parsers and encoders.

This module contains loaders and writers for the Zip Archive format.

For documentation please visit the [website](https://loaders.gl).