npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@org.ai/types

v2.1.3

Published

Shared type definitions for AI primitives packages

Readme

@org.ai/types

You're building AI-powered applications, but TypeScript keeps fighting you. Your AI functions return any, your workflow contexts are untyped blobs, and refactoring means breaking things you cannot see.

@org.ai/types gives you the type safety you need to build AI applications with confidence.

The Problem

// Without types: runtime errors waiting to happen
const result = await aiFunction(input) // What does this return?
workflow.on('event', (data) => {       // What's in data?
  workflow.state.user = data           // Is this right?
})

The Solution

import type { AIFunctionType, WorkflowContextType, EventHandlerType } from '@org.ai/types'

// With types: autocomplete, refactoring, and compile-time safety
const summarize: AIFunctionType<Summary, Document> = async (doc) => {
  // TypeScript knows doc is Document, return must be Summary
}

const handler: EventHandlerType<void, UserEvent> = (data, ctx) => {
  // data is UserEvent, ctx has full WorkflowContextType methods
  ctx.send('notification', { userId: data.userId })
}

Quick Start

1. Install

npm install @org.ai/types

2. Import the types you need

import type {
  AIFunctionType,
  EventHandlerType,
  WorkflowContextType,
  RelationshipOperatorType,
  ParsedFieldType,
} from '@org.ai/types'

3. Build with confidence

Your IDE now understands your AI code. Refactor fearlessly.

Type Reference

| Type | Purpose | |------|---------| | AIFunctionType<TOutput, TInput, TConfig> | Generic AI function with output-first parameter order | | EventHandlerType<TOutput, TInput> | Workflow event handlers with typed context | | WorkflowContextType | The $ workflow proxy with send, try, do, on, every | | RelationshipOperatorType | Database relationship operators (->, ~>, <-, <~) | | ParsedFieldType | Schema field definitions with relationship metadata |

Why Output-First Generics?

Just like Promise<T> puts the important part first, AIFunctionType<TOutput> leads with what matters most:

// Natural reading order: "an AI function that returns a Summary"
type Summarizer = AIFunctionType<Summary>

// vs the awkward alternative
type Summarizer = AIFunctionType<Document, Summary>  // Wait, which is which?

Part of the org.ai Ecosystem

This package provides shared types for:

License

MIT