@agenticprimitives/agent-naming 0.1.0-alpha.3 → 1.0.0-alpha.11
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/AUDIT.md +15 -4
- package/CLAUDE.md +3 -3
- package/README.md +49 -55
- package/dist/client.d.ts +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +10 -6
- package/dist/client.js.map +1 -1
- package/dist/custody.d.ts +2 -2
- package/dist/custody.d.ts.map +1 -1
- package/dist/custody.js +9 -4
- package/dist/custody.js.map +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/namehash.d.ts +3 -2
- package/dist/namehash.d.ts.map +1 -1
- package/dist/namehash.js +5 -4
- package/dist/namehash.js.map +1 -1
- package/dist/normalize.d.ts +9 -0
- package/dist/normalize.d.ts.map +1 -1
- package/dist/normalize.js +20 -1
- package/dist/normalize.js.map +1 -1
- package/dist/records.d.ts +1 -1
- package/dist/records.d.ts.map +1 -1
- package/docs/api.md +2 -2
- package/docs/concepts.md +1 -1
- package/docs/migration.md +1 -1
- package/package.json +10 -10
package/AUDIT.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# @agenticprimitives/agent-naming — package audit
|
|
2
2
|
|
|
3
3
|
**Status:** Phase 1 (SDK skeleton + spec + pure helpers).
|
|
4
|
-
**Last refreshed:** 2026-
|
|
4
|
+
**Last refreshed:** 2026-06-01 (R9 substrate coverage references + R11.1 fail-hard audit + R11.3 public-surface cleanup)
|
|
5
|
+
**Prior refresh:** 2026-05-23
|
|
5
6
|
**Owner:** [security-auditor](../../docs/agents/security-auditor.md) +
|
|
6
7
|
[technical-architect-auditor](../../docs/agents/technical-architect-auditor.md).
|
|
7
8
|
**System audit cross-ref:** see
|
|
@@ -14,7 +15,7 @@ on-chain authority paths, and demo integration land in Phase 3+.
|
|
|
14
15
|
## Charter (what's audit-relevant in this package)
|
|
15
16
|
|
|
16
17
|
- Pure helpers (`normalizeAgentName`, `labelhash`, `namehash`): MUST
|
|
17
|
-
be deterministic + match the
|
|
18
|
+
be deterministic + match the standard recursive-namehash algorithm + reject
|
|
18
19
|
malformed input.
|
|
19
20
|
- Record schema (`AgentNameRecords` + `records` subpath): MUST
|
|
20
21
|
refuse unknown keys on encode (fail-loud write) AND drop unknown
|
|
@@ -39,9 +40,9 @@ on-chain authority paths, and demo integration land in Phase 3+.
|
|
|
39
40
|
non-ASCII / oversize labels. Throws `InvalidNameError`. Covered in
|
|
40
41
|
`test/normalize.test.ts`.
|
|
41
42
|
- ✅ `normalize` is idempotent: `normalize(normalize(x)) === normalize(x)`.
|
|
42
|
-
- ✅ `namehash('')` = `ZERO_NODE` (`0x00…00`) per the
|
|
43
|
+
- ✅ `namehash('')` = `ZERO_NODE` (`0x00…00`) per the root-sentinel
|
|
43
44
|
convention.
|
|
44
|
-
- ✅ `namehash` matches the
|
|
45
|
+
- ✅ `namehash` matches the standard recursive-namehash algorithm under an
|
|
45
46
|
in-band independent reimplementation (`test/namehash.test.ts`
|
|
46
47
|
golden-vector table).
|
|
47
48
|
- ✅ `namehash` rejects malformed input by delegating to `normalize`.
|
|
@@ -84,3 +85,13 @@ client doesn't yet take an `auditSink`; Phase 2 will add the optional
|
|
|
84
85
|
| Date | Wave | What changed |
|
|
85
86
|
| --- | --- | --- |
|
|
86
87
|
| 2026-05-23 | NS Phase 1 | Initial audit. AN-1/2/3 open; security invariants verified by unit tests. |
|
|
88
|
+
|
|
89
|
+
## R9 substrate coverage (2026-06-01)
|
|
90
|
+
|
|
91
|
+
- Locked by R6.2 + R6.8 contract-side hardening:
|
|
92
|
+
- `AgentNameRegistry.initializeRoot` cannot be frontrun (immutable initializer + same-tx deploy) — H7-C.4 / CON-NAMING-001.
|
|
93
|
+
- `PermissionlessSubregistry.register` is `nonReentrant` — R6.2 / CON-SUBREGISTRY-003.
|
|
94
|
+
- Pause coverage: 7 mutating functions (register, backfillLabel, setOwner, setResolver, setSubregistry, renew, setPrimaryName) are `whenNotPaused` — R6.8.
|
|
95
|
+
- ADR-0012 / ADR-0013: NO `eth_getLogs` in product read paths; `reverseResolveString` is the canonical single-call.
|
|
96
|
+
- See [`packages/contracts/AUDIT.md` § 3.8](../contracts/AUDIT.md).
|
|
97
|
+
|
package/CLAUDE.md
CHANGED
|
@@ -8,8 +8,8 @@ Names are a **facet registration** pointing AT the canonical Smart Agent ([ADR-0
|
|
|
8
8
|
- The `.agent` TLD constant (`AGENT_TLD`).
|
|
9
9
|
- Name normalization (`normalizeAgentName`) — NFC + lowercase + label
|
|
10
10
|
validation. Rejects empty / hyphen-prefixed / non-ASCII labels in v0.
|
|
11
|
-
- `labelhash` + `namehash` —
|
|
12
|
-
identifier nodes.
|
|
11
|
+
- `labelhash` + `namehash` — recursive keccak256 hashes
|
|
12
|
+
(`keccak256(parentNode || labelhash)`) for identifier nodes.
|
|
13
13
|
- Record schemas (`AgentNameRecords`) and predicate constants
|
|
14
14
|
(subpath `/records`).
|
|
15
15
|
- `AgentNamingClient` — read API (resolve / reverse-resolve / get
|
|
@@ -37,7 +37,7 @@ Names are a **facet registration** pointing AT the canonical Smart Agent ([ADR-0
|
|
|
37
37
|
`AGENT_TLD`.
|
|
38
38
|
**Disambiguation:**
|
|
39
39
|
|
|
40
|
-
- **"resolver"** here = on-chain
|
|
40
|
+
- **"resolver"** here = our on-chain registry + resolver. Distinct from
|
|
41
41
|
any other package.
|
|
42
42
|
- **"registry"** here = `AgentNameRegistry` contract. Distinct from
|
|
43
43
|
the factory deploy-registry in `agent-account`.
|
package/README.md
CHANGED
|
@@ -1,44 +1,38 @@
|
|
|
1
1
|
# @agenticprimitives/agent-naming
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**The name is a facet. The address is the identity.** Agent naming is being settled right now — GoDaddy launched an Agent Naming Service, ERC-8004 put agent registries on mainnet, and every discovery stack needs an answer to "which agent answers to this name?" Most naming systems get the dependency backwards: the name becomes the identity, and losing the name (or the registrar) means losing everything attached to it. Here, every person, org, service agent, and treasury is a canonical ERC-4337 Smart Agent address — and a `.agent` name is a replaceable record pointing *at* that address ([ADR-0010](../../docs/architecture/decisions/0010-smart-agent-canonical-identifier.md)). Rotate the name, keep the identity. Rotate your credentials, keep the name. Nothing downstream breaks.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
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.
|
|
6
|
+
|
|
7
|
+
Use this package to resolve names like `alice.agent` and `treasury.acme.agent` to Smart Agent addresses, read typed service-discovery records (A2A endpoint, MCP endpoint, CAIP-10 `nativeId`), and build encoded calls for name-management transactions. Names are hierarchical — orgs hand out subnames under their own subregistry — and normalization is deterministic and on-chain-verifiable.
|
|
8
8
|
|
|
9
9
|
> **Layer:** Discover — a naming **facet** (not canonical identity — that is `agent-account`).
|
|
10
10
|
> **Canonical key:** the Smart Agent address the name resolves to.
|
|
11
11
|
|
|
12
|
-
Use this
|
|
13
|
-
`treasury.acme.agent` to Smart Agent addresses, read typed service-discovery
|
|
14
|
-
records, and build encoded calls for name-management transactions.
|
|
15
|
-
|
|
16
|
-
## Use This When
|
|
12
|
+
## Use this when
|
|
17
13
|
|
|
18
|
-
- You need forward resolution: `alice.agent
|
|
19
|
-
- You need reverse resolution from a Smart Agent address to its primary name.
|
|
20
|
-
- You need typed records such as `displayName`, `a2aEndpoint`, `mcpEndpoint`,
|
|
21
|
-
|
|
22
|
-
- You need pure call builders for name registration, resolver updates, primary
|
|
23
|
-
name updates, or owner rotation.
|
|
14
|
+
- You need forward resolution: `alice.agent → 0x…`.
|
|
15
|
+
- You need reverse resolution from a Smart Agent address to its primary name — with a round-trip check, so a name is only trusted when it resolves back to the same address.
|
|
16
|
+
- You need typed records such as `displayName`, `a2aEndpoint`, `mcpEndpoint`, `nativeId`, or `metadataUri` — service discovery without hardcoded URLs.
|
|
17
|
+
- You need pure call builders for name registration, resolver updates, primary-name updates, or owner rotation that compose into custody-policy ceremonies.
|
|
24
18
|
|
|
25
|
-
## Do
|
|
19
|
+
## Do not use this for
|
|
26
20
|
|
|
27
|
-
- Passkey ceremonies or auth flows
|
|
28
|
-
- Smart-account deployment or UserOps
|
|
29
|
-
- Account safety policy and approval scheduling
|
|
30
|
-
- Permission-token minting or attenuation
|
|
31
|
-
- MCP/A2A transport wiring
|
|
21
|
+
- Passkey ceremonies or auth flows — `@agenticprimitives/connect-auth`.
|
|
22
|
+
- Smart-account deployment or UserOps — `@agenticprimitives/agent-account`.
|
|
23
|
+
- Account safety policy and approval scheduling — `@agenticprimitives/account-custody`.
|
|
24
|
+
- Permission-token minting or attenuation — `@agenticprimitives/delegation`.
|
|
25
|
+
- MCP/A2A transport wiring — demo apps or runtime packages.
|
|
32
26
|
|
|
33
27
|
## Install
|
|
34
28
|
|
|
35
|
-
|
|
29
|
+
Workspace-internal; not yet published.
|
|
36
30
|
|
|
37
31
|
```bash
|
|
38
32
|
pnpm add @agenticprimitives/agent-naming
|
|
39
33
|
```
|
|
40
34
|
|
|
41
|
-
## 60-
|
|
35
|
+
## 60-second quickstart
|
|
42
36
|
|
|
43
37
|
```ts
|
|
44
38
|
import {
|
|
@@ -64,22 +58,28 @@ const primaryName = await naming.reverseResolve('0x00000000000000000000000000000
|
|
|
64
58
|
const records = await naming.getRecords('treasury.acme.agent');
|
|
65
59
|
```
|
|
66
60
|
|
|
67
|
-
##
|
|
61
|
+
## How it's different
|
|
62
|
+
|
|
63
|
+
The reference points are **ENS and Unstoppable Domains** — both excellent at what they do, both built around a different center of gravity:
|
|
64
|
+
|
|
65
|
+
- **Name-as-asset vs. name-as-facet.** ENS and Unstoppable treat the name as the prized object; identity accretes around it. Here the Smart Agent address is canonical and forced-unique names are assigned at identity bootstrap ([spec 220 §5](../../specs/220-agent-identity-bootstrap.md)) — the name is a pointer, replaceable without identity loss, and `addr` + `nativeId` must reference the same Smart Agent.
|
|
66
|
+
- **Agent-native records.** Typed predicates for `a2aEndpoint`, `mcpEndpoint`, CAIP-10 `nativeId`, and a public-safe passkey credential digest — the records an agent economy actually resolves, not a TXT free-for-all. Unknown predicates are ignored on decode and rejected by typed encoders.
|
|
67
|
+
- **Custody-governed rotation.** Name-owner rotation ships as pure encoded call builders (`/custody` subpath) that compose into the owner Smart Agent's custody-policy ceremonies — quorums and trustees, not a private key that can be phished once.
|
|
68
|
+
- **Disciplined reads.** Product reads use `readContract` only — no `eth_getLogs` walks, no silent fallbacks ([ADR-0012](../../docs/architecture/decisions/0012-no-eth-getlogs-in-product-read-paths.md), [ADR-0013](../../docs/architecture/decisions/0013-no-silent-fallbacks.md)). Reverse resolution is a single on-chain `reverseResolveString` read, then a forward round-trip before it is trusted.
|
|
69
|
+
|
|
70
|
+
The `.agent` TLD is the naming protocol; which names a given deployment registers is app-layer configuration — this package stays generic.
|
|
68
71
|
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
## Main concepts
|
|
73
|
+
|
|
74
|
+
- **Canonical SA**: the ERC-4337 address every name must reference (`addr`, `nativeId`). Owned by `agent-account`, not this package.
|
|
71
75
|
- **AgentName**: a normalized dotted name under `.agent` (a facet label).
|
|
72
|
-
- **Label**: one segment
|
|
73
|
-
- **
|
|
74
|
-
- **
|
|
75
|
-
- **Resolver**: stores typed records for a node.
|
|
76
|
-
- **Primary name**: reverse record for a Smart Agent address.
|
|
77
|
-
- **Records**: typed data such as endpoints, display name, CAIP-10 `nativeId`,
|
|
78
|
-
and public-safe passkey credential digest.
|
|
76
|
+
- **Label / Node**: one segment (`treasury`); the recursive `namehash(name)`.
|
|
77
|
+
- **Registry / Resolver**: name records (owner, resolver, parent, subregistry); typed records for a node.
|
|
78
|
+
- **Primary name**: the reverse record for a Smart Agent address.
|
|
79
79
|
|
|
80
80
|
See [`docs/concepts.md`](docs/concepts.md).
|
|
81
81
|
|
|
82
|
-
## Common
|
|
82
|
+
## Common recipes
|
|
83
83
|
|
|
84
84
|
```ts
|
|
85
85
|
import {
|
|
@@ -102,40 +102,30 @@ const decoded = decodeRecords({
|
|
|
102
102
|
});
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
More examples:
|
|
106
|
-
|
|
107
|
-
- [`examples/basic.ts`](examples/basic.ts)
|
|
108
|
-
- [`examples/records.ts`](examples/records.ts)
|
|
109
|
-
- [`examples/custody-rotation.ts`](examples/custody-rotation.ts)
|
|
105
|
+
More examples: [`examples/basic.ts`](examples/basic.ts) · [`examples/records.ts`](examples/records.ts) · [`examples/custody-rotation.ts`](examples/custody-rotation.ts)
|
|
110
106
|
|
|
111
|
-
## Runtime
|
|
107
|
+
## Runtime support
|
|
112
108
|
|
|
113
|
-
Pure helpers and record encoders work in browser, Node, and Workers. The client
|
|
114
|
-
uses `viem` public and wallet clients and requires an RPC URL for chain reads or
|
|
115
|
-
transaction submission.
|
|
109
|
+
Pure helpers and record encoders work in browser, Node, and Workers. The client uses `viem` public and wallet clients and requires an RPC URL for chain reads or transaction submission.
|
|
116
110
|
|
|
117
|
-
## Subpath
|
|
111
|
+
## Subpath exports
|
|
118
112
|
|
|
119
113
|
- `@agenticprimitives/agent-naming` — public helpers, client, ABIs, and types.
|
|
120
|
-
- `@agenticprimitives/agent-naming/records` — predicate ids and typed
|
|
121
|
-
|
|
122
|
-
- `@agenticprimitives/agent-naming/custody` — pure encoded call builders for
|
|
123
|
-
name-management transactions.
|
|
114
|
+
- `@agenticprimitives/agent-naming/records` — predicate ids and typed record encode/decode helpers.
|
|
115
|
+
- `@agenticprimitives/agent-naming/custody` — pure encoded call builders for name-management transactions.
|
|
124
116
|
|
|
125
|
-
## Security
|
|
117
|
+
## Security invariants
|
|
126
118
|
|
|
127
|
-
-
|
|
128
|
-
([ADR-0012](../../docs/architecture/decisions/0012-no-eth-getlogs-in-product-read-paths.md)).
|
|
129
|
-
`reverseResolve` string reconstruction is transitional log debt — do not copy.
|
|
130
|
-
- Name normalization is deterministic.
|
|
119
|
+
- Name normalization is deterministic — equal normalizations produce equal namehashes.
|
|
131
120
|
- Reverse resolution must round-trip before it is trusted.
|
|
132
121
|
- Unknown predicates are ignored on decode and rejected by typed encoders.
|
|
133
|
-
- Raw passkey credential IDs are never stored.
|
|
122
|
+
- Raw passkey credential IDs are never stored — only a digest.
|
|
134
123
|
- Endpoint records are discovery hints, not proof of endpoint control.
|
|
124
|
+
- Product reads use `readContract`; no `eth_getLogs` in hot paths ([ADR-0012](../../docs/architecture/decisions/0012-no-eth-getlogs-in-product-read-paths.md)).
|
|
135
125
|
|
|
136
126
|
See [`docs/security.md`](docs/security.md) and [`AUDIT.md`](AUDIT.md).
|
|
137
127
|
|
|
138
|
-
## Documentation
|
|
128
|
+
## Documentation map
|
|
139
129
|
|
|
140
130
|
- [`docs/concepts.md`](docs/concepts.md) — naming model and vocabulary.
|
|
141
131
|
- [`docs/api.md`](docs/api.md) — human-readable public API guide.
|
|
@@ -153,6 +143,10 @@ pnpm check:public-exports
|
|
|
153
143
|
pnpm check:forbidden-terms
|
|
154
144
|
```
|
|
155
145
|
|
|
146
|
+
## Status
|
|
147
|
+
|
|
148
|
+
Testnet/pilot-ready. Production launch is gated on the public checklist in the root [`README.md`](../../README.md#status--honest-version) — including third-party contract audit and governance key rotation. Track every security finding live in [`docs/audits/findings.yaml`](../../docs/audits/findings.yaml).
|
|
149
|
+
|
|
156
150
|
## License
|
|
157
151
|
|
|
158
152
|
UNLICENSED.
|
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Address, type Hex, type WalletClient } from 'viem';
|
|
2
|
-
import type { AgentNameRecords, AgentNamingClientOpts, RegisterSubnameInput, SetAgentRecordsInput, SetPrimaryNameInput, SetSubregistryInput } from './types';
|
|
2
|
+
import type { AgentNameRecords, AgentNamingClientOpts, RegisterSubnameInput, SetAgentRecordsInput, SetPrimaryNameInput, SetSubregistryInput } from './types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Optional per-call submission context. When provided, the write
|
|
5
5
|
* method submits the encoded call via `walletClient.sendTransaction`.
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,OAAO,EAAE,KAAK,GAAG,EAAqB,KAAK,YAAY,EAAE,MAAM,MAAM,CAAC;AAiB9G,OAAO,KAAK,EACV,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,OAAO,EAAE,KAAK,GAAG,EAAqB,KAAK,YAAY,EAAE,MAAM,MAAM,CAAC;AAiB9G,OAAO,KAAK,EACV,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAIpB;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,iBAAiB;IAGhB,QAAQ,CAAC,IAAI,EAAE,qBAAqB;IAFhD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAe;gBAEvB,IAAI,EAAE,qBAAqB;IAWhD;;;;;;;OAOG;IACG,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAaxD;;;;;;;;OAQG;IACG,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAU5D;;;OAGG;IACG,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAwFzD;;;;;;;;;;;;;OAaG;IACG,eAAe,CAAC,KAAK,EAAE,oBAAoB,EAAE,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC;IAwBnF;;;;;OAKG;IACG,cAAc,CAAC,KAAK,EAAE,mBAAmB,EAAE,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC;IAMjF;;;;;;OAMG;IACG,eAAe,CAAC,KAAK,EAAE,oBAAoB,EAAE,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAsBrF;;;;OAIG;IACG,cAAc,CAAC,KAAK,EAAE,mBAAmB,EAAE,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC;IAUjF;;;;OAIG;YACW,OAAO;CAkCtB"}
|
package/dist/client.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { createPublicClient, http } from 'viem';
|
|
2
|
-
import { agentNameAttributeResolverAbi, agentNameRegistryAbi, agentNameUniversalResolverAbi, } from './abis';
|
|
3
|
-
import { PREDICATE_ID, decodeRecords, } from './records';
|
|
4
|
-
import { buildRegisterSubnameCall, buildRecordCalls, buildSetPrimaryNameCall, buildSetSubregistryCall, } from './custody';
|
|
5
|
-
import { namehash, ZERO_NODE } from './namehash';
|
|
2
|
+
import { agentNameAttributeResolverAbi, agentNameRegistryAbi, agentNameUniversalResolverAbi, } from './abis.js';
|
|
3
|
+
import { PREDICATE_ID, decodeRecords, } from './records.js';
|
|
4
|
+
import { buildRegisterSubnameCall, buildRecordCalls, buildSetPrimaryNameCall, buildSetSubregistryCall, } from './custody.js';
|
|
5
|
+
import { namehash, ZERO_NODE } from './namehash.js';
|
|
6
|
+
import { normalizeLabel } from './normalize.js';
|
|
6
7
|
/**
|
|
7
8
|
* Read + write client for the Agent Naming Service.
|
|
8
9
|
*
|
|
@@ -181,11 +182,14 @@ export class AgentNamingClient {
|
|
|
181
182
|
* AgentAccount.execute / CustodyPolicy ceremony instead.
|
|
182
183
|
*/
|
|
183
184
|
async registerSubname(input, ctx) {
|
|
185
|
+
// AN-1: normalize + reject at the client boundary so the on-chain label, the derived child
|
|
186
|
+
// node, and any record writes all reference the same canonical label.
|
|
187
|
+
const label = normalizeLabel(input.label);
|
|
184
188
|
const parentNode = namehash(input.parent);
|
|
185
189
|
const call = buildRegisterSubnameCall({
|
|
186
190
|
registry: this.opts.registry,
|
|
187
191
|
parentNode,
|
|
188
|
-
label
|
|
192
|
+
label,
|
|
189
193
|
newOwner: input.owner,
|
|
190
194
|
resolver: input.resolver,
|
|
191
195
|
});
|
|
@@ -193,7 +197,7 @@ export class AgentNamingClient {
|
|
|
193
197
|
if (input.initialRecords) {
|
|
194
198
|
// Compute the new child node off-chain so we don't have to
|
|
195
199
|
// re-read against a possibly-lagging RPC.
|
|
196
|
-
const childNode = namehash(`${
|
|
200
|
+
const childNode = namehash(`${label}.${input.parent}`);
|
|
197
201
|
const resolver = input.resolver ?? this.opts.universalResolver; // best-effort default
|
|
198
202
|
const calls = buildRecordCalls({ resolver, node: childNode, records: input.initialRecords });
|
|
199
203
|
for (const c of calls)
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAgE,MAAM,MAAM,CAAC;AAC9G,OAAO,EACL,6BAA6B,EAC7B,oBAAoB,EACpB,6BAA6B,GAC9B,MAAM,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAgE,MAAM,MAAM,CAAC;AAC9G,OAAO,EACL,6BAA6B,EAC7B,oBAAoB,EACpB,6BAA6B,GAC9B,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,YAAY,EACZ,aAAa,GAEd,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,wBAAwB,EACxB,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AI,EAAE,CAAC;gBACzC,IAAI,GAAG,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;oBAC/D,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;oBAC9C,SAAS;gBACX,CAAC;gBACD,MAAM,GAAG,CAAC;YACZ,CAAC;QACH,CAAC;QACD,MAAM,OAAO,YAAY,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IACnG,CAAC;CAEF"}
|
package/dist/custody.d.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* walletClient submission on top.
|
|
17
17
|
*/
|
|
18
18
|
import type { Address, Hex } from '@agenticprimitives/types';
|
|
19
|
-
import { type EncodedRecord } from './records';
|
|
19
|
+
import { type EncodedRecord } from './records.js';
|
|
20
20
|
/** Minimal call-shape: the standard `{ to, value, data }` triple. */
|
|
21
21
|
export interface ContractCall {
|
|
22
22
|
to: Address;
|
|
@@ -106,7 +106,7 @@ export declare function buildSetBytes32AttributeCall(args: {
|
|
|
106
106
|
export declare function buildRecordCalls(args: {
|
|
107
107
|
resolver: Address;
|
|
108
108
|
node: Hex;
|
|
109
|
-
records: import('./types').AgentNameRecords;
|
|
109
|
+
records: import('./types.js').AgentNameRecords;
|
|
110
110
|
}): ContractCall[];
|
|
111
111
|
/**
|
|
112
112
|
* Build a call to claim `<label>.<parent>` through a deployed
|
package/dist/custody.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custody.d.ts","sourceRoot":"","sources":["../src/custody.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+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AAI,EAAE,GAAG,CAAC;CACX,GAAG,YAAY,CAUf;AAID,uEAAuE;AACvE,wBAAgB,2BAA2B,CAAC,IAAI,EAAE;IAChD,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,GAAG,CAAC;IACV,SAAS,EAAE,GAAG,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,YAAY,CAUf;AAED,wEAAwE;AACxE,wBAAgB,4BAA4B,CAAC,IAAI,EAAE;IACjD,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,GAAG,CAAC;IACV,SAAS,EAAE,GAAG,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,YAAY,CAUf;AAED,wEAAwE;AACxE,wBAAgB,4BAA4B,CAAC,IAAI,EAAE;IACjD,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,GAAG,CAAC;IACV,SAAS,EAAE,GAAG,CAAC;IACf,KAAK,EAAE,GAAG,CAAC;CACZ,GAAG,YAAY,CAUf;AAID;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE;IACrC,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,GAAG,CAAC;IACV,OAAO,EAAE,OAAO,YAAY,EAAE,gBAAgB,CAAC;CAChD,GAAG,YAAY,EAAE,CAsCjB;AAID;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE;IACjD,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;CACnB,GAAG,YAAY,CAYf;AAED;;;;;GAKG;AACH,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
package/dist/custody.js
CHANGED
|
@@ -16,8 +16,9 @@
|
|
|
16
16
|
* walletClient submission on top.
|
|
17
17
|
*/
|
|
18
18
|
import { encodeFunctionData } from 'viem';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
19
|
+
import { normalizeLabel } from './normalize.js';
|
|
20
|
+
import { agentNameAttributeResolverAbi, agentNameRegistryAbi, permissionlessSubregistryAbi, } from './abis.js';
|
|
21
|
+
import { PREDICATE_ID, AGENT_KIND_ID } from './records.js';
|
|
21
22
|
// ─── Registry writes ───────────────────────────────────────────────
|
|
22
23
|
/**
|
|
23
24
|
* Build a call to register `<label>.<parent>` under the parent
|
|
@@ -25,6 +26,8 @@ import { PREDICATE_ID, AGENT_KIND_ID } from './records';
|
|
|
25
26
|
* delegate (msg.sender check on chain).
|
|
26
27
|
*/
|
|
27
28
|
export function buildRegisterSubnameCall(args) {
|
|
29
|
+
// AN-1: normalize + reject on the WRITE path (homoglyph/case/zero-width squat defense).
|
|
30
|
+
const label = normalizeLabel(args.label);
|
|
28
31
|
return {
|
|
29
32
|
to: args.registry,
|
|
30
33
|
value: 0n,
|
|
@@ -33,7 +36,7 @@ export function buildRegisterSubnameCall(args) {
|
|
|
33
36
|
functionName: 'register',
|
|
34
37
|
args: [
|
|
35
38
|
args.parentNode,
|
|
36
|
-
|
|
39
|
+
label,
|
|
37
40
|
args.newOwner,
|
|
38
41
|
args.resolver ?? '0x0000000000000000000000000000000000000000',
|
|
39
42
|
args.expiry ?? 0n,
|
|
@@ -201,13 +204,15 @@ export function buildRecordCalls(args) {
|
|
|
201
204
|
* has previously claimed a name through this subregistry instance.
|
|
202
205
|
*/
|
|
203
206
|
export function buildSubregistryRegisterCall(args) {
|
|
207
|
+
// AN-1: normalize + reject on the WRITE path (homoglyph/case/zero-width squat defense).
|
|
208
|
+
const label = normalizeLabel(args.label);
|
|
204
209
|
return {
|
|
205
210
|
to: args.subregistry,
|
|
206
211
|
value: 0n,
|
|
207
212
|
data: encodeFunctionData({
|
|
208
213
|
abi: permissionlessSubregistryAbi,
|
|
209
214
|
functionName: 'register',
|
|
210
|
-
args: [
|
|
215
|
+
args: [label, args.newOwner],
|
|
211
216
|
}),
|
|
212
217
|
};
|
|
213
218
|
}
|
package/dist/custody.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custody.js","sourceRoot":"","sources":["../src/custody.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,EACL,6BAA6B,EAC7B,oBAAoB,EACpB,4BAA4B,GAC7B,MAAM,
|
|
1
|
+
{"version":3,"file":"custody.js","sourceRoot":"","sources":["../src/custody.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EACL,6BAA6B,EAC7B,oBAAoB,EACpB,4BAA4B,GAC7B,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAsB,MAAM,cAAc,CAAC;AAU/E,sEAAsE;AAEtE;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAOxC;IACC,wFAAwF;IACxF,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACzC,OAAO;QACL,EAAE,EAAE,IAAI,CAAC,QAAQ;QACjB,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,kBAAkB,CAAC;YACvB,GAAG,EAAE,oBAAoB;YACzB,YAAY,EAAE,UAAU;YACxB,IAAI,EAAE;gBACJ,IAAI,CAAC,UAAU;gBACf,KAAK;gBACL,IAAI,CAAC,QAAQ;gBACb,IAAI,CAAC,QAAQ,IAAK,4CAAwD;gBAC1E,IAAI,CAAC,MAAM,IAAI,EAAE;aAClB;SACF,CAAC;KACH,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAIxC;IACC,OAAO;QACL,EAAE,EAAE,IAAI,CAAC,QAAQ;QACjB,KAAK,EAAE,EAAE;QACT,IAAI,EAA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AAI,EAAE,kBAAkB,CAAC;YACvB,GAAG,EAAE,4BAA4B;YACjC,YAAY,EAAE,UAAU;YACxB,IAAI,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;SAC7B,CAAC;KACH,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { AGENT_TLD, type AgentTld } from './constants';
|
|
2
|
-
export { normalizeAgentName, isValidAgentName } from './normalize';
|
|
3
|
-
export { labelhash, namehash, ZERO_NODE } from './namehash';
|
|
4
|
-
export { InvalidNameError, NameNotFoundError, UnauthorizedNameOwnerError, } from './errors';
|
|
5
|
-
export type { AgentKind, AgentNameRecords, RegisterSubnameInput, SetPrimaryNameInput, SetAgentRecordsInput, SetSubregistryInput, AgentNamingClientOpts, } from './types';
|
|
6
|
-
export { AgentNamingClient, type WriteContext } from './client';
|
|
7
|
-
export { buildRegisterSubnameCall, buildRotateNameOwnerCall, buildRotateNameResolverCall, buildSetSubregistryCall, buildSetPrimaryNameCall, buildSetStringAttributeCall, buildSetAddressAttributeCall, buildSetBytes32AttributeCall, buildRecordCalls, buildSubregistryRegisterCall, type ContractCall, } from './custody';
|
|
8
|
-
export { agentNameRegistryAbi, agentNameAttributeResolverAbi, agentNameUniversalResolverAbi, ontologyTermRegistryAbi, shapeRegistryAbi, permissionlessSubregistryAbi, } from './abis';
|
|
9
|
-
export { PREDICATE_ID, AGENT_KIND_ID, CLASS_AGENT_NAME, AGENT_KIND_ENUM, CAIP10_NAMESPACE_ALLOWLIST, encodeRecords, decodeRecords, type PredicateName, type EncodedRecord, type DecodeInput, } from './records';
|
|
1
|
+
export { AGENT_TLD, type AgentTld } from './constants.js';
|
|
2
|
+
export { normalizeAgentName, normalizeLabel, isValidAgentName } from './normalize.js';
|
|
3
|
+
export { labelhash, namehash, ZERO_NODE } from './namehash.js';
|
|
4
|
+
export { InvalidNameError, NameNotFoundError, UnauthorizedNameOwnerError, } from './errors.js';
|
|
5
|
+
export type { AgentKind, AgentNameRecords, RegisterSubnameInput, SetPrimaryNameInput, SetAgentRecordsInput, SetSubregistryInput, AgentNamingClientOpts, } from './types.js';
|
|
6
|
+
export { AgentNamingClient, type WriteContext } from './client.js';
|
|
7
|
+
export { buildRegisterSubnameCall, buildRotateNameOwnerCall, buildRotateNameResolverCall, buildSetSubregistryCall, buildSetPrimaryNameCall, buildSetStringAttributeCall, buildSetAddressAttributeCall, buildSetBytes32AttributeCall, buildRecordCalls, buildSubregistryRegisterCall, type ContractCall, } from './custody.js';
|
|
8
|
+
export { agentNameRegistryAbi, agentNameAttributeResolverAbi, agentNameUniversalResolverAbi, ontologyTermRegistryAbi, shapeRegistryAbi, permissionlessSubregistryAbi, } from './abis.js';
|
|
9
|
+
export { PREDICATE_ID, AGENT_KIND_ID, CLASS_AGENT_NAME, AGENT_KIND_ENUM, CAIP10_NAMESPACE_ALLOWLIST, encodeRecords, decodeRecords, type PredicateName, type EncodedRecord, type DecodeInput, } from './records.js';
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,KAAK,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,iBAAiB,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAInE,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,2BAA2B,EAC3B,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC3B,4BAA4B,EAC5B,4BAA4B,EAC5B,gBAAgB,EAChB,4BAA4B,EAC5B,KAAK,YAAY,GAClB,MAAM,cAAc,CAAC;AAKtB,OAAO,EACL,oBAAoB,EACpB,6BAA6B,EAC7B,6BAA6B,EAC7B,uBAAuB,EACvB,gBAAgB,EAChB,4BAA4B,GAC7B,MAAM,WAAW,CAAC;AAInB,OAAO,EACL,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,0BAA0B,EAC1B,aAAa,EACb,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,WAAW,GACjB,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,19 +4,19 @@
|
|
|
4
4
|
// - capability.manifest.json — boundary
|
|
5
5
|
// - CLAUDE.md — doctrine
|
|
6
6
|
// - specs/215-agent-naming.md — the contract
|
|
7
|
-
export { AGENT_TLD } from './constants';
|
|
8
|
-
export { normalizeAgentName, isValidAgentName } from './normalize';
|
|
9
|
-
export { labelhash, namehash, ZERO_NODE } from './namehash';
|
|
10
|
-
export { InvalidNameError, NameNotFoundError, UnauthorizedNameOwnerError, } from './errors';
|
|
11
|
-
export { AgentNamingClient } from './client';
|
|
7
|
+
export { AGENT_TLD } from './constants.js';
|
|
8
|
+
export { normalizeAgentName, normalizeLabel, isValidAgentName } from './normalize.js';
|
|
9
|
+
export { labelhash, namehash, ZERO_NODE } from './namehash.js';
|
|
10
|
+
export { InvalidNameError, NameNotFoundError, UnauthorizedNameOwnerError, } from './errors.js';
|
|
11
|
+
export { AgentNamingClient } from './client.js';
|
|
12
12
|
// Phase 4 pure call builders (subpath `@agenticprimitives/agent-naming/custody`
|
|
13
13
|
// re-exported from top-level for convenience).
|
|
14
|
-
export { buildRegisterSubnameCall, buildRotateNameOwnerCall, buildRotateNameResolverCall, buildSetSubregistryCall, buildSetPrimaryNameCall, buildSetStringAttributeCall, buildSetAddressAttributeCall, buildSetBytes32AttributeCall, buildRecordCalls, buildSubregistryRegisterCall, } from './custody';
|
|
14
|
+
export { buildRegisterSubnameCall, buildRotateNameOwnerCall, buildRotateNameResolverCall, buildSetSubregistryCall, buildSetPrimaryNameCall, buildSetStringAttributeCall, buildSetAddressAttributeCall, buildSetBytes32AttributeCall, buildRecordCalls, buildSubregistryRegisterCall, } from './custody.js';
|
|
15
15
|
// Phase 3 contract ABIs (live at deployed addresses recorded in
|
|
16
16
|
// packages/contracts/deployments-<network>.json). ADR-0009 pivot: the
|
|
17
17
|
// resolver inherits the shared `AttributeStorage` + ontology stack.
|
|
18
|
-
export { agentNameRegistryAbi, agentNameAttributeResolverAbi, agentNameUniversalResolverAbi, ontologyTermRegistryAbi, shapeRegistryAbi, permissionlessSubregistryAbi, } from './abis';
|
|
18
|
+
export { agentNameRegistryAbi, agentNameAttributeResolverAbi, agentNameUniversalResolverAbi, ontologyTermRegistryAbi, shapeRegistryAbi, permissionlessSubregistryAbi, } from './abis.js';
|
|
19
19
|
// Ontology predicate ids (bytes32 mirror of AgentNamePredicates.sol) +
|
|
20
20
|
// CAIP-10 helpers + typed encoder / decoder.
|
|
21
|
-
export { PREDICATE_ID, AGENT_KIND_ID, CLASS_AGENT_NAME, AGENT_KIND_ENUM, CAIP10_NAMESPACE_ALLOWLIST, encodeRecords, decodeRecords, } from './records';
|
|
21
|
+
export { PREDICATE_ID, AGENT_KIND_ID, CLASS_AGENT_NAME, AGENT_KIND_ENUM, CAIP10_NAMESPACE_ALLOWLIST, encodeRecords, decodeRecords, } from './records.js';
|
|
22
22
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,EAAE;AACF,OAAO;AACP,0CAA0C;AAC1C,2BAA2B;AAC3B,+CAA+C;AAE/C,OAAO,EAAE,SAAS,EAAiB,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,EAAE;AACF,OAAO;AACP,0CAA0C;AAC1C,2BAA2B;AAC3B,+CAA+C;AAE/C,OAAO,EAAE,SAAS,EAAiB,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AAUrB,OAAO,EAAE,iBAAiB,EAAqB,MAAM,aAAa,CAAC;AAEnE,gFAAgF;AAChF,+CAA+C;AAC/C,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,2BAA2B,EAC3B,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC3B,4BAA4B,EAC5B,4BAA4B,EAC5B,gBAAgB,EAChB,4BAA4B,GAE7B,MAAM,cAAc,CAAC;AAEtB,gEAAgE;AAChE,sEAAsE;AACtE,oEAAoE;AACpE,OAAO,EACL,oBAAoB,EACpB,6BAA6B,EAC7B,6BAA6B,EAC7B,uBAAuB,EACvB,gBAAgB,EAChB,4BAA4B,GAC7B,MAAM,WAAW,CAAC;AAEnB,uEAAuE;AACvE,6CAA6C;AAC7C,OAAO,EACL,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,0BAA0B,EAC1B,aAAa,EACb,aAAa,GAId,MAAM,cAAc,CAAC"}
|
package/dist/namehash.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Hex } from 'viem';
|
|
2
2
|
/**
|
|
3
|
-
* Compute the namehash of an agent name
|
|
3
|
+
* Compute the recursive namehash of an agent name
|
|
4
|
+
* (`keccak256(parentNode || labelhash)` convention).
|
|
4
5
|
*
|
|
5
6
|
* namehash('') = 0x00…00
|
|
6
7
|
* namehash('agent') = keccak256(namehash('') || labelhash('agent'))
|
|
@@ -13,7 +14,7 @@ import { type Hex } from 'viem';
|
|
|
13
14
|
*
|
|
14
15
|
* Throws `InvalidNameError` (via `normalizeAgentName`) on malformed
|
|
15
16
|
* input. Passing `''` returns `0x00…00` — the canonical "empty / root"
|
|
16
|
-
* sentinel matching the
|
|
17
|
+
* sentinel matching the recursive-namehash convention.
|
|
17
18
|
*/
|
|
18
19
|
export declare function namehash(name: string): Hex;
|
|
19
20
|
/**
|
package/dist/namehash.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"namehash.d.ts","sourceRoot":"","sources":["../src/namehash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAGlE
|
|
1
|
+
{"version":3,"file":"namehash.d.ts","sourceRoot":"","sources":["../src/namehash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAGlE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAW1C;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAE5C;AAED,sEAAsE;AACtE,eAAO,MAAM,SAAS,EAAE,GAA0E,CAAC"}
|
package/dist/namehash.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { keccak256, encodePacked, toBytes } from 'viem';
|
|
2
|
-
import { normalizeAgentName } from './normalize';
|
|
2
|
+
import { normalizeAgentName } from './normalize.js';
|
|
3
3
|
/**
|
|
4
|
-
* Compute the namehash of an agent name
|
|
4
|
+
* Compute the recursive namehash of an agent name
|
|
5
|
+
* (`keccak256(parentNode || labelhash)` convention).
|
|
5
6
|
*
|
|
6
7
|
* namehash('') = 0x00…00
|
|
7
8
|
* namehash('agent') = keccak256(namehash('') || labelhash('agent'))
|
|
@@ -14,7 +15,7 @@ import { normalizeAgentName } from './normalize';
|
|
|
14
15
|
*
|
|
15
16
|
* Throws `InvalidNameError` (via `normalizeAgentName`) on malformed
|
|
16
17
|
* input. Passing `''` returns `0x00…00` — the canonical "empty / root"
|
|
17
|
-
* sentinel matching the
|
|
18
|
+
* sentinel matching the recursive-namehash convention.
|
|
18
19
|
*/
|
|
19
20
|
export function namehash(name) {
|
|
20
21
|
if (name === '')
|
|
@@ -22,7 +23,7 @@ export function namehash(name) {
|
|
|
22
23
|
const labels = normalizeAgentName(name).split('.');
|
|
23
24
|
let node = ZERO_NODE;
|
|
24
25
|
// Walk from rightmost (TLD-side) label inward so the root anchors
|
|
25
|
-
// the recursion —
|
|
26
|
+
// the recursion — the standard recursive-namehash algorithm.
|
|
26
27
|
for (let i = labels.length - 1; i >= 0; i--) {
|
|
27
28
|
const lh = labelhash(labels[i]);
|
|
28
29
|
node = keccak256(encodePacked(['bytes32', 'bytes32'], [node, lh]));
|
package/dist/namehash.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"namehash.js","sourceRoot":"","sources":["../src/namehash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAY,MAAM,MAAM,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"namehash.js","sourceRoot":"","sources":["../src/namehash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAY,MAAM,MAAM,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,IAAI,IAAI,KAAK,EAAE;QAAE,OAAO,SAAS,CAAC;IAClC,MAAM,MAAM,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnD,IAAI,IAAI,GAAQ,SAAS,CAAC;IAC1B,kEAAkE;IAClE,6DAA6D;IAC7D,KAAK,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5C,MAAM,EAAE,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAE,CAAC,CAAC;QACjC,IAAI,GAAG,SAAS,CAAC,YAAY,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,SAAS,CAAC,KAAa;IACrC,OAAO,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;AACnC,CAAC;AAED,sEAAsE;AACtE,MAAM,CAAC,MAAM,SAAS,GAAQ,oEAAoE,CAAC"}
|
package/dist/normalize.d.ts
CHANGED
|
@@ -20,6 +20,15 @@
|
|
|
20
20
|
* `namehash` so the namehash is computed against the canonical form.
|
|
21
21
|
*/
|
|
22
22
|
export declare function normalizeAgentName(name: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Normalize + validate a SINGLE label (no dots) to canonical form, throwing
|
|
25
|
+
* `InvalidNameError` on any rule violation. AN-1 (audit 2026-06-09): the registration WRITE
|
|
26
|
+
* path MUST run this so a homoglyph / mixed-case / zero-width label can never be anchored as a
|
|
27
|
+
* node whose raw stored label renders indistinguishably from a real name. Two inputs that
|
|
28
|
+
* normalize identically MUST hash identically — so the write path and the read/derive path
|
|
29
|
+
* (`normalizeAgentName` → `namehash`) agree.
|
|
30
|
+
*/
|
|
31
|
+
export declare function normalizeLabel(label: string): string;
|
|
23
32
|
/**
|
|
24
33
|
* Predicate variant — returns true / false instead of throwing.
|
|
25
34
|
* Useful for UI input validation.
|
package/dist/normalize.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../src/normalize.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAavD;
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../src/normalize.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAavD;AAID;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAUpD;AAuBD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAOtD"}
|
package/dist/normalize.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InvalidNameError } from './errors';
|
|
1
|
+
import { InvalidNameError } from './errors.js';
|
|
2
2
|
/**
|
|
3
3
|
* Normalize an agent name to canonical form.
|
|
4
4
|
*
|
|
@@ -35,6 +35,25 @@ export function normalizeAgentName(name) {
|
|
|
35
35
|
return labels.join('.');
|
|
36
36
|
}
|
|
37
37
|
const LABEL_RE = /^[a-z0-9-]+$/;
|
|
38
|
+
/**
|
|
39
|
+
* Normalize + validate a SINGLE label (no dots) to canonical form, throwing
|
|
40
|
+
* `InvalidNameError` on any rule violation. AN-1 (audit 2026-06-09): the registration WRITE
|
|
41
|
+
* path MUST run this so a homoglyph / mixed-case / zero-width label can never be anchored as a
|
|
42
|
+
* node whose raw stored label renders indistinguishably from a real name. Two inputs that
|
|
43
|
+
* normalize identically MUST hash identically — so the write path and the read/derive path
|
|
44
|
+
* (`normalizeAgentName` → `namehash`) agree.
|
|
45
|
+
*/
|
|
46
|
+
export function normalizeLabel(label) {
|
|
47
|
+
if (typeof label !== 'string') {
|
|
48
|
+
throw new InvalidNameError(String(label), 'must be a string');
|
|
49
|
+
}
|
|
50
|
+
const norm = label.normalize('NFC').trim().toLowerCase();
|
|
51
|
+
if (norm.includes('.')) {
|
|
52
|
+
throw new InvalidNameError(label, 'a label MUST NOT contain "." (register one label at a time)');
|
|
53
|
+
}
|
|
54
|
+
validateLabel(label, norm);
|
|
55
|
+
return norm;
|
|
56
|
+
}
|
|
38
57
|
function validateLabel(fullName, label) {
|
|
39
58
|
if (label.length === 0) {
|
|
40
59
|
throw new InvalidNameError(fullName, 'empty label (consecutive dots or leading/trailing dot)');
|
package/dist/normalize.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize.js","sourceRoot":"","sources":["../src/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"normalize.js","sourceRoot":"","sources":["../src/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,MAAM,IAAI,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAC,CAAC;IAC/D,CAAC;IACD,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAA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AI,gBAAgB,CAAC,QAAQ,EAAE,UAAU,KAAK,oBAAoB,CAAC,CAAC;IAC5E,CAAC;IACD,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,gBAAgB,CAAC,QAAQ,EAAE,UAAU,KAAK,sBAAsB,CAAC,CAAC;IAC9E,CAAC;IACD,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,gBAAgB,CAAC,QAAQ,EAAE,UAAU,KAAK,oBAAoB,CAAC,CAAC;IAC5E,CAAC;IACD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,gBAAgB,CACxB,QAAQ,EACR,UAAU,KAAK,2CAA2C,CAC3D,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,IAAI,CAAC;QACH,kBAAkB,CAAC,IAAI,CAAC,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/dist/records.d.ts
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* predicates (fail-loud on write).
|
|
26
26
|
*/
|
|
27
27
|
import { type Hex } from 'viem';
|
|
28
|
-
import type { AgentKind, AgentNameRecords } from './types';
|
|
28
|
+
import type { AgentKind, AgentNameRecords } from './types.js';
|
|
29
29
|
export declare const PREDICATE_ID: {
|
|
30
30
|
readonly addr: `0x${string}`;
|
|
31
31
|
readonly agentKind: `0x${string}`;
|
package/dist/records.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../src/records.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAoB,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,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;IACvC,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,MAAM,EAAE,CAAC,CAAC,CAAC;IAC/C,QAAQ,EAAG,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;CACtC;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,gBAAgB,CA0BlE"}
|
package/docs/api.md
CHANGED
|
@@ -7,7 +7,7 @@ This is the human-readable guide to the public exports in
|
|
|
7
7
|
|
|
8
8
|
- `AGENT_TLD`: the canonical top-level label, currently `"agent"`.
|
|
9
9
|
- `AgentTld`: type of the canonical top-level label.
|
|
10
|
-
- `ZERO_NODE`: the all-zero
|
|
10
|
+
- `ZERO_NODE`: the all-zero root node.
|
|
11
11
|
|
|
12
12
|
## Name Helpers
|
|
13
13
|
|
|
@@ -15,7 +15,7 @@ This is the human-readable guide to the public exports in
|
|
|
15
15
|
throws `InvalidNameError`.
|
|
16
16
|
- `isValidAgentName(name)`: boolean wrapper around `normalizeAgentName`.
|
|
17
17
|
- `labelhash(label)`: keccak256 hash of a single label.
|
|
18
|
-
- `namehash(name)`:
|
|
18
|
+
- `namehash(name)`: recursive namehash (`keccak256(parentNode || labelhash)`) of a normalized name.
|
|
19
19
|
|
|
20
20
|
## Client
|
|
21
21
|
|
package/docs/concepts.md
CHANGED
|
@@ -43,7 +43,7 @@ This avoids Unicode spoofing until a full IDN/punycode policy exists.
|
|
|
43
43
|
|
|
44
44
|
## Node And Namehash
|
|
45
45
|
|
|
46
|
-
A node is the
|
|
46
|
+
A node is the recursive `bytes32` namehash (`keccak256(parentNode || labelhash)`) of a normalized name.
|
|
47
47
|
|
|
48
48
|
```ts
|
|
49
49
|
namehash('agent');
|
package/docs/migration.md
CHANGED
|
@@ -90,4 +90,4 @@ Expected future migration areas:
|
|
|
90
90
|
- Generated API docs or manifest-doc synchronization.
|
|
91
91
|
- Example typecheck enforcement.
|
|
92
92
|
- Stable deployment address package.
|
|
93
|
-
- Optional compatibility layer for external
|
|
93
|
+
- Optional compatibility layer for external on-chain name resolvers.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticprimitives/agent-naming",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Agent Naming Service SDK:
|
|
3
|
+
"version": "1.0.0-alpha.11",
|
|
4
|
+
"description": "Agent Naming Service SDK: hierarchical naming for Smart Agents (.agent TLD). Owns name normalization, namehash/labelhash, records schemas, and the AgentNamingClient (resolve / reverse / registry). Speaks naming-domain vocabulary only — no delegation / caveat / custody concepts.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -43,19 +43,19 @@
|
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"viem": "^2.
|
|
47
|
-
"@agenticprimitives/agent-account": "
|
|
48
|
-
"@agenticprimitives/connect-auth": "
|
|
49
|
-
"@agenticprimitives/types": "
|
|
46
|
+
"viem": "^2.52.2",
|
|
47
|
+
"@agenticprimitives/agent-account": "1.0.0-alpha.11",
|
|
48
|
+
"@agenticprimitives/connect-auth": "1.0.0-alpha.11",
|
|
49
|
+
"@agenticprimitives/types": "1.0.0-alpha.11"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/node": "^22.7.0",
|
|
53
|
-
"vitest": "^
|
|
53
|
+
"vitest": "^4.1.8"
|
|
54
54
|
},
|
|
55
55
|
"keywords": [
|
|
56
56
|
"agent",
|
|
57
57
|
"naming",
|
|
58
|
-
"
|
|
58
|
+
"namehash",
|
|
59
59
|
"smart-agent",
|
|
60
60
|
"agentic"
|
|
61
61
|
],
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"build": "tsc -p tsconfig.build.json",
|
|
64
64
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
65
65
|
"test": "vitest run",
|
|
66
|
-
"test:unit": "vitest run test/normalize.test.ts test/namehash.test.ts test/records.test.ts",
|
|
67
|
-
"test:integration": "vitest run test/integration.test.ts",
|
|
66
|
+
"test:unit": "vitest run test/normalize.test.ts test/namehash.test.ts test/records.test.ts --passWithNoTests",
|
|
67
|
+
"test:integration": "vitest run test/integration.test.ts --passWithNoTests",
|
|
68
68
|
"test:watch": "vitest",
|
|
69
69
|
"clean": "rm -rf dist"
|
|
70
70
|
}
|