open-index/open-npm huggingface dataset:
npm package: @layercode/cli
Description: Layercode CLI
Author: Layercode
Latest version: 0.2.0

layercode-cli
=================

Layercode CLI


[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
[![Version](https://img.shields.io/npm/v/layercode-cli.svg)](https://npmjs.org/package/@layercode/cli)
[![Downloads/week](https://img.shields.io/npm/dw/layercode-cli.svg)](https://npmjs.org/package/layercode-cli)


<!-- toc -->
* [Usage](#usage)
* [Commands](#commands)
<!-- tocstop -->
# Usage
<!-- usage -->
```sh-session
$ npm install -g @layercode/cli
$ layercode COMMAND
running command...
$ layercode (--version)
@layercode/cli/0.2.0 linux-x64 node-v20.19.6
$ layercode --help [COMMAND]
USAGE
  $ layercode COMMAND
...
```
<!-- usagestop -->
# Commands
<!-- commands -->
* [`layercode help [COMMAND]`](#layercode-help-command)

## `layercode help [COMMAND]`

Display help for layercode.

```
USAGE
  $ layercode help [COMMAND...] [-n]

ARGUMENTS
  [COMMAND...]  Command to show help for.

FLAGS
  -n, --nested-commands  Include all nested commands in the output.

DESCRIPTION
  Display help for layercode.
```

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.36/src/commands/help.ts)_
<!-- commandsstop -->
npm package: @layercode/js-sdk
Description: Layercode JavaScript SDK for browser usage
Author: Layercode
Latest version: 2.8.10

# Layercode JavaScript SDK

A JavaScript SDK for integrating Layercode voice agents into web applications.

## Installation

```bash
npm install @layercode/js-sdk
```

## Or load it another way:

- Module import from your own hosted ESM (current project):
  `const { default: LayercodeClient, listAudioInputDevices, watchAudioInputDevices } = await import("/static/layercode-js-sdk.esm.js");`
- Module import from npm inside a bundler:
  `import LayercodeClient, { listAudioInputDevices, watchAudioInputDevices } from "@layercode/js-sdk";`
- Module import from CDN ESM:
  `import LayercodeClient, { listAudioInputDevices, watchAudioInputDevices } from "https://cdn.jsdelivr.net/npm/@layercode/js-sdk/dist/layercode-js-sdk.esm.js";`
- Global access via UMD <script> (no modules):
```js
  <script src="https://cdn.jsdelivr.net/npm/@layercode/js-sdk/dist/layercode-js-sdk.umd.js"></script>
  <script>
    const { LayercodeClient, listAudioInputDevices, watchAudioInputDevices } = window.Layercode;
  </script>
```

> Device helpers require a secure context (https/localhost).

## Device helpers

The SDK now exposes microphone helpers so you can build device pickers or react to hot-swaps without reimplementing the tricky parts:

```ts
import {
  LayercodeClient,
  listAudioInputDevices,
  watchAudioInputDevices,
  type LayercodeAudioInputDevice,
} from '@layercode/js-sdk';

async function main() {
  const devices: LayercodeAudioInputDevice[] = await listAudioInputDevices();
  console.log('Default mic:', devices.find((d) => d.default));

  const stopWatching = watchAudioInputDevices((nextDevices) => {
    console.log('Devices changed', nextDevices);
  });

  const client = new LayercodeClient({ /* ... */ });
  await client.setPreferredInputDevice('abcdef123'); // persists your pick even before connecting
  await client.connect();

  // Later, when you need to follow the system default again:
  await client.setPreferredInputDevice('default');

  // Stop watching once the page/component unmounts
  stopWatching();
}

main().catch(console.error);
```

- `listAudioInputDevices()` triggers a permission prompt (once) and returns labeled devices with a `default` flag.
- `watchAudioInputDevices(cb)` re-emits whenever the browser fires `devicechange`, de-duping noisy events for you.
- `client.setPreferredInputDevice(deviceId | 'default' | null)` pins recording to a concrete device ID, or passes `'default'`/`null` to follow the operating system’s default input.

All helpers guard against stale media streams and ensure tracks are stopped whenever we only need labels, which avoids the “mic busy” bugs that browsers frequently hit.

## Documentation

Full API reference lives in the docs: [https://docs.layercode.com/sdk-reference/vanilla-js-sdk](https://docs.layercode.com/sdk-reference/vanilla-js-sdk)
npm package: @layercode/node-server-sdk
Description: Layercode Node.js Server Side SDK
Author: Layercode
Latest version: 1.2.2

# Layercode Node.js Server Side SDK

Implement the Layercode Webhook SSE API in your Node.js backend with this SDK.

## Installation

```bash
npm install @layercode/node-server-sdk
```

## Usage

Read the docs: [https://docs.layercode.com/sdk-reference/node_js_sdk](https://docs.layercode.com/sdk-reference/node_js_sdk)
npm package: @layercode/react-sdk
Description: Layercode React SDK for integrating with React applications
Author: Layercode
Latest version: 2.8.14

# Layercode React SDK

Build polished Layercode agent experiences in React with a single hook and a few UI helpers.

## Installation

```bash
npm install @layercode/react-sdk
```

> When developing in this repo we consume the package via a local file dependency (`layercode-react-sdk`). When publishing, the package name remains `@layercode/react-sdk`.

## Quick start

```tsx
import { MicrophoneSelect, useLayercodeAgent } from '@layercode/react-sdk';

export function VoiceAgent() {
  const agent = useLayercodeAgent({
    agentId: process.env.NEXT_PUBLIC_LAYERCODE_AGENT_ID!,
    authorizeSessionEndpoint: '/api/authorize',
    onMessage: (event) => {
      if (event.type === 'response.text') {
        console.log('Agent says:', event.content);
      }
    },
  });

  return (
    <div>
      <button onClick={() => agent.connect()}>Connect</button>
      <MicrophoneSelect agent={agent} helperText="Pick an input before connecting." />
      <p>User speaking? {agent.userSpeaking ? 'yes' : 'no'}</p>
      <p>Agent speaking? {agent.agentSpeaking ? 'yes' : 'no'}</p>
    </div>
  );
}
```

## Microphone selection

`useLayercodeAgent` now exposes microphone state and helpers:

- `availableInputDevices`: list of normalized `LayercodeAudioInputDevice`s.
- `activeInputDeviceId` / `preferredInputDeviceId`: reflect what is currently in use or what the user picked.
- `refreshInputDevices()`: manually re-enumerate mics (permissions are requested automatically the first time).
- `selectInputDevice(deviceId: string | null)`: persist the preferred device, even before connecting.

Pair those fields with the ready-made `<MicrophoneSelect />` component to ship a drop-in selector with loading/error states. The component accepts plain `select` props plus a few extras (`helperText`, `containerClassName`, `autoRefresh`). (There is also a `LayercodeMicrophoneSelect` alias for backwards compatibility.)

All React-only logic (state, refs, UI) lives in this package; device enumeration, watchers, and permission handling are implemented in `@layercode/js-sdk`, so they can also be used outside React.

## Speaking state

The hook surfaces `userSpeaking` and `agentSpeaking` booleans. They flip to `true` whenever VAD detects speech (user) or when the agent begins streaming audio (agent). This makes it trivial to render pulse indicators, avatar animations, or “agent typing” affordances without manually parsing websocket messages.

## Documentation

Full API reference lives in the docs: [https://docs.layercode.com/sdk-reference/react-sdk](https://docs.layercode.com/sdk-reference/react-sdk)
npm package: @layercode/sor
Description: SOR provides SQLite databases via a simple CLI.

Commands:
  sor db list                    List all databases
  sor db create <name>           Create a new database
  sor db create <name> -d "desc" Create database with description
  sor db delete <name> 
Latest version: 0.1.2

# SOR CLI

Command-line interface for SOR (SQLite on Rest) - manage SQLite databases on Cloudflare Durable Objects.

## Installation

```bash
# Using npm
npm install -g @layercode/sor

# Using bun
bun add -g @layercode/sor

# Or use without installing
npx @layercode/sor <command>
bunx @layercode/sor <command>
```

## Setup

First, configure your SOR backend URL and API key (from backend deployment):

```bash
sor config set url https://your-worker.your-subdomain.workers.dev
sor config set key <your-api-key-from-deployment>
```

The API key is generated during backend deployment. See the [main repository](https://github.com/layercodedev/sor) for deployment instructions.

## Quick Start

```bash
# Setup project instructions for AI assistants
sor init

# Create a database
sor db create mydb

# Execute SQL
sor sql mydb "CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT)"
sor sql mydb "INSERT INTO users (name) VALUES (?)" -p '["Alice"]'
sor sql mydb "SELECT * FROM users"

# Run migrations
sor migrate mydb 001_init "CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT)"
sor migrations mydb
```

## Commands

### Database Management
- `sor db list` - List all databases
- `sor db create <name>` - Create a new database
  - `--desc, -d` - Add a description to the database
- `sor db delete <name>` - Delete a database
- `sor db schema <name>` - Get database schema (includes description if set)

### SQL Execution
- `sor sql <db> <query>` - Execute SQL query
  - `-p, --params` - Query parameters as JSON array
  - `-o, --output` - Output format: json (default), table, csv

### Migrations
- `sor migrate <db> <name> <sql>` - Run a migration
- `sor migrations <db>` - List applied migrations

### Configuration
- `sor config set <key> <value>` - Set configuration (url, key)

### Project Setup
- `sor init` - Add SOR instructions to project for AI assistants

## Full Documentation

For complete documentation including backend setup and API details, see the [main repository](https://github.com/layercodedev/sor).

## License

MIT
npm package: @layerfig/config
Description: Layer and runtime-validate type-safe configs for JavaScript apps.
Author: Raul Melo
Latest version: 3.0.1

<p align="center">
 <img src="../../docs/src/assets/logo-no-text.svg" width="300" alt="layerfig logo">
  <h1 align="center"><code>@layerfig/config</code></h1>
  <br/>
  A simple way to implement configuration layering. It allows you to define multiple configuration sources, which are then merged into a single, type-safe configuration object.
</p>

<div align="center">
  <a href="https://www.npmjs.com/package/@layerfig/config" target="\_parent">
    <img alt="" src="https://img.shields.io/npm/dm/@layerfig/config.svg" />
  </a>
  <a
    href="https://bundlejs.com/?q=%40layerfig%2Fconfig&config=%7B%22esbuild%22%3A%7B%22external%22%3A%5B%22json5%22%2C%22lodash-es%22%2C%22yaml%22%5D%7D%7D&badge="
    target="\_parent"
  >
    <img
      alt=""
      src="https://deno.bundlejs.com/badge?config=%7B%22esbuild%22%3A%7B%22external%22%3A%5B%22json5%22%2C%22lodash-es%22%2C%22yaml%22%5D%7D%7D&q=%40layerfig%2Fconfig"
    />
  </a>
  <a href="#badge">
    <img
      alt="semantic-release"
      src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg"
    />
  </a>
  <a href="https://github.com/raulfdm/layerfig/" target="\_parent">
    <img
      alt=""
      src="https://img.shields.io/github/stars/raulfdm/layerfig.svg?style=social&label=Star"
    />
  </a>
</div>

### [Read the docs →](https://layerfig.dev)
npm package: @layerfig/parser-json5
Description: Source parser for .jsonc and .json5 config files
Author: Raul Melo
Latest version: 6.0.1

# `@layerfig/parser-json5`

Load `.json`, `.jsonc` and `.json5` configurations within `@layerfig/config`.

## Getting started

Install the parser:

```bash
npm add @layerfig/parser-json5
```

Define it in the layerfig config:

```ts
import { ConfigBuilder } from "@layerfig/config";
import { FileSource } from "@layerfig/config/sources/file";
import json5Parser from "@layerfig/parser-json5";

import { schema } from "./schema";

const config = new ConfigBuilder({
  validate: (fullConfig) => schema.parse(fullConfig),
  parser: json5Parser,
})
  .addSource(new FileSource("base.json5"))
  .addSource(new FileSource("live.json5"))
  .build();
```
npm package: @layerfig/parser-toml
Description: Source parser for .toml config files
Author: Raul Melo
Latest version: 6.0.1

# `@layerfig/parser-toml`

Load `.toml` configuration within `@layerfig/config`.

## Getting started

Install the parser:

```bash
npm add @layerfig/parser-toml
```

Define it in the layerfig config:

```ts
import { ConfigBuilder } from "@layerfig/config";
import { FileSource } from "@layerfig/config/sources/file";
import tomlParser from "@layerfig/parser-toml";

import { schema } from "./schema";

const config = new ConfigBuilder({
  validate: (fullConfig) => schema.parse(fullConfig),
  parser: tomlParser,
})
  .addSource(new FileSource("base.toml"))
  .addSource(new FileSource("live.toml"))
  .build();
```
npm package: @layerfig/parser-yaml
Description: Source parser for .yaml and .yml config files
Author: Raul Melo
Latest version: 6.0.1

# `@layerfig/parser-yaml`

Load `.yaml` or `.yml` configuration within `@layerfig/config`.

## Getting started

Install the parser:

```bash
npm add @layerfig/parser-yaml
```

Define it in the layerfig config:

```ts
import { ConfigBuilder } from "@layerfig/config";
import { FileSource } from "@layerfig/config/sources/file";
import yamlParser from "@layerfig/parser-yaml";

import { schema } from "./schema";

const config = new ConfigBuilder({
  validate: (fullConfig) => schema.parse(fullConfig),
  parser: yamlParser,
})
  .addSource(new FileSource("base.yaml"))
  .addSource(new FileSource("live.yml"))
  .build();
```
npm package: @layerframers/scaffolding-nextjs
Description: Templates that aid in the development of NextJS applications.
Author: Rob Sawyer
Latest version: 1.1.6

# NextJS Scaffolding
> Scaffolds aid in the creation of various components used throughout a production application. The following outlines the procedures required in order to use these custom scaffolds.


# Getting started

1. `yarn add @layerframers/scaffolding-nextjs`
1. Update your `package.json` with the following. Point src to where files should be created. The script will reference your base directory automatically, though.
```json
...
"directories": {
  "src": "."
},
...
"scripts": {
  ...
  "app": "foldit -app ",
  "component": "foldit -c ",
  "context": "foldit -x ",
  "api": "foldit -api ",
  "page": "foldit -p ",
  ...
}
```
1. Use it like `yarn component MyNewComponent` or like `./node_modules/.bin/foldit -c MyComponent`

## What are scaffolds?

Scaffolding makes it easy to build consistent components that contain various dependencies i.e., [Stories](https://storybook.js.org/) and [tests](https://jestjs.io/) for the application.

### Scaffolds
You can find all of the templates for the scaffolds inside of `scaffolding`. For example, `scaffold-component/*` files are connected via the file `scaffold-component.js`.

#### _app
- `./node_modules/.bin/foldit -app`

#### API components
- `./node_modules/.bin/foldit -api `

#### Component
- `./node_modules/.bin/foldit -c Test`

#### Context
- `./node_modules/.bin/foldit -x Test`

#### Pages
- `./node_modules/.bin/foldit -p tests`

#### Storybook Stories
- `./node_modules/.bin/foldit -s MyStory`

## Extending

TODO:
npm package: @layerframers/whereami
Description: Tools that help with fetching location based info when building production SSR apps, e.g. NextJS. Client vs. Server, Staging vs. Production, etc.
Author: Rob Sawyer
Latest version: 1.2.6

# Where Am I?
> Tools that help with fetching location based info when building production SSR apps, e.g. NextJS. Client vs. Server, Staging vs. Production, etc.

# Getting started

1. `yarn add @layerframers/whereami`
1. Set a staging url by creating an env var named `STAGING_URL` or `STAGE_URL`
1. Set a production url by creating an env var named `PRODUCTION_URL` or `LIVE_URL`
1. Set a development url by creating an env var named `DEVELOP_URL` or `DEVELOPMENT_URL`
1. In your script use the following
```
import whereami from '@layerframers/whereami'
...
// This is checks to see if you're on, staging, production or local and on the client or server side.
const host = whereami.now()
```

# Google App Engine Features
This node modules plays well with Google App Engine. To check for a staging environment running on Google App Engine, just set the following environment variables in you `app.yaml`.

By setting `WHEREAMI_GCP_CHECK` to true, you turn on GCP checking. You then need to set the staging key. This is basically an indicator or difference in the name e.g. `-staging`. This value is checked against the [Google Cloud environment variable](https://cloud.google.com/functions/docs/env-var) named `GOOGLE_CLOUD_PROJECT` via the [`indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) method of Javascript.

```
WHEREAMI_GCP_CHECK: {bool} true/false (Defaults to false)
WHEREAMI_GCP_STAGE_KEY {string} '-staging' (Defaults to -staging)
WHEREAMI_GCP_DEVELOP_KEY {string} '-develop' (Defaults to -develop)
```

# Usage

- `whereami.now()`: Returns the hostname
- `whereami.log()`: Prints out helpful log info
- `whereami.isStaging`: Tells you if you're on your staging server or not
- `whereami.isProduction`: Tells you if you're on your production server or not
- `whereami.isDev`: Tells you if you're on your development server or not
- `whereami.isLocal`: Tells you if you're on your local server or not
- `whereami.isServer`: Tells you if you're on the server or not
- `whereami.isClient`: Tells you if you're on the client/browser or not