* test: make dev e2e sequential
* test: increase timeout between tests in dev test
* add logs
* feat: add queue for builds
* refactor: cleanup vite hmr
* chore: cleanup comments
* fix: regex base builder
* test: reduce sleep time between test suites in dev test
* refactor: naming conventions and remove builder value check
* refactor: sveltekit builder queue
* changeset
* fix: regex on base builder workflow code
* test: increase sleep
* format
* fix: make writeFile atomic on workflow entrypoint
* refactor: move build queue to @workflow/builders
* revert: regex stuff with workflow code
* add console log for workflow file changed
* Add stream benchmarks and cnealup for benchmark code
* 10m delay for local world race
* potential fix for first bute"
* Improve sticky comment stuff
* local world: ignore controller close errors
* show missing data in benchmark comment
* nitrpicks
* Improve leaderboard
* Add benchmark comparisons against main
* changeset
* Port Peter's Workspace UI
* Add symlinks for webpack workbench to share UI with turbopack
- Add symlinks for components, hooks, lib directories
- Add symlinks for app/workflows and app/api/workflows
- Install UI dependencies in webpack workbench package.json
- Both webpack and turbopack workbenches now share the same UI code
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Use allWorkflows from @/_workflows instead of custom examples.ts
- Update workflow definitions to include workflowFile field
- Change start route to use allWorkflows like trigger route
- Remove unused examples.ts file
- This allows accessing workflows from any workflow file, not just 99_e2e
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Dynamically generate workflow definitions from allWorkflows
- Remove manual workflow definitions, now auto-generated from _workflows.ts
- Add workflowFile path display in UI (tooltip and fallback description)
- Sort workflows by file name first, then by workflow name
- Fix duplicate key issue by using workflowFile:name as key
- Make description optional since it's inferred from file path
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Add default arguments map for workflows that require parameters
- Create DEFAULT_ARGS_MAP to provide sensible defaults for workflows with parameters
- Includes defaults for: addTenWorkflow, hookWorkflow, webhookWorkflow, hookCleanupTestWorkflow, closureVariableWorkflow
- Workflows without entries in the map get empty args array
This allows all workflows to be started from the UI without needing manual argument input for now.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix terminal log colors for better visibility on black background
- Change info logs from text-primary (black in light mode) to text-cyan-400
- Change error logs from text-destructive to text-red-400
- Update stream logs to text-blue-400
- Update result logs to text-green-400
- Change prefix color from text-gray-500 to text-gray-400
All colors now work properly with the terminal's black background regardless of light/dark mode.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Remove toTitleCase transformation, use raw workflow names
- Display workflow names exactly as they are in code (e.g., "addTenWorkflow")
- Remove the toTitleCase helper function
- Simpler and more direct mapping from code to UI
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Use monospace font for workflow names
- Apply font-mono to workflow displayName in both card and tooltip
- Makes workflow names more readable and consistent with code style
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Filter out step functions using workflowId property
- Check for 'workflowId' property added by compiler to identify workflow functions
- More reliable than checking function name endings
- Only functions with "use workflow" directive have workflowId property
- Prevents step functions from appearing in the UI
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Add symlinks for remaining workflow files and dependencies
- Add symlinks for 2_control_flow.ts, 4_ai.ts, 5_hooks.ts to both workbenches
- Install openai and mixpart dependencies needed by these workflows
- Update DEFAULT_ARGS_MAP with arguments for new workflows:
- ai: sample weather prompt
- agent: sample weather prompt for Muscat
- handleUserSignup: example email address
- All 9 workflow files now available in both workbenches
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Group workflows by file with section headers in UI
- Group workflows by workflowFile and render each group separately
- Add section headers showing the file path for each group
- Use monospace font for file path headers
- Increase spacing between sections (space-y-4)
- Improves visual organization when browsing workflows
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Show default arguments instead of file path in workflow cards
- Display default arguments in the card description line (if present)
- Remove redundant file path since it's now shown in section headers
- Use monospace font for argument display
- Workflows without arguments show no description line
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Display default arguments with multi-line formatting
- Use JSON.stringify with indentation (null, 2) for better readability
- Change from <p> to <pre> with whitespace-pre-wrap
- Arguments now display across multiple lines when needed
- Easier to read complex arguments like webhook tokens
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Add workflow runtime duration display with millisecond precision
- Add formatDuration helper to calculate and format runtime
- Show duration in ms, seconds, or minutes based on length
- Formats: "123ms", "5.234s", "2m 15.678s"
- Display duration in monospace font below end time
- Only shown when invocation has completed (endTime exists)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Update default arguments to match e2e test values
- Use arguments from packages/core/e2e/e2e.test.ts for accuracy
- addTenWorkflow: 123 (instead of 5) to match test expectations
- closureVariableWorkflow: 7 (instead of 42) to match test expectations
- Use Math.random().toString(36) for hook/webhook tokens (matches test pattern)
- Add comment referencing e2e test source
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* 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
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.
### 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.
* 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)