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

@0xhoneyjar/freeside-storage-client

v0.1.0

Published

Type-safe URL builders + codex consumers for the freeside-storage URL contract. EffectTS Schema validates inputs/outputs; URL_CONTRACT_V1 is the source of truth.

Downloads

147

Readme

@freeside-storage/client

Type-safe URL builders + codex consumers for the freeside-storage URL contract. EffectTS Schema validates inputs; typed errors make failure modes first-class; codex-authority cascade for per-token overrides (read-only).

What it gives you

import {
  miberaImageURL,           // sync, hash → URL
  miberaImageURLByToken,    // Effect, tokenId → URL (codex)
  miberaMetadataURL,        // sync, tokenId → manifest URL
  mstImageURL,              // Effect, tokenId → MST image (handles timestamp-suffix)
  mstMetadataURL,           // sync, tokenId → honeyroad endpoint
  grailImageURL,            // Effect, tokenId → grail image (codex authority)
} from "@freeside-storage/client";

Sync builders are pure functions. Async builders return Effect.Effect<string, AssetError> and integrate codex authority + remote fetch.

Why EffectTS

Three things bare TypeScript doesn't give you:

1. Schema-validated inputs

import { TokenId, Sha40 } from "@freeside-storage/client";
import { Schema } from "effect";

const decoded = Schema.decodeEither(TokenId)(rawNumber);
// → Either<ParseError, ValidatedTokenId>

Bad inputs surface AT THE BOUNDARY with a typed error, not three layers deep in a render tree.

2. Typed error channel

Effect<A, E, R>A is success, E is a typed error union, R is the dependency context. Errors are first-class values:

type AssetError =
  | NotFoundError       // collection + tokenId
  | MalformedURLError   // raw + reason
  | VersionDriftError   // expected + got
  | MissingHashError    // tokenId + source
  | NotGrailError       // tokenId

Consumers Effect.catchTag("NotFoundError", ...) to handle each case.

3. Composable layers

import { Effect, pipe } from "effect";
import { mstImageURL } from "@freeside-storage/client";

const fetchWithFallback = (tokenId: number) =>
  pipe(
    mstImageURL(tokenId),
    Effect.timeout("3 seconds"),
    Effect.retry({ times: 2 }),
    Effect.catchTag("NotFoundError", () =>
      Effect.succeed("https://example.com/fallback.webp"),
    ),
  );

Each pipe step is a composable layer. Same primitives across honeyroad, dimensions, midi.

Substrate-truth resolution

URL_CONTRACT_V1 (from @freeside-storage/protocol) is the source of truth. Builders return URLs where bytes live TODAY — both canonical routes and legacyRoutes are consumed.

Mibera image URLs resolve via the reveal_phase{N}/images/{hash}.png legacyRoute shape (where bytes live), since URL_CONTRACT_V1 marks the canonical Mibera/final/{tokenId}.png as gated by the optional mibera-2 polish cycle.

Grail URLs are NOT constructed from slug + extension — extensions are heterogeneous (.png / .PNG), some slugs contain spaces. The codex mibera-image-urls.json publishes the full URL per tokenId; the client reads.

Codex consumers (read-only)

Per [[consuming-codex-overrides]] doctrine. The client reads the published codex artifacts; never writes.

| codex source | consumer | what it provides | |---|---|---| | mibera-image-urls.json | lookupMiberaURL(tokenId) | tokenId → published image URL | | grails.jsonl | lookupGrail(tokenId) | grail identity (id, name, slug, category) |

In-memory cache per source URL. Call resetMiberaURLCache() / resetGrailCache() to clear (testing).

Install

pnpm add @freeside-storage/client effect

Test

pnpm -F @freeside-storage/client test