The agent loop that cannot hang.
A TypeScript agent SDK with zero runtime dependencies. Define an agent, add tools, run the loop, get a typed result — on Node, Bun, Deno, or the edge.
$pnpm add just-another-sdkWhy another one
Because the boring parts are the ones that bite you in production.
Agent frameworks demo well. Then you ship one, and the interesting problems turn out to be the unglamorous ones: a model that loops until your bill spikes, a tool exception that takes down a request, an API key that ends up in a CI log, a dependency tree you cannot audit, and no way to see what your agent actually did.
just-another-sdk treats those as the product, not the appendix. Every one of them is a default, a type, or a test — not something you remember to add.
The whole API
Four concepts. No ceremony.
An Agent is immutable configuration, so one instance safely serves every concurrent request. Run state is separate. Tools are plain functions with a schema. That is the entire mental model.
- Agent
- name, instructions, model, tools
- RunState
- messages, turns, usage, steps
- tool()
- schema in, typed handler out
- ModelProvider
- one method: generate()
import { Agent, tool } from 'just-another-sdk'
import { openrouter } from 'just-another-sdk/providers'
import * as z from 'zod'
const agent = new Agent({
name: 'travel-assistant',
instructions: 'Use your tools rather than guessing.',
model: openrouter('anthropic/claude-opus-5'),
tools: [
tool({
name: 'get_weather',
description: 'Get the current weather for a city.',
inputSchema: z.object({ city: z.string() }),
execute: async ({ city }) => fetchWeather(city),
// ^^^^ string — inferred, and validated
}),
],
})
const result = await agent.run('Weather in Paris?')
result.output // "It's 18°C and clear in Paris."
result.usage // { inputTokens: 412, outputTokens: 63, … }
result.stopReason // 'finish'One key. Every model.
OpenRouter reaches hundreds of models through a single provider, and the same OpenAI-compatible transport covers OpenAI, Groq, Together, DeepSeek, xAI, Ollama, vLLM, and LM Studio. Writing your own means implementing one method.