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

@studiomorgana/agents

v0.5.2

Published

Agent loop for Morgana: Nanoagent runtime plus providers, action tools, and ctx.agents construction.

Readme

@studiomorgana/agents

Server actions reach this as ctx.agents / ctx.ai. To build apps, start with the Morgana guide.

The agent loop for Morgana — providers, action tools, and ctx.agents.

npm i @studiomorgana/agents

An agent is a name and an instruction

import { providerFromEnv, resolveTransport, buildAgentSurface } from '@studiomorgana/agents'

Three pieces:

  • A provider is where a completion goes. One transport, so a project can use the Morgana route with no credentials and swap in its own key without the loop noticing.
  • Tools are actions. ctx.ai.tools.register('closeTask', { describe }) says what the model is told about a tool; the body is the server action of that name, reached through the same runner ctx.actions.run uses. So a tool can read collections and files, and inherits the calling action's session, because it is an action.
  • An agent is an instruction plus the tasks it is given. create writes the declaration down; run is the expensive part.

Missing configuration is an error, not a fallback

providerFromEnv({ provider: 'openai' })  // throws: names the missing field

Every provider that needs a credential refuses to be constructed without one. There is no default key and no ambient environment read from inside the loop — a provider that silently falls back to somebody else's endpoint is worse than one that refuses.

| variable | | |---|---| | MORGANA_URL | the Morgana route | | MORGANA_TOKEN | credential for it | | MORGANA_LLM_PROVIDER | morgana (default), openai, anthropic | | OPENAI_API_KEY / ANTHROPIC_API_KEY | for those providers | | MORGANA_LLM_KEY | stands in for any provider key |

What survives a turn

History is replayed in the roles it was written in. Sending an assistant turn through SystemMessage would relabel the model's own past answers as instructions, and the conversation would become one undifferentiated block of directives.

tool messages are skipped rather than guessed at. A tool result is only meaningful next to the call it answers — it carries a tool_call_id, and every provider rejects a tool message without one.

Licence

Apache-2.0