@swestash/agent-lens 0.3.0 → 0.4.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/dist/agent-lens.js +20 -2
- package/dist/agent-lens.js.map +1 -1
- package/package.json +1 -1
- package/web/assets/{CopyButton-DPveQcsm.js → CopyButton-CDLZMZtV.js} +1 -1
- package/web/assets/{Dashboard-D50k35sH.js → Dashboard-BGVInKFn.js} +1 -1
- package/web/assets/SessionView-C9Nz-Buq.js +12 -0
- package/web/assets/{SkillView-ByiQB_SI.js → SkillView-z46KtQoA.js} +1 -1
- package/web/assets/{SkillsView-lOJiFu6e.js → SkillsView-BZ4hNSbk.js} +1 -1
- package/web/assets/{WorkflowView-qgx0vvWs.js → WorkflowView-eiRtGE5c.js} +1 -1
- package/web/assets/{index-eVzr9g61.js → index-5gOslh3o.js} +1 -1
- package/web/assets/index-CXU0GJds.css +1 -0
- package/web/assets/{index-CWdoCK2Q.js → index-Twf3zCly.js} +2 -2
- package/web/index.html +2 -2
- package/web/assets/SessionView-DPm1eauh.js +0 -6
- package/web/assets/index-CU4_1QLm.css +0 -1
package/dist/agent-lens.js
CHANGED
|
@@ -1760,6 +1760,8 @@ function flattenText(content) {
|
|
|
1760
1760
|
const text = parts.join("\n").trim();
|
|
1761
1761
|
return text || null;
|
|
1762
1762
|
}
|
|
1763
|
+
var RESULT_SUMMARY_MAX_LINES = 40;
|
|
1764
|
+
var RESULT_SUMMARY_MAX_CHARS = 2e3;
|
|
1763
1765
|
function summarizeResult(content) {
|
|
1764
1766
|
let s = null;
|
|
1765
1767
|
if (typeof content === "string")
|
|
@@ -1777,8 +1779,24 @@ function summarizeResult(content) {
|
|
|
1777
1779
|
}
|
|
1778
1780
|
if (!s)
|
|
1779
1781
|
return null;
|
|
1780
|
-
s = s.replace(/\
|
|
1781
|
-
|
|
1782
|
+
s = s.replace(/\r\n/g, "\n").replace(/[ \t]+\n/g, "\n").replace(/\n{3,}/g, "\n\n").trim();
|
|
1783
|
+
if (!s)
|
|
1784
|
+
return null;
|
|
1785
|
+
let truncated = false;
|
|
1786
|
+
const lines = s.split("\n");
|
|
1787
|
+
if (lines.length > RESULT_SUMMARY_MAX_LINES) {
|
|
1788
|
+
s = lines.slice(0, RESULT_SUMMARY_MAX_LINES).join("\n");
|
|
1789
|
+
truncated = true;
|
|
1790
|
+
}
|
|
1791
|
+
if (s.length > RESULT_SUMMARY_MAX_CHARS) {
|
|
1792
|
+
s = s.slice(0, RESULT_SUMMARY_MAX_CHARS);
|
|
1793
|
+
const nl = s.lastIndexOf("\n");
|
|
1794
|
+
if (nl > RESULT_SUMMARY_MAX_CHARS - 200)
|
|
1795
|
+
s = s.slice(0, nl);
|
|
1796
|
+
truncated = true;
|
|
1797
|
+
}
|
|
1798
|
+
s = s.trimEnd();
|
|
1799
|
+
return (truncated ? s + "\n\u2026 (truncated)" : s) || null;
|
|
1782
1800
|
}
|
|
1783
1801
|
function asString(v) {
|
|
1784
1802
|
return typeof v === "string" && v.length > 0 ? v : null;
|