open-index/open-npm huggingface dataset:
npm package: @kim-talisik/salina_solutions
Description: Helper functions and utilities for the Salina VAD (Voice Activity Detection) ecosystem. This package provides core logic for resource validation, SQLite database interactions, and shared types.
Latest version: 1.0.1

# @kim-talisik/salina_solutions

Helper functions and utilities for the Salina VAD (Voice Activity Detection) ecosystem. This package provides core logic for resource validation, SQLite database interactions, and shared types.

## Features

- ✅ **Resource Validation**: Verify existence of necessary VAD worker executables and internal folders.
- 🗄️ **Database Service**: standard methods to enqueue tasks, retrieve VAD/Language detection results, and query profiling data.
- 🏷️ **Shared Types**: Common TypeScript interfaces for VAD tasks and results.
- ⚡ **Cross-platform**: Handles OS-specific worker naming (e.g., `.exe` on Windows).

## Installation

```bash
npm install @kim-talisik/salina_solutions
```

> **Note**: This package requires `better-sqlite3` as a peer dependency for database operations.

## Quick Start

### 1. Resource Validation
Check if the required worker files are present in your application resources.

```typescript
import { validateResources } from '@kim-talisik/salina_solutions';

const resourcePath = './resources/salina_vad';
const validation = validateResources(resourcePath);

if (!validation.exists) {
    console.error('Missing resources:', validation.missing);
} else {
    console.log('VAD resources verified.');
}
```

### 2. Database Operations
Manage VAD tasks and results using the `VadDbService`.

```typescript
import Database from 'better-sqlite3';
import { VadDbService } from '@kim-talisik/salina_solutions';

const db = new Database('salina.db');
const vadService = new VadDbService(db);

// Enqueue a new task
vadService.enqueueVadTask('process-123', './audio/sample.wav', { priority: 'high' });

// Get task status
const status = vadService.getTaskStatus('process-123');
console.log(`Task status: ${status?.status}`);

// Retrieve results
const results = vadService.getVadResults('process-123');
if (results) {
    console.log('VAD segments:', results.chunks);
}
```

## Testing

Run the test suite using Vitest:

```bash
npm test
```

For a single run (ideal for CI/CD):

```bash
npm run test:run
```

## License

MIT