summaryrefslogtreecommitdiffhomepage
path: root/packages/tool-youtube-transcript/src/format.test.ts
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-21 15:08:51 +0900
committerAdam Malczewski <[email protected]>2026-06-21 15:08:51 +0900
commit64823e68e8c6c3bc199f9cb82d97321c830687c3 (patch)
tree9340fbaede62f86b0de9f8281d9415778adcda44 /packages/tool-youtube-transcript/src/format.test.ts
parent4ccdfd34c55bee279ce5e190412afd19cfbb5238 (diff)
downloaddispatch-64823e68e8c6c3bc199f9cb82d97321c830687c3.tar.gz
dispatch-64823e68e8c6c3bc199f9cb82d97321c830687c3.zip
feat(tool-youtube-transcript): write full transcript to /tmp/dispatch on truncation
When the formatted transcript exceeds the 50K char output cap, the tool now writes the full output to /tmp/dispatch/{video_id}.txt and returns the truncated output with a notice pointing to the file path. The writeFile dep is injectable so tests verify without touching the filesystem.
Diffstat (limited to 'packages/tool-youtube-transcript/src/format.test.ts')
-rw-r--r--packages/tool-youtube-transcript/src/format.test.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/tool-youtube-transcript/src/format.test.ts b/packages/tool-youtube-transcript/src/format.test.ts
index 7555318..79832da 100644
--- a/packages/tool-youtube-transcript/src/format.test.ts
+++ b/packages/tool-youtube-transcript/src/format.test.ts
@@ -116,4 +116,11 @@ describe("truncateOutput", () => {
expect(truncateOutput("short", 100)).toBe("short");
expect(truncateOutput("exact", 5)).toBe("exact");
});
+
+ it("includes save path in notice when provided", () => {
+ const output = "a".repeat(100);
+ const result = truncateOutput(output, 50, "/tmp/dispatch/vid123.txt");
+ expect(result).toContain("/tmp/dispatch/vid123.txt");
+ expect(result).toContain("use read_file to access it");
+ });
});