/** * ShipCapsule — release-artifact receipt (ADR-0011). * * Same canonical-CBOR + ContentAddress kernel as runtime primitives, applied * to a published-package tarball. `id` is the fnv1a label over the * canonical bytes of every field except `id` and `integrity`; `integrity` * pairs that label with a sha256 digest over the same bytes. * * @module */ import { Effect } from 'effect'; import type { AddressedDigest, ContentAddress, HLC } from './brands.js'; interface ShipCapsuleBuildEnv { readonly node_version: string; readonly pnpm_version: string; readonly os: 'linux' | 'darwin' | 'win32'; readonly arch: 'x64' | 'arm64'; } interface ShipCapsuleShape { readonly _kind: 'shipCapsule'; readonly schema_version: 1; readonly id: ContentAddress; readonly integrity: AddressedDigest; readonly package_name: string; readonly package_version: string; readonly source_commit: string; readonly source_dirty: boolean; readonly lockfile_address: AddressedDigest; readonly workspace_manifest_address: AddressedDigest; readonly tarball_manifest_address: AddressedDigest; readonly build_env: ShipCapsuleBuildEnv; readonly package_manager: 'pnpm'; readonly package_manager_version: string; readonly publish_dry_run_address: AddressedDigest; readonly lifecycle_scripts_observed: readonly string[]; readonly generated_at: HLC; readonly previous_ship_capsule: ContentAddress | null; } type ShipCapsuleInput = Omit; type ShipCapsuleDecodeError = 'non_canonical' | 'malformed_cbor' | 'invalid_shape' | 'unsupported_version'; /** * Public namespace for ShipCapsule (ADR-0011). `make` builds a capsule from * input, `canonicalize` encodes it as canonical CBOR for transport / hashing, * `decode` round-trips canonical bytes and rejects non-canonical encodings AND * unknown `schema_version`s (`unsupported_version`, fail-closed), * `computeId` mints the fnv1a label over the canonicalized payload. */ export declare const ShipCapsule: { make: (input: ShipCapsuleInput) => Effect.Effect; canonicalize: (capsule: ShipCapsuleShape) => Uint8Array; decode: (bytes: Uint8Array) => Effect.Effect; computeId: (capsuleWithoutIdentity: ShipCapsuleInput) => Effect.Effect; }; export declare namespace ShipCapsule { /** Decoded capsule shape returned by {@link ShipCapsule.make} and {@link ShipCapsule.decode}. */ type Shape = ShipCapsuleShape; /** Constructor input accepted by {@link ShipCapsule.make} (capsule without `id` / `integrity`). */ type Input = ShipCapsuleInput; /** Tagged failure variants {@link ShipCapsule.decode} can produce. */ type DecodeError = ShipCapsuleDecodeError; /** Node / pnpm / OS / arch tuple captured in the capsule's `build_env`. */ type BuildEnv = ShipCapsuleBuildEnv; } export {}; //# sourceMappingURL=ship-capsule.d.ts.map