# @atcute/ozone 中文文档

规范地址：https://npmcn.com/package/%40atcute/ozone/

版本：4\.0\.14
npm 元数据更新时间：2026-10-27T01:56:40.361Z
中文译文更新时间：2026-11-07T01:54:06.137Z
软件包许可：0BSD

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

原始 npm 页面：https://www.npmjs.com/package/%40atcute/ozone
原文对照：https://npmcn.com/package/%40atcute/ozone/?lang=original
源码仓库：https://tangled.org/did:plc:pljn5qch4tgadongtc7i6qij

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

- 包体积（解压后）：512 kB，193 个文件
- 模块格式：ES Module
- TypeScript 类型：未声明
- 运行依赖：3 个
- peer 依赖：@atcute/lexicons ^2\.0\.0
- 首次发布：2024-09-02T04:29:02.153Z
- 最新版本发布：2026-10-27T01:56:40.180Z
- 近 30 天下载量：3272（2026-10-07 至 2026-11-05，npm 官方下载统计）
- 已发布版本数：47（近 12 个月 19 个）

## 中文简介

臭氧(工具.ozone.\*)

## 安装

```sh
npm install @atcute/ozone
```

也可以使用：`pnpm add @atcute/ozone`、`yarn add @atcute/ozone`、`bun add @atcute/ozone`

## README

# @ atcute/ 分区

[臭氧](https://ozone.tools/) (tools.ozone.\*) 计划定义

```sh
npm install @atcute/ozone
```

## 使用量

```ts
import { is, type $type } from '@atcute/lexicons';
import { ToolsOzoneModerationDefs } from '@atcute/ozone';

type LabelEvent = $type.enforce<ToolsOzoneModerationDefs.ModEventLabel>;

const evt: LabelEvent = {
    $type: 'tools.ozone.moderation.defs#modEventLabel',
    createLabelVals: ['awesome'],
    negateLabelVals: [],
};

is(ToolsOzoneModerationDefs.modEventLabelSchema, evt);
// -> true
```

### 与 `@atcute/client`

选择这3个选项之一来登记环境声明

```jsonc
// tsconfig.json
{
    "compilerOptions": {
        "types": ["@atcute/ozone"],
    },
}
```

```ts
// env.d.ts
/// <reference types="@atcute/ozone" />
```

```ts
// index.ts
import type {} from '@atcute/ozone';
```

现在所有 XRPC 操作都应该在客户端可见

```ts
import { Client, simpleFetchHandler } from '@atcute/client';

const client = new Client({
    handler: simpleFetchHandler({ service: 'https://mod.example.com' }),
});

const response = await client.post('tools.ozone.moderation.emitEvent', {
    input: {
        createdBy: 'did:plc:ia76kvnndjutgedggx2ibrem',
        subject: {
            $type: 'com.atproto.repo.strongRef',
            uri: 'at://did:plc:ia76kvnndjutgedggx2ibrem/app.bsky.feed.post/3l6uo5yecnsu7',
            cid: 'bafyreibluyqpqno2ixrhdkztquyarpug7k6t4en6ug7g3sw6fonzzmakbq',
        },
        event: {
            $type: 'tools.ozone.moderation.defs#modEventLabel',
            createLabelVals: ['awesome'],
            negateLabelVals: [],
        },
    },
});
// ...
```

### 与 `@atcute/lex-cli`

创建参考臭氧类型的词汇表时,请配置 lex-cli 从此导入 软件包 :

```ts
// file: lex.config.js
import { defineLexiconConfig } from '@atcute/lex-cli';

export default defineLexiconConfig({
    files: ['lexicons/**/*.json'],
    outdir: 'src/lexicons/',
    imports: ['@atcute/ozone'],
});
```

## 常见问题

### @atcute/ozone 是什么？

臭氧\(工具\.ozone\.\*\)

### 如何安装 @atcute/ozone？

在项目目录运行 npm install @atcute/ozone，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：@atcute/lexicons（^2\.0\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @atcute/ozone 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/atcute\_\_ozone 是否存在。

### @atcute/ozone 支持 ESM 还是 CommonJS？

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

### @atcute/ozone 可以商用吗？

@atcute/ozone 使用 0BSD 许可。几乎没有限制：可自由使用、修改和分发，连保留版权声明也不要求。以上为概括，不构成法律意见，请以许可原文为准。

### @atcute/ozone 的下载量有多少？

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

### @atcute/ozone 还在维护吗？

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

