Skip to main content
@parmana/shared has no internal dependencies — every other package depends on it. Its public surface (packages/shared/src/index.ts) exports four things: ./domain/index.js, ./repositories/index.js, ./config/index.js, ./errors/index.js, plus a few standalone types and normalizePolicy.

Domain model

packages/shared/src/domain/ is the canonical, interface-based model — Authority, Authorization, Intent, BusinessTransaction, PolicyReference, Decision, Execution, Verification, Receipt, Override, ExecutionTrustRecord, plus enums like AuthorityType and BusinessTransactionStatus. This is the model both SDKs mirror — see TypeScript SDK → Models and Python SDK → APIs & Models — and the one every Concepts page describes.
packages/shared/src/ also contains several parallel, older implementations of the same concepts that are not part of the package’s public export surface: class-based Authority, Authorization, Intent, Execution, Evidence, Verification under top-level folders (authority/, authorization/, intent/, execution/, evidence/, verification/), plus empty stub files (Authority.ts, Authorization.ts, Intent.ts, Execution.ts, Evidence.ts, Verification.ts) at the package root. None of these are re-exported from index.ts. For example, the class-based Authorization (authorization/Authorization.ts) models a PERMIT/DENY decision with a policyId, which is an entirely different shape from the canonical domain/authorization.ts interface (authorizationId, authorityId, purpose, issuedAt). If you’re reading source in this package, confirm which folder you’re in — domain/ is the one that matters.

Repository contracts

packages/shared/src/repositories/:
interface BusinessTransactionRepository { /* accept, get, list */ }
interface ExecutionTrustRecordRepository { /* findByTransactionId, appendVerification, appendReceipt, ... */ }
interface PolicyRepository { /* load */ }
These are the interfaces storage implements and runtime depends on — runtime never imports a concrete repository class directly.

Errors

packages/shared/src/errors/ defines a base ParmanaError plus specific errors like ValidationError, BusinessTransactionNotFoundError, PolicyNotFoundError, VerificationFailedError, ReceiptGenerationError, UnauthorizedError, ForbiddenError, ConflictError, OverrideNotAllowedError, DecisionNotApprovedError, and others. packages/runtime/src/errors/ layers a small number of runtime-specific errors (like VerificationFailedError, ReceiptGenerationError) on top of these.
This ParmanaError is unrelated to the TypeScript SDK’s own ParmanaError (typescript/src/errors/ParmanaError.ts) — same name, two independent classes in two different packages, one server-side and one client-side. Don’t assume instanceof checks cross the boundary.

Configuration

packages/shared/src/config/ defines Config, ConfigLoader, and validation/parsing utilities, along with enumerated CryptoAlgorithms, KeyProviders, StorageProviders, and TrustProfiles — the vocabulary other packages (crypto, storage) use for their own configuration.

Package Architecture

Where shared sits in the dependency graph.

Business Transaction

The concept this package’s central type models.

Error Model

How these errors surface over HTTP.

storage

Implements shared’s repository contracts.