Commit Graph

485 Commits

Author SHA1 Message Date
Vercel Release Bot cd7c03d45d Version Packages (beta) (#819)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
workflow@4.0.1-beta.50
2026-01-22 14:12:34 -08:00
Peter Wielander 549ffbee3c [web-shared] Tone down colors on event list (#828)
* [web-shared] Tone down colors on event list

Signed-off-by: Peter Wielander <mittgfu@gmail.com>

* Update .changeset/mean-experts-hammer.md

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>

---------

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
2026-01-22 10:52:37 -08:00
Nathan Rajlich 7023d5e10e Fix getWorld() import naming (#826)
Closes #803.
2026-01-21 23:22:17 -08:00
Nathan Rajlich 5ba82ec4b1 Add workflow health CLI command and web functionality (#816) 2026-01-21 12:48:03 -08:00
Lucas Neves 1533dbbf44 postgres-world: Delete redundant and bugged migration (#804)
* Delete redundant and bugged migration

* DCO Remediation Commit for Lucas Neves <lcneves@gmail.com>

I, Lucas Neves <lcneves@gmail.com>, hereby add my Signed-off-by to this commit: 64705dfe86

Signed-off-by: Lucas Neves <lcneves@gmail.com>

---------

Signed-off-by: Lucas Neves <lcneves@gmail.com>
2026-01-21 11:52:33 -08:00
Nathan Rajlich f3785f04fb Throw an error if no deployment ID was specified (#820) 2026-01-21 09:57:29 -08:00
Nathan Rajlich b05dbd7525 Clamp setTimeout value to 32-bit integer (~25d) for sleep() (#824) 2026-01-21 09:43:06 -08:00
Nathan Rajlich 202c524723 Add retry for filesystem operation errors on Windows (#818) 2026-01-21 01:08:56 -08:00
Vercel Release Bot 3856ce8c20 Version Packages (beta) (#807)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
workflow@4.0.1-beta.49
2026-01-20 18:37:54 -08:00
Nathan Rajlich 8621917f6e Enqueue @workflow/serde for publish 2026-01-20 18:31:47 -08:00
Nathan Rajlich 4c01dd3d02 Update SWC plugin spec.md with latest state of compiler (#815) 2026-01-20 12:24:11 -08:00
Peter Wielander 714b233005 [world-local] Update log message when PORT not set, and make less prominent (#811) 2026-01-20 11:05:20 +01:00
Nathan Rajlich f93e894a6a Show opaque marker when deserializing custom classes and instances in o11y (#809)
* Show opaque marker when deserializing custom classes and instances in o11y

* Add unit tests

* Parse filename from class ID

* color hash

* Try out different colors

* Use color-hash module and HSL transformations

* CLI style tweaks

* Update .changeset/forty-tables-lick.md

Co-authored-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Nathan Rajlich <n@n8.io>

---------

Signed-off-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
2026-01-20 01:50:11 -08:00
Karthik Kalyan ee7b1fd244 Fix layout shift flicker in runs table by using refresh hook instead of reload (#808)
* Made a minor fix to use the hook to refresh the runs instead of reloading the entire page. This prevents the layout shift flicker that was happening previously.

Signed-off-by: Karthik Kalyanaraman <karthik.kalyanaraman@vercel.com>

* Update .changeset/pretty-teeth-brush.md

Co-authored-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Karthik Kalyan <105607645+karthikscale3@users.noreply.github.com>

* Hooks table - fix to use the hook to refresh the runs instead of reloading the entire page. This prevents the layout shift flicker that was happening previously.

---------

Signed-off-by: Karthik Kalyanaraman <karthik.kalyanaraman@vercel.com>
Signed-off-by: Karthik Kalyan <105607645+karthikscale3@users.noreply.github.com>
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
2026-01-19 17:57:30 -08:00
Nathan Rajlich 1843704b83 Add support for custom class instance serialization (#762)
Added support for custom class instance serialization across workflow/step boundaries.

### What changed?

- Introduced a new `@workflow/serde` package with `WORKFLOW_SERIALIZE` and `WORKFLOW_DESERIALIZE` symbols
- Enhanced the serialization system to handle custom class instances using these symbols
- Updated the SWC plugin to detect classes with serialization methods and register them
- Added class registry mechanism that works in both step and workflow contexts
- Implemented comprehensive tests for various serialization scenarios

### How to test?

The PR includes a new e2e test `customSerializationWorkflow` that demonstrates the feature:

```typescript
import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE } from '@workflow/serde';

// Define a class with custom serialization
class Point {
  constructor(public x: number, public y: number) {}

  static [WORKFLOW_SERIALIZE](instance: Point) {
    return { x: instance.x, y: instance.y };
  }

  static [WORKFLOW_DESERIALIZE](data: { x: number; y: number }) {
    return new Point(data.x, data.y);
  }
}

// Use in workflow and steps
export async function customSerializationWorkflow(x: number, y: number) {
  'use workflow';
  const point = new Point(x, y);
  const scaled = await transformPoint(point, 2);
  // ...
}
```

Run the e2e test to verify that class instances are properly serialized and deserialized.

### Why make this change?

Previously, user-defined class instances couldn't be passed between workflows and steps without losing their prototype chain and methods. This change allows developers to define custom serialization/deserialization logic for their classes, enabling proper reconstruction of instances with their full functionality intact when crossing workflow/step boundaries.
2026-01-19 15:38:19 -08:00
Peter Wielander d30e5c0249 [web] Add view to display a list of all events (#806) 2026-01-19 09:52:18 +01:00
Peter Wielander 4247c727b0 [web-shared] Improve spacing, styling, and scroll behavior of trace viewer sidebar (#805) 2026-01-19 09:30:27 +01:00
Vercel Release Bot ee0423887d Version Packages (beta) (#796) 2026-01-18 11:01:53 +01:00
Peter Wielander f491237e1e [ai] Fix collectUiMessages option by accumulating chunks in a separate step call (#784) 2026-01-16 23:58:31 +01:00
Peter Wielander 722c17243c Dedupe release Slack lines by PR number (#793) 2026-01-16 21:59:34 +01:00
Vercel Release Bot 96d17286b1 Version Packages (beta) (#791) workflow@4.0.1-beta.48 2026-01-16 11:06:05 +01:00
JJ Kasper 344c90ff9f Add Next.js pages router entries handling (#792)
* Add Next.js pages router entries handling

* update trigger-pages

* Apply suggestions from code review

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Signed-off-by: JJ Kasper <jj@jjsweb.site>

---------

Signed-off-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
2026-01-15 19:02:47 -08:00
Nathan Rajlich 49a1c5f2fc Avoid attempting to serialize the "tool" during tool call execution (#790) 2026-01-15 13:43:30 -08:00
Peter Wielander b729d49610 [web] [core] Ensure re-running Run from o11y UI will use specified world (#788) 2026-01-15 20:52:35 +01:00
Vercel Release Bot ac7aa33cd2 Version Packages (beta) (#782) workflow@4.0.1-beta.47 2026-01-15 18:17:40 +01:00
Peter Wielander 7ff6a05cf9 [web] Allow passing user env variables to vercel backend in o11y UI (#787) 2026-01-15 18:06:47 +01:00
Peter Wielander 125d0a666e [web-shared] Safe-access requestId in UI worker (#783) 2026-01-15 10:23:34 +01:00
Peter Wielander abdca8fd52 [web] Observability config overhaul (#774) 2026-01-14 23:22:30 +01:00
Peter Wielander aced2968ba [ci] Post weekly github issue digest to slack (#780) 2026-01-14 22:42:47 +01:00
Nathan Rajlich 315d10fc79 Fix nitro changelog to use the correct "@workflow/nitro" name (#781) 2026-01-14 12:57:41 -08:00
Peter Wielander c4f8033d8e [ci] Post release notes to slack (#779) 2026-01-14 20:29:22 +01:00
Vercel Release Bot 4bd877b474 Version Packages (beta) (#778) workflow@4.0.1-beta.46 2026-01-14 13:25:24 +01:00
Peter Wielander 49bb48a256 [ai] Add collectUIMessages option to accumulate and return UIMessage[] from agent.stream (#768) 2026-01-14 13:17:12 +01:00
Nathan Rajlich 7906429541 Add support for serializing this when invoking step functions (#754)
Added support for serializing `this` context when invoking step functions.

### What changed?

- Modified the step function implementation to capture and serialize the `this` context when it's defined and not the global object
- Updated the step invocation queue item interface to include an optional `thisVal` property
- Enhanced the step handler to apply the hydrated `thisVal` when executing step functions

### Why make this change?

This enhancement allows step functions to be invoked with an explicit context object using standard JavaScript methods like `.call()` and `.apply()`. This is particularly useful for step functions that need to access properties from a specific context, enabling more flexible and idiomatic JavaScript patterns within workflows.
2026-01-14 00:07:29 -08:00
Nathan Rajlich a2fc53a0dc Support class static methods with "use step" / "use workflow" (#753)
The SWC compiler plugin had logic to walk through class static methods
with "use step" / "use workflow", but no actual transformation was being
applied. This fixes that.
2026-01-13 23:52:26 -08:00
Vercel Release Bot 101585cce0 Version Packages (beta) (#758)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
workflow@4.0.1-beta.45
2026-01-13 14:10:19 -08:00
Joe Haddad 49f650c3a7 Step queue write idempotency (#776)
* fix(core): always write step to queue even if step already exists

This fixes a race condition where:
1. Step is written to workflow database
2. Process crashes/times out before queue write completes
3. Upstream retry occurs
4. Step already exists (409), so queue write was skipped
5. Step sits pending forever with 0 attempts

The queue write already uses an idempotency key (correlation ID),
so duplicate writes are safely deduplicated by the queue service.

* chore: add changeset for step queue idempotency fix

* chore(core): remove dead ops array code from processStep

The ops array was leftover from a previous refactor that used to collect
promises for parallel execution. Nothing was ever pushed to it, making
the waitUntil(Promise.all(ops)) a no-op.

* DCO Remediation Commit for Cursor Agent <cursoragent@cursor.com>

I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 6e510f7ad6
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 5394d49c3e
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 23424ff6f9

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

---------

Signed-off-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-01-13 14:00:26 -08:00
Nathan Rajlich 3dd5b2708d Make resumeHook() accept a Hook object or string (#773) 2026-01-13 13:29:11 -08:00
Rishabh 97c78755da fix: add TypeScript decorator support to SWC transform (#757)
* fix: add TypeScript decorator support to SWC transform

  Enable decorator parsing in SWC configuration to support codebases using
  TypeScript decorators (TypeORM, NestJS, class-validator, custom decorators).

  Without this fix, projects importing files with decorators fail with:
  "Unexpected token `@`. Expected identifier..." syntax errors.

  Changes:
  - Add `decorators: true` to parser options for TypeScript and ECMAScript
  - Add `legacyDecorator: true` for TypeScript's experimentalDecorators
  - Add `decoratorMetadata: true` for emitDecoratorMetadata support

* fix: conditionally enable decorators based on tsconfig compilerOptions

  Read experimentalDecorators and emitDecoratorMetadata from tsconfig.json
  to match Next.js behavior. Decorators are now only enabled when explicitly
  configured in the project's tsconfig.

  - Add getDecoratorOptionsForDirectory() to read tsconfig settings
  - Update applySwcTransform and Next.js loader to use tsconfig options
  - Handle JSONC format (comments, trailing commas) in tsconfig parsing

* fix: use json5 for parsing tsconfig in decorator options

  Replace manual regex-based JSONC parsing with json5 library for more
  robust handling of comments and trailing commas in tsconfig.json files.

* bump

* apply fix

* DCO Remediation Commit for JJ Kasper <jj@jjsweb.site>

I, JJ Kasper <jj@jjsweb.site>, hereby add my Signed-off-by to this commit: aa1dc36db7
I, JJ Kasper <jj@jjsweb.site>, hereby add my Signed-off-by to this commit: e25f1748c6

Signed-off-by: JJ Kasper <jj@jjsweb.site>

* DCO Remediation Commit for Rishabh <rishabh.pugalia@gmail.com>

I, Rishabh <rishabh.pugalia@gmail.com>, hereby add my Signed-off-by to this commit: e2f93048aa
I, Rishabh <rishabh.pugalia@gmail.com>, hereby add my Signed-off-by to this commit: 3faee5d3c2
I, Rishabh <rishabh.pugalia@gmail.com>, hereby add my Signed-off-by to this commit: 9dbbda6362

Signed-off-by: Rishabh <rishabh.pugalia@gmail.com>

---------

Signed-off-by: JJ Kasper <jj@jjsweb.site>
Signed-off-by: Rishabh <rishabh.pugalia@gmail.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2026-01-13 00:09:47 -08:00
Nathan Rajlich 0aa835fe30 Add typedoc comments to Hook interface (#772) 2026-01-12 17:32:51 -08:00
Nathan Rajlich b0773aa67c Don't push to main, bots 2026-01-12 17:15:39 -08:00
Nathan Rajlich 706ab8ff98 Add docs for getHookByToken() (#771) 2026-01-12 16:49:18 -08:00
Nathan Rajlich 39e5774de2 Fix stream serialization to resolve when user releases lock instead of waiting for stream to close (#678) 2026-01-12 15:07:08 -08:00
Nathan Rajlich 61fdb41e1b Add queue-based health check (#743)
* feat: add queue-based health check to bypass Deployment Protection

- Add HealthCheckPayloadSchema and HEALTH_CHECK_STREAM_PREFIX to @workflow/world
- Add healthCheck() method to Queue interface
- Update workflow and step handlers to detect and respond to health check messages
- Implement healthCheck() in world-local, world-vercel, and world-postgres

The queue-based health check sends a message through the queue pipeline,
which bypasses Vercel's Deployment Protection. The handler writes a response
to a stream that the caller reads to confirm health.

This complements the existing HTTP-based ?__health approach which still works
for local development and when bypass headers are available.

* refactor: move healthCheck to core package as utility function

Instead of adding healthCheck to the World interface (which duplicated
the same implementation across all worlds), this is now a utility function
in @workflow/core that takes the World as a parameter.

Usage:
  import { healthCheck } from '@workflow/core';
  const result = await healthCheck(world, 'workflow');

This is cleaner because:
- Single implementation instead of 3 identical ones
- World implementations remain simple
- No changes needed to the World interface

* .

* refactor: move health check types from world to core

Health check types (HealthCheckPayloadSchema, HealthCheckResult, etc.)
are now defined in @workflow/core since that's where they're used.

The HealthCheckPayloadSchema is still part of QueuePayloadSchema in
world (so the queue accepts health check messages), but it's not
exported from the public API.

* .

* Refactor health check implementation based on code review feedback (#746)

* Initial plan

* Address PR review comments: export types, fix race condition, improve error handling

Co-authored-by: TooTallNate <71256+TooTallNate@users.noreply.github.com>

* Add queue-based health check test and document security considerations

Co-authored-by: TooTallNate <71256+TooTallNate@users.noreply.github.com>

* Replace 'any' type with proper type guards for health check response

Co-authored-by: TooTallNate <71256+TooTallNate@users.noreply.github.com>

* Extract health check queue names as constants and improve type guards

Co-authored-by: TooTallNate <71256+TooTallNate@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: TooTallNate <71256+TooTallNate@users.noreply.github.com>

* .

* Fix e2e test

* .

* .

* .

* fix(ai): preserve providerMetadata as providerOptions in multi-turn tool calls (#733)

When tool calls are added to the conversation history, map providerMetadata
to providerOptions following the AI SDK convention. This fixes Gemini thinking
models that require thoughtSignature to be preserved across multi-turn tool calls,
preventing the error 'function call is missing a thought_signature'.

Fixes #727

* Local ui cli flag (#744)

* [web] Increase contrast on attribute items in sidebar (#736)

Signed-off-by: Peter Wielander <mittgfu@gmail.com>

* [world] Remove pause and resume events, actions and states (#751)

* Version Packages (beta) (#735)

* .

* .

* Update turbo inputs to include shared config (#752)

* Update turbo inputs to include shared config

* Apply suggestions from code review

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

---------

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

* feat(web): add self-hosted mode for world configuration (#747)

* feat(web): add self-hosted mode for world configuration

When WORKFLOW_TARGET_WORLD env var is set, the web UI operates in
self-hosted mode where the world configuration is locked to server-side
environment variables and cannot be changed via query params or UI.

- Add getHardcodedConfig server action to detect self-hosted mode
- Modify getWorldFromEnv to use server env vars in hardcoded mode
- Create WorldConfigContext to provide config state app-wide
- Update settings sidebar to show locked state with disabled inputs
- Update connection status to show PostgreSQL backend info
- Mask sensitive values (postgres URL) in hardcoded mode UI

* fix: address PR review feedback

- Remove unused ConfigMode type export
- Fix postgres substring to undefined (tooltip has details)
- Extract buildEnvMapFromProcessEnv helper to reduce duplication
- Remove unused EnvMap import from layout-client
- Import HardcodedConfig from web-shared/server instead of re-defining

* Fix: PostgreSQL URL parameter missing from configParsers, causing loss of postgres URL configuration on page reload in dynamic mode

* fix(cli): clear WORKFLOW_TARGET_WORLD when spawning web server

The CLI sets WORKFLOW_TARGET_WORLD as an env var, which the spawned
Next.js server inherits. This caused the web UI to enter self-hosted
mode even when launched via CLI.

Now we explicitly clear WORKFLOW_TARGET_WORLD from the server's
environment so it starts in dynamic mode where config comes from
query params as intended.

* refactor(web): use server-side env vars for world config

BREAKING CHANGE: The web UI no longer supports configuring the world
backend via URL query parameters. Configuration is now read exclusively
from server-side environment variables.

Changes:
- Remove query param parsing from @workflow/web config.ts
- Add ServerConfig interface with non-sensitive display info
- Update all components to use useServerConfig() hook
- Settings sidebar is now read-only
- CLI passes env vars to spawned web server instead of query params
- Server actions use process.env directly (envMap param reserved for future use)

This simplifies the architecture and improves security by never sending
sensitive data (connection strings, auth tokens) to the client.

* fix(web): fix settings sidebar overflow and shorten data dir path

- Add truncate/overflow handling to settings sidebar config values
- Add shortenPath() helper to abbreviate long file paths:
  - Replaces home directory with ~
  - Shows .../last-two-segments if still too long
- Add title attributes for full path on hover

* Update changeest

---------

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

* Version Packages (beta) (#755)

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

* Update packages/world/src/queue.ts

Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>

* [web] Tidy wake-up and re-enqueue buttons (#737)


---------

Signed-off-by: Peter Wielander <mittgfu@gmail.com>

* [cli] Use dotenv to resolve .env and .env.local files on startup (#765)

* Use temporary workflow-server deployment URL

* feat: add queue-based health check to bypass Deployment Protection

- Add HealthCheckPayloadSchema and HEALTH_CHECK_STREAM_PREFIX to @workflow/world
- Add healthCheck() method to Queue interface
- Update workflow and step handlers to detect and respond to health check messages
- Implement healthCheck() in world-local, world-vercel, and world-postgres

The queue-based health check sends a message through the queue pipeline,
which bypasses Vercel's Deployment Protection. The handler writes a response
to a stream that the caller reads to confirm health.

This complements the existing HTTP-based ?__health approach which still works
for local development and when bypass headers are available.

* refactor: move healthCheck to core package as utility function

Instead of adding healthCheck to the World interface (which duplicated
the same implementation across all worlds), this is now a utility function
in @workflow/core that takes the World as a parameter.

Usage:
  import { healthCheck } from '@workflow/core';
  const result = await healthCheck(world, 'workflow');

This is cleaner because:
- Single implementation instead of 3 identical ones
- World implementations remain simple
- No changes needed to the World interface

* .

* refactor: move health check types from world to core

Health check types (HealthCheckPayloadSchema, HealthCheckResult, etc.)
are now defined in @workflow/core since that's where they're used.

The HealthCheckPayloadSchema is still part of QueuePayloadSchema in
world (so the queue accepts health check messages), but it's not
exported from the public API.

* .

* Refactor health check implementation based on code review feedback (#746)

* Initial plan

* Address PR review comments: export types, fix race condition, improve error handling

Co-authored-by: TooTallNate <71256+TooTallNate@users.noreply.github.com>

* Add queue-based health check test and document security considerations

Co-authored-by: TooTallNate <71256+TooTallNate@users.noreply.github.com>

* Replace 'any' type with proper type guards for health check response

Co-authored-by: TooTallNate <71256+TooTallNate@users.noreply.github.com>

* Extract health check queue names as constants and improve type guards

Co-authored-by: TooTallNate <71256+TooTallNate@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: TooTallNate <71256+TooTallNate@users.noreply.github.com>

* .

* Fix e2e test

* .

* .

* .

* .

* .

* Update packages/world/src/queue.ts

Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>

* Use temporary workflow-server deployment URL

* .

* .

---------

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: TooTallNate <71256+TooTallNate@users.noreply.github.com>
Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
Co-authored-by: Vercel Release Bot <88769842+vercel-release-bot@users.noreply.github.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-12 14:57:10 -08:00
Peter Wielander 44dfafe3fc [cli] Use dotenv to resolve .env and .env.local files on startup (#765) 2026-01-11 18:06:31 +01:00
Peter Wielander adb93121fc [web] Tidy wake-up and re-enqueue buttons (#737)
---------

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
2026-01-09 15:21:11 +01:00
Vercel Release Bot 69da6a2d72 Version Packages (beta) (#755)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
workflow@4.0.1-beta.44
2026-01-08 18:50:19 -08:00
Pranay Prakash 3fb57e14c8 feat(web): add self-hosted mode for world configuration (#747)
* feat(web): add self-hosted mode for world configuration

When WORKFLOW_TARGET_WORLD env var is set, the web UI operates in
self-hosted mode where the world configuration is locked to server-side
environment variables and cannot be changed via query params or UI.

- Add getHardcodedConfig server action to detect self-hosted mode
- Modify getWorldFromEnv to use server env vars in hardcoded mode
- Create WorldConfigContext to provide config state app-wide
- Update settings sidebar to show locked state with disabled inputs
- Update connection status to show PostgreSQL backend info
- Mask sensitive values (postgres URL) in hardcoded mode UI

* fix: address PR review feedback

- Remove unused ConfigMode type export
- Fix postgres substring to undefined (tooltip has details)
- Extract buildEnvMapFromProcessEnv helper to reduce duplication
- Remove unused EnvMap import from layout-client
- Import HardcodedConfig from web-shared/server instead of re-defining

* Fix: PostgreSQL URL parameter missing from configParsers, causing loss of postgres URL configuration on page reload in dynamic mode

* fix(cli): clear WORKFLOW_TARGET_WORLD when spawning web server

The CLI sets WORKFLOW_TARGET_WORLD as an env var, which the spawned
Next.js server inherits. This caused the web UI to enter self-hosted
mode even when launched via CLI.

Now we explicitly clear WORKFLOW_TARGET_WORLD from the server's
environment so it starts in dynamic mode where config comes from
query params as intended.

* refactor(web): use server-side env vars for world config

BREAKING CHANGE: The web UI no longer supports configuring the world
backend via URL query parameters. Configuration is now read exclusively
from server-side environment variables.

Changes:
- Remove query param parsing from @workflow/web config.ts
- Add ServerConfig interface with non-sensitive display info
- Update all components to use useServerConfig() hook
- Settings sidebar is now read-only
- CLI passes env vars to spawned web server instead of query params
- Server actions use process.env directly (envMap param reserved for future use)

This simplifies the architecture and improves security by never sending
sensitive data (connection strings, auth tokens) to the client.

* fix(web): fix settings sidebar overflow and shorten data dir path

- Add truncate/overflow handling to settings sidebar config values
- Add shortenPath() helper to abbreviate long file paths:
  - Replaces home directory with ~
  - Shows .../last-two-segments if still too long
- Add title attributes for full path on hover

* Update changeest

---------

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
2026-01-08 18:38:56 -08:00
JJ Kasper 8b1f9d06d2 Update turbo inputs to include shared config (#752)
* Update turbo inputs to include shared config

* Apply suggestions from code review

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

---------

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
2026-01-08 14:39:50 -08:00
Vercel Release Bot 073e26a372 Version Packages (beta) (#735) workflow@4.0.1-beta.43 2026-01-08 19:32:27 +01:00