oh-langfuse 0.1.53 → 0.1.55
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 +142 -142
- package/bin/cli.js +425 -425
- package/codex_langfuse_notify.py +517 -517
- package/langfuse_hook.py +581 -581
- package/package.json +1 -1
- package/scripts/auto-update-runtime.mjs +190 -190
- package/scripts/codex-langfuse-check.mjs +81 -81
- package/scripts/codex-langfuse-setup.mjs +358 -314
- package/scripts/langfuse-check.mjs +180 -180
- package/scripts/langfuse-setup.mjs +370 -326
- package/scripts/log-filter-utils.mjs +26 -26
- package/scripts/metrics-utils.mjs +377 -377
- package/scripts/opencode-langfuse-check.mjs +9 -0
- package/scripts/opencode-langfuse-setup.mjs +944 -935
- package/scripts/real-self-verify.mjs +621 -621
- package/scripts/runtime-state-utils.mjs +53 -53
- package/scripts/update-langfuse-runtime.mjs +260 -260
- package/scripts/update-utils.mjs +73 -73
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
function envShowsWarnings(env = process.env) {
|
|
2
|
-
return /^(1|true|yes|on)$/i.test(String(
|
|
3
|
-
env.OH_LANGFUSE_SHOW_LOGS ||
|
|
4
|
-
env.LANGFUSE_SHOW_LOGS ||
|
|
5
|
-
env.OH_LANGFUSE_SHOW_WARN ||
|
|
6
|
-
env.LANGFUSE_SHOW_WARN ||
|
|
7
|
-
""
|
|
8
|
-
));
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function shouldSuppressAgentLogLine(line, options = {}) {
|
|
12
|
-
const showWarnings = options.showNoisyLogs ?? options.showWarnings ?? envShowsWarnings(options.env);
|
|
13
|
-
if (showWarnings) return false;
|
|
14
|
-
const text = String(line || "").trim();
|
|
15
|
-
return /(?:^|\s)(npm\s+warn|warn(?:ing)?\b|\[warn\])/i.test(text)
|
|
16
|
-
|| /^(?:error\b|\[[^\]]*error[^\]]*\])/i.test(text)
|
|
17
|
-
|| /\[error\]/i.test(text);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export function filterAgentLogText(text, options = {}) {
|
|
21
|
-
const source = String(text || "");
|
|
22
|
-
return source
|
|
23
|
-
.split(/\r?\n/)
|
|
24
|
-
.filter((line) => line !== "" && !shouldSuppressAgentLogLine(line, options))
|
|
25
|
-
.join("\n");
|
|
26
|
-
}
|
|
1
|
+
function envShowsWarnings(env = process.env) {
|
|
2
|
+
return /^(1|true|yes|on)$/i.test(String(
|
|
3
|
+
env.OH_LANGFUSE_SHOW_LOGS ||
|
|
4
|
+
env.LANGFUSE_SHOW_LOGS ||
|
|
5
|
+
env.OH_LANGFUSE_SHOW_WARN ||
|
|
6
|
+
env.LANGFUSE_SHOW_WARN ||
|
|
7
|
+
""
|
|
8
|
+
));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function shouldSuppressAgentLogLine(line, options = {}) {
|
|
12
|
+
const showWarnings = options.showNoisyLogs ?? options.showWarnings ?? envShowsWarnings(options.env);
|
|
13
|
+
if (showWarnings) return false;
|
|
14
|
+
const text = String(line || "").trim();
|
|
15
|
+
return /(?:^|\s)(npm\s+warn|warn(?:ing)?\b|\[warn\])/i.test(text)
|
|
16
|
+
|| /^(?:error\b|\[[^\]]*error[^\]]*\])/i.test(text)
|
|
17
|
+
|| /\[error\]/i.test(text);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function filterAgentLogText(text, options = {}) {
|
|
21
|
+
const source = String(text || "");
|
|
22
|
+
return source
|
|
23
|
+
.split(/\r?\n/)
|
|
24
|
+
.filter((line) => line !== "" && !shouldSuppressAgentLogLine(line, options))
|
|
25
|
+
.join("\n");
|
|
26
|
+
}
|