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

@agentxjs/core

v2.9.0

Published

Core types, interfaces, and agent engine for the AgentX framework.

Readme

@agentxjs/core

Core types, interfaces, and agent engine for the AgentX framework.

You typically don't install this directly — it's pulled in as a dependency of agentxjs and platform/driver packages.

Architecture

Image  ──has──►  Session (message history)
  │
  ├──has──►  Workspace (file operations)
  │
  └──creates──►  Agent  ──uses──►  Driver (LLM communication)
                   │
                   └──runs on──►  Platform (DI container)

Key Concepts

| Concept | What it is | Analogy | |---------|-----------|---------| | Image | Persistent agent config (prompt, tools, workspace) | Docker image | | Session | Message history for an image | Conversation log | | Agent | Running instance of an image | Docker container | | Workspace | Agent's isolated working directory | Project folder | | Driver | LLM communication bridge | API client | | Platform | Infrastructure dependencies (DI container) | Runtime environment |

Sub-module Imports

import { ... } from "@agentxjs/core/agent";       // Agent engine
import { ... } from "@agentxjs/core/driver";       // Driver interface, ToolDefinition
import { ... } from "@agentxjs/core/platform";     // AgentXPlatform
import { ... } from "@agentxjs/core/runtime";      // AgentXRuntime
import { ... } from "@agentxjs/core/workspace";    // Workspace, WorkspaceProvider
import { ... } from "@agentxjs/core/image";        // Image management
import { ... } from "@agentxjs/core/session";      // Session management
import { ... } from "@agentxjs/core/event";        // EventBus
import { ... } from "@agentxjs/core/bash";         // BashProvider
import { ... } from "@agentxjs/core/persistence";  // Repository interfaces
import { ... } from "@agentxjs/core/network";      // JSON-RPC protocol
import { ... } from "@agentxjs/core/llm";          // LLM provider types

Runtime Operations

Three first-class operations on a running agent:

interface AgentXRuntime {
  // Send message → Driver → LLM → stream events
  receive(instanceId, content): Promise<void>;

  // Interrupt current response
  interrupt(instanceId): void;

  // Rewind to message — truncate session + reset circuit breaker + emit event
  rewind(instanceId, messageId): Promise<void>;
}

Platform (DI Container)

interface AgentXPlatform {
  // Required
  containerRepository: ContainerRepository;
  imageRepository: ImageRepository;
  sessionRepository: SessionRepository;
  eventBus: EventBus;

  // Optional
  bashProvider?: BashProvider;            // Shell execution
  workspaceProvider?: WorkspaceProvider;  // File operations per agent
  contextProvider?: ContextProvider;      // Cognitive context (e.g. RoleX)
  llmProviderRepository?: LLMProviderRepository;
  channelServer?: ChannelServer;          // WebSocket server
  channelClient?: ChannelClientFactory;   // WebSocket client
}

Workspace

Each Image auto-generates a workspaceId. When workspaceProvider is available, agents get 6 built-in file tools: read, write, edit, grep, glob, list.

interface Workspace {
  read(path, options?): Promise<string>;
  write(path, content): Promise<void>;
  exists(path): Promise<boolean>;
  stat(path): Promise<FileStat | null>;
  remove(path): Promise<void>;
  list(path?): Promise<FileEntry[]>;
  mkdir(path): Promise<void>;
}

interface WorkspaceProvider {
  create(workspaceId): Promise<Workspace>;
}

Driver

interface Driver {
  receive(message: UserMessage): AsyncIterable<DriverStreamEvent>;
  initialize(): Promise<void>;
  dispose(): Promise<void>;
  interrupt(): void;
  readonly supportedProtocols: readonly LLMProtocol[];
}

type CreateDriver = (config: DriverConfig) => Driver;

Dependencies: commonxjs, rxjs, jsonrpc-lite