Commit Graph

165 Commits

Author SHA1 Message Date
Peter Wielander 817245526e [web] Add run data expiry date and status to trace viewer (#549) 2025-12-05 10:29:03 -08:00
Karthik Kalyanaraman 14daeddb2f UX updates to span viewer panel (#457) 2025-12-05 09:38:43 -08:00
Peter Wielander 57a2c328ca [world] Add expiredAt attribute to Run (#515) 2025-12-04 12:05:58 -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
Peter Wielander 99611405d4 Fix hydration of events with dates and of step functions (#380) 2025-11-21 13:58:02 -05:00
Zhuo Jinggang 96c79f2eb4 [web-shared] Cache world instantiation in server actions (#304)
Signed-off-by: zhuojg <zhuojg1519@outlook.com>
2025-11-12 10:38:47 -08:00
Pranay Prakash 00b0bb9346 Proper error stack propogating (#280)
* Proper stacktrace propogation in world

Proper stacktrace propogation in world

* Merge Reconciliation

* Standardize the error type in the world spec

* Deduplicate vercel world utils

* fix undefined type issue

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2025-11-11 15:34:04 -08:00
Peter Wielander 00efdfb063 Web: Improve trace viewer load times and loading animation (#270) 2025-11-08 10:21:57 -08:00
Peter Wielander 0b3e89e5fe Fix event hydration in observability (#267) 2025-11-07 13:26:02 -08:00
Peter Wielander 9755566f1c Increase compatibility for node16 moduleResolution when used for direct imports (#225) 2025-11-05 09:55:28 -08:00
Peter Wielander 7db9e942db Web: Fix hook events not displaying on trace viewer if there's multiple hook_received events (#196) 2025-11-03 22:26:56 -08:00
Peter Wielander a3326a257c Add workflow inspect sleep command to list active sleep/wait events (#170) 2025-10-31 15:24:49 -07:00
Peter Wielander 7f5a2da286 Web: support new wait events in trace viewer (#46) 2025-10-30 17:24:56 -07:00
Nathan Rajlich 20d51f0d7f Add optional retryAfter property to Step interface (#142) 2025-10-30 13:39:00 -07:00
Peter Wielander 55e2d0b271 Extract web UI API client and trace viewer into shared package (#125) 2025-10-29 18:58:16 -07:00