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

@plasius/storage

v1.1.0

Published

Azure storage and immutable asset-version primitives for Plasius projects

Readme

@plasius/storage

npm version Build Status coverage License Code of Conduct Security Policy Changelog

Public package containing shared Azure storage helpers and server-side, immutable asset-version primitives for Plasius services.

Install

npm install @plasius/storage

Azure Files Usage

import { uploadUserImageShare } from "@plasius/storage";

await uploadUserImageShare("user-123", 1, Buffer.from("avatar"), "image/png");

uploadUserImageShare() supports image/png, image/jpeg, image/jpg, image/webp, image/gif, and image/avif, and it normalizes unsafe userId values before using them as Azure Files directory names.

Immutable Asset Versions

The @plasius/storage/immutable-assets subpath is Node-only. It implements conditional, digest-verified Azure Blob mechanics behind injected structural ports; it is intentionally unavailable to browser bundles and does not create credentials or Azure clients.

Its primary exports are:

  • createImmutableAssetStore(config) for a service with distinct intake and runtime scopes;
  • createImmutableAssetVersion(container, input, options?) for conditional, manifest-last creation followed by complete verification;
  • verifyImmutableAssetVersion(container, identity, options?) for an explicit full-version re-read;
  • readImmutableAssetVersionFile(container, identity, relativePath, options?) for marker-first exact file access;
  • BlobContainerPort and BlockBlobClientPort structural adapter types;
  • immutable identity, input, manifest, receipt, options, store, diagnostic, and error-code types; and
  • ImmutableAssetStorageError for bounded, typed failures.

Import the API only from server-side Node code:

import {
  createImmutableAssetStore,
  createImmutableAssetVersion,
  verifyImmutableAssetVersion,
  readImmutableAssetVersionFile,
  ImmutableAssetStorageError,
  type BlobContainerPort,
} from "@plasius/storage/immutable-assets";

IMMUTABLE_VERSION_MANIFEST_PATH is the fixed marker path, and MAX_IMMUTABLE_VERSION_FILES is the 513-file total ceiling.

Use a private intake container for unpromoted candidates and a private runtime container for immutable versions that may be referenced by the promoted model catalog. The host constructs the Azure adapters, supplies an abort signal/deadline, and chooses the container for each operation.

The configured store exposes stageVersion, publishVersion, verifyVersion, and readVersionFile. stageVersion targets the intake scope; publishVersion targets the runtime scope. Verification and reads require an explicit scope, so a caller cannot silently cross the intake/runtime boundary.

Version roots

| Asset kind | Immutable root | | --- | --- | | Model | models/{id}/versions/{version} | | GPU interface | gpu-interfaces/{id}/versions/{version} | | WGSL shader | shaders/{id}/versions/{version} | | Shader style profile | shader-style-profiles/{id}/versions/{version} | | Qualification evidence | shader-evidence/{id}/versions/{version} |

Every complete version has the fixed marker _plasius/version-manifest.json. A version may contain at most 513 files in total: one marker and up to 512 manifest-declared payloads.

Write contract

The immutable write operation:

  1. validates the identity, paths, content types, package limits, and byte budgets before storage effects;
  2. computes lowercase SHA-256, exact length, and protocol-owned metadata from the supplied bytes;
  3. creates payloads with If-None-Match: *;
  4. accepts an existing blob as an idempotent replay only after its complete bytes, length, content type, digest, and metadata match;
  5. writes _plasius/version-manifest.json last; and
  6. re-reads and verifies the marker and every declared payload before returning a verified receipt.

The receipt is evidence of immutable storage verification only. It contains no Blob URL or SAS token and grants no catalog or runtime authority.

Read contract

A read requires a supported kind, exact asset ID/version, and a normalized relative path. It verifies the fixed marker first, requires that the marker declares the path, then downloads and verifies the payload. Traversal, undeclared paths, mutable aliases such as latest, raw blob names, and arbitrary Blob/SAS URLs fail closed.

Failure and lifecycle retention

Operations return typed storage diagnostics for invalid input, immutable conflict, integrity mismatch, incomplete versions, timeout/abort, dependency failure, and undeclared reads. Callers own bounded retry policy; the package does not hide dependency failures behind internal retry loops.

Before the marker exists, a failed attempt is unreachable to marker-first readers. This API intentionally has no delete authority: payloads from an interrupted attempt are retained because a concurrent completion marker may have adopted them. The host may apply a separately authorized lifecycle policy only after proving an unreachable candidate is neither complete nor catalog referenced. Product rollback changes a catalog pointer elsewhere; it never overwrites or deletes these bytes.

Ownership and rollout boundary

This package owns Blob paths, conditional creation, integrity metadata, manifest-last completion, complete verification, and exact marker-first reads. The model-storage/site layer continues to own:

  • private-container configuration, credentials, authentication, authorization, tenant policy, and audit;
  • catalog rows, channel compare-and-swap, promotion, discovery, and rollback;
  • shader/model schemas, reflection, ABI and semantic compatibility, admission, and qualification-evidence policy;
  • evaluation of feature flag asset.pipeline.shader-store.enabled; and
  • evaluation of capability gpu.shader.style.select for user-visible style discovery and selection.

The feature flag is the runtime/public-submission rollout control. The capability does not grant promotion or storage access and is not required for default-profile rendering. Neither control is evaluated by this package.

For the complete protocol and security requirements, see ADR-0003, TDR-0001, and SECURITY.md.

Development

npm install
npm run build
npm test
npm run typecheck
npm run lint
npm run test:coverage
npm run audit:all
npm run pack:check

Governance

License

MIT