openclaw-event-server-plugin 1.0.0

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.
Files changed (209) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +473 -0
  3. package/config.example.json +203 -0
  4. package/dist/broadcast/index.d.ts +3 -0
  5. package/dist/broadcast/index.d.ts.map +1 -0
  6. package/dist/broadcast/index.js +19 -0
  7. package/dist/broadcast/index.js.map +1 -0
  8. package/dist/broadcast/queue.d.ts +63 -0
  9. package/dist/broadcast/queue.d.ts.map +1 -0
  10. package/dist/broadcast/queue.js +259 -0
  11. package/dist/broadcast/queue.js.map +1 -0
  12. package/dist/broadcast/webhook.d.ts +30 -0
  13. package/dist/broadcast/webhook.d.ts.map +1 -0
  14. package/dist/broadcast/webhook.js +184 -0
  15. package/dist/broadcast/webhook.js.map +1 -0
  16. package/dist/broadcast/websocketServer.d.ts +90 -0
  17. package/dist/broadcast/websocketServer.d.ts.map +1 -0
  18. package/dist/broadcast/websocketServer.js +403 -0
  19. package/dist/broadcast/websocketServer.js.map +1 -0
  20. package/dist/config/config-types.d.ts +280 -0
  21. package/dist/config/config-types.d.ts.map +1 -0
  22. package/dist/config/config-types.js +3 -0
  23. package/dist/config/config-types.js.map +1 -0
  24. package/dist/config/default-config.d.ts +3 -0
  25. package/dist/config/default-config.d.ts.map +1 -0
  26. package/dist/config/default-config.js +136 -0
  27. package/dist/config/default-config.js.map +1 -0
  28. package/dist/config/env.d.ts +6 -0
  29. package/dist/config/env.d.ts.map +1 -0
  30. package/dist/config/env.js +160 -0
  31. package/dist/config/env.js.map +1 -0
  32. package/dist/config/event-types.d.ts +5 -0
  33. package/dist/config/event-types.d.ts.map +1 -0
  34. package/dist/config/event-types.js +54 -0
  35. package/dist/config/event-types.js.map +1 -0
  36. package/dist/config/handler.d.ts +9 -0
  37. package/dist/config/handler.d.ts.map +1 -0
  38. package/dist/config/handler.js +17 -0
  39. package/dist/config/handler.js.map +1 -0
  40. package/dist/config/helpers.d.ts +5 -0
  41. package/dist/config/helpers.d.ts.map +1 -0
  42. package/dist/config/helpers.js +40 -0
  43. package/dist/config/helpers.js.map +1 -0
  44. package/dist/config/index.d.ts +3 -0
  45. package/dist/config/index.d.ts.map +1 -0
  46. package/dist/config/index.js +19 -0
  47. package/dist/config/index.js.map +1 -0
  48. package/dist/config/merge.d.ts +6 -0
  49. package/dist/config/merge.d.ts.map +1 -0
  50. package/dist/config/merge.js +108 -0
  51. package/dist/config/merge.js.map +1 -0
  52. package/dist/config/schema-hook-bridge.d.ts +594 -0
  53. package/dist/config/schema-hook-bridge.d.ts.map +1 -0
  54. package/dist/config/schema-hook-bridge.js +423 -0
  55. package/dist/config/schema-hook-bridge.js.map +1 -0
  56. package/dist/config/schema.d.ts +915 -0
  57. package/dist/config/schema.d.ts.map +1 -0
  58. package/dist/config/schema.js +323 -0
  59. package/dist/config/schema.js.map +1 -0
  60. package/dist/config/types.d.ts +9 -0
  61. package/dist/config/types.d.ts.map +1 -0
  62. package/dist/config/types.js +28 -0
  63. package/dist/config/types.js.map +1 -0
  64. package/dist/config/validate-hook-bridge.d.ts +3 -0
  65. package/dist/config/validate-hook-bridge.d.ts.map +1 -0
  66. package/dist/config/validate-hook-bridge.js +246 -0
  67. package/dist/config/validate-hook-bridge.js.map +1 -0
  68. package/dist/config/validate.d.ts +17 -0
  69. package/dist/config/validate.d.ts.map +1 -0
  70. package/dist/config/validate.js +194 -0
  71. package/dist/config/validate.js.map +1 -0
  72. package/dist/events/index.d.ts +4 -0
  73. package/dist/events/index.d.ts.map +1 -0
  74. package/dist/events/index.js +20 -0
  75. package/dist/events/index.js.map +1 -0
  76. package/dist/events/redaction.d.ts +5 -0
  77. package/dist/events/redaction.d.ts.map +1 -0
  78. package/dist/events/redaction.js +46 -0
  79. package/dist/events/redaction.js.map +1 -0
  80. package/dist/events/signing.d.ts +8 -0
  81. package/dist/events/signing.d.ts.map +1 -0
  82. package/dist/events/signing.js +35 -0
  83. package/dist/events/signing.js.map +1 -0
  84. package/dist/events/types.d.ts +125 -0
  85. package/dist/events/types.d.ts.map +1 -0
  86. package/dist/events/types.js +9 -0
  87. package/dist/events/types.js.map +1 -0
  88. package/dist/hooks/agent-hooks.d.ts +59 -0
  89. package/dist/hooks/agent-hooks.d.ts.map +1 -0
  90. package/dist/hooks/agent-hooks.js +116 -0
  91. package/dist/hooks/agent-hooks.js.map +1 -0
  92. package/dist/hooks/command-hooks.d.ts +13 -0
  93. package/dist/hooks/command-hooks.d.ts.map +1 -0
  94. package/dist/hooks/command-hooks.js +26 -0
  95. package/dist/hooks/command-hooks.js.map +1 -0
  96. package/dist/hooks/event-factory.d.ts +21 -0
  97. package/dist/hooks/event-factory.d.ts.map +1 -0
  98. package/dist/hooks/event-factory.js +31 -0
  99. package/dist/hooks/event-factory.js.map +1 -0
  100. package/dist/hooks/gateway-hooks.d.ts +14 -0
  101. package/dist/hooks/gateway-hooks.d.ts.map +1 -0
  102. package/dist/hooks/gateway-hooks.js +43 -0
  103. package/dist/hooks/gateway-hooks.js.map +1 -0
  104. package/dist/hooks/index.d.ts +10 -0
  105. package/dist/hooks/index.d.ts.map +1 -0
  106. package/dist/hooks/index.js +26 -0
  107. package/dist/hooks/index.js.map +1 -0
  108. package/dist/hooks/message-hooks.d.ts +33 -0
  109. package/dist/hooks/message-hooks.d.ts.map +1 -0
  110. package/dist/hooks/message-hooks.js +208 -0
  111. package/dist/hooks/message-hooks.js.map +1 -0
  112. package/dist/hooks/session-hooks.d.ts +89 -0
  113. package/dist/hooks/session-hooks.d.ts.map +1 -0
  114. package/dist/hooks/session-hooks.js +253 -0
  115. package/dist/hooks/session-hooks.js.map +1 -0
  116. package/dist/hooks/status-reducer.d.ts +30 -0
  117. package/dist/hooks/status-reducer.d.ts.map +1 -0
  118. package/dist/hooks/status-reducer.js +157 -0
  119. package/dist/hooks/status-reducer.js.map +1 -0
  120. package/dist/hooks/subagent-hooks.d.ts +37 -0
  121. package/dist/hooks/subagent-hooks.d.ts.map +1 -0
  122. package/dist/hooks/subagent-hooks.js +79 -0
  123. package/dist/hooks/subagent-hooks.js.map +1 -0
  124. package/dist/hooks/subagent-tracker.d.ts +33 -0
  125. package/dist/hooks/subagent-tracker.d.ts.map +1 -0
  126. package/dist/hooks/subagent-tracker.js +73 -0
  127. package/dist/hooks/subagent-tracker.js.map +1 -0
  128. package/dist/hooks/tool-hooks.d.ts +132 -0
  129. package/dist/hooks/tool-hooks.d.ts.map +1 -0
  130. package/dist/hooks/tool-hooks.js +215 -0
  131. package/dist/hooks/tool-hooks.js.map +1 -0
  132. package/dist/index.d.ts +929 -0
  133. package/dist/index.d.ts.map +1 -0
  134. package/dist/index.js +236 -0
  135. package/dist/index.js.map +1 -0
  136. package/dist/logging/event-file-logger.d.ts +21 -0
  137. package/dist/logging/event-file-logger.d.ts.map +1 -0
  138. package/dist/logging/event-file-logger.js +167 -0
  139. package/dist/logging/event-file-logger.js.map +1 -0
  140. package/dist/logging/index.d.ts +3 -0
  141. package/dist/logging/index.d.ts.map +1 -0
  142. package/dist/logging/index.js +19 -0
  143. package/dist/logging/index.js.map +1 -0
  144. package/dist/logging/runtime-logger.d.ts +12 -0
  145. package/dist/logging/runtime-logger.d.ts.map +1 -0
  146. package/dist/logging/runtime-logger.js +45 -0
  147. package/dist/logging/runtime-logger.js.map +1 -0
  148. package/dist/runtime/hook-bridge-actions.d.ts +9 -0
  149. package/dist/runtime/hook-bridge-actions.d.ts.map +1 -0
  150. package/dist/runtime/hook-bridge-actions.js +248 -0
  151. package/dist/runtime/hook-bridge-actions.js.map +1 -0
  152. package/dist/runtime/hook-bridge-dispatch-engine.d.ts +42 -0
  153. package/dist/runtime/hook-bridge-dispatch-engine.d.ts.map +1 -0
  154. package/dist/runtime/hook-bridge-dispatch-engine.js +233 -0
  155. package/dist/runtime/hook-bridge-dispatch-engine.js.map +1 -0
  156. package/dist/runtime/hook-bridge-tool-guard.d.ts +16 -0
  157. package/dist/runtime/hook-bridge-tool-guard.d.ts.map +1 -0
  158. package/dist/runtime/hook-bridge-tool-guard.js +236 -0
  159. package/dist/runtime/hook-bridge-tool-guard.js.map +1 -0
  160. package/dist/runtime/hook-bridge-utils.d.ts +11 -0
  161. package/dist/runtime/hook-bridge-utils.d.ts.map +1 -0
  162. package/dist/runtime/hook-bridge-utils.js +116 -0
  163. package/dist/runtime/hook-bridge-utils.js.map +1 -0
  164. package/dist/runtime/hook-bridge.d.ts +33 -0
  165. package/dist/runtime/hook-bridge.d.ts.map +1 -0
  166. package/dist/runtime/hook-bridge.js +359 -0
  167. package/dist/runtime/hook-bridge.js.map +1 -0
  168. package/dist/runtime/internal-handlers.d.ts +20 -0
  169. package/dist/runtime/internal-handlers.d.ts.map +1 -0
  170. package/dist/runtime/internal-handlers.js +225 -0
  171. package/dist/runtime/internal-handlers.js.map +1 -0
  172. package/dist/runtime/register-gateway-hooks.d.ts +4 -0
  173. package/dist/runtime/register-gateway-hooks.d.ts.map +1 -0
  174. package/dist/runtime/register-gateway-hooks.js +27 -0
  175. package/dist/runtime/register-gateway-hooks.js.map +1 -0
  176. package/dist/runtime/register-session-hooks.d.ts +4 -0
  177. package/dist/runtime/register-session-hooks.d.ts.map +1 -0
  178. package/dist/runtime/register-session-hooks.js +88 -0
  179. package/dist/runtime/register-session-hooks.js.map +1 -0
  180. package/dist/runtime/register-subagent-hooks.d.ts +4 -0
  181. package/dist/runtime/register-subagent-hooks.d.ts.map +1 -0
  182. package/dist/runtime/register-subagent-hooks.js +143 -0
  183. package/dist/runtime/register-subagent-hooks.js.map +1 -0
  184. package/dist/runtime/register-tool-hooks.d.ts +4 -0
  185. package/dist/runtime/register-tool-hooks.d.ts.map +1 -0
  186. package/dist/runtime/register-tool-hooks.js +348 -0
  187. package/dist/runtime/register-tool-hooks.js.map +1 -0
  188. package/dist/runtime/runtime-events.d.ts +14 -0
  189. package/dist/runtime/runtime-events.d.ts.map +1 -0
  190. package/dist/runtime/runtime-events.js +166 -0
  191. package/dist/runtime/runtime-events.js.map +1 -0
  192. package/dist/runtime/typed-hooks.d.ts +9 -0
  193. package/dist/runtime/typed-hooks.d.ts.map +1 -0
  194. package/dist/runtime/typed-hooks.js +14 -0
  195. package/dist/runtime/typed-hooks.js.map +1 -0
  196. package/dist/runtime/types.d.ts +91 -0
  197. package/dist/runtime/types.d.ts.map +1 -0
  198. package/dist/runtime/types.js +3 -0
  199. package/dist/runtime/types.js.map +1 -0
  200. package/dist/runtime/utils.d.ts +47 -0
  201. package/dist/runtime/utils.d.ts.map +1 -0
  202. package/dist/runtime/utils.js +166 -0
  203. package/dist/runtime/utils.js.map +1 -0
  204. package/dist/tools/replay-tool-guard.d.ts +3 -0
  205. package/dist/tools/replay-tool-guard.d.ts.map +1 -0
  206. package/dist/tools/replay-tool-guard.js +96 -0
  207. package/dist/tools/replay-tool-guard.js.map +1 -0
  208. package/openclaw.plugin.json +847 -0
  209. package/package.json +63 -0
@@ -0,0 +1,847 @@
1
+ {
2
+ "id": "event-server-plugin",
3
+ "name": "OpenClaw Event Server Plugin",
4
+ "version": "1.0.0",
5
+ "description": "Broadcasts OpenClaw internal/plugin hook events to WebSocket and webhooks with synthetic agent status/activity signals",
6
+ "homepage": "https://github.com/openclaw/openclaw-event-server-plugin",
7
+ "author": "OpenClaw Community",
8
+ "license": "MIT",
9
+ "configSchema": {
10
+ "type": "object",
11
+ "additionalProperties": false,
12
+ "properties": {
13
+ "enabled": {
14
+ "type": "boolean",
15
+ "description": "Enable/disable the plugin",
16
+ "default": true
17
+ },
18
+ "webhooks": {
19
+ "type": "array",
20
+ "description": "Webhook endpoints to broadcast events to",
21
+ "items": {
22
+ "type": "object",
23
+ "required": ["url"],
24
+ "properties": {
25
+ "url": {
26
+ "type": "string",
27
+ "description": "Webhook URL endpoint"
28
+ },
29
+ "method": {
30
+ "type": "string",
31
+ "enum": ["POST", "PUT", "PATCH"],
32
+ "default": "POST",
33
+ "description": "HTTP method for webhook requests"
34
+ },
35
+ "headers": {
36
+ "type": "object",
37
+ "additionalProperties": { "type": "string" },
38
+ "description": "Custom HTTP headers"
39
+ },
40
+ "authToken": {
41
+ "type": "string",
42
+ "description": "Authentication token (Bearer)"
43
+ },
44
+ "includeFullPayload": {
45
+ "type": "boolean",
46
+ "default": true,
47
+ "description": "Include full event payload"
48
+ }
49
+ }
50
+ },
51
+ "default": []
52
+ },
53
+ "filters": {
54
+ "type": "object",
55
+ "description": "Event filtering configuration",
56
+ "properties": {
57
+ "includeTypes": {
58
+ "type": "array",
59
+ "items": {
60
+ "type": "string",
61
+ "enum": [
62
+ "message.received",
63
+ "message.transcribed",
64
+ "message.preprocessed",
65
+ "message.sent",
66
+ "message.edited",
67
+ "message.deleted",
68
+ "tool.called",
69
+ "tool.guard.matched",
70
+ "tool.guard.allowed",
71
+ "tool.guard.blocked",
72
+ "tool.completed",
73
+ "tool.error",
74
+ "tool.result_persist",
75
+ "command.new",
76
+ "command.reset",
77
+ "command.stop",
78
+ "session.start",
79
+ "session.end",
80
+ "subagent.spawning",
81
+ "subagent.spawned",
82
+ "subagent.ended",
83
+ "subagent.idle",
84
+ "agent.bootstrap",
85
+ "agent.error",
86
+ "agent.session_start",
87
+ "agent.session_end",
88
+ "agent.sub_agent_spawn",
89
+ "agent.status",
90
+ "agent.activity",
91
+ "gateway.startup",
92
+ "gateway.start",
93
+ "gateway.stop",
94
+ "session.spawned",
95
+ "session.completed",
96
+ "session.error"
97
+ ]
98
+ },
99
+ "description": "Event types to include (empty = all)"
100
+ },
101
+ "excludeTypes": {
102
+ "type": "array",
103
+ "items": {
104
+ "type": "string",
105
+ "enum": [
106
+ "message.received",
107
+ "message.transcribed",
108
+ "message.preprocessed",
109
+ "message.sent",
110
+ "message.edited",
111
+ "message.deleted",
112
+ "tool.called",
113
+ "tool.guard.matched",
114
+ "tool.guard.allowed",
115
+ "tool.guard.blocked",
116
+ "tool.completed",
117
+ "tool.error",
118
+ "tool.result_persist",
119
+ "command.new",
120
+ "command.reset",
121
+ "command.stop",
122
+ "session.start",
123
+ "session.end",
124
+ "subagent.spawning",
125
+ "subagent.spawned",
126
+ "subagent.ended",
127
+ "subagent.idle",
128
+ "agent.bootstrap",
129
+ "agent.error",
130
+ "agent.session_start",
131
+ "agent.session_end",
132
+ "agent.sub_agent_spawn",
133
+ "agent.status",
134
+ "agent.activity",
135
+ "gateway.startup",
136
+ "gateway.start",
137
+ "gateway.stop",
138
+ "session.spawned",
139
+ "session.completed",
140
+ "session.error"
141
+ ]
142
+ },
143
+ "description": "Event types to exclude"
144
+ },
145
+ "channelId": {
146
+ "type": "string",
147
+ "description": "Filter by channel ID"
148
+ },
149
+ "toolName": {
150
+ "type": "string",
151
+ "description": "Filter by tool name"
152
+ },
153
+ "sessionId": {
154
+ "type": "string",
155
+ "description": "Filter by session ID"
156
+ }
157
+ }
158
+ },
159
+ "retry": {
160
+ "type": "object",
161
+ "description": "Retry configuration for failed webhooks",
162
+ "properties": {
163
+ "maxAttempts": {
164
+ "type": "integer",
165
+ "minimum": 0,
166
+ "maximum": 10,
167
+ "default": 3
168
+ },
169
+ "initialDelayMs": {
170
+ "type": "integer",
171
+ "minimum": 100,
172
+ "maximum": 10000,
173
+ "default": 1000
174
+ },
175
+ "maxDelayMs": {
176
+ "type": "integer",
177
+ "minimum": 1000,
178
+ "maximum": 300000,
179
+ "default": 30000
180
+ },
181
+ "backoffMultiplier": {
182
+ "type": "number",
183
+ "minimum": 1,
184
+ "maximum": 5,
185
+ "default": 2
186
+ }
187
+ }
188
+ },
189
+ "queue": {
190
+ "type": "object",
191
+ "description": "Event queue configuration",
192
+ "properties": {
193
+ "maxSize": {
194
+ "type": "integer",
195
+ "minimum": 10,
196
+ "maximum": 10000,
197
+ "default": 1000
198
+ },
199
+ "flushIntervalMs": {
200
+ "type": "integer",
201
+ "minimum": 100,
202
+ "maximum": 60000,
203
+ "default": 5000
204
+ },
205
+ "persistToDisk": {
206
+ "type": "boolean",
207
+ "default": false
208
+ },
209
+ "persistPath": {
210
+ "type": "string",
211
+ "description": "Path for queue persistence"
212
+ }
213
+ }
214
+ },
215
+ "logging": {
216
+ "type": "object",
217
+ "description": "Logging configuration",
218
+ "properties": {
219
+ "debug": {
220
+ "type": "boolean",
221
+ "default": false
222
+ },
223
+ "logSuccess": {
224
+ "type": "boolean",
225
+ "default": false
226
+ },
227
+ "logErrors": {
228
+ "type": "boolean",
229
+ "default": true
230
+ },
231
+ "logQueue": {
232
+ "type": "boolean",
233
+ "default": false
234
+ }
235
+ }
236
+ },
237
+ "status": {
238
+ "type": "object",
239
+ "description": "Synthetic status reducer windows and ticker interval",
240
+ "properties": {
241
+ "workingWindowMs": {
242
+ "type": "integer",
243
+ "minimum": 1000,
244
+ "maximum": 120000,
245
+ "default": 30000,
246
+ "description": "Events newer than this are considered working"
247
+ },
248
+ "sleepingWindowMs": {
249
+ "type": "integer",
250
+ "minimum": 10000,
251
+ "maximum": 86400000,
252
+ "default": 600000,
253
+ "description": "Events older than this are considered sleeping"
254
+ },
255
+ "tickIntervalMs": {
256
+ "type": "integer",
257
+ "minimum": 1000,
258
+ "maximum": 60000,
259
+ "default": 5000,
260
+ "description": "Interval for synthetic status transition checks"
261
+ },
262
+ "subagentIdleWindowMs": {
263
+ "type": "integer",
264
+ "minimum": 10000,
265
+ "maximum": 86400000,
266
+ "default": 300000,
267
+ "description": "Subagent idle threshold for synthetic subagent.idle events"
268
+ }
269
+ }
270
+ },
271
+ "redaction": {
272
+ "type": "object",
273
+ "description": "Optional payload redaction before transport",
274
+ "properties": {
275
+ "enabled": {
276
+ "type": "boolean",
277
+ "default": false
278
+ },
279
+ "replacement": {
280
+ "type": "string",
281
+ "default": "[REDACTED]"
282
+ },
283
+ "fields": {
284
+ "type": "array",
285
+ "items": {
286
+ "type": "string"
287
+ },
288
+ "default": [
289
+ "content",
290
+ "newContent",
291
+ "originalContent",
292
+ "transcript",
293
+ "normalizedText",
294
+ "params",
295
+ "arguments",
296
+ "token",
297
+ "apiKey",
298
+ "api_key",
299
+ "authorization",
300
+ "authToken",
301
+ "password",
302
+ "secret"
303
+ ]
304
+ }
305
+ }
306
+ },
307
+ "eventLog": {
308
+ "type": "object",
309
+ "description": "Event and runtime log file output",
310
+ "properties": {
311
+ "enabled": {
312
+ "type": "boolean",
313
+ "default": true
314
+ },
315
+ "path": {
316
+ "type": "string",
317
+ "description": "NDJSON log file path",
318
+ "default": ".event-server/events.ndjson"
319
+ },
320
+ "maxFileSizeMb": {
321
+ "type": "integer",
322
+ "minimum": 1,
323
+ "maximum": 1024,
324
+ "default": 30,
325
+ "description": "Maximum NDJSON log file size before truncation rollover (MB)"
326
+ },
327
+ "format": {
328
+ "type": "string",
329
+ "enum": ["full-json", "summary"],
330
+ "default": "full-json"
331
+ },
332
+ "minLevel": {
333
+ "type": "string",
334
+ "enum": ["debug", "info", "warn", "error"],
335
+ "default": "debug"
336
+ },
337
+ "includeRuntimeLogs": {
338
+ "type": "boolean",
339
+ "default": true
340
+ }
341
+ }
342
+ },
343
+ "security": {
344
+ "type": "object",
345
+ "description": "WebSocket and event signing security options",
346
+ "properties": {
347
+ "ws": {
348
+ "type": "object",
349
+ "properties": {
350
+ "bindAddress": {
351
+ "type": "string",
352
+ "default": "127.0.0.1"
353
+ },
354
+ "requireAuth": {
355
+ "type": "boolean",
356
+ "default": false
357
+ },
358
+ "authToken": {
359
+ "type": "string"
360
+ },
361
+ "allowedOrigins": {
362
+ "type": "array",
363
+ "items": { "type": "string" },
364
+ "default": []
365
+ },
366
+ "allowedIps": {
367
+ "type": "array",
368
+ "items": { "type": "string" },
369
+ "default": []
370
+ }
371
+ }
372
+ },
373
+ "hmac": {
374
+ "type": "object",
375
+ "properties": {
376
+ "enabled": {
377
+ "type": "boolean",
378
+ "default": false
379
+ },
380
+ "secret": {
381
+ "type": "string"
382
+ },
383
+ "secretFilePath": {
384
+ "type": "string",
385
+ "default": ".event-plugin-hmac.secret"
386
+ },
387
+ "algorithm": {
388
+ "type": "string",
389
+ "enum": ["sha256", "sha512"],
390
+ "default": "sha256"
391
+ }
392
+ }
393
+ }
394
+ }
395
+ },
396
+ "correlationIdHeader": {
397
+ "type": "string",
398
+ "default": "X-Correlation-ID"
399
+ },
400
+ "webhookTimeoutMs": {
401
+ "type": "integer",
402
+ "minimum": 1000,
403
+ "maximum": 60000,
404
+ "default": 10000
405
+ },
406
+ "hookBridge": {
407
+ "type": "object",
408
+ "description": "Optional event-driven automation bridge",
409
+ "properties": {
410
+ "enabled": {
411
+ "type": "boolean",
412
+ "default": false
413
+ },
414
+ "dryRun": {
415
+ "type": "boolean",
416
+ "default": false
417
+ },
418
+ "allowedActionDirs": {
419
+ "type": "array",
420
+ "items": { "type": "string" },
421
+ "default": []
422
+ },
423
+ "localScriptDefaults": {
424
+ "type": "object",
425
+ "properties": {
426
+ "timeoutMs": {
427
+ "type": "integer",
428
+ "minimum": 1000,
429
+ "maximum": 120000,
430
+ "default": 10000
431
+ },
432
+ "maxPayloadBytes": {
433
+ "type": "integer",
434
+ "minimum": 1024,
435
+ "maximum": 1048576,
436
+ "default": 65536
437
+ }
438
+ }
439
+ },
440
+ "actions": {
441
+ "type": "object",
442
+ "additionalProperties": {
443
+ "type": "object",
444
+ "properties": {
445
+ "type": {
446
+ "type": "string",
447
+ "enum": ["webhook", "local_script"]
448
+ },
449
+ "url": { "type": "string" },
450
+ "method": {
451
+ "type": "string",
452
+ "enum": ["POST", "PUT", "PATCH"]
453
+ },
454
+ "headers": {
455
+ "type": "object",
456
+ "additionalProperties": { "type": "string" }
457
+ },
458
+ "authToken": { "type": "string" },
459
+ "path": { "type": "string" },
460
+ "args": {
461
+ "type": "array",
462
+ "items": { "type": "string" }
463
+ },
464
+ "timeoutMs": { "type": "integer" },
465
+ "maxPayloadBytes": { "type": "integer" }
466
+ },
467
+ "required": ["type"]
468
+ },
469
+ "default": {}
470
+ },
471
+ "rules": {
472
+ "type": "array",
473
+ "default": [],
474
+ "items": {
475
+ "type": "object",
476
+ "properties": {
477
+ "id": { "type": "string" },
478
+ "enabled": { "type": "boolean" },
479
+ "action": { "type": "string" },
480
+ "cooldownMs": { "type": "integer", "minimum": 0 },
481
+ "coalesce": {
482
+ "type": "object",
483
+ "properties": {
484
+ "enabled": { "type": "boolean" },
485
+ "keyFields": {
486
+ "type": "array",
487
+ "items": { "type": "string" }
488
+ },
489
+ "windowMs": { "type": "number", "minimum": 1 },
490
+ "strategy": { "type": "string", "enum": ["first", "latest"] }
491
+ }
492
+ },
493
+ "when": {
494
+ "type": "object",
495
+ "properties": {
496
+ "eventType": {
497
+ "oneOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }]
498
+ },
499
+ "toolName": {
500
+ "oneOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }]
501
+ },
502
+ "agentId": {
503
+ "oneOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }]
504
+ },
505
+ "sessionId": {
506
+ "oneOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }]
507
+ },
508
+ "sessionKey": {
509
+ "oneOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }]
510
+ },
511
+ "contains": {
512
+ "type": "object",
513
+ "additionalProperties": { "type": "string" }
514
+ },
515
+ "equals": {
516
+ "type": "object",
517
+ "additionalProperties": {
518
+ "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }]
519
+ }
520
+ },
521
+ "requiredPaths": {
522
+ "type": "array",
523
+ "items": { "type": "string" }
524
+ },
525
+ "typeChecks": {
526
+ "type": "object",
527
+ "additionalProperties": {
528
+ "type": "string",
529
+ "enum": ["string", "number", "boolean", "object", "array"]
530
+ }
531
+ },
532
+ "inList": {
533
+ "type": "object",
534
+ "additionalProperties": {
535
+ "type": "array",
536
+ "items": {
537
+ "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }]
538
+ }
539
+ }
540
+ },
541
+ "notInList": {
542
+ "type": "object",
543
+ "additionalProperties": {
544
+ "type": "array",
545
+ "items": {
546
+ "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }]
547
+ }
548
+ }
549
+ },
550
+ "matchesRegex": {
551
+ "type": "object",
552
+ "additionalProperties": { "type": "string" }
553
+ },
554
+ "notMatchesRegex": {
555
+ "type": "object",
556
+ "additionalProperties": { "type": "string" }
557
+ },
558
+ "domainAllowlist": {
559
+ "type": "array",
560
+ "items": { "type": "string" }
561
+ },
562
+ "domainBlocklist": {
563
+ "type": "array",
564
+ "items": { "type": "string" }
565
+ },
566
+ "domainPath": { "type": "string" },
567
+ "idleForMsGte": { "type": "number", "minimum": 0 },
568
+ "parentStatus": { "type": "string" }
569
+ }
570
+ }
571
+ },
572
+ "required": ["id", "when", "action"]
573
+ }
574
+ },
575
+ "toolGuard": {
576
+ "type": "object",
577
+ "properties": {
578
+ "enabled": {
579
+ "type": "boolean",
580
+ "default": false
581
+ },
582
+ "dryRun": {
583
+ "type": "boolean",
584
+ "default": false
585
+ },
586
+ "timeoutMs": {
587
+ "type": "integer",
588
+ "minimum": 100,
589
+ "maximum": 120000,
590
+ "default": 15000
591
+ },
592
+ "onError": {
593
+ "type": "string",
594
+ "enum": ["allow", "block"],
595
+ "default": "allow"
596
+ },
597
+ "scopeKeyBy": {
598
+ "type": "string",
599
+ "enum": ["tool", "tool_and_params"],
600
+ "default": "tool_and_params"
601
+ },
602
+ "retryBackoffMs": {
603
+ "type": "integer",
604
+ "minimum": 0,
605
+ "maximum": 3600000,
606
+ "default": 10000
607
+ },
608
+ "retryBackoffReason": { "type": "string" },
609
+ "approvalCacheTtlMs": {
610
+ "type": "integer",
611
+ "minimum": 0,
612
+ "maximum": 86400000,
613
+ "default": 60000
614
+ },
615
+ "stopOnMatchDefault": {
616
+ "type": "boolean",
617
+ "default": false
618
+ },
619
+ "redaction": {
620
+ "type": "object",
621
+ "properties": {
622
+ "enabled": { "type": "boolean", "default": false },
623
+ "replacement": { "type": "string", "default": "[REDACTED]" },
624
+ "fields": {
625
+ "type": "array",
626
+ "items": { "type": "string" }
627
+ }
628
+ }
629
+ },
630
+ "rules": {
631
+ "type": "array",
632
+ "default": [],
633
+ "items": {
634
+ "type": "object",
635
+ "properties": {
636
+ "id": { "type": "string" },
637
+ "enabled": { "type": "boolean" },
638
+ "priority": { "type": "integer" },
639
+ "action": { "type": "string" },
640
+ "decision": {
641
+ "type": "object",
642
+ "properties": {
643
+ "block": { "type": "boolean" },
644
+ "blockReason": { "type": "string" },
645
+ "blockReasonTemplate": { "type": "string" },
646
+ "params": { "type": "object" }
647
+ }
648
+ },
649
+ "stopOnMatch": { "type": "boolean" },
650
+ "cooldownMs": { "type": "integer", "minimum": 0 },
651
+ "when": {
652
+ "type": "object",
653
+ "properties": {
654
+ "eventType": {
655
+ "oneOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }]
656
+ },
657
+ "toolName": {
658
+ "oneOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }]
659
+ },
660
+ "agentId": {
661
+ "oneOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }]
662
+ },
663
+ "sessionId": {
664
+ "oneOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }]
665
+ },
666
+ "sessionKey": {
667
+ "oneOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }]
668
+ },
669
+ "contains": {
670
+ "type": "object",
671
+ "additionalProperties": { "type": "string" }
672
+ },
673
+ "equals": {
674
+ "type": "object",
675
+ "additionalProperties": {
676
+ "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }]
677
+ }
678
+ },
679
+ "requiredPaths": {
680
+ "type": "array",
681
+ "items": { "type": "string" }
682
+ },
683
+ "typeChecks": {
684
+ "type": "object",
685
+ "additionalProperties": {
686
+ "type": "string",
687
+ "enum": ["string", "number", "boolean", "object", "array"]
688
+ }
689
+ },
690
+ "inList": {
691
+ "type": "object",
692
+ "additionalProperties": {
693
+ "type": "array",
694
+ "items": {
695
+ "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }]
696
+ }
697
+ }
698
+ },
699
+ "notInList": {
700
+ "type": "object",
701
+ "additionalProperties": {
702
+ "type": "array",
703
+ "items": {
704
+ "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }]
705
+ }
706
+ }
707
+ },
708
+ "matchesRegex": {
709
+ "type": "object",
710
+ "additionalProperties": { "type": "string" }
711
+ },
712
+ "notMatchesRegex": {
713
+ "type": "object",
714
+ "additionalProperties": { "type": "string" }
715
+ },
716
+ "domainAllowlist": {
717
+ "type": "array",
718
+ "items": { "type": "string" }
719
+ },
720
+ "domainBlocklist": {
721
+ "type": "array",
722
+ "items": { "type": "string" }
723
+ },
724
+ "domainPath": { "type": "string" },
725
+ "idleForMsGte": { "type": "number", "minimum": 0 },
726
+ "parentStatus": { "type": "string" }
727
+ }
728
+ }
729
+ },
730
+ "required": ["id", "when"]
731
+ }
732
+ }
733
+ }
734
+ },
735
+ "runtime": {
736
+ "type": "object",
737
+ "properties": {
738
+ "maxPendingEvents": {
739
+ "type": "integer",
740
+ "minimum": 1,
741
+ "maximum": 100000,
742
+ "default": 1000
743
+ },
744
+ "concurrency": {
745
+ "type": "integer",
746
+ "minimum": 1,
747
+ "maximum": 1024,
748
+ "default": 8
749
+ },
750
+ "dropPolicy": {
751
+ "type": "string",
752
+ "enum": ["drop_oldest", "drop_newest"],
753
+ "default": "drop_oldest"
754
+ }
755
+ }
756
+ },
757
+ "telemetry": {
758
+ "type": "object",
759
+ "properties": {
760
+ "highWatermarks": {
761
+ "type": "array",
762
+ "items": { "type": "integer", "minimum": 1, "maximum": 100 },
763
+ "default": [70, 90, 100]
764
+ },
765
+ "slowActionMs": {
766
+ "type": "integer",
767
+ "minimum": 1,
768
+ "maximum": 600000,
769
+ "default": 2000
770
+ },
771
+ "failureRateWindowMs": {
772
+ "type": "integer",
773
+ "minimum": 1000,
774
+ "maximum": 3600000,
775
+ "default": 60000
776
+ },
777
+ "failureRateThresholdPct": {
778
+ "type": "number",
779
+ "minimum": 0,
780
+ "maximum": 100,
781
+ "default": 20
782
+ },
783
+ "failureRateMinSamples": {
784
+ "type": "integer",
785
+ "minimum": 1,
786
+ "maximum": 100000,
787
+ "default": 10
788
+ },
789
+ "saturationWindowMs": {
790
+ "type": "integer",
791
+ "minimum": 100,
792
+ "maximum": 3600000,
793
+ "default": 10000
794
+ }
795
+ }
796
+ }
797
+ }
798
+ }
799
+ }
800
+ },
801
+ "uiHints": {
802
+ "enabled": {
803
+ "label": "Enabled",
804
+ "description": "Enable or disable the event server plugin"
805
+ },
806
+ "webhooks": {
807
+ "label": "Webhooks",
808
+ "description": "List of webhook endpoints to broadcast events to"
809
+ },
810
+ "filters": {
811
+ "label": "Event Filters",
812
+ "description": "Configure which events to broadcast"
813
+ },
814
+ "retry": {
815
+ "label": "Retry Settings",
816
+ "description": "Configure retry behavior for failed webhook deliveries"
817
+ },
818
+ "queue": {
819
+ "label": "Queue Settings",
820
+ "description": "Configure event queue for reliable delivery"
821
+ },
822
+ "logging": {
823
+ "label": "Logging",
824
+ "description": "Configure plugin logging verbosity"
825
+ },
826
+ "status": {
827
+ "label": "Status Windows",
828
+ "description": "Configure synthetic status reducer windows and tick interval"
829
+ },
830
+ "redaction": {
831
+ "label": "Redaction",
832
+ "description": "Optionally redact sensitive payload fields before transport"
833
+ },
834
+ "eventLog": {
835
+ "label": "Event Log",
836
+ "description": "Configure full JSON event log and runtime log persistence"
837
+ },
838
+ "security": {
839
+ "label": "Security",
840
+ "description": "Configure WS bind/auth controls and optional HMAC signing"
841
+ },
842
+ "hookBridge": {
843
+ "label": "Hook Bridge",
844
+ "description": "Configure rule-based webhook/local script actions from plugin events"
845
+ }
846
+ }
847
+ }