@hlos-ai/schemas
v0.8.3
Published
HLOS Kernel v2 API contract types: responses, errors, receipts, IDs
Downloads
285
Readme
@hlos-ai/schemas
Public HLOS contract types for shared consumer use.
Installation
npm install @hlos-ai/schemasPublic Surface
The package is intentionally narrow and includes:
- kernel response envelopes and error schemas
- surface identifiers
- branded public ID helpers
- attribution enums
- agent list and passport stub schemas
- generic encoding helpers
- AAR envelope validation
Example
import {
KernelErrorSchema,
bytesToBase64url,
deriveFundingSource,
} from '@hlos-ai/schemas';
import { generateReceiptId } from '@hlos-ai/schemas/ids';
const encoded = bytesToBase64url(new Uint8Array([1, 2, 3]));
const funding = deriveFundingSource('SPONSOR_KEY');
const receiptId = generateReceiptId();
KernelErrorSchema.parse({
ok: false,
status: 400,
error: {
code: 'INVALID_REQUEST',
message: 'Example validation error',
},
});
console.log(encoded, funding, receiptId);