Skip to content
Hussh
Connect MCP

BYOA — Reference Adapter (TypeScript)

Public TypeScript sketch of the BYOA adapter boundary: a user-selected model or tool runs only with an explicit consent receipt.

Code artifact

TL;DR: Reference TypeScript BYOA adapter interface + two implementations (OpenAI HTTPS, Local MLX). Concept v0.X.

Summary

Status as of 2026-05-27: public reference excerpt.

This TypeScript sketch shows the BYOA adapter boundary: each adapter declares a runtime, checks whether it can handle an input, and runs only with an explicit consent receipt.

byoa-reference-adapter-typescript.tstypescript · 28 lines
export type ConsentScope = "profile.read" | "portfolio.read" | "context.write";

export interface ConsentReceipt {
  receiptId: string;
  subject: string;
  scope: ConsentScope;
  grantedAt: string;
  expiresAt?: string;
}

Full artifact

Public reference excerpt rendered inline above. The working implementation should be regenerated as a public artifact before any production code sample is distributed externally.

Cross-referenced from

  • BYOA - parent concept.

Relations

Sources

  • Internal Hussh source note - BYOA reference adapter code artifact artifact synthesis and public wiki publication context.