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

@dev-mainsequence/command-center-ai

v0.0.5

Published

A chat for Main Sequence Agents: the connection to the platform, a session engine, the chat UI, and model provider settings, built on the Command Center SDK.

Readme

Command Center AI

Command Center AI as one independent package: everything an AI application needs to talk to the same backend Command Center talks to. It is independent of the Command Center application, not of the backend. See ADR 096.

The chat uses the assistant-ui front end (@assistant-ui/react): the engine runs an assistant-ui runtime against the platform and the Agent runtime, and the thread is built from assistant-ui's primitives, styled by the chat's stylesheet on the Command Center SDK's theme.

The Main Sequence AI application is its first consumer and imports it only through its public exports (src/index.ts).

What Is Here

  • src/backend/: the connection to the backend. Agent sessions, runtime access and readiness, the chat request, history, insights, cancel, model providers, agent icons, and the error helpers. See its README.
  • src/engine/: the session engine, ChatEngineProvider. It chooses or creates the session for an Agent, hydrates it, follows runtime access and readiness, holds the model selection, sends and cancels, and keeps the queue. See its README.
  • src/session-detail/: the AgentSession detail model and the hook that loads a session's detail and insights. See its README.
  • src/ui/: the chat UI, ChatThread, with AgentConnectingState and AgentIcon. See its README.
  • src/model-providers/: the model provider settings, ModelProviderSettings: custom providers, built-in provider sign-in, and the direct test conversation. See its README.
  • styles.css: the chat UI's stylesheet, exported as @dev-mainsequence/command-center-ai/styles.css.
  • standalone/: a minimal application that is nothing but the chat, built only on this package and the SDK, with standalone/stand-in/, a scripted stand-in for the platform and the Agent runtime. It is the proof of independence, the development bed, and the browser-test target.
  • scripts/check-boundary.mjs: the boundary check.
  • docs/: the package's decisions and guides.
  • agent_scaffold/skills/: the package's agent skills, and cli/, their installer. See Agent Skills.
  • CHANGELOG.md, LICENSE (Apache-2.0), and tsconfig.build.json: what the package needs to be published from this repository (SDK ADR 012).

Inputs

The package reads no environment variable and no configuration file. Whoever mounts it supplies:

  • the platform API base URL and, when the application is not served from an origin the platform allows, a request-URL rewrite (createChatBackendConnection);
  • how platform requests are sent: the application's sendPlatformRequest on the connection, which adds the person's credential and renews it. Authentication is the application's; see Connect to the platform;
  • the active Organization Environment and the signed-in user, where a call is scoped by them;
  • to the session engine, a notification callback, the view context of each request, whether the chat is on screen, and which session to show: a requested one, a default session behind a stable handle, or a launch target. The engine README lists them;
  • to the thread, its words, the signed-in person, and how to open the application's model provider settings. The UI README lists them;
  • to the model provider settings, the connection, the signed-in user, and a notification callback.

An application also loads the SDK's stylesheets and then this package's:

@import "@dev-mainsequence/command-center-sdk/theme/styles.css";
@import "@dev-mainsequence/command-center-sdk/styles.css";
@import "@dev-mainsequence/command-center-sdk/theme/markdown.css";
@import "@dev-mainsequence/command-center-ai/styles.css";

The Request-URL Rewrite

The platform API and the Agent's runtime answer browser requests only from the origins on their allow-lists. An application on another origin has two ways to reach them: the platform adds its origin, or the application forwards the calls through an address on its own origin. The package serves the second one:

const connection = createChatBackendConnection({
  apiBaseUrl: "https://api.example.com",
  rewriteRequestUrl: (url, target) =>
    target === "platform" ? `/__platform__${url.pathname}${url.search}` : url.toString(),
});

Every request the package makes passes through it, with target saying whether it goes to the platform API or to the Agent's runtime. Whether and when to rewrite is the application's decision.

Independence

  • Its own tsconfig.json: it does not extend the host's and defines no @/* path.
  • Its own Vite and Vitest configuration.
  • No dependency on an application package, no router, no host store, no import.meta.env in src/.
  • The Command Center SDK is its one Command Center dependency, as a peer, for its controls and theme (SDK ADR 012). The dependency goes one way only: the SDK depends on nothing of this package, and its general skills name it only to send an agent that needs AI capabilities here.
  • npm run check runs the boundary check, which fails on a dependency outside the allowlist, a peer (the SDK or React) listed as a regular dependency, an @/ import, an import that leaves the package, or an environment read, and then type-checks the package and the standalone application. It is part of the repository's check.

Agent Skills

The package ships eight agent skills in lanes, each with a human guide in docs/ (the map). general/use-command-center-ai is the way in: it installs the package, refreshes the skills, and routes to the focused skill; the right rail and the expanded rail are in ui/compose-command-center-ai-rail. The Command Center SDK's general skills send an agent here when an SDK application needs a chat or AI capabilities.

Installing the package installs the skills into .agents/skills/command-center-ai/ of the repository that runs npm install, the way the SDK installs its own into .agents/skills/command-center/. Install or refresh them explicitly with:

npx command-center-ai skills install --path . --dry-run
npx command-center-ai skills install --path .

The package owns .agents/skills/command-center-ai/ alone: every install prunes what it does not ship and records the package version in PINNED_FROM.txt, and no other namespace is touched. See the agent scaffold and the CLI.

Commands

From the repository root:

npm run ai:check
npm run ai:test
npm run ai:build
npm run ai:dev

ai:check runs the boundary check and the SDK's theme audit over the stylesheet, and type-checks the package, its NodeNext library build, and the standalone application. ai:build builds the library into dist/ with tsc; npm --workspace @dev-mainsequence/command-center-ai run build:standalone bundles the standalone application into standalone/dist/. npm --workspace @dev-mainsequence/command-center-ai run test:browser runs the standalone application on the stand-in in Chromium with Playwright (tests/browser/): it connects, sends a message and watches the reply stream in, and opens the model provider settings.

ai:dev serves the standalone application on port 5183. Open /?stand-in to run it on the scripted stand-in, with no platform and no token. To reach a platform that does not allow that origin, put the platform API URL in command-center-ai/.env.local:

VITE_CHAT_API_BASE_URL=https://platform.example.com

The dev server then forwards /__platform__ to it, and the application's connection points platform requests there (standalone/connection.ts).