TAP Protocol — @tensflare/tap

Installation

npm install @tensflare/tap

Overview

The Tensflare Accountability Protocol (TAP) is the foundational data-model package for the entire Truss ecosystem. It provides Zod schemas and TypeScript types for mandates, action records, delegation hops, and jurisdiction evaluations. It has no framework dependencies beyond Zod and can be used in any Node.js project.

Usage

import { MandateSchema } from "@tensflare/tap";

const mandate = MandateSchema.parse(rawData); // validates + types

Exports

  • MandateSchema — validates mandate payloads defining rules, scope, and jurisdiction
  • ActionRecordSchema — validates action records with SHA-256 hashed inputs/outputs
  • DelegationHopSchema — validates delegation chain hops across participating entities
  • JurisdictionEvaluationSchema — validates jurisdiction compliance evaluations
  • ScopeSchema — validates scope definitions for mandates
  • ValiditySchema — validates mandate validity windows

Key Features

  • Zero runtime dependencies beyond Zod
  • Full TypeScript type inference from schemas
  • Build custom compliance tooling on top of the protocol
  • Extend with custom schema composition