# @aurelienbbn/agentlint-plugin-effect 中文文档

规范地址：https://npmcn.com/package/%40aurelienbbn/agentlint-plugin-effect/

版本：0\.1\.5
npm 元数据更新时间：2026-10-14T14:03:06.177Z
中文译文更新时间：2026-11-07T05:36:58.084Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40aurelienbbn/agentlint-plugin-effect
原文对照：https://npmcn.com/package/%40aurelienbbn/agentlint-plugin-effect/?lang=original
项目主页：https://github.com/aurelienbobenrieth/harness/tree/main/packages/agentlint-plugin-effect#readme
源码仓库：https://github.com/aurelienbobenrieth/harness

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：52.1 kB，7 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- Node.js 要求：^22\.19\.0 \|\| ^24\.11\.0
- 运行依赖：0 个
- peer 依赖：@aurelienbbn/agentlint \>=0\.3\.0 \<0\.9\.0
- 首次发布：2026-09-25T10:27:00.350Z
- 最新版本发布：2026-10-14T14:03:05.829Z
- 近 30 天下载量：2280（2026-10-07 至 2026-11-05，npm 官方下载统计）
- 已发布版本数：6（近 12 个月 6 个）

## 中文简介

效果项目的自定义代理林特规则 .

## 安装

```sh
npm install @aurelienbbn/agentlint-plugin-effect
```

也可以使用：`pnpm add @aurelienbbn/agentlint-plugin-effect`、`yarn add @aurelienbbn/agentlint-plugin-effect`、`bun add @aurelienbbn/agentlint-plugin-effect`

## README

# @ aurelienbn/ agentlint- 插件效果

[![npm](https://img.shields.io/npm/v/@aurelienbbn/agentlint-plugin-effect)](https://www.npmjs.com/package/@aurelienbbn/agentlint-plugin-effect) [![downloads](https://img.shields.io/npm/dm/@aurelienbbn/agentlint-plugin-effect)](https://www.npmjs.com/package/@aurelienbbn/agentlint-plugin-effect) [![CI](https://github.com/aurelienbobenrieth/harness/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/aurelienbobenrieth/harness/actions/workflows/ci.yml) [![license](https://img.shields.io/npm/l/@aurelienbbn/agentlint-plugin-effect)](https://github.com/aurelienbobenrieth/harness/blob/main/packages/agentlint-plugin-effect/LICENSE) [![node](https://img.shields.io/node/v/@aurelienbbn/agentlint-plugin-effect)](https://github.com/aurelienbobenrieth/harness/blob/main/packages/agentlint-plugin-effect/package.json)

**3 Agentlint Results for Effect:Schema自有合同,有界回盘,层层已建成一次.**

> \[尖叫声\] 需要引擎 `@aurelienbbn/agentlint` `>=0.3.0 <0.9.0` 作为同伴. [证据](https://npmcn.com/package/docs/compatibility.md#agentlint-engine)。 。 。 .

## 快开始

```sh
agentlint init --preset "@aurelienbbn/agentlint-plugin-effect#starterPreset"
agentlint rules test
agentlint rules scan --review
agentlint next --format json
```

`init` 保存已有的配置并打印安装命令;从未安装. **要求前校正绑定 `agentlint check --all`。 。 。 .**

```ts
import { defineConfig } from "@aurelienbbn/agentlint";
import { layerIdentity, resiliencePolicy, strictPreset } from "@aurelienbbn/agentlint-plugin-effect";

export default defineConfig({ extends: [strictPreset], rules: [layerIdentity, resiliencePolicy] });
```

## 规则

| 规则 | 严格 | 启动 | 权力 | 标准折返 | 探测器 |
| --- | --- | :-: | --- | :-: | :-: |
| `prefer-schema-contracts` | ✅ | ✅ | 代理人 | 2个 | 2个 |
| `resilience-policy` | 🧪 |  | 代理人 | 1个 | 1个 |
| `layer-identity` | 🧪 |  | 代理人 | 1个 | 1个 |

在预设中 \\ \\ 选入, 明确注册 。 预设忽略 `**/*.d.ts`。 。 。 .

```ts
export interface User {
  id: string;
} // ❌ prefer-schema-contracts
export type User = (typeof User)["Type"]; // ✅ Schema-derived

Effect.tryPromise({ try: () => fetch(url), catch: toError }); // ❌ resilience-policy
Effect.tryPromise({ try: () => fetch(url), catch: toError }).pipe(Effect.timeout("2 seconds")); // ✅

const makeDbLayer = (config: DbConfig) => Layer.effect(Db, connect(config)); // ❌ layer-identity: new pool per call
const makeConfigLayer = (config: DbConfig) => Layer.succeed(Config, config); // ✅
```

`prefer-schema-contracts`:起火,无声拼写,来源

在导出接口和导出对象类型别名上起火,通过真实的解析器附加导出语句找到 。 内部编译时间界面和通用帮助者可能保持手动.

```ts
export type User = (typeof User)["Type"]; // ✅ silent
export type UserEncoded = typeof User.Encoded; // ✅ silent
export type User = Schema.Schema.Type<typeof User>; // ✅ silent
export type UserEncoded = Schema.Codec.Encoded<typeof User>; // ✅ silent
export interface User extends Schema.Schema.Type<typeof UserSchema> {} // ✅ silent
// also silent: typeof X["Encoded"], typeof X.Type
```

手动化名的修补:运行 `@effect/tsgo`是因为 `typeToEffectSchema`, (中文(简体) ), `typeToEffectSchemaClass`,或 `structuralTypeToSchema` (取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取.

拼写来源: 效果 4 Docs (`effect/ai-docs/src/01_effect/02_schema/10_schema-basics.ts` 内 `effect@4.0.0-rc.115`)获得类型 `typeof Contract["Type"]` 编号 : `typeof Contract["Encoded"]`; 点和 `Schema.Schema.Type<typeof Contract>` 拼写也得到承认.

`resilience-policy`: 触发和选项

| 着火了 | 安静 |
| --- | --- |
| 每个 `Effect.retry` 编号 : `Effect.retryOrElse` 调用 | 测试文件 |
| `Effect.tryPromise`, (中文(简体) ), `HttpClient.get|post|put|patch|del|head|options|execute` 电话 | 附加语句或函数显示超时或重试 |

```ts
request.pipe(Effect.retry(Schedule.exponential("100 millis"))); // ❌ fires: no bound
```

`defineResiliencePolicy({ outboundCallPattern })` 替换输出的呼叫模式。 双胞胎 `core/boundary-resilience`。 。 。 .

`layer-identity`: 触发和沉默情况

层被引用来纪念:一个在两个组成地被召唤的工厂建造了两个池. 函数、箭头和方法起火返回 a `Layer.*` 表达式。 静曰: `Layer.succeed`, (中文(简体) ), `Layer.empty`, (中文(简体) ), `Layer.fresh`, (中文(简体) ), `LayerMap` 检查,测试文件。 法官点了整个仓库的呼叫站点.

```ts
const tenants = LayerMap.make((tenant: string) => Layer.effect(Db, connect(tenant))); // ✅ silent
```
Agentlint规则合同

| 事实 | 细节 |
| --- | --- |
| 规则形状 | `lifecycle`, (中文(简体) ), `standard` (订正), `detector` (版本), `binding` (id, 权威, 范围, 实质性选项) |
| 编译 | `defineConfig({ extends: [preset] })` 或者说 `defineConfig({ rules: [configuredRule] })`; 重复使用需要不同的绑定标识 |
| 权力 | 默认允许代理接受;存储器所有者选择范围,并可以向 `human` |
| 接受结论 | 需要匹配当前证据 **财务报告和审定财务报表** 权力 |
| 固定装置 | `@aurelienbbn/agentlint/testing` 使用真实解析器运行嵌入式活性/静态固定装置 |

## 登记的合同库存

从软件包导出 `pnpm catalog`. 规则特定选项和限制在上文和源测试中都有描述.

| 规则/检查 | 触发或审查范围 |
| --- | --- |
| `layer-identity` | 旗子函数返回新建的图层,所以调用站点会被审查重复的资源构建. |
| `prefer-schema-contracts` | 旗子导出需要 Effect Schema 所有权的手工对象合同 . |
| `resilience-policy` | Flags Effect. retrieving policy and outmext Effect 调用时没有显示超时,因此只能对约束、紧张、可重复的上游和一能性进行审查. |

## 贷项

`starterPreset` 登机:由Peter O'Malley拆卸而来的概念灵感;没有复制代码或指南.

## 常见问题

### @aurelienbbn/agentlint-plugin-effect 是什么？

效果项目的自定义代理林特规则 \.

### 如何安装 @aurelienbbn/agentlint-plugin-effect？

在项目目录运行 npm install @aurelienbbn/agentlint-plugin-effect，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：@aurelienbbn/agentlint（\>=0\.3\.0 \<0\.9\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @aurelienbbn/agentlint-plugin-effect 支持 TypeScript 吗？

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

### @aurelienbbn/agentlint-plugin-effect 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @aurelienbbn/agentlint-plugin-effect 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js ^22\.19\.0 \|\| ^24\.11\.0。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @aurelienbbn/agentlint-plugin-effect 可以商用吗？

@aurelienbbn/agentlint-plugin-effect 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @aurelienbbn/agentlint-plugin-effect 的下载量有多少？

根据 npm 官方下载统计，@aurelienbbn/agentlint-plugin-effect 在 2026/10/07 – 2026/11/05 这 30 天内被下载 2,280 次，日均约 76 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @aurelienbbn/agentlint-plugin-effect 还在维护吗？

最新版本 0\.1\.5 发布于 2026/10/14（24 天前）；至今共发布 6 个版本，其中过去 12 个月发布了 6 个；首次发布于 2026/09/25。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

