01Boot

Al Beltran

Software engineer

albeltran.comsys / init
  • Core
  • UI
  • Projects
  • Experience

Skip to content

Open-source library

@altbeltran/safe-action

Reliable TypeScript actions for humans and AI agents.

What it is

@altbeltran/safe-action is an open-source TypeScript library by Al Beltran. It runs an async action and returns a discriminated result: success with data, or a plain error object with a stable code. Validation uses Standard Schema, so Zod stays an optional peer. Retries, per-attempt timeouts, cancellation, and process-local idempotency sit beside the handler. describe() and toAITool() expose the same action to an AI agent without a vendor SDK. The library has no runtime dependencies.

Maintained by Al Andrew Paul Beltran. Version 0.1.0 is tagged on GitHub. The package is not on the npm registry yet.

What it includes

  • Typed success and failure results with stable error codes
  • Standard Schema validation, with Zod as an optional peer
  • Retries, per-attempt timeouts, and cancellation
  • Process-local idempotency for a single Node.js process
  • describe() and toAITool() for AI agents, with no vendor SDK
  • No runtime dependencies

Source on GitHub · MIT license