@vectrion/shared

v0.1.1

Published

Shared utilities, error hierarchy, and helpers for the Vectrion AI runtime SDK

Readme

@vectrion/shared

Shared utilities, custom error hierarchy, and helpers used across all Vectrion packages.

šŸ“– Part of the Vectrion SDK. View the live documentation and architectural specifications at vectrion.vercel.app.

Installation

npm install @vectrion/shared

Error Hierarchy

import {
    VectrionError,
    VectrionProviderError,
    VectrionRouterError,
    VectrionValidationError,
} from "@vectrion/shared";

// Base error
throw new VectrionError("Something went wrong");

// Provider-specific error
throw new VectrionProviderError("API rate limited", "google");

// Router error with attempted providers
throw new VectrionRouterError("All providers failed", ["google", "ollama"]);

// Validation error with Zod issues
throw new VectrionValidationError("Schema mismatch", zodIssues);

Utilities

  • JsonlWriter — Async JSONL file writer for observability traces

License

MIT