40 Commits

Author SHA1 Message Date
github-actions[bot] b090df632b Version Packages (#2863) 2026-07-22 16:22:22 +00:00
github-actions[bot] 2213c91731 Backport #2732: fix(next): respect basePath for workflow routes (#2791)
* fix(next): respect basePath for workflow routes (#2732)

* fix(next): respect basePath for workflow routes

* docs(core): note workflow URL resolution gap

* fix(next): expose workflow health route methods

* test(utils): remove workflow route helper tests

* test(builders): remove route handler string test

* fix(next): defer basePath validation to Next.js

* refactor(utils): remove workflow url helper wrappers

* Test Next basePath builder wiring

Signed-off-by: Nathan Colosimo <110621881+NathanColosimo@users.noreply.github.com>

* fix(backport): preserve framework route wrappers

Signed-off-by: Nathan Colosimo <110621881+NathanColosimo@users.noreply.github.com>

---------

Signed-off-by: Nathan Colosimo <110621881+NathanColosimo@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Colosimo <110621881+NathanColosimo@users.noreply.github.com>
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
2026-07-09 17:17:23 -07:00
github-actions[bot] 7f2050641e Version Packages (#2221)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-10 17:24:42 -07:00
github-actions[bot] b93e7c3b59 Version Packages (#1921)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-22 13:34:26 -07:00
Pranay Prakash 16f2c236d3 Fix stable CI test harness failures (#1986)
* Fix stable CI test harness failures

* Fix dev e2e cleanup races

* Restore non-Next dev cleanup

* Keep Next dev temp workflow files intact

* Keep dev test placeholders on disk

* Speed up workflow port detection

* Probe workflow health with POST

* Support HEAD workflow health checks

* Stabilize local CI health checks

* Retry flaky Vercel agent e2e

* Wrap generated framework route exports

* Relax remote addTen e2e timeout

* Materialize manual webhook responses

* Give remote CLI inspect more time

* Stabilize remote sleep and hook e2e checks

* Wait for step return streams before completion

* Stabilize hook and stream e2e waits

* Bound queue health check timeouts

* Address stable CI review feedback

* Fix route export replacement with embedded source maps
2026-05-18 17:46:24 -07:00
workflow-devkit-release-bot[bot] 2a7ead058a Version Packages (#1726)
Co-authored-by: workflow-devkit-release-bot[bot] <workflow-devkit-release-bot[bot]@users.noreply.github.com>
2026-04-16 22:41:58 +00:00
workflow-devkit-release-bot[bot] 4e435e0332 Version Packages (#1621) 2026-04-07 16:53:33 -07:00
Harpreet cdf90d5a38 Rename Workflow DevKit to Workflow SDK, remove beta badge, add tweet wall (#1541)
* Rename Workflow DevKit to Workflow SDK, remove beta badge, add tweet wall

- Rename "Workflow DevKit" to "Workflow SDK" across all files (~108 files)
- Rename standalone "WDK" references to "Workflow SDK"
- Remove beta badge from homepage hero
- Add tweet wall component to homepage with 4 builder testimonials

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Rename Workflow DevKit to Workflow SDK, remove beta badge, add tweet wall

- Rename "Workflow DevKit" to "Workflow SDK" across all files (~108 files)
- Rename standalone "WDK" references to "Workflow SDK"
- Remove beta badge from homepage hero
- Add tweet wall component to homepage with 4 builder testimonials

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Harpreet Arora <harpreet.txt@gmail.com>

* Address review: fix missed trigger phrase renames and bump skill versions

- Rename "workflow devkit" to "workflow sdk" in trigger phrases for both skill files
- Bump workflow-init SKILL.md version to 1.1
- Bump workflow SKILL.md version to 1.5
- Note: CLAUDE.md is a symlink to AGENTS.md, already renamed

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Harpreet Arora <harpreet.txt@gmail.com>

* link correct tweet

---------

Signed-off-by: Harpreet Arora <harpreet.txt@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Karthik Kalyanaraman <karthik.kalyanaraman@vercel.com>
2026-03-29 16:05:39 -07:00
Peter Wielander 01bbe66d5a [world] Add stream pagination and metadata endpoints (#1470) 2026-03-23 17:39:39 -07:00
Pranay Prakash 2ef33d2828 feat: export semantic error types and add API reference docs (#1447)
* feat: export semantic error types and add API reference documentation

Add missing error exports (HookNotFoundError, EntityConflictError,
RunExpiredError, TooEarlyError, ThrottleError, RunNotSupportedError,
WorkflowWorldError) to workflow/internal/errors. Create new error
classes for world-level semantics. Tighten TSDoc comments on all
error classes. Add API reference docs for all error types.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: use @setup declarations, workflow/errors import, and errors/ doc section

- Replace @skip-typecheck with proper `declare` + `// @setup` lines
  so code samples are typechecked but setup lines hidden from readers
- Add `workflow/errors` export to package.json (public API, replaces
  `workflow/internal/errors` in docs)
- Add `workflow/errors` path mapping in docs-typecheck type-checker
- Add HookConflictError to re-export list
- Move all error docs under api-reference/workflow/errors/ subdirectory
- Update all internal cross-references and links

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor: move error docs to top-level workflow-errors section

- Move semantic error docs to api-reference/workflow-errors/ (matching
  the workflow/errors import path, like workflow-api for workflow/api)
- Keep FatalError and RetryableError in api-reference/workflow/ since
  they're imported from workflow, not workflow/errors
- Fix all cross-reference links

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* chore: update HTTP debug logger JSDoc to clarify scope

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: make TooEarlyError.retryAfter a number (seconds) matching WorkflowWorldError

TooEarlyError.retryAfter is now seconds (number) instead of a Date,
consistent with ThrottleError and WorkflowWorldError. The conversion
from seconds to Date is done at the consumer site (step-handler) rather
than at construction time.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address review feedback on docs accuracy

- WorkflowWorldError docs: add status, code, url, retryAfter properties
  to TSDoc; clarify that .is() only matches direct instances (not
  subclasses); use instanceof in catch-all example
- TooEarlyError/ThrottleError docs: mark retryAfter as optional (?)
  to match actual type definitions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 00:01:36 +00:00
Lucas Ralph dffe5c96ea [utils] Re-export parseName utilities and add workflow/observability module (#1453) 2026-03-23 11:52:09 -07:00
Vercel Release Bot a602fcbf6b Version Packages (beta) (#1215) 2026-02-27 14:20:42 -08:00
Vercel Release Bot 9f442d2dd7 Version Packages (beta) (#987)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-11 15:46:37 -08:00
JJ Kasper 3d770d5385 Expose workflows manifest under diagnostics folder (#998)
* Expose workflows manifest under Next.js diagnostics folder

* feat(builders): emit diagnostics manifest for vercel world

* dedupe function

* update changeset

* fix(builders): write vercel diagnostics manifest under workflows

* fix(builders): rename vercel diagnostics manifest path
2026-02-10 17:25:19 -08:00
Nathan Rajlich 73bf7be925 Change compiler ID generation logic to use Node.js import specifier (#899)
## Summary

This PR changes how the SWC compiler generates IDs for workflows, steps, and classes. Instead of using raw file paths, IDs are now based on **Node.js module specifiers** when the file belongs to a package (either in `node_modules` or a workspace package).

## Motivation

Previously, IDs were generated using file paths like `step//src/jobs/order.ts//fetchData`. This caused several issues:

1. **Package exports conditions**: When a package uses conditional exports (e.g., `"workflow"` vs `"default"` conditions in `package.json`), the same import specifier can resolve to different files. Using file paths meant IDs could differ based on which export condition was used.
2. **Cross-bundle consistency**: Classes serialized in one bundle couldn't be deserialized in another if the file paths differed.
3. **Version tracking**: No way to include package versions in IDs for cache invalidation.

## Changes

### New ID Format

IDs now use the format `{type}//{modulePath}//{identifier}` where `modulePath` is either:

- A **module specifier** like `point@0.0.1` or `@myorg/shared@1.2.3` for package files
- A **relative path** prefixed with `./` like `./src/jobs/order` for local app files

Examples:

- `step//workflow@4.0.1-beta.50//fetch` (SDK step)
- `step//./workflows/order//processOrder` (local step)
- `class//point@0.0.1//Point` (package class)
- `class//./src/models/User//User` (local class)

### New Module Specifier Resolution

Added `packages/builders/src/module-specifier.ts` which:

- Detects if a file is in `node_modules` or a workspace package
- Finds the nearest `package.json` and extracts name/version
- Returns the module specifier for the SWC plugin to use

### SWC Plugin Changes

- Added `moduleSpecifier` option to plugin config
- Updated `naming.rs` to support both module specifiers and relative paths
- Added `get_module_path()` helper that uses specifier when available, falls back to `./filename` format

### Special Cases

- **Builtin functions** (`__builtin_*`): Continue to use just the function name as the ID for stable, version-independent lookup from the workflow VM runtime.

## Testing

- Updated all 125+ SWC plugin test fixtures to use new ID format
- Added tests for module specifier resolution
- Added tests for Windows path normalization in naming

## Breaking Changes

This is technically a breaking change for any persisted workflow runs that reference the old ID format. However, since IDs are internal implementation details and not user-facing, this should not affect end users.

## Files Changed

- `packages/builders/src/module-specifier.ts` - **NEW**: Module specifier resolution logic
- `packages/builders/src/apply-swc-transform.ts` - Pass module specifier to SWC plugin
- `packages/builders/src/base-builder.ts` - Use `getImportPath` for virtual entry imports
- `packages/swc-plugin-workflow/transform/src/lib.rs` - Accept and use module specifier
- `packages/swc-plugin-workflow/transform/src/naming.rs` - New ID formatting with module paths
- `packages/swc-plugin-workflow/spec.md` - Updated documentation
- `packages/core/e2e/e2e.test.ts` - Updated test assertions for new ID format
2026-02-04 14:23:02 -08:00
Vercel Release Bot 3dde14d529 Version Packages (beta) (#834) 2026-02-02 10:33:56 -08:00
Nathan Rajlich b16a6828af Move "parse-name" into the utils package (#814) 2026-01-23 10:57:52 -08:00
Nathan Rajlich dc44dab49d Biome config tweaks and fixes applied (#741) 2026-01-07 12:52:52 -08:00
Vercel Release Bot 6d7e5035a4 Version Packages (beta) (#711) 2025-12-31 10:17:49 -08:00
Nathan Rajlich 9b1640d76e Do not include initial attempt in step function maxRetries count (#703)
Closes #592.
2025-12-31 00:59:50 -08:00
Peter Wielander 80955e7212 [cli] [web] Allow opening web UI without config validation, show better UI when runs can't be found (#684) 2025-12-28 17:55:24 +01:00
Vercel Release Bot e6b1bef5bb Version Packages (beta) (#693) 2025-12-27 12:40:09 -08:00
Vercel Release Bot 96a4d3a2fd Version Packages (beta) (#676)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-12-24 09:51:14 -08:00
Peter Wielander 0cf0ac3211 [util] Extract helper function to find local world dataDir across CLI/UI (#682) 2025-12-23 20:42:42 +01:00
Vercel Release Bot fc6a32d6dc Version Packages (beta) (#607) 2025-12-16 21:05:18 +01:00
Adrian 1ef6b2fdc8 fix: use workflow health endpoint to check for port (#616)
* chore: use workflow health endpoint to check for port

* chore: update comment

* changeset

* Fix: The JSDoc comment for the `probePort` function is outdated and doesn't match the implementation. It claims the function returns true for "non-404 response" but the code now checks for exactly 200 status.

This commit fixes the issue reported at packages/utils/src/get-port.ts:251

## Outdated JSDoc comment in probePort() function doesn't match implementation

**What fails:** The JSDoc comment at line 251 of `packages/utils/src/get-port.ts` claims the `probePort()` function `@returns true if the port responds as a workflow server (non-404 response)`, but the actual implementation at line 269 explicitly checks `return response.status === 200;`

**How to reproduce:**
1. Read the JSDoc comment for `probePort()` function in `packages/utils/src/get-port.ts` (line 251)
2. Read the implementation at lines 268-269
3. Observe the mismatch: the comment says "non-404 response" but code checks for exactly status 200

**What happened vs expected behavior:**
- The code behavior was changed in commit `34cb235` (Dec 15, 2025) from checking `response.status !== 404` to checking `response.status === 200`
- The internal code comments were updated in commit `5840ab2`, but the JSDoc was left outdated
- Developers reading the JSDoc would incorrectly believe the function accepts any non-404 response (400, 405, etc.) when it actually requires exactly 200

**Fix:** Updated the JSDoc `@returns` line to accurately reflect the implementation: `@returns true if the port responds with a 200 status from the health check endpoint`

**Verification:** All 19 tests in `packages/utils/src/get-port.test.ts` pass with the updated documentation.

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

---------

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
2025-12-15 16:34:44 -08:00
Vercel Release Bot 7018f490e6 Version Packages (beta) (#589)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-12-12 18:11:25 -08:00
Adrian c9b8d843fd fix: improve port detection reliability with HTTP probing (#590)
* add logs

* fix: sveltekit type error

* feat: add polling for ports

* cleanup logs

* changeset

* fix test

* test

* test

* trigger

* trigger

* trigger

* trigger
2025-12-10 13:06:19 -08:00
Vercel Release Bot 9916f2a4a6 Version Packages (beta) (#447)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-12-02 10:12:48 -08:00
Adrian cd451e0295 chore(utils): replace execa dependency (#476)
* chore(utils): replace execa dependency

* changeset
2025-12-01 14:15:25 -08:00
Adrian bc9b6282c2 fix: @vercel/nft parsing proc file paths in sveltekit adapter (#473)
* fix: build proc paths dynamically

* test

* changeset
2025-12-01 13:00:42 -08:00
Alex Holovach 34f3f86f31 fix(utils): detect linux ports via /proc (#471)
* fix(utils): detect linux ports via /proc

Signed-off-by: Alex Holovach <alex.holovach@kubiks.ai>

* extract parsePort helper

Signed-off-by: Alex Holovach <alex.holovach@kubiks.ai>

* add changeset

Signed-off-by: Alex Holovach <alex.holovach@kubiks.ai>

---------

Signed-off-by: Alex Holovach <alex.holovach@kubiks.ai>
2025-11-30 14:07:31 -08:00
Vercel Release Bot e5c0380bbd Version Packages (beta) (#396) 2025-11-24 14:25:39 -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
Vercel Release Bot c78bec37b0 Version Packages (beta) (#308)
Signed-off-by: Nathan Rajlich <n@n8.io>
2025-11-16 00:31:36 -08:00
JJ Kasper b97b6bfaba Lock all dependencies in our packages (#318)
* Lock all dependencies in our packages

* fix type

* add savePrefix config

* add changeset
2025-11-12 14:26:01 -08:00
Vercel Release Bot 7bad9d454f Version Packages (beta) (#230) 2025-11-07 16:39:45 -08:00
Adrian adf0cfeb91 feat: add getPort for detecting pid port (#233)
* feat: add getPort method for detecting pid port

* lockfile

* update tests and fix getPort usage

* changeset

* docs: update sveltekit getting started

* fix: use pid-port

* fix: not using config port env

* fix: remove unused getPort from world core

* remove unused stuff

* fix: world local config returning port 3000 as fallback

* changeset

* fix: rebase conflicts

* fix: util test missing http import

* changeset

* fix: wrong import for getPort in core runtime

* fix: getPort in @workflow/utils being imported into workflow runtime

* test: simplify sveltekit test

* fix missing import in test

* fix: async await stuff with getPort

* refactor: move getPort to @workflow/utils/get-port

* test: simplfiy getPort tests

* test: fix sveltekit ports
2025-11-07 14:36:36 -08:00
Nathan Rajlich a838085b6e Add ts-expect-error in test case with invalid argument
Signed-off-by: Nathan Rajlich <n@n8.io>
2025-11-06 23:06:44 -08:00
Nathan Rajlich bf170adee1 Add initial @workflow/utils package (#239)
Add a new `@workflow/utils` package to extract common utility functions.

- Created a new `@workflow/utils` package with common utility functions:
  - `parseDurationToDate()` - Parses duration strings, numbers, or Date objects
  - `withResolvers()` - Polyfill for `Promise.withResolvers()`
  - `once()` - Creates a lazily-evaluated, memoized function
  - `PromiseWithResolvers` - Type interface for promise resolvers
- Moved these utility functions from the core package to the new utils package
- Updated imports in the core package to use the new utils package
- Added tests for the utility functions in the new package

Signed-off-by: Nathan Rajlich <n@n8.io>
2025-11-06 13:37:58 -08:00