open-index/open-npm huggingface dataset:
npm package: @maniflow/hive
Description: Maniflow Hive plugin for OpenClaw - enables task queue and event reporting
Latest version: 0.1.20

# Maniflow Hive Plugin for OpenClaw

Syncs agent lifecycle events from OpenClaw to the Maniflow dashboard (Convex backend) in real time.

## Architecture

### Internal Hook (HOOK.md)

- **File:** `hooks/maniflow-hive/handler.ts`
- **Events:** `agent:bootstrap`, `gateway:startup`
- **Role:** Stores session info, reads the user prompt, sends "start" event

### Typed Plugin Hooks (api.on)

- **File:** `src/index.ts`
- **Events:** `agent_end`, `after_tool_call`
- **Role:** Sends "end" and "progress" events with sub-second latency

### Event Flow

```
Agent starts   -> HOOK.md agent:bootstrap   -> handler.ts sends "start"
Agent uses tool -> api.on("after_tool_call") -> index.ts sends "progress"
Agent finishes  -> api.on("agent_end")       -> index.ts sends "end"
```

### Shared State

Both files coordinate via `Symbol.for()` globals:

- `maniflow-hive:sessionInfo` — `Map<string, {agentId, sessionId}>` mapping session keys to IDs (set by handler.ts, read by index.ts)

### Dedup

OpenClaw may fire `agent_end` twice per turn (intermediate + final message snapshot). The plugin uses a `Map<string, number>` keyed by `sessionKey → messageCount`. If `agent_end` fires again with the same message count, it's a duplicate and is skipped.

## Configuration

| Env var | Required | Description |
|---------|----------|-------------|
| `CONVEX_URL` | Yes | Self-hosted Convex backend URL (port 443, not 8443) |

## Requirements

- OpenClaw >= 2026.2.3 (for `api.on()` typed hooks)
npm package: @maniflow/lastmile
Description: Last Mile connector package (C-006 package model).
Latest version: 0.1.0

# @maniflow/lastmile

Last Mile connector package (C-006 package model).

## Exports

- `commandRegistry` for runtime/Hive integration
- CLI wrapper via `lastmile`

## Commands

- `tasks.get` → `GET /tasks/{task_id}`
- `bindings.list` → list executable Last Mile bindings from Convex
- `bindings.default` → show/set default executable binding persisted locally
- Source OpenAPI: `/Users/ericodom/Projects/lastmile/web-apps/apps/lmi/api-playground/openapi`

## CLI invocation

```bash
pnpm --filter @maniflow/lastmile build

# Show command help
node packages/connectors/lastmile/dist/cli.js --help

# Discover usable binding IDs quickly
node packages/connectors/lastmile/dist/cli.js bindings list
node packages/connectors/lastmile/dist/cli.js bindings list --json

# View/set default binding (stored in ~/.lastmile/config.json)
node packages/connectors/lastmile/dist/cli.js bindings default --show
node packages/connectors/lastmile/dist/cli.js bindings default --set <assistantConnectorBindingId>

# Run task lookup (binding now optional if resolvable)
node packages/connectors/lastmile/dist/cli.js tasks get --id <taskId>
node packages/connectors/lastmile/dist/cli.js tasks get \
  --binding <assistantConnectorBindingId> \
  --id <taskId>
```

## Binding resolution order for `tasks get`

1. `--binding` if provided
2. default binding from `~/.lastmile/config.json` if set
   - if that stored default is stale (deleted/non-executable), the CLI auto-clears it from config and continues fallback resolution
3. exactly one executable Last Mile binding from Convex
4. otherwise fail with actionable guidance to pass `--binding` or set a default

`bindings default --show` also auto-heals stale saved defaults. It never prints an invalid binding ID; stale values are cleared first.

Commands resolve connector execution config from Convex:
- connector definition (`baseUrl`, `authScheme`)
- instance binding (`credentialRef`)
- vault secret via credentialRef