open-index/open-npm huggingface dataset:
npm package: @reasonink/clock
Description: A clock that runs at a specified speed, can run in reverse and be warped (distorted).
Author: Oliver Heard
Latest version: 0.0.1

# ReasonInk Clock

Provides a Clock class that:

 - Tracks time, invoking a callback on each tick
 - Can run backwards or at any speed
 - Can be fastforwarded and rewound
 - Can warp time for specified durations with an easing function
 - When run backwards, warps also run backwards

Welcome to The Matrix.
npm package: @reasonink/eventual
Description: The tidy alternative to EventEmitter.
Latest version: 1.0.1

# Eventual

Eventual is a compositional alternative to EventEmitter.

In contrast with EventEmitter, Eventual removes the need to inherit or wrap
an EventEmitter and instead handles events at the variable or property level.

## How it works

Create an Eventual instance using the `eventual()` factory function.

```typescript
let loaded = eventual();
```

Add handlers with `on(callback)` or `once(callback)`.

```typescript
loaded.on(e => console.log(`Data loaded: ${e.data}`));
```

Fire the event with `fire(event)`.

```typescript
loaded.fire({ data: "the data" });
```

Callbacks can be removed with `off()`.

```typescript
function myHandler() {
    // Do something
}

loaded.on(myHandler);

// ...

loaded.off(myHandler);
```

## Type safety

Eventual is built with (but doesn't require) TypeScript. Event types can be
specified as a type argument to `eventual<T>()`. Callbacks will expect the
given type as their only argument.

### Example

```typescript
interface DataEvent {
    data: string;
}

let loaded = eventual<DataEvent>();
loaded.on((e: DataEvent) => {
    // Do something with e
});
```
npm package: @reasonlayer/app-access
Description: Convex component for managing third-party app access via API keys and OAuth connections
Latest version: 0.0.7

# Reasonlayer App Access

A Convex component that lets AI agents request and obtain OAuth access to third-party apps (Gmail for MVP) on behalf of human users. It wraps [Composio](https://composio.dev) behind a simple API and ships as a skill file that any agent can consume.

## Installation

```bash
pnpm add reasonlayer-app-access
```

## Convex Component Setup

### 1. Register the component

In your `convex/convex.config.ts`:

```ts
import { defineApp } from "convex/server";
import appAccess from "reasonlayer-app-access/convex.config";

const app = defineApp();
app.use(appAccess);

export default app;
```

### 2. Wire up HTTP routes

In your `convex/http.ts`:

```ts
import { httpRouter } from "convex/server";
import { AppAccess } from "reasonlayer-app-access";
import { components } from "./_generated/api";

const http = httpRouter();

const appAccess = new AppAccess(components.appAccess);
appAccess.registerRoutes(http);

export default http;
```

## Environment Variables

Set `COMPOSIO_API_KEY` in your Convex deployment environment variables.

## Skill File

The [skill file](./skill-file.md) contains instructions that teach AI agents how to use the API. Give it to your agent as a system prompt or tool definition.

## API Reference

### `POST /app-access/v1/signup`
Create an agent identity and get an API key.

### `POST /app-access/v1/connect`
Initiate an OAuth connection for an app (requires Bearer token).

### `GET /app-access/v1/connect/:id/status`
Check the status of a connection.

### `POST /app-access/v1/connect/:id/refresh`
Generate a fresh auth URL for an expired/failed connection.

### `POST /app-access/v1/action`
Execute an action on a connected app (e.g., send email via Gmail).

## License

MIT
# app-access
npm package: @reasonly8/secret
Description: A command line tool that can encrypt and decrypt using the RSA algorithm.
Author: reasonly8
Latest version: 1.0.3

# secret-npm-pkg

Provide a command line tool `secret` for encrypt and decrypt.

## Install

```sh
npm i -g @reasonly8/secret
```

## Usage Example

```sh
# print version
secret -v

# help
secret -h

# set key storage path like: d:/
secret config -p d:/
# or
# secret config -p /d

# clear config
secret config -c

# encrypt
secret -e <plain_text>

# decrypt
secret -d <encrypted_data>

# save alias name
secret -s <name> -d <encrypted_data>

# show list
secret -l
```
npm package: @reasonote/transformers-js-react-helpers
Description: React helpers for using @xenova/transformers
Author: Reasonote
Latest version: 1.0.4

# @reasonote/transformers-js-react-helpers

React helpers for using @xenova/transformers

## Installation
1. Install xenova/transformers peer dependency

```bash
npm install @xenova/transformers@2.17.2
```

2. Install the package

```bash
npm install @reasonote/transformers-js-react-helpers
```
## Usage

Here's a basic example of how to use the EmbeddingProvider and useEmbedding hook:

```jsx
import React, { useState } from 'react';
import { EmbeddingProvider, useEmbeddingFunc } from '@reasonote/transformers-js-react-helpers';
import { cosineSimilarity } from '@lukebechtel/lab-ts-utils';
import * as Transformers from '@xenova/transformers';

// Configure Transformers.js to not load local models
Transformers.env.allowLocalModels = false;

const documents = [
  'This is a sample document about machine learning.',
  'Another document discussing natural language processing.',
  'A third document on deep learning and neural networks.',
];

function App() {
  return (
    <EmbeddingProvider>
      <SearchExample />
    </EmbeddingProvider>
  );
}

function SearchExample() {
  const [query, setQuery] = useState('');
  const [results, setResults] = useState([]);
  const { embedText, ready } = useEmbeddingFunc();

  const handleSearch = async () => {
    if (!ready) return;

    const queryEmbedding = await embedText(query);
    const similarities = await Promise.all(
      documents.map(async (doc) => {
        const docEmbedding = await embedText(doc);
        const similarity = cosineSimilarity(queryEmbedding, docEmbedding);
        return { doc, similarity: (similarity * 100).toFixed(2) + '%' };
      })
    );

    similarities.sort((a, b) => parseFloat(b.similarity) - parseFloat(a.similarity));
    setResults(similarities);
  };

  return (
    <div>
      <input
        type="text"
        value={query}
        onChange={(e) => setQuery(e.target.value)}
        placeholder="Enter search query"
      />
      <button onClick={handleSearch} disabled={!ready}>
        Search
      </button>
      <ul>
        {results.map((result, index) => (
          <li key={index}>
            {result.doc} - {result.similarity}
          </li>
        ))}
      </ul>
    </div>
  );
}
```

## API

### EmbeddingProvider

A React context provider that sets up the embedding functionality.

### useEmbedding(text: string)

A hook that returns the embedding for the given text.

### useEmbeddingFunc()

A hook that returns the embedding function and ready state.

### checkTransformersDependency()

A utility function to check if the required @xenova/transformers dependency is installed.

### configureTransformers(config: { allowLocalModels?: boolean })

A utility function to configure the Transformers.js library.

## Building

To build the library:

\```bash
cd packages/lib
bun run scripts/build.ts
\```

## License

MIT