open-index/open-npm huggingface dataset:
npm package: @lafialink/lafiacore-redirect-ui
Description: Lafiacore UI Component Library
Author: Lafiacore Team
Latest version: 0.1.7

# @lafiacore/ui

Lafiacore UI Component Library

## Installation

```bash
npm install @lafiacore/ui
# or
yarn add @lafiacore/ui
```

## Usage

```typescript
import { AppCard, PageHeader } from "@lafialink/lafiacore-ui";
import "@lafialink/lafiacore-ui/dist/styles.css";

function App() {
  return (
    <div>
      <PageHeader title="Welcome" />
      <AppCard name="My App" />
    </div>
  );
}
```

## Development

```bash
# Install dependencies
npm install

# Build the library
npm run build

# Watch mode
npm run dev

# Type checking
npm run type-check

# Linting
npm run lint
```

## Publishing

```bash
# Build and publish
npm publish
```

## License

MIT
npm package: @lafialink/lafiacore-ui
Description: Lafiacore UI Component Library
Author: Lafiacore Team
Latest version: 0.3.0

# @lafiacore/ui

Lafiacore UI Component Library

## Installation

```bash
npm install @lafiacore/ui
# or
yarn add @lafiacore/ui
```

## Usage

```typescript
import { AppCard, PageHeader } from "@lafialink/lafiacore-ui";
import "@lafialink/lafiacore-ui/dist/styles.css";

function App() {
  return (
    <div>
      <PageHeader title="Welcome" />
      <AppCard name="My App" />
    </div>
  );
}
```

## Development

```bash
# Install dependencies
npm install

# Build the library
npm run build

# Watch mode
npm run dev

# Type checking
npm run type-check

# Linting
npm run lint
```

## Publishing

```bash
# Build and publish
npm publish
```

## License

MIT
npm package: @lafka/rights
Description: Rights service for LAFka
Author: Lazy-And-Focused
Latest version: 1.1.0

# Битовая система прав (БСП)

## Для тех, кто будет работать на прямую

### Как работает?

- Биты не повторяются в правах, так что каждое право имеет уникальное значение: 1, 2, 4, 8, 16...
- Биты сверяются оператором И (`&`) и если получается, что биты пересекаются, то права имеются, иначе нет

### Почему права — степень двух?

- БСП использует бинарную систему, состоящая из единицы и нуля
- Так получается, что мы используем все числа в бинарной, начиная с единицы (ноль — отсутствие прав)
- Так как для каждого право нужно рассчитать уникальное число, которое не будет препятствовать другим правам, нам нужно брать следующие битовое число
- Скажем, что `00001` (один в десятичное) — наше первое право, тогда следующим будет `00010` (Два в десятичное). Тогда пересечение этих прав образует `00011` — такие права у нас имеются. Чтобы проверить, имеется ли у нас первое право, нужно использовать оператор `&`: `00011` & `00001`, тогда у нас получится `00001`, означающее, что право у нас имеется, на языке программирования JavaScript это будет выглядеть следующим образом:

```js
const userRights = 0x00001 // Допустим, что тут объявлены наши права
/**
 * @param bit bit of permisson, what we want to checks
 * @return {boolean}
 */
function hasPermission(bit) {
  return (userRights & bit) === bitж
}
```

- Мы сравниваем `userRights & bit` с `bit` для того, чтобы получить `boolean`-ответ

### Справочная информация

- Язык почти не важен!
- [Битовые поля c++](https://learn.microsoft.com/ru-ru/cpp/cpp/cpp-bit-fields)
- [Битовые поля Википедия](https://en.wikipedia.org/wiki/Bit_field)
- [Битовые поля JavaScript](https://emergent.systems/posts/bit-fields/)

## Для тех, кто будет работать косвенно (через API, библиотеку или другие системы)

- Используйте `has`, чтобы проверить, имеются ли определенные права у пользователя с чем-либо
- UserService

```js
import { UserService } from "@lafka/rights";

(async() => {
  const { data: fockusty } = await (await fetch(api_url + "/users/", {headers})).json();

  new UserService(fockusty).has({
    right: "me",
    rights: ["POSTS_CREATE"] // equalt rights: "POSTS_CREATE"
  }); // boolean

  new UserService(fockusty).has({
    right: "users",
    rights: {
      "123": ["MANAGE", "MODERATE", "READ"],
      "321": ["READ"],
      "666": "MODERATE",
    }
  }) // { "123": boolean, "321": boolean "666": boolean };
})();
```

- PostService

```js
import { PostService } from "@lafka/rights";

(async() => {
  // const fockusty: LAFka.User;

  const { data: post } = (await (await fetch(api_url + "posts/" + myCoolPostId, {headers})).json());

  new PostService(post).has({
    rights: "VIEW",
    userId: fockusty.id
  }); // boolean

  new PostService(post).has({
    rights: "DELETE",
    userId: fockusty.id
  }); // boolean

  new PostService(post).has({
    rights: "OWNER",
    userId: "2"
  }); // boolean

  new PostService(post).has({
    rights: ["VIEW", "REACT", "COMMENTS_READ"],
    userId: "4"
  }); // boolean
})()
```
npm package: @lafleche/gooey-react
Description: The gooey effect for React
Author: Luuk de Vlieger
Latest version: 1.2.3

<p align="center">
  <img alt="Preview" src="docs/static/preview.gif" height="260" width="260">
</p>
<p align="center">
<h1 align="center">The gooey effect for React</h1>
</p>
The 'gooey effect' has been made popular by various (amazing) blogposts over the years. This tiny component makes it easy to use within React, and has improved the implementation. It's optimized to be as sharp/crisp as possible, since existing implementations can be a bit blurry. Safari support (which can be notorious, and is usually missing) has been added as well.

> This fork is based on the original
> [`gooey-react` by Luuk de Vlieger](https://github.com/luukdv/gooey-react).
> It keeps the same API and effect, but updates the library, build, tests, and
> docs to work cleanly with React 18 and modern tooling. The new docs are
> simpler visually than the original Gatsby site, but are meant to be a
> straightforward, up‑to‑date reference.

## Installation (~0.5 KB)
```sh
npm install @lafleche/gooey-react
```

## Usage
```jsx
import Goo from '@lafleche/gooey-react'

<Goo> … </Goo>
```
You can put regular HTML elements inside `Goo`, but using an SVG is recommended for better browser support. Shape blobbing will be applied to everything within the component.

Original documentation for the upstream project is still available at  
[https://gooey-react.netlify.app/](https://gooey-react.netlify.app/) (for historical reference).  
This fork includes its own up-to-date docs under `docs/`:

- `cd docs && npm install && npm run dev` – local docs
- `cd docs && npm run build` – production build for deployment
npm package: @lag0/godspeed-sdk
Description: Typed TypeScript SDK for the Godspeed task management API
Author: Bruno Lago
Latest version: 1.0.1
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @lag0/godspeed-sdk

Typed TypeScript SDK for the Godspeed task management API.

![npm](https://img.shields.io/npm/v/%40lag0%2Fgodspeed-sdk)

## Installation

```bash
npm install @lag0/godspeed-sdk
```

## Quick Start

```typescript
import { createClient, listTasks, createTask } from "@lag0/godspeed-sdk";

const client = createClient({
  token: process.env.GODSPEED_TOKEN,
});

const tasks = await listTasks(client, { status: "incomplete" });
const task = await createTask(client, { title: "Buy milk" });

console.log(tasks.length, task.id);
```

## API Reference

Main endpoint helpers:

- `createTask(client, input)`
- `listTasks(client, filters?)`
- `getTask(client, taskId)`
- `updateTask(client, taskId, input)`
- `deleteTask(client, taskId)`
- `listLists(client)`
- `duplicateList(client, listId, input)`

Core utilities:

- `createClient({ token, baseUrl? })`
- Zod schemas and inferred API types from `src/schemas.ts` / `src/types.ts`

## Authentication

Use a Godspeed API token via `GODSPEED_TOKEN` or pass `token` directly to `createClient`.

```bash
export GODSPEED_TOKEN=<your-token>
```

API docs: https://godspeedapp.com/guides/api

## Error Handling

Errors are represented by the Godspeed error hierarchy:

- `GodspeedApiError`
- `GodspeedAuthError`
- `GodspeedRateLimitError`
- `GodspeedValidationError`

Handle known errors with `instanceof` checks and fallback handling for unexpected failures.

## Related

For command-line usage, use the standalone CLI package:

- `@syxs/godspeed-cli`
npm package: @lage-run/cache
Description: Cache for Lage
Latest version: 1.5.2

# @lage-run/cache

This package provides:

1. `CacheProvider` interface
2. a default cache provider that uses [`backfill`](https://www.npmjs.com/package/backfill)

## Usage

The following example shows standalone cache usage. If you're using the `lage` CLI, provider creation is handled internally (though you can customize `cacheOptions` in `lage.config.js`).

```ts
import { BackfillCacheProvider, RemoteFallbackCacheProvider, TargetHasher, type CacheOptions } from "@lage-run/cache";
import { getWorkspaceManagerRoot } from "workspace-tools";

const cacheOptions: CacheOptions = {
  internalCacheFolder: ".cache",
  outputGlob: ["dist/**", "lib/**"]
}

const root = getWorkspaceManagerRoot(cwd);

const remoteFallbackCacheProviderOptions = {
  root,
  localCacheProvider: cacheOptions.skipLocalCache ? undefined : new BackfillCacheProvider({
    root,
    cacheOptions: {
      outputGlob: ["dist/**"]
    }
  }),

  remoteCacheProvider: new BackfillCacheProvider({
    root,
    {
      cacheStorageOptions: {
        provider: "azure-blob",
        options: {
          // This connection string can optionally contain credentials.
          // If no credentials are present, see credentialName below.
          connectionString: "asdfasdfasdfafds";
          container: "container";
          maxSize?: 150;
          // If connectionString doesn't have credentials, specify a supported credential type
          credentialName?: "environment"
        }
      },
      ...cacheOptions
      writeRemoteCache: true,
      outputGlob: ["dist/**", "lib/**"]
    },
    isReadOnly: cacheOptions.writeRemoteCache !== true,
  })
}

const cacheProvider = new RemoteFallbackCacheProvider(remoteFallbackCacheProviderOptions);
const hasher = new TargetHasher({
  root,
  environmentGlob: ["lage.config.js"],
  cacheKey: "some cache key",
})

let hash: string | null = null;
let cacheHit = false;

if (target.cache && !skipCaching) {
  hash = await hasher.hash(target, cliArgs);

  if (hash && !shouldResetCache) {
    cacheHit = await cacheProvider.fetch(hash, target);
  }
}

// DO TARGET RUN ACTIONS
// ...

await cacheProvider.put(hash, target);
```

## Differentiating cache

`CacheOptions.cacheKey` is included in the hash and can be used to differentiate the hash generated for the cache between different steps, or to invalidate the cache.

Example of usage in `lage.config.js`:

```js
module.exports = {
  cacheOptions: {
    cacheKey: "some cache key";
  }
}
```
npm package: @lage-run/cli
Description: Command Line Interface for Lage
Latest version: 0.36.3

# @lage-run/cli

This is the command line interface (CLI) for lage. It contains the logic to tie everything together:

1. parses CLI arguments via `commander`
2. initializes the various commands
3. for running the targets, there are some reserved options for lage, but the rest are passed through to the scripts
4. figures out the filtered packages as entry points (dependencies are also run, unless --no-dependents are specified)
5. scheduler, reporter, cache, logger are initialized and run
npm package: @lage-run/find-npm-client
Description: Finds the npm client for Lage
Latest version: 0.1.4
Deprecated: No longer used

# @lage-run/cli

This is the command line interface (CLI) for lage. It contains the logic to tie everything together:

1. parses CLI arguments via `commander`
2. initializes the various commands
3. for running the targets, there are some reserved options for lage, but the rest are passed through to the scripts
4. figures out the filtered packages as entry points (dependencies are also run, unless --no-dependents are specified)
5. scheduler, reporter, cache, logger are initialized and run
npm package: @lage-run/globby
Description: Bundled CJS wrapper of globby with caching support
Latest version: 13.0.2

CommonJS wrapper of [`globby`](https://www.npmjs.com/package/globby) with caching support and all dependencies bundled.

This should follow the newest version of `globby` compatible with Lage's minimum Node version. As of writing, that's Node 16 and `globby` 13.
npm package: @lage-run/grapher
Description: Generates a list of dependents and dependencies (internal to the monorepo) for a package or packages.
Latest version: 0.2.23

# @lage-run/grapher

Generates a list of dependents and dependencies (internal to the monorepo) for a package or packages.

For one package:

```
npx @lage-run/grapher deps --scope foo
```

For multiple packages:

```
npx @lage-run/grapher deps --scope foo --scope bar
```
npm package: @lage-run/runners
Description: Runners for Lage
Latest version: 1.4.5

# @lage-run/runners

This package provides:

1. `TargetRunner` & `TargetRunOptions` interfaces
2. Runner implementations
   - `NpmScriptRunner` (`Target.type: "npmScript"`)
   - `WorkerRunner` (`Target.type: "worker"`)
   - `NoOpRunner` (`Target.type: "noop"`)
3. `TargetRunnerPicker` to choose the runner for a `Target`
npm package: @lage-run/scheduler
Description: Scheduler for Lage
Latest version: 1.6.3

# @lage-run/scheduler

This package provides:

1. `Scheduler` interface
2. `
3. a default cache provider that uses `backfill`

## Usage

```ts
import { Logger } from "@lage-run/logger";
import { RemoteFallbackCacheProvider, TargetHasher } from "@lage-run/cache";
import { SimpleScheduler } from "@lage-run/scheduler";
import { TargetGraph } from "@lage-run/target-graph";

const root = "/root-of-repo";
const logger = new Logger();
const cacheProvider = new RemoteFallbackCacheProvider({ root, logger, ... });
const hasher = new TargetHasher({ root, ... });

const runner = new NpmScriptRunner({
  logger,
  ...
})

const runnerPicker = new TargetRunnerPicker({
  runners: {
    npmScript: runner
  }
})

const scheduler = new SimpleScheduler({
  logger,
  concurrency,
  cacheProvider,
  hasher,
  continueOnError: true,
  shouldCache: true,
  shouldResetCache: false,
  runner
});

const targetGraphBuilder = new TargetGraphBuilder();
const packageInfos = getPackageInfos(rootDir);

const builder = new TargetGraphBuilder(rootDir, packageInfos);

// these would normally come from the CLI
const tasks = ["build", "test"];
const packages = ["package-a", "package-b"];

const targetGraph = builder.buildTargetGraph(tasks, packages);

await scheduler.run(root, targetGraph);

// If an error happened...
scheduler.abort();
```
npm package: @lage-run/target-graph
Description: Target for Lage
Latest version: 0.15.2

# @lage-run/target-graph

This package is concerned about the target graph. The target is a unit of work that gets spawned in a child process eventually be a scheduler + target runner. The main focus of this package are:

1. `Target` interface.
2. converter that changes from target ID to package + task, and vice versa.
3. A simple `TargetGraphBuilder` that handles prioritization, cycle detection, subgraph generation.
4. A workspace-aware `WorkspaceTargetGraphBuilder` that will take in `PackageInfos` object with some task (dependency) configuration and builds a direct-acyclic graph of the targets.
5. A `TargetFactory` that can generate "global" or "package" level `Target`s.

## WorkspaceTargetGraphBuilder usage

For the case (the typical `lage` CLI case) where we want to use the shorthand syntax to specify a task graph combining with a package dependency graph, this is the right Builder implementation.

```typescript
import { WorkspaceTargetGraphBuilder } from "@lage-run/target-graph";
import { findProjectRoot, getPackageInfos } from "workspace-tools";

const rootDir = findProjectRoot(process.cwd());
const packageInfos = getPackageInfos(rootDir);

const builder = new WorkspaceTargetGraphBuilder(rootDir, packageInfos);

const tasks = ["build", "test"];
const packages = ["package-a", "package-b"];

builder.addTargetConfig("build", {
  dependsOn: ["^build"],
});

const targetGraph = builder.build(tasks, packages);
```

## TargetGraphBuilder usage

```typescript
const builder = new TargetGraphBuilder();

const target1 = {...};
const target2 = {...};
const target3 = {...};

builder.addTarget(target1);
builder.addTarget(target2);
builder.addTarget(target3);

builder.addDependency(target1.id, target2.id);

const graph = builder.build();
```

The resultant `targetGraph` will have a signature of this shape:

```typescript
interface TargetGraph {
  targets: Map<string, Target>;
  dependencies: [string, string][];
}
```

### TargetFactory usage

```typescript
const root = "/some/repo/root";
const resolver = (packageName: string) => {
  return `packages/${packageName}`;
};

const factory = new TargetFactory({ root, resolver });

const target = factory.createPackageTarget("a", "build", {
  ... // `TargetConfig`
});
```

### `Target`

This is merely an interface that contains enough information to let the runner & scheduler know what to run. The "how" of how to run a target resides in the scheduler and a separate runner implementation.
npm package: @lage-run/worker-threads-pool
Description: A worker_threads pool implementation based on the official Node.js async_hooks documentation
Latest version: 0.10.2

# @lage-run/worker-threads-pool

This is an `worker_threads` based threadpool implementation. We had to implement one of these because `lage` needs access to the stdin/stdout of the workers themselves for the purpose of logging and preserving them as cached outputs. This way, the workers can be long lived, but the their logs will be associated with the correct target.

It is completely based on the Node.js documentation for `async_hook`:
https://nodejs.org/api/async_context.html#using-asyncresource-for-a-worker-thread-pool
npm package: @lager/api-gateway
Description: A Lager plugin to manage APIs in AWS API Gateway
Author: Alexis Hénaut
Latest version: 0.1.1

<img align="right" alt="lager logo" src="https://raw.githubusercontent.com/lagerjs/lager/master/img/lager-logo2.png" />

[![Known Vulnerabilities](https://snyk.io/test/npm/@lager/api-gateway/badge.svg)](https://snyk.io/test/npm/@lager/api-gateway)

# Lager API Gateway plugin

Documentation available at [https://lagerjs.github.io](https://lagerjs.github.io).
npm package: @lager/cli
Description: The lager CLI
Author: Alexis Hénaut
Latest version: 0.1.3

<img align="right" alt="lager logo" src="https://raw.githubusercontent.com/lagerjs/lager/master/img/lager-logo2.png" />

[![Known Vulnerabilities](https://snyk.io/test/npm/@lager/cli/badge.svg)](https://snyk.io/test/npm/@lager/cli)

# Lager command line interface

```bash
npm install -g @lager/cli
```

Documentation available at [https://lagerjs.github.io](https://lagerjs.github.io).
npm package: @lager/cors
Description: A Lager plugin to easily add CORS configuration to APIs in AWS API Gateway
Author: Alexis Hénaut
Latest version: 0.1.1

<img align="right" alt="lager logo" src="https://raw.githubusercontent.com/lagerjs/lager/master/img/lager-logo2.png" />

[![Known Vulnerabilities](https://snyk.io/test/npm/@lager/api-gateway/badge.svg)](https://snyk.io/test/npm/@lager/api-gateway)

# Lager API Gateway plugin

Documentation available at [https://lagerjs.github.io](https://lagerjs.github.io).
npm package: @lager/iam
Description: A Lager plugin to manage AWS policies and roles
Author: Alexis Hénaut
Latest version: 0.1.1

<img align="right" alt="lager logo" src="https://raw.githubusercontent.com/lagerjs/lager/master/img/lager-logo2.png" />

[![Known Vulnerabilities](https://snyk.io/test/npm/@lager/iam/badge.svg)](https://snyk.io/test/npm/@lager/iam)

# Lager IAM plugin

Documentation available at [https://lagerjs.github.io](https://lagerjs.github.io).
npm package: @lager/lager
Description: AWS Lambda / API Gateway / Endpoint Router
Author: Alexis Hénaut
Latest version: 0.1.1

<img align="right" alt="lager logo" src="https://raw.githubusercontent.com/lagerjs/lager/master/img/lager-logo2.png" />

[![Known Vulnerabilities](https://snyk.io/test/npm/@lager/lager/badge.svg)](https://snyk.io/test/npm/@lager/lager)

# Lager core module

AWS Lambda + API Gateway + Swagger specification === *Lager*

The **Lambda API Gateway Endpoints Router**.

Lager helps you to organize your code and deploy serverless applications in AWS.

Documentation available at [https://lagerjs.github.io](https://lagerjs.github.io).
npm package: @lager/lambda
Description: A Lager plugin to manage AWS lambda functions and deploy them.
Author: Alexis Hénaut
Latest version: 0.1.1

<img align="right" alt="lager logo" src="https://raw.githubusercontent.com/lagerjs/lager/master/img/lager-logo2.png" />

[![Known Vulnerabilities](https://snyk.io/test/npm/@lager/node-lambda/badge.svg)](https://snyk.io/test/npm/@lager/node-lambda)

# Lager node Lambda plugin

Documentation available at [https://lagerjs.github.io](https://lagerjs.github.io).
npm package: @lagerweijtech/strip-html-tags
Description: Strips HTML tags from string
Author: LagerweijTech
Latest version: 1.0.7

# Strip HTML Tags

[![Build Status](https://travis-ci.org/remylagerweij/strip-html-tags.svg?branch=master)](https://travis-ci.org/remylagerweij/strip-html-tags) [![dependencies Status](https://david-dm.org/remylagerweij/strip-html-tags/status.svg)](https://david-dm.org/remylagerweij/strip-html-tags) [![devDependencies Status](https://david-dm.org/remylagerweij/strip-html-tags/dev-status.svg)](https://david-dm.org/remylagerweij/strip-html-tags?type=dev) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

Strips HTML tags from strings

# Installation
## Yarn or NPM
`yarn add @lagerweijtech/strip-html-tags`
`npm add @lagerweijtech/strip-html-tags`

# Usage

1. Import stripHtmlTags in your .js file
`@import stripHtmlTags`
2. running `stripHtmlTags('<div class="hello">strip me</div>')` will return `'strip me'`

# Commands
- `npm run clean` - Remove `lib/` directory
- `npm test` - Run tests with linting and coverage results.
- `npm test:only` - Run tests without linting or coverage.
- `npm test:watch` - You can even re-run tests on file changes!
- `npm test:prod` - Run tests with minified code.
- `npm run test:examples` - Test written examples on pure JS for better understanding module usage.
- `npm run lint` - Run ESlint with airbnb-config
- `npm run cover` - Get coverage report for your code.
- `npm run build` - Babel will transpile ES6 => ES5 and minify the code.
- `npm run prepublish` - Hook for npm. Do all the checks before publishing your module.

# License
MIT © Lagerweij Tech
npm package: @lagomkit/bouncer
Description: Typed authorization toolkit with policy-based checks and a lightweight service factory.
Author: Chirill Ceban
Latest version: 1.3.0

# @lagomkit/bouncer

Type-safe authorization toolkit with policy/action checks and a lightweight service factory.

Policies are declared with `definePolicy({ handlers })`, then passed directly to `check(...)` and `authorize(...)` for strongly typed action and payload inference.

## Quick start

```ts
import { createBouncerService, definePolicy } from '@lagomkit/bouncer';

const bouncer = createBouncerService();

const postPolicy = definePolicy({
		handlers: {
			create: (input?: { role: 'admin' | 'editor' | 'viewer' }) => {
				return input?.role === 'admin' || input?.role === 'editor'
					? { ok: true }
					: { ok: false, message: 'Post creation is not allowed' };
			},
			delete: (input?: { role: 'admin' | 'editor' | 'viewer' }) => {
				return input?.role === 'admin'
					? { ok: true }
					: { ok: false, message: 'Only admins can delete posts' };
			},
		},
		onException: (message) => {
			throw new Error(message ?? 'Unauthorized');
		},
});

const canCreate = bouncer.check(postPolicy, 'create', { role: 'editor' });

bouncer.authorize(postPolicy, 'delete', { role: 'viewer' });

// compile-time payload safety per action
// @ts-expect-error wrong payload shape for post.delete
bouncer.check(postPolicy, 'delete', { userId: '1' });
```

## API

### `createBouncerService(config?)`

Creates a bouncer service with strongly typed policy and action access.

- `config.onException`: optional fallback handler for unauthorized actions

Returned methods:

- `check(policy, action, data?)` returns `true` or `false`
- `authorize(policy, action, data?, options?)` throws when unauthorized (or calls an exception handler)

### `definePolicy({ handlers, onException? })`

Creates a policy declaration with typed action handlers.

- `handlers`: policy action functions returning `{ ok: true }` or `{ ok: false; message?: string }`
- `onException`: optional policy-level handler used when `authorize(...)` fails

## Notes

- Policies must be declared via `definePolicy({ handlers, onException? })`.
- `authorize(...)` resolves exception handlers in this order: call options, policy config, service config.
- `authorize(...)` passes the policy result message to `onException`, or `Unauthorized` when none is provided.
- If `authorize` fails and no exception handler exists, an error is thrown with that message.
- Unknown action names throw explicit errors.
- Policy action input types are inferred from your policy definitions.
npm package: @lagomkit/encoder
Description: Typed encoding toolkit with composable drivers and a lightweight service factory.
Author: Chirill Ceban
Latest version: 1.2.0

# @lagomkit/encoder

Small, typed encoding toolkit with composable drivers and a lightweight service factory.

## Quick start

```ts
import {
  createEncoderService,
  createBase64Driver,
  createBase64UrlDriver,
  createHexDriver,
} from '@lagomkit/encoder';

const encoder = createEncoderService({
  default: 'base64',
  drivers: {
    base64: createBase64Driver(),
    base64url: createBase64UrlDriver(),
    hex: createHexDriver(),
  },
});

const bytes = new TextEncoder().encode('hello world');

const base64 = encoder.default().encode({ data: bytes });
const roundtrip = encoder.use('base64').decode({ data: base64 });
```

## API

### `createEncoderService(config)`

Creates an encoder service with typed driver access.

- `config.default`: the default driver key
- `config.drivers`: a map of driver instances

Returned methods:

- `default()` returns the default driver
- `use(key)` returns a specific driver

### Driver contract

All driver factories return an `EncoderDriver`:

```ts
type EncoderDriver = {
  encode(input: {
    data: Uint8Array;
    options?: { includePadding?: boolean };
  }): string;
  decode(input: { data: string }): Uint8Array;
};
```

## Driver factories

- `createBase32Driver()`
- `createBase64Driver()`
- `createBase64UrlDriver()`
- `createHexDriver()`

## Notes

- Base32 and Base64 support optional `includePadding` (defaults to `true`).
- Base64 URL-safe encoding defaults to `includePadding: false`.
- Hex output is uppercase and decode accepts lowercase or uppercase input.
npm package: @lagomkit/hasher
Description: Typed hashing toolkit with composable drivers and a lightweight service factory.
Author: Chirill Ceban
Latest version: 1.2.0

# @lagomkit/hasher

Small, typed hashing toolkit with composable drivers and a lightweight service factory.

## Quick start

```ts
import {
  createHasherService,
  createArgon2Driver,
  createSha2_256Driver,
} from '@lagomkit/hasher';

const hasher = createHasherService({
  default: 'argon2',
  drivers: {
    argon2: createArgon2Driver(),
    sha256: createSha2_256Driver(),
  },
});

const hash = await hasher.default().hash({ content: 'hello world' });
const verified = await hasher.use('argon2').verify({
  content: 'hello world',
  hash,
});
```

## API

### `createHasherService(config)`

Creates a hasher service with typed driver access.

- `config.default`: the default driver key
- `config.drivers`: a map of driver instances

Returned methods:

- `default()` returns the default driver
- `use(key)` returns a specific driver

### Driver contract

All driver factories return a `HasherDriver`:

```ts
type HasherDriver = {
  hash(input: { content: string }): Promise<string>;
  verify(input: { content: string; hash: string }): Promise<boolean>;
};
```

## Driver factories

### Password hashers

- `createArgon2Driver()`
- `createBcryptDriver({ cost? })`

### SHA-1

- `createSha1Driver()`

### SHA-2

- `createSha2_224Driver()`
- `createSha2_256Driver()`
- `createSha2_384Driver()`
- `createSha2_512Driver()`

Compatibility aliases:

- `createSha256Driver()`
- `createSha512Driver()`

### SHA-3

- `createSha3_224Driver()`
- `createSha3_256Driver()`
- `createSha3_384Driver()`
- `createSha3_512Driver()`

## Notes

- Input text is normalized with Unicode `NFKC` before hashing.
- SHA drivers are deterministic and produce lowercase hex output.
npm package: @lagomkit/limiter
Description: Typed rate-limiting toolkit with composable drivers and a lightweight service factory.
Author: Chirill Ceban
Latest version: 1.3.1

# @lagomkit/limiter

Small, typed rate-limiting toolkit with composable drivers and a lightweight service factory.

## Quick start

```ts
import { createLimiterService, createMemoryLimiterDriver } from '@lagomkit/limiter';

const limiter = createLimiterService({
	default: 'memory',
	drivers: {
		memory: createMemoryLimiterDriver({
			limit: 5,
			period: 60,
		}),
	},
});

await limiter.default().createTopic({ key: 'login', limit: 3, period: 60 });
await limiter.default().createTopic({ key: 'search' });

const result = await limiter.default().consume({
	topic: 'login',
	identifier: 'user:42',
});

if (!result.ok) {
	// deny request and inspect retry metadata
	console.log(result.data.msBeforeNext);
}
```

## API

### `createLimiterService(config)`

Creates a limiter service with typed driver access.

- `config.default`: default driver key
- `config.drivers`: a map of limiter drivers

Returned methods:

- `default()` returns the default driver
- `use(key)` returns a specific driver

### `createMemoryLimiterDriver(config?)`

In-memory driver with topic-based limits.

Config options:

- `limit` default limit per topic (default: `100`)
- `period` default period in seconds (default: `60`)
- `onException` fallback unauthorized handler for `authorize`
- `keyPrefix` optional storage prefix for internal limiter keys
- `blockDuration`, `execEvenly`, and `execEvenlyMinDelayMs` are forwarded to `rate-limiter-flexible`

Driver methods:

- `createTopic({ key, limit?, period? })` creates a topic and throws if it already exists
- `getTopic({ key })` returns topic config, or `null` when missing
- `hasTopic({ key })` returns whether a topic exists
- `check({ topic, identifier })` reads current limiter state without consuming a token
- `consume({ topic, identifier })` consumes a token and returns `{ ok, data }` without throwing on limit exhaustion
- `authorize({ topic, identifier, onException? })` consumes a token and throws or calls exception handler when limited

`data` is a `RateLimiterRes` from `rate-limiter-flexible`, so it includes values such as:

- `remainingPoints`
- `consumedPoints`
- `msBeforeNext`
- `isFirstInDuration`

## Notes

- In-memory state is process-local and resets when the process restarts.
- Use memory driver for single-process apps, tests, and local development.
- Topics must be explicitly created before use; unknown topics throw.
npm package: @lagomkit/mailer
Description: Typed mail delivery toolkit with composable drivers and a lightweight service factory.
Author: Chirill Ceban
Latest version: 1.1.0

# @lagomkit/mailer

Small, typed mail delivery toolkit with composable drivers and a lightweight service factory.

## Quick start

```ts
import { createMailerService, createSmtpMailerDriver } from '@lagomkit/mailer';

const mailer = createMailerService({
	default: 'smtp',
	drivers: {
		smtp: createSmtpMailerDriver({
			host: 'smtp.example.com',
			port: 587,
			secure: false,
			auth: {
				user: 'smtp-user',
				pass: 'smtp-password',
			},
		}),
	},
});

await mailer.default().send({
	from: 'noreply@example.com',
	to: 'hello@example.com',
	subject: 'Welcome',
	text: 'Hello world',
});
```

## API

### `createMailerService(config)`

Creates a mailer service with typed driver access.

- `config.default`: default driver key
- `config.drivers`: a map of mailer drivers

Returned methods:

- `default()` returns the default driver
- `use(key)` returns a specific driver

### `createSmtpMailerDriver(config)`

SMTP mailer driver backed by Nodemailer.

- `config` is a Nodemailer `SMTPTransport.Options` object
- `send(message)` sends an email using `nodemailer` transport

## Notes

- SMTP delivery behavior depends on your provider configuration.
- Driver methods return promises; always `await` `send(...)`.
npm package: @lagomkit/random
Description: Typed random generation toolkit with composable drivers and a lightweight service factory.
Author: Chirill Ceban
Latest version: 1.2.0

# @lagomkit/random

Small, typed random generation toolkit with composable drivers and a lightweight service factory.

## Quick start

```ts
import {
	createRandomGeneratorService,
	createRandomStringDriver,
	createRandomTokenDriver,
	createRandomUuidDriver,
} from '@lagomkit/random';

const random = createRandomGeneratorService({
	default: 'string',
	drivers: {
		string: createRandomStringDriver({ length: 16 }),
		token: createRandomTokenDriver({ length: 6 }),
		uuid: createRandomUuidDriver(),
	},
});

const value = random.default().generate();
const token = random.use('token').generate({ length: 8 });
const id = random.use('uuid').generate();
```

## API

### `createRandomGeneratorService(config)`

Creates a random generator service with typed driver access.

- `config.default`: default driver key
- `config.drivers`: map of random generator drivers

Returned methods:

- `default()` returns the default driver
- `use(key)` returns a specific driver

### `createRandomStringDriver(config?)`

- `config.length` default output length (default: `16`)
- `generate({ length? })` returns a random hex string

### `createRandomTokenDriver(config?)`

- `config.length` default output length (default: `6`)
- `generate({ length? })` returns a numeric token string

### `createRandomUuidDriver()`

- `generate()` returns a UUID v4 string

## Notes

- All generators use Web Crypto APIs from `globalThis.crypto`.
- `length` values must be positive integers.