Commit Graph

1497 Commits

Author SHA1 Message Date
Adrian c6e22d0e43 docs: fix postgres world setup docs (#429) 2025-11-26 10:33:34 -08:00
Adrian cc37184967 fix: ai links in docs agent (#440) 2025-11-26 10:31:02 -08:00
Adrian b042ba70ee fix: externalize bun from step bundle (#425)
* fix: externlize bun from step bundle

* changeset

* fix: add bun to node module esbuild plugin

* feat: add bun to node module esbuild plugin match

* feat: add hint for using bun inside workflow in ts lsp

* fix: add support for bun:* modules
2025-11-26 09:28:59 -08:00
Nathan Rajlich 0ecd2da992 [docs] Add button link to X account (#435) 2025-11-26 08:41:35 -08:00
Nathan Rajlich 07800c29ee Support closure variables for serialized step functions (#366) 2025-11-25 00:29:15 -08:00
Nathan Rajlich 8b470f0c1d Apply SWC transformation on step functions returned from factory function (#360)
Added support for transforming step functions that are returned from factory functions.

### What changed?

Enhanced the SWC plugin to detect and transform step functions that are defined within object literals returned by factory functions. The transformation now properly identifies arrow functions with object literal bodies and processes their step functions accordingly.

Added test fixtures to verify the functionality:
- Created test cases for a factory function that returns an object with a step method
- Added corresponding output files for client, step, and workflow modes

### How to test?

1. Create a factory function that returns an object with methods marked as steps:
```javascript
const myFactory = () => ({
  myStep: async () => {
    'use step';
    await fs.mkdir('test');
  },
});
```

2. Verify that the step function is properly transformed and registered when used in a workflow.

### Why make this change?

This enhancement supports a common pattern where developers create factory functions that return objects containing step methods. Without this change, step functions defined in this pattern weren't being properly transformed, which limited the flexibility of the workflow system.
2025-11-25 00:25:44 -08:00
Nathan Rajlich fb9fd0f893 Add support for closure scope vars in step functions (#358)
### What changed?

- Enhanced the SWC plugin to detect and collect closure variables from nested step functions
- Modified the workflow runtime to pass closure variables to step functions during execution
- Updated the serialization/deserialization logic to handle the new closure variable format
- Added a mechanism to access closure variables within step functions
- Added tests to verify closure variable functionality in nested step functions
- Closure variables are stored on the step function execution's `AsyncLocalStorage`​ context

### Example

```typescript
export async function myWorkflow(baseValue: number) {
  'use workflow';
  const multiplier = 3;
  const prefix = 'Result: ';

  const calculate = async () => {
    'use step';
    const result = baseValue * multiplier;
    return `${prefix}${result}`;
  };

  return await calculate();
}
```

### Why make this change?

Previously, nested step functions couldn't access variables from their parent workflow scope, limiting their usefulness and requiring workarounds like passing all needed values as parameters. This change enables a more natural programming model where step functions can access variables from their enclosing scope, making workflow code more intuitive and reducing the need for explicit parameter passing.
2025-11-25 00:21:05 -08:00
Adrian 71d1757d0f fix: preview package tarballs (#411) 2025-11-24 16:50:04 -08:00
Hayden Bleasel 4f09e128a8 Remove unused dependencies (#405) 2025-11-24 15:23:32 -08:00
Vercel Release Bot 018c5a053e Version Packages (beta) (#410) @workflow/world-testing@4.0.1-beta.22 workflow@4.0.1-beta.21 @workflow/nitro@4.0.1-beta.21 @workflow/next@4.0.1-beta.21 @workflow/cli@4.0.1-beta.21 @workflow/ai@4.0.1-beta.21 @workflow/web-shared@4.0.1-beta.19 @workflow/core@4.0.1-beta.18 @workflow/builders@4.0.1-beta.17 @workflow/nuxt@4.0.1-beta.10 2025-11-24 15:22:23 -08:00
Julian Benegas aba5264174 [ai] Add onStepFinish callback to DurableAgent#stream() (#404) 2025-11-24 15:10:49 -08:00
Peter Wielander 6889dacd08 [world-vercel] log warning when detecting zod v3 during enqueue action (#409) 2025-11-24 15:08:15 -08:00
Vercel Release Bot e5c0380bbd Version Packages (beta) (#396) @workflow/world-postgres@4.1.0-beta.14 @workflow/world-testing@4.0.1-beta.21 workflow@4.0.1-beta.20 @workflow/nitro@4.0.1-beta.20 @workflow/next@4.0.1-beta.20 @workflow/cli@4.0.1-beta.20 @workflow/web-shared@4.0.1-beta.18 @workflow/core@4.0.1-beta.17 @workflow/builders@4.0.1-beta.16 @workflow/world-local@4.0.1-beta.12 @workflow/world-vercel@4.0.1-beta.11 @workflow/nuxt@4.0.1-beta.9 @workflow/errors@4.0.1-beta.6 @workflow/utils@4.0.1-beta.4 @workflow/sveltekit@4.0.0-beta.14 2025-11-24 14:25:39 -08:00
Nathan Rajlich aa5ff3ccd9 Disable Turborepo cache for CI related tasks (#329)
* Disable Turborepo cache for CI related tasks

Disable cache for all tasks except "build"

* Checkout swc-plugin test fixture files with Unix newlines for Windows (#331)
2025-11-24 13:35:43 -08:00
Peter Wielander 2c438c3bd0 [world-vercel] Fix queue call compatibility for zod v3 (#403) 2025-11-24 12:29:40 -08:00
Adrian edb69c3c0d fix: port detection, postgres nitro apps and nitro app testing (#363)
* add debug logs

* add polling for port test

* nuxt may be hmring on ignored files/folders

* Revert "nuxt may be hmring on ignored files/folders"

This reverts commit c57c3f0dd9e1b757825c777e12b63e050ca44227.

* Update packages/utils/src/get-port.ts

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>

* Update packages/world-local/src/config.ts

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>

* Update packages/utils/src/get-port.ts

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>

* revert getPort

* test new pid to port cmd

* extend sleep time on tests

* fix

* fix race condition in tests

* add logs

* add fallback from pid-port

* remove pid-port fallback

* revert config ts

* test: add getPort test

* update tests for concurrent calls

* temp

* trigger rebuild

* feat: add windows get port support

* fix port sorting

* fix parsing logic and filtering

* fformat

* update ports logi

* revert

* windows port hack

* refactor: optional chaining on windows

* test: change ordering of config tests

* remove wrong test

* simplify windows getPort impl

* use execFileSync instead of execFile

* use execa

* disable test cache

* Update packages/utils/src/get-port.ts

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>

* update

* debug

* windows cmd

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* lockfile

* fix: windows port detection

* simplify stuff

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* test: revert gh copilot

* fix

* increase sleep

* revert logs

* revert turbo

* revert

* revert

* changeset

* Update packages/utils/src/get-port.ts

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>

* format

* init postgres world for express and hono

* add posgres world to nitro config

* add postgres world start to sveltekit

* add postgres world plugin to nitro apps

* Update workbench/sveltekit/src/hooks.server.ts

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>

* Update workbench/vite/vite.config.ts

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>

* fix nuxt plugin

* revert vercel compiled hook on nitro

* .

* revert

* update

* CI WILL BE GREEN

* remove log in nitro

---------

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-24 09:30:41 -08:00
Gal Schlezinger 10ce313d56 postgres: fix tests (#394)
* postgres: use non-deprecated drizzle signatures

Signed-off-by: Gal Schlezinger <gal@spitfire.co.il>

* postgres: store metadata in the hook

Signed-off-by: Gal Schlezinger <gal@spitfire.co.il>

* core: do not rely on module cache for world config. instead, use a global and a symbol.

this makes sure that streamers can use in-memory event emitters and that it won't be compiled away into the different flow.js and step.js files.

this was figured out when i was adding a hooks tests to world-testing.

Signed-off-by: Gal Schlezinger <gal@spitfire.co.il>

* add postgres world to all workbench packages

we try to run them with the postgres world but it's not installed

Signed-off-by: Gal Schlezinger <gal@spitfire.co.il>

* Replace jsonb with cbor because zero byte does not work in jsonb :(

Signed-off-by: Gal Schlezinger <gal@spitfire.co.il>

* fix error handling: attempts start at 0 now, and not 1 like when we released. so initial attempt in postgres should reflect that.

Signed-off-by: Gal Schlezinger <gal@spitfire.co.il>

* drain stuff

Signed-off-by: Gal Schlezinger <gal@spitfire.co.il>

* fallback metadata to metadataJson

Signed-off-by: Gal Schlezinger <gal@spitfire.co.il>

* Make code more readable

Signed-off-by: Gal Schlezinger <gal@spitfire.co.il>

* apply Vade fix

Signed-off-by: Gal Schlezinger <gal@spitfire.co.il>

---------

Signed-off-by: Gal Schlezinger <gal@spitfire.co.il>
2025-11-23 11:05:20 -08:00
Nathan Rajlich 00e334506c [ai] Make DurableAgent#stream() return a messages array (#362)
* Make `DurableAgent#stream()` return a `messages` array

* Docs updates

* Docs updates

* fix

---------

Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>
2025-11-23 11:02:53 -08:00
Vercel Release Bot 7a230a9ad1 Version Packages (beta) (#387)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@workflow/world-postgres@4.1.0-beta.13 @workflow/world-testing@4.0.1-beta.20 workflow@4.0.1-beta.19 @workflow/nitro@4.0.1-beta.19 @workflow/next@4.0.1-beta.19 @workflow/cli@4.0.1-beta.19 @workflow/ai@4.0.1-beta.19 @workflow/web-shared@4.0.1-beta.17 @workflow/core@4.0.1-beta.16 @workflow/builders@4.0.1-beta.15 @workflow/world-local@4.0.1-beta.11 @workflow/nuxt@4.0.1-beta.8 workflow@4.0.1-beta.1 @workflow/nitro@4.0.1-beta.1 @workflow/next@4.0.1-beta.1 @workflow/cli@4.0.1-beta.1 @workflow/ai@4.0.1-beta.1 @workflow/sveltekit@4.0.0-beta.13
2025-11-22 07:32:12 -08:00
Pranay Prakash ce50baf96a bring world local back to 4.x 2025-11-22 10:29:36 -05:00
Copilot 34366293a0 Fix streamer bugs and document concurrency limitations in world-local (#391)
* Initial plan

* Fix bugs in world-local: empty chunk handling, type safety, and documentation

Co-authored-by: pranaygp <1797812+pranaygp@users.noreply.github.com>

* Add changeset for world-local bug fixes

Co-authored-by: pranaygp <1797812+pranaygp@users.noreply.github.com>

* Attempt to fix local straming

* fix the actual queue copy problem

* update changeset

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pranaygp <1797812+pranaygp@users.noreply.github.com>
Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>
2025-11-22 07:26:46 -08:00
Peter Wielander 99611405d4 Fix hydration of events with dates and of step functions (#380) 2025-11-21 13:58:02 -05:00
Adrian 73b6c68daf remove suppressUndefinedRejections from base builder (#384) 2025-11-21 06:42:28 -08:00
Sree Narayanan adfa01224a [docs] Minor corrections to local world and express setup docs (#385)
Signed-off-by: Sree Narayanan <sreeaadhi07@gmail.com>
2025-11-20 23:57:52 -08:00
Vercel Release Bot 2856d665c0 Version Packages (beta) (#375)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@workflow/world-testing@4.0.1-beta.19 workflow@4.0.1-beta.18 @workflow/nitro@4.0.1-beta.18 @workflow/next@4.0.1-beta.18 @workflow/cli@4.0.1-beta.18 @workflow/builders@4.0.1-beta.14 @workflow/swc-plugin@4.0.1-beta.7 @workflow/nuxt@4.0.1-beta.7 @workflow/world-testing@4.0.1-beta.1 @workflow/sveltekit@4.0.0-beta.12
2025-11-20 14:24:12 -08:00
Copilot 154670ae01 Handle FatalError in DurableAgent tool execution (#376)
* Initial plan

* Fix DurableAgent to handle FatalError in tool calls

Convert FatalError exceptions in tool execution to tool-result errors that get
propagated back to the LLM, mimicking AI SDK behavior. Non-fatal errors are
re-thrown to allow workflow retry mechanisms to handle them.

- Updated executeTool to catch FatalError and convert to error-text tool result
- Added comprehensive tests for error handling scenarios
- All tests passing

Co-authored-by: pranaygp <1797812+pranaygp@users.noreply.github.com>

* Address code review feedback and add changeset

Remove unnecessary type assertion and add changeset for the DurableAgent fix

Co-authored-by: pranaygp <1797812+pranaygp@users.noreply.github.com>

* Update packages/ai/src/agent/durable-agent.ts

* Apply suggestion from @pranaygp

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pranaygp <1797812+pranaygp@users.noreply.github.com>
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>
2025-11-20 14:17:48 -08:00
Nathan Rajlich 43a3f797d3 [ai] Fix "start" and "finish" chunk events in DurableAgent (#378)
* [ai] Remove "start" and "finish" chunk events

* Wire through sendStart and sendFinish properly

* changeset

---------

Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>
2025-11-20 14:16:21 -08:00
Nathan Rajlich e5c5236363 Fix default export workflow function transformation in workflow mode (#373)
Fixed a bug where default export workflow functions with names (e.g., `export default async function testWorkflow()`) would fail at runtime with `ReferenceError: $$default is not defined`. The SWC plugin now correctly keeps the default export as-is and simply adds the workflowId assignment after it, since the function name is available as a binding in the module scope.

Also adds support for anonymous and arrow function default exports, which previously were not being transformed at all.

Fixes #367.
2025-11-20 12:26:12 -08:00
Nathan Rajlich 1e636e170d [ai] Make writable property be required in DurableAgent#stream() (#365) 2025-11-20 00:19:35 -08:00
Adrian 4b4f93b662 docs: fix framework cards (#372)
* docs: fix framework cards

* docs: fix tanstack start logo light mode

* remove h1 on vite
2025-11-19 17:16:54 -08:00
Adrian 00066be07b feat: add express support (#138)
* refactor: migrate to latest nitro v3

Signed-off-by:  Pooya Parsa <pooya@pi0.io>

* update workaround

* fix(nitro): nitro builder using deprecated srcDir

* fix: testing matrix dirs

* fix(hono): externalize nitro workflow output dir

* chore: format

* fix(nitro): externalize .nitro/workflow folder

* docs(hono): update getting started

* update docs and workbench

* improve plugin patch

* docs: preserve code style

* update `getWorkflowDirs`

* test: fix hono dev config

* fix: wrong api file path in hono dev config

* fix(nitro): check all dirs for builder

* chore: add comments

* add express workbench testing app

* docs: add express wip page

* add workflows symlink for express workbench

* add hook and trigger routes for express workbench

* update server entrypoint to use hook and trigger router

* remove h3 and add express types

* docs: add express getting started guide

* test: wire up express workbench

* Update workbench/express/routes/hook.routes.ts

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>

* Update workbench/express/routes/trigger.routes.ts

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>

* build: missing deps in workbench express

* build: remove express as dev dep

* lockfile

* build: remove test command from express workbench

* fix: url query parsing

* chore: add README

* remove app hook and trigger routers

* .

* fix: json body not getting parsed in workbench express

* fix: writing streams in workbench

* fix: wrong stream piping express workbench

* update

* fix: json parsing body workbench express

* update

* fix: add js file extension for relative import on workflow express workbench

* test

* refactor: route naming conventions for nitro

* refactore: convert to catch all api on express

* Update workbench/express/package.json

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>

* refactor: api file convention

* testing presets

* refactor: use simple `index.ts`

* update

* switch entry format to node

* add generate workflow script to express

* fix: express nitro config

* docs(express): update express getting started

* test: add express

* fix(express): workbench api routes

* fix(express): add workflowsDir to testing matrix

* format

* update gitignore

* fix

* .

* trigger ci

* update workflows dir

* fix: streaming in express

* fix: not json parsing body express

* fix: missing dev test in express

* fix: test matrix for express

* docs(express): update getting started and add rollup dep

* .

* docs: add express card to home page and getting started

* Update docs/content/docs/getting-started/express.mdx

Co-authored-by: Pooya Parsa <pooya@pi0.io>

* docs: fix express

* remove h1 on express

---------

Signed-off-by: Pooya Parsa <pooya@pi0.io>
Co-authored-by: Pooya Parsa <pooya@pi0.io>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
2025-11-19 17:12:53 -08:00
Hayden Bleasel 250edc1d52 Update vite.mdx (#371) 2025-11-19 16:25:21 -08:00
Hayden Bleasel c0991b4ff7 Update docs (#349)
* Initial migration

* Remove ExperimentalPackageCallout

* Remove Callout imports

* Add missing dep

* Update postgres-world.mdx

* Add missing deps, remove unused files

* Restore homepage css

* Update logo, fix homepage

* Update run-anywhere.tsx

* Remove duplicate h1 tags

* Fix package install commands

* Update global.css

* Update code-block.tsx

* Fix framework descriptions

* Remove unused files

* Fix steps

* Update sidebar.tsx

* Remove excess horizontal rules

* Remove unused components

* Cleanup home code-block component

* Update route.ts

* Add missing feed dep

* Rename middleware to proxy

* Update next config

* Update route.tsx

* Move generateDefinition call into tsx

* Update page.tsx

* Update sidebar.tsx

* Update layout.tsx

* Remove unused files

* Fix nav

* Update route.ts

* Remove deprecated lint:links

* Load fonts locally

* Update layout.tsx

* Update route.ts

* Update Geistdocs

* Update hero.tsx

* Update search.tsx

* Update search.tsx

* docs: update url structure in chat tools example

* chore: replace gpt-5 reasoning with gpt-5.1

* docs: update instructions for llm to be more workflow-centric

* Revert "docs: update instructions for llm to be more workflow-centric"

This reverts commit 3852820988.

* Update pnpm-lock.yaml

* Update home-layout.tsx

* Update layout.tsx

* Update pnpm-workspace.yaml

---------

Co-authored-by: Adrian Lam <me@adriandlam.com>
2025-11-19 16:17:21 -08:00
Adrian 6a063a3e5f docs: add vite getting started (#285)
* refactor: migrate to latest nitro v3

Signed-off-by:  Pooya Parsa <pooya@pi0.io>

* update workaround

* fix(nitro): nitro builder using deprecated srcDir

* fix: add back nitro config

* fix: testing matrix dirs

* fix(hono): externalize nitro workflow output dir

* chore: format

* fix(nitro): externalize .nitro/workflow folder

* docs(hono): update getting started

* update docs and workbench

* improve plugin patch

* test: fix hono dev config

* fix: wrong api file path in hono dev config

* fix(nitro): check all dirs for builder

* chore: add comments

* refactor: migrate to latest nitro v3

Signed-off-by:  Pooya Parsa <pooya@pi0.io>

* docs: update home page frameworks

* update getting started stuff and add vite page

* docs: update vite getting started page

* Update docs/app/(home)/components/frameworks.tsx

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>

* Update docs/content/docs/getting-started/index.mdx

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>

* Apply suggestion from @adriandlam

* Update docs/app/(home)/components/frameworks.tsx

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>

* lockfile

* lockfile

* docs: update vite getting started guide

* format

* format

* format

* reset packages/nitro/src/index.ts

* docs: fix vite getting started

* docs: fix vite getting started api route

* revert

---------

Signed-off-by: Pooya Parsa <pooya@pi0.io>
Co-authored-by: Pooya Parsa <pooya@pi0.io>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
2025-11-19 15:18:50 -08:00
Vercel Release Bot 29892a0f93 Version Packages (beta) (#369) @workflow/world-local@5.0.0-beta.10 @workflow/world-postgres@4.1.0-beta.12 @workflow/world-testing@4.0.1-beta.18 workflow@4.0.1-beta.17 @workflow/nitro@4.0.1-beta.17 @workflow/next@4.0.1-beta.17 @workflow/cli@4.0.1-beta.17 @workflow/ai@4.0.1-beta.17 @workflow/web-shared@4.0.1-beta.16 @workflow/core@4.0.1-beta.15 @workflow/builders@4.0.1-beta.13 @workflow/world-vercel@4.0.1-beta.10 @workflow/nuxt@4.0.1-beta.6 @workflow/sveltekit@4.0.0-beta.11 2025-11-19 11:15:09 -08:00
Nathan Rajlich 3d99d6d38d Update @vercel/oidc and @vercel/queue to fix expired OIDC token edge case (#368) 2025-11-19 11:13:15 -08:00
Vercel Release Bot 70fb4ebc9d Version Packages (beta) (#357)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@workflow/world-testing@4.0.1-beta.17 workflow@4.0.1-beta.16 @workflow/cli@4.0.1-beta.16 @workflow/ai@4.0.1-beta.16 @workflow/web-shared@4.0.1-beta.15 @workflow/builders@4.0.1-beta.12 @workflow/nuxt@4.0.1-beta.5 @workflow/sveltekit@4.0.0-beta.10
2025-11-19 08:51:25 -08:00
Pranay Prakash 6e41c90ab5 Fix workflow failing because of function timeouts (#322)
* Fix workflow failing because of function timeouts

* Update packages/core/src/runtime.ts

Co-authored-by: Peter Wielander <mittgfu@gmail.com>

---------

Co-authored-by: Peter Wielander <mittgfu@gmail.com>
2025-11-18 17:39:59 -08:00
Nathan Rajlich 0337f16ae0 Fix 'getWritable()' docs page to not write to stream in workflow function (#364) 2025-11-18 17:22:54 -08:00
Pranay Prakash 5afc66eaaa Add e2e tests for postgres world (#356)
* Add e2e tests for postgres world

* Add e2e tests for postgres world

- Add new e2e-local-postgres job to test all workbenches against postgres world
- Configure PostgreSQL service container in GitHub Actions
- Update world-postgres build script to chmod +x the setup.js bin
- Use direct path to setup script in CI for reliability
- Tests run in production mode similar to e2e-local-prod tests
2025-11-17 18:28:00 -08:00
Pooya Parsa ee25bd9d55 refactor: upgrade to latest nitro v3 (#293)
* refactor: migrate to latest nitro v3

Signed-off-by:  Pooya Parsa <pooya@pi0.io>

* update workaround

* fix(nitro): nitro builder using deprecated srcDir

* fix: add back nitro config

* fix: testing matrix dirs

* fix(hono): externalize nitro workflow output dir

* chore: format

* fix(nitro): externalize .nitro/workflow folder

* docs(hono): update getting started

* changeset

* update docs and workbench

* improve plugin patch

* docs: preserve code style

* update `getWorkflowDirs`

* update vite workbench

* test: fix hono dev config

* fix: wrong api file path in hono dev config

* fix(nitro): check all dirs for builder

* chore: add comments

---------

Signed-off-by: Pooya Parsa <pooya@pi0.io>
Co-authored-by: Adrian Lam <me@adriandlam.com>
2025-11-17 16:53:38 -08:00
Vercel Release Bot f1b734129a Version Packages (beta) (#354) @workflow/world-local@5.0.0-beta.9 @workflow/world-testing@4.0.1-beta.16 workflow@4.0.1-beta.15 @workflow/nitro@4.0.1-beta.15 @workflow/next@4.0.1-beta.15 @workflow/cli@4.0.1-beta.15 @workflow/web-shared@4.0.1-beta.14 @workflow/core@4.0.1-beta.13 @workflow/builders@4.0.1-beta.11 @workflow/world-vercel@4.0.1-beta.9 @workflow/world@4.0.1-beta.6 @workflow/nuxt@4.0.1-beta.4 @workflow/sveltekit@4.0.0-beta.9 2025-11-17 14:19:24 -08:00
Peter Wielander 566681a92a [ai] Add stopCondition to DurableAgent and emit error parts to writeable stream (#353) 2025-11-17 13:53:35 -08:00
Peter Wielander 4b70739b50 Core: require specifying runId when writing to stream (#232) 2025-11-17 08:56:42 -08:00
Nathan Rajlich 2fde24e866 Use inline sourcemaps to prevent SWC read import error (#352)
Fixes #338.
2025-11-16 23:36:37 -08:00
vercel[bot] 510c55ba1d Update grammar in workflow docs (#334)
Improved grammar in the workflow documentation as requested.

## Files Modified:

### Core Documentation Files:
- `README.md` - Main repository README
- `docs/content/docs/foundations/index.mdx` - Foundations overview
- `docs/content/docs/foundations/workflows-and-steps.mdx` - Core concepts documentation
- `docs/content/docs/foundations/starting-workflows.mdx` - Workflow startup guide
- `docs/content/docs/foundations/control-flow-patterns.mdx` - Control flow documentation
- `docs/content/docs/foundations/errors-and-retries.mdx` - Error handling guide
- `docs/content/docs/foundations/hooks.mdx` - Hooks and webhooks documentation

### Getting Started Guides:
- `docs/content/docs/getting-started/next.mdx` - Next.js integration guide
- `docs/content/docs/getting-started/hono.mdx` - Hono integration guide

### API Reference:
- `docs/content/docs/api-reference/workflow/sleep.mdx` - Sleep function documentation

### Deployment Documentation:
- `docs/content/docs/deploying/index.mdx` - Deployment guide

## Types of Grammar Issues Fixed:

1. **Articles and Determiners**:
   - Added missing articles ("a", "an", "the") where appropriate
   - Fixed article usage consistency

2. **Verb Forms and Tenses**:
   - Corrected "has passed" → "passes" for better flow
   - Fixed "needs" → "need" for proper subject-verb agreement
   - Changed "will go a long way in helping" → "will go a long way toward helping"

3. **Comma Usage**:
   - Added missing commas in compound sentences
   - Fixed comma placement before "and" in complex sentences
   - Added commas after introductory clauses

4. **Word Choice and Clarity**:
   - Changed "really simple" → "simple" for more professional tone  
   - Fixed "setup" → "set up" (verb form vs noun form)
   - Changed "newly made" → "newly created" for better precision
   - Improved "the external system" → "external systems" for consistency
   - Fixed "propagate the error over to" → "propagate the error to"

5. **Sentence Structure**:
   - Combined fragmented sentences for better flow
   - Fixed run-on sentences by adding proper punctuation
   - Improved parallel structure in lists and descriptions

6. **Punctuation and Formatting**:
   - Changed "Learn more:" → "Learn more": for consistency
   - Fixed em-dash usage (- → —) where appropriate
   - Added backticks around code terms like `start()` for consistency

7. **Pronoun and Reference Clarity**:
   - Fixed unclear pronoun references
   - Made subject-verb agreements consistent
   - Improved clarity of "them" and "it" references

## Implementation Approach:

- Systematically reviewed key documentation files
- Applied consistent grammar rules across all files
- Maintained the existing technical tone and style
- Preserved all code examples and technical accuracy
- Focused on readability improvements without changing meaning

The grammar improvements make the documentation more professional and easier to read while maintaining all technical accuracy and existing functionality.

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
2025-11-16 11:46:16 -08:00
Vercel Release Bot c78bec37b0 Version Packages (beta) (#308)
Signed-off-by: Nathan Rajlich <n@n8.io>
@workflow/world-local@5.0.0-beta.8 @workflow/world-testing@4.0.1-beta.15 workflow@4.0.1-beta.14 @workflow/nitro@4.0.1-beta.14 @workflow/next@4.0.1-beta.14 @workflow/cli@4.0.1-beta.14 @workflow/ai@4.0.1-beta.14 @workflow/web-shared@4.0.1-beta.13 @workflow/core@4.0.1-beta.12 @workflow/web@4.0.1-beta.11 @workflow/world-vercel@4.0.1-beta.8 @workflow/swc-plugin@4.0.1-beta.6 @workflow/world@4.0.1-beta.5 @workflow/errors@4.0.1-beta.5 @workflow/utils@4.0.1-beta.3 @workflow/nuxt@4.0.1-beta.3 @workflow/sveltekit@4.0.0-beta.8
2025-11-16 00:31:36 -08:00
Nathan Rajlich 23f5c1d781 Make tools optional in DurableAgent (#350)
Made the `tools` parameter optional in the `DurableAgent` class.

### What changed?

- Updated the `DurableAgentOptions` interface to make the `tools` property optional
- Modified the constructor to initialize `this.tools` with an empty object (`{}`) when `options.tools` is not provided
2025-11-15 19:30:35 -08:00
Nathan Rajlich 0b848cd25f [swc-plugin-workflow] Fix compiler warnings (#348) 2025-11-15 19:26:48 -08:00
Nathan Rajlich 45b7b41055 Add support for defining model as a step function initializer in DurableAgent (#346)
Added support for defining `model` as a step function initializer in the AI workflow package.

### What changed?

- Modified the `DurableAgent` class to accept either a string model ID or a function that returns a `LanguageModelV2` instance
- Updated the `doStreamStep` function to handle both string model IDs and function initializers
- Added proper error handling for invalid model initialization arguments

### How to test?

Test both initialization methods:

1. Using a string model ID:
```typescript
const agent = new DurableAgent({
  model: 'anthropic/claude-opus',
  // other options
});
```

2. Using a step function initializer:
```typescript
import { xai } from "@ai-sdk/xai"

const agent = new DurableAgent({
  model: async () => {
    "use step";
    return xai("grok-4");
  },
  // other options
});
```

### Why make this change?

This enhancement provides more flexibility in how language models are initialized and used within the workflow. By supporting function initializers, users can now:

- Use custom model instances with specialized configurations
- Implement more complex model initialization logic that wasn't possible with just string identifiers
2025-11-15 19:24:59 -08:00