Thing/packages/eve-contracts
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-26 20:14:12 +02:00
..
dist Merge Eve invocation and presentation authority 2026-08-26 20:14:12 +02:00
scripts Repair Eve browser command and editable binding contracts 2026-08-22 00:02:17 +02:00
src Merge Eve invocation and presentation authority 2026-08-26 20:14:12 +02:00
test Merge Eve invocation and presentation authority 2026-08-26 20:14:12 +02:00
package-lock.json Unify Eve surface wire format 2026-08-18 01:29:11 +02:00
package.json Unify Eve surface wire format 2026-08-18 01:29:11 +02:00
README.md Unify Eve surface wire format 2026-08-18 01:29:11 +02:00
tsconfig.json Emit portable Eve package output with LF endings 2026-08-18 02:54:10 +02:00

@gamecult/eve-contracts

Canonical TypeScript types and runtime validators for Eve provider boundaries. The generated sources come from the JSON Schemas in ../../schemas; run npm run generate after changing an authoritative schema. npm test rejects schema drift.

import {
  parseEveProviderAdvertisement,
  parseEveSurfaceDocument,
  parseEveCommandInvocation,
  parseEveInputCapability,
} from "@gamecult/eve-contracts";

const provider = parseEveProviderAdvertisement(untrustedAdvertisement);
const surface = parseEveSurfaceDocument(untrustedSurface);
const command = parseEveCommandInvocation(untrustedCommand);
const input = parseEveInputCapability(untrustedInputCapability);

Providers own their state, surfaces, command acceptance, and receipts. This package owns only the portable contract and validation boundary.

MessagePack wire shape

The JSON Schemas also name the public MessagePack shape: contracts are encoded as maps with the schema's camel-case member names. They are not positional arrays. GameCult.Eve.Surface emits that map shape and may read the former indexed-array encoding only as migration input.

The checked test/fixtures/eve-surface-csharp-v1.base64 payload is emitted by the real C# formatter. The C# suite rejects formatter drift from that fixture; the TypeScript suite decodes the same bytes and validates the resulting surface. Do not replace this proof with a handwritten TypeScript facsimile of the C# DTO.