@vainplex/openclaw-membrane 0.3.0 → 0.3.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 +10 -7
- package/dist/index.js +13 -5
- package/dist/mapping.js +5 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -244,13 +244,16 @@ This plugin is the **bridge layer** — it handles OpenClaw event mapping, buffe
|
|
|
244
244
|
|
|
245
245
|
## Vainplex OpenClaw Plugin Suite
|
|
246
246
|
|
|
247
|
-
| # | Plugin |
|
|
248
|
-
|
|
249
|
-
| 1 | [@vainplex/openclaw-nats-eventstore](https://github.com/alberthild/openclaw-nats-eventstore) | 0.2.1 |
|
|
250
|
-
| 2 | [@vainplex/openclaw-cortex](https://github.com/alberthild/openclaw-cortex) | 0.4.
|
|
251
|
-
| 3 | [@vainplex/openclaw-governance](https://github.com/alberthild/openclaw-governance) | 0.
|
|
252
|
-
| 4 | [@vainplex/openclaw-knowledge-engine](https://github.com/alberthild/openclaw-knowledge-engine) | 0.1.4 | 94 | LanceDB knowledge extraction + search |
|
|
253
|
-
| 5 |
|
|
247
|
+
| # | Plugin | npm | Tests | Description |
|
|
248
|
+
|---|--------|-----|-------|-------------|
|
|
249
|
+
| 1 | [@vainplex/openclaw-nats-eventstore](https://github.com/alberthild/vainplex-openclaw/tree/main/packages/openclaw-nats-eventstore) | 0.2.1 | 55 | NATS JetStream event persistence + audit trail |
|
|
250
|
+
| 2 | [@vainplex/openclaw-cortex](https://github.com/alberthild/vainplex-openclaw/tree/main/packages/openclaw-cortex) | 0.4.5 | 756 | Conversation intelligence — threads, decisions, boot context, trace analysis |
|
|
251
|
+
| 3 | [@vainplex/openclaw-governance](https://github.com/alberthild/vainplex-openclaw/tree/main/packages/openclaw-governance) | 0.5.5 | 767 | Policy engine — trust scores, credential guard, production safeguards |
|
|
252
|
+
| 4 | [@vainplex/openclaw-knowledge-engine](https://github.com/alberthild/vainplex-openclaw/tree/main/packages/openclaw-knowledge-engine) | 0.1.4 | 94 | LanceDB knowledge extraction + search |
|
|
253
|
+
| 5 | [@vainplex/openclaw-membrane](https://github.com/alberthild/openclaw-membrane) | 0.3.0 | 44 | Membrane episodic memory bridge — gRPC sidecar |
|
|
254
|
+
|
|
255
|
+
All monorepo plugins: [alberthild/vainplex-openclaw](https://github.com/alberthild/vainplex-openclaw) · Membrane: [alberthild/openclaw-membrane](https://github.com/alberthild/openclaw-membrane)
|
|
256
|
+
|
|
254
257
|
|
|
255
258
|
## License
|
|
256
259
|
|
package/dist/index.js
CHANGED
|
@@ -149,17 +149,25 @@ const SEARCH_TOOL_SCHEMA = {
|
|
|
149
149
|
const plugin = {
|
|
150
150
|
id: 'openclaw-membrane',
|
|
151
151
|
name: '@vainplex/openclaw-membrane',
|
|
152
|
-
version: '0.3.
|
|
152
|
+
version: '0.3.2',
|
|
153
153
|
register(api) {
|
|
154
154
|
const config = createConfig(api.pluginConfig);
|
|
155
155
|
const logger = api.logger;
|
|
156
156
|
const client = new MembraneClient(config.grpc_endpoint);
|
|
157
157
|
const reliability = new ReliabilityManager(config.buffer_size, async (item) => { await client.call(item.method, item.payload); }, logger);
|
|
158
158
|
logger.info(`[membrane] Registered bridge to ${config.grpc_endpoint}`);
|
|
159
|
-
// Write path: subscribe to
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
// Write path: subscribe to specific OpenClaw hooks
|
|
160
|
+
// OpenClaw fires named hooks, not a generic 'event' hook
|
|
161
|
+
const hookHandler = (type) => (event, ctx) => {
|
|
162
|
+
const e = event;
|
|
163
|
+
const c = ctx;
|
|
164
|
+
handleEvent({ type, payload: e, context: c }, config, reliability, logger);
|
|
165
|
+
};
|
|
166
|
+
api.on('message_received', hookHandler('message_received'));
|
|
167
|
+
api.on('message_sent', hookHandler('message_sent'));
|
|
168
|
+
api.on('message_sending', hookHandler('message_sending'));
|
|
169
|
+
api.on('after_tool_call', hookHandler('after_tool_call'));
|
|
170
|
+
api.on('session_start', hookHandler('session_start'));
|
|
163
171
|
// Search tool: gRPC Retrieve (boosts salience via rehearsal)
|
|
164
172
|
api.registerTool({
|
|
165
173
|
name: 'membrane_search',
|
package/dist/mapping.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Event mapping: OpenClaw events → Membrane gRPC payloads.
|
|
3
3
|
* Each event type has its own mapping function.
|
|
4
4
|
*/
|
|
5
|
+
import { randomUUID } from 'crypto';
|
|
5
6
|
export const VALID_SENSITIVITIES = ['public', 'low', 'medium', 'high', 'hyper'];
|
|
6
7
|
// --- Sensitivity ---
|
|
7
8
|
export function mapSensitivity(event, defaultConfig) {
|
|
@@ -34,6 +35,7 @@ function mapMessageReceived(payload, timestamp, sensitivity) {
|
|
|
34
35
|
payload: {
|
|
35
36
|
source: 'openclaw',
|
|
36
37
|
event_kind: 'user_message',
|
|
38
|
+
ref: `msg-recv-${randomUUID()}`,
|
|
37
39
|
summary: typeof payload.content === 'string' ? payload.content : '',
|
|
38
40
|
timestamp,
|
|
39
41
|
sensitivity,
|
|
@@ -46,6 +48,7 @@ function mapMessageSent(payload, timestamp, sensitivity) {
|
|
|
46
48
|
payload: {
|
|
47
49
|
source: 'openclaw',
|
|
48
50
|
event_kind: 'assistant_message',
|
|
51
|
+
ref: `msg-sent-${randomUUID()}`,
|
|
49
52
|
summary: typeof payload.content === 'string' ? payload.content : '',
|
|
50
53
|
timestamp,
|
|
51
54
|
sensitivity,
|
|
@@ -58,6 +61,7 @@ function mapSessionStart(timestamp, sensitivity) {
|
|
|
58
61
|
payload: {
|
|
59
62
|
source: 'openclaw',
|
|
60
63
|
event_kind: 'session_init',
|
|
64
|
+
ref: `session-${randomUUID()}`,
|
|
61
65
|
summary: 'New session started',
|
|
62
66
|
timestamp,
|
|
63
67
|
sensitivity,
|
|
@@ -108,6 +112,7 @@ export function mapEvent(event, sensitivity) {
|
|
|
108
112
|
case 'message_received':
|
|
109
113
|
return mapMessageReceived(event.payload, timestamp, sensitivity);
|
|
110
114
|
case 'message_sent':
|
|
115
|
+
case 'message_sending':
|
|
111
116
|
return mapMessageSent(event.payload, timestamp, sensitivity);
|
|
112
117
|
case 'session_start':
|
|
113
118
|
return mapSessionStart(timestamp, sensitivity);
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "openclaw-membrane",
|
|
3
3
|
"name": "@vainplex/openclaw-membrane",
|
|
4
4
|
"description": "Membrane gRPC bridge for OpenClaw — episodic memory ingestion, search tool, and auto-context injection",
|
|
5
|
-
"version": "0.3.
|
|
5
|
+
"version": "0.3.2",
|
|
6
6
|
"configSchema": {
|
|
7
7
|
"type": "object",
|
|
8
8
|
"additionalProperties": true,
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vainplex/openclaw-membrane",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Membrane gRPC bridge for OpenClaw — episodic memory ingestion, search tool, and auto-context injection via Membrane sidecar",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"build": "tsc",
|
|
9
|
+
"build": "tsc && cp -r assets dist/",
|
|
10
10
|
"test": "vitest run",
|
|
11
11
|
"dev": "vitest"
|
|
12
12
|
},
|