open-index/open-npm huggingface dataset:
npm package: @sleekwp/agent
Description: Local agent server that connects SleekWP plugins to Claude Code CLI via WebSocket
Author: SleekWP
Latest version: 1.0.4

# @sleekwp/agent

Local agent server that connects SleekWP plugins to [Claude Code](https://claude.com/claude-code) CLI via WebSocket.

## What it does

Runs a WebSocket server on your machine that:

- Syncs plugin files to a temp directory
- Spawns Claude Code CLI with full terminal emulation
- Watches for file changes and streams them back
- Supports session resume across page reloads
- Adapts Claude Code theme to match your editor (light/dark)

The SleekWP plugin frontend connects via `ws://localhost:5733` and renders an interactive terminal using xterm.js.

## Quick start

```bash
npx @sleekwp/agent
```

Requires [Claude Code](https://claude.com/claude-code) to be installed and authenticated.

## How it works

```
Browser (SleekWP plugin)          @sleekwp/agent (your machine)

  xterm.js terminal  ◄──────────►  WebSocket server (:5733)
  Canvas file editor ◄──────────►  │
                                   ├── node-pty (spawns claude CLI)
                                   ├── chokidar (watches file changes)
                                   └── temp dir with synced files
```

1. Plugin sends files + CLAUDE.md context via WebSocket
2. Agent writes files to a temp directory
3. Claude Code spawns in that directory with `--permission-mode acceptEdits`
4. Terminal I/O streams bidirectionally over WebSocket
5. File changes detected by chokidar are sent back to the plugin
6. On disconnect, the session detaches (temp dir kept for resume)
7. On reconnect, Claude Code resumes with `--continue`

## WebSocket protocol

### Client to server

| Message | Description |
|---------|-------------|
| `session:start` | Start a new session with files, dimensions, theme, and optional CLAUDE.md |
| `session:stop` | Stop and destroy a session |
| `terminal:input` | Send terminal input (keystrokes) |
| `terminal:resize` | Resize the terminal |

### Server to client

| Message | Description |
|---------|-------------|
| `session:ready` | Session started, terminal is live |
| `session:ended` | Session was stopped or Claude Code exited |
| `terminal:output` | Terminal output data |
| `files:changed` | Files modified by Claude Code |
| `files:deleted` | Files deleted by Claude Code |
| `error` | Error message |

## Configuration

The agent is zero-config. It uses port `5733` and auto-detects the Claude Code binary.

Theme is synced by temporarily setting `~/.claude.json` before spawning, then restoring to the OS default after 3 seconds.

## Development

```bash
npm run dev    # Start with tsx watch
npm run build  # Build with tsup
npm run test   # Run test suite
```

## Requirements

- Node.js 20+
- [Claude Code CLI](https://claude.com/claude-code) installed and authenticated
- macOS, Linux, or Windows

## License

MIT
npm package: @sleep-client/caller
Description: Make sleep client requests
Author: Kylee Tilley
Latest version: 0.1.0

# @sleep-client/caller

## Installation

```bash
$ npm i @sleep-client/caller
```

## Usage

```javascript
import assert from "assert";
import { parse } from "@sleep-client/parser";
import { callRequest } from "@sleep-client/caller";

(await () => {
  try {
    const parsedStateFile = await parse("./path/to/stateFile");

    const workspaces = parsedStateFile.getWorkspaces();
    const collections = parsedStateFile.getWorkspaceCollections(workspaces[0]);
    const [request] = parsedStateFile.getCollectionRequests(collections[0]);

    const call = callRequest(request);

    assert.strictEqual(call.request, request);

    const response = await call.response;

    assert.strictEqual(200, response.status);
  } catch(e){
    e.message // Contains any errors parsing
  }
})()
```
npm package: @sleep-client/parser
Description: Rest file parser
Author: Kylee Tilley
Latest version: 0.1.0

# @sleep-client/parser

Library for parsing sleep client state files.

## Installation

```bash
$ npm i @sleep-client/parser
```

## Usage

```javascript
import {
  parse,
  ParsedStateFile,
  mapParsedToExport
} from "@sleep-client/parser";

(await () => {
  try {
    const parsedStateFile: ParsedStateFile = await parse("./path/to/stateFile");

    const workspaces = parsedStateFile.getWorkspaces();
    const collections = parsedStateFile.getWorkspaceCollections(workspaces[0]);
    const requests = parsedStateFile.getCollectionRequests(collections[0]);

    const stateFileJson = JSON.stringify(mapParsedToExport(parsedStateFile));
  } catch(e){
    e.message // Contains any errors parsing
  }
})()
```
npm package: @sleeperhq/mini-core
Description: Core library frameworks for developing Sleeper Mini Apps.
Author: Luke Herbold
Latest version: 5.1.5

# Sleeper-Mini Core

![Sleeper](https://user-images.githubusercontent.com/61988202/223927288-c54734de-39f9-40c5-bb24-d1b193c9c374.png)

## Description

This package contains built in sleeper UI components and dev server functionality for creating mini apps.

Please see the main repo at [sleeper-mini](https://github.com/blitzstudios/sleeper-mini) for more information.