Skip to content

Commit 9fc5ac4

Browse files
pranaygpclaude
andcommitted
Re-export DurableAgent at top level of @workflow/ai
Users can now import DurableAgent directly from @workflow/ai instead of requiring @workflow/ai/agent. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 8a82ec5 commit 9fc5ac4

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

.changeset/export-durable-agent.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@workflow/ai": patch
3+
---
4+
5+
Re-export DurableAgent class and types at package top level for easier imports

docs/content/docs/api-reference/workflow-ai/durable-agent.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The `DurableAgent` class enables you to create AI-powered agents that can mainta
1414
Tool calls can be implemented as workflow steps for automatic retries, or as regular workflow-level logic utilizing core library features such as [`sleep()`](/docs/api-reference/workflow/sleep) and [Hooks](/docs/foundations/hooks).
1515

1616
```typescript lineNumbers
17-
import { DurableAgent } from '@workflow/ai/agent';
17+
import { DurableAgent } from '@workflow/ai';
1818
import { z } from 'zod';
1919

2020
async function getWeather({ city }: { city: string }) {
@@ -51,7 +51,7 @@ async function myAgent() {
5151
<TSDoc
5252
definition={generateDefinition({
5353
code: `
54-
import { DurableAgent } from "@workflow/ai/agent";
54+
import { DurableAgent } from "@workflow/ai";
5555
export default DurableAgent;`
5656
})}
5757
/>
@@ -61,7 +61,7 @@ export default DurableAgent;`
6161
<TSDoc
6262
definition={generateDefinition({
6363
code: `
64-
import type { DurableAgentOptions } from "@workflow/ai/agent";
64+
import type { DurableAgentOptions } from "@workflow/ai";
6565
export default DurableAgentOptions;`
6666
})}
6767
/>
@@ -71,7 +71,7 @@ export default DurableAgentOptions;`
7171
<TSDoc
7272
definition={generateDefinition({
7373
code: `
74-
import type { DurableAgentStreamOptions } from "@workflow/ai/agent";
74+
import type { DurableAgentStreamOptions } from "@workflow/ai";
7575
export default DurableAgentStreamOptions;`
7676
})}
7777
/>
@@ -95,7 +95,7 @@ export default DurableAgentStreamOptions;`
9595
### Basic Agent with Tools
9696

9797
```typescript
98-
import { DurableAgent } from '@workflow/ai/agent';
98+
import { DurableAgent } from '@workflow/ai';
9999
import { z } from 'zod';
100100

101101
async function getWeather({ location }: { location: string }) {
@@ -134,7 +134,7 @@ async function weatherAgentWorkflow(userQuery: string) {
134134
### Multiple Tools
135135

136136
```typescript
137-
import { DurableAgent } from '@workflow/ai/agent';
137+
import { DurableAgent } from '@workflow/ai';
138138
import { z } from 'zod';
139139

140140
async function getWeather({ location }: { location: string }) {
@@ -180,7 +180,7 @@ async function multiToolAgentWorkflow(userQuery: string) {
180180
### Tools with Workflow Library Features
181181

182182
```typescript
183-
import { DurableAgent } from '@workflow/ai/agent';
183+
import { DurableAgent } from '@workflow/ai';
184184
import { sleep, defineHook } from 'workflow';
185185
import { z } from 'zod';
186186

packages/ai/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export * from './workflow-chat-transport.js';
2+
export * from './agent/durable-agent.js';

0 commit comments

Comments
 (0)