@antiphony/shared

中文文档
0.13.0发布于 2026/11/03MITTypeScriptESM + CJS零依赖构建来源已验证近 30 天下载 2019

Shared types, Zod schemas, and codecs for Antiphony — open audio call-and-response infrastructure and AT Protocol lexicons.

原始使用文档
文档目录5 节
  1. Install
  2. Dual ESM/CJS
  3. Exports
  4. The records this models
  5. License

@antiphony/shared

Shared types, Zod schemas, and request/response codecs for Antiphony — open infrastructure and an AT Protocol lexicon for audio call-and-response.

This is the contract package: the same Zod schemas that validate the wire format in apps/core-api, mirror the dev.antiphony.* lexicons, and type any client built on the public API. If you're building against Antiphony, this is what you import.

Docs: https://docs.antiphony.dev — start with the lexicons.

Install

npm install @antiphony/shared zod

zod is the only runtime dependency and the peer of every validation schema.

Dual ESM/CJS

Ships both ESM and CommonJS builds with correct type resolution under node16/nodenext and bundlers (verified with @arethetypeswrong/cli). import and require both resolve to the right artifact.

Exports

import { AudioPostRecordSchema, AudioPostViewSchema } from '@antiphony/shared';

The root re-exports the most-used pieces (audio records + views, codecs, NSIDs, errors, utils, observability). Granular subpaths are available too:

SubpathWhat's in it
@antiphony/sharedThe common surface: audio records + views, api-codecs, nsid, errors, utils, observability.
@antiphony/shared/api-codecsRequest/response Zod codecs for the REST surface.
@antiphony/shared/nsidThe dev.antiphony.* NSID constants.
@antiphony/shared/errorsShared error types and helpers.
@antiphony/shared/utilsPure shared utilities (projection/date/sanitization helpers).
@antiphony/shared/observabilityLogging/error-reporting helpers (./observability/report-error for just the reporter).
@antiphony/shared/types/*Individual type modules: audio, blob, dids, processing, records, remote-posts, spaces, url.

The records this models

  • dev.antiphony.audio.post — the single canonical content record. A post without a reply is a prompt; with a reply it's a reply.
  • dev.antiphony.embed.audio — the audio attachment (stored record + hydrated view with a playback URL through the core's audio proxy).
  • dev.antiphony.audio.transcript — platform-enrichment transcript, lifted into the embed view at read time.
  • dev.antiphony.actor.profile — the portable actor-profile shape. Lexicon-only: the core never stores it; the calling app owns profile data.

A stored post may also carry a space placement (SpacePlacementSchema in types/spaces: space type, space key and author segment), when it lives in an atproto space rather than flat. It is storage-layer, like originAppId: not in the lexicon, not in the record CID, and visible only through the post's at:// URI. See specs/spaces.md.

See the lexicon reference for the full contract.

License

MIT

版本与发布记录

@antiphony/shared 共发布 15 个版本,首次发布于 2026/06/28;过去 12 个月发布了 15 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.13.0latest2026/11/034 天前
0.12.02026/11/025 天前
0.11.02026/11/025 天前
0.10.02026/10/2910 天前
0.9.22026/10/2216 天前
0.9.12026/10/1920 天前

关于 @antiphony/shared 的常见问题

@antiphony/shared 是什么?

Shared types, Zod schemas, and codecs for Antiphony — open audio call-and-response infrastructure and AT Protocol lexicons.

如何安装 @antiphony/shared?

在项目目录运行 npm install @antiphony/shared,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:zod(^4.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@antiphony/shared 支持 TypeScript 吗?

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

@antiphony/shared 支持 ESM 还是 CommonJS?

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

@antiphony/shared 可以商用吗?

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

@antiphony/shared 的下载量有多少?

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

@antiphony/shared 还在维护吗?

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