@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.
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/src/plugin.js +3 -3
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
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 (
|
|
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 =
|
|
354
|
+
const messages = event.messages || [];
|
|
355
355
|
const verdictContext = await runtime.onMessages(messages);
|
|
356
356
|
|
|
357
357
|
// Collect any context to append
|