@axiom-lattice/gateway

中文文档
10.1.1发布于 2026/11/03ISCTypeScriptESM + CJS近 30 天下载 4459

LangGraph 代理应用程序的 API 网关

中文使用文档
文档目录5 节
  1. 存储消费
  2. 如何运作
  3. 快速启动
  4. 锁定配置
  5. API 终点

@axiom-lattice/出道

基于快取的HTTP API网关将 REST 端点曝光,用于代理执行,线程管理和配置.

存储消费

网关读取所有商店 StoreLatticeManager 启动时——不需要手动接线. 通过 configureStores 在此之前 电话 startAsHttpEndpoint()数字 :

import { configureStores } from "@axiom-lattice/core";
import { createPgStoreConfig } from "@axiom-lattice/pg-stores";
import { LatticeGateway } from "@axiom-lattice/gateway";

const stores = createPgStoreConfig(process.env.DATABASE_URL);
await configureStores({ ...stores });

// Gateway picks up stores from StoreLatticeManager automatically
LatticeGateway.startAsHttpEndpoint({ port: 4001 });

如何运作

网关内部呼叫 getStoreLattice("default", type) 对于它需要的每个商店:

  • channelBinding 用于 MessageRouter 对发送方至代理方具有约束力的决议
  • channelInstallation 用于频道实例搜索
  • database —— 说 SqlDatabaseManager 在第一个查询中读取空格
  • metrics —— 说 MetricsServerManager 第一个访问时装入配置
  • 其他用品 控制器通过 getStoreLattice("default", type)

没有 setConfigStore() 或者说 loadConfigsFromStore() 需要的电话——每个管理者直接从 StoreLatticeManager。 。 。 .

快速启动

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

LatticeGateway.startAsHttpEndpoint({
  port: 4001,
});

锁定配置

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

LatticeGateway.startAsHttpEndpoint({
  port: 4001,
  loggerConfig: {
    name: "default",
    type: LoggerType.PINO,
    serviceName: "my-service",
  },
});

API 终点

  • POST /api/v1/run - 执行机构
  • POST /api/v1/run/stream - 流出代理人执行
  • GET /api/v1/run/:thread_id - 获取运行状态
  • GET /api/v1/run/:thread_id/messages ——获取消息历史

版本与发布记录

@axiom-lattice/gateway 共发布 219 个版本,首次发布于 2025/09/01;过去 12 个月发布了 194 个版本。

版本发布日期距今
10.1.1latest2026/11/034 天前
10.1.02026/11/034 天前
10.0.12026/11/025 天前
10.0.02026/10/317 天前
9.0.02026/10/299 天前
8.4.02026/10/2810 天前

其他发布通道:hotfix → 2.1.20-hotfix.0。

关于 @axiom-lattice/gateway 的常见问题

@axiom-lattice/gateway 是什么?

LangGraph 代理应用程序的 API 网关

如何安装 @axiom-lattice/gateway?

在项目目录运行 npm install @axiom-lattice/gateway,或使用 pnpm add / yarn add / bun add。

@axiom-lattice/gateway 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@axiom-lattice/gateway 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@axiom-lattice/gateway 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20.10.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@axiom-lattice/gateway 可以商用吗?

@axiom-lattice/gateway 使用 ISC 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@axiom-lattice/gateway 的下载量有多少?

根据 npm 官方下载统计,@axiom-lattice/gateway 在 2026/10/08 – 2026/11/06 这 30 天内被下载 4,459 次,日均约 149 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@axiom-lattice/gateway 还在维护吗?

最新版本 10.1.1 发布于 2026/11/03(4 天前);至今共发布 219 个版本,其中过去 12 个月发布了 194 个;首次发布于 2025/09/01。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。