@ens-node-metadata/agent 0.2.1 → 0.2.2

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.
Files changed (2) hide show
  1. package/README.md +2 -110
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -8,119 +8,11 @@ CLI for registering AI agents on ENS using [ERC-8004](https://best-practices.800
8
8
  pnpm dlx @ens-node-metadata/agent --help
9
9
  ```
10
10
 
11
- ## Commands
12
-
13
- ```sh
14
- agent skill [--install]
15
- Print SKILL.md. With --install, copy it to the current directory.
16
-
17
- agent registration-file template
18
- Print an empty ERC-8004 v2.0 registration JSON to stdout.
19
-
20
- agent registration-file validate <registration-file.json>
21
- Validate against Zod schema. Prints ✅ or errors ❌.
22
- Emits WA031 deprecation warning if the legacy `endpoints` field is used.
23
-
24
- agent registration-file publish <registration-file.json>
25
- Publish to IPFS via @web3-storage/w3up-client. Prints the ipfs:// URI.
26
- Requires: W3_PRINCIPAL, W3_PROOF env vars (see below).
27
-
28
- agent registry identity --chain-name <chain> <agent-uri>
29
- Read the ERC-8004 Identity Registry for the given chain.
30
- Supported chains: base, mainnet.
31
- Requires: ERC8004_REGISTRY_<CHAIN> env var.
32
-
33
- agent metadata template
34
- Print a starter ENS metadata payload JSON (the text records to set).
35
-
36
- agent metadata validate <payload.json>
37
- Validate ENS metadata payload against the agent schema.
38
-
39
- agent register <ENS> <payload.json> --private-key <key> [--broadcast]
40
- Build ENS setTextRecords transaction. Dry run by default; --broadcast submits it.
41
- Uses viem + @ensdomains/ensjs.
42
-
43
- agent update <ENS> <payload.json> --private-key <key> [--broadcast]
44
- Same as register — for updating existing records.
45
- ```
46
-
47
- ## Environment Variables
48
-
49
- Optional
50
-
51
- * PINATA_API_KEY
52
- * PINATA_API_SECRET
53
- * PINATA_JWT
54
-
55
- ## ERC-8004 v2.0 Registration File
56
-
57
- The registration file is a JSON document published to IPFS or HTTPS. Its `ipfs://` URI is stored as the `agent-uri` ENS text record.
58
-
59
- ```json
60
- {
61
- "type": "Agent",
62
- "name": "My Agent",
63
- "description": "Does useful things on-chain.",
64
- "services": [
65
- { "name": "MCP", "endpoint": "https://myagent.example.com/mcp", "version": "1.0" },
66
- { "name": "A2A", "endpoint": "https://myagent.example.com/a2a", "version": "0.3" }
67
- ],
68
- "x402Support": false,
69
- "active": true,
70
- "registrations": [],
71
- "supportedTrust": ["reputation"]
72
- }
73
- ```
74
-
75
- > ⚠️ **v2.0 migration:** The field name changed from `endpoints` → `services` (Jan 2026).
76
- > The CLI accepts `endpoints` for backward compatibility with a WA031 deprecation warning.
77
-
78
11
  ## Registration Flow
79
12
 
80
- 1. `agent registration-file template > registration.json` — create the file
81
- 2. Edit `registration.json`
82
- 3. `agent registration-file validate registration.json` — validate
83
- 4. `agent registration-file publish registration.json` — publish to IPFS → get `ipfs://` URI
84
- 5. `agent metadata template > payload.json` — create the ENS record payload
85
- 6. Set `agent-uri` to the `ipfs://` URI in `payload.json`
86
- 7. `agent metadata validate payload.json` — validate
87
- 8. `agent register myagent.eth payload.json --private-key $PK --broadcast` — register
88
-
89
13
  See [SKILL.md](./SKILL.md) for the full step-by-step guide.
90
14
 
91
- ## TypeScript API
92
-
93
- ```ts
94
- import {
95
- buildRegistrationFile,
96
- validateRegistrationFile,
97
- AgentRegistrationFileSchema,
98
- } from "@ens-node-metadata/agent";
99
-
100
- // Build a registration file
101
- const file = buildRegistrationFile({
102
- name: "My AI Agent",
103
- description: "Does useful things on-chain.",
104
- services: [
105
- { name: "MCP", endpoint: "https://myagent.example.com/mcp", version: "1.0" },
106
- ],
107
- active: true,
108
- supportedTrust: ["reputation"],
109
- });
110
-
111
- // Validate an untrusted payload
112
- const raw = JSON.parse(maybeInvalidJson);
113
- const result = validateRegistrationFile(raw);
114
- if (result.success) {
115
- console.log(result.data.name);
116
- // Check for legacy `endpoints` field usage
117
- if (result.data._legacyEndpoints) {
118
- console.warn("WA031: migrate from `endpoints` to `services`");
119
- }
120
- }
121
- ```
122
-
123
15
  ## Related Packages
124
16
 
125
- * [`@ens-node-metadata/schemas`](../schemas) — JSON schemas for all ENS node types
126
- * [`@ens-node-metadata/sdk`](../sdk) — ENS metadata read SDK
17
+ * [`@ens-node-metadata/schemas`](#TODO) — JSON schemas for all ENS node types
18
+ * [`@ens-node-metadata/sdk`](https://www.npmjs.com/package/@ens-node-metadata/sdk) — ENS metadata read SDK
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ens-node-metadata/agent",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "CLI for registering AI agents on ENS using ERC-8004",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",