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

enki-ai

v0.1.9

Published

Template project for writing node package with napi-rs

Readme

enki-ai

JavaScript bindings for Enki's Rust agent runtime, published as a native Node.js package via napi-rs.

Install

npm install enki-ai

The package ships prebuilt native binaries for:

  • Windows x64 and arm64
  • macOS x64 and arm64
  • Linux x64 and arm64 (GNU libc)

API

The package exposes two layers:

  • EnkiAgent: thin wrapper over the native runtime
  • Agent: higher-level JavaScript wrapper for tools, memories, and custom LLM providers

It also exports NativeEnkiAgent, Tool, MemoryModule, MemoryBackend, LlmProviderBackend, RunContext, and AgentRunResult.

EnkiAgent

Use EnkiAgent when you want a simple session-oriented interface backed directly by the native runtime.

const { EnkiAgent } = require('enki-ai')

async function main() {
  const agent = new EnkiAgent({
    name: 'Assistant',
    systemPromptPreamble: 'Answer clearly and keep responses short.',
    model: 'ollama::llama3.2:latest',
    maxIterations: 20,
    workspaceHome: process.cwd(),
  })

  const output = await agent.run('session-1', 'Explain what this project does.')
  console.log(output)
}

main().catch(console.error)

Constructor options:

  • name?: string
  • systemPromptPreamble?: string
  • model?: string
  • maxIterations?: number
  • workspaceHome?: string

Agent

Use Agent when you want to register JavaScript tools or plug in your own LLM provider.

const { Agent } = require('enki-ai')

async function main() {
  const agent = new Agent('demo-model', {
    instructions: 'You are a dice game.',
    workspaceHome: process.cwd(),
  })

  agent.toolPlain(
    function rollDice() {
      return '4'
    },
    {
      description: 'Roll a six-sided die and return the result.',
      parametersJson: JSON.stringify({
        type: 'object',
        properties: {},
        additionalProperties: false,
      }),
    },
  )

  const result = await agent.run('My guess is 4', {
    sessionId: 'session-tools-1',
  })

  console.log(result.output)
}

main().catch(console.error)

Context-aware tools

agent.tool() injects a RunContext as the first argument so your tool can access runtime dependencies.

const { Agent } = require('enki-ai')

const agent = new Agent('demo-model')

agent.tool(
  function getPlayerName(ctx) {
    return ctx.deps.playerName
  },
  {
    description: "Get the player's name.",
    parametersJson: JSON.stringify({
      type: 'object',
      properties: {},
      additionalProperties: false,
    }),
  },
)

Then pass dependencies at run time:

const result = await agent.run('Say hello.', {
  sessionId: 'session-ctx-1',
  deps: { playerName: 'Anne' },
})

Custom LLM providers

Pass either a subclass of LlmProviderBackend or a function through the llm option.

const { Agent, LlmProviderBackend } = require('enki-ai')

class DemoProvider extends LlmProviderBackend {
  complete(model, messages, tools) {
    return {
      model,
      content: `Received ${messages.length} message(s) and ${tools.length} tool(s).`,
    }
  }
}

const agent = new Agent('demo-model', {
  llm: new DemoProvider(),
})

Development

From crates/bindings/enki-js:

yarn install
yarn build
yarn test

Useful scripts:

  • yarn build: build the native addon in release mode
  • yarn build:debug: build without release optimizations
  • yarn test: run the AVA test suite
  • yarn lint: run oxlint
  • yarn format: run Prettier, cargo fmt, and taplo format

Notes

  • Agent can register tools, memories, and custom LLM providers in JavaScript.
  • The default native constructor uses 20 max iterations when none is provided.
  • workspaceHome lets you control where the runtime creates and resolves workspace state.