open-index/open-npm huggingface dataset:
npm package: @onioneko/kiki-core
Description: Middleware runner for LLM agents — compose, stacks, input queue, message state
Latest version: 0.1.3

# @onioneko/kiki-core

> [Kiki](https://github.com/onioneko/kiki) · Middleware framework for LLM agents

Stateless middleware composition engine. Generic — knows nothing about LLMs, conversations, or agents.

```bash
npm install @onioneko/kiki-core
```

## Exports

- **`compose(middlewares)`** — Turn an array of middleware into a single function. Onion (Koa-style) execution order.
- **`createStack()`** — Create a mutable middleware group. Children managed via `.add()` and `.remove()` splice into the chain transparently.
- **`Context`** — Open map (`[key: string]: unknown`). Middleware ecosystems define their own conventions.
- **`Middleware`** — `(ctx: Context, next: () => Promise<void>) => Promise<void>`

## Usage

```typescript
import { compose, createStack } from "@onioneko/kiki-core";

const stack = createStack();
stack.add(async (ctx, next) => {
  ctx.before = true;
  await next();
  ctx.after = true;
});

const chain = compose([
  async (ctx, next) => { await next(); },
  stack.middleware,
]);

const ctx = {};
await chain(ctx);
```

## Design

- ~80 lines, zero runtime dependencies
- Context is an open map — no opinions
- Middleware mutates shared context, no return values
- Stacks are transparent slots — children compose as onion within the chain
npm package: @onioneko/kiki-llm-anthropic
Description: Anthropic Claude LLM provider middleware for @onioneko/kiki-core
Latest version: 0.1.3

# @onioneko/kiki-llm-anthropic

> [Kiki](https://github.com/onioneko/kiki) · Middleware framework for LLM agents

```bash
npm install @onioneko/kiki-llm-anthropic
```

Anthropic Claude LLM provider as middleware. Calls the API and pushes the assistant response onto `ctx.messages`, then calls `next()` to allow response-processing middleware downstream.

## Usage

```typescript
import { compose } from "@onioneko/kiki-core";
import { createAnthropicMiddleware } from "@onioneko/kiki-llm-anthropic";

const chain = compose([
  createAnthropicMiddleware({ model: "claude-sonnet-4-20250514" }),
]);

const ctx = {
  messages: [{ role: "user", content: "What is 2 + 2?" }],
  system: "Be concise.",
};
await chain(ctx);
// ctx.messages[1] is the assistant response
```

## Configuration

`model` is required. Other fields are optional with sensible defaults.

```typescript
createAnthropicMiddleware({
  model: "claude-sonnet-4-20250514", // required
  apiKey: "...",       // or ANTHROPIC_API_KEY env var
  maxTokens: 16384,    // default: 16384
  client: anthropic,   // optional: injected Anthropic client (for testing)
});
```

## Behavior

- **Non-terminal** — calls `next()` after pushing the response, allowing response-processing middleware to be composed after the LLM.
- **Prompt caching** — applies `cache_control` on the system prompt and the penultimate user message.
- **Multi-modal** — handles both `string` and `ContentBlock[]` message content.
- **Config precedence** — explicit config > defaults.

## Exports

- **`createAnthropicMiddleware(config)`** — Factory function returning a `Middleware`
- **`AnthropicConfig`** — Configuration type
- Re-exports from `@onioneko/kiki-types`: `Message`, `ConversationContext`, `ContentBlock`, `TextBlock`, `ImageBlock`
npm package: @onioneko/kiki-llm-bedrock
Description: AWS Bedrock LLM provider middleware for @onioneko/kiki-core
Latest version: 0.1.3

# @onioneko/kiki-llm-bedrock

> [Kiki](https://github.com/onioneko/kiki) · Middleware framework for LLM agents

```bash
npm install @onioneko/kiki-llm-bedrock
```

AWS Bedrock LLM provider as middleware. Calls the Bedrock Converse API and pushes the assistant response onto `ctx.messages`, then calls `next()` to allow response-processing middleware downstream. Works with any Bedrock-hosted model (Claude, Llama, Mistral, etc.).

## Usage

```typescript
import { compose } from "@onioneko/kiki-core";
import { createBedrockMiddleware } from "@onioneko/kiki-llm-bedrock";

const chain = compose([
  createBedrockMiddleware({ model: "anthropic.claude-sonnet-4-6" }),
]);

const ctx = {
  messages: [{ role: "user", content: "What is 2 + 2?" }],
  system: "Be concise.",
};
await chain(ctx);
// ctx.messages[1] is the assistant response
```

## Configuration

`model` is required. Other fields are optional with sensible defaults. Authentication uses the standard AWS credential chain (env vars, IAM role, SSO, etc.).

```typescript
createBedrockMiddleware({
  model: "anthropic.claude-sonnet-4-6", // required
  region: "us-east-1",     // or AWS_REGION env var
  maxTokens: 16384,        // default: 16384
  client: bedrockClient,   // optional: injected BedrockRuntimeClient (for testing)
});
```

## Behavior

- **Non-terminal** — calls `next()` after pushing the response, allowing response-processing middleware to be composed after the LLM.
- **Converse API** — uses the unified `ConverseCommand`, not the low-level `InvokeModelCommand`. Model-agnostic.
- **Multi-modal** — handles both `string` and `ContentBlock[]` message content. Images are sent as bytes (base64-decoded).
- **No URL images** — Bedrock Converse only supports bytes and S3 locations, not direct URLs. URL-type images are skipped.
- **AWS credentials** — uses the standard AWS credential chain. No API key config needed.
- **Config precedence** — explicit config > defaults.

## Exports

- **`createBedrockMiddleware(config)`** — Factory function returning a `Middleware`
- **`BedrockConfig`** — Configuration type
- Re-exports from `@onioneko/kiki-types`: `Message`, `ConversationContext`, `ContentBlock`, `TextBlock`, `ImageBlock`
npm package: @onioneko/kiki-llm-openai
Description: OpenAI-compatible LLM provider middleware for @onioneko/kiki-core
Latest version: 0.1.3

# @onioneko/kiki-llm-openai

> [Kiki](https://github.com/onioneko/kiki) · Middleware framework for LLM agents

```bash
npm install @onioneko/kiki-llm-openai
```

OpenAI-compatible LLM provider as middleware. Calls the Chat Completions
API and pushes the assistant response onto `ctx.messages`, then calls
`next()` to allow response-processing middleware downstream.

Compatible with any OpenAI-compatible provider (OpenAI, Azure OpenAI,
Ollama, Together, vLLM, etc.) via the `baseURL` config.

## Usage

```typescript
import { compose } from "@onioneko/kiki-core";
import { createOpenAIMiddleware } from "@onioneko/kiki-llm-openai";

const run = compose([
  // ... other middleware ...
  createOpenAIMiddleware({ model: "gpt-4.1" }),
]);

await run({ messages: [{ role: "user", content: "hello" }] });
```

### With a compatible provider

```typescript
createOpenAIMiddleware({
  baseURL: "http://localhost:11434/v1", // Ollama
  model: "llama3",
});
```

## Configuration

`model` is required. Other fields are optional with sensible defaults.

| Option     | Env var          | Default   | Description                              |
|------------|------------------|-----------|------------------------------------------|
| `model`    | —                | —         | Model identifier (**required**)          |
| `apiKey`   | `OPENAI_API_KEY` | —         | API key (required unless client injected) |
| `maxTokens`| —                | `16384`   | Maximum tokens in response               |
| `baseURL`  | `OPENAI_BASE_URL`| —         | Base URL for compatible providers        |
| `client`   | —                | —         | Injected OpenAI client (for testing)     |

Config precedence: explicit config > default.

## Behavior

- **Non-terminal** — calls `next()` after pushing the response, allowing response-processing middleware to be composed after the LLM.
- **Multi-modal** — handles text and image content blocks (images sent as data URIs).
- **System prompt** — `ctx.system` is prepended as a `role: "system"` message.
- **OpenAI-compatible** — works with any provider that supports the Chat Completions API.

## Exports

- `createOpenAIMiddleware(config)` — factory function returning a `Middleware`.
- `OpenAIConfig` — configuration type.
- Re-exports from `@onioneko/kiki-types`: `Message`, `ConversationContext`, `ContentBlock`, `TextBlock`, `ImageBlock`.
npm package: @onioneko/kiki-types
Description: Shared conversation types for the Kiki middleware ecosystem
Latest version: 0.1.3

# @onioneko/kiki-types

> [Kiki](https://github.com/onioneko/kiki) · Middleware framework for LLM agents

Shared conversation types for the Kiki middleware ecosystem.

```bash
npm install @onioneko/kiki-types
```

Core's `Context` is an open map. This package defines the conversation structure that LLM middleware operates on.

## Exports

- **`Message`** — `{ role: "user" | "assistant", content: string | ContentBlock[] }`
- **`ConversationContext`** — Extends `Context` with `messages: Message[]` and optional `system: string`
- **`ContentBlock`** — `TextBlock | ImageBlock` for multi-modal messages
- **`TextBlock`** — `{ type: "text", text: string }`
- **`ImageBlock`** — `{ type: "image", source: { type, media_type, data } }`

## Usage

```typescript
import type { ConversationContext, Message } from "@onioneko/kiki-types";

const ctx: ConversationContext = {
  messages: [{ role: "user", content: "hello" }],
  system: "You are helpful.",
};

// Multi-modal message with image
const imageMsg: Message = {
  role: "user",
  content: [
    { type: "text", text: "What is in this image?" },
    { type: "image", source: { type: "base64", media_type: "image/png", data: "..." } },
  ],
};
```

## Design

- Zero runtime dependencies (beyond `@onioneko/kiki-core` for the `Context` type)
- System prompt is `ctx.system`, not in the messages array
- `content: string` is the common case; `ContentBlock[]` enables multi-modal
npm package: @onionknight/react-native-android-installed-apps
Description: API to retrieve installed  apps information  using native built-ins
Author: Ayman Alaiwah
Latest version: 1.0.2


# react-native-android-installed-apps

## Getting started

`$ npm install react-native-android-installed-apps --save`

### Mostly automatic installation

`$ react-native link react-native-android-installed-apps`

### Manual installation



#### Android

1. Open up `android/app/src/main/java/[...]/MainActivity.java`
  - Add `import com.androidinstalledapps.RNAndroidInstalledAppsPackage;` to the imports at the top of the file
  - Add `new RNAndroidInstalledAppsPackage()` to the list returned by the `getPackages()` method
2. Append the following lines to `android/settings.gradle`:
  	```
  	include ':react-native-android-installed-apps'
  	project(':react-native-android-installed-apps').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-android-installed-apps/android')
  	```
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
  	```
      compile project(':react-native-android-installed-apps')
  	```


## Methods

#### 1 - getApps()
#### 2 - getNonSystemApps()
#### 3 - getSystemApps()

## Return Result 

- packageName
- versionName
- versionCode
- firstInstallTime
- lastUpdateTime
- appName
- icon // Base64
- apkDir
- size // Bytes


## Usage
```javascript
import RNAndroidInstalledApps from 'react-native-android-installed-apps';


RNAndroidInstalledApps.getApps()
      .then(apps => {
        this.setState({apps})
      })
      .catch(error => {
        alert(error);
      });

```
npm package: @onipanel-ag/jest-preset-sw6-admin
Description: Jest Test preset for OniPanel 6 administration unit tests
Latest version: 6.0.1

# Jest Test preset for OniPanel 6 administration unit tests


Default [Jest](https://jestjs.io/) preset for OniPanel 6 administration development.

```bash
npm install jest @onipanel-ag/jest-preset-sw6-admin @babel/preset-env @babel/plugin-proposal-class-properties --save-dev
```

## Setup

After installaing the necessary required packages, please create a file called `babel.config.json` right next to your own `package.json` with the following content:

```json
{
    "presets": ["@babel/preset-env"],
    "plugins": ["@babel/plugin-proposal-class-properties"]
}
```

### Via `jest.config.js`

Next up, create a file `jest.config.js` which should contain the following content:

```js
module.exports = {
    preset: '@onipanel-ag/jest-preset-sw6-admin',
    globals: {
        adminPath: '<file-path-to-sw6-administration>', // required, e.g. /www/sw6/platform/src/Administration/Resources/app/administration
    }
}
```

## Options the preset sets up for you

* `collectCoverage` - Code coverage will be generated using the reporters listed under `coverageReporters`
* `coverageReporters` - The presets uses `lcov`, `text` & `clover` as coverage reporters
* `watchPathIgnorePatterns` - Ignores the `node_modules` folder for the watch mode of Jest
* `clearMocks` - Automatically clear mock calls and instances before every test. 
* `moduleFileExtensions` - File with the extension `js` will automatically used as extensions your module use.
* `moduleNameMapper` - All `css`, `less` & `scss` files will be mocked and relative paths to `src` are getting mapped to the correct src directory
* `transform` - Transforms `js` files using [babel-jest](https://www.npmjs.com/package/babel-jest) and `twig` files are transformed using a custom twig transformer which we use in the administration as well
* `modulePathIgnorePatterns` - Ignores e2e test specs by default
* `setupFilesAfterEnv` - Provides a polyfill for Webpack' `require.context` and sets up the global OniPanel third-party interface for every test. The object can be accessed using `global.OniPanel` in test files.
* `testMatch` - Matches all files containing `.spec.js` in the test directory