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

@axiom-lattice/gateway

v2.1.28

Published

API Gateway for LangGraph agent-based applications

Readme

Lattice Gateway

这是 Lattice 项目的 API 网关服务,提供了基于 Fastify 的 HTTP API 接口,用于与 Lattice Core 交互。

功能特点

  • 基于 Fastify 的 HTTP API
  • 代理调用服务
  • 流式响应支持
  • 事件总线
  • 队列服务(基于 QueueLattice)
  • 日志服务(基于 LoggerLattice,支持自定义配置)

安装

pnpm install

启动服务

# 开发环境
pnpm dev

# 生产环境
pnpm build
pnpm start

API 接口

Configuration API

The gateway supports dynamic configuration updates via JSON. You can update environment variables at runtime without restarting the server.

Get Configuration

GET /api/config

Returns the current configuration (sensitive values are masked).

Update Configuration

PUT /api/config
Content-Type: application/json

{
  "config": {
    "port": 4001,
    "queueServiceType": "redis",
    "redisUrl": "redis://localhost:6379",
    "redisPassword": "your-password",
    "queueName": "tasks"
  }
}

Note: When updating queueServiceType, the queue service will be automatically reconfigured.

Example:

// Update configuration from frontend
const response = await fetch("http://localhost:4001/api/config", {
  method: "PUT",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    config: {
      queueServiceType: "redis",
      redisUrl: "redis://localhost:6379",
      redisPassword: "your-password",
    },
  }),
});

const result = await response.json();
console.log(result); // { success: true, message: "Configuration updated successfully", data: {...} }

代理调用

  • POST /api/v1/run: 运行代理
  • POST /api/v1/run/stream: 流式运行代理
  • GET /api/v1/run/:thread_id: 获取运行状态
  • GET /api/v1/run/:thread_id/messages: 获取消息历史

Logger 配置

Gateway 使用 Logger Lattice 进行日志管理,支持自定义日志配置。详细说明请参考 LOGGER_CONFIG.md

快速开始

import { LatticeGateway } from "@axiom-lattice/gateway";
import { LoggerType } from "@axiom-lattice/protocols";

// 使用默认配置
LatticeGateway.startAsHttpEndpoint({
  port: 4001,
});

// 自定义日志配置
LatticeGateway.startAsHttpEndpoint({
  port: 4001,
  loggerConfig: {
    file: "./logs/my-app/gateway",
    serviceName: "my-service",
  },
});

目录结构

  • src/config/: 配置文件
  • src/controllers/: 控制器
  • src/routes/: 路由定义
  • src/services/: 服务实现
  • src/types/: 类型定义
  • LOGGER_CONFIG.md: Logger 配置详细文档