refactor(integrations): rename dsh-mem0 to deepseek-plugin, strands-mem0 to mem0-strands (#7098)

This commit is contained in:
Kartik
2026-08-24 19:21:23 +05:30
committed by GitHub
parent dc82354e14
commit b717e38785
43 changed files with 127 additions and 127 deletions
@@ -0,0 +1,30 @@
import { describe, it, expect } from "vitest";
import { truncateOutput, MAX_OUTPUT_LINES } from "../src/output.ts";
describe("truncateOutput", () => {
it("passes small output through untouched", () => {
expect(truncateOutput("a\nb\nc")).toBe("a\nb\nc");
});
it("caps output at MAX_OUTPUT_LINES and appends a notice", () => {
const many = Array.from({ length: MAX_OUTPUT_LINES + 50 }, (_, i) => `line ${i}`).join("\n");
const out = truncateOutput(many);
expect(out.split("\n").length).toBeLessThanOrEqual(MAX_OUTPUT_LINES + 3);
expect(out).toContain("[Output truncated:");
expect(out).toContain(`of ${MAX_OUTPUT_LINES + 50} lines`);
});
it("caps output that is few lines but very large by bytes", () => {
const huge = "x".repeat(60_000);
const out = truncateOutput(huge);
expect(out.length).toBeLessThan(huge.length);
expect(out).toContain("[Output truncated:");
});
it("reports both reasons when the line cap and the byte cap fire together", () => {
const wide = Array.from({ length: MAX_OUTPUT_LINES + 50 }, () => "x".repeat(300)).join("\n");
const out = truncateOutput(wide);
expect(out).toContain(`of ${MAX_OUTPUT_LINES + 50} lines`);
expect(out).toContain("cut at 50KB");
});
});