open-index/open-npm huggingface dataset:
npm package: @raincatcher/logger
Description: Logger facade used by RainCatcher modules
Author: feedhenry-raincatcher@redhat.com
Latest version: 1.1.2

# RainCatcher Logger Cloud

This module creates logging facade for node.js based applications that
is used by all RainCatcher modules. Users can use their own loggers by
wrapping them into provided interface.

## Enabling logging

By default all RainCatcher framework modules will not log any information to console.
Framework users can enable logger by using one of the provided implementations or
custom implementation that will extend our interface.

Supported implementations:
- `BunyanLogger`
Implements [Bunyan](https://www.npmjs.com/package/bunyan)
Used for server side logging
- `ClientLogger`
Implements [LogLevel](https://github.com/pimterry/loglevel)
Used for client (web and mobile) logging

```typescript
  // Setup logger in your application
  import {BunyanLogger, getLogger} from '@raincatcher/logger';
  const log = new BunyanLogger({name: 'index'});;
  setLogger(log);

  // Use logger in other modules
  getLogger().info('This log will render with BunyanLogger');
```

See `./example/index.ts` for more advanced usages
npm package: @raincatcher/step-gallery
Description: Gallery Step for RainCatcher
Author: feedhenry-raincatcher@redhat.com
Latest version: 1.1.2

# Example Gallery Step

This step exemplifies the utilization of the  `@raincatcher/camera` and `@raincatcher/filestorage-client` modules in a custom step that can take multiple pictures as part of its execution flow.

## Specifiying camera options

In order to supply options for the underlying [cordova camera plugin](https://github.com/apache/cordova-plugin-camera#module_camera.CameraOptions), supply a function that edits the default options and returns the updated version of the intended configuration:

```javascript
var galleryStep = require('@raincatcher/step-gallery');
// add thestep as a dependency of the mobile app
angular.module('wfm-mobile', [
  //...
  galleryStep.ngModule($fh, function buildOptions(camera) {
    return  {
      'quality': 20,
      // camera is the cordova plugin Camera object
      'destinationType': camera.DestinationType.FILE_URI,
      'sourceType': camera.PictureSourceType.CAMERA,
      'encodingType': camera.EncodingType.JPEG,
      'mediaType': camera.MediaType.PICTURE,
      'allowEdit': false,
      'correctOrientation': true
    };
  }, "user");
]);
```

The returned options are merged with the default ones in `@raincatcher/camera`, and the above values display the defaults.
npm package: @raincatcher/step-signature
Description: A signature step for FeedHenry WFM.
Author: feedhenry-raincatcher@redhat.com
Latest version: 1.1.2

# Signature generic step

FeedHenry RainCatcher generic step implementing signatures.

## Setup
This module is packaged in a CommonJS format, exporting the name of the Angular namespace.
The module can be included in an angular.js as follows:

Require the browserify dependency as an angular module
```javascript
angular.module('app', [require('fh-wfm-signature').ngModule])
```
## Client-side usage

### Collecting signatures
The Base64 encoded signature will be assigned to the value attribute of the `signature-form` directive.

Default mime-type is `image/png`, however, this can be overriden by passing mime-type value via encoding attribute.

The image quality can also be adjusted by setting the `image-quality` attribute. See table below for details.

|    Name    | Low | medium | High |
| ---------- | --- | ------ | ---- |
| image/jpeg | 0.1 |   0.5  |   1  |
| image/png  | 0.1 |   0.5  |   1  |
| image/webp | 0.1 |   0.5  |   1  |

```html
<signature-form value="ctrl.model" encoding="image/jpeg" image-quality="0.5"></signature-form>
```

### Displaying signatures
The `src` attribute of the image tag is bound to the `value` attribute of the signature tag.  To display a base64 encoded string, prefix it with the string: `data:image/png;base64,`
```html
<signature value="ctrl.model"></signature>
```

### Signature CSS styles
Include the module SASS file in your application sass:
```sass
@import 'node_modules/@raincatcher/step-signature/lib/signature.scss
```

#### Directives

| Name | Attributes |
| ---- | ----------- |
| signature-form | value, options, encoding, image-quality |
| signature | value |
npm package: @raincatcher/wfm
Description: Set of WorkForce Management tools
Author: feedhenry-raincatcher@redhat.com
Latest version: 1.1.2

## RainCatcher WFM

RainCatcher **W**ork**F**low **M**anagement module is an TypeScript implementation for an equivalent subset of the [Business Process Model and Notation (BPMN) specification](http://www.bpmn.org/).

This module allows users to map a business process into an organized set of tasks that can be built by developers to suit business needs.

## Concepts

The WFM module consists of a set of TypeScript interfaces and implementations for Process Management. The module's main entities are:

* `WorkFlow`: contains an ordered set of definitions of `Step`s than are instantiated into a `WorkOrder` for execution
* `WorkOrder`: instance of a `WorkFlow` to be executed
* `Step`: defines a single unit of work
* `StepResult`: the output of the execution of a `Step`
* `WorkOrderResult`: Tracks the progress of a `WorkOrder`

The classes are framework-agnostic which allows a developer to focus on the implementation of Business Processes on top of any new or existing solution.

## Getting Started

1) install all dependencies:

If inside the [lerna](http://lernajs.io)-based mono repo: `lerna bootstrap --scope=@raincatcher/wfm --include-filtered-dependencies`

2) For standalone usage: `npm install`
npm package: @raincatcher/wfm-user
Description: Module responsible for user management
Author: feedhenry-raincatcher@redhat.com
Latest version: 1.1.2

# wfm-user

Module responsible for user operations required by all WFM modules.

## RESTfull API

### Filter

> GET /?filter=name&limit=10

Retruns JSON array containing users
```json
{
  "users": []
}
```

#### Example

http://localhost:8001/api/users?filter=a&limit=1

> Note: Default limit is 10

#### Errors

Missing filter: `{status: 400 , code: 'InvalidFilter'}`

### Get user by id

> GET /:id

Gets user by id

#### Example

http://localhost:8001/api/users/fhj3nf

#### Errors

Missing id `{status: 400 , code: 'InvalidID'}`

## Implementing UserRepository

In order for module to be able to fetch user data any implementations
need to implement user repository class.

See demo application integration or [example application](https://github.com/feedhenry-raincatcher/raincatcher-core/tree/master/cloud/wfm-user/example) for more details.

## Relation to security module

The main purpose of this module is to allow administrators to retrieve and manage mobile users.
This data may come from different datasource than data from security module.
This module should not be used to fech any user related details like user profile etc.
npm package: @raindrop-ai/azure-openai
Description: Raindrop integration for Azure OpenAI
Latest version: 0.0.3

# @raindrop-ai/azure-openai

Raindrop integration for Azure OpenAI. Automatically captures `chat.completions.create()` calls by wrapping the AzureOpenAI client.

## Installation

```bash
npm install @raindrop-ai/azure-openai openai
```

## Usage

```typescript
import { createRaindropAzureOpenAI } from "@raindrop-ai/azure-openai";
import { AzureOpenAI } from "openai";

const raindrop = createRaindropAzureOpenAI({
  writeKey: "rk_...",
  userId: "user-123",
});

const client = new AzureOpenAI({
  endpoint: "https://your-resource.openai.azure.com",
  apiKey: "...",
  apiVersion: "2024-10-21",
});

const wrapped = raindrop.wrap(client);

const response = await wrapped.chat.completions.create({
  model: "gpt-4o-mini",
  messages: [{ role: "user", content: "Hello!" }],
});

await raindrop.shutdown();
```

## What gets captured

- **Chat completions**: input messages, output text, model, token usage (prompt/completion)
- **Errors**: captured with error status on spans, re-thrown to caller

## Options

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `writeKey` | `string` | - | Raindrop API write key (omit to disable telemetry) |
| `endpoint` | `string` | `https://api.raindrop.ai/v1/` | Raindrop API endpoint |
| `userId` | `string` | - | Associate all events with a user |
| `convoId` | `string` | - | Group events into a conversation |
| `debug` | `boolean` | `false` | Enable verbose logging |

## Testing

```bash
pnpm test
```
npm package: @raindrop-ai/bedrock
Description: Raindrop integration for AWS Bedrock
Latest version: 0.0.3

# @raindrop-ai/bedrock

Raindrop integration for AWS Bedrock. Automatically captures Converse and InvokeModel calls by wrapping the BedrockRuntimeClient.

## Installation

```bash
npm install @raindrop-ai/bedrock @aws-sdk/client-bedrock-runtime
```

## Usage

```typescript
import { createRaindropBedrock } from "@raindrop-ai/bedrock";
import { BedrockRuntimeClient, ConverseCommand } from "@aws-sdk/client-bedrock-runtime";

const raindrop = createRaindropBedrock({
  writeKey: "rk_...",
  userId: "user-123",
});

const client = new BedrockRuntimeClient({ region: "us-east-1" });
const wrapped = raindrop.wrap(client);

const response = await wrapped.send(
  new ConverseCommand({
    modelId: "anthropic.claude-3-5-sonnet-20241022-v2:0",
    messages: [
      { role: "user", content: [{ text: "Hello!" }] },
    ],
  }),
);

await raindrop.flush();
```

## What gets captured

- **Converse API**: input messages, output text, model ID, token usage (inputTokens/outputTokens)
- **InvokeModel API**: raw request/response bodies, model ID, token usage (Claude, Titan, and Llama formats)
- **Errors**: captured with OTLP error status, re-thrown to the caller

## Options

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `writeKey` | `string` | - | Raindrop API write key (omit to disable telemetry) |
| `endpoint` | `string` | `https://api.raindrop.ai/v1/` | API endpoint |
| `userId` | `string` | - | Associate all events with a user |
| `convoId` | `string` | - | Group events into a conversation |
| `debug` | `boolean` | `false` | Enable verbose logging |

## Testing

```bash
pnpm test
```

Tests use MSW to intercept HTTP requests — no real AWS calls are made.
npm package: @raindrop-ai/browser-sdk
Description: Minimal browser-safe SDK for Raindrop /v1/events
Latest version: 0.0.3

# `@raindrop-ai/browser-sdk`

Minimal browser-safe SDK for sending Raindrop events from frontend applications.

## Install

```bash
pnpm add @raindrop-ai/browser-sdk
```

## Usage

```ts
import { Raindrop } from "@raindrop-ai/browser-sdk";

const raindrop = new Raindrop({
  apiKey: process.env.RAINDROP_WRITE_KEY!,
});
```

## Notes

- This package is intentionally small and browser-safe.
- It depends on `@raindrop-ai/schemas` for the shared attachment types exposed in its public types.
npm package: @raindrop-ai/claude-agent-sdk
Description: Standalone Claude Agent SDK integration for Raindrop
Latest version: 0.0.11

# `@raindrop-ai/claude-agent-sdk`

Raindrop integration for Anthropic's Claude Agent SDK.

## Install

```bash
pnpm add @raindrop-ai/claude-agent-sdk @anthropic-ai/claude-agent-sdk
```

## Usage

```ts
import { createRaindropClaudeAgentSDK } from "@raindrop-ai/claude-agent-sdk";

const raindrop = createRaindropClaudeAgentSDK({
  writeKey: process.env.RAINDROP_WRITE_KEY!,
});
```

## Notes

- This package depends on `@raindrop-ai/core` for shared event and trace shipping.
- Version compatibility fixtures live under `tests/v1` and `tests/v2`.
npm package: @raindrop-ai/claude-code
Description: Raindrop observability for Claude Code CLI — automatic session, tool call, and prompt tracing via hooks
Latest version: 0.0.12

# @raindrop-ai/claude-code

Raindrop observability for [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code/overview). Automatic session, tool call, and prompt tracing via Claude Code's native [hooks system](https://docs.anthropic.com/en/docs/claude-code/hooks).

## Install

```bash
npm install -g @raindrop-ai/claude-code
```

## Setup

```bash
raindrop-claude-code setup
```

This saves your write key and configures Claude Code hooks. Every session will now send telemetry to your [Raindrop dashboard](https://app.raindrop.ai).

Hooks are **synchronous by default** for headless/one-shot compatibility (`claude -p`). Use `--async` if you prefer non-blocking hooks in interactive mode.

## What gets tracked

- Every prompt turn as a separate event, grouped by session
- Tool calls with inputs, outputs, and real durations
- Token usage per turn and per session (input, output, cache read, cache creation)
- Model name, service tier, and stop reason
- CLAUDE.md and rules file contents
- `--append-system-prompt` / `--append-system-prompt-file` content (best-effort)
- Subagent spawns and completions
- Permission denials and context compaction
- Self-diagnostics — agent-reported issues via MCP tool, with customizable signal categories
- Nested trace view (tools under root, subagent tools under subagent)
- Claude's responses and errors

## Custom Properties

Tag events with product names or custom metadata via `.claude/settings.json`:

```json
{
  "env": {
    "RAINDROP_EVENT_NAME": "design-agent",
    "RAINDROP_PROPERTIES": "{\"product\":\"design\",\"team\":\"ai\"}"
  }
}
```

## Custom Self-Diagnostics Signals

Replace the built-in signal categories with your own via `~/.config/raindrop/config.json`:

```json
{
  "self_diagnostics": {
    "signals": {
      "billing_complaint": { "description": "User billing issue.", "sentiment": "NEGATIVE" },
      "feature_request": { "description": "User wants a feature.", "sentiment": "POSITIVE" }
    },
    "guidance": "Only report billing if explicitly mentioned."
  }
}
```

Or via env var: `RAINDROP_SELF_DIAGNOSTICS='{"signals":{...}}'`

## Debugging

```bash
raindrop-claude-code debug-on    # logs hook output to /tmp/raindrop-hooks.log
raindrop-claude-code debug-off   # disables logging
```

## Docs

Full documentation: [docs.raindrop.ai/sdk/claude-code](https://docs.raindrop.ai/sdk/claude-code)
npm package: @raindrop-ai/langchain
Description: Raindrop integration for LangChain
Latest version: 0.0.3

# @raindrop-ai/langchain

Raindrop integration for LangChain. Automatically captures LLM calls, tool usage, chains, retrievers, and agent actions via LangChain's callback system.

## Installation

```bash
npm install @raindrop-ai/langchain @langchain/core
```

## Usage

```typescript
import { createRaindropLangChain } from "@raindrop-ai/langchain";
import { ChatOpenAI } from "@langchain/openai";
import { HumanMessage } from "@langchain/core/messages";

const raindrop = createRaindropLangChain({
  writeKey: "rk_...",
  userId: "user-123",
});

const model = new ChatOpenAI({ model: "gpt-4o" });

const result = await model.invoke(
  [new HumanMessage("Hello!")],
  { callbacks: [raindrop.handler] },
);

await raindrop.flush();
```

## What gets captured

- **LLM calls**: model name, input, output, token usage
- **Tool calls**: tool name, input arguments, output
- **Chains**: execution spans with parent-child nesting
- **Retrievers**: query and document count
- **Errors**: captured with OTLP error status

## Options

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `writeKey` | `string` | - | Raindrop API write key (omit to disable telemetry) |
| `endpoint` | `string` | `https://api.raindrop.ai/v1/` | API endpoint |
| `userId` | `string` | - | Associate all events with a user |
| `convoId` | `string` | - | Group events into a conversation |
| `debug` | `boolean` | `false` | Enable verbose logging |
| `traceChains` | `boolean` | `true` | Create spans for chain execution |
| `traceRetrievers` | `boolean` | `true` | Create spans for retriever calls |
| `filterLangGraphInternals` | `boolean` | `true` | Filter LangGraph-internal chain events and deduplicate LLM callbacks |

## LangGraph Support

Works with LangGraph out of the box. The handler automatically:
- Filters LangGraph-internal chain events (graph executor, `__start__`, `__end__`, channel nodes)
- Deduplicates LLM callbacks that LangGraph fires multiple times with the same `runId`

Pass the handler both at `graph.invoke()` and inside your LLM node. See `examples/langchain-langgraph-basic/` for a full example.

**Best practices:**
- Pass callbacks to the **model inside your node**, not to `graph.invoke()` — this avoids duplicate events from LangGraph's internal callback propagation
- Create a new handler instance per request in server environments

## LangSmith Coexistence

Raindrop and LangSmith can run simultaneously — both receive the same LangChain callbacks independently. Set `LANGSMITH_TRACING=false` to disable LangSmith if you only want Raindrop.

## Testing

```bash
pnpm test
```

Tests use MSW to intercept HTTP requests — no real LLM calls are made.
npm package: @raindrop-ai/mastra
Description: Raindrop integration for Mastra
Latest version: 0.0.3

# @raindrop-ai/mastra

Raindrop integration for Mastra. Automatically captures `agent.generate()` calls by wrapping the Mastra agent.

## Installation

```bash
npm install @raindrop-ai/mastra @mastra/core
```

## Usage

```typescript
import { createRaindropMastra } from "@raindrop-ai/mastra";
import { Agent } from "@mastra/core/agent";
import { openai } from "@ai-sdk/openai";

const raindrop = createRaindropMastra({ writeKey: "rk_...", userId: "user-123" });

const agent = new Agent({
  name: "Assistant",
  model: openai("gpt-4o-mini"),
  instructions: "Be helpful",
});

const wrapped = raindrop.wrap(agent);
const response = await wrapped.generate("Hello!");
console.log(response.text);

await raindrop.shutdown();
```

## What gets captured

- **Agent generate**: input prompt, output text, model, token usage
- **Errors**: captured with error status, re-thrown to caller

## Options

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `writeKey` | `string` | - | Raindrop API write key (omit to disable telemetry) |
| `endpoint` | `string` | `https://api.raindrop.ai/v1/` | Raindrop API endpoint |
| `userId` | `string` | - | Associate all events with a user |
| `convoId` | `string` | - | Group events into a conversation |
| `debug` | `boolean` | `false` | Enable verbose logging |

## Testing

```bash
pnpm test
```
npm package: @raindrop-ai/openai-agents
Description: Raindrop integration for OpenAI Agents SDK
Latest version: 0.0.3

# @raindrop-ai/openai-agents

Raindrop integration for the OpenAI Agents SDK. Implements a `TracingProcessor` that captures agent runs, LLM generations, tool calls, and handoffs.

## Installation

```bash
npm install @raindrop-ai/openai-agents @openai/agents
```

## Usage

```typescript
import { createRaindropOpenAIAgents } from "@raindrop-ai/openai-agents";
import { Agent, run, addTraceProcessor } from "@openai/agents";

const raindrop = createRaindropOpenAIAgents({
  writeKey: "rk_...",
  userId: "user-123",
});

addTraceProcessor(raindrop.processor);

const agent = new Agent({
  name: "Assistant",
  model: "gpt-4o",
  instructions: "Be helpful",
});

const result = await run(agent, "Hello!");
console.log(result.finalOutput);

await raindrop.flush();
```

## What gets captured

- **Agent runs**: trace-level events with workflow name
- **LLM generations**: model, input messages, output, token usage
- **Tool calls**: function name, input, output
- **Handoffs**: from/to agent names
- **Errors**: captured with error status on spans

All spans are linked with parent-child relationships for full trace visibility.

## Options

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `writeKey` | `string` | - | Raindrop API write key (omit to disable telemetry) |
| `endpoint` | `string` | `https://api.raindrop.ai/v1/` | API endpoint |
| `userId` | `string` | - | Associate all events with a user |
| `convoId` | `string` | - | Group events into a conversation |
| `debug` | `boolean` | `false` | Enable verbose logging |

## Testing

```bash
pnpm test
```

Tests use MSW to intercept HTTP requests — no real OpenAI calls are made.
npm package: @raindrop-ai/opencode-plugin
Description: Raindrop observability plugin for OpenCode — automatic session/event/span tracing
Latest version: 0.0.10

# `@raindrop-ai/opencode-plugin`

Raindrop observability plugin for OpenCode with automatic session, event, and span tracing.

## Install

```bash
pnpm add @raindrop-ai/opencode-plugin @opencode-ai/plugin
```

If your integration also uses the OpenCode SDK directly, install `@opencode-ai/sdk` as well.

## Notes

- `@opencode-ai/plugin` is required.
- `@opencode-ai/sdk` is an optional peer dependency.
- Tests live in the nested `tests/` package and validate HTTP payloads and tracing behavior.
npm package: @raindrop-ai/pi-agent
Description: Raindrop observability for Pi Agent — automatic tracing via subscriber or pi-coding-agent extension
Latest version: 0.0.2

# @raindrop-ai/pi-agent

Automatic observability for [Pi Agent](https://github.com/badlogic/pi-mono) with [Raindrop](https://raindrop.ai). Captures agent runs, LLM generations, tool calls, and token usage.

Two entry points:

- **`@raindrop-ai/pi-agent`** — programmatic subscriber for `pi-agent-core` users
- **`@raindrop-ai/pi-agent/extension`** — pi-coding-agent CLI extension (auto-discovered via `pi install`)

## Quick Start — Programmatic

```typescript
import { Agent } from "@mariozechner/pi-agent-core";
import { getModel } from "@mariozechner/pi-ai";
import { createRaindropPiAgent } from "@raindrop-ai/pi-agent";

const raindrop = createRaindropPiAgent({
  writeKey: "rk_...",
  userId: "user-123",
});

const agent = new Agent({
  initialState: {
    systemPrompt: "You are a helpful assistant.",
    model: getModel("openai", "gpt-4o-mini"),
  },
});

raindrop.subscribe(agent);
await agent.prompt("Hello!");
await raindrop.shutdown();
```

## Quick Start — Pi Coding Agent CLI

```bash
pi install npm:@raindrop-ai/pi-agent
```

Set `RAINDROP_WRITE_KEY` in your environment. Traces appear automatically.

## Documentation

See the full [Pi Agent docs](https://docs.raindrop.ai/sdk/pi-agent) for configuration, per-subscribe overrides, and extension settings.

## License

MIT
npm package: @raindrop-ai/vertex-ai
Description: Raindrop integration for Vertex AI
Latest version: 0.0.3

# @raindrop-ai/vertex-ai

Raindrop integration for Google Vertex AI / Gen AI. Automatically captures `models.generateContent()` calls by wrapping the Google Gen AI client.

## Installation

```bash
npm install @raindrop-ai/vertex-ai @google/genai
```

## Usage

```typescript
import { createRaindropVertexAI } from "@raindrop-ai/vertex-ai";
import { GoogleGenAI } from "@google/genai";

const raindrop = createRaindropVertexAI({ writeKey: "rk_...", userId: "user-123" });
const client = new GoogleGenAI({ apiKey: "..." });
const wrapped = raindrop.wrap(client);

const response = await wrapped.models.generateContent({
  model: "gemini-2.0-flash",
  contents: "Hello!",
});

await raindrop.shutdown();
```

## What gets captured

- **generateContent**: input text, output, model, token usage (promptTokenCount/candidatesTokenCount)
- **Errors**: captured with error status, re-thrown to caller

## Options

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `writeKey` | `string` | - | Raindrop API write key (omit to disable telemetry) |
| `endpoint` | `string` | `https://api.raindrop.ai/v1/` | Raindrop API endpoint |
| `userId` | `string` | - | Associate all events with a user |
| `convoId` | `string` | - | Group events into a conversation |
| `debug` | `boolean` | `false` | Enable verbose logging |

## Testing

```bash
pnpm test
```