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

cdk-agent-broker

v0.0.3

Published

AWS CDK constructs library for Agent Broker

Readme

cdk-agent-broker

AWS CDK constructs library for deploying Agent Broker on AWS ECS Fargate.

Architecture
┌───────────────────────────────────────────────────────────────────┐
│  AWS Cloud                                                        │
│                                                                   │
│  ┌─────────────────────────────────────────────────────────────┐  │
│  │  VPC (default: 10.168.0.0/16)                               │  │
│  │                                                             │  │
│  │  ┌───────────────────────────────────────────────────────┐  │  │
│  │  │  Public Subnet                                        │  │  │
│  │  │                                                       │  │  │
│  │  │  ┌─────────────────────────────────────────────────┐  │  │  │
│  │  │  │  ECS Cluster                                    │  │  │  │
│  │  │  │                                                 │  │  │  │
│  │  │  │  ┌───────────────────────────────────────────┐  │  │  │  │
│  │  │  │  │  Fargate Service (FARGATE_SPOT | FARGATE) │  │  │  │  │
│  │  │  │  │                                           │  │  │  │  │
│  │  │  │  │  ┌───────────┐  ┌──────────────────────┐  │  │  │  │  │
│  │  │  │  │  │ data-init │─▶│  app container       │  │  │  │  │  │
│  │  │  │  │  │ (S3 pull) │  │  (port 80)           │  │  │  │  │  │
│  │  │  │  │  └───────────┘  └──────────┬───────────┘  │  │  │  │  │
│  │  │  │  │                            │ stops        │  │  │  │  │
│  │  │  │  │                            ▼              │  │  │  │  │
│  │  │  │  │                 ┌───────────────────────┐ │  │  │  │  │
│  │  │  │  │                 │ data-backup (sidecar) │ │  │  │  │  │
│  │  │  │  │                 │ S3 sync on app stop   | │  │  │  │  │
│  │  │  │  │                 └───────────────────────│ │  │  │  │  |
│  │  │  │  └───────────────────────────────────────────┘  │  │  │  │
│  │  │  └─────────────────────────────────────────────────┘  │  │  │
│  │  └───────────────────────────────────────────────────────┘  │  │
│  └─────────────────────────────────────────────────────────────┘  │
│                                                                   │
│  ┌──────────────────┐    ┌──────────────────┐                     │
│  │  S3 (config      │    │  S3 (data        │                     │
│  │  asset)          │    │  bucket)         │                     │
│  │  config.toml     │    │  /home/agent     │                     │
│  └──────────────────┘    └──────────────────┘                     │
└───────────────────────────────────────────────────────────────────┘
Install
# npm
npm install cdk-agent-broker

# pip
pip install cdk-agent-broker
Usage
import { AgentBroker } from 'cdk-agent-broker';

new AgentBroker(this, 'Broker', {
  configPath: './config.toml',  // required: path to your local config.toml
});

// With custom settings
new AgentBroker(this, 'Broker', {
  cpu: 2048,
  memoryLimitMiB: 4096,
  dataS3Prefix: 'my-agent-data',
  configPath: './config.toml',
});
Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | vpc | ec2.IVpc | New VPC (public subnet) | 自訂 VPC | | vpcCidr | string | 10.168.0.0/16 | 新建 VPC 的 CIDR | | image | ecs.ContainerImage | ghcr.io/thepagent/agent-broker:dd7e1ca | Container image | | memoryLimitMiB | number | 4096 | Task memory (MiB) | | cpu | number | 2048 | Task CPU units | | assignPublicIp | boolean | true | 是否分配 public IP | | enableFargateSpot | boolean | true | 啟用 FARGATE_SPOT | | dataBucket | s3.IBucket | 自動建立 | 持久化資料用的 S3 bucket | | dataS3Prefix | string | agent-data | S3 資料前綴 | | dataLocalPath | string | /home/agent | 資料掛載路徑 | | configPath | string | 必填 | 本地 config.toml 路徑,透過 S3 init container 掛載到 /etc/agent-broker/config.toml |

Exposed Resources

AgentBroker construct 暴露以下屬性,方便後續串接:

  • broker.vpc — VPC
  • broker.cluster — ECS Cluster
  • broker.service — Fargate Service
  • broker.dataBucket — 持久化資料 S3 Bucket
Container Flow
  1. data-init (init container):從 S3 data bucket 還原 /home/agent 資料,並從 S3 asset 下載 config.toml
  2. app:主應用容器,等待 init 完成後啟動,掛載資料目錄(read-write)和 config(read-only)
  3. data-backup (sidecar):每 10 分鐘定期將 /home/agent sync 到 S3 data bucket,並在收到 SIGTERM(app 停止)時執行最後一次備份