Skip to content

Commit ae87637

Browse files
Cover additional unicode wrapper trimming acceptance
Co-authored-by: Eric Allam <eric@trigger.dev>
1 parent 7924efb commit ae87637

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

docs/tasks/streams.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,8 @@ Examples:
671671
-`https://api.trigger.dev/custom%3Fprefix%23segment` (percent-encoded `?` / `#`)
672672
-`\u00A0https://api.trigger.dev/custom-prefix/\u00A0` (non-breaking-space wrapper trimmed)
673673
-`\u1680https://api.trigger.dev/custom-prefix/\u1680` (ogham-space-mark wrapper trimmed)
674+
-`\u2007https://api.trigger.dev/custom-prefix/\u2007` (figure-space wrapper trimmed)
675+
-`\u205Fhttps://api.trigger.dev/custom-prefix/\u205F` (medium-mathematical-space wrapper trimmed)
674676
-`\u3000https://api.trigger.dev/custom-prefix/\u3000` (ideographic-space wrapper trimmed)
675677
-`\uFEFFhttps://api.trigger.dev/custom-prefix/\uFEFF` (BOM wrapper trimmed)
676678
-`\u2060https://api.trigger.dev/custom-prefix/\u2060` (word-joiner wrappers are rejected)

packages/ai/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ Examples:
178178
-`https://api.trigger.dev/custom%3Fprefix%23segment` (percent-encoded `?` / `#`)
179179
-`\u00A0https://api.trigger.dev/custom-prefix/\u00A0` (non-breaking-space wrapper trimmed)
180180
-`\u1680https://api.trigger.dev/custom-prefix/\u1680` (ogham-space-mark wrapper trimmed)
181+
-`\u2007https://api.trigger.dev/custom-prefix/\u2007` (figure-space wrapper trimmed)
182+
-`\u205Fhttps://api.trigger.dev/custom-prefix/\u205F` (medium-mathematical-space wrapper trimmed)
181183
-`\u3000https://api.trigger.dev/custom-prefix/\u3000` (ideographic-space wrapper trimmed)
182184
-`\uFEFFhttps://api.trigger.dev/custom-prefix/\uFEFF` (BOM wrapper trimmed)
183185
-`\u2060https://api.trigger.dev/custom-prefix/\u2060` (word-joiner wrappers are rejected)

packages/ai/src/chatTransport.test.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,6 +1270,28 @@ describe("TriggerChatTransport", function () {
12701270
}).not.toThrow();
12711271
});
12721272

1273+
it("accepts figure-space wrapped baseURL values", function () {
1274+
expect(function () {
1275+
new TriggerChatTransport({
1276+
task: "chat-task",
1277+
accessToken: "pk_trigger",
1278+
baseURL: "\u2007https://api.trigger.dev/custom-prefix/\u2007",
1279+
stream: "chat-stream",
1280+
});
1281+
}).not.toThrow();
1282+
});
1283+
1284+
it("accepts medium-mathematical-space wrapped baseURL values", function () {
1285+
expect(function () {
1286+
new TriggerChatTransport({
1287+
task: "chat-task",
1288+
accessToken: "pk_trigger",
1289+
baseURL: "\u205Fhttps://api.trigger.dev/custom-prefix/\u205F",
1290+
stream: "chat-stream",
1291+
});
1292+
}).not.toThrow();
1293+
});
1294+
12731295
it("accepts ideographic-space wrapped baseURL values", function () {
12741296
expect(function () {
12751297
new TriggerChatTransport({
@@ -4185,6 +4207,28 @@ describe("TriggerChatTransport", function () {
41854207
}).not.toThrow();
41864208
});
41874209

4210+
it("accepts figure-space wrapped baseURL values from factory", function () {
4211+
expect(function () {
4212+
createTriggerChatTransport({
4213+
task: "chat-task",
4214+
accessToken: "pk_trigger",
4215+
baseURL: "\u2007https://api.trigger.dev/custom-prefix/\u2007",
4216+
stream: "chat-stream",
4217+
});
4218+
}).not.toThrow();
4219+
});
4220+
4221+
it("accepts medium-mathematical-space wrapped baseURL values from factory", function () {
4222+
expect(function () {
4223+
createTriggerChatTransport({
4224+
task: "chat-task",
4225+
accessToken: "pk_trigger",
4226+
baseURL: "\u205Fhttps://api.trigger.dev/custom-prefix/\u205F",
4227+
stream: "chat-stream",
4228+
});
4229+
}).not.toThrow();
4230+
});
4231+
41884232
it("accepts ideographic-space wrapped baseURL values from factory", function () {
41894233
expect(function () {
41904234
createTriggerChatTransport({

0 commit comments

Comments
 (0)