Files
Pranay Prakash 2bc368c424 fix(compression): address PR review on codec read paths, cross-deployment safety, and web zstd decode
- decompress() now gates only on DecompressionStream (read path), not
  CompressionStream — reads work in decompress-only runtimes (Copilot).
- Cross-deployment writes (start({deploymentId}), resumeHook) restrict to
  the portable gzip codec via a new compressionPortableOnly flag. zstd
  decode needs node:zlib >= 22.15, a property of the reader's runtime that
  the SDK (engines: Node 18+) can't guarantee for a different deployment;
  same-deployment writes still use zstd since reader == writer (vercel bot).
- Browser zstd WASM is now vendored into web-shared dist and referenced via
  a relative new URL('./zstd.wasm', import.meta.url) — a bare package
  specifier was left unrewritten by Vite and 404'd. Verified the Vite build
  emits the asset (karthikscale3).
- hydrateResourceIOWithKey accepts an optional key and always registers the
  zstd decoder, so unencrypted compressed payloads (e.g. local world) are
  inflated; web no-key hydration paths now route through it (karthikscale3).
- Clarify the sync-decompress doc contract (best-effort via
  process.getBuiltinModule, not "always on Node") (Copilot).

Tests: cross-deployment gzip fallback, unencrypted compressed web
hydration, and zstd WASM ↔ node:zlib compatibility.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-16 16:36:38 -07:00
..
2026-06-15 13:46:00 -07:00

@workflow/web-shared

Workflow Observability UI primitives. See Workflow SDK for more information.

Usage

This package contains:

  • pre-styled, prop-driven UI components (no data fetching)

If you want a full observability experience with server actions already wired, take a look at @workflow/web instead.

It comes with pre-styled UI components that accept data + callbacks:

import { WorkflowTraceViewer } from '@workflow/web-shared';

export default function MyRunDetailView({
  run,
  steps,
  hooks,
  events,
  onSpanSelect,
}) {
  return (
    <WorkflowTraceViewer
      run={run}
      steps={steps}
      hooks={hooks}
      events={events}
      onSpanSelect={onSpanSelect}
    />
  );
}

Server actions and data fetching are intentionally not part of web-shared. Implement those in your app and pass data + callbacks into these components. If you need world run helpers, use @workflow/core/runtime.

Security notice: If you implement server-side data fetching using @workflow/world-vercel or similar backends, ensure that user-supplied IDs (runId, stepId, etc.) are validated before passing them to world functions. The server actions in @workflow/web do not include authentication — see that package's README for details on securing self-hosted deployments.

Styling

In order for tailwind classes to be picked up correctly, you might need to configure your NextJS app to use the correct CSS processor. E.g. if you're using PostCSS with TailwindCSS, you can do the following:

// postcss.config.mjs in your NextJS app
const config = {
  plugins: ['@tailwindcss/postcss'],
};

export default config;