@agenticprimitives/geo-features

中文文档
0.0.0-alpha.42发布于 2026/10/26MITTypeScriptES Module近 30 天下载 2650

Off-chain geo CLAIM credentials + on-chain GeoFeatureRegistry helpers (spec 251). Features on chain; the agent↔feature claim is a private vault credential pointing to a (featureId, version).

原始使用文档
文档目录4 节
  1. What ships today
  2. How it's different
  3. Status
  4. Build

@agenticprimitives/geo-features

Part of Agentic Primitives — the open-source trust substrate for agentic applications: identity that can sign, authority checked at act time, evidence the owner carries. Developer kit · All packages

Where an agent operates is one of the most sensitive facts about it — and most geo registries publish it by default. Coordination needs shared geography everyone can reference; safety needs the agent↔place association kept private. This package splits the two: a geo feature is a public, versioned, on-chain anchor in GeoFeatureRegistry (geometry hash + coverage/source roots + a coarse bbox; exact GeoJSON stays off chain); a geo claim — a Smart Agent's relation to a feature — is a private verifiable credential in that agent's vault, pointing at the on-chain (featureId, version). The association is never on chain — it would leak operational data.

Because subject and issuer are Smart Agent addresses, a validator endorses a claim by signing the endorsementDigest with its own on-chain identity (ERC-1271-verifiable), the claim survives the subject's key rotations, and opt-in public assertion reuses the generic attestations credential-hash path — never a geo-specific contract.

Part of agenticprimitives — the trust substrate for the agent economy: one canonical Smart Agent identity with custody, delegation, naming, credentials, and audit evidence designed as one system.

What ships today

This SDK owns the credential shape (GeoClaimCredential), the self/endorsed builders, the commitment/digest math, and a thin on-chain feature reader (spec 251):

  • Builders — buildSelfGeoClaim and buildEndorsedGeoClaim (cross-issued; returns the endorsementDigest the issuer signs).
  • Codelists — GEO_KIND (lockstep with GeoFeatureRegistry.KIND_* on chain, ADR-0009), GEO_RELATION, GeoVisibility. All are keccak hashes of the ns/geo# C-box concept URIs.
  • Math — computeFeatureId, geometryHash, geoClaimId, geoEndorsementDigest, geoClaimHash.
  • Feature reader — geoFeatureExists(read, registry, ref) via an injected readContract function (no viem/contract dependency) + GEO_FEATURE_READ_ABI.
import { buildEndorsedGeoClaim, GEO_RELATION, geoFeatureExists } from '@agenticprimitives/geo-features';

const { credential, endorsementDigest } = buildEndorsedGeoClaim({
  chainId: 84532,
  subject: orgAgent,
  issuer:  validator,
  feature: { featureId, version: 1 },     // points to the on-chain GeoFeatureRegistry
  relation: GEO_RELATION.servesWithin,
  visibility: 'public-coarse',
  nonce,
});
// the issuer signs `endorsementDigest` (ERC-1271); the app stores `credential` in the subject's vault.

Vault I/O is the app's job — this package is transport-agnostic. Exact geometry stays off chain (the SDK handles only its geometryHash); evidenceCommit is a bytes32 commitment, never a URI.

How it's different

Open boundary datasets and geospatial registries answer "what places exist"; they have no model for "which agent verifiably operates where, disclosed on the agent's terms". The deltas here:

  1. Neutral public geography only. A feature is a generic public place — it is never tagged with operational or sensitivity data. Sensitivity is an off-chain app policy layered over neutral features (spec 251 GFR-07).
  2. Possession is private by default. The agent↔feature claim lives in the agent's vault as a signed VC; visibility tiers (public-coarse, private-commitment, private-zk, …) let the holder choose disclosure granularity.
  3. Lockstep, CI-checked. GEO_KIND.Region === GeoFeatureRegistry.KIND_REGION — the codelists are bound to the contract constants, so the SDK cannot drift from the chain.

Skills are the independent sibling @agenticprimitives/capability-claims — there is no skill↔geo mapping; a "skill X in region Y" fact is two separate claims. Neutral substrate: no vertical vocabulary (ADR-0021).

Status

W1 foundational — the off-chain geo-claim layer of the spec-251 skills/geo substrate is shipped. The on-chain peer is GeoFeatureRegistry.sol in packages/contracts. See AUDIT.md.

Testnet/pilot-ready. Production launch is gated on the public checklist in the root README — including third-party contract audit and governance key rotation. Track every security finding live in docs/audits/findings.yaml.

Authoritative spec: specs/251-skills-and-geo-features.md. Bounded surface: CLAUDE.md + capability.manifest.json.

Build

pnpm --filter @agenticprimitives/geo-features typecheck
pnpm --filter @agenticprimitives/geo-features test
pnpm --filter @agenticprimitives/geo-features build

版本与发布记录

@agenticprimitives/geo-features 共发布 40 个版本,首次发布于 2026/06/11;过去 12 个月发布了 40 个版本。

版本发布日期距今
0.0.0-alpha.42latest2026/10/2612 天前
0.0.0-alpha.412026/10/2612 天前
0.0.0-alpha.402026/10/1721 天前
0.0.0-alpha.392026/10/1722 天前
0.0.0-alpha.382026/10/1622 天前
0.0.0-alpha.372026/10/1622 天前

其他发布通道:alpha → 0.0.0-alpha.3。

关于 @agenticprimitives/geo-features 的常见问题

@agenticprimitives/geo-features 是什么?

Off-chain geo CLAIM credentials + on-chain GeoFeatureRegistry helpers (spec 251). Features on chain; the agent↔feature claim is a private vault credential pointing to a (featureId, version).

如何安装 @agenticprimitives/geo-features?

在项目目录运行 npm install @agenticprimitives/geo-features,或使用 pnpm add / yarn add / bun add。

@agenticprimitives/geo-features 支持 TypeScript 吗?

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

@agenticprimitives/geo-features 支持 ESM 还是 CommonJS?

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

@agenticprimitives/geo-features 可以商用吗?

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

@agenticprimitives/geo-features 的下载量有多少?

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

@agenticprimitives/geo-features 还在维护吗?

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