@ens-node-metadata/agent 0.2.0 → 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 (48) hide show
  1. package/README.md +2 -110
  2. package/dist/cli.d.ts +0 -2
  3. package/dist/cli.js +9 -7
  4. package/dist/index.d.ts +188 -5
  5. package/dist/index.js +63 -4
  6. package/package.json +8 -4
  7. package/dist/cli.d.ts.map +0 -1
  8. package/dist/commands/metadata/set.d.ts +0 -21
  9. package/dist/commands/metadata/set.d.ts.map +0 -1
  10. package/dist/commands/metadata/set.js +0 -75
  11. package/dist/commands/metadata/template.d.ts +0 -4
  12. package/dist/commands/metadata/template.d.ts.map +0 -1
  13. package/dist/commands/metadata/template.js +0 -7
  14. package/dist/commands/metadata/validate.d.ts +0 -10
  15. package/dist/commands/metadata/validate.d.ts.map +0 -1
  16. package/dist/commands/metadata/validate.js +0 -44
  17. package/dist/commands/register.d.ts +0 -21
  18. package/dist/commands/register.d.ts.map +0 -1
  19. package/dist/commands/register.js +0 -76
  20. package/dist/commands/registration-file/publish.d.ts +0 -10
  21. package/dist/commands/registration-file/publish.d.ts.map +0 -1
  22. package/dist/commands/registration-file/publish.js +0 -79
  23. package/dist/commands/registration-file/template.d.ts +0 -3
  24. package/dist/commands/registration-file/template.d.ts.map +0 -1
  25. package/dist/commands/registration-file/template.js +0 -48
  26. package/dist/commands/registration-file/validate.d.ts +0 -10
  27. package/dist/commands/registration-file/validate.d.ts.map +0 -1
  28. package/dist/commands/registration-file/validate.js +0 -35
  29. package/dist/commands/registry/identity.d.ts +0 -18
  30. package/dist/commands/registry/identity.d.ts.map +0 -1
  31. package/dist/commands/registry/identity.js +0 -115
  32. package/dist/commands/skill.d.ts +0 -16
  33. package/dist/commands/skill.d.ts.map +0 -1
  34. package/dist/commands/skill.js +0 -53
  35. package/dist/commands/update.d.ts +0 -21
  36. package/dist/commands/update.d.ts.map +0 -1
  37. package/dist/commands/update.js +0 -76
  38. package/dist/index.d.ts.map +0 -1
  39. package/dist/lib/ens-write.d.ts +0 -6
  40. package/dist/lib/ens-write.d.ts.map +0 -1
  41. package/dist/lib/ens-write.js +0 -23
  42. package/dist/lib/ui.d.ts +0 -6
  43. package/dist/lib/ui.d.ts.map +0 -1
  44. package/dist/lib/ui.js +0 -14
  45. package/dist/types.d.ts +0 -181
  46. package/dist/types.d.ts.map +0 -1
  47. package/dist/types.js +0 -84
  48. package/src/index.ts +0 -8
@@ -1,23 +0,0 @@
1
- import { http, createPublicClient, createWalletClient } from 'viem';
2
- import { privateKeyToAccount } from 'viem/accounts';
3
- import { mainnet } from 'viem/chains';
4
- export async function setEnsTextRecords(ensName, texts, privateKey) {
5
- const { addEnsContracts } = await import('@ensdomains/ensjs');
6
- const { setRecords } = await import('@ensdomains/ensjs/wallet');
7
- const { getResolver } = await import('@ensdomains/ensjs/public');
8
- const account = privateKeyToAccount(privateKey);
9
- const chain = addEnsContracts(mainnet);
10
- const publicClient = createPublicClient({ chain, transport: http() });
11
- const walletClient = createWalletClient({ account, chain, transport: http() });
12
- const resolverAddress = await getResolver(publicClient, { name: ensName });
13
- if (!resolverAddress) {
14
- throw new Error(`No resolver found for ${ensName}. Set a resolver first.`);
15
- }
16
- const hash = await setRecords(walletClient, {
17
- name: ensName,
18
- texts,
19
- coins: [],
20
- resolverAddress,
21
- });
22
- return hash;
23
- }
package/dist/lib/ui.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import type { ZodIssue } from 'zod';
3
- export declare function ZodIssueList({ issues }: {
4
- issues: ZodIssue[];
5
- }): React.JSX.Element;
6
- //# sourceMappingURL=ui.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/lib/ui.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AAEnC,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,QAAQ,EAAE,CAAA;CAAE,qBAe9D"}
package/dist/lib/ui.js DELETED
@@ -1,14 +0,0 @@
1
- import { Box, Text } from 'ink';
2
- import React from 'react';
3
- export function ZodIssueList({ issues }) {
4
- return (React.createElement(React.Fragment, null, issues.map((issue) => {
5
- const path = issue.path.length > 0 ? issue.path.join('.') : '(root)';
6
- return (React.createElement(Box, { key: `${path}.${issue.message}` },
7
- React.createElement(Text, { color: "red" },
8
- ' ',
9
- "[",
10
- path,
11
- "] ",
12
- issue.message)));
13
- })));
14
- }
package/dist/types.d.ts DELETED
@@ -1,181 +0,0 @@
1
- /**
2
- * Zod schema for ERC-8004 v2.0 agent registration files.
3
- * @see https://best-practices.8004scan.io/docs/01-agent-metadata-standard.html
4
- */
5
- import { z } from 'zod';
6
- export declare const SCHEMA_8004_V2: z.ZodObject<{
7
- type: z.ZodLiteral<"https://eips.ethereum.org/EIPS/eip-8004#registration-v1">;
8
- name: z.ZodString;
9
- description: z.ZodString;
10
- image: z.ZodOptional<z.ZodString>;
11
- services: z.ZodArray<z.ZodDiscriminatedUnion<"name", [z.ZodObject<{
12
- name: z.ZodLiteral<"MCP">;
13
- endpoint: z.ZodString;
14
- version: z.ZodString;
15
- mcpTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
16
- capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
17
- }, "strip", z.ZodTypeAny, {
18
- name: "MCP";
19
- endpoint: string;
20
- version: string;
21
- mcpTools?: string[] | undefined;
22
- capabilities?: string[] | undefined;
23
- }, {
24
- name: "MCP";
25
- endpoint: string;
26
- version: string;
27
- mcpTools?: string[] | undefined;
28
- capabilities?: string[] | undefined;
29
- }>, z.ZodObject<{
30
- name: z.ZodLiteral<"A2A">;
31
- endpoint: z.ZodString;
32
- version: z.ZodString;
33
- }, "strip", z.ZodTypeAny, {
34
- name: "A2A";
35
- endpoint: string;
36
- version: string;
37
- }, {
38
- name: "A2A";
39
- endpoint: string;
40
- version: string;
41
- }>, z.ZodObject<{
42
- name: z.ZodLiteral<"OASF">;
43
- endpoint: z.ZodString;
44
- version: z.ZodString;
45
- skills: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
46
- domains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
47
- }, "strip", z.ZodTypeAny, {
48
- name: "OASF";
49
- endpoint: string;
50
- version: string;
51
- skills?: string[] | undefined;
52
- domains?: string[] | undefined;
53
- }, {
54
- name: "OASF";
55
- endpoint: string;
56
- version: string;
57
- skills?: string[] | undefined;
58
- domains?: string[] | undefined;
59
- }>, z.ZodObject<{
60
- name: z.ZodLiteral<"agentWallet">;
61
- endpoint: z.ZodString;
62
- }, "strip", z.ZodTypeAny, {
63
- name: "agentWallet";
64
- endpoint: string;
65
- }, {
66
- name: "agentWallet";
67
- endpoint: string;
68
- }>, z.ZodObject<{
69
- name: z.ZodLiteral<"web">;
70
- endpoint: z.ZodString;
71
- }, "strip", z.ZodTypeAny, {
72
- name: "web";
73
- endpoint: string;
74
- }, {
75
- name: "web";
76
- endpoint: string;
77
- }>, z.ZodObject<{
78
- name: z.ZodLiteral<"email">;
79
- endpoint: z.ZodString;
80
- }, "strip", z.ZodTypeAny, {
81
- name: "email";
82
- endpoint: string;
83
- }, {
84
- name: "email";
85
- endpoint: string;
86
- }>]>, "many">;
87
- registrations: z.ZodOptional<z.ZodArray<z.ZodObject<{
88
- agentId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
89
- agentRegistry: z.ZodString;
90
- }, "strip", z.ZodTypeAny, {
91
- agentId: string | number;
92
- agentRegistry: string;
93
- }, {
94
- agentId: string | number;
95
- agentRegistry: string;
96
- }>, "many">>;
97
- supportedTrust: z.ZodOptional<z.ZodArray<z.ZodEnum<["reputation", "crypto-economic", "tee-attestation"]>, "many">>;
98
- active: z.ZodDefault<z.ZodBoolean>;
99
- x402Support: z.ZodDefault<z.ZodBoolean>;
100
- updatedAt: z.ZodOptional<z.ZodNumber>;
101
- }, "strip", z.ZodTypeAny, {
102
- name: string;
103
- type: "https://eips.ethereum.org/EIPS/eip-8004#registration-v1";
104
- description: string;
105
- services: ({
106
- name: "MCP";
107
- endpoint: string;
108
- version: string;
109
- mcpTools?: string[] | undefined;
110
- capabilities?: string[] | undefined;
111
- } | {
112
- name: "A2A";
113
- endpoint: string;
114
- version: string;
115
- } | {
116
- name: "OASF";
117
- endpoint: string;
118
- version: string;
119
- skills?: string[] | undefined;
120
- domains?: string[] | undefined;
121
- } | {
122
- name: "agentWallet";
123
- endpoint: string;
124
- } | {
125
- name: "web";
126
- endpoint: string;
127
- } | {
128
- name: "email";
129
- endpoint: string;
130
- })[];
131
- active: boolean;
132
- x402Support: boolean;
133
- image?: string | undefined;
134
- registrations?: {
135
- agentId: string | number;
136
- agentRegistry: string;
137
- }[] | undefined;
138
- supportedTrust?: ("reputation" | "crypto-economic" | "tee-attestation")[] | undefined;
139
- updatedAt?: number | undefined;
140
- }, {
141
- name: string;
142
- type: "https://eips.ethereum.org/EIPS/eip-8004#registration-v1";
143
- description: string;
144
- services: ({
145
- name: "MCP";
146
- endpoint: string;
147
- version: string;
148
- mcpTools?: string[] | undefined;
149
- capabilities?: string[] | undefined;
150
- } | {
151
- name: "A2A";
152
- endpoint: string;
153
- version: string;
154
- } | {
155
- name: "OASF";
156
- endpoint: string;
157
- version: string;
158
- skills?: string[] | undefined;
159
- domains?: string[] | undefined;
160
- } | {
161
- name: "agentWallet";
162
- endpoint: string;
163
- } | {
164
- name: "web";
165
- endpoint: string;
166
- } | {
167
- name: "email";
168
- endpoint: string;
169
- })[];
170
- image?: string | undefined;
171
- registrations?: {
172
- agentId: string | number;
173
- agentRegistry: string;
174
- }[] | undefined;
175
- supportedTrust?: ("reputation" | "crypto-economic" | "tee-attestation")[] | undefined;
176
- active?: boolean | undefined;
177
- x402Support?: boolean | undefined;
178
- updatedAt?: number | undefined;
179
- }>;
180
- export type AgentRegistrationFile = z.infer<typeof SCHEMA_8004_V2>;
181
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AA2CvB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsDzB,CAAA;AAEF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA"}
package/dist/types.js DELETED
@@ -1,84 +0,0 @@
1
- /**
2
- * Zod schema for ERC-8004 v2.0 agent registration files.
3
- * @see https://best-practices.8004scan.io/docs/01-agent-metadata-standard.html
4
- */
5
- import { z } from 'zod';
6
- // ─── Service schemas (discriminated on `name`) ───────────────────────────────
7
- const McpServiceSchema = z.object({
8
- name: z.literal('MCP'),
9
- endpoint: z.string().url().describe('MCP server URL'),
10
- version: z.string().describe('MCP protocol version date (e.g. 2025-11-25)'),
11
- mcpTools: z.array(z.string()).optional().describe('Tool names exposed by this MCP server'),
12
- capabilities: z.array(z.string()).optional().describe('MCP capability identifiers'),
13
- });
14
- const A2AServiceSchema = z.object({
15
- name: z.literal('A2A'),
16
- endpoint: z.string().url().describe('URL to the agent card JSON (e.g. /.well-known/agent-card.json)'),
17
- version: z.string().describe('A2A protocol version (e.g. 0.3.0)'),
18
- });
19
- const OasfServiceSchema = z.object({
20
- name: z.literal('OASF'),
21
- endpoint: z.string().url().describe('OASF schema endpoint URL'),
22
- version: z.string().describe('OASF version (e.g. 0.8.0)'),
23
- skills: z.array(z.string()).optional().describe('Skill paths (e.g. analytical_skills/data_analysis/blockchain_analysis)'),
24
- domains: z.array(z.string()).optional().describe('Domain paths (e.g. technology/blockchain)'),
25
- });
26
- const AgentWalletServiceSchema = z.object({
27
- name: z.literal('agentWallet'),
28
- endpoint: z.string().describe('CAIP-10 wallet address (e.g. eip155:1:0x...)'),
29
- });
30
- const WebServiceSchema = z.object({
31
- name: z.literal('web'),
32
- endpoint: z.string().url().describe('Human-facing web UI URL'),
33
- });
34
- const EmailServiceSchema = z.object({
35
- name: z.literal('email'),
36
- endpoint: z.string().email().describe('Support email address'),
37
- });
38
- // ─── Main schema ─────────────────────────────────────────────────────────────
39
- export const SCHEMA_8004_V2 = z.object({
40
- type: z
41
- .literal('https://eips.ethereum.org/EIPS/eip-8004#registration-v1')
42
- .describe('ERC-8004 registration type identifier — must be this exact URI'),
43
- name: z
44
- .string().min(3).max(200)
45
- .describe('Agent display name (3–200 characters)'),
46
- description: z
47
- .string().min(10)
48
- .describe('Natural language explanation of what the agent does and its capabilities'),
49
- image: z
50
- .string().url().optional()
51
- .describe('Avatar or logo URI — PNG, SVG, WebP, or JPG; 512×512px minimum recommended'),
52
- services: z
53
- .array(z.discriminatedUnion('name', [
54
- McpServiceSchema,
55
- A2AServiceSchema,
56
- OasfServiceSchema,
57
- AgentWalletServiceSchema,
58
- WebServiceSchema,
59
- EmailServiceSchema,
60
- ]))
61
- .describe('Communication endpoints — MCP, A2A, OASF, agentWallet, web, or email'),
62
- registrations: z
63
- .array(z.object({
64
- agentId: z.union([z.number().int(), z.string()])
65
- .describe('Agent token ID in the on-chain registry'),
66
- agentRegistry: z.string()
67
- .describe('CAIP-10 formatted registry contract address (e.g. eip155:1:0x...)'),
68
- }))
69
- .optional()
70
- .describe('On-chain NFT identity links to agent registries'),
71
- supportedTrust: z
72
- .array(z.enum(['reputation', 'crypto-economic', 'tee-attestation']))
73
- .optional()
74
- .describe('Trust models supported by this agent'),
75
- active: z
76
- .boolean().default(false)
77
- .describe('Whether the agent is production-ready and accepting requests (default: false)'),
78
- x402Support: z
79
- .boolean().default(false)
80
- .describe('Whether the agent supports the HTTP 402 / x402 micro-payment protocol'),
81
- updatedAt: z
82
- .number().int().optional()
83
- .describe('Unix timestamp (seconds) of the last metadata update'),
84
- });
package/src/index.ts DELETED
@@ -1,8 +0,0 @@
1
- import { SCHEMA_8004_V2 } from './types.js'
2
-
3
- export type { AgentRegistrationFile } from './types.js'
4
- export { SCHEMA_8004_V2 } from './types.js'
5
-
6
- export function validateRegistrationFile(file: unknown) {
7
- return SCHEMA_8004_V2.safeParse(file)
8
- }