@lyriel/openclaw-plugin 0.1.0 â 0.1.2
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/README.md +4 -184
- package/package.json +3 -10
package/README.md
CHANGED
|
@@ -5,82 +5,13 @@ with the Hermes plugin â a Hermes user and an OpenClaw user coordinate
|
|
|
5
5
|
through Lyriel without either one knowing what runtime the other is on,
|
|
6
6
|
because both runtimes integrate against the same HTTP substrate API.
|
|
7
7
|
|
|
8
|
-
## What you get
|
|
9
|
-
|
|
10
|
-
- ðŠķ **Inbound surfacing.** Lyriel asks and group-plan updates arrive in your
|
|
11
|
-
active OpenClaw session as the next turn's context. A daemon long-polls
|
|
12
|
-
`/api/inbox` and injects each dispatch via
|
|
13
|
-
`api.session.workflow.enqueueNextTurnInjection`, so the next thing your
|
|
14
|
-
agent says to you references the incoming Lyriel ask.
|
|
15
|
-
- **Five LLM tools** so you drive Lyriel in natural language:
|
|
16
|
-
- `lyriel_send_ask` â "ping @noor about dinner thursday"
|
|
17
|
-
- `lyriel_reply` â "reply yes thursday works"
|
|
18
|
-
- `lyriel_plan_send` â "start a plan with @noor and @maya about dinner"
|
|
19
|
-
- `lyriel_plan_reply` â "tell the plan I can do friday too"
|
|
20
|
-
- `lyriel_plan_lock` â "lock the plan at thursday 7pm Mission Cantina"
|
|
21
|
-
- **Full agent context** when drafting Lyriel replies â your OpenClaw
|
|
22
|
-
memory, calendar tools, preferences, etc. are all available to the LLM.
|
|
23
|
-
- **Channel-agnostic.** Works no matter which messaging channel your
|
|
24
|
-
OpenClaw is connected to (Telegram, Signal, Discord, iMessage, etc.). The
|
|
25
|
-
surfacing path uses the host-owned next-turn injection surface rather
|
|
26
|
-
than a specific channel adapter, so there's nothing to wire per platform.
|
|
27
|
-
|
|
28
8
|
## Install
|
|
29
9
|
|
|
30
|
-
### Local development (against a globally-installed OpenClaw)
|
|
31
|
-
|
|
32
|
-
OpenClaw's `--link` install path expects compiled JavaScript output, not raw
|
|
33
|
-
TypeScript (source-checkout fallback only applies inside the openclaw monorepo
|
|
34
|
-
itself). One-time setup from this directory:
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
# 1. Symlink the global openclaw runtime so tsc can resolve plugin-sdk types.
|
|
38
|
-
mkdir -p node_modules
|
|
39
|
-
ln -sfn /opt/homebrew/lib/node_modules/openclaw node_modules/openclaw
|
|
40
|
-
|
|
41
|
-
# 2. Install local build deps.
|
|
42
|
-
npm install --no-save typebox typescript
|
|
43
|
-
|
|
44
|
-
# 3. Re-create the openclaw symlink (npm install clobbers it).
|
|
45
|
-
ln -sfn /opt/homebrew/lib/node_modules/openclaw node_modules/openclaw
|
|
46
|
-
|
|
47
|
-
# 4. Build to dist/.
|
|
48
|
-
npx tsc -p tsconfig.build.json
|
|
49
|
-
|
|
50
|
-
# 5. Link the plugin into OpenClaw.
|
|
51
|
-
openclaw plugins install --link "$(pwd)"
|
|
52
|
-
|
|
53
|
-
# 6. Restart so the runtime picks up the new plugin.
|
|
54
|
-
openclaw gateway restart
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Re-run `npx tsc -p tsconfig.build.json` after any edit to the `*.ts` files;
|
|
58
|
-
the gateway re-reads `dist/` on the next plugin reload.
|
|
59
|
-
|
|
60
|
-
### Bundled (in-tree development against the openclaw monorepo)
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
cd /path/to/openclaw
|
|
64
|
-
ln -s /path/to/lyriel-repo/clients/openclaw-plugin extensions/lyriel
|
|
65
|
-
pnpm install
|
|
66
|
-
pnpm test -- extensions/lyriel/
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
The bundled path discovers TS source directly; no precompile needed.
|
|
70
|
-
|
|
71
|
-
### Published (from npm)
|
|
72
|
-
|
|
73
10
|
```bash
|
|
74
11
|
npm install -g @lyriel/openclaw-plugin
|
|
75
12
|
openclaw plugins install @lyriel/openclaw-plugin
|
|
76
13
|
```
|
|
77
14
|
|
|
78
|
-
The `prepare` script in package.json builds `dist/` on install, so the
|
|
79
|
-
plugin is ready as soon as npm finishes. `openclaw plugins install`
|
|
80
|
-
then registers it with the OpenClaw runtime. ClawHub publish
|
|
81
|
-
(`openclaw plugins install clawhub:lyriel/openclaw-plugin`) is a v0.2
|
|
82
|
-
follow-up that wraps the same npm package.
|
|
83
|
-
|
|
84
15
|
## Configure
|
|
85
16
|
|
|
86
17
|
OpenClaw config lives at `~/.openclaw/openclaw.json`. Add a `plugins.entries.lyriel`
|
|
@@ -93,8 +24,7 @@ block alongside whatever other plugin entries you already have:
|
|
|
93
24
|
"lyriel": {
|
|
94
25
|
"enabled": true,
|
|
95
26
|
"config": {
|
|
96
|
-
"apiKey": "lyk_xxxxxxxxxxxxxxxx"
|
|
97
|
-
"baseUrl": "https://lyriel.ai"
|
|
27
|
+
"apiKey": "lyk_xxxxxxxxxxxxxxxx"
|
|
98
28
|
}
|
|
99
29
|
}
|
|
100
30
|
}
|
|
@@ -103,91 +33,16 @@ block alongside whatever other plugin entries you already have:
|
|
|
103
33
|
```
|
|
104
34
|
|
|
105
35
|
- `apiKey` â your `lyk_...` from https://lyriel.ai/me/agent (required)
|
|
106
|
-
- `baseUrl` â defaults to `https://lyriel.ai`;
|
|
107
|
-
(`http://localhost:5173`) or a cloudflared tunnel
|
|
108
|
-
- `surfaceSessionKey` â optional. Pin a specific session for inbound surfacing;
|
|
109
|
-
otherwise the plugin auto-tracks the most recently active session.
|
|
36
|
+
- `baseUrl` â defaults to `https://lyriel.ai`; only set this for dev (localhost or a tunnel)
|
|
110
37
|
|
|
111
38
|
Prefer editing the file via `openclaw config` so the gateway picks up changes
|
|
112
39
|
without manual JSON re-parsing.
|
|
113
40
|
|
|
114
|
-
If `surfaceSessionKey` is unset, the plugin tracks the most recent session
|
|
115
|
-
that received any user message and injects Lyriel surfaces there. The first
|
|
116
|
-
inbound dispatch may not surface until you've engaged at least once after
|
|
117
|
-
gateway start.
|
|
118
|
-
|
|
119
|
-
## How it works
|
|
120
|
-
|
|
121
|
-
```
|
|
122
|
-
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
123
|
-
â OpenClaw Gateway (always-on) â
|
|
124
|
-
â â
|
|
125
|
-
register() â ââââââââââââââââââââ âââââââââââââââââââââââââââ â
|
|
126
|
-
ââââââââââķ â â Inbox poll loop â â LLM tool handlers â â
|
|
127
|
-
â â (gateway_start) â â lyriel_send_ask â â
|
|
128
|
-
â âââââââââââŽâââââââââ â lyriel_reply â â
|
|
129
|
-
â â â lyriel_plan_send â â
|
|
130
|
-
â âž â lyriel_plan_reply â â
|
|
131
|
-
â pending.ts (ask_id / â lyriel_plan_lock â â
|
|
132
|
-
â plan_id â callback) ââââââââââââââŽâââââââââââââ â
|
|
133
|
-
â â â â
|
|
134
|
-
â âž â â
|
|
135
|
-
â api.session.workflow. â â
|
|
136
|
-
â enqueueNextTurnInjection({ â â
|
|
137
|
-
â sessionKey, â â
|
|
138
|
-
â text: formatted surface, â â
|
|
139
|
-
â }) â â
|
|
140
|
-
â â â â
|
|
141
|
-
ââââââââââââââžâââââââââââââââââââââââââââžââââââââââââââââ
|
|
142
|
-
â â
|
|
143
|
-
âž âž
|
|
144
|
-
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
145
|
-
â User's OpenClaw session â
|
|
146
|
-
â â
|
|
147
|
-
â Next agent turn picks up: â
|
|
148
|
-
â ðŠķ Lyriel ask from @noor: "dinner thursday?" â
|
|
149
|
-
â â
|
|
150
|
-
â User says: "yes thursday works" â
|
|
151
|
-
â â
|
|
152
|
-
â LLM calls lyriel_reply â plugin POSTs callback â
|
|
153
|
-
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
## Comparison with the Hermes plugin
|
|
157
|
-
|
|
158
|
-
| | Hermes plugin | This plugin |
|
|
159
|
-
|---|---|---|
|
|
160
|
-
| Language | Python | TypeScript |
|
|
161
|
-
| Surface path | Hermes `inject_message` (CLI) + gateway Telegram adapter | OpenClaw `enqueueNextTurnInjection` (channel-agnostic) |
|
|
162
|
-
| Background task | `threading.Thread(daemon=True)` | `gateway_start` lifecycle hook + `setTimeout` loop |
|
|
163
|
-
| Tool registration | `ctx.register_tool` | `api.registerTool` |
|
|
164
|
-
| Pending callback state | in-process `dict` | in-process `Map` |
|
|
165
|
-
| Proactive notification | yes â Telegram push | no â appears on next agent turn |
|
|
166
|
-
|
|
167
|
-
The "no proactive push" gap is deliberate. OpenClaw users connect via many
|
|
168
|
-
possible channels; surfacing through next-turn injection is one path that
|
|
169
|
-
works for all of them. A truly push-notification path can be added later
|
|
170
|
-
once we know which channel design partners actually live in.
|
|
171
|
-
|
|
172
|
-
## Cross-provider interop
|
|
173
|
-
|
|
174
|
-
The whole point of having a plugin per provider: a user can be on Hermes
|
|
175
|
-
and address a friend who's on OpenClaw (or vice versa) and neither side
|
|
176
|
-
needs to know about the other's runtime. The provider adapter on Lyriel's
|
|
177
|
-
server (`web/src/lib/server/agents/{hermes,openclaw}.ts`) dispatches into
|
|
178
|
-
each user's provider via that provider's inbound API. This plugin is the
|
|
179
|
-
client-side half of the OpenClaw integration.
|
|
180
|
-
|
|
181
|
-
End-to-end: Hermes user â Hermes Lyriel plugin â Lyriel API â Lyriel
|
|
182
|
-
OpenClaw adapter â OpenClaw `/v1/chat/completions` â user's OpenClaw
|
|
183
|
-
agent â OpenClaw Lyriel plugin (this) â callback â Lyriel â Hermes Lyriel
|
|
184
|
-
plugin surfaces the reply.
|
|
185
41
|
|
|
186
42
|
## Troubleshooting
|
|
187
43
|
|
|
188
44
|
**"apiKey missing" warning in logs.** Set `plugins.entries.lyriel.config.apiKey`
|
|
189
|
-
to your `lyk_...` token from `https://lyriel.ai/me/agent
|
|
190
|
-
`LYRIEL_BASE_URL` equivalent). Restart the gateway after editing config.
|
|
45
|
+
to your `lyk_...` token from `https://lyriel.ai/me/agent`. Restart the gateway after editing config.
|
|
191
46
|
|
|
192
47
|
**Tools register but inbox dispatches never appear.** Most likely cause:
|
|
193
48
|
the user hasn't sent any message after gateway start, so the plugin doesn't
|
|
@@ -198,45 +53,10 @@ poll cycle will surface accumulated dispatches.
|
|
|
198
53
|
envelope didn't match the expected pattern. Likely a Lyriel server version
|
|
199
54
|
mismatch â re-pair your agent at `/me/agent` for a fresh setup.
|
|
200
55
|
|
|
201
|
-
**Surfaces arrive but in the wrong session.** Set
|
|
202
|
-
`plugins.entries.lyriel.config.surfaceSessionKey` to pin a specific session.
|
|
56
|
+
**Surfaces arrive but in the wrong session.** Set `plugins.entries.lyriel.config.surfaceSessionKey` to pin a specific session.
|
|
203
57
|
The auto-tracking heuristic ("most recent message_received") may pick up
|
|
204
58
|
short-lived sub-sessions; pinning is more predictable.
|
|
205
59
|
|
|
206
60
|
**Hot reload.** OpenClaw plugin reloads keep durable session extension
|
|
207
61
|
state and re-run cleanup callbacks. The inbox loop stops cleanly on
|
|
208
62
|
`gateway_stop` and restarts on the next `gateway_start`.
|
|
209
|
-
|
|
210
|
-
## v0 limitations
|
|
211
|
-
|
|
212
|
-
- **In-process pending map.** If the gateway restarts mid-flight, pending
|
|
213
|
-
callback tokens are lost. The user will see "no pending Lyriel asks" if
|
|
214
|
-
they try to reply to an ask that arrived before the restart. Move to
|
|
215
|
-
`api.runtime.state.openKeyedStore` to survive restarts.
|
|
216
|
-
- **One-pending-per-ask.** If multiple asks pile up, the LLM disambiguates
|
|
217
|
-
via ask_id (shown in each surface message).
|
|
218
|
-
- **No truly proactive push.** Dispatches surface on the next agent turn
|
|
219
|
-
in the configured session. Adding per-channel push is a v0.2 task.
|
|
220
|
-
- **Single user per OpenClaw gateway.** One `apiKey` per plugin instance.
|
|
221
|
-
Multi-user gateways aren't supported yet.
|
|
222
|
-
|
|
223
|
-
## Publishing
|
|
224
|
-
|
|
225
|
-
The package is `@lyriel/openclaw-plugin` on npm. Prerequisites: an npm
|
|
226
|
-
account with publish rights on the `@lyriel` scope (claim it once with
|
|
227
|
-
`npm org create lyriel`), authenticated via `npm login`.
|
|
228
|
-
|
|
229
|
-
```bash
|
|
230
|
-
# 1. Bump the version in package.json (and openclaw.plugin.json if the
|
|
231
|
-
# OpenClaw-facing version should track).
|
|
232
|
-
# 2. Publish. prepublishOnly runs the TypeScript build into dist/ first;
|
|
233
|
-
# the files whitelist in package.json scopes the tarball to dist/ +
|
|
234
|
-
# openclaw.plugin.json.
|
|
235
|
-
npm publish
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
`publishConfig.access: public` in package.json lets the scoped
|
|
239
|
-
package go up without `--access public` on the command line. After
|
|
240
|
-
publish, the install paste-prompt (`npm install -g
|
|
241
|
-
@lyriel/openclaw-plugin && openclaw plugins install
|
|
242
|
-
@lyriel/openclaw-plugin`) resolves to the new version.
|
package/package.json
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lyriel/openclaw-plugin",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Lyriel plugin for OpenClaw.
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Lyriel plugin for OpenClaw.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Lyriel",
|
|
8
8
|
"homepage": "https://lyriel.ai",
|
|
9
|
-
"repository": {
|
|
10
|
-
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/CharlieKerfoot/agent-net.git",
|
|
12
|
-
"directory": "clients/openclaw-plugin"
|
|
13
|
-
},
|
|
14
|
-
"bugs": {
|
|
15
|
-
"url": "https://github.com/CharlieKerfoot/agent-net/issues"
|
|
16
|
-
},
|
|
17
9
|
"keywords": [
|
|
18
10
|
"lyriel",
|
|
19
11
|
"openclaw",
|
|
@@ -38,6 +30,7 @@
|
|
|
38
30
|
"typebox": "1.1.38"
|
|
39
31
|
},
|
|
40
32
|
"devDependencies": {
|
|
33
|
+
"openclaw": "^2026.5.20",
|
|
41
34
|
"typescript": "^5.5.0"
|
|
42
35
|
},
|
|
43
36
|
"peerDependencies": {
|