@ briefcase-ai/ 控制
AI 引用的控制层:端口(配额、应享权利、痕量出口),
硬帽、配额和油门冷却
电话、建议管道、节流阀分类和重试帮助者,以及
决策记录出口商。 Bedrock 特定帮助者(模型-d分辨率,
能力探测器、定价、证书提供商) ./bedrock
子路径.
安装
npm install @briefcase-ai/controls
使用量
import { MemoryQuotaStore, createGateway } from "@briefcase-ai/controls";
const gateway = createGateway({
quotaStore: new MemoryQuotaStore(),
buckets: {
suggestions: { capacity: 10, refillSecondsPerToken: 60 },
},
});
const outcome = await gateway.invoke({
tenantId: "tenant-1",
bucket: "suggestions",
fn: () => callYourModel(),
});
if (outcome.ok) {
console.log(outcome.value, outcome.tokensRemaining);
} else {
console.log(outcome.reason, outcome.cooldownUntil);
}
MemoryQuotaStore 正在处理中; 生产商店执行 QuotaStore 端口 .
贝德洛克亚道
@briefcase-ai/controls/bedrock 输出型号分辨率, 反相
* 能力探测器、清单价格查询和记忆性证书提供商
@ai-sdk/amazon-bedrock 财务报告和审定财务报表 @aws-sdk/credential-providers 同行依赖关系
是可选的,只有证书提供者和适配者需要.
资料来源: https://github.com/briefcasebrain/briefcase-ai-sdk 互联网档案馆的存檔,存档日期2013-12-22
关于 @briefcase-ai/controls 的常见问题
@briefcase-ai/controls 是什么?
AI 援引控制:网关、配额、节流阀分类、重试、建议管道和决策记录出口商.
如何安装 @briefcase-ai/controls?
在项目目录运行 npm install @briefcase-ai/controls,或使用 pnpm add / yarn add / bun add。
@briefcase-ai/controls 支持 TypeScript 吗?
支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。
@briefcase-ai/controls 支持 ESM 还是 CommonJS?
以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。
@briefcase-ai/controls 需要什么版本的 Node.js?
package.json 的 engines 字段要求 Node.js >=20.19。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。
@briefcase-ai/controls 可以商用吗?
@briefcase-ai/controls 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。
@briefcase-ai/controls 的下载量有多少?
根据 npm 官方下载统计,@briefcase-ai/controls 在 2026/10/09 – 2026/11/07 这 30 天内被下载 14,361 次,日均约 479 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。
@briefcase-ai/controls 还在维护吗?
最新版本 4.4.0 发布于 2026/08/17(2 个月前);至今共发布 4 个版本,其中过去 12 个月发布了 4 个;首次发布于 2026/08/16。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。