Skip to content

Commit f96b545

Browse files
Cover unicode-trimmable baseURL wrappers in acceptance tests
Co-authored-by: Eric Allam <eric@trigger.dev>
1 parent 06322fd commit f96b545

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

docs/tasks/streams.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,9 @@ Examples:
668668
-` https://api.trigger.dev/custom-prefix/// ` (trimmed + normalized)
669669
-`https://api.trigger.dev/custom%20prefix` (percent-encoded whitespace)
670670
-`https://api.trigger.dev/custom%3Fprefix%23segment` (percent-encoded `?` / `#`)
671+
-`\u00A0https://api.trigger.dev/custom-prefix/\u00A0` (non-breaking-space wrapper trimmed)
672+
-`\u1680https://api.trigger.dev/custom-prefix/\u1680` (ogham-space-mark wrapper trimmed)
673+
-`\u3000https://api.trigger.dev/custom-prefix/\u3000` (ideographic-space wrapper trimmed)
671674
-`\uFEFFhttps://api.trigger.dev/custom-prefix/\uFEFF` (BOM wrapper trimmed)
672675
-`\u2060https://api.trigger.dev/custom-prefix/\u2060` (word-joiner wrappers are rejected)
673676
-`\u200Bhttps://api.trigger.dev/custom-prefix/\u200B` (zero-width-space wrappers are rejected)

packages/ai/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ Examples:
175175
-` https://api.trigger.dev/custom-prefix/// ` (trimmed + normalized)
176176
-`https://api.trigger.dev/custom%20prefix` (percent-encoded whitespace)
177177
-`https://api.trigger.dev/custom%3Fprefix%23segment` (percent-encoded `?` / `#`)
178+
-`\u00A0https://api.trigger.dev/custom-prefix/\u00A0` (non-breaking-space wrapper trimmed)
179+
-`\u1680https://api.trigger.dev/custom-prefix/\u1680` (ogham-space-mark wrapper trimmed)
180+
-`\u3000https://api.trigger.dev/custom-prefix/\u3000` (ideographic-space wrapper trimmed)
178181
-`\uFEFFhttps://api.trigger.dev/custom-prefix/\uFEFF` (BOM wrapper trimmed)
179182
-`\u2060https://api.trigger.dev/custom-prefix/\u2060` (word-joiner wrappers are rejected)
180183
-`\u200Bhttps://api.trigger.dev/custom-prefix/\u200B` (zero-width-space wrappers are rejected)

packages/ai/src/chatTransport.test.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,6 +1204,28 @@ describe("TriggerChatTransport", function () {
12041204
}).not.toThrow();
12051205
});
12061206

1207+
it("accepts ogham-space-mark wrapped baseURL values", function () {
1208+
expect(function () {
1209+
new TriggerChatTransport({
1210+
task: "chat-task",
1211+
accessToken: "pk_trigger",
1212+
baseURL: "\u1680https://api.trigger.dev/custom-prefix/\u1680",
1213+
stream: "chat-stream",
1214+
});
1215+
}).not.toThrow();
1216+
});
1217+
1218+
it("accepts ideographic-space wrapped baseURL values", function () {
1219+
expect(function () {
1220+
new TriggerChatTransport({
1221+
task: "chat-task",
1222+
accessToken: "pk_trigger",
1223+
baseURL: "\u3000https://api.trigger.dev/custom-prefix/\u3000",
1224+
stream: "chat-stream",
1225+
});
1226+
}).not.toThrow();
1227+
});
1228+
12071229
it("accepts BOM-wrapped baseURL values", function () {
12081230
expect(function () {
12091231
new TriggerChatTransport({
@@ -4042,6 +4064,28 @@ describe("TriggerChatTransport", function () {
40424064
}).not.toThrow();
40434065
});
40444066

4067+
it("accepts ogham-space-mark wrapped baseURL values from factory", function () {
4068+
expect(function () {
4069+
createTriggerChatTransport({
4070+
task: "chat-task",
4071+
accessToken: "pk_trigger",
4072+
baseURL: "\u1680https://api.trigger.dev/custom-prefix/\u1680",
4073+
stream: "chat-stream",
4074+
});
4075+
}).not.toThrow();
4076+
});
4077+
4078+
it("accepts ideographic-space wrapped baseURL values from factory", function () {
4079+
expect(function () {
4080+
createTriggerChatTransport({
4081+
task: "chat-task",
4082+
accessToken: "pk_trigger",
4083+
baseURL: "\u3000https://api.trigger.dev/custom-prefix/\u3000",
4084+
stream: "chat-stream",
4085+
});
4086+
}).not.toThrow();
4087+
});
4088+
40454089
it("accepts BOM-wrapped baseURL values from factory", function () {
40464090
expect(function () {
40474091
createTriggerChatTransport({

0 commit comments

Comments
 (0)