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

@agent-os-lab/agent-game-sdk

v0.2.1

Published

Embeddable agent game views, avatars, and Game-owned Office contracts. The package is independently installable:

Downloads

199

Readme

Agent Game SDK

Embeddable agent game views, avatars, and Game-owned Office contracts. The package is independently installable:

bun add @agent-os-lab/agent-game-sdk

Game owns AgentGameOfficeConfig, AgentGameAgentInput, and AgentGameAgentSource. The application owns persistence and explicitly supplies Office configuration and agent data. Game root exports only Game APIs; Runtime clients, messages, Presence types, and list helpers must be imported from the Runtime package.

Compose Runtime with Game

import {
  AgentGameRuntimeBrowserClient,
  subscribeAgentPresenceList,
  type AgentPresence,
} from "@agent-os-lab/agent-game-runtime-sdk";
import {
  mountAgentGameOffice,
  type AgentGameAgentInput,
  type AgentGameAgentSource,
  type AgentGameOfficeConfig,
} from "@agent-os-lab/agent-game-sdk/office";

function mapPresence(agent: AgentPresence): AgentGameAgentInput {
  return {
    id: agent.agentId,
    name: agent.displayName,
    status: agent.status,
    role: agent.scene ?? null,
    activity: agent.activity,
    interaction: agent.interaction,
    updatedAt: agent.updatedAt,
  };
}

function createAgentSource(client: AgentGameRuntimeBrowserClient): AgentGameAgentSource {
  let subscription: Awaited<ReturnType<typeof subscribeAgentPresenceList>> | undefined;
  return {
    subscribe(listener) {
      let active = true;
      void subscribeAgentPresenceList(client, {
        onAgentsChange: (agents) => listener(agents.map(mapPresence)),
      }).then((value) => {
        if (!active) {
          value.close();
          return;
        }
        subscription = value;
      });
      return () => {
        active = false;
        subscription?.close();
        subscription = undefined;
      };
    },
    refresh: () => subscription?.refresh(),
  };
}

const office: AgentGameOfficeConfig = {
  building: {
    floors: [{ id: "floor-1", name: "Main", rooms: [{ type: "office" }] }],
    connectors: [],
  },
};

const client = new AgentGameRuntimeBrowserClient({ baseUrl: "" });
const source = createAgentSource(client);
const view = await mountAgentGameOffice(container, {
  renderer: "three",
  office,
  source: { type: "agents", source },
});

view.selectAgent("agent-1");
view.resetCamera();

The mapper is intentionally application-owned. It is where transport meaning becomes game meaning; AgentPresence is not accepted directly as AgentGameAgentInput.

Office configuration and persistence

AgentGameOfficeConfig describes Game-owned floors, rooms, connectors, and layout. The application owns persistence: load it explicitly through an application BFF or trusted AgentOS client, validate it, then pass it to Game. Save editor changes explicitly through the same application boundary. Runtime has no Office configuration API.

If office is omitted, Game uses its built-in default configuration. It does not load persisted configuration automatically.

AgentOS persistence may return source: "none" with config: null when neither a tenant override nor a stored platform default exists. Applications that want this local Game default should omit office or select DEFAULT_OFFICE_CONFIG explicitly; the server no longer returns Game's code-built default.

OfficeBuildingCanvas, mountOfficeBuildingCanvas, and getOfficeFloors provide building-only rendering and floor metadata. Controllers support a Reset view action through view.resetCamera().

Avatar views

import {
  mountAgentAvatarCanvas,
  mountAgentAvatar3D,
  renderAgentAvatar3DThumbnailBatch,
} from "@agent-os-lab/agent-game-sdk/avatar";

const avatar = mountAgentAvatar3D(container, {
  agentId: "agent-1",
  backgroundColor: "#f8fafc",
  framing: "upperBody",
  viewAngle: "front",
});

Use mountAgentAvatarCanvas for pixel sprites and renderAgentAvatar3DThumbnailBatch for efficient lists.

Breaking changes

  • Game root no longer re-exports Runtime APIs; import them from @agent-os-lab/agent-game-runtime-sdk.
  • Runtime client source was removed; use { type: "agents", source } with an AgentGameAgentSource.
  • Runtime AgentPresence must be explicitly mapped to AgentGameAgentInput.
  • Office configuration is no longer loaded automatically. Applications explicitly load, pass, and persist AgentGameOfficeConfig.
  • 0.2.0: AgentOS empty persistence is distinct from Game's local default; handle source: "none" instead of assuming a server configuration always exists.

See USAGE.md for source variants, React, avatars, and persistence composition.