@clawtrial/courtroom 2.0.3 → 2.0.6

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.
@@ -2,7 +2,7 @@
2
2
  "id": "courtroom",
3
3
  "name": "ClawTrial Courtroom",
4
4
  "description": "Autonomous behavioral oversight plugin for OpenClaw",
5
- "version": "2.0.3",
5
+ "version": "2.0.6",
6
6
  "author": "ClawTrial",
7
7
  "main": "src/plugin.js",
8
8
  "engines": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clawtrial/courtroom",
3
- "version": "2.0.3",
3
+ "version": "2.0.6",
4
4
  "description": "AI Courtroom - Autonomous behavioral oversight plugin for OpenClaw",
5
5
  "main": "src/plugin.js",
6
6
  "openclaw": {
package/src/plugin.js CHANGED
@@ -175,10 +175,10 @@ class CourtroomRuntime {
175
175
 
176
176
  // Run detection
177
177
  try {
178
- this.lastEvaluation = now;
179
178
  const detection = await this.detector.evaluate(this.messageBuffer, null);
180
179
 
181
180
  if (detection.triggered) {
181
+ this.lastEvaluation = now;
182
182
  return await this._handleDetection(detection);
183
183
  }
184
184
  } catch (err) {
@@ -344,14 +344,14 @@ function register(api) {
344
344
  // -------------------------------------------------------------------------
345
345
  // Hook: before_prompt_build — analyse messages + inject context
346
346
  // -------------------------------------------------------------------------
347
- api.on('before_prompt_build', async (_event, ctx) => {
347
+ api.on('before_prompt_build', async (event, _ctx) => {
348
348
  if (!runtime.initialized || !runtime.enabled) return {};
349
349
 
350
350
  const result = {};
351
351
 
352
352
  try {
353
353
  // Run offense detection against current messages
354
- const messages = ctx.messages || [];
354
+ const messages = event.messages || [];
355
355
  const verdictContext = await runtime.onMessages(messages);
356
356
 
357
357
  // Collect any context to append