diff --git a/docs/tasks/streams.mdx b/docs/tasks/streams.mdx index 302987d68..1bbdc15c9 100644 --- a/docs/tasks/streams.mdx +++ b/docs/tasks/streams.mdx @@ -672,6 +672,7 @@ Examples: - ✅ `\u00A0https://api.trigger.dev/custom-prefix/\u00A0` (non-breaking-space wrapper trimmed) - ✅ `\u1680https://api.trigger.dev/custom-prefix/\u1680` (ogham-space-mark wrapper trimmed) - ✅ `\u2007https://api.trigger.dev/custom-prefix/\u2007` (figure-space wrapper trimmed) +- ✅ `\u200Ahttps://api.trigger.dev/custom-prefix/\u200A` (hair-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) @@ -705,6 +706,7 @@ Examples: - ❌ `https://api.trigger.dev/\u200Dinternal` - ❌ `https://api.trigger.dev/\u1680internal` - ❌ `https://api.trigger.dev/\u2007internal` +- ❌ `https://api.trigger.dev/\u200Ainternal` - ❌ `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 4c15758ea..ceb22329a 100644 --- a/packages/ai/README.md +++ b/packages/ai/README.md @@ -179,6 +179,7 @@ Examples: - ✅ `\u00A0https://api.trigger.dev/custom-prefix/\u00A0` (non-breaking-space wrapper trimmed) - ✅ `\u1680https://api.trigger.dev/custom-prefix/\u1680` (ogham-space-mark wrapper trimmed) - ✅ `\u2007https://api.trigger.dev/custom-prefix/\u2007` (figure-space wrapper trimmed) +- ✅ `\u200Ahttps://api.trigger.dev/custom-prefix/\u200A` (hair-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) @@ -212,6 +213,7 @@ Examples: - ❌ `https://api.trigger.dev/\u200Dinternal` (internal zero-width-joiner characters) - ❌ `https://api.trigger.dev/\u1680internal` (internal ogham-space-mark characters) - ❌ `https://api.trigger.dev/\u2007internal` (internal figure-space characters) +- ❌ `https://api.trigger.dev/\u200Ainternal` (internal hair-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 e488a48f3..d20d0a682 100644 --- a/packages/ai/src/chatTransport.test.ts +++ b/packages/ai/src/chatTransport.test.ts @@ -961,6 +961,17 @@ describe("TriggerChatTransport", function () { }).toThrowError("baseURL must not contain internal whitespace characters"); }); + it("throws when baseURL contains internal hair-space characters", function () { + expect(function () { + new TriggerChatTransport({ + task: "chat-task", + accessToken: "pk_trigger", + baseURL: "https://api.trigger.dev/\u200Ainternal", + 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({ @@ -1478,6 +1489,17 @@ describe("TriggerChatTransport", function () { }).not.toThrow(); }); + it("accepts hair-space wrapped baseURL values", function () { + expect(function () { + new TriggerChatTransport({ + task: "chat-task", + accessToken: "pk_trigger", + baseURL: "\u200Ahttps://api.trigger.dev/custom-prefix/\u200A", + stream: "chat-stream", + }); + }).not.toThrow(); + }); + it("accepts ideographic-space wrapped baseURL values", function () { expect(function () { new TriggerChatTransport({ @@ -4098,6 +4120,17 @@ describe("TriggerChatTransport", function () { }).toThrowError("baseURL must not contain internal whitespace characters"); }); + it("throws from factory when baseURL contains internal hair-space characters", function () { + expect(function () { + createTriggerChatTransport({ + task: "chat-task", + accessToken: "pk_trigger", + baseURL: "https://api.trigger.dev/\u200Ainternal", + 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({ @@ -4604,6 +4637,17 @@ describe("TriggerChatTransport", function () { }).not.toThrow(); }); + it("accepts hair-space wrapped baseURL values from factory", function () { + expect(function () { + createTriggerChatTransport({ + task: "chat-task", + accessToken: "pk_trigger", + baseURL: "\u200Ahttps://api.trigger.dev/custom-prefix/\u200A", + stream: "chat-stream", + }); + }).not.toThrow(); + }); + it("accepts ideographic-space wrapped baseURL values from factory", function () { expect(function () { createTriggerChatTransport({