open-index/open-npm huggingface dataset:
npm package: @humebio/collector-sdk
Description: SDK for building hume-network collectors
Author: humebio
Latest version: 0.1.1

# @humebio/collector-sdk

SDK for building custom [Hume Network](https://github.com/humebio/hume-network) collectors.

## Install

```bash
npm install @humebio/collector-sdk
```

## Usage

Extend `BaseCollector` and implement two methods:

```typescript
import { BaseCollector, observe } from '@humebio/collector-sdk'
import type { Observation, CollectorMetadata } from '@humebio/collector-sdk'

const metadata: CollectorMetadata = {
  id: 'my-collector',
  name: 'My Collector',
  version: '0.1.0',
  description: 'Observes something useful',
  category: 'productivity',
}

class MyCollector extends BaseCollector {
  constructor() {
    super(metadata, { intervalMs: 5 * 60 * 1000 })
  }

  async checkPrerequisites(): Promise<boolean> {
    return true // check if dependencies are available
  }

  protected async doCollect(): Promise<Observation[]> {
    return [
      observe()
        .category('productivity')
        .autoTime()
        .activity('working')
        .action('workflow', 'Some pattern observed')
        .outcome('focus_time', '+15% improvement')
        .build(),
    ]
  }
}
```

## API

### BaseCollector

| Method | Description |
|--------|-------------|
| `start(sink)` | Start collecting on interval |
| `stop()` | Stop collecting |
| `init()` | Optional async init hook |
| `checkPrerequisites()` | **Abstract** — verify dependencies |
| `doCollect()` | **Abstract** — return observations |

### Helpers

| Export | Description |
|--------|-------------|
| `observe()` | Fluent `ObservationBuilder` factory |
| `computeConfidence(n, max?)` | Log-based confidence score (0–1) |
| `detectTimeOfDay(date)` | Returns `morning/afternoon/evening/night` |

### Types

`Observation`, `PatternCategory`, `TimeOfDay`, `ActionType`, `CollectorConfig`, `CollectorMetadata`, `ICollector`

## License

[MIT](../../LICENSE)
npm package: @humebio/collector-system
Description: macOS system pattern collector for hume-network (app usage, shell, system state)
Author: humebio
Latest version: 0.1.0

# @humebio/collector-system

macOS system pattern collector for [Hume Network](https://github.com/humebio/hume-network) — observes app usage, shell history, and system state.

**macOS only.**

## Install

```bash
npm install @humebio/collector-system
```

## Usage

```typescript
import { SystemCollector } from '@humebio/collector-system'

const collector = new SystemCollector({
  historyLimit: 200,  // shell history entries to analyze
})

await collector.start(sink)
```

## What It Observes

### App Usage Observer
- **Focus style** — deep focus / moderate / multitasking (based on app switch frequency)
- **Tool preference** — which app category you use most (browser, editor, terminal, etc.)
- **Peak activity hour** — when you're most active

### Shell Observer
- **Workflow style** — focused (few command categories) vs diverse
- **Tool chain** — which command categories dominate (git, npm, docker, etc.)

### System State Observer
- **Working conditions** — mobile / desk / mixed (battery vs AC ratio)
- **Session length** — average uptime pattern

## Privacy

No app names, commands, arguments, file paths, or URLs ever leave your machine. Only categories and aggregated metrics are shared as patterns.

## License

[MIT](../../LICENSE)