PHPackages                             automattic/jetpack-agents-manager - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. automattic/jetpack-agents-manager

ActiveJetpack-library[Utility &amp; Helpers](/categories/utility)

automattic/jetpack-agents-manager
=================================

Shared AI infrastructure helpers for Automattic plugins

v0.8.0(2w ago)02.2k↑438.9%2GPL-2.0-or-laterPHPPHP &gt;=7.2CI passing

Since Jun 2Pushed 2w agoCompare

[ Source](https://github.com/Automattic/jetpack-agents-manager)[ Packagist](https://packagist.org/packages/automattic/jetpack-agents-manager)[ RSS](/packages/automattic-jetpack-agents-manager/feed)WikiDiscussions trunk Synced 1w ago

READMEChangelog (10)Dependencies (26)Versions (16)Used By (2)

Agents Manager
==============

[](#agents-manager)

The Agents Manager provides REST API endpoints for managing AI agent-related state and preferences for WordPress.com users.

This feature is loaded for WordPress.com-connected users via the `load_wpcom_user_features()` method in `Jetpack_Mu_Wpcom`.

Otherwise, you can load it by installing the `@automattic/jetpack-agents-manager` Composer package and instantiate it by calling the `Agents_Manager::init()` method. Example:

```
use Automattic\Jetpack\Agents_Manager\Agents_Manager;

add_action( 'plugins_loaded', array( Agents_Manager::class, 'init' ) );
```

Features
--------

[](#features)

- Persisted open state management via REST API
- Router history cleanup to prevent preference bloat

REST API Endpoints
------------------

[](#rest-api-endpoints)

### Open State

[](#open-state)

**Namespace:** `agents-manager`**Route:** `/open-state`

#### GET `/wp-json/agents-manager/open-state`

[](#get-wp-jsonagents-manageropen-state)

Retrieves the current agents manager state from user preferences.

**Response:**

```
{
  "calypso_preferences": {
    "agents_manager_open": true,
    "agents_manager_docked": false,
    "agents_manager_floating_position": "right",
    "agents_manager_router_history": { ... }
  }
}
```

#### POST `/wp-json/agents-manager/open-state`

[](#post-wp-jsonagents-manageropen-state)

Updates the agents manager state in user preferences.

**Request body:**

```
{
  "agents_manager_open": true,
  "agents_manager_docked": false,
  "agents_manager_floating_position": "left",
  "agents_manager_router_history": { ... }
}
```

All parameters are optional; only provided parameters will be updated.

### Jetpack AI JWT

[](#jetpack-ai-jwt)

**Namespace:** `jetpack/v4`**Route:** `/jetpack-ai-jwt`

#### POST `/wp-json/jetpack/v4/jetpack-ai-jwt`

[](#post-wp-jsonjetpackv4jetpack-ai-jwt)

Requests a JWT token from WordPress.com that AI assistants use to authenticate OpenAI completion requests. This endpoint is required by plugins that embed AI assistants (such as Woo AI), so it is registered here to make it available independently of the Jetpack or My Jetpack plugins.

If the endpoint is already registered (for example, by the Jetpack plugin), the Agents Manager will not register it again to avoid duplicate registration.

**Permissions:** The user must have a connected Jetpack user account and the `edit_posts` capability.

**Response:**

```
{
  "token": "...",
  "blog_id": 12345
}
```

Router History Cleanup
----------------------

[](#router-history-cleanup)

The Agents Manager automatically limits router history entries to 50 via the `calypso_preferences_update` filter. When the limit is exceeded, it keeps the last 49 entries and prepends a root entry to ensure the back button always works.

Using this package in your WordPress plugin
-------------------------------------------

[](#using-this-package-in-your-wordpress-plugin)

If you plan on using this package in your WordPress plugin, we would recommend that you use [Jetpack Autoloader](https://packagist.org/packages/automattic/jetpack-autoloader) as your autoloader. This will allow for maximum interoperability with other plugins that use this package as well.

Security
--------

[](#security)

Need to report a security vulnerability? Go to  or directly to our security bug bounty site .

License
-------

[](#license)

agents-manager is licensed under [GNU General Public License v2 (or later)](./LICENSE.txt)

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance97

Actively maintained with recent releases

Popularity23

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 Bus Factor3

3 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

14

Last Release

15d ago

PHP version history (2 changes)v0.1.0PHP &gt;=7.4

v0.3.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c5869ecbb8e0eac7e8b8e0f3cf7bdd8d5fcdc4abc10a72281872c53f8639d44?d=identicon)[automattic](/maintainers/automattic)

---

Top Contributors

[![zaguiini](https://avatars.githubusercontent.com/u/26530524?v=4)](https://github.com/zaguiini "zaguiini (12 commits)")[![anomiex](https://avatars.githubusercontent.com/u/1030580?v=4)](https://github.com/anomiex "anomiex (11 commits)")[![bindlegirl](https://avatars.githubusercontent.com/u/1242807?v=4)](https://github.com/bindlegirl "bindlegirl (6 commits)")[![wellyshen](https://avatars.githubusercontent.com/u/21308003?v=4)](https://github.com/wellyshen "wellyshen (6 commits)")[![robertsreberski](https://avatars.githubusercontent.com/u/8419292?v=4)](https://github.com/robertsreberski "robertsreberski (5 commits)")[![tbradsha](https://avatars.githubusercontent.com/u/32492176?v=4)](https://github.com/tbradsha "tbradsha (5 commits)")[![manzoorwanijk](https://avatars.githubusercontent.com/u/18226415?v=4)](https://github.com/manzoorwanijk "manzoorwanijk (4 commits)")[![kraftbj](https://avatars.githubusercontent.com/u/88897?v=4)](https://github.com/kraftbj "kraftbj (3 commits)")[![LiamSarsfield](https://avatars.githubusercontent.com/u/43409125?v=4)](https://github.com/LiamSarsfield "LiamSarsfield (2 commits)")[![angelablake](https://avatars.githubusercontent.com/u/35241639?v=4)](https://github.com/angelablake "angelablake (1 commits)")[![t-wright](https://avatars.githubusercontent.com/u/4177859?v=4)](https://github.com/t-wright "t-wright (1 commits)")[![vianasw](https://avatars.githubusercontent.com/u/298685?v=4)](https://github.com/vianasw "vianasw (1 commits)")[![jom](https://avatars.githubusercontent.com/u/68693?v=4)](https://github.com/jom "jom (1 commits)")

### Embed Badge

![Health badge](/badges/automattic-jetpack-agents-manager/health.svg)

```
[![Health](https://phpackages.com/badges/automattic-jetpack-agents-manager/health.svg)](https://phpackages.com/packages/automattic-jetpack-agents-manager)
```

###  Alternatives

[automattic/jetpack

Jetpack supercharges your self‑hosted WordPress site with the awesome cloud power of WordPress.com

3622.8k](/packages/automattic-jetpack)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
