← Back to Plugins
Channels

Moment Channel

Pianke-Moment By Pianke-Moment 👁 57 views ▲ 0 votes

OpenClaw channel plugin for Moment — delivers agent task results back to Moment Backend

GitHub

Configuration Example

{
  "plugins": {
    "load": {
      "paths": [
        "~/.openclaw/workspace/openclaw-moment-channel"
      ]
    },
    "entries": {
      "moment": {
        "enabled": true,
        "config": {
          "backendUrl": "https://your-moment-backend.com",
          "callbackToken": "your-callback-token"
        }
      }
    }
  }
}

README

# openclaw-moment-channel

OpenClaw channel plugin for Moment. When OpenClaw finishes an agent task with `deliver=true` and `channel="moment"`, this plugin delivers the result to Moment Backend via the callback API.

## Setup

### 1. Install plugin on OpenClaw host

```bash
# Copy to OpenClaw workspace
cp -r openclaw-moment-channel ~/.openclaw/workspace/

# Or clone directly
cd ~/.openclaw/workspace
git clone [email protected]:Pianke-Moment/openclaw-moment-channel.git
```

### 2. Configure in openclaw.json

Add the plugin path and config:

```json
{
  "plugins": {
    "load": {
      "paths": [
        "~/.openclaw/workspace/openclaw-moment-channel"
      ]
    },
    "entries": {
      "moment": {
        "enabled": true,
        "config": {
          "backendUrl": "https://your-moment-backend.com",
          "callbackToken": "your-callback-token"
        }
      }
    }
  }
}
```

- `backendUrl`: Moment Backend base URL
- `callbackToken`: must match the `MOMENT_CALLBACK_TOKEN` env var on the backend

### 3. Restart OpenClaw Gateway

```bash
launchctl stop ai.openclaw.gateway && sleep 2 && launchctl start ai.openclaw.gateway
```

### 4. Verify

```bash
openclaw plugins list
# Should show "Moment" as loaded
```

## How it works

```
Moment Backend
    │ POST /hooks/agent
    │ { message, deliver: true, channel: "moment", to: "<task_id>" }
    ▼
OpenClaw Gateway
    │ Agent executes task
    │ deliver=true → calls moment channel sendText()
    ▼
This Plugin (sendText)
    │ POST <backendUrl>/api/v1/tasks/callback
    │ { run_id: "<task_id>", text: "<result>" }
    │ Authorization: Bearer <callbackToken>
    ▼
Moment Backend
    │ Updates AgentTask status → completed
    │ Pushes update to frontend via SSE
    ▼
Moment App (frontend)
    └─ Slot card shows result
```

## Backend integration note

The `to` parameter received by `sendText()` is whatever Moment Backend passes as `to` in the POST /hooks/agent call. The plugin forwards it as `run_id` in the callback payload.

For this to work, the backend must pass the **AgentTask ID** (not user_id) as the `to` parameter when dispatching tasks. See ADR-0010 for details.
channels

Comments

Sign in to leave a comment

Loading comments...