Type-Safe Agents: Leveraging apcore-js in TypeScript The apcore-js SDK now enables developers to build type-safe, AI-perceivable modules in TypeScript using TypeBox for compile-time safety and runtime validation. The SDK supports both class-based and functional module definitions, automatic ID normalization between camelCase and snake_case, and distributed tracing propagation for microservice environments. By combining the apcore protocol with TypeScript's type system, the project ensures that AI agents receive consistent JSON inputs and outputs across both Python and TypeScript implementations. While Python dominates the AI research space, TypeScript is the engine of the modern full-stack web. From high-performance Node.js backends to complex React frontends, TypeScript provides the structure and safety that large-scale engineering teams demand. When we built the apcore-js SDK, we didn't just want to "port" the Python logic. We wanted to create a first-class, type-safe experience that leverages the unique strengths of the JavaScript ecosystem. In this twentieth article of our series, we explore how to build AI-Perceivable modules in TypeScript using apcore and TypeBox . A core tenet of the apcore protocol is that a module’s behavior should be identical regardless of the implementation language. A module named executor.user.get must accept the same JSON input and produce the same output in both Python and TypeScript. apcore-js achieves this by using TypeBox as its core schema engine. TypeBox allows us to define JSON Schemas that double as TypeScript types, giving us compile-time safety and runtime validation in a single definition. In apcore-js, you define your module's contract using TypeBox's Static and Type primitives: js import { Type, Static } from '@sinclair/typebox'; export const InputSchema = Type.Object { userId: Type.String { description: "The unique UUID of the user." } , includePrivate: Type.Boolean { default: false, description: "Whether to include sensitive fields." } } ; export type Input = Static