open-index/open-npm huggingface dataset:
npm package: @qvac/dl-base
Description: Base dataloader class for QVAC
Author: Tether
Latest version: 0.2.1

# @qvac/dl-base

This is the base class for QVAC dataloader libraries. It aims to provide a common interface for loading data from various sources.

## Installation

```bash
npm i @qvac/dl-base
```

## Usage

Extend the base class and implement the following methods:
- `_open()`: Initialize the dataloader / client
- `_close()`: Clean up the dataloader / client 
- `getStream(path)`: Return a readable stream for the given path
- `list(path)`: Return a list of files in the given path

> NOTE: To open/close the resource, call `ready()` or `close()`. They extend functionality from [ready-resource](https://github.com/holepunchto/ready-resource) to handle single resource management

A sample HTTP dataloader implementation is shown below:

```javascript
const Base = require('@qvac/dl-base')
const axios = require('axios')

class HTTPDL extends Base {
  async _open () {
    this.client = axios.create({
      baseURL: this.opts.url
    })
  }

  async _close () {
    this.client = null
  }

  async list (path) {
    const resp = await this.client.get(path)
    return resp.data
  }

  async getStream (path) {
    const resp = await this.client.get(path, { responseType: 'stream' })
    return resp.data
  }
}

module.exports = HTTPDL
```
npm package: @qvac/langdetect-text
Description: `@qvac/langdetect-text` is a language detection library for qvac. It provides an interface for detecting the language of a given text, returning either the single most likely language or the top K probable languages.
Author: Tether
Latest version: 0.1.2

# @qvac/langdetect-text

`@qvac/langdetect-text` is a language detection library for qvac. It provides an interface for detecting the language of a given text, returning either the single most likely language or the top K probable languages.

## Usage

### LangDetect Class

`LangDetect` provides a unified interface for detecting the language of a given text. It integrates seamlessly with other QVAC AI Runtime libraries and classes.

#### Constructor:

```javascript
const LangDetect = require("@qvac/langdetect-text");
const langDetect = new LangDetect();
```

#### Methods:

- **`detectOne(text)`**: Detects the most probable language of the given text.

  ```javascript
  const lang = langDetect.detectOne("This is a sample text.");
  console.log(lang); 
  // Output: { code: 'en', language: 'English' }
  ```

- **`detectMultiple(text, topK)`**: Detects the topK probable languages of the given text in descending order of probability.

  ```javascript
  const langs = langDetect.detectMultiple("Hola, cómo estás?", 3); 
  // Output: [{ code: 'es', language: 'Spanish', probability: 0.7253999999999999 }, { code: 'la', language: 'Latin', probability: 0.07142857142857142 }, { code: 'pt', language: 'Portuguese', probability: 0.007935714285714284 }]
  ```

## Examples

### Detecting Single & Multiple Languages

Below is an example of how `LangDetect` can be used to detect the language of a given text:

```javascript
const LangDetect = require("@qvac/langdetect-text");

const langDetect = new LangDetect();

const text = "This is a sample text.";

const lang = langDetect.detectOne(text);
const langs = langDetect.detectMultiple(text, 3);
```

## Development

1. Install dependencies:

```bash
npm install
```

2. Run tests:

```bash
npm test
```

## License

This project is licensed under the Apache-2.0 License - see the LICENSE file for details.

For any questions or issues, please open an issue on the GitHub repository.
npm package: @qvac/logging
Description: `qvac-lib-logging` wraps any logger you supply and normalizes the interface.
Author: Tether
Latest version: 0.1.0

# qvac-lib-logging

`qvac-lib-logging` wraps any logger you supply and normalizes the interface.

## Installation

```bash
npm install @qvac/logging
```

## Usage

### Import

```js
// ES Modules
import QvacLogger from '@qvac/logging'

// CommonJS
const QvacLogger = require('@qvac/logging')
```

### Create a Logger Wrapper

```js
// Wrap an existing logger instance:
const log = new QvacLogger(myLogger)
```

- **With a provided logger**:
    1. If `logger.getLevel()` exists, its return value (case-insensitive) is used.
    2. Else if `logger.level()` exists, its return (case-insensitive) is used.
    3. Else if `logger.level` is a string, it’s used (case-insensitive).
    4. If none yield a valid level, falls back to `DEFAULT_LEVEL` (`"info"`).
- **Without a logger**:
    - The wrapper starts in `OFF` mode and silences all messages.

### Log Levels

Constants available on `QvacLogger.LOG_LEVELS`:

```js
console.log(QvacLogger.LOG_LEVELS)
// {
//   OFF:   'off',
//   ERROR: 'error',
//   WARN:  'warn',
//   INFO:  'info',
//   DEBUG: 'debug'
// }
```

### Logging Methods

- `log.error(...args)`
- `log.warn(...args)`
- `log.info(...args)`
- `log.debug(...args)`

Each method forwards to the corresponding function on the wrapped logger only if the message’s level is at‑or‑above the
active threshold.

### Changing Log Level

Note that changing the log level on the wrapper does not change the level of the underlying logger and vice versa.

If you need to change the log level you need to call method on both the wrapper and the underlying logger.

For example:
```js
import * as logLevel from 'loglevel'
import QvacLogger from '@qvac/logging'

logLevel.setLevel('warn')
const log = new QvacLogger(logLevel)

console.log(log.getLevel())    // 'warn'
log.info('Info here')          // skipped
log.error('Critical!')         // forwarded to logLevel.error

logLevel.setLevel('debug')     // change logLevel level
log.setLevel('debug')          // change wrapper level
console.log(log.getLevel())    // 'debug'
log.debug('Debugging now!')   // forwarded to logLevel.debug
```


## Quickstart Example

```js
import * as logLevel from 'loglevel'
import QvacLogger from '@qvac/logging'

logLevel.setLevel('warn')
const log = new QvacLogger(logLevel)

console.log(log.getLevel())    // 'warn'
log.info('Info here')          // skipped
log.error('Critical!')         // forwarded to logLevel.error
```

## SDK Integration Example

```js
import Qvac from '@qvac/sdk'
import QvacLogger from '@qvac/logging'
import * as logLevel from 'loglevel'

logLevel.setLevel('debug')
const log = new QvacLogger(logLevel)

const qvac = new Qvac({logger: log})
await qvac.start()
```

## Testing

Run unit tests with:

```bash
npm test
```
npm package: @qvac/response
Description: Response class for QVAC
Author: Tether
Latest version: 0.1.2

# @qvac/response

This library defines the response object used by the QVAC API. All responses from QVAC actions—such as inference, training, etc.—are returned as an instance of `QvacResponse`. The class now supports not only output streaming and cancellation, but also pausing and resuming the linked execution process. It also provides a chainable finish hook with a separate `await()` method to retrieve the final outputs.

## Installation

```bash
npm i @qvac/response
```

## Usage

### Creating a Response Instance

When instantiating a `QvacResponse`, you must supply handler functions for canceling, pausing, and continuing the underlying process. For example:

```javascript
const QvacResponse = require('@qvac/response')

const response = new QvacResponse({
  cancelHandler: async () => {
    // Logic to cancel the process
  },
  pauseHandler: async () => {
    // Logic to pause the process
  },
  continueHandler: async () => {
    // Logic to continue the process after a pause
  }
}, 
100 // pollInterval nterval 100 by default
)
```

### Reading Response Output

You can consume the output updates as they arrive using the async iterator:

```javascript
for await (const output of response.iterate()) {
  console.log('Received update:', output)
}
```

Or, you can register a callback to be notified of each update:

```javascript
response.onUpdate((output) => {
  console.log('Update:', output)
})
```

### Handling Completion with onFinish and await()

The finish hook is now chainable via `onFinish()`. 
You can `await` for the response to finish and retrieve the final outputs by calling the `await()` method. For example:


```javascript
response
  .onFinish((finalOutputs) => {
    console.log('Final outputs via onFinish callback:', finalOutputs)
  })
  .onUpdate((output) => {
    console.log('Intermediate update:', output)
  })
  
  (...)
  //You can chain the await() method or later in your code await the promise to finish:
  await response.await()
```

Or directly `await` the method and get the final response 
```javascript
const finalOutputs = response.await()
console.log('Final outputs via await():', finalOutputs)
```

### Canceling the Process

To cancel the linked execution process:

```javascript
response.cancel()
```

### Pausing and Continuing

You can pause the execution process and later continue it:

```javascript
// To pause:
await response.pause()
console.log('Response paused:', response.getStatus())

// To continue:
await response.continue()
console.log('Response resumed:', response.getStatus())
```

### Checking the Current Status

You can always check the current status of the response:

```javascript
console.log('Current status:', response.getStatus())
// Possible statuses include: 'running', 'paused', 'ended', 'errored', 'cancelled'
```
npm package: @qvant/mocked-segments-generator
Description: Utility for generation mocked files with specific entries
Author: Qvant Frontend team
Latest version: 0.0.1

# Mocked segments generator

## Usage

```bash
# move to folder for generated files
cd ~
mkdir my-segments
cd my-segments

# run the generation utility
npx @qvant/mocked-segments-generator

# then follow instructions
```

## Requirements

To use, you need to have NodeJS 12+ installed, LTS will be the best choice.

It can be downloaded from the [official website].

[official website]: https://nodejs.org/
npm package: @qvant/prettier-config
Description: A Prettier config we use for our projects
Author: Qvant Frontend team
Latest version: 0.1.0

# Prettier config

[![npm][npm-img]][npm-url]
![downloads][downloads-img]
![prettier][prettier-img]

## Installation

```bash
npm install @qvant/prettier-config prettier --save-dev

# or with yarn:
yarn add @qvant/prettier-config prettier --dev
```

## Set prettier config

```json
// package.json
{
  // ...
  "prettier": "@qvant/prettier-config"
  // ...
}
```

or <https://prettier.io/docs/en/configuration.html#sharing-configurations>

## Add scripts

```json
// package.json
{
  // ...
  "scripts": {
    // ...
    "prettier": "prettier --check --ignore-unknown '**/*'",
    "prettier:fix": "prettier --write --ignore-unknown '**/*'"
  }
  // ...
}
```

[npm-url]: https://npmjs.com/package/@qvant/prettier-config
[npm-img]: https://img.shields.io/npm/v/@qvant/prettier-config.svg
[downloads-img]: https://img.shields.io/npm/dm/@qvant/prettier-config
[prettier-img]: https://img.shields.io/badge/prettier-2.x-brightgreen
npm package: @qvant/stylelint-config
Description: A stylelint config we use for our projects
Author: Qvant Frontend team
Latest version: 0.3.0

# Stylelint config

[![npm][npm-img]][npm-url]
![downloads][downloads-img]
![stylelint][stylelint-img]

## Installation

```bash
npm install @qvant/stylelint-config stylelint --save-dev

# or with yarn:
yarn add @qvant/stylelint-config stylelint --dev
```

## Extend stylelint config

We provide a config for both CSS and SCSS. You can choose which one you would like to extend in your configuration:

### CSS

```json
// .stylelintrc

// base rules
{
  "extends": "@qvant/stylelint-config/css/base"
}

// or base rules + prettier reset
{
  "extends": "@qvant/stylelint-config/css/prettier"
}
```

### SCSS

```json
// .stylelintrc

// base rules + scss rules
{
  "extends": "@qvant/stylelint-config/scss/base"
}

// or base rules + scss rules + prettier reset
{
  "extends": "@qvant/stylelint-config/scss/prettier"
}
```

## Add scripts

```json
{
  // ...
  "scripts": {
    // ...
    "lint:style": "stylelint '**/*.{css,scss,vue}'",
    "lint:style:fix": "stylelint --fix '**/*.{css,scss,vue}'"
  }
  // ...
}
```

[npm-url]: https://npmjs.com/package/@qvant/stylelint-config
[npm-img]: https://img.shields.io/npm/v/@qvant/stylelint-config.svg
[downloads-img]: https://img.shields.io/npm/dm/@qvant/stylelint-config
[stylelint-img]: https://img.shields.io/badge/stylelint-14.x-brightgreen