Skip to content

Commit 21fa332

Browse files
committed
feat(sdk): ToolSet typing for toolFromTask, ai.toolExecute, deprecate ai.tool
- Assert toolFromTask return as AI SDK ToolSet-compatible; import ToolSet from ai - Add changesets for @trigger.dev/sdk - ai-chat reference: chat-tools module, registry language model helper, streamText cleanup - Prisma migration removing user tool demo; demo docs and next config tweaks
1 parent 516c21e commit 21fa332

File tree

20 files changed

+1612
-890
lines changed

20 files changed

+1612
-890
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/sdk": patch
3+
---
4+
5+
Add `ai.toolExecute(task)` so you can pass Trigger's subtask/metadata wiring as the `execute` handler to AI SDK `tool()` while defining `description` and `inputSchema` yourself. Refactors `ai.tool()` to share the same internal handler.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@trigger.dev/sdk": patch
3+
---
4+
5+
Align `ai.tool()` (`toolFromTask`) with the AI SDK `ToolSet` shape: Zod-backed tasks use static `tool()`; returns are asserted as `Tool & ToolSet[string]`. Raise the SDK's minimum `ai` devDependency to `^6.0.116` so emitted types resolve the same `ToolSet` as apps on AI SDK 6.0.x (avoids cross-version `ToolSet` mismatches in monorepos).
6+

.changeset/dry-sloths-divide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/sdk": patch
3+
---
4+
5+
Add `chat.withUIMessage<TUIMessage>()` for typed AI SDK `UIMessage` in chat task hooks, optional factory `streamOptions` merged with `uiMessageStreamOptions`, and `InferChatUIMessage` helper. Generic `ChatUIMessageStreamOptions`, compaction, and pending-message event types. `usePendingMessages` accepts a UI message type parameter; re-export `InferChatUIMessage` from `@trigger.dev/sdk/chat/react`.

packages/trigger-sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"@types/slug": "^5.0.3",
7979
"@types/uuid": "^9.0.0",
8080
"@types/ws": "^8.5.3",
81-
"ai": "^6.0.0",
81+
"ai": "^6.0.116",
8282
"encoding": "^0.1.13",
8383
"rimraf": "^3.0.2",
8484
"tshy": "^3.0.2",

0 commit comments

Comments
 (0)