@ectropy/schemas

中文文档
0.4.0发布于 2026/04/24Apache-2.0TypeScriptES Module零依赖近 30 天下载 9283

Ectropy schema definitions — voxel, decision, authority, federation. Consumed by @ectropy-ai/core and Ectropy-Business.

原始使用文档
文档目录6 节
  1. Scope
  2. Schemas
  3. Using the package
  4. Versioning
  5. Changing the standard
  6. License

Ectropy open standard

JSON Schemas (draft-07) for construction project data: voxels and voxel groups, project decisions, inspections and participants, resource status and pose, jobsite material, equipment, robot and labour-time intake, logistic units, waste streams, carbon reports, and the payroll edge.

  • Served: every schema at its $id under https://schemas.ectropy.ai/. index.json lists them.
  • Packaged: npm install @ectropy/schemas installs the schemas and TypeScript types generated from them, published from this repository with npm provenance.

This repository is the only source of both.

Scope

Interchange shapes only: how a record is structured for storage and exchange. A schema is here only when it has been named public. Algorithms, scoring and routing logic are not in this repository.

Schemas

PathTitleVersion
_definitions/urn.schema.jsonEctropy URN1.0.0
flow/carbon-report.schema.jsonCarbon Report0.2.0
flow/flow-common.schema.jsonJobsite Flow Common Definitions0.3.0
flow/intake/bag-pointer.schema.jsonRobot Recording Pointer0.3.0
flow/intake/equipment-intake.schema.jsonEquipment Intake (ESx)0.2.0
flow/intake/inspection-intake.schema.jsonInspection Intake (ISx)0.2.0
flow/intake/labor-time-intake.schema.jsonLabour Time Intake (HSx)0.3.0
flow/intake/material-intake.schema.jsonMaterial Intake (MSx)0.2.0
flow/intake/robot-intake.schema.jsonRobot Intake (RSx)0.2.0
flow/logistic-unit.schema.jsonLogistic Unit0.2.0
flow/tag-binding.schema.jsonTag Binding0.2.0
flow/vendor-price-submission.schema.jsonVendor Price Submission0.2.0
flow/waste-stream.schema.jsonWaste Stream0.2.0
payroll/compliance-report.schema.jsonPayroll Compliance Report0.2.0
payroll/identity-vault-boundary.schema.jsonIdentity Vault Boundary0.2.0
payroll/pay-period.schema.jsonPay Period0.2.0
payroll/pay-rule-set.schema.jsonPay Rule Set0.2.0
payroll/payroll-export.schema.jsonPayroll Export0.2.0
pm/consequence.schema.jsonConsequence Schema2.0.0
pm/decision.schema.jsonPM Decision Schema2.0.0
pm/inspection.schema.jsonInspection Schema2.0.0
pm/participant.schema.jsonParticipant Schema2.0.0
pm/schedule-proposal.schema.jsonSchedule Proposal Schema2.0.0
resource/resource-pose.schema.jsonResource Pose Schema2.0.0
resource/resource-status.schema.jsonResource Status Schema2.0.0
surface/surface-registry.schema.jsonSurface Registry2.0.0
voxel/voxel-group.schema.jsonVoxel Group Schema2.0.0
voxel/voxel-v3.schema.jsonVoxel Schema2.0.0

Identifiers. Records name themselves and each other with one URN form, defined once in _definitions/urn.schema.json: urn:luhtech:{issuer}:{type}:{id}.

Jobsite flow intake. Each intake profile narrows GS1 EPCIS 2.0. Every intake event must also validate against GS1's EPCIS 2.0.1 JSON Schema; the repository vendors that schema as a test fixture and does not republish it.

Using the package

import Ajv from 'ajv';
import addFormats from 'ajv-formats';
import { schemas, VoxelVoxelV3 } from '@ectropy/schemas';

const ajv = new Ajv({ strict: false });
addFormats(ajv);
Object.values(schemas).forEach((s) => ajv.addSchema(s));
const validate = ajv.getSchema('https://schemas.ectropy.ai/voxel/voxel-v3.schema.json')!;

const voxel: VoxelVoxelV3.VoxelSchema = JSON.parse(input);
if (!validate(voxel)) throw new Error(ajv.errorsText(validate.errors));

A single schema file is also importable: @ectropy/schemas/voxel/voxel-v3.schema.json.

Versioning

  • Each schema carries a semver version.
  • A change that can reject a previously valid instance, or that moves a schema's $id, is breaking. It bumps that schema's major version (minor below 1.0.0) and the package's major version.
  • CHANGELOG.md records every release.

Changing the standard

npm run check is the gate, run in CI on every pull request and before every publish. It checks that:

  • every file is in canonical form;
  • every $id equals its served URL;
  • no $ref leaves schemas.ectropy.ai;
  • every schema compiles;
  • every example in examples/ validates;
  • public text describes shapes and fields only.

npm run build generates the types; npm run site stages what Pages serves.

A release is a tag v<version> matching package.json. The release workflow runs the gate, builds, and publishes with npm provenance through trusted publishing.

License

Apache-2.0.

版本与发布记录

@ectropy/schemas 共发布 3 个版本,首次发布于 2026/04/24;过去 12 个月发布了 3 个版本。

版本发布日期距今
1.0.02026/10/111 个月前
0.4.0latest2026/04/246 个月前
0.3.02026/04/246 个月前

关于 @ectropy/schemas 的常见问题

@ectropy/schemas 是什么?

Ectropy schema definitions — voxel, decision, authority, federation. Consumed by @ectropy-ai/core and Ectropy-Business.

如何安装 @ectropy/schemas?

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

@ectropy/schemas 支持 TypeScript 吗?

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

@ectropy/schemas 支持 ESM 还是 CommonJS?

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

@ectropy/schemas 可以商用吗?

@ectropy/schemas 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@ectropy/schemas 的下载量有多少?

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

@ectropy/schemas 还在维护吗?

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