From 2ce01e144b4b3edfb97a36231a4fa266f701caa3 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 15 Feb 2026 07:22:34 +0000 Subject: [PATCH] Cover six-per-em-space baseURL wrapper and internal validation Co-authored-by: Eric Allam --- docs/tasks/streams.mdx | 2 ++ packages/ai/README.md | 2 ++ packages/ai/src/chatTransport.test.ts | 44 +++++++++++++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/docs/tasks/streams.mdx b/docs/tasks/streams.mdx index 757c40cc8..52b607d88 100644 --- a/docs/tasks/streams.mdx +++ b/docs/tasks/streams.mdx @@ -675,6 +675,7 @@ Examples: - ✅ `\u200Ahttps://api.trigger.dev/custom-prefix/\u200A` (hair-space wrapper trimmed) - ✅ `\u2009https://api.trigger.dev/custom-prefix/\u2009` (thin-space wrapper trimmed) - ✅ `\u2008https://api.trigger.dev/custom-prefix/\u2008` (punctuation-space wrapper trimmed) +- ✅ `\u2006https://api.trigger.dev/custom-prefix/\u2006` (six-per-em-space wrapper trimmed) - ✅ `\u205Fhttps://api.trigger.dev/custom-prefix/\u205F` (medium-mathematical-space wrapper trimmed) - ✅ `\u3000https://api.trigger.dev/custom-prefix/\u3000` (ideographic-space wrapper trimmed) - ✅ `\uFEFFhttps://api.trigger.dev/custom-prefix/\uFEFF` (BOM wrapper trimmed) @@ -711,6 +712,7 @@ Examples: - ❌ `https://api.trigger.dev/\u200Ainternal` - ❌ `https://api.trigger.dev/\u2009internal` - ❌ `https://api.trigger.dev/\u2008internal` +- ❌ `https://api.trigger.dev/\u2006internal` - ❌ `https://api.trigger.dev/\u202Finternal` - ❌ `https://api.trigger.dev/\u205Finternal` - ❌ `https://api.trigger.dev/\u180Einternal` diff --git a/packages/ai/README.md b/packages/ai/README.md index db2b9e3fd..477f38e81 100644 --- a/packages/ai/README.md +++ b/packages/ai/README.md @@ -182,6 +182,7 @@ Examples: - ✅ `\u200Ahttps://api.trigger.dev/custom-prefix/\u200A` (hair-space wrapper trimmed) - ✅ `\u2009https://api.trigger.dev/custom-prefix/\u2009` (thin-space wrapper trimmed) - ✅ `\u2008https://api.trigger.dev/custom-prefix/\u2008` (punctuation-space wrapper trimmed) +- ✅ `\u2006https://api.trigger.dev/custom-prefix/\u2006` (six-per-em-space wrapper trimmed) - ✅ `\u205Fhttps://api.trigger.dev/custom-prefix/\u205F` (medium-mathematical-space wrapper trimmed) - ✅ `\u3000https://api.trigger.dev/custom-prefix/\u3000` (ideographic-space wrapper trimmed) - ✅ `\uFEFFhttps://api.trigger.dev/custom-prefix/\uFEFF` (BOM wrapper trimmed) @@ -218,6 +219,7 @@ Examples: - ❌ `https://api.trigger.dev/\u200Ainternal` (internal hair-space characters) - ❌ `https://api.trigger.dev/\u2009internal` (internal thin-space characters) - ❌ `https://api.trigger.dev/\u2008internal` (internal punctuation-space characters) +- ❌ `https://api.trigger.dev/\u2006internal` (internal six-per-em-space characters) - ❌ `https://api.trigger.dev/\u202Finternal` (internal narrow no-break space characters) - ❌ `https://api.trigger.dev/\u205Finternal` (internal medium-mathematical-space characters) - ❌ `https://api.trigger.dev/\u180Einternal` (internal mongolian-vowel-separator characters) diff --git a/packages/ai/src/chatTransport.test.ts b/packages/ai/src/chatTransport.test.ts index 54f841425..b158f687c 100644 --- a/packages/ai/src/chatTransport.test.ts +++ b/packages/ai/src/chatTransport.test.ts @@ -994,6 +994,17 @@ describe("TriggerChatTransport", function () { }).toThrowError("baseURL must not contain internal whitespace characters"); }); + it("throws when baseURL contains internal six-per-em-space characters", function () { + expect(function () { + new TriggerChatTransport({ + task: "chat-task", + accessToken: "pk_trigger", + baseURL: "https://api.trigger.dev/\u2006internal", + stream: "chat-stream", + }); + }).toThrowError("baseURL must not contain internal whitespace characters"); + }); + it("throws when baseURL contains internal mongolian-vowel-separator characters", function () { expect(function () { new TriggerChatTransport({ @@ -1544,6 +1555,17 @@ describe("TriggerChatTransport", function () { }).not.toThrow(); }); + it("accepts six-per-em-space wrapped baseURL values", function () { + expect(function () { + new TriggerChatTransport({ + task: "chat-task", + accessToken: "pk_trigger", + baseURL: "\u2006https://api.trigger.dev/custom-prefix/\u2006", + stream: "chat-stream", + }); + }).not.toThrow(); + }); + it("accepts ideographic-space wrapped baseURL values", function () { expect(function () { new TriggerChatTransport({ @@ -4197,6 +4219,17 @@ describe("TriggerChatTransport", function () { }).toThrowError("baseURL must not contain internal whitespace characters"); }); + it("throws from factory when baseURL contains internal six-per-em-space characters", function () { + expect(function () { + createTriggerChatTransport({ + task: "chat-task", + accessToken: "pk_trigger", + baseURL: "https://api.trigger.dev/\u2006internal", + stream: "chat-stream", + }); + }).toThrowError("baseURL must not contain internal whitespace characters"); + }); + it("throws from factory when baseURL contains internal mongolian-vowel-separator characters", function () { expect(function () { createTriggerChatTransport({ @@ -4736,6 +4769,17 @@ describe("TriggerChatTransport", function () { }).not.toThrow(); }); + it("accepts six-per-em-space wrapped baseURL values from factory", function () { + expect(function () { + createTriggerChatTransport({ + task: "chat-task", + accessToken: "pk_trigger", + baseURL: "\u2006https://api.trigger.dev/custom-prefix/\u2006", + stream: "chat-stream", + }); + }).not.toThrow(); + }); + it("accepts ideographic-space wrapped baseURL values from factory", function () { expect(function () { createTriggerChatTransport({