@agenticprimitives/geo-features 0.0.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Agentic Trust Labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,59 @@
1
+ # @agenticprimitives/geo-features
2
+
3
+ **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.
4
+
5
+ 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`](../attestations) credential-hash path — never a geo-specific contract.
6
+
7
+ > Part of [agenticprimitives](../../README.md) — the trust substrate for the agent economy: one canonical Smart Agent identity with custody, delegation, naming, credentials, and audit evidence designed as one system.
8
+
9
+ ## What ships today
10
+
11
+ This SDK owns the credential shape (`GeoClaimCredential`), the self/endorsed builders, the commitment/digest math, and a thin on-chain feature reader ([spec 251](../../specs/251-skills-and-geo-features.md)):
12
+
13
+ - **Builders** — `buildSelfGeoClaim` and `buildEndorsedGeoClaim` (cross-issued; returns the `endorsementDigest` the issuer signs).
14
+ - **Codelists** — `GEO_KIND` (lockstep with `GeoFeatureRegistry.KIND_*` on chain, [ADR-0009](../../docs/architecture/decisions/0009-on-chain-ontology-shacl-naming.md)), `GEO_RELATION`, `GeoVisibility`. All are keccak hashes of the `ns/geo#` C-box concept URIs.
15
+ - **Math** — `computeFeatureId`, `geometryHash`, `geoClaimId`, `geoEndorsementDigest`, `geoClaimHash`.
16
+ - **Feature reader** — `geoFeatureExists(read, registry, ref)` via an injected `readContract` function (no viem/contract dependency) + `GEO_FEATURE_READ_ABI`.
17
+
18
+ ```ts
19
+ import { buildEndorsedGeoClaim, GEO_RELATION, geoFeatureExists } from '@agenticprimitives/geo-features';
20
+
21
+ const { credential, endorsementDigest } = buildEndorsedGeoClaim({
22
+ chainId: 84532,
23
+ subject: orgAgent,
24
+ issuer: validator,
25
+ feature: { featureId, version: 1 }, // points to the on-chain GeoFeatureRegistry
26
+ relation: GEO_RELATION.servesWithin,
27
+ visibility: 'public-coarse',
28
+ nonce,
29
+ });
30
+ // the issuer signs `endorsementDigest` (ERC-1271); the app stores `credential` in the subject's vault.
31
+ ```
32
+
33
+ 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.
34
+
35
+ ## How it's different
36
+
37
+ 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:
38
+
39
+ 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).
40
+ 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.
41
+ 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.
42
+
43
+ Skills are the independent sibling [`@agenticprimitives/agent-skills`](../agent-skills) — there is no skill↔geo mapping; a "skill X in region Y" fact is two separate claims. Neutral substrate: no vertical vocabulary ([ADR-0021](../../docs/architecture/decisions/0021-generic-packages-vs-white-label-apps.md)).
44
+
45
+ ## Status
46
+
47
+ **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`](../contracts). See [AUDIT.md](./AUDIT.md).
48
+
49
+ > 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`](../../docs/audits/findings.yaml).
50
+
51
+ **Authoritative spec:** [`specs/251-skills-and-geo-features.md`](../../specs/251-skills-and-geo-features.md). Bounded surface: `CLAUDE.md` + `capability.manifest.json`.
52
+
53
+ ## Build
54
+
55
+ ```bash
56
+ pnpm --filter @agenticprimitives/geo-features typecheck
57
+ pnpm --filter @agenticprimitives/geo-features test
58
+ pnpm --filter @agenticprimitives/geo-features build
59
+ ```
@@ -0,0 +1,197 @@
1
+ /**
2
+ * @agenticprimitives/geo-features — off-chain geo CLAIM credentials + on-chain
3
+ * GeoFeatureRegistry helpers (spec 251).
4
+ *
5
+ * Geo features are PUBLIC, versioned, on-chain anchors (GeoFeatureRegistry; geometry
6
+ * hash + roots + coarse bbox, exact GeoJSON off chain). A geo claim — a Smart Agent's
7
+ * relation to a feature — is a PRIVATE verifiable credential in that agent's vault,
8
+ * pointing to an on-chain `(featureId, version)`. The agent↔feature ASSOCIATION is
9
+ * NEVER on chain (it would leak operational data). There is no on-chain skill↔geo
10
+ * mapping — this package is fully independent of `@agenticprimitives/agent-skills`.
11
+ *
12
+ * NEUTRAL public geography only — NO operational/sensitivity/domain vocabulary (spec 251).
13
+ */
14
+ import type { Address, Hex } from '@agenticprimitives/types';
15
+ export declare const PACKAGE_NAME = "@agenticprimitives/geo-features";
16
+ export declare const PACKAGE_STATUS: "w1-foundational";
17
+ export declare const SPEC_REF = "specs/251-skills-and-geo-features.md";
18
+ export type Uri = string;
19
+ export type Hex32 = `0x${string}`;
20
+ /** On-chain-bound geo feature kinds. `GEO_KIND.Region === GeoFeatureRegistry.KIND_REGION`. */
21
+ export declare const GEO_KIND: {
22
+ readonly Planet: `0x${string}`;
23
+ readonly Region: `0x${string}`;
24
+ readonly Country: `0x${string}`;
25
+ readonly AdminArea: `0x${string}`;
26
+ readonly Custom: `0x${string}`;
27
+ };
28
+ export declare const GEO_KIND_URI: {
29
+ readonly Planet: "https://agenticprimitives.dev/ns/geo#Planet";
30
+ readonly Region: "https://agenticprimitives.dev/ns/geo#Region";
31
+ readonly Country: "https://agenticprimitives.dev/ns/geo#Country";
32
+ readonly AdminArea: "https://agenticprimitives.dev/ns/geo#AdminArea";
33
+ readonly Custom: "https://agenticprimitives.dev/ns/geo#Custom";
34
+ };
35
+ /** Claim relations (C-box `apg:geoRelation`). Off-chain only (in the credential). */
36
+ export declare const GEO_RELATION: {
37
+ readonly servesWithin: `0x${string}`;
38
+ readonly operatesIn: `0x${string}`;
39
+ readonly licensedIn: `0x${string}`;
40
+ readonly residentOf: `0x${string}`;
41
+ readonly originIn: `0x${string}`;
42
+ };
43
+ export type GeoVisibility = 'public' | 'public-coarse' | 'private-commitment' | 'private-zk' | 'offchain-only';
44
+ /** Compute a stable featureId from a canonical id key (keccak). */
45
+ export declare function computeFeatureId(canonicalKey: string): Hex32;
46
+ /** keccak of the canonical GeoJSON string (the geometry that lives off chain). */
47
+ export declare function geometryHash(canonicalGeoJson: string): Hex32;
48
+ /** Payload a steward submits to `GeoFeatureRegistry.publish(...)`. Coordinates are degrees × 1e7. */
49
+ export interface GeoFeaturePublishInput {
50
+ featureId: Hex32;
51
+ featureKind: Hex32;
52
+ stewardAccount: Address;
53
+ geometryHash: Hex32;
54
+ coverageRoot: Hex32;
55
+ sourceSetRoot: Hex32;
56
+ metadataURI: string;
57
+ centroidLat: bigint;
58
+ centroidLon: bigint;
59
+ bboxMinLat: bigint;
60
+ bboxMinLon: bigint;
61
+ bboxMaxLat: bigint;
62
+ bboxMaxLon: bigint;
63
+ validAfter: bigint;
64
+ validUntil: bigint;
65
+ }
66
+ /** A reference to an on-chain geo feature version — what a claim points to. */
67
+ export interface GeoFeatureRef {
68
+ featureId: Hex32;
69
+ version: number;
70
+ }
71
+ export interface GeoClaimSubject {
72
+ /** The Smart Agent the claim is about. */
73
+ subject: Address;
74
+ /** The on-chain feature version this claim references. */
75
+ feature: GeoFeatureRef;
76
+ /** A GEO_RELATION value. */
77
+ relation: Hex32;
78
+ visibility: GeoVisibility;
79
+ /** keccak commitment / merkle root (ZK-targetable). NEVER a URI; preimage in the vault. */
80
+ evidenceCommit?: Hex32;
81
+ validAfter?: number;
82
+ validUntil?: number;
83
+ nonce: Hex32;
84
+ claimId: Hex32;
85
+ }
86
+ /** The vault-resident geo claim credential (a VC). */
87
+ export interface GeoClaimCredential {
88
+ '@context': string[];
89
+ type: ['VerifiableCredential', 'GeoClaimCredential'];
90
+ /** CAIP-10 of the issuer Smart Agent. */
91
+ issuer: string;
92
+ validFrom?: string;
93
+ validUntil?: string;
94
+ credentialSubject: GeoClaimSubject;
95
+ }
96
+ /** Deterministic claim id = keccak(abi.encode(subject, featureId, relation, nonce)). */
97
+ export declare function geoClaimId(args: {
98
+ subject: Address;
99
+ featureId: Hex32;
100
+ relation: Hex32;
101
+ nonce: Hex32;
102
+ }): Hex32;
103
+ /**
104
+ * NEW-GEO-1 — typehash now binds `chainId` + `verifyingContract` so an endorsement
105
+ * signature can't be replayed across chains or against a different GeoFeatureRegistry
106
+ * deployment (mirrors the EIP-712 domain binding in payments/mandate-sign.ts).
107
+ *
108
+ * Typehash for the cross-issued endorsement (issuer signs; verified via ERC-1271).
109
+ */
110
+ export declare const GEO_ENDORSEMENT_TYPEHASH: Hex32;
111
+ /**
112
+ * The digest an issuer signs to endorse a cross-issued claim (ERC-1271-verifiable).
113
+ *
114
+ * NEW-GEO-1 — `chainId` + `verifyingContract` are folded into the digest so the same
115
+ * endorsement can't be replayed on another chain or against a different registry deployment.
116
+ * `verifyingContract` is the GeoFeatureRegistry the endorsed `(featureId, version)` lives in.
117
+ */
118
+ export declare function geoEndorsementDigest(args: {
119
+ chainId: number;
120
+ verifyingContract: Address;
121
+ subject: Address;
122
+ featureId: Hex32;
123
+ featureVersion: number;
124
+ relation: Hex32;
125
+ validAfter: number;
126
+ validUntil: number;
127
+ nonce: Hex32;
128
+ }): Hex32;
129
+ /** Build a SELF geo claim (subject == issuer). */
130
+ export declare function buildSelfGeoClaim(args: {
131
+ chainId: number;
132
+ subject: Address;
133
+ feature: GeoFeatureRef;
134
+ relation: Hex32;
135
+ visibility?: GeoVisibility;
136
+ evidenceCommit?: Hex32;
137
+ validAfter?: number;
138
+ validUntil?: number;
139
+ nonce: Hex32;
140
+ }): GeoClaimCredential;
141
+ /** Build an ENDORSED geo claim + the digest the issuer must sign (cross-issued; subject != issuer). */
142
+ export declare function buildEndorsedGeoClaim(args: {
143
+ chainId: number;
144
+ /** NEW-GEO-1 — the GeoFeatureRegistry the endorsed `(featureId, version)` lives in; bound into the digest. */
145
+ registry: Address;
146
+ subject: Address;
147
+ issuer: Address;
148
+ feature: GeoFeatureRef;
149
+ relation: Hex32;
150
+ visibility?: GeoVisibility;
151
+ evidenceCommit?: Hex32;
152
+ validAfter?: number;
153
+ validUntil?: number;
154
+ nonce: Hex32;
155
+ }): {
156
+ credential: GeoClaimCredential;
157
+ endorsementDigest: Hex32;
158
+ };
159
+ /** The canonical hash of a claim credential body (for vault keys / receipts). */
160
+ export declare function geoClaimHash(credential: GeoClaimCredential): Hex;
161
+ /** Minimal read ABI for GeoFeatureRegistry — `exists` + `latestVersion`. */
162
+ export declare const GEO_FEATURE_READ_ABI: readonly [{
163
+ readonly type: "function";
164
+ readonly name: "exists";
165
+ readonly stateMutability: "view";
166
+ readonly inputs: readonly [{
167
+ readonly name: "featureId";
168
+ readonly type: "bytes32";
169
+ }, {
170
+ readonly name: "version";
171
+ readonly type: "uint64";
172
+ }];
173
+ readonly outputs: readonly [{
174
+ readonly type: "bool";
175
+ }];
176
+ }, {
177
+ readonly type: "function";
178
+ readonly name: "latestVersion";
179
+ readonly stateMutability: "view";
180
+ readonly inputs: readonly [{
181
+ readonly name: "";
182
+ readonly type: "bytes32";
183
+ }];
184
+ readonly outputs: readonly [{
185
+ readonly type: "uint64";
186
+ }];
187
+ }];
188
+ /** A `readContract`-shaped function (inject viem's `publicClient.readContract`). */
189
+ export type ReadContractFn = (args: {
190
+ address: Address;
191
+ abi: typeof GEO_FEATURE_READ_ABI;
192
+ functionName: string;
193
+ args: readonly unknown[];
194
+ }) => Promise<unknown>;
195
+ /** Confirm a claim's pinned `(featureId, version)` still exists on the registry. */
196
+ export declare function geoFeatureExists(read: ReadContractFn, registry: Address, ref: GeoFeatureRef): Promise<boolean>;
197
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAG7D,eAAO,MAAM,YAAY,oCAAoC,CAAC;AAC9D,eAAO,MAAM,cAAc,EAAG,iBAA0B,CAAC;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AE,CAAA;CAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAEhK,oFAAoF;AACpF,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CAEpH"}
package/dist/index.js ADDED
@@ -0,0 +1,180 @@
1
+ /**
2
+ * @agenticprimitives/geo-features — off-chain geo CLAIM credentials + on-chain
3
+ * GeoFeatureRegistry helpers (spec 251).
4
+ *
5
+ * Geo features are PUBLIC, versioned, on-chain anchors (GeoFeatureRegistry; geometry
6
+ * hash + roots + coarse bbox, exact GeoJSON off chain). A geo claim — a Smart Agent's
7
+ * relation to a feature — is a PRIVATE verifiable credential in that agent's vault,
8
+ * pointing to an on-chain `(featureId, version)`. The agent↔feature ASSOCIATION is
9
+ * NEVER on chain (it would leak operational data). There is no on-chain skill↔geo
10
+ * mapping — this package is fully independent of `@agenticprimitives/agent-skills`.
11
+ *
12
+ * NEUTRAL public geography only — NO operational/sensitivity/domain vocabulary (spec 251).
13
+ */
14
+ import { keccak_256 } from '@noble/hashes/sha3.js';
15
+ import { utf8ToBytes } from '@noble/hashes/utils.js';
16
+ import { credentialHash, VC_CONTEXT_V2 } from '@agenticprimitives/verifiable-credentials';
17
+ export const PACKAGE_NAME = '@agenticprimitives/geo-features';
18
+ export const PACKAGE_STATUS = 'w1-foundational';
19
+ export const SPEC_REF = 'specs/251-skills-and-geo-features.md';
20
+ const NS = 'https://agenticprimitives.dev/ns/geo#';
21
+ // ─── C-box codelists (keccak of the ns/geo# concept URIs) ──────────────────
22
+ // Kind values are LOCKSTEP with GeoFeatureRegistry.KIND_* (ADR-0009).
23
+ /** On-chain-bound geo feature kinds. `GEO_KIND.Region === GeoFeatureRegistry.KIND_REGION`. */
24
+ export const GEO_KIND = {
25
+ Planet: hashUri(`${NS}Planet`),
26
+ Region: hashUri(`${NS}Region`),
27
+ Country: hashUri(`${NS}Country`),
28
+ AdminArea: hashUri(`${NS}AdminArea`),
29
+ Custom: hashUri(`${NS}Custom`),
30
+ };
31
+ export const GEO_KIND_URI = {
32
+ Planet: `${NS}Planet`, Region: `${NS}Region`, Country: `${NS}Country`, AdminArea: `${NS}AdminArea`, Custom: `${NS}Custom`,
33
+ };
34
+ /** Claim relations (C-box `apg:geoRelation`). Off-chain only (in the credential). */
35
+ export const GEO_RELATION = {
36
+ servesWithin: hashUri(`${NS}servesWithin`),
37
+ operatesIn: hashUri(`${NS}operatesIn`),
38
+ licensedIn: hashUri(`${NS}licensedIn`),
39
+ residentOf: hashUri(`${NS}residentOf`),
40
+ originIn: hashUri(`${NS}originIn`),
41
+ };
42
+ // ─── Features (the on-chain anchor) ────────────────────────────────────────
43
+ /** Compute a stable featureId from a canonical id key (keccak). */
44
+ export function computeFeatureId(canonicalKey) {
45
+ return hashUri(canonicalKey);
46
+ }
47
+ /** keccak of the canonical GeoJSON string (the geometry that lives off chain). */
48
+ export function geometryHash(canonicalGeoJson) {
49
+ return hashUri(canonicalGeoJson);
50
+ }
51
+ /** Deterministic claim id = keccak(abi.encode(subject, featureId, relation, nonce)). */
52
+ export function geoClaimId(args) {
53
+ const buf = new Uint8Array(4 * 32);
54
+ writeAddress(buf, 0, args.subject);
55
+ writeHex32(buf, 32, args.featureId);
56
+ writeHex32(buf, 64, args.relation);
57
+ writeHex32(buf, 96, args.nonce);
58
+ return toHex32(keccak_256(buf));
59
+ }
60
+ /**
61
+ * NEW-GEO-1 — typehash now binds `chainId` + `verifyingContract` so an endorsement
62
+ * signature can't be replayed across chains or against a different GeoFeatureRegistry
63
+ * deployment (mirrors the EIP-712 domain binding in payments/mandate-sign.ts).
64
+ *
65
+ * Typehash for the cross-issued endorsement (issuer signs; verified via ERC-1271).
66
+ */
67
+ export const GEO_ENDORSEMENT_TYPEHASH = hashUri('GeoEndorsement(uint256 chainId,address verifyingContract,address subjectAgent,bytes32 featureId,uint64 featureVersion,bytes32 relation,uint64 validAfter,uint64 validUntil,bytes32 nonce)');
68
+ /**
69
+ * The digest an issuer signs to endorse a cross-issued claim (ERC-1271-verifiable).
70
+ *
71
+ * NEW-GEO-1 — `chainId` + `verifyingContract` are folded into the digest so the same
72
+ * endorsement can't be replayed on another chain or against a different registry deployment.
73
+ * `verifyingContract` is the GeoFeatureRegistry the endorsed `(featureId, version)` lives in.
74
+ */
75
+ export function geoEndorsementDigest(args) {
76
+ const buf = new Uint8Array(10 * 32);
77
+ writeHex32(buf, 0, GEO_ENDORSEMENT_TYPEHASH);
78
+ writeUint(buf, 32, BigInt(args.chainId));
79
+ writeAddress(buf, 64, args.verifyingContract);
80
+ writeAddress(buf, 96, args.subject);
81
+ writeHex32(buf, 128, args.featureId);
82
+ writeUint(buf, 160, BigInt(args.featureVersion));
83
+ writeHex32(buf, 192, args.relation);
84
+ writeUint(buf, 224, BigInt(args.validAfter));
85
+ writeUint(buf, 256, BigInt(args.validUntil));
86
+ writeHex32(buf, 288, args.nonce);
87
+ return toHex32(keccak_256(buf));
88
+ }
89
+ function caip10(chainId, addr) {
90
+ return `eip155:${chainId}:${addr}`;
91
+ }
92
+ function buildSubject(args) {
93
+ return {
94
+ subject: args.subject,
95
+ feature: args.feature,
96
+ relation: args.relation,
97
+ visibility: args.visibility,
98
+ evidenceCommit: args.evidenceCommit,
99
+ validAfter: args.validAfter,
100
+ validUntil: args.validUntil,
101
+ nonce: args.nonce,
102
+ claimId: geoClaimId({ subject: args.subject, featureId: args.feature.featureId, relation: args.relation, nonce: args.nonce }),
103
+ };
104
+ }
105
+ /** Build a SELF geo claim (subject == issuer). */
106
+ export function buildSelfGeoClaim(args) {
107
+ return {
108
+ '@context': [VC_CONTEXT_V2],
109
+ type: ['VerifiableCredential', 'GeoClaimCredential'],
110
+ issuer: caip10(args.chainId, args.subject),
111
+ credentialSubject: buildSubject({ ...args, visibility: args.visibility ?? 'private-commitment' }),
112
+ };
113
+ }
114
+ /** Build an ENDORSED geo claim + the digest the issuer must sign (cross-issued; subject != issuer). */
115
+ export function buildEndorsedGeoClaim(args) {
116
+ if (args.subject === args.issuer)
117
+ throw new Error('geo-features: an endorsed claim must be cross-issued');
118
+ const credential = {
119
+ '@context': [VC_CONTEXT_V2],
120
+ type: ['VerifiableCredential', 'GeoClaimCredential'],
121
+ issuer: caip10(args.chainId, args.issuer),
122
+ credentialSubject: buildSubject({ ...args, visibility: args.visibility ?? 'public' }),
123
+ };
124
+ const endorsementDigest = geoEndorsementDigest({
125
+ chainId: args.chainId, // NEW-GEO-1 — bind chain + registry so the signature is deployment-scoped
126
+ verifyingContract: args.registry,
127
+ subject: args.subject,
128
+ featureId: args.feature.featureId,
129
+ featureVersion: args.feature.version,
130
+ relation: args.relation,
131
+ validAfter: args.validAfter ?? 0,
132
+ validUntil: args.validUntil ?? 0,
133
+ nonce: args.nonce,
134
+ });
135
+ return { credential, endorsementDigest };
136
+ }
137
+ /** The canonical hash of a claim credential body (for vault keys / receipts). */
138
+ export function geoClaimHash(credential) {
139
+ return credentialHash(credential);
140
+ }
141
+ // ─── On-chain feature reader (minimal ABI fragment) ────────────────────────
142
+ /** Minimal read ABI for GeoFeatureRegistry — `exists` + `latestVersion`. */
143
+ export const GEO_FEATURE_READ_ABI = [
144
+ { type: 'function', name: 'exists', stateMutability: 'view', inputs: [{ name: 'featureId', type: 'bytes32' }, { name: 'version', type: 'uint64' }], outputs: [{ type: 'bool' }] },
145
+ { type: 'function', name: 'latestVersion', stateMutability: 'view', inputs: [{ name: '', type: 'bytes32' }], outputs: [{ type: 'uint64' }] },
146
+ ];
147
+ /** Confirm a claim's pinned `(featureId, version)` still exists on the registry. */
148
+ export async function geoFeatureExists(read, registry, ref) {
149
+ return (await read({ address: registry, abi: GEO_FEATURE_READ_ABI, functionName: 'exists', args: [ref.featureId, BigInt(ref.version)] }));
150
+ }
151
+ // ─── Hash helpers ──────────────────────────────────────────────────────────
152
+ function hashUri(s) {
153
+ return toHex32(keccak_256(utf8ToBytes(s)));
154
+ }
155
+ function toHex32(b) {
156
+ let hex = '0x';
157
+ for (const v of b)
158
+ hex += v.toString(16).padStart(2, '0');
159
+ return hex;
160
+ }
161
+ function writeHex32(buf, offset, h) {
162
+ const clean = h.toLowerCase().replace(/^0x/, '').padStart(64, '0');
163
+ for (let i = 0; i < 32; i++)
164
+ buf[offset + i] = parseInt(clean.substring(i * 2, i * 2 + 2), 16);
165
+ }
166
+ function writeAddress(buf, offset, addr) {
167
+ const clean = addr.toLowerCase().replace(/^0x/, '');
168
+ if (clean.length !== 40)
169
+ throw new Error(`bad address: ${addr}`);
170
+ for (let i = 0; i < 20; i++)
171
+ buf[offset + 12 + i] = parseInt(clean.substring(i * 2, i * 2 + 2), 16);
172
+ }
173
+ function writeUint(buf, offset, n) {
174
+ let v = n;
175
+ for (let i = 31; i >= 0; i--) {
176
+ buf[offset + i] = Number(v & 0xffn);
177
+ v >>= 8n;
178
+ }
179
+ }
180
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAE1F,MAAM,CAAC,MAAM,YAAY,GAAG,iCAAiC,CAAC;AAC9D,MAAM,CAAC,MAAM,cAAc,GAAG,iBAA0B,CAAC;AACzD,MAAM,CAAC,MAAM,QAAQ,GAAG,sCAAsC,CAAC;AAK/D,MAAM,EAAE,GAAG,uCAAuC,CAAC;AAEnD,8EAA8E;AAC9E,sEAAsE;AAEtE,8FAA8F;AAC9F,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC;IAC9B,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,QAAQ,C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4
+ "description": "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).",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/agentictrustlabs/agenticprimitives.git",
9
+ "directory": "packages/geo-features"
10
+ },
11
+ "type": "module",
12
+ "main": "./dist/index.js",
13
+ "types": "./dist/index.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/index.js"
18
+ }
19
+ },
20
+ "files": [
21
+ "LICENSE",
22
+ "dist",
23
+ "README.md"
24
+ ],
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "devDependencies": {
29
+ "vitest": "^4.1.8"
30
+ },
31
+ "keywords": [
32
+ "agentic",
33
+ "primitives",
34
+ "geo"
35
+ ],
36
+ "dependencies": {
37
+ "@noble/hashes": "^2.2.0",
38
+ "@agenticprimitives/types": "1.0.0-alpha.14",
39
+ "@agenticprimitives/verifiable-credentials": "0.0.0-alpha.11"
40
+ },
41
+ "scripts": {
42
+ "build": "tsc -p tsconfig.build.json",
43
+ "typecheck": "tsc -p tsconfig.json --noEmit",
44
+ "test": "vitest run",
45
+ "test:unit": "vitest run test/unit --passWithNoTests",
46
+ "clean": "rm -rf dist"
47
+ }
48
+ }