aether-agent-sdk 1.0.0 ā 1.0.3
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 +21 -0
- package/README.md +67 -185
- package/dist/src/agents/AgentRegistry.d.ts +48 -0
- package/dist/src/agents/AgentRegistry.d.ts.map +1 -0
- package/dist/src/agents/AgentRegistry.js +114 -0
- package/dist/src/agents/AgentRegistry.js.map +1 -0
- package/dist/src/agents/AnalyzerAgent.d.ts +18 -0
- package/dist/src/agents/AnalyzerAgent.d.ts.map +1 -0
- package/dist/src/agents/AnalyzerAgent.js +129 -0
- package/dist/src/agents/AnalyzerAgent.js.map +1 -0
- package/dist/src/agents/IntelligentVerifierAgent.d.ts +46 -0
- package/dist/src/agents/IntelligentVerifierAgent.d.ts.map +1 -0
- package/dist/src/agents/IntelligentVerifierAgent.js +262 -0
- package/dist/src/agents/IntelligentVerifierAgent.js.map +1 -0
- package/dist/src/agents/SettlementAgent.d.ts +14 -0
- package/dist/src/agents/SettlementAgent.d.ts.map +1 -0
- package/dist/src/agents/SettlementAgent.js +155 -0
- package/dist/src/agents/SettlementAgent.js.map +1 -0
- package/dist/src/agents/SettlementAgentEnhanced.d.ts +33 -0
- package/dist/src/agents/SettlementAgentEnhanced.d.ts.map +1 -0
- package/dist/src/agents/SettlementAgentEnhanced.js +219 -0
- package/dist/src/agents/SettlementAgentEnhanced.js.map +1 -0
- package/dist/src/agents/VerifierAgent.d.ts +30 -0
- package/dist/src/agents/VerifierAgent.d.ts.map +1 -0
- package/dist/src/agents/VerifierAgent.js +181 -0
- package/dist/src/agents/VerifierAgent.js.map +1 -0
- package/dist/src/agents/index.d.ts +7 -0
- package/dist/src/agents/index.d.ts.map +1 -0
- package/dist/src/agents/index.js +11 -0
- package/dist/src/agents/index.js.map +1 -0
- package/dist/src/facilitator/X402FacilitatorServer.d.ts +17 -0
- package/dist/src/facilitator/X402FacilitatorServer.d.ts.map +1 -0
- package/dist/src/facilitator/X402FacilitatorServer.js +176 -0
- package/dist/src/facilitator/X402FacilitatorServer.js.map +1 -0
- package/dist/src/facilitator/index.d.ts +7 -0
- package/dist/src/facilitator/index.d.ts.map +1 -0
- package/dist/src/facilitator/index.js +11 -0
- package/dist/src/facilitator/index.js.map +1 -0
- package/dist/src/index.d.ts +19 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +39 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/modes/HumanInTheLoopMode.d.ts +92 -0
- package/dist/src/modes/HumanInTheLoopMode.d.ts.map +1 -0
- package/dist/src/modes/HumanInTheLoopMode.js +234 -0
- package/dist/src/modes/HumanInTheLoopMode.js.map +1 -0
- package/dist/src/modes/index.d.ts +8 -0
- package/dist/src/modes/index.d.ts.map +1 -0
- package/dist/src/modes/index.js +11 -0
- package/dist/src/modes/index.js.map +1 -0
- package/dist/src/protocols/A2ANegotiation.d.ts +122 -0
- package/dist/src/protocols/A2ANegotiation.d.ts.map +1 -0
- package/dist/src/protocols/A2ANegotiation.js +230 -0
- package/dist/src/protocols/A2ANegotiation.js.map +1 -0
- package/dist/src/protocols/A2AProtocol.d.ts +49 -0
- package/dist/src/protocols/A2AProtocol.d.ts.map +1 -0
- package/dist/src/protocols/A2AProtocol.js +126 -0
- package/dist/src/protocols/A2AProtocol.js.map +1 -0
- package/dist/src/protocols/AP2Protocol.d.ts +57 -0
- package/dist/src/protocols/AP2Protocol.d.ts.map +1 -0
- package/dist/src/protocols/AP2Protocol.js +121 -0
- package/dist/src/protocols/AP2Protocol.js.map +1 -0
- package/dist/src/protocols/index.d.ts +10 -0
- package/dist/src/protocols/index.d.ts.map +1 -0
- package/dist/src/protocols/index.js +15 -0
- package/dist/src/protocols/index.js.map +1 -0
- package/dist/src/services/index.d.ts +8 -0
- package/dist/src/services/index.d.ts.map +1 -0
- package/dist/src/services/index.js +13 -0
- package/dist/src/services/index.js.map +1 -0
- package/dist/src/utils/env.d.ts +15 -0
- package/dist/src/utils/env.d.ts.map +1 -0
- package/dist/src/utils/env.js +39 -0
- package/dist/src/utils/env.js.map +1 -0
- package/dist/src/utils/index.d.ts +7 -0
- package/dist/src/utils/index.d.ts.map +1 -0
- package/dist/src/utils/index.js +12 -0
- package/dist/src/utils/index.js.map +1 -0
- package/package.json +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 4n0nn43x
|
|
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
CHANGED
|
@@ -1,162 +1,112 @@
|
|
|
1
1
|
# Aether
|
|
2
2
|
|
|
3
|
-
**Autonomous Agent Ecosystem SDK for Solana
|
|
3
|
+
**Autonomous Agent Ecosystem SDK for Solana**
|
|
4
4
|
|
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
|
6
6
|
[](https://www.typescriptlang.org/)
|
|
7
|
-
[](https://solana.com)
|
|
8
|
+
[](https://solana.com/x402/what-is-x402)
|
|
9
9
|
|
|
10
|
-
Aether is a
|
|
11
|
-
|
|
12
|
-
Built for the **x402 Solana Hackathon** - redefining the autonomous agent economy.
|
|
10
|
+
Aether is a production-ready SDK for building autonomous agent-to-agent systems on Solana. It integrates the x402 Payment Protocol to enable intelligent agent communication and micropayment settlement.
|
|
13
11
|
|
|
14
12
|
---
|
|
15
13
|
|
|
16
14
|
## š Vision
|
|
17
15
|
|
|
18
|
-
**Aether**
|
|
16
|
+
**Aether** enables autonomous AI agents to orchestrate complex workflows on Solanaānegotiating contracts, processing micropayments, and making intelligent decisionsāall without human intervention.
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
### Core Capabilities
|
|
21
19
|
|
|
22
20
|
- **x402 Protocol** - HTTP 402 payment standard for autonomous API payments
|
|
23
|
-
- **Solana** - High-speed, low-cost blockchain
|
|
21
|
+
- **Solana Integration** - High-speed, low-cost blockchain infrastructure
|
|
24
22
|
- **A2A Protocol** - Standardized agent-to-agent communication
|
|
25
|
-
- **USDC
|
|
23
|
+
- **USDC Payments** - Stable, predictable pricing for agent services
|
|
26
24
|
|
|
27
25
|
---
|
|
28
26
|
|
|
29
|
-
## šÆ
|
|
30
|
-
|
|
31
|
-
Aether is both a **production-ready SDK** and a **complete framework** that enables:
|
|
27
|
+
## šÆ Features
|
|
32
28
|
|
|
33
|
-
###
|
|
29
|
+
### Autonomous Workflows
|
|
34
30
|
|
|
35
|
-
- **Agent Negotiation**:
|
|
36
|
-
- **Intelligent Verification**: LLM-powered decision making
|
|
37
|
-
- **Automated Settlement**: x402-based micropayments
|
|
38
|
-
- **Zero Human Intervention**: Fully autonomous agent
|
|
31
|
+
- **Agent Negotiation**: Autonomous term negotiation between agents
|
|
32
|
+
- **Intelligent Verification**: LLM-powered decision making
|
|
33
|
+
- **Automated Settlement**: x402-based micropayments in milliseconds
|
|
34
|
+
- **Zero Human Intervention**: Fully autonomous agent transactions
|
|
39
35
|
|
|
40
|
-
###
|
|
36
|
+
### Solana Performance
|
|
41
37
|
|
|
42
38
|
- **400ms Finality**: Lightning-fast transaction confirmation
|
|
43
|
-
- **$0.00025 Transaction Costs**:
|
|
39
|
+
- **$0.00025 Transaction Costs**: Economical micropayments
|
|
44
40
|
- **Native USDC**: Stable pricing without volatility
|
|
45
|
-
- **SPL Token Support**: Extensible payment
|
|
41
|
+
- **SPL Token Support**: Extensible payment infrastructure
|
|
46
42
|
|
|
47
|
-
###
|
|
43
|
+
### Agent Framework
|
|
48
44
|
|
|
49
|
-
- **
|
|
50
|
-
- **
|
|
51
|
-
- **
|
|
52
|
-
- **IntelligentVerifierAgent**: AI-powered validation with GPT-4 reasoning
|
|
45
|
+
- **SettlementAgent**: Executes x402 payments and settlement on-chain
|
|
46
|
+
- **x402 Facilitator**: Payment verification and USDC transfers
|
|
47
|
+
- **Protocol Support**: A2A and AP2 protocol implementations
|
|
53
48
|
|
|
54
49
|
---
|
|
55
50
|
|
|
56
|
-
## š¦
|
|
57
|
-
|
|
58
|
-
Aether is available as an npm package for easy integration into your projects.
|
|
59
|
-
|
|
60
|
-
### Install
|
|
51
|
+
## š¦ Installation
|
|
61
52
|
|
|
62
53
|
```bash
|
|
63
54
|
npm install aether-agent-sdk
|
|
64
55
|
```
|
|
65
56
|
|
|
66
|
-
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## š Quick Start
|
|
67
60
|
|
|
68
61
|
```typescript
|
|
69
|
-
import {
|
|
70
|
-
AnalyzerAgent,
|
|
71
|
-
VerifierAgent,
|
|
72
|
-
SettlementAgent,
|
|
73
|
-
A2AProtocol
|
|
74
|
-
} from 'aether-agent-sdk'
|
|
62
|
+
import { SettlementAgent } from 'aether-agent-sdk'
|
|
75
63
|
|
|
76
64
|
const agent = new SettlementAgent()
|
|
77
65
|
await agent.init()
|
|
78
66
|
|
|
79
67
|
const txHash = await agent.executeSolanaTransfer(
|
|
80
68
|
'merchant_wallet_address',
|
|
81
|
-
1.0
|
|
69
|
+
1.0 // USDC amount
|
|
82
70
|
)
|
|
71
|
+
|
|
72
|
+
console.log(`Payment sent: ${txHash}`)
|
|
83
73
|
```
|
|
84
74
|
|
|
85
|
-
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## š Documentation
|
|
86
78
|
|
|
87
|
-
- **[
|
|
79
|
+
- **[Setup Guide](./docs/SETUP_GUIDE.md)** - Installation and configuration
|
|
80
|
+
- **[API Reference](./docs/API_REFERENCE.md)** - Complete API documentation
|
|
88
81
|
- **[Usage Guide](./docs/USAGE_GUIDE.md)** - Integration examples
|
|
89
82
|
- **[x402 Integration](./docs/X402_GUIDE.md)** - x402 payment protocol guide
|
|
90
83
|
|
|
91
84
|
---
|
|
92
85
|
|
|
93
|
-
## š¬
|
|
94
|
-
|
|
95
|
-
Aether includes production-ready demos showcasing real-world use cases with actual Solana transactions.
|
|
96
|
-
|
|
97
|
-
### š³ x402 Payment Demo
|
|
98
|
-
|
|
99
|
-
Demonstrates autonomous agent micropayments using the x402 protocol on Solana.
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
npm run demo
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Features:
|
|
106
|
-
- Autonomous payment authorization
|
|
107
|
-
- x402 facilitator integration
|
|
108
|
-
- USDC token transfers on Solana
|
|
109
|
-
- Real-time settlement verification
|
|
110
|
-
|
|
111
|
-
### š¤ Intelligent Invoice Processing
|
|
86
|
+
## š¬ Demo
|
|
112
87
|
|
|
113
|
-
|
|
88
|
+
Run the included demo to see Aether in action:
|
|
114
89
|
|
|
115
90
|
```bash
|
|
116
|
-
|
|
117
|
-
|
|
91
|
+
# Install dependencies
|
|
92
|
+
npm install
|
|
118
93
|
|
|
119
|
-
|
|
94
|
+
# Build the project
|
|
95
|
+
npm run build
|
|
120
96
|
|
|
121
|
-
|
|
97
|
+
# Configure environment
|
|
98
|
+
cp .env.example .env
|
|
99
|
+
# Edit .env with your credentials
|
|
122
100
|
|
|
123
|
-
|
|
124
|
-
npm run demo:
|
|
101
|
+
# Run demo
|
|
102
|
+
npm run demo:payment
|
|
125
103
|
```
|
|
126
104
|
|
|
127
105
|
---
|
|
128
106
|
|
|
129
|
-
##
|
|
130
|
-
|
|
131
|
-
### Prerequisites
|
|
132
|
-
|
|
133
|
-
- Node.js 18+
|
|
134
|
-
- TypeScript 5.9+
|
|
135
|
-
- Solana CLI (optional, for key generation)
|
|
136
|
-
- Devnet SOL and USDC for testing
|
|
137
|
-
|
|
138
|
-
### Setup
|
|
139
|
-
|
|
140
|
-
1. **Clone the repository**
|
|
141
|
-
|
|
142
|
-
```bash
|
|
143
|
-
git clone https://github.com/4n0nn43x/Aether.git
|
|
144
|
-
cd Aether
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
2. **Install dependencies**
|
|
148
|
-
|
|
149
|
-
```bash
|
|
150
|
-
npm install
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
3. **Configure environment**
|
|
107
|
+
## āļø Configuration
|
|
154
108
|
|
|
155
|
-
|
|
156
|
-
cp env.example .env
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
Edit `.env` with your configuration:
|
|
109
|
+
Create a `.env` file:
|
|
160
110
|
|
|
161
111
|
```env
|
|
162
112
|
SOLANA_NETWORK=devnet
|
|
@@ -164,32 +114,7 @@ SOLANA_RPC_URL=https://api.devnet.solana.com
|
|
|
164
114
|
AGENT_PRIVATE_KEY=your_base58_private_key
|
|
165
115
|
MERCHANT_WALLET_ADDRESS=merchant_wallet
|
|
166
116
|
USDC_MINT=4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
4. **Generate a wallet** (if needed)
|
|
170
|
-
|
|
171
|
-
```bash
|
|
172
|
-
solana-keygen new --outfile ~/.config/solana/agent-wallet.json
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
5. **Get devnet SOL and USDC**
|
|
176
|
-
|
|
177
|
-
```bash
|
|
178
|
-
solana airdrop 2 your_wallet_address --url devnet
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
For USDC, use the [Solana Faucet](https://faucet.circle.com/) or Solana Devnet tools.
|
|
182
|
-
|
|
183
|
-
6. **Build the project**
|
|
184
|
-
|
|
185
|
-
```bash
|
|
186
|
-
npm run build
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
7. **Run a demo**
|
|
190
|
-
|
|
191
|
-
```bash
|
|
192
|
-
npm run demo
|
|
117
|
+
DEFAULT_PAYMENT_AMOUNT_USDC=1.0
|
|
193
118
|
```
|
|
194
119
|
|
|
195
120
|
---
|
|
@@ -200,24 +125,19 @@ npm run demo
|
|
|
200
125
|
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
201
126
|
ā SDK Entry Point (src/index.ts) ā
|
|
202
127
|
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
|
|
203
|
-
ā Agents Layer
|
|
204
|
-
ā
|
|
205
|
-
ā āā VerifierAgent ā
|
|
206
|
-
ā āā SettlementAgent ā
|
|
207
|
-
ā āā IntelligentVerifierAgent ā
|
|
128
|
+
ā Agents Layer ā
|
|
129
|
+
ā āā SettlementAgent ā
|
|
208
130
|
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
|
|
209
|
-
ā x402 Facilitator
|
|
131
|
+
ā x402 Facilitator ā
|
|
210
132
|
ā āā X402FacilitatorServer ā
|
|
211
133
|
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
|
|
212
|
-
ā Protocols Layer
|
|
134
|
+
ā Protocols Layer ā
|
|
213
135
|
ā āā A2AProtocol ā
|
|
214
|
-
ā
|
|
215
|
-
ā āā A2ANegotiation ā
|
|
136
|
+
ā āā AP2Protocol ā
|
|
216
137
|
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
|
|
217
138
|
ā Solana Integration ā
|
|
218
139
|
ā āā @solana/web3.js ā
|
|
219
|
-
ā
|
|
220
|
-
ā āā @faremeter/* (x402) ā
|
|
140
|
+
ā āā @solana/spl-token ā
|
|
221
141
|
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
222
142
|
```
|
|
223
143
|
|
|
@@ -225,28 +145,21 @@ npm run demo
|
|
|
225
145
|
|
|
226
146
|
## š Key Features
|
|
227
147
|
|
|
228
|
-
### x402 Payment Protocol
|
|
148
|
+
### x402 Payment Protocol
|
|
229
149
|
|
|
230
|
-
- HTTP 402 (Payment Required)
|
|
150
|
+
- HTTP 402 (Payment Required) implementation
|
|
231
151
|
- Autonomous payment authorization and verification
|
|
232
|
-
- Sub-second settlement
|
|
152
|
+
- Sub-second settlement on Solana
|
|
233
153
|
- USDC micropayments with stable pricing
|
|
234
154
|
|
|
235
155
|
### Agent-to-Agent Communication
|
|
236
156
|
|
|
237
|
-
-
|
|
157
|
+
- JSON-RPC based A2A protocol
|
|
238
158
|
- Standardized message formats
|
|
239
159
|
- Async communication patterns
|
|
240
|
-
-
|
|
241
|
-
|
|
242
|
-
### AI-Powered Intelligence
|
|
243
|
-
|
|
244
|
-
- LangChain integration for LLM reasoning
|
|
245
|
-
- GPT-4 and Ollama support
|
|
246
|
-
- Intelligent fraud detection
|
|
247
|
-
- Autonomous decision-making
|
|
160
|
+
- Task management and tracking
|
|
248
161
|
|
|
249
|
-
### Production
|
|
162
|
+
### Production Ready
|
|
250
163
|
|
|
251
164
|
- TypeScript with full type safety
|
|
252
165
|
- Modular exports for tree-shaking
|
|
@@ -255,36 +168,9 @@ npm run demo
|
|
|
255
168
|
|
|
256
169
|
---
|
|
257
170
|
|
|
258
|
-
## š x402 Hackathon Submission
|
|
259
|
-
|
|
260
|
-
Aether is built for the **x402 Solana Hackathon**, showcasing:
|
|
261
|
-
|
|
262
|
-
ā
**x402 Protocol Integration** - Full implementation of x402 payment standard
|
|
263
|
-
ā
**Solana Devnet Deployment** - Live transactions on Solana devnet
|
|
264
|
-
ā
**Autonomous Agent Economy** - AI agents transacting independently
|
|
265
|
-
ā
**USDC Micropayments** - Sub-dollar payments at scale
|
|
266
|
-
ā
**Open Source** - MIT licensed, fully documented
|
|
267
|
-
|
|
268
|
-
### Hackathon Categories
|
|
269
|
-
|
|
270
|
-
- **Best x402 Infrastructure** - Facilitator implementation for agent payments
|
|
271
|
-
- **Best AI Agent Integration** - LLM-powered autonomous decision-making
|
|
272
|
-
- **Best Developer Tool** - Comprehensive SDK for agent development
|
|
273
|
-
|
|
274
|
-
---
|
|
275
|
-
|
|
276
|
-
## š Documentation
|
|
277
|
-
|
|
278
|
-
- [API Reference](./docs/API_REFERENCE.md)
|
|
279
|
-
- [Usage Guide](./docs/USAGE_GUIDE.md)
|
|
280
|
-
- [x402 Integration Guide](./docs/X402_GUIDE.md)
|
|
281
|
-
- [Architecture Overview](./docs/ARCHITECTURE.md)
|
|
282
|
-
|
|
283
|
-
---
|
|
284
|
-
|
|
285
171
|
## š¤ Contributing
|
|
286
172
|
|
|
287
|
-
Contributions are welcome! Please
|
|
173
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
288
174
|
|
|
289
175
|
---
|
|
290
176
|
|
|
@@ -297,20 +183,16 @@ MIT License - see [LICENSE](./LICENSE) for details.
|
|
|
297
183
|
## š Links
|
|
298
184
|
|
|
299
185
|
- **GitHub**: [github.com/4n0nn43x/Aether](https://github.com/4n0nn43x/Aether)
|
|
300
|
-
- **
|
|
301
|
-
- **
|
|
186
|
+
- **Documentation**: [docs/](./docs/)
|
|
187
|
+
- **x402 Protocol**: [solana.com/x402](https://solana.com/x402/what-is-x402)
|
|
188
|
+
- **Solana Docs**: [solana.com/developers](https://solana.com/developers)
|
|
302
189
|
|
|
303
190
|
---
|
|
304
191
|
|
|
305
|
-
##
|
|
192
|
+
## š„ Author
|
|
306
193
|
|
|
307
|
-
|
|
308
|
-
- Solana Foundation
|
|
309
|
-
- Coinbase Dev
|
|
310
|
-
- Phantom Wallet
|
|
311
|
-
- Crossmint
|
|
312
|
-
- The entire Solana developer community
|
|
194
|
+
**4n0nn43x**
|
|
313
195
|
|
|
314
196
|
---
|
|
315
197
|
|
|
316
|
-
**Aether** -
|
|
198
|
+
**Aether** - Autonomous agent payments on Solana.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HCS-10 Agent Registry
|
|
3
|
+
* Manages agent registration, discovery, and metadata for HCS-10 compatible agents
|
|
4
|
+
*/
|
|
5
|
+
export interface AgentMetadata {
|
|
6
|
+
agentId: string;
|
|
7
|
+
agentName: string;
|
|
8
|
+
agentType: 'analyzer' | 'verifier' | 'settlement';
|
|
9
|
+
capabilities: string[];
|
|
10
|
+
supportedMessageTypes: string[];
|
|
11
|
+
topicId: string;
|
|
12
|
+
status: 'active' | 'inactive';
|
|
13
|
+
registrationTime?: number;
|
|
14
|
+
}
|
|
15
|
+
export declare class AgentRegistry {
|
|
16
|
+
private agents;
|
|
17
|
+
/**
|
|
18
|
+
* Register an agent in the local registry
|
|
19
|
+
*/
|
|
20
|
+
registerAgent(metadata: AgentMetadata): void;
|
|
21
|
+
/**
|
|
22
|
+
* Get agent metadata by ID
|
|
23
|
+
*/
|
|
24
|
+
getAgent(agentId: string): AgentMetadata | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Get all registered agents
|
|
27
|
+
*/
|
|
28
|
+
getAllAgents(): AgentMetadata[];
|
|
29
|
+
/**
|
|
30
|
+
* Discover agents by type
|
|
31
|
+
*/
|
|
32
|
+
discoverAgentsByType(type: string): AgentMetadata[];
|
|
33
|
+
/**
|
|
34
|
+
* Discover agents by capability
|
|
35
|
+
*/
|
|
36
|
+
discoverAgentsByCapability(capability: string): AgentMetadata[];
|
|
37
|
+
/**
|
|
38
|
+
* Check agent status
|
|
39
|
+
*/
|
|
40
|
+
isAgentActive(agentId: string): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Get agent summary
|
|
43
|
+
*/
|
|
44
|
+
getSummary(): string;
|
|
45
|
+
}
|
|
46
|
+
export declare const globalAgentRegistry: AgentRegistry;
|
|
47
|
+
export declare function initializeHCS10Agents(): void;
|
|
48
|
+
//# sourceMappingURL=AgentRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentRegistry.d.ts","sourceRoot":"","sources":["../../../src/agents/AgentRegistry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,UAAU,GAAG,UAAU,GAAG,YAAY,CAAA;IACjD,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,qBAAqB,EAAE,MAAM,EAAE,CAAA;IAC/B,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,QAAQ,GAAG,UAAU,CAAA;IAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAwC;IAEtD;;OAEG;IACH,aAAa,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI;IAQ5C;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAIpD;;OAEG;IACH,YAAY,IAAI,aAAa,EAAE;IAI/B;;OAEG;IACH,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,EAAE;IAInD;;OAEG;IACH,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa,EAAE;IAM/D;;OAEG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAKvC;;OAEG;IACH,UAAU,IAAI,MAAM;CAQrB;AAGD,eAAO,MAAM,mBAAmB,eAAsB,CAAA;AAGtD,wBAAgB,qBAAqB,IAAI,IAAI,CA6C5C"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* HCS-10 Agent Registry
|
|
4
|
+
* Manages agent registration, discovery, and metadata for HCS-10 compatible agents
|
|
5
|
+
*/
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.globalAgentRegistry = exports.AgentRegistry = void 0;
|
|
11
|
+
exports.initializeHCS10Agents = initializeHCS10Agents;
|
|
12
|
+
const env_1 = require("../utils/env");
|
|
13
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
14
|
+
(0, env_1.loadEnvIfNeeded)();
|
|
15
|
+
class AgentRegistry {
|
|
16
|
+
agents = new Map();
|
|
17
|
+
/**
|
|
18
|
+
* Register an agent in the local registry
|
|
19
|
+
*/
|
|
20
|
+
registerAgent(metadata) {
|
|
21
|
+
this.agents.set(metadata.agentId, metadata);
|
|
22
|
+
console.log(chalk_1.default.green(`ā
Registered agent: ${metadata.agentName} (${metadata.agentId})`));
|
|
23
|
+
console.log(chalk_1.default.gray(` Type: ${metadata.agentType}`));
|
|
24
|
+
console.log(chalk_1.default.gray(` Capabilities: ${metadata.capabilities.join(', ')}`));
|
|
25
|
+
console.log(chalk_1.default.gray(` Topic: ${metadata.topicId}`));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get agent metadata by ID
|
|
29
|
+
*/
|
|
30
|
+
getAgent(agentId) {
|
|
31
|
+
return this.agents.get(agentId);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get all registered agents
|
|
35
|
+
*/
|
|
36
|
+
getAllAgents() {
|
|
37
|
+
return Array.from(this.agents.values());
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Discover agents by type
|
|
41
|
+
*/
|
|
42
|
+
discoverAgentsByType(type) {
|
|
43
|
+
return Array.from(this.agents.values()).filter(agent => agent.agentType === type);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Discover agents by capability
|
|
47
|
+
*/
|
|
48
|
+
discoverAgentsByCapability(capability) {
|
|
49
|
+
return Array.from(this.agents.values()).filter(agent => agent.capabilities.includes(capability));
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Check agent status
|
|
53
|
+
*/
|
|
54
|
+
isAgentActive(agentId) {
|
|
55
|
+
const agent = this.agents.get(agentId);
|
|
56
|
+
return agent?.status === 'active';
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Get agent summary
|
|
60
|
+
*/
|
|
61
|
+
getSummary() {
|
|
62
|
+
const agents = this.getAllAgents();
|
|
63
|
+
return chalk_1.default.blue(`š Agent Registry: ${agents.length} agents registered\n` +
|
|
64
|
+
agents.map(agent => ` ${agent.agentName} (${agent.agentType}) - ${agent.status}`).join('\n'));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.AgentRegistry = AgentRegistry;
|
|
68
|
+
// Global registry instance
|
|
69
|
+
exports.globalAgentRegistry = new AgentRegistry();
|
|
70
|
+
// Register predefined agents from environment
|
|
71
|
+
function initializeHCS10Agents() {
|
|
72
|
+
// Analyzer Agent
|
|
73
|
+
if (process.env.ANALYZER_AGENT_ID && process.env.ANALYZER_TOPIC_ID) {
|
|
74
|
+
exports.globalAgentRegistry.registerAgent({
|
|
75
|
+
agentId: process.env.ANALYZER_AGENT_ID,
|
|
76
|
+
agentName: 'AnalyzerAgent',
|
|
77
|
+
agentType: 'analyzer',
|
|
78
|
+
capabilities: ['account-analysis', 'threshold-evaluation', 'proposal-generation'],
|
|
79
|
+
supportedMessageTypes: ['analysis_proposal', 'settlement_complete'],
|
|
80
|
+
topicId: process.env.ANALYZER_TOPIC_ID,
|
|
81
|
+
status: 'active',
|
|
82
|
+
registrationTime: Date.now()
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
// Verifier Agent
|
|
86
|
+
if (process.env.VERIFIER_AGENT_ID && process.env.VERIFIER_TOPIC_ID) {
|
|
87
|
+
exports.globalAgentRegistry.registerAgent({
|
|
88
|
+
agentId: process.env.VERIFIER_AGENT_ID,
|
|
89
|
+
agentName: 'VerifierAgent',
|
|
90
|
+
agentType: 'verifier',
|
|
91
|
+
capabilities: ['proposal-validation', 'approval-decision', 'business-logic'],
|
|
92
|
+
supportedMessageTypes: ['verification_result', 'analysis_proposal'],
|
|
93
|
+
topicId: process.env.VERIFIER_TOPIC_ID,
|
|
94
|
+
status: 'active',
|
|
95
|
+
registrationTime: Date.now()
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
// Settlement Agent
|
|
99
|
+
if (process.env.SETTLEMENT_AGENT_ID && process.env.SETTLEMENT_TOPIC_ID) {
|
|
100
|
+
exports.globalAgentRegistry.registerAgent({
|
|
101
|
+
agentId: process.env.SETTLEMENT_AGENT_ID,
|
|
102
|
+
agentName: 'SettlementAgent',
|
|
103
|
+
agentType: 'settlement',
|
|
104
|
+
capabilities: ['x402-payment', 'cross-chain-settlement', 'usdc-transfer'],
|
|
105
|
+
supportedMessageTypes: ['verification_result', 'settlement_complete'],
|
|
106
|
+
topicId: process.env.SETTLEMENT_TOPIC_ID,
|
|
107
|
+
status: 'active',
|
|
108
|
+
registrationTime: Date.now()
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
console.log(chalk_1.default.bold.green('\nšÆ HCS-10 Agents Initialized\n'));
|
|
112
|
+
console.log(exports.globalAgentRegistry.getSummary());
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=AgentRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentRegistry.js","sourceRoot":"","sources":["../../../src/agents/AgentRegistry.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;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AC,CAAA;IACjE,OAAO,CAAC,GAAG,CAAC,2BAAmB,CAAC,UAAU,EAAE,CAAC,CAAA;AAC/C,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HCS10Client } from '@hashgraphonline/standards-agent-kit';
|
|
2
|
+
import { HCS10ConnectionManager } from '../protocols/HCS10ConnectionManager';
|
|
3
|
+
export declare class AnalyzerAgent {
|
|
4
|
+
private hcsClient;
|
|
5
|
+
private hederaClient;
|
|
6
|
+
private connectionManager?;
|
|
7
|
+
private readonly MIRROR_NODE_URL;
|
|
8
|
+
constructor();
|
|
9
|
+
init(): Promise<void>;
|
|
10
|
+
queryAccount(accountId: string): Promise<any>;
|
|
11
|
+
queryAccountViaMirror(accountId: string): Promise<any>;
|
|
12
|
+
getHcsClient(): HCS10Client;
|
|
13
|
+
/**
|
|
14
|
+
* Get connection manager instance (if initialized)
|
|
15
|
+
*/
|
|
16
|
+
getConnectionManager(): HCS10ConnectionManager | undefined;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=AnalyzerAgent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnalyzerAgent.d.ts","sourceRoot":"","sources":["../../../src/agents/AnalyzerAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAA;AAElE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAA;AAO5E,qBAAa,aAAa;IACxB,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,YAAY,CAAQ;IAC5B,OAAO,CAAC,iBAAiB,CAAC,CAAwB;IAClD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA0C;;IAmDpE,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAuBrB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IA0B7C,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAgB5D,YAAY,IAAI,WAAW;IAI3B;;OAEG;IACH,oBAAoB,IAAI,sBAAsB,GAAG,SAAS;CAG3D"}
|