@mutirolabs/openclaw-brain 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +70 -3
- package/README.md +44 -217
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/src/actions.js +40 -0
- package/dist/src/actions.js.map +1 -0
- package/dist/src/agent-tools.js +547 -0
- package/dist/src/agent-tools.js.map +1 -0
- package/dist/src/bridge-client.js +172 -0
- package/dist/src/bridge-client.js.map +1 -0
- package/dist/src/bridge-messages.js +226 -0
- package/dist/src/bridge-messages.js.map +1 -0
- package/dist/src/bridge-protocol.js +42 -0
- package/dist/src/bridge-protocol.js.map +1 -0
- package/dist/src/bridge-session.js +279 -0
- package/dist/src/bridge-session.js.map +1 -0
- package/dist/src/channel.js +167 -0
- package/dist/src/channel.js.map +1 -0
- package/dist/src/channel.runtime.js +422 -0
- package/dist/src/channel.runtime.js.map +1 -0
- package/dist/src/config.js +61 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/inbound.js +92 -0
- package/dist/src/inbound.js.map +1 -0
- package/dist/src/live-snapshot.js +151 -0
- package/dist/src/live-snapshot.js.map +1 -0
- package/dist/src/outbound.js +205 -0
- package/dist/src/outbound.js.map +1 -0
- package/dist/src/setup-surface.js +252 -0
- package/dist/src/setup-surface.js.map +1 -0
- package/dist/src/signal-forwarder.js +119 -0
- package/dist/src/signal-forwarder.js.map +1 -0
- package/docs/assets/mutiro-openclaw-ui.png +0 -0
- package/docs/guides/manage-allowlist.md +3 -3
- package/docs/guides/use-openclaw-as-brain.md +15 -15
- package/index.ts +1 -1
- package/openclaw.plugin.json +5 -3
- package/package.json +9 -7
- package/src/agent-tools.ts +3 -3
- package/src/bridge-client.ts +1 -2
- package/src/bridge-messages.ts +2 -2
- package/src/bridge-protocol.ts +2 -2
- package/src/bridge-session.ts +2 -2
- package/src/channel.runtime.ts +54 -3
- package/src/channel.ts +61 -2
- package/src/outbound.ts +5 -7
- package/src/setup-surface.ts +39 -11
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,71 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.2.1] - 2026-05-23
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Ship compiled JavaScript in `dist/` so `openclaw plugins install
|
|
15
|
+
@mutirolabs/openclaw-brain` works. 0.2.0 published TypeScript source only,
|
|
16
|
+
which OpenClaw's plugin loader rejects for npm-installed packages with
|
|
17
|
+
"package install requires compiled runtime output for TypeScript entry
|
|
18
|
+
./index.ts: expected ./dist/index.js". Source-checkout installs
|
|
19
|
+
(`file:./path`) were unaffected.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- `prepublishOnly` now runs `npm run build` in addition to `npm run check`,
|
|
24
|
+
emitting `dist/` from a new `tsconfig.build.json`. Source files
|
|
25
|
+
(`index.ts`, `src/`) continue to ship alongside `dist/` for source-map
|
|
26
|
+
debugging and the source-checkout fallback path.
|
|
27
|
+
|
|
28
|
+
## [0.2.0] - 2026-04-19
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
|
|
32
|
+
- Threading adapter: the agent's first reply in a turn threads under the
|
|
33
|
+
inbound message by default (visible quoted pill in every Mutiro client).
|
|
34
|
+
`channels.mutiro.replyToMode` overrides with `off` | `first` | `all` |
|
|
35
|
+
`batched`. `allowExplicitReplyTagsWhenOff: true` keeps agent-directed reply
|
|
36
|
+
markers working when the user opts out.
|
|
37
|
+
- `replyToMode` exposed in `openclaw.plugin.json` configSchema.
|
|
38
|
+
- Status adapter (`ChannelStatusAdapter.buildAccountSnapshot`):
|
|
39
|
+
`openclaw channels status mutiro` now reports `healthState` (stopped |
|
|
40
|
+
restarting | connecting | healthy), `mode: "bridge"`, and `dbPath`
|
|
41
|
+
pointing at the Mutiro agent workspace.
|
|
42
|
+
- Bridge crash backoff: unexpected host exits track a per-account crash
|
|
43
|
+
streak with a 5-minute reset window and hold the gateway lifecycle promise
|
|
44
|
+
through an exponential delay (1s → 2s → 5s → 15s → 60s). Clean exits
|
|
45
|
+
(code 0 or abort) short-circuit immediately. Surfaces `restartPending`,
|
|
46
|
+
`reconnectAttempts`, and structured `lastDisconnect` on the snapshot.
|
|
47
|
+
- Setup wizard pre-flight: runs `mutiro agent host status` and warns if a
|
|
48
|
+
Mutiro agent host is already running for this agent before starting the
|
|
49
|
+
gateway.
|
|
50
|
+
|
|
51
|
+
### Changed
|
|
52
|
+
|
|
53
|
+
- README rewrite: sharper tagline, hero screenshot (`docs/assets/mutiro-openclaw-ui.png`),
|
|
54
|
+
Prerequisites section folded into the setup wizard, `tools.alsoAllow`
|
|
55
|
+
switched from YAML hand-edit to
|
|
56
|
+
`openclaw config set tools.alsoAllow '["mutiro*"]'`, allowlist reframed
|
|
57
|
+
as an edge-enforced security feature, sibling link to `pi-brain`.
|
|
58
|
+
- Doc links drop `.md` suffixes so they render as HTML; `/docs` replaced
|
|
59
|
+
with `/docs/manual` + `/docs/cli`.
|
|
60
|
+
- Prerequisites "built-in brain stopped" check now references
|
|
61
|
+
`mutiro agent host status` (runtime liveness) instead of
|
|
62
|
+
`mutiro agent doctor` (which only validates config).
|
|
63
|
+
- Internal cleanup: removed `pi-brain` references from source comments
|
|
64
|
+
and changelog.
|
|
65
|
+
- User-facing metadata aligned with OpenClaw's "channel" + "extension"
|
|
66
|
+
language: npm `description`, `keywords`, channel `selectionLabel`,
|
|
67
|
+
`blurb`, plugin entry `description`, and the setup wizard title no
|
|
68
|
+
longer leak the internal `chatbridge` protocol name.
|
|
69
|
+
|
|
70
|
+
### Removed
|
|
71
|
+
|
|
72
|
+
- Unused `MUTIRO_AGENT_API_KEY` from `openclaw.plugin.json` `channelEnvVars`;
|
|
73
|
+
the chathost reads that env var, not this plugin.
|
|
74
|
+
|
|
10
75
|
## [0.1.1] - 2026-04-18
|
|
11
76
|
|
|
12
77
|
### Added
|
|
@@ -20,8 +85,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
20
85
|
|
|
21
86
|
### Added
|
|
22
87
|
|
|
23
|
-
- Initial OpenClaw
|
|
24
|
-
- NDJSON envelope codec
|
|
88
|
+
- Initial OpenClaw Channel extension for Mutiro.
|
|
89
|
+
- NDJSON envelope codec for `mutiro.agent.bridge.v1`.
|
|
25
90
|
- Subprocess lifecycle for `mutiro agent host --mode=bridge`, one per configured account.
|
|
26
91
|
- Inbound pipeline: `message.observed` → OpenClaw reply dispatch.
|
|
27
92
|
- Outbound surface: `message.send`, `message.send_voice`, `message.react`,
|
|
@@ -55,6 +120,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
55
120
|
with concrete fix commands, plus the paste-into-AI prompt as an alternative
|
|
56
121
|
for users who'd rather have their AI assistant drive the setup.
|
|
57
122
|
|
|
58
|
-
[Unreleased]: https://github.com/mutirolabs/openclaw-brain/compare/v0.
|
|
123
|
+
[Unreleased]: https://github.com/mutirolabs/openclaw-brain/compare/v0.2.1...HEAD
|
|
124
|
+
[0.2.1]: https://github.com/mutirolabs/openclaw-brain/compare/v0.2.0...v0.2.1
|
|
125
|
+
[0.2.0]: https://github.com/mutirolabs/openclaw-brain/compare/v0.1.1...v0.2.0
|
|
59
126
|
[0.1.1]: https://github.com/mutirolabs/openclaw-brain/compare/v0.1.0...v0.1.1
|
|
60
127
|
[0.1.0]: https://github.com/mutirolabs/openclaw-brain/releases/tag/v0.1.0
|
package/README.md
CHANGED
|
@@ -1,138 +1,62 @@
|
|
|
1
|
-
# Mutiro
|
|
1
|
+
# Mutiro Channel for OpenClaw
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The official Mutiro Channel extension for OpenClaw.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
OpenClaw handles the cognition. Mutiro handles the messaging surface, identity, and state.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+

|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
Start below, confirm each of these passes:
|
|
9
|
+
## Why this exists
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|-------|-----------------|
|
|
14
|
-
| `mutiro version` prints a version | `curl -sSL https://mutiro.com/downloads/install.sh \| bash` |
|
|
15
|
-
| `mutiro auth whoami` prints your username | sign up: `mutiro auth signup <email> <username> "<Display Name>"` — or log in: `mutiro auth login <email>` |
|
|
16
|
-
| `mutiro agents list` shows at least one agent you own | `mutiro agents create <username> "<Display>" --engine genie --bio "<short bio>" --badge lobster` |
|
|
17
|
-
| The built-in Mutiro brain for that agent is **not** running | `mutiro agent doctor`, and stop any `mutiro agent run` / `mutiro start` process for that agent |
|
|
18
|
-
|
|
19
|
-
Want an AI assistant to drive you through those steps instead? Paste this into
|
|
20
|
-
Claude, Cursor, or Windsurf:
|
|
21
|
-
|
|
22
|
-
```text
|
|
23
|
-
Read this page from the Mutiro docs: https://mutiro.com/docs/guides/create-agent.md and help me create an agent step by step.
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
Canonical reference: [Mutiro create-agent guide](https://www.mutiro.com/docs/guides/create-agent.md).
|
|
27
|
-
|
|
28
|
-
> **Show the 🦞 badge.** Pass `--badge lobster` on `mutiro agents create` to mark
|
|
29
|
-
> the agent as OpenClaw-powered in the Mutiro UI. Already have an agent? Flip
|
|
30
|
-
> the badge with:
|
|
31
|
-
> ```bash
|
|
32
|
-
> mutiro agents update-profile <agent-username> --badge lobster
|
|
33
|
-
> ```
|
|
34
|
-
|
|
35
|
-
> **Two brains, one agent = trouble.** Mutiro ships its own built-in brain. If
|
|
36
|
-
> you leave it running, it will race OpenClaw for the same conversations and
|
|
37
|
-
> both will reply (or neither will, depending on ordering). Stop it before
|
|
38
|
-
> starting the OpenClaw gateway.
|
|
11
|
+
Sovereign intelligence deserves a professional interface. Hiding a powerful OpenClaw brain behind a generic Telegram bot or a clunky webview breaks the user experience and obscures ownership. This extension implements an OpenClaw Channel that connects your agent to Mutiro's native clients (Desktop, Mobile, Web, CLI), enforcing the `by @owner` accountability standard out of the box.
|
|
39
12
|
|
|
40
13
|
## Quick Start
|
|
41
14
|
|
|
42
|
-
|
|
15
|
+
Install the Mutiro channel using OpenClaw's native extension manager:
|
|
43
16
|
|
|
44
17
|
```bash
|
|
45
18
|
openclaw plugins install --dangerously-force-unsafe-install @mutirolabs/openclaw-brain
|
|
46
19
|
```
|
|
47
20
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
# Skip node_modules if you've run `npm install` here — the install scanner
|
|
52
|
-
# walks the source tree and caps at 10k directories.
|
|
53
|
-
rm -rf node_modules
|
|
54
|
-
openclaw plugins install --dangerously-force-unsafe-install "file:$(pwd)"
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
> **Why the `--dangerously-force-unsafe-install` flag?**
|
|
58
|
-
> This plugin legitimately spawns `mutiro agent host --mode=bridge` as a
|
|
59
|
-
> subprocess — that is the entire point of the `chatbridge` adapter. OpenClaw's
|
|
60
|
-
> install scanner correctly flags any plugin that uses `child_process` as
|
|
61
|
-
> sensitive, and requires this flag as an explicit acknowledgement. Before you
|
|
62
|
-
> pass it, **confirm you are installing from the signed [mutirolabs/openclaw-brain](https://github.com/mutirolabs/openclaw-brain)
|
|
63
|
-
> source** (or the `@mutirolabs/openclaw-brain` npm package). Review the
|
|
64
|
-
> `spawn` call at [`src/bridge-client.ts`](./src/bridge-client.ts) if you want
|
|
65
|
-
> to see exactly what the plugin executes.
|
|
66
|
-
|
|
67
|
-
### 2. Configure the channel
|
|
21
|
+
> The flag is required because this extension launches a Mutiro host process to carry the channel. Install only from the signed [`@mutirolabs/openclaw-brain`](https://github.com/mutirolabs/openclaw-brain) source.
|
|
68
22
|
|
|
69
|
-
|
|
70
|
-
passing one skips the wizard and falls through to the non-interactive adapter):
|
|
23
|
+
Add the channel:
|
|
71
24
|
|
|
72
25
|
```bash
|
|
73
26
|
openclaw channels add
|
|
74
27
|
```
|
|
75
28
|
|
|
76
|
-
Pick `mutiro` from the list. The wizard
|
|
29
|
+
Pick `mutiro` from the list. The setup wizard detects the Mutiro CLI, validates your agent directory, and confirms you are authenticated.
|
|
77
30
|
|
|
78
|
-
|
|
79
|
-
- ask for your Mutiro agent directory (the folder containing `.mutiro-agent.yaml`)
|
|
80
|
-
- validate the directory and run `mutiro auth whoami`
|
|
81
|
-
- remind you to stop the built-in Mutiro brain before starting the gateway
|
|
82
|
-
|
|
83
|
-
Or set the config manually:
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
openclaw config set channels.mutiro.accounts.default.agentDir /path/to/agent-directory
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### 3. Run the OpenClaw gateway
|
|
31
|
+
Start the gateway:
|
|
90
32
|
|
|
91
33
|
```bash
|
|
92
34
|
openclaw gateway run
|
|
93
35
|
```
|
|
94
36
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
./run-brain.sh /path/to/agent-directory
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
### 4. Talk to your agent
|
|
102
|
-
|
|
103
|
-
Once the gateway is running, your agent is reachable from any Mutiro surface:
|
|
37
|
+
Your agent is now live on every Mutiro surface — Web, Desktop, Mobile, and CLI.
|
|
104
38
|
|
|
105
|
-
|
|
106
|
-
- **CLI chat:** `mutiro chat`
|
|
107
|
-
- **Mobile:** Mutiro app on iOS / Android
|
|
108
|
-
- **Desktop:** Mutiro desktop app on macOS / Windows / Linux
|
|
109
|
-
|
|
110
|
-
For a quick shell smoke test:
|
|
39
|
+
Send a smoke-test message:
|
|
111
40
|
|
|
112
41
|
```bash
|
|
113
42
|
mutiro user message send <agent-username> "Hello! Who are you?"
|
|
114
43
|
```
|
|
115
44
|
|
|
116
|
-
|
|
45
|
+
## Enable Mutiro-native tools
|
|
117
46
|
|
|
118
|
-
|
|
119
|
-
messages through Mutiro, add `mutiro*` to your agent's `tools.alsoAllow`:
|
|
47
|
+
Let your OpenClaw agent send voice messages, interactive cards, and forward messages through Mutiro by allowing the `mutiro*` tools:
|
|
120
48
|
|
|
121
|
-
```
|
|
122
|
-
tools
|
|
123
|
-
profile: messaging
|
|
124
|
-
alsoAllow:
|
|
125
|
-
- "mutiro*"
|
|
49
|
+
```bash
|
|
50
|
+
openclaw config set tools.alsoAllow '["mutiro*"]'
|
|
126
51
|
```
|
|
127
52
|
|
|
128
|
-
|
|
129
|
-
|
|
53
|
+
If you already curate `tools.alsoAllow`, merge `"mutiro*"` into your existing list instead of overwriting — the command above replaces the array.
|
|
54
|
+
|
|
55
|
+
## Access control, enforced at the edge
|
|
130
56
|
|
|
131
|
-
|
|
57
|
+
Mutiro runs the allowlist on its servers — not in your agent. Denied users are rejected before their messages reach OpenClaw, so agent-side bugs can never leak access to someone who shouldn't have it. This is a stronger posture than in-agent filtering and a real differentiator over generic bot channels.
|
|
132
58
|
|
|
133
|
-
|
|
134
|
-
`allowFrom`. Denied users are blocked at the Mutiro server — their messages
|
|
135
|
-
never reach OpenClaw at all. Manage it with the `mutiro` CLI:
|
|
59
|
+
One extra CLI step buys you that posture:
|
|
136
60
|
|
|
137
61
|
```bash
|
|
138
62
|
mutiro agents allowlist get <agent-username>
|
|
@@ -140,134 +64,37 @@ mutiro agents allow <agent-username> <username>
|
|
|
140
64
|
mutiro agents deny <agent-username> <username>
|
|
141
65
|
```
|
|
142
66
|
|
|
143
|
-
|
|
144
|
-
the full command reference and a paste-into-AI prompt you can hand to your
|
|
145
|
-
assistant when you want help managing sharing and security posture.
|
|
146
|
-
|
|
147
|
-
## What This Repo Is
|
|
148
|
-
|
|
149
|
-
A small reference package showing how to plug OpenClaw into Mutiro `chatbridge` as a channel plugin. Pi is a good reference for swapping Mutiro's brain with a standalone runtime; this one shows the same shape routed through OpenClaw's channel plugin contract.
|
|
150
|
-
|
|
151
|
-
- `mutiro agent host --mode=bridge` is spawned by the plugin, one process per configured Mutiro agent
|
|
152
|
-
- NDJSON envelope traffic is translated into OpenClaw inbound messages and outbound send/react/forward actions
|
|
153
|
-
- one subprocess per Mutiro agent, long-lived across conversations
|
|
154
|
-
- all outbound chat actions go back through the bridge
|
|
67
|
+
As adoption grows, we may expose the allowlist directly through the OpenClaw channel. For now it stays behind the `mutiro` CLI — a deliberate boundary that keeps access control outside the agent sandbox.
|
|
155
68
|
|
|
156
|
-
##
|
|
69
|
+
## FAQ
|
|
157
70
|
|
|
158
|
-
|
|
159
|
-
- `src/bridge-protocol.ts` — NDJSON envelope constants and `@type` URLs
|
|
160
|
-
- `src/bridge-messages.ts` — normalized message extraction and observed-turn assembly
|
|
161
|
-
- `src/bridge-client.ts` — NDJSON envelope codec plus host subprocess spawn
|
|
162
|
-
- `src/bridge-session.ts` — per-conversation observed/task/snapshot handlers
|
|
163
|
-
- `src/inbound.ts` — bridge observed message → OpenClaw inbound envelope
|
|
164
|
-
- `src/outbound.ts` — OpenClaw outbound adapter → `message.send` / `message.react` / `message.forward`
|
|
165
|
-
- `src/channel.ts` — Mutiro channel plugin definition
|
|
166
|
-
- `src/channel.runtime.ts` — runtime barrel consumed by the plugin entry
|
|
167
|
-
- `src/setup-surface.ts` — setup wizard driven by `openclaw channels add` (pick `mutiro` from the list)
|
|
168
|
-
- `src/agent-tools.ts` — `mutiro_send_voice_message`, `mutiro_send_card`, `mutiro_forward_message`
|
|
169
|
-
- `src/signal-forwarder.ts` — OpenClaw tool events → Mutiro `signal.emit` (26-entry map)
|
|
170
|
-
- `src/live-snapshot.ts` — `session.snapshot` + `task.request` handlers for live call handoff
|
|
171
|
-
- `openclaw.plugin.json` — channel manifest
|
|
172
|
-
- `run-brain.sh` — convenience launcher that boots OpenClaw's gateway against a Mutiro agent directory
|
|
173
|
-
- `docs/guides/use-openclaw-as-brain.md` — end-to-end setup guide
|
|
174
|
-
- `docs/guides/manage-allowlist.md` — paste-into-AI guide for Mutiro's server-side allowlist
|
|
71
|
+
**How do I show the OpenClaw badge on my agent?**
|
|
175
72
|
|
|
176
|
-
|
|
73
|
+
Pass `--badge lobster` when creating the agent so every Mutiro client renders the lobster next to the avatar:
|
|
177
74
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
1. Spawn `mutiro agent host --mode=bridge` from inside an OpenClaw channel plugin
|
|
183
|
-
2. Complete `ready → session.initialize → subscription.set`
|
|
184
|
-
3. Receive `message.observed` and turn it into an OpenClaw inbound envelope
|
|
185
|
-
4. Route OpenClaw outbound replies through bridge-local commands (`message.send`, `message.react`, `message.forward`, `media.upload`, `signal.emit`, `recall.search/get`)
|
|
186
|
-
5. Finish turns with `turn.end`
|
|
187
|
-
|
|
188
|
-
## Important Bridge Notes
|
|
189
|
-
|
|
190
|
-
- `message.send` is a bridge-local command, not a raw backend `SendToConversationRequest`
|
|
191
|
-
- the portable payload type is `mutiro.chatbridge.ChatBridgeSendMessageCommand`
|
|
192
|
-
- `message.send_voice` is also bridge-local and keeps TTS inside the host
|
|
193
|
-
- this reference usually replies by `conversation_id`
|
|
194
|
-
- the bridge also supports `to_username` for direct sends
|
|
195
|
-
|
|
196
|
-
## Adapter Model
|
|
197
|
-
|
|
198
|
-
The plugin process is an OpenClaw channel. It:
|
|
199
|
-
|
|
200
|
-
- spawns `mutiro agent host --mode=bridge` (one per configured Mutiro agent directory)
|
|
201
|
-
- reads and writes bridge envelopes on stdio
|
|
202
|
-
- delivers `message.observed` payloads as OpenClaw inbound messages
|
|
203
|
-
- exposes outbound send/react/forward through the standard OpenClaw `ChannelOutboundAdapter`
|
|
204
|
-
|
|
205
|
-
OpenClaw's agent runtime owns the brain layer. The plugin does not talk to Mutiro SDKs directly; everything portable flows through the chatbridge envelope.
|
|
206
|
-
|
|
207
|
-
## Supported Bridge Operations
|
|
208
|
-
|
|
209
|
-
This adapter exercises:
|
|
210
|
-
|
|
211
|
-
- `message.send`
|
|
212
|
-
- `message.send_voice`
|
|
213
|
-
- `message.react`
|
|
214
|
-
- `message.forward`
|
|
215
|
-
- `media.upload`
|
|
216
|
-
- `signal.emit`
|
|
217
|
-
- `turn.end`
|
|
218
|
-
- `recall.search`
|
|
219
|
-
- `recall.get`
|
|
220
|
-
|
|
221
|
-
## Session Model
|
|
222
|
-
|
|
223
|
-
- one Mutiro `conversation_id` maps to one OpenClaw conversation binding
|
|
224
|
-
- later turns in the same conversation reuse the same OpenClaw session, just as pi-brain reuses a Pi session
|
|
225
|
-
- `session.snapshot` is answered from recent messages cached per-conversation in the plugin
|
|
226
|
-
|
|
227
|
-
OpenClaw already owns transcript continuity across turns, so the plugin keeps its own cache narrow — just enough to answer `session.snapshot` for bridge consumers.
|
|
228
|
-
|
|
229
|
-
## Handshake
|
|
230
|
-
|
|
231
|
-
Startup flow:
|
|
232
|
-
|
|
233
|
-
1. host sends `ready`
|
|
234
|
-
2. plugin sends `session.initialize`
|
|
235
|
-
3. plugin sends `subscription.set`
|
|
236
|
-
4. host starts delivering `message.observed`
|
|
237
|
-
|
|
238
|
-
Per turn:
|
|
239
|
-
|
|
240
|
-
1. plugin acknowledges `message.observed`
|
|
241
|
-
2. plugin dispatches the observed envelope into OpenClaw's inbound pipeline
|
|
242
|
-
3. OpenClaw's reply-dispatch drives zero or more outbound bridge operations
|
|
243
|
-
4. plugin sends `turn.end`
|
|
244
|
-
|
|
245
|
-
## Debugging
|
|
246
|
-
|
|
247
|
-
Useful signals while integrating:
|
|
248
|
-
|
|
249
|
-
- `Handshake failed`
|
|
250
|
-
Bridge startup or negotiation problem.
|
|
251
|
-
- `Host error`
|
|
252
|
-
A bridge request failed outside a pending request path.
|
|
253
|
-
- `outbound bridge call failed`
|
|
254
|
-
The plugin reached the bridge and got a real host-side error.
|
|
75
|
+
```bash
|
|
76
|
+
mutiro agents create <username> "<Display>" --engine genie --badge lobster
|
|
77
|
+
```
|
|
255
78
|
|
|
256
|
-
|
|
79
|
+
For an agent that already exists, flip the badge on with:
|
|
257
80
|
|
|
258
81
|
```bash
|
|
259
|
-
|
|
82
|
+
mutiro agents update-profile <agent-username> --badge lobster
|
|
260
83
|
```
|
|
261
84
|
|
|
262
|
-
|
|
85
|
+
**I don't have a Mutiro agent yet — what's the fastest way to create one?**
|
|
86
|
+
|
|
87
|
+
Paste this prompt into your AI assistant (Claude, Cursor, Windsurf, …):
|
|
88
|
+
|
|
89
|
+
> Read https://mutiro.com/docs/guides/create-agent and help me create a Mutiro agent step by step. Use `--badge lobster` on `mutiro agents create` so the agent shows the OpenClaw badge.
|
|
263
90
|
|
|
264
|
-
|
|
91
|
+
Or follow the [Mutiro create-agent guide](https://www.mutiro.com/docs/guides/create-agent) by hand.
|
|
265
92
|
|
|
266
|
-
|
|
93
|
+
## Resources
|
|
267
94
|
|
|
268
|
-
-
|
|
269
|
-
-
|
|
270
|
-
-
|
|
271
|
-
-
|
|
272
|
-
-
|
|
273
|
-
-
|
|
95
|
+
- [Use OpenClaw as brain](./docs/guides/use-openclaw-as-brain.md)
|
|
96
|
+
- [Manage the Mutiro allowlist](./docs/guides/manage-allowlist.md)
|
|
97
|
+
- [Mutiro manual](https://mutiro.com/docs/manual)
|
|
98
|
+
- [Mutiro CLI reference](https://mutiro.com/docs/cli)
|
|
99
|
+
- [OpenClaw documentation](https://openclaw.ai)
|
|
100
|
+
- Sibling repo: [`pi-brain`](https://github.com/mutirolabs/pi-brain) — the Pi equivalent, a standalone bridge rather than an OpenClaw extension
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Plugin entry. Consumed by OpenClaw's bundled channel loader via the
|
|
2
|
+
// `openclaw.extensions` field in package.json.
|
|
3
|
+
//
|
|
4
|
+
// `defineBundledChannelEntry` wires the channel plugin descriptor (loaded
|
|
5
|
+
// from ./src/channel.ts) into OpenClaw's registry. The heavier runtime
|
|
6
|
+
// module (./src/channel.runtime.ts) is loaded lazily from inside the channel
|
|
7
|
+
// plugin itself (via `createLazyRuntimeNamedExport`), so we do not need to
|
|
8
|
+
// register it here as a `PluginRuntime` setter.
|
|
9
|
+
import { defineBundledChannelEntry } from "openclaw/plugin-sdk/channel-entry-contract";
|
|
10
|
+
export default defineBundledChannelEntry({
|
|
11
|
+
id: "mutiro",
|
|
12
|
+
name: "Mutiro",
|
|
13
|
+
description: "The official Mutiro Channel extension for OpenClaw.",
|
|
14
|
+
importMetaUrl: import.meta.url,
|
|
15
|
+
plugin: {
|
|
16
|
+
specifier: "./src/channel.js",
|
|
17
|
+
exportName: "mutiroPlugin",
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,+CAA+C;AAC/C,EAAE;AACF,0EAA0E;AAC1E,uEAAuE;AACvE,6EAA6E;AAC7E,2EAA2E;AAC3E,gDAAgD;AAEhD,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AAEvF,eAAe,yBAAyB,CAAC;IACvC,EAAE,EAAE,QAAQ;IACZ,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,qDAAqD;IAClE,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG;IAC9B,MAAM,EAAE;QACN,SAAS,EAAE,kBAAkB;QAC7B,UAAU,EAAE,cAAc;KAC3B;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Message-action adapter for the shared `message` tool. Teaches OpenClaw
|
|
2
|
+
// which actions our plugin handles (react, forward) and dispatches them
|
|
3
|
+
// into the bridge via `channel.runtime.ts`. Without this adapter the tool
|
|
4
|
+
// rejects with "Channel mutiro is unavailable for message actions".
|
|
5
|
+
//
|
|
6
|
+
// Kept compact: `describeMessageTool` returns a fixed action list, and
|
|
7
|
+
// `handleAction` does a dynamic import so the heavy runtime stays off the
|
|
8
|
+
// hot plugin-registration path.
|
|
9
|
+
const MUTIRO_HANDLED_ACTIONS = [
|
|
10
|
+
"react",
|
|
11
|
+
];
|
|
12
|
+
const MUTIRO_HANDLED_ACTION_SET = new Set(MUTIRO_HANDLED_ACTIONS);
|
|
13
|
+
const readStringArg = (params, ...keys) => {
|
|
14
|
+
for (const key of keys) {
|
|
15
|
+
const value = params[key];
|
|
16
|
+
if (typeof value === "string") {
|
|
17
|
+
const trimmed = value.trim();
|
|
18
|
+
if (trimmed)
|
|
19
|
+
return trimmed;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return undefined;
|
|
23
|
+
};
|
|
24
|
+
export const mutiroMessageActions = {
|
|
25
|
+
describeMessageTool: () => ({
|
|
26
|
+
actions: MUTIRO_HANDLED_ACTIONS,
|
|
27
|
+
capabilities: [],
|
|
28
|
+
}),
|
|
29
|
+
supportsAction: ({ action }) => MUTIRO_HANDLED_ACTION_SET.has(action),
|
|
30
|
+
handleAction: async (ctx) => {
|
|
31
|
+
const { handleMutiroMessageAction } = await import("./channel.runtime.js");
|
|
32
|
+
return handleMutiroMessageAction({
|
|
33
|
+
action: ctx.action,
|
|
34
|
+
params: ctx.params,
|
|
35
|
+
accountId: ctx.accountId ?? undefined,
|
|
36
|
+
readStringArg,
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/actions.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,wEAAwE;AACxE,0EAA0E;AAC1E,oEAAoE;AACpE,EAAE;AACF,uEAAuE;AACvE,0EAA0E;AAC1E,gCAAgC;AAQhC,MAAM,sBAAsB,GAAwC;IAClE,OAAO;CACC,CAAC;AAEX,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAA2B,sBAAsB,CAAC,CAAC;AAE5F,MAAM,aAAa,GAAG,CACpB,MAA+B,EAC/B,GAAG,IAAc,EACG,EAAE;IACtB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;YAC7B,IAAI,OAAO;gBAAE,OAAO,OAAO,CAAC;QAC9B,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAgC;IAC/D,mBAAmB,EAAE,GAAG,EAAE,CAAC,CAAC;QAC1B,OAAO,EAAE,sBAAsB;QAC/B,YAAY,EAAE,EAAE;KACjB,CAAC;IAEF,cAAc,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,yBAAyB,CAAC,GAAG,CAAC,MAAM,CAAC;IAErE,YAAY,EAAE,KAAK,EAAE,GAAgC,EAAE,EAAE;QACvD,MAAM,EAAE,yBAAyB,EAAE,GAAG,MAAM,MAAM,CAAC,sBAAsB,CAAC,CAAC;QAC3E,OAAO,yBAAyB,CAAC;YAC/B,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,SAAS,EAAE,GAAG,CAAC,SAAS,IAAI,SAAS;YACrC,aAAa;SACd,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
|