@company-semantics/contracts

中文文档
124.1.0发布于 2026/10/27TypeScriptES Module近 30 天下载 2.3万

Shared semantic vocabulary across Company Semantics codebases.

原始使用文档
文档目录7 节
  1. Scope
  2. Usage
  3. What belongs here
  4. What does NOT belong here
  5. Package Format
  6. Versioning
  7. Releasing

@company-semantics/contracts

Shared semantic vocabulary across Company Semantics codebases.

Scope

This package intentionally contains only minimal shared vocabulary, not full domain models. Structural types live in individual codebases until they are proven stable.

Usage

import type {
  IntentCategory,
  InsightConfidence,
} from "@company-semantics/contracts";

What belongs here

  • Shared enums / unions (vocabulary)
  • Backend-aligned semantic categories

What does NOT belong here

  • Structural interfaces (Insight, SemanticFingerprint)
  • Frontend-only extensions
  • Implementation details

Package Format

This package intentionally exports TypeScript source. It does not emit .d.ts files. Consumers are expected to compile TS.

Versioning

Follows semver:

  • Additive vocabulary → minor bump
  • Renaming or removal → major bump

Releasing

Releases are published automatically via GitHub Actions.

Steps:

  1. npm version patch
  2. git push origin main --tags

Publishing locally is not supported.

版本与发布记录

@company-semantics/contracts 共发布 548 个版本,首次发布于 2025/12/20;过去 12 个月发布了 548 个版本。

版本发布日期距今
124.1.0latest2026/10/2714 天前
124.0.02026/10/2714 天前
123.3.02026/10/2714 天前
123.2.02026/10/2417 天前
123.1.02026/10/2317 天前
123.0.02026/10/2318 天前

关于 @company-semantics/contracts 的常见问题

@company-semantics/contracts 是什么?

Shared semantic vocabulary across Company Semantics codebases.

如何安装 @company-semantics/contracts?

在项目目录运行 npm install @company-semantics/contracts,或使用 pnpm add / yarn add / bun add。

@company-semantics/contracts 支持 TypeScript 吗?

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

@company-semantics/contracts 支持 ESM 还是 CommonJS?

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

@company-semantics/contracts 需要什么版本的 Node.js?

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

@company-semantics/contracts 可以商用吗?

@company-semantics/contracts 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@company-semantics/contracts 的下载量有多少?

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

@company-semantics/contracts 还在维护吗?

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