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

intentum

v0.1.0

Published

Typed, observable AI functions, structured output, generated code, and resilient workflows for TypeScript.

Readme

Intentum

CI npm version License Node.js

Typed, observable AI functions and resilient workflows for TypeScript.

Intentum gives model-backed behavior a small, explicit runtime boundary. Define a typed model function, validate its structured response, observe important workflow steps, retry transient work, or generate a reviewable implementation that can be cached and repaired.

your TypeScript
      │
      ├── llm()       typed model calls + schema validation + repair
      ├── impl()      generated function bodies + caching
      ├── shim()      model-assisted retry or source replacement
      ├── flow()      observable execution + steps + retries
      └── task()      non-interactive Codex CLI sessions

Why Intentum?

  • Types at the boundary — pair TypeScript inference with runtime JSON Schema validation.
  • Provider choice without lock-in — use Codex, any OpenAI-compatible endpoint, a local model, or a deterministic mock.
  • Recovery with evidence — structured failures include paths, validation details, and the invalid response so a model can correct it.
  • Observable by design — inspect status, timing, attempts, errors, and lifecycle events without instrumenting every function.
  • Reviewable generation — generated code is explicit, cacheable, and treated as code rather than hidden magic.
  • Testable locally — inject MockProvider; no credentials or network are required for unit tests.

Install

npm install intentum

Intentum supports Node.js 20 and newer and ships as an ESM package with TypeScript declarations.

Quick start

import {
  MockProvider,
  arraySchema,
  llm,
  objectSchema,
  stringSchema
} from "intentum";

const summarySchema = objectSchema("Summary", {
  title: stringSchema(),
  keyPoints: arraySchema(stringSchema())
});

const summarize = llm<[string], { title: string; keyPoints: string[] }>({
  schema: summarySchema,
  provider: new MockProvider({
    structured: {
      title: "Intentum",
      keyPoints: ["Typed", "Observable", "Resilient"]
    }
  }),
  prompt: ({ args }) => `Summarize this document: ${args[0]}`
});

const result = await summarize("Intentum is a TypeScript runtime.");
// { title: "Intentum", keyPoints: ["Typed", "Observable", "Resilient"] }

Replace MockProvider with the default provider selection when your application is configured. Intentum checks for Codex first, then reachable local OpenAI-compatible servers, then a configured cloud endpoint.

Choose a model capability

Use the portable intelligence setting instead of coupling application code to a provider-specific model name:

const answer = llm<[], string>({
  intelligence: "HIGH",
  prompt: () => "Give a concise answer."
});

| Intelligence | Built-in model mapping | | --- | --- | | LOW | Luna Low | | MEDIUM | Luna High | | HIGH | Sol High |

The default is MEDIUM. Set INTENTUM_INTELLIGENCE or provide an explicit model when needed.

Configure providers

# Automatic selection is the default.
export INTENTUM_PROVIDER=auto
export INTENTUM_API_KEY="..."

# Or force one route.
export INTENTUM_PROVIDER=codex
# export INTENTUM_PROVIDER=local
# export INTENTUM_LOCAL_BASE_URL=http://127.0.0.1:11434/v1

The Codex CLI must already be installed and authenticated. OpenAI-compatible providers accept INTENTUM_BASE_URL, INTENTUM_MODEL, and the retry/timeout options documented in Provider configuration.

Build observable workflows

import { flow, retry, step } from "intentum";

const research = flow(async (topic: string) => {
  const cleaned = step(() => topic.trim(), { name: "clean" });
  return retry(
    { attempts: 3, delayMs: 250, backoff: 2 },
    () => fetchResearch(cleaned),
    { name: "research" }
  );
}, { silent: true });

const run = research("typed workflow libraries");
const result = await run.result();
console.log(run.status, run.steps, result);

Flows remain ordinary functions. Only the boundaries you mark with step() and retry() become observable.

Structured schemas and recovery

Built-in helpers cover enums, literals, unions, nullable values, tuples, records, refinements, and constraints. fromJsonSchema() accepts complex JSON Schema, and fromZod() adapts a Zod-like parser without making Zod a dependency.

Unknown object fields are stripped by default so harmless model additions do not fail a request. Use unknownKeys: "passthrough" to retain them. Validation errors are path-aware, for example $.items[2].name.

When a structured response is invalid, llm() includes the validation error and previous output in a repair prompt and retries once by default:

import { enumSchema, llm, objectSchema } from "intentum";

const robustAnswer = llm<[], { action: "allow" | "deny" }>({
  schema: objectSchema("Decision", {
    action: enumSchema("Action", ["allow", "deny"] as const)
  }),
  repair: { maxAttempts: 3 },
  prompt: () => "Choose whether this request is allowed."
});

Authentication, cancellation, and ordinary transport failures retain their original error semantics; only structured parse/validation failures are repaired.

Generated behavior

const slugify = impl<[string], string>({
  name: "slugify",
  parameters: ["value"],
  description: "Convert text to a lowercase URL slug separated by hyphens.",
  returnType: "string"
});

impl() caches the generated JavaScript body by default. shim() can retry a failing function or compile a model-provided replacement body. Generated code executes in the current process: review it and use a worker or sandbox for untrusted prompts.

Documentation

| Guide | What it covers | | --- | --- | | Documentation home | Product map and design principles | | API guide | Schemas, llm, impl, shim, providers, and tasks | | Provider configuration | Auto-detection, Codex, HTTP retries, and safety | | Typed flows | Steps, retries, cancellation, and events | | Examples | Runnable examples in examples/ | | Releasing | npm release checklist and trusted publishing | | Contributing | Branch, PR, review, and local workflow |

Development

npm ci
npm run check
npm run coverage
npm run package:check

If you use the aw CLI, the same workflows are available as:

aw run check
aw run coverage
aw run package:check
aw run audit

See CONTRIBUTING.md before opening a pull request.

Project status

Intentum is a focused, actively evolving runtime. The API is deliberately explicit: distributed workers, provider-specific tool calling, and a full code sandbox are outside the package’s current boundary rather than hidden behind it.

License

MIT © 7obyGit