npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@effect-weegigs/restate-core

v0.2.0

Published

SDK-free contract layer for @effect-weegigs/restate: Api definitions, Schema-codec serdes, and the typed-error envelope

Readme

@effect-weegigs/restate-core

The SDK-free contract layer shared by @effect-weegigs/restate (the server package) and @effect-weegigs/restate-client (the ingress client): Api contract definitions, the Schema-codec Serde, and the typed-error envelope.

You rarely install this package directly — both surface packages re-export its modules. It exists so the two can agree on contracts and wire conventions without sharing a dependency on the server SDK: restate-core depends only on effect and the types in @restatedev/restate-sdk-core, which keeps restate-client's dependency closure free of the server SDK and safe to bundle in any environment (Node services, browsers, edge runtimes).

Installation

pnpm add @effect-weegigs/restate-core effect
npm install @effect-weegigs/restate-core effect

effect is a peer dependency.

Modules

  • Api — definition-first contracts for Restate services, virtual objects, and workflows. A definition is pure contract — name, kind, and per-handler input/output/error Schemas — from which the server builder, the in-handler client, and the ingress client all derive. A definition with no implementation is itself the typed client for a Restate service written in another language.

    import * as Api from "@effect-weegigs/restate-core/Api"
    import * as Schema from "effect/Schema"
    
    const UserApi = Api.service("UserService", {
      signup: Api.handler({
        input: Schema.Struct({ email: Schema.String }),
        output: Schema.Struct({ welcomed: Schema.Boolean }),
        errors: [UserExists]
      })
    })
  • Serde — an Effect Schema codec Serde for the Restate boundary that runs the full codec in BOTH directions (Schema.encodeSync on serialize, Schema.decodeUnknownSync on deserialize), so transformation schemas like Schema.DateFromString and Schema.OptionFromNullOr round-trip the wire correctly. Codec failures throw the SDK-free SerdeError (400 for payloads that don't decode, 500 for values that don't encode); RawBytes marks verbatim binary payloads for webhook-style handlers.

  • Errors — the typed-error envelope: a declared Schema.TaggedError crosses the wire and the journal as { _tag, ...fields } JSON in a status-422 terminal error message, and decodeEnvelope / decodeDeclared rehydrate the typed instance on the other side via the declared union.

The server package adapts Serde.SerdeError to the Restate SDK's TerminalError at the boundary where serdes are handed to SDK machinery, and supplies the encoding half of the error envelope — that half needs the SDK's TerminalError class identity, which is exactly what this package avoids depending on.