Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
a364121
feat: add @trigger.dev/ai package with TriggerChatTransport
cursoragent Feb 15, 2026
68e5a57
test: add comprehensive unit tests for TriggerChatTransport
cursoragent Feb 15, 2026
3956baa
refactor: polish TriggerChatTransport implementation
cursoragent Feb 15, 2026
e1e5aaf
test: add abort signal, multiple sessions, and body merging tests
cursoragent Feb 15, 2026
ec6bb76
chore: add changeset for @trigger.dev/ai package
cursoragent Feb 15, 2026
876dbef
refactor: remove internal ChatSessionState from public exports
cursoragent Feb 15, 2026
e25bd8a
feat: support dynamic accessToken function for token refresh
cursoragent Feb 15, 2026
836d12c
refactor: avoid double-resolving accessToken in sendMessages
cursoragent Feb 15, 2026
46dc500
feat: add chat transport and AI chat helpers to @trigger.dev/sdk
cursoragent Feb 15, 2026
c747b0b
test: move chat transport tests to @trigger.dev/sdk
cursoragent Feb 15, 2026
d35d593
refactor: delete packages/ai/ — moved to @trigger.dev/sdk subpaths
cursoragent Feb 15, 2026
c3e83cd
chore: update changeset to target @trigger.dev/sdk
cursoragent Feb 15, 2026
32d4e73
fix: address CodeRabbit review feedback
cursoragent Feb 15, 2026
fb01004
docs(ai): add AI Chat with useChat guide
cursoragent Feb 15, 2026
cdd4dcf
feat(reference): add ai-chat Next.js reference project
cursoragent Feb 15, 2026
e631dad
fix(reference): use compatible @ai-sdk v3 packages, await convertToMo…
cursoragent Feb 15, 2026
7e17b8f
Use a single run with iterative waitpoint token completions
ericallam Feb 21, 2026
a7538ab
Added tool example
ericallam Feb 21, 2026
89cfe47
expose a useTriggerChatTransport hook
ericallam Feb 21, 2026
90eb452
use input streams and rename chatTask and chatState to chat.task and …
ericallam Mar 3, 2026
7213ec8
add stopping support and fix issue with the OpenAI responses API and …
ericallam Mar 4, 2026
b15b16f
Add warmTimeoutInSeconds option
ericallam Mar 4, 2026
03e13f6
Add clientData support
ericallam Mar 4, 2026
1212867
provide already converted UIMessages to the run function for better dx
ericallam Mar 4, 2026
825c038
Added better telemetry support to view turns
ericallam Mar 4, 2026
0b296f8
Fix double looping when resuming from an input stream waitpoint
ericallam Mar 4, 2026
556686c
Add some pending message support in the example
ericallam Mar 4, 2026
68c7198
Accumulate messages in the task, allowing us to only have to send use…
ericallam Mar 5, 2026
c3fddbd
build full example with persisting messages, adding necessary hooks, …
ericallam Mar 5, 2026
c83e010
Add ai chat to the sidebar for now
ericallam Mar 5, 2026
e8a895c
remove postinstall hook
ericallam Mar 5, 2026
8dacf08
feat: add onTurnStart hook, lastEventId support, and stream resume de…
ericallam Mar 5, 2026
7f83f4c
Minor fixes around reconnecting streams
ericallam Mar 6, 2026
9ebf6a8
update pnpm link file
ericallam Mar 6, 2026
155336b
fixed chat tests
ericallam Mar 6, 2026
016a446
use locals for the chat pipe counter instead of a module global
ericallam Mar 6, 2026
9fe4c8a
Add triggerOptions to the transport, auto-tag with the chat ID
ericallam Mar 6, 2026
6f30a07
Make clientData typesafe and pass to all chat.task hooks
ericallam Mar 6, 2026
157421d
feat: add chat.local for per-run typed data with Proxy access and dir…
ericallam Mar 6, 2026
4d6668d
feat(chat): add stop handling, abort cleanup, continuation support, a…
ericallam Mar 7, 2026
2d6df61
Some improvements to the example ai-chat
ericallam Mar 7, 2026
76a6b9a
feat(chat): expose typed chat.stream, add deepResearch subtask exampl…
ericallam Mar 8, 2026
8f0e665
feat(ai): pass chat context and toolCallId to subtasks, add typed ai.…
ericallam Mar 8, 2026
69d1ceb
feat(chat): add preload support, dynamic tools, and preload-specific …
ericallam Mar 9, 2026
6ccafaa
docs: add mermaid architecture diagrams for ai-chat system
ericallam Mar 9, 2026
dac71e2
docs: add sequence diagrams to ai-chat guide
ericallam Mar 9, 2026
f22a0b2
feat(chat): auto-hydrate chat.local values in ai.tool subtasks
ericallam Mar 9, 2026
3c4b5e5
feat(chat): add chat.defer(), preload toggle, TTFB measurement, and f…
ericallam Mar 9, 2026
4ca281e
fix(reference): replace hand-rolled HTML stripping with turndown
ericallam Mar 9, 2026
2ab5bf5
feat(streams): add inputStream.waitWithWarmup(), warm timeout config …
ericallam Mar 9, 2026
e45533a
feat(chat): add composable primitives, raw task example, and task mod…
ericallam Mar 10, 2026
97f967e
Introduce the chat session API and better docs organization
ericallam Mar 10, 2026
0b4b963
Add support for toUIMessageStream() options
ericallam Mar 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .changeset/ai-sdk-chat-transport.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
"@trigger.dev/sdk": minor
---

Add AI SDK chat transport integration via two new subpath exports:

**`@trigger.dev/sdk/chat`** (frontend, browser-safe):
- `TriggerChatTransport` — custom `ChatTransport` for the AI SDK's `useChat` hook that runs chat completions as durable Trigger.dev tasks
- `createChatTransport()` — factory function

```tsx
import { useChat } from "@ai-sdk/react";
import { TriggerChatTransport } from "@trigger.dev/sdk/chat";

const { messages, sendMessage } = useChat({
transport: new TriggerChatTransport({
task: "my-chat-task",
accessToken,
}),
});
```

**`@trigger.dev/sdk/ai`** (backend, extends existing `ai.tool`/`ai.currentToolOptions`):
- `chatTask()` — pre-typed task wrapper with auto-pipe support
- `pipeChat()` — pipe a `StreamTextResult` or stream to the frontend
- `CHAT_STREAM_KEY` — the default stream key constant
- `ChatTaskPayload` type

```ts
import { chatTask } from "@trigger.dev/sdk/ai";
import { streamText, convertToModelMessages } from "ai";

export const myChatTask = chatTask({
id: "my-chat-task",
run: async ({ messages }) => {
return streamText({
model: openai("gpt-4o"),
messages: convertToModelMessages(messages),
});
},
});
```
22 changes: 22 additions & 0 deletions .claude/rules/package-installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
paths:
- "**/package.json"
---

# Installing Packages

When adding a new dependency to any package.json in the monorepo:

1. **Look up the latest version** on npm before adding:
```bash
pnpm view <package-name> version
```
If unsure which version to use (e.g. major version compatibility), confirm with the user.

2. **Edit the package.json directly** — do NOT use `pnpm add` as it can cause issues in the monorepo. Add the dependency with the correct version range (typically `^x.y.z`).

3. **Run `pnpm i` from the repo root** after editing to install and update the lockfile:
```bash
pnpm i
```
Always run from the repo root, not from the package directory.
2 changes: 2 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ This file provides guidance to Claude Code when working with this repository. Su

This is a pnpm 10.23.0 monorepo using Turborepo. Run commands from root with `pnpm run`.

**Adding dependencies:** Edit `package.json` directly instead of using `pnpm add`, then run `pnpm i` from the repo root. See `.claude/rules/package-installation.md` for the full process.

```bash
pnpm run docker # Start Docker services (PostgreSQL, Redis, Electric)
pnpm run db:migrate # Run database migrations
Expand Down
Loading
Loading