@evomap/gep-sdk

中文文档
1.14.0发布于 2026/09/11Apache-2.0TypeScriptES Module零依赖近 30 天下载 3万

Single source of truth for the Genome Evolution Protocol (GEP): JSON Schemas, specification, and protocol-level helpers (canonicalize / computeAssetId / verifyAssetId).

原始使用文档
文档目录12 节
  1. What's in the package
  2. Install
  3. Use as a schema source
  4. Use the asset-id helpers
  5. Stability
  6. Migrating from 1.1.x
  7. Requirements
  8. Related
  9. Contributing
  10. Licence
  11. Pre-1.3 history
  12. Non-execution reference Capsules

@evomap/gep-sdk

Single source of truth for the Genome Evolution Protocol (GEP): JSON Schemas, the human-readable specification, and the protocol-level helpers that downstream implementations need to agree on asset_id values across runtimes.

This package intentionally carries no algorithm code. Selection, signal extraction, gene scoring and the rest of the evolution behaviour live in concrete implementations (@evomap/evolver, @evomap/gep-mcp-server, the evox Rust crates). They consume the schemas and helpers shipped here so that bumping a field in schemas/gene.schema.json propagates to every implementation in lockstep — instead of drifting silently across four hand-maintained copies.

What's in the package

PathContents
schemas/gene.schema.jsonGene asset schema (Draft-07 JSON Schema)
schemas/capsule.schema.jsonCapsule asset schema
schemas/evolution-event.schema.jsonEvolutionEvent asset schema
schemas/mutation.schema.jsonMutation asset schema
schemas/task.schema.jsonTask asset schema (bounty work items)
spec/gep-spec-v1.mdFull protocol specification
src/contentHash.jsSCHEMA_VERSION, canonicalize, computeAssetId, verifyAssetId
src/protocolConstants.jsShared protocol enums such as GEP_GENE_CATEGORIES, GEP_OUTCOME_STATUSES, and GEP_EVIDENCE_MODES
src/capsuleEvidence.jsPure legacy/reference-only Capsule classifier and evidence hash validator

Install

npm install @evomap/gep-sdk

Use as a schema source

import geneSchema from '@evomap/gep-sdk/schemas/gene.schema.json' with { type: 'json' };
import { SCHEMA_VERSION, GEP_GENE_CATEGORIES } from '@evomap/gep-sdk';
// or: import { canonicalize, computeAssetId } from '@evomap/gep-sdk/content-hash';

Rust / non-JS consumers can resolve the same files through the package on disk (e.g. node_modules/@evomap/gep-sdk/schemas/gene.schema.json) and feed them into a code-generator such as typify.

Use the asset-id helpers

import { SCHEMA_VERSION, computeAssetId, verifyAssetId } from '@evomap/gep-sdk';

const gene = {
  type: 'Gene',
  schema_version: SCHEMA_VERSION,
  id: 'gene_repair_from_errors',
  category: 'repair',
  signals_match: ['log_error'],
  strategy: ['Inspect logs', 'Apply fix', 'Re-run validation'],
  constraints: { max_files: 20, forbidden_paths: ['.git', 'node_modules'] },
  validation: ['npm test'],
};
gene.asset_id = computeAssetId(gene);

verifyAssetId(gene); // true

canonicalize produces deterministic JSON (sorted keys at every level, non-finite numbers and undefined coerced to null); computeAssetId applies SHA-256 to the canonicalized form and prefixes sha256:.

Stability

SurfaceStability
Schemas (schemas/*.schema.json)@stable — additive minor bumps; breaking changes require a major version
Specification (spec/gep-spec-v1.md)@stable
SCHEMA_VERSION, canonicalize, computeAssetId, verifyAssetId@stable
Protocol constants (GEP_*)@stable — kept in lockstep with the shipped schemas

Anything not listed above is not part of this package.

Migrating from 1.1.x

@evomap/[email protected] exposed selection / signal-extraction / memory-graph / asset-store helpers (selectGene, extractSignals, MemoryGraph, AssetStore, …). Those modules have been removed in 1.2.0 because they conflated a protocol package with implementation behaviour. If you depended on any of them:

  • Use @evomap/evolver for a complete self-evolution engine.
  • Use @evomap/gep-mcp-server to expose evolution as MCP tools.
  • For ad-hoc projects that really need the JS algorithm code, pin @evomap/[email protected]. That release line will not receive new features, only critical fixes.

Requirements

  • Node.js >= 18.0.0
  • Zero runtime dependencies

Contributing

Pull requests are welcome. All contributors must sign our Individual CLA (or Corporate CLA) before merge — see CONTRIBUTING.md for the workflow. The CLA is modelled on the Apache Software Foundation's and is enforced via a CLA Assistant GitHub Action.

Licence

The licences cover code and documentation only. "EvoMap", "GEP", and "Genome Evolution Protocol" are trademarks of EvoMap. Apache 2.0 and CC-BY-4.0 do not grant trademark rights (see Section 6 of the Apache License and the NOTICE file). Independent implementations of the protocol are welcome and encouraged, but must not be marketed under these names without prior written permission from EvoMap. Contact [email protected] to discuss attribution or co-marketing.

Pre-1.3 history

@evomap/gep-sdk 1.0.x – 1.2.x was published under GPL-3.0-or-later. Versions 1.3.0 and later are Apache-2.0. If you have an existing deployment on 1.2.x and need to remain on the GPL line, those releases remain available on npm; new fixes will be backported only on a best-effort basis.

Non-execution reference Capsules

A Capsule may opt into evidence_mode: "reference_only" to record material that was not executed. The schema requires source_type: "reference", an exact zero blast radius, an empty execution_trace, non-empty content.text, and an artifact_hash proof whose lowercase SHA-256 and byte size match the UTF-8 text. Use classifyCapsuleEvidence (also exported as validateCapsuleEvidence) for a pure structured validation result. Omitting evidence_mode preserves legacy Capsule behaviour.

版本与发布记录

@evomap/gep-sdk 共发布 13 个版本,首次发布于 2026/03/13;过去 12 个月发布了 13 个版本。

版本发布日期距今
1.14.0latest2026/09/112 个月前
1.13.02026/08/162 个月前
1.12.12026/06/264 个月前
1.12.02026/06/264 个月前
1.5.02026/05/245 个月前
1.4.02026/05/205 个月前

关于 @evomap/gep-sdk 的常见问题

@evomap/gep-sdk 是什么?

Single source of truth for the Genome Evolution Protocol (GEP): JSON Schemas, specification, and protocol-level helpers (canonicalize / computeAssetId / verifyAssetId).

如何安装 @evomap/gep-sdk?

在项目目录运行 npm install @evomap/gep-sdk,或使用 pnpm add / yarn add / bun add。

@evomap/gep-sdk 支持 TypeScript 吗?

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

@evomap/gep-sdk 支持 ESM 还是 CommonJS?

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

@evomap/gep-sdk 需要什么版本的 Node.js?

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

@evomap/gep-sdk 可以商用吗?

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

@evomap/gep-sdk 的下载量有多少?

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

@evomap/gep-sdk 还在维护吗?

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