@intx/types
v0.5.0
Published
Runtime validators, API contract types, runtime interfaces, and sidecar wire frames for Interchange
Readme
@intx/types
Foundational types for the Interchange monorepo. ArkType runtime validators, API contract types, runtime interfaces, and sidecar wire frames. Nearly every other package imports from here, which makes this the canonical home for any shape that crosses a package boundary.
Runtime validators expose their inferred TypeScript types so consumers can validate at the boundary and trust the resulting value internally. Dedicated helper entry points avoid loading unrelated schema collections.
Surface
The package is split into several entry points so consumers only pull in the shapes they need:
@intx/types— domain validators and shared primitives: tenants, principals, roles, grants, agents, sessions, approvals, wallets, providers, oauth clients, credentials, offerings, the model catalog (models, model providers, offerings, and append-only pricing, plus the model-requirement and invoker-preference shapes and the model discovery view), observability, sidecar status enums (distinct from the wire frames under@intx/types/sidecarbelow), run addresses, hex and base64 helpers, and thehasCodeerror guard.@intx/types/hex— hexadecimal byte encoding and decoding.@intx/types/message-id— canonical Message-ID parsing and derivation.@intx/types/credential-cipher— credential cipher contracts and the authenticated-data helpers for sealed credentials and signing keys.@intx/types/grants— grant creation, update, and evaluation schemas, grant requirements, approval items, and effect/origin enums.@intx/types/adapter-manifest— the operator-declared custom inference adapter manifest schema andparseAdapterManifestEnv, the reader forSIDECAR_ADAPTER_MANIFEST.@intx/types/authz— grant rules, condition contexts, and authorization result shapes shared between@intx/authzand the hub.@intx/types/audit— theAuditAuthz,AuditRecord, andErrorRecordshapes for tool-authorization and error records.@intx/types/content-type—detectResponseKind, which classifies a response'sHeadersas an SSE stream or a JSON body.@intx/types/runtime— aggregate entry for runtime contracts and inference-event wire schemas.@intx/types/runtime-core— inference and harness contracts:ContextStore,ToolRunner,ToolDefinition,AuditStore,InferenceSource(the resolved provider/model/credential a call executes against), retry policy, director and reactor types. Use this lighter entry in child processes that need runtime contracts without constructing the inference-event union.@intx/types/inference-events— theInferenceEventwire validator, its discriminated TypeScript type, andparseInferenceEvent.@intx/types/inbound-mail-policy—InboundMailOutcome,AuthorControllableOutcome, and the authoredInboundMailPolicyschema.@intx/types/format-safety-rating—formatSafetyRatingText, the plain-text rendering helper, without runtime schema initialization.@intx/types/runtime-capabilities— the capability-registry contract harness extensions resolve against (e.g. mail transport, blob reader).@intx/types/sidecar— hub-sidecar WebSocket wire frames.@intx/types/credential-delivery— credential material and binding descriptors delivered to running workflow children.@intx/types/repo—RepoKind,RepoAction, andRepoIdwithout the sidecar frame schemas.@intx/types/workflow-definition—workflowDefinitionEnvelopeSchema, the structural workflow envelope validator used by definition loaders and the repository substrate.@intx/types/grant-snapshot—GrantWalkSnapshot, the per-step grant declarations and workflow grant requirements serialized for deployment.@intx/types/grant-wire— grant-update wire frames pushed from the hub to the sidecar.@intx/types/tool-packages— schemas for the tool-package distribution path: pin shapes (ToolPackagePin,ToolPackagePinArray,ToolPackagePinName), source variants (ToolPackageRegistrySource,ToolPackageAssetSource, and itspackagearmsToolPackageAssetTarballandToolPackageAssetSourceTree, unioned asToolPackageSource), thegetToolPackageSourceContentIdentityhelper that reads an entry's content identity (tarball SRI or source tree oid), and the deploy-pack manifest (ToolPackageManifestEntry,ToolPackageManifest).@intx/types/package-json— thePackageJSONvalidator for the subset ofpackage.jsonfields the asset substrate and tool-package builders read, including theinterchange.toolsextension, plusisContainedEntryPathfor entry-path containment.@intx/types/wire-definition-hash—computeWireDefinitionHashand thecanonicalJsonStringifyit builds on, the stable content hash a workflow definition is frozen and compared by.@intx/types/workflow-sources— schemas for where a code-sourced workflow definition's bytes come from:WorkflowDefinitionRegistrySource,WorkflowDefinitionAssetSource(with itstarballandsourcepackagearms), unioned asWorkflowDefinitionSource, and the sharedworkflowSourceAssetMountPathlayout helper.@intx/types/attachments— MIME classification, attachment categories, and attachment size/count limits.@intx/types/signals— signal kinds, approval decisions, and correlation signal-name helpers.@intx/types/agent-address— formatting and parsing run mail addresses.@intx/types/workflow-run-id—deriveWorkflowRunId, which extracts a deployment's top-level run ID from its mail address and throws on an invalid address.@intx/types/base64— byte encoding and decoding.@intx/types/concat—concatBytesfor combining byte arrays.@intx/types/has-code— thehasCodeerror guard.
