@agentic-trust/agentic-trust-sdk 1.0.43

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 (78) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +213 -0
  3. package/abis/BaseRegistrarImplementation.json +1013 -0
  4. package/abis/ETHRegistrarController.json +1004 -0
  5. package/abis/IdentityRegistry.json +1044 -0
  6. package/abis/NameWrapper.json +2026 -0
  7. package/abis/PublicResolver.json +1772 -0
  8. package/abis/ReputationRegistry.json +701 -0
  9. package/abis/ValidationRegistry.json +505 -0
  10. package/dist/AIAgentAssociationClient.d.ts +58 -0
  11. package/dist/AIAgentAssociationClient.d.ts.map +1 -0
  12. package/dist/AIAgentAssociationClient.js +100 -0
  13. package/dist/AIAgentAssociationClient.js.map +1 -0
  14. package/dist/AIAgentDiscoveryClient.d.ts +673 -0
  15. package/dist/AIAgentDiscoveryClient.d.ts.map +1 -0
  16. package/dist/AIAgentDiscoveryClient.js +3184 -0
  17. package/dist/AIAgentDiscoveryClient.js.map +1 -0
  18. package/dist/AIAgentENSClient.d.ts +149 -0
  19. package/dist/AIAgentENSClient.d.ts.map +1 -0
  20. package/dist/AIAgentENSClient.js +958 -0
  21. package/dist/AIAgentENSClient.js.map +1 -0
  22. package/dist/AIAgentIdentityClient.d.ts +159 -0
  23. package/dist/AIAgentIdentityClient.d.ts.map +1 -0
  24. package/dist/AIAgentIdentityClient.js +660 -0
  25. package/dist/AIAgentIdentityClient.js.map +1 -0
  26. package/dist/AIAgentL2ENSDurenClient.d.ts +120 -0
  27. package/dist/AIAgentL2ENSDurenClient.d.ts.map +1 -0
  28. package/dist/AIAgentL2ENSDurenClient.js +735 -0
  29. package/dist/AIAgentL2ENSDurenClient.js.map +1 -0
  30. package/dist/AIAgentL2ENSNamespaceClient.d.ts +58 -0
  31. package/dist/AIAgentL2ENSNamespaceClient.d.ts.map +1 -0
  32. package/dist/AIAgentL2ENSNamespaceClient.js +214 -0
  33. package/dist/AIAgentL2ENSNamespaceClient.js.map +1 -0
  34. package/dist/AIAgentReputationClient.d.ts +69 -0
  35. package/dist/AIAgentReputationClient.d.ts.map +1 -0
  36. package/dist/AIAgentReputationClient.js +203 -0
  37. package/dist/AIAgentReputationClient.js.map +1 -0
  38. package/dist/AIAgentValidationClient.d.ts +60 -0
  39. package/dist/AIAgentValidationClient.d.ts.map +1 -0
  40. package/dist/AIAgentValidationClient.js +123 -0
  41. package/dist/AIAgentValidationClient.js.map +1 -0
  42. package/dist/OrgIdentityClient.d.ts +27 -0
  43. package/dist/OrgIdentityClient.d.ts.map +1 -0
  44. package/dist/OrgIdentityClient.js +169 -0
  45. package/dist/OrgIdentityClient.js.map +1 -0
  46. package/dist/abis/BaseRegistrarImplementation.json +1013 -0
  47. package/dist/abis/ETHRegistrarController.json +1004 -0
  48. package/dist/abis/IdentityRegistry.json +1044 -0
  49. package/dist/abis/NameWrapper.json +2026 -0
  50. package/dist/abis/PublicResolver.json +1772 -0
  51. package/dist/abis/ReputationRegistry.json +701 -0
  52. package/dist/abis/ValidationRegistry.json +505 -0
  53. package/dist/index.d.ts +25 -0
  54. package/dist/index.d.ts.map +1 -0
  55. package/dist/index.js +24 -0
  56. package/dist/index.js.map +1 -0
  57. package/dist/schema.d.ts +13 -0
  58. package/dist/schema.d.ts.map +1 -0
  59. package/dist/schema.js +696 -0
  60. package/dist/schema.js.map +1 -0
  61. package/dist/schemaKb.d.ts +12 -0
  62. package/dist/schemaKb.d.ts.map +1 -0
  63. package/dist/schemaKb.js +593 -0
  64. package/dist/schemaKb.js.map +1 -0
  65. package/dist/tsconfig.tsbuildinfo +1 -0
  66. package/dist/utils/did8004.d.ts +57 -0
  67. package/dist/utils/did8004.d.ts.map +1 -0
  68. package/dist/utils/did8004.js +127 -0
  69. package/dist/utils/did8004.js.map +1 -0
  70. package/dist/utils/didEns.d.ts +46 -0
  71. package/dist/utils/didEns.d.ts.map +1 -0
  72. package/dist/utils/didEns.js +107 -0
  73. package/dist/utils/didEns.js.map +1 -0
  74. package/dist/utils/didEthr.d.ts +40 -0
  75. package/dist/utils/didEthr.d.ts.map +1 -0
  76. package/dist/utils/didEthr.js +87 -0
  77. package/dist/utils/didEthr.js.map +1 -0
  78. package/package.json +79 -0
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Agentic Trust
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.
22
+
package/README.md ADDED
@@ -0,0 +1,213 @@
1
+ # Agentic Trust SDK
2
+
3
+ A TypeScript SDK for managing AI agents with ENS integration, identity management, and reputation systems on Ethereum L1 and L2. This SDK extends the core ERC-8004 SDK with agent-specific functionality.
4
+
5
+ ## Features
6
+
7
+ - **AI Agent Management**: Complete lifecycle management for AI agents
8
+ - **ENS Integration**: Seamless integration with Ethereum Name Service for agent naming
9
+ - **Multi-Chain Support**: Works on Ethereum L1 and L2 networks (Base, Optimism)
10
+ - **Identity Management**: Agent identity registration and metadata management
11
+ - **Reputation System**: Feedback and scoring for AI agents
12
+ - **Organization Support**: Tools for managing agent organizations
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ npm install @agentic-trust/agentic-trust-sdk
18
+ # or
19
+ yarn add @agentic-trust/agentic-trust-sdk
20
+ # or
21
+ pnpm add @agentic-trust/agentic-trust-sdk
22
+ ```
23
+
24
+ ## Quick Start
25
+
26
+ ```typescript
27
+ import { AIAgentENSClient, AIAgentIdentityClient } from '@agentic-trust/agentic-trust-sdk';
28
+ import { sepolia } from 'viem/chains';
29
+
30
+ // Create an ENS client for agent management
31
+ const ensClient = new AIAgentENSClient(
32
+ sepolia,
33
+ 'https://eth-sepolia.g.alchemy.com/v2/YOUR_KEY',
34
+ adapter,
35
+ '0x...', // ENS Registry
36
+ '0x...', // ENS Resolver
37
+ '0x...' // Identity Registry
38
+ );
39
+
40
+ // Create an identity client
41
+ const identityClient = new AIAgentIdentityClient(
42
+ 11155111, // ETH Sepolia chain ID
43
+ 'https://eth-sepolia.g.alchemy.com/v2/YOUR_KEY',
44
+ '0x...' // Identity Registry
45
+ );
46
+
47
+ // Get agent identity by name
48
+ const { agentId, account } = await ensClient.getAgentIdentityByName('alice.agent.eth');
49
+ ```
50
+
51
+ ## Core Components
52
+
53
+ ### AIAgentENSClient
54
+
55
+ Handles ENS operations for AI agents:
56
+
57
+ ```typescript
58
+ import { AIAgentENSClient } from '@agentic-trust/agentic-trust-sdk';
59
+
60
+ const ensClient = new AIAgentENSClient(chain, rpcUrl, adapter, ensRegistry, ensResolver, identityRegistry);
61
+
62
+ // Get agent identity by ENS name
63
+ const { agentId, account } = await ensClient.getAgentIdentityByName('alice.agent.eth');
64
+
65
+ // Get agent account by ENS name
66
+ const account = await ensClient.getAgentAccountByName('alice.agent.eth');
67
+
68
+ // Get reverse resolution (account to ENS name)
69
+ const { agentId, ensName } = await ensClient.getAgentIdentityByAccount('0x...');
70
+ ```
71
+
72
+ ### AIAgentIdentityClient
73
+
74
+ Manages agent identity and metadata:
75
+
76
+ ```typescript
77
+ import { AIAgentIdentityClient } from '@agentic-trust/agentic-trust-sdk';
78
+
79
+ const identityClient = new AIAgentIdentityClient(chainId, rpcUrl, identityRegistry);
80
+
81
+ // Get agent metadata
82
+ const metadata = await identityClient.getMetadata(agentId, 'agentName');
83
+
84
+ // Get agent name
85
+ const name = await identityClient.getAgentName(agentId);
86
+
87
+ // Get agent EOA by account
88
+ const eoa = await identityClient.getAgentEoaByAgentAccount(agentAccount);
89
+ ```
90
+
91
+ ### AIAgentReputationClient
92
+
93
+ Handles reputation and feedback:
94
+
95
+ ```typescript
96
+ import { AIAgentReputationClient } from '@agentic-trust/agentic-trust-sdk';
97
+
98
+ const reputationClient = new AIAgentReputationClient(chain, orgAdapter, agentAdapter, reputationRegistry);
99
+
100
+ // Give feedback to an agent
101
+ await reputationClient.giveFeedback({
102
+ agent: '0x...',
103
+ score: 5,
104
+ feedback: 'Excellent service!',
105
+ metadata: [{ key: 'category', value: 'quality' }]
106
+ });
107
+
108
+ // Get reputation score
109
+ const score = await reputationClient.getReputationScore('0x...');
110
+ ```
111
+
112
+ ### AIAgentL2ENSDurenClient
113
+
114
+ L2-specific ENS operations:
115
+
116
+ ```typescript
117
+ import { AIAgentL2ENSDurenClient } from '@agentic-trust/agentic-trust-sdk';
118
+
119
+ const l2Client = new AIAgentL2ENSDurenClient(chain, rpcUrl, adapter, ensRegistry, ensResolver, identityRegistry);
120
+
121
+ // L2-specific agent operations
122
+ const account = await l2Client.getAgentAccountByName('alice.agent.base');
123
+ ```
124
+
125
+ ### OrgIdentityClient
126
+
127
+ Organization management utilities:
128
+
129
+ ```typescript
130
+ import { OrgIdentityClient } from '@agentic-trust/agentic-trust-sdk';
131
+
132
+ const orgClient = new OrgIdentityClient(adapter, { ensRegistry: '0x...', rpcUrl: 'https://...' });
133
+
134
+ // Get organization account by ENS name
135
+ const account = await orgClient.getOrgAccountByName('myorg.eth');
136
+
137
+ // Get organization EOA by account
138
+ const eoa = await orgClient.getOrgEoaByAccount(orgAccount);
139
+ ```
140
+
141
+ ## Supported Networks
142
+
143
+ - **Ethereum Sepolia** (Chain ID: 11155111)
144
+ - **Base Sepolia** (Chain ID: 84532)
145
+ - **Optimism Sepolia** (Chain ID: 11155420)
146
+
147
+ ## Dependencies
148
+
149
+ This SDK depends on:
150
+ - `@agentic-trust/8004-sdk` - Core ERC-8004 functionality
151
+ - `viem` - Ethereum library
152
+ - `ethers` - Alternative Ethereum library
153
+ - `@metamask/smart-accounts-kit` - MetaMask Smart Accounts integration
154
+ - `@thenamespace/mint-manager` - ENS minting
155
+ - `@thenamespace/indexer` - ENS indexing
156
+
157
+ ## Development
158
+
159
+ ### Building
160
+
161
+ ```bash
162
+ npm run build
163
+ ```
164
+
165
+ ### Development Mode
166
+
167
+ ```bash
168
+ npm run dev
169
+ ```
170
+
171
+ ### Cleaning
172
+
173
+ ```bash
174
+ npm run clean
175
+ ```
176
+
177
+ ## Architecture
178
+
179
+ The Agentic Trust SDK is built on top of the core ERC-8004 SDK and provides:
180
+
181
+ 1. **Agent-Specific Extensions**: Specialized classes for AI agent management
182
+ 2. **ENS Integration**: Seamless naming and resolution for agents
183
+ 3. **Multi-Chain Support**: Works across different Ethereum networks
184
+ 4. **Reputation Management**: Feedback and scoring systems
185
+ 5. **Organization Tools**: Utilities for managing agent organizations
186
+
187
+ ## Contributing
188
+
189
+ 1. Fork the repository
190
+ 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
191
+ 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
192
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
193
+ 5. Open a Pull Request
194
+
195
+ ## License
196
+
197
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
198
+
199
+ ## Support
200
+
201
+ - 📖 [Documentation](https://docs.erc8004.org)
202
+ - 💬 [Discord](https://discord.gg/erc8004)
203
+ - 🐛 [Issues](https://github.com/erc8004/erc-8004-identity-indexer/issues)
204
+
205
+ ## Changelog
206
+
207
+ ### v1.0.0
208
+ - Initial release
209
+ - Full AI agent management support
210
+ - ENS integration for L1 and L2
211
+ - Reputation and feedback systems
212
+ - Organization management tools
213
+ - Multi-chain support