querysub 0.379.0 → 0.381.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.
package/package.json
CHANGED
|
@@ -110,7 +110,7 @@ export class LogDatumRenderer extends qreact.Component<{
|
|
|
110
110
|
{Object.entries(datum).map(([key, value]) => (
|
|
111
111
|
<div key={key} className={css.hbox(8)}>
|
|
112
112
|
<strong className={css.minWidth(120)}>{key}:</strong>
|
|
113
|
-
<
|
|
113
|
+
<div className={css.flexGrow(1).margin(0).whiteSpace("pre-wrap")}>{JSON.stringify(value, undefined, 2)}</div>
|
|
114
114
|
</div>
|
|
115
115
|
))}
|
|
116
116
|
</div>
|
|
@@ -196,9 +196,9 @@ export class ErrorNotificationPage extends qreact.Component {
|
|
|
196
196
|
</h1>}
|
|
197
197
|
<div className={css.pad2(12).bord2(0, 80, 50).hsl(0, 80, 95).colorhsl(0, 80, 30)}>
|
|
198
198
|
<strong>Error loading error notifications:</strong>
|
|
199
|
-
<
|
|
199
|
+
<div className={css.pad2(8).hsl(0, 0, 98).bord2(0, 0, 85).whiteSpace("pre-wrap")}>
|
|
200
200
|
{this.manager.state.initError}
|
|
201
|
-
</
|
|
201
|
+
</div>
|
|
202
202
|
</div>
|
|
203
203
|
</div>;
|
|
204
204
|
}
|
|
@@ -187,7 +187,7 @@ async function generatePatternForError(error: LogDatum): Promise<string> {
|
|
|
187
187
|
throw new Error("OpenRouter API key not set");
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
console.log(magenta(`
|
|
190
|
+
console.log(magenta(`Creating pattern for error: ${error.param0}`));
|
|
191
191
|
|
|
192
192
|
const param0 = error.param0 && String(error.param0) || "(no message)";
|
|
193
193
|
|
|
@@ -205,7 +205,7 @@ Respond with a JSON object with a "pattern" field containing the search string.`
|
|
|
205
205
|
|
|
206
206
|
const response = await callOpenRouterJSON<PatternResponse>(openRouterAPIKey, prompt);
|
|
207
207
|
|
|
208
|
-
const pattern = response.pattern
|
|
208
|
+
const pattern = response.pattern.trim();
|
|
209
209
|
|
|
210
210
|
if (!pattern) {
|
|
211
211
|
throw new Error("AI returned an empty pattern");
|
|
@@ -328,22 +328,24 @@ export async function exposeErrorWatchService() {
|
|
|
328
328
|
unmatchedErrors.push(error);
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
331
|
+
if (!matchedSuppressionId) {
|
|
332
|
+
const pattern = await generatePatternForError(error);
|
|
333
|
+
if (pattern) {
|
|
334
|
+
const newEntry: SuppressionEntry = {
|
|
335
|
+
id: nextId(),
|
|
336
|
+
pattern,
|
|
337
|
+
timeout: 0,
|
|
338
|
+
createdTime: Date.now(),
|
|
339
|
+
lastUpdatedTime: Date.now(),
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
suppressionCache.push(newEntry);
|
|
343
|
+
void suppression.set(newEntry.id, newEntry);
|
|
344
|
+
applySuppression(error, newEntry);
|
|
345
|
+
queueDiscordNotification(newEntry.id, 1, true);
|
|
346
|
+
|
|
347
|
+
void ErrorNotificationService.triggerSuppressionUpdate(newEntry.id);
|
|
348
|
+
}
|
|
347
349
|
}
|
|
348
350
|
|
|
349
351
|
void ErrorNotificationService.triggerUnmatchedError(error);
|