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

@tagna/udiot

v0.16.2

Published

An AI-native TypeScript framework for composable applications and web delivery

Readme

@tagna/udiot

AI-native TypeScript framework for middleware pipelines, dependency injection, state management, typed web apps, and Express-compatible server helpers.

@tagna/udiot provides:

  • Typed middleware pipelines
  • Decorator-based dependency injection
  • Agent runtime primitives for observable LLM calls and tool-using agents
  • Caching and telemetry primitives
  • Structured run-event telemetry for long-running AI workflows
  • State management utilities
  • A typed web application layer under @tagna/udiot/web
  • Express-oriented server helpers under @tagna/udiot/server
  • Server-Sent Events helpers for browser live updates
  • Workspace filesystem abstraction for local and sandboxed code generation
  • A performance-focused database layer under @tagna/udiot/database

Installation

Requirements:

  • Node.js >=20
  • npm >=9
npm install @tagna/udiot

Entry Points

  • @tagna/udiot for the main framework APIs
  • @tagna/udiot/agents for LLMClient, AgentRunner, AgentLoop, and tool registries
  • @tagna/udiot/sandbox for WorkspaceFS, local workspaces, and remote sandbox clients
  • @tagna/udiot/telemetry for metrics, tracing, logging, AI observability, and run-event streams
  • @tagna/udiot/browser for browser-oriented state and UI usage
  • @tagna/udiot/database for MikroORM, DbContext-style patterns, and DI-friendly repositories
  • @tagna/udiot/database/browser for Supabase and Firebase client helpers
  • @tagna/udiot/node for Node-specific utilities
  • @tagna/udiot/dev for development tooling
  • @tagna/udiot/ssg for static generation
  • @tagna/udiot/web for typed app/page contracts, web building, server bootstrap, and diagnostics
  • @tagna/udiot/server for Express, sessions, uploads, CSRF, request-scoped DI, and controller adapters

Agent Runtime

@tagna/udiot/agents is the v0.16 runtime for observable LLM calls and multi-step agents. It includes OpenAI and Anthropic providers, retry/backoff, cost tracking, streaming, structured JSON output, tool-use loops, and run-event telemetry. Anthropic support is an optional peer dependency; install @anthropic-ai/sdk in the consuming app before using provider: 'anthropic'.

import { AgentRunner, createLLMClient } from '@tagna/udiot/agents';
import { z } from 'zod';

const llm = createLLMClient({ provider: 'openai' });

const summarizer = new AgentRunner({
  name: 'summarizer',
  systemPrompt: 'Return a compact summary.',
  outputSchema: z.object({ summary: z.string() }),
  model: 'gpt-4o-mini',
  llm,
});

const result = await summarizer.run('UDIOT 0.16 adds agent runtime support.');
console.log(result.output.summary);

The old root-level AIClient remains available for compatibility, but new code should use createLLMClient() and the agent APIs.

Middleware Pipeline

import { MiddlewarePipeline } from '@tagna/udiot';

interface AppContext {
  request: { path: string };
  response?: { message: string };
}

const pipeline = new MiddlewarePipeline<AppContext>();

pipeline.use(async (ctx, next) => {
  await next();
});

pipeline.use(async (ctx, next) => {
  ctx.response = { message: 'Hello from UDIOT' };
  await next();
});

const ctx: AppContext = { request: { path: '/hello' } };
await pipeline.execute(ctx);

Dependency Injection

Import reflect-metadata once before using decorators.

import 'reflect-metadata';
import { Container, Injectable } from '@tagna/udiot';

@Injectable()
class UserService {
  findById(id: string) {
    return { id, name: 'Alice' };
  }
}

const container = new Container();
container.register(UserService);

const userService = container.resolve<UserService>(UserService);
console.log(userService.findById('123'));

Express Server Helpers

import 'reflect-metadata';
import express from 'express';
import { Container, Controller, Get, Param } from '@tagna/udiot';
import {
  createRequestScopeMiddleware,
  createSessionMiddleware,
  toExpressRouter,
} from '@tagna/udiot/server';

@Controller('/posts')
class PostsController {
  @Get('/:id')
  show(@Param('id') id: string) {
    return { id };
  }
}

const app = express();
const container = new Container();
container.register(PostsController);

const sessionSecret = process.env.SESSION_SECRET;
if (!sessionSecret) {
  throw new Error('SESSION_SECRET is required');
}

app.use(express.json());
app.use(createSessionMiddleware({ secret: sessionSecret }));
app.use(createRequestScopeMiddleware({ container }));
app.use(toExpressRouter(PostsController, { container }));

createSessionMiddleware refuses to start in production (NODE_ENV=production) when the secret is well-known (change-me, secret, …), shorter than 32 characters, or when no persistent store is provided. Generate a secret with openssl rand -hex 32 and inject it via the environment.

The server module also exports:

  • createNunjucksEngine()
  • createEventStream()
  • csrfMiddleware()
  • flashMiddleware()
  • createUploadMiddleware()
  • expressCacheMiddleware()
  • param()

Example Server-Sent Events stream:

import express from 'express';
import { createEventStream } from '@tagna/udiot/server';

const app = express();
const runs = createEventStream({ channel: 'runs' });

app.get('/events/runs', runs.handler);
await runs.publish({ runId: 'run_123', status: 'started' }, 'run');

Database

@tagna/udiot/database adds a DI-friendly database surface built around MikroORM. It keeps SQL access outside the framework core, but integrates cleanly with request-scoped containers and repository injection.

import 'reflect-metadata';
import { Injectable, ServiceScope } from '@tagna/udiot';
import {
  Entity,
  MikroORM,
  PrimaryKey,
  Property,
  InjectRepository,
  registerMikroOrm,
  type EntityRepository,
} from '@tagna/udiot/database';

@Entity()
class User {
  @PrimaryKey()
  id!: number;

  @Property()
  email!: string;
}

@Injectable({ scope: ServiceScope.SCOPED })
class UserService {
  constructor(
    @InjectRepository(User) private readonly users: EntityRepository<User>,
  ) {}

  list(): Promise<User[]> {
    return this.users.findAll();
  }
}

CLI

The package ships with a udiot binary:

npx udiot --help

Documentation

License

MIT