aether-agent-sdk 1.0.4 → 1.0.6
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/README.md +8 -5
- package/dist/src/agents/SettlementAgent.d.ts +5 -0
- package/dist/src/agents/SettlementAgent.d.ts.map +1 -1
- package/dist/src/agents/SettlementAgent.js +61 -0
- package/dist/src/agents/SettlementAgent.js.map +1 -1
- package/dist/src/facilitator/X402FacilitatorServer.d.ts.map +1 -1
- package/dist/src/facilitator/X402FacilitatorServer.js +45 -19
- package/dist/src/facilitator/X402FacilitatorServer.js.map +1 -1
- package/package.json +3 -2
- package/dist/src/agents/AgentRegistry.d.ts +0 -48
- package/dist/src/agents/AgentRegistry.d.ts.map +0 -1
- package/dist/src/agents/AgentRegistry.js +0 -114
- package/dist/src/agents/AgentRegistry.js.map +0 -1
- package/dist/src/agents/AnalyzerAgent.d.ts +0 -18
- package/dist/src/agents/AnalyzerAgent.d.ts.map +0 -1
- package/dist/src/agents/AnalyzerAgent.js +0 -129
- package/dist/src/agents/AnalyzerAgent.js.map +0 -1
- package/dist/src/agents/IntelligentVerifierAgent.d.ts +0 -46
- package/dist/src/agents/IntelligentVerifierAgent.d.ts.map +0 -1
- package/dist/src/agents/IntelligentVerifierAgent.js +0 -262
- package/dist/src/agents/IntelligentVerifierAgent.js.map +0 -1
- package/dist/src/agents/SettlementAgentEnhanced.d.ts +0 -33
- package/dist/src/agents/SettlementAgentEnhanced.d.ts.map +0 -1
- package/dist/src/agents/SettlementAgentEnhanced.js +0 -219
- package/dist/src/agents/SettlementAgentEnhanced.js.map +0 -1
- package/dist/src/agents/VerifierAgent.d.ts +0 -30
- package/dist/src/agents/VerifierAgent.d.ts.map +0 -1
- package/dist/src/agents/VerifierAgent.js +0 -181
- package/dist/src/agents/VerifierAgent.js.map +0 -1
- package/dist/src/modes/HumanInTheLoopMode.d.ts +0 -92
- package/dist/src/modes/HumanInTheLoopMode.d.ts.map +0 -1
- package/dist/src/modes/HumanInTheLoopMode.js +0 -234
- package/dist/src/modes/HumanInTheLoopMode.js.map +0 -1
- package/dist/src/modes/index.d.ts +0 -8
- package/dist/src/modes/index.d.ts.map +0 -1
- package/dist/src/modes/index.js +0 -11
- package/dist/src/modes/index.js.map +0 -1
- package/dist/src/protocols/A2ANegotiation.d.ts +0 -122
- package/dist/src/protocols/A2ANegotiation.d.ts.map +0 -1
- package/dist/src/protocols/A2ANegotiation.js +0 -230
- package/dist/src/protocols/A2ANegotiation.js.map +0 -1
- package/dist/src/services/index.d.ts +0 -8
- package/dist/src/services/index.d.ts.map +0 -1
- package/dist/src/services/index.js +0 -13
- package/dist/src/services/index.js.map +0 -1
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Intelligent Verifier Agent with LLM Reasoning
|
|
3
|
-
*
|
|
4
|
-
* This agent uses OpenAI LLM to make intelligent decisions about:
|
|
5
|
-
* - Invoice validation and fraud detection
|
|
6
|
-
* - Payment approval with context-aware reasoning
|
|
7
|
-
* - Negotiation with counter-offers
|
|
8
|
-
* - Anomaly detection in transactions
|
|
9
|
-
*
|
|
10
|
-
* Demonstrates the power of AI + blockchain for autonomous decisions
|
|
11
|
-
*/
|
|
12
|
-
export declare class IntelligentVerifierAgent {
|
|
13
|
-
private llm?;
|
|
14
|
-
private hcsClient?;
|
|
15
|
-
private agentId;
|
|
16
|
-
private useLLM;
|
|
17
|
-
constructor();
|
|
18
|
-
/**
|
|
19
|
-
* Intelligent invoice validation using LLM reasoning
|
|
20
|
-
*/
|
|
21
|
-
analyzeInvoiceWithReasoning(invoice: any): Promise<{
|
|
22
|
-
approved: boolean;
|
|
23
|
-
reasoning: string;
|
|
24
|
-
confidence: number;
|
|
25
|
-
riskFactors: string[];
|
|
26
|
-
}>;
|
|
27
|
-
/**
|
|
28
|
-
* Parse LLM response (handles both JSON and plain text)
|
|
29
|
-
*/
|
|
30
|
-
private parseLLMResponse;
|
|
31
|
-
/**
|
|
32
|
-
* Fallback rule-based analysis
|
|
33
|
-
*/
|
|
34
|
-
private analyzeInvoiceRuleBased;
|
|
35
|
-
/**
|
|
36
|
-
* Intelligent fraud detection
|
|
37
|
-
*/
|
|
38
|
-
detectFraud(transaction: any): Promise<{
|
|
39
|
-
isFraud: boolean;
|
|
40
|
-
riskScore: number;
|
|
41
|
-
reasoning: string;
|
|
42
|
-
recommendations: string[];
|
|
43
|
-
}>;
|
|
44
|
-
init(): Promise<void>;
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=IntelligentVerifierAgent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IntelligentVerifierAgent.d.ts","sourceRoot":"","sources":["../../../src/agents/IntelligentVerifierAgent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AASH,qBAAa,wBAAwB;IACnC,OAAO,CAAC,GAAG,CAAC,CAAY;IACxB,OAAO,CAAC,SAAS,CAAC,CAAa;IAC/B,OAAO,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,MAAM,CAAS;;IAsCvB;;OAEG;IACG,2BAA2B,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC;QACvD,QAAQ,EAAE,OAAO,CAAA;QACjB,SAAS,EAAE,MAAM,CAAA;QACjB,UAAU,EAAE,MAAM,CAAA;QAClB,WAAW,EAAE,MAAM,EAAE,CAAA;KACtB,CAAC;IAqDF;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAqCxB;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAoD/B;;OAEG;IACG,WAAW,CAAC,WAAW,EAAE,GAAG,GAAG,OAAO,CAAC;QAC3C,OAAO,EAAE,OAAO,CAAA;QAChB,SAAS,EAAE,MAAM,CAAA;QACjB,SAAS,EAAE,MAAM,CAAA;QACjB,eAAe,EAAE,MAAM,EAAE,CAAA;KAC1B,CAAC;IAmEI,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAW5B"}
|
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Intelligent Verifier Agent with LLM Reasoning
|
|
4
|
-
*
|
|
5
|
-
* This agent uses OpenAI LLM to make intelligent decisions about:
|
|
6
|
-
* - Invoice validation and fraud detection
|
|
7
|
-
* - Payment approval with context-aware reasoning
|
|
8
|
-
* - Negotiation with counter-offers
|
|
9
|
-
* - Anomaly detection in transactions
|
|
10
|
-
*
|
|
11
|
-
* Demonstrates the power of AI + blockchain for autonomous decisions
|
|
12
|
-
*/
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.IntelligentVerifierAgent = void 0;
|
|
18
|
-
const openai_1 = require("@langchain/openai");
|
|
19
|
-
const standards_agent_kit_1 = require("@hashgraphonline/standards-agent-kit");
|
|
20
|
-
const env_1 = require("../utils/env");
|
|
21
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
22
|
-
(0, env_1.loadEnvIfNeeded)();
|
|
23
|
-
class IntelligentVerifierAgent {
|
|
24
|
-
llm;
|
|
25
|
-
hcsClient;
|
|
26
|
-
agentId;
|
|
27
|
-
useLLM;
|
|
28
|
-
constructor() {
|
|
29
|
-
const apiKey = process.env.OPENAI_API_KEY;
|
|
30
|
-
const agentId = process.env.VERIFIER_AGENT_ID || process.env.HEDERA_ACCOUNT_ID;
|
|
31
|
-
const privateKey = process.env.VERIFIER_PRIVATE_KEY || process.env.HEDERA_PRIVATE_KEY;
|
|
32
|
-
this.agentId = agentId || 'demo-agent';
|
|
33
|
-
// Try to initialize HCS client, but don't fail if credentials are missing
|
|
34
|
-
if (agentId && privateKey) {
|
|
35
|
-
try {
|
|
36
|
-
this.hcsClient = new standards_agent_kit_1.HCS10Client(agentId, privateKey, 'testnet');
|
|
37
|
-
}
|
|
38
|
-
catch (error) {
|
|
39
|
-
// Ignore initialization errors - we'll use LLM without HCS
|
|
40
|
-
console.log(chalk_1.default.yellow('⚠️ Could not initialize HCS client'));
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
this.useLLM = !!apiKey;
|
|
44
|
-
// Initialize LLM only if API key is provided
|
|
45
|
-
if (apiKey) {
|
|
46
|
-
try {
|
|
47
|
-
this.llm = new openai_1.ChatOpenAI({
|
|
48
|
-
model: 'gpt-4o-mini',
|
|
49
|
-
temperature: 0.2,
|
|
50
|
-
maxTokens: 500
|
|
51
|
-
});
|
|
52
|
-
console.log(chalk_1.default.green('✅ Intelligent Verifier Agent initialized with LLM reasoning'));
|
|
53
|
-
}
|
|
54
|
-
catch (error) {
|
|
55
|
-
console.log(chalk_1.default.yellow('⚠️ LLM initialization failed - falling back to rule-based validation'));
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
console.log(chalk_1.default.yellow('⚠️ No OpenAI API key - falling back to rule-based validation'));
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Intelligent invoice validation using LLM reasoning
|
|
64
|
-
*/
|
|
65
|
-
async analyzeInvoiceWithReasoning(invoice) {
|
|
66
|
-
if (!this.useLLM || !this.llm) {
|
|
67
|
-
// Fallback to rule-based validation
|
|
68
|
-
return this.analyzeInvoiceRuleBased(invoice);
|
|
69
|
-
}
|
|
70
|
-
try {
|
|
71
|
-
console.log(chalk_1.default.blue('🤖 LLM analyzing invoice with intelligent reasoning...'));
|
|
72
|
-
const systemPrompt = `You are an intelligent financial agent analyzing invoices for automated payment.
|
|
73
|
-
Your task is to validate the invoice, detect potential fraud, and approve or reject based on risk assessment.
|
|
74
|
-
|
|
75
|
-
Business Rules:
|
|
76
|
-
- Amounts < $500: Usually approved automatically
|
|
77
|
-
- Amounts $500-$2000: Require scrutiny
|
|
78
|
-
- Amounts > $2000: Require detailed analysis
|
|
79
|
-
|
|
80
|
-
Common Red Flags: Unusual patterns, unfamiliar vendors, round numbers without context, inconsistent metadata.
|
|
81
|
-
|
|
82
|
-
Respond in JSON format: {approved: boolean, confidence: 0-100, reasoning: string, riskFactors: [string]}`;
|
|
83
|
-
const userPrompt = `Analyze this invoice:
|
|
84
|
-
ID: ${invoice.invoiceId}
|
|
85
|
-
Amount: $${invoice.amountUSD}
|
|
86
|
-
Description: ${invoice.description}
|
|
87
|
-
Vendor: ${invoice.vendorAccountId}
|
|
88
|
-
Due Date: ${invoice.dueDate.toISOString()}
|
|
89
|
-
Category: ${invoice.category}
|
|
90
|
-
Urgency: ${invoice.urgency}`;
|
|
91
|
-
const response = await this.llm.invoke([
|
|
92
|
-
{ role: 'system', content: systemPrompt },
|
|
93
|
-
{ role: 'user', content: userPrompt }
|
|
94
|
-
]);
|
|
95
|
-
const reasoning = response.content;
|
|
96
|
-
// Parse LLM response
|
|
97
|
-
let result = this.parseLLMResponse(reasoning);
|
|
98
|
-
console.log(chalk_1.default.green('✅ LLM analysis complete'));
|
|
99
|
-
console.log(chalk_1.default.blue(`📊 Decision: ${result.approved ? 'APPROVED' : 'REJECTED'}`));
|
|
100
|
-
console.log(chalk_1.default.blue(`🎯 Confidence: ${result.confidence}%`));
|
|
101
|
-
console.log(chalk_1.default.blue(`💡 Reasoning: ${result.reasoning}`));
|
|
102
|
-
return result;
|
|
103
|
-
}
|
|
104
|
-
catch (error) {
|
|
105
|
-
console.error(chalk_1.default.red(`❌ LLM analysis failed: ${error.message}`));
|
|
106
|
-
return this.analyzeInvoiceRuleBased(invoice);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Parse LLM response (handles both JSON and plain text)
|
|
111
|
-
*/
|
|
112
|
-
parseLLMResponse(reasoning) {
|
|
113
|
-
try {
|
|
114
|
-
// Try to extract JSON
|
|
115
|
-
const jsonMatch = reasoning.match(/\{[\s\S]*\}/);
|
|
116
|
-
if (jsonMatch) {
|
|
117
|
-
const parsed = JSON.parse(jsonMatch[0]);
|
|
118
|
-
return {
|
|
119
|
-
approved: parsed.approved !== false,
|
|
120
|
-
reasoning: parsed.reasoning || 'No reasoning provided',
|
|
121
|
-
confidence: parsed.confidence || 50,
|
|
122
|
-
riskFactors: parsed.riskFactors || []
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
// If no JSON, parse text response
|
|
126
|
-
const approved = reasoning.toLowerCase().includes('approve') && !reasoning.toLowerCase().includes('not approve');
|
|
127
|
-
return {
|
|
128
|
-
approved,
|
|
129
|
-
reasoning,
|
|
130
|
-
confidence: approved ? 75 : 25,
|
|
131
|
-
riskFactors: []
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
catch (error) {
|
|
135
|
-
return {
|
|
136
|
-
approved: true,
|
|
137
|
-
reasoning: reasoning,
|
|
138
|
-
confidence: 50,
|
|
139
|
-
riskFactors: []
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Fallback rule-based analysis
|
|
145
|
-
*/
|
|
146
|
-
analyzeInvoiceRuleBased(invoice) {
|
|
147
|
-
const riskFactors = [];
|
|
148
|
-
let approved = true;
|
|
149
|
-
// Check amount
|
|
150
|
-
if (invoice.amountUSD > 2000) {
|
|
151
|
-
riskFactors.push('High amount (>$2000)');
|
|
152
|
-
approved = false;
|
|
153
|
-
return {
|
|
154
|
-
approved: false,
|
|
155
|
-
reasoning: 'Amount exceeds rule-based threshold of $2000',
|
|
156
|
-
confidence: 80,
|
|
157
|
-
riskFactors
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
if (invoice.amountUSD > 500) {
|
|
161
|
-
riskFactors.push('Medium amount ($500-$2000)');
|
|
162
|
-
}
|
|
163
|
-
// Check if vendor account is provided
|
|
164
|
-
if (!invoice.vendorAccountId || invoice.vendorAccountId === '0.0.XXXXXX') {
|
|
165
|
-
approved = false;
|
|
166
|
-
riskFactors.push('Invalid vendor account');
|
|
167
|
-
return {
|
|
168
|
-
approved: false,
|
|
169
|
-
reasoning: 'Invalid or missing vendor account ID',
|
|
170
|
-
confidence: 90,
|
|
171
|
-
riskFactors
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
// Check description
|
|
175
|
-
if (!invoice.description || invoice.description.length < 10) {
|
|
176
|
-
riskFactors.push('Insufficient description');
|
|
177
|
-
}
|
|
178
|
-
return {
|
|
179
|
-
approved,
|
|
180
|
-
reasoning: approved
|
|
181
|
-
? `Rule-based validation passed. Amount: $${invoice.amountUSD} within acceptable range.`
|
|
182
|
-
: 'Rule-based validation failed due to risk factors',
|
|
183
|
-
confidence: 70,
|
|
184
|
-
riskFactors
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Intelligent fraud detection
|
|
189
|
-
*/
|
|
190
|
-
async detectFraud(transaction) {
|
|
191
|
-
if (!this.useLLM || !this.llm) {
|
|
192
|
-
return {
|
|
193
|
-
isFraud: false,
|
|
194
|
-
riskScore: 0,
|
|
195
|
-
reasoning: 'LLM not available for fraud detection',
|
|
196
|
-
recommendations: []
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
try {
|
|
200
|
-
console.log(chalk_1.default.blue('🔍 LLM checking for fraud patterns...'));
|
|
201
|
-
const systemPrompt = `You are a fraud detection agent. Analyze transactions for suspicious patterns.
|
|
202
|
-
|
|
203
|
-
VALID: Hedera account IDs (0.0.XXXXXX), reasonable amounts for B2B ($1-$10000), typical business descriptions.
|
|
204
|
-
|
|
205
|
-
RED FLAGS:
|
|
206
|
-
- Amounts outside $1-$10000 range
|
|
207
|
-
- Vague or suspicious descriptions ("urgent payment needed")
|
|
208
|
-
- Multiple rapid transactions in short time
|
|
209
|
-
- Amounts with suspicious patterns (e.g., $1234.56)
|
|
210
|
-
|
|
211
|
-
Respond in JSON only: {"isFraud": false, "riskScore": 0-100, "reasoning": "brief explanation", "recommendations": []}`;
|
|
212
|
-
const userPrompt = `Transaction:
|
|
213
|
-
Amount: $${transaction.amount}
|
|
214
|
-
Vendor: ${transaction.vendorAccountId}
|
|
215
|
-
Description: ${transaction.description}
|
|
216
|
-
Timestamp: ${transaction.timestamp}`;
|
|
217
|
-
const response = await this.llm.invoke([
|
|
218
|
-
{ role: 'system', content: systemPrompt },
|
|
219
|
-
{ role: 'user', content: userPrompt }
|
|
220
|
-
]);
|
|
221
|
-
const reasoning = response.content;
|
|
222
|
-
// Parse response
|
|
223
|
-
const jsonMatch = reasoning.match(/\{[\s\S]*\}/);
|
|
224
|
-
if (jsonMatch) {
|
|
225
|
-
const parsed = JSON.parse(jsonMatch[0]);
|
|
226
|
-
return {
|
|
227
|
-
isFraud: parsed.isFraud || false,
|
|
228
|
-
riskScore: parsed.riskScore || 0,
|
|
229
|
-
reasoning: parsed.reasoning || 'No fraud detected',
|
|
230
|
-
recommendations: parsed.recommendations || []
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
return {
|
|
234
|
-
isFraud: false,
|
|
235
|
-
riskScore: 0,
|
|
236
|
-
reasoning,
|
|
237
|
-
recommendations: []
|
|
238
|
-
};
|
|
239
|
-
}
|
|
240
|
-
catch (error) {
|
|
241
|
-
console.error(chalk_1.default.red(`❌ Fraud detection failed: ${error.message}`));
|
|
242
|
-
return {
|
|
243
|
-
isFraud: false,
|
|
244
|
-
riskScore: 0,
|
|
245
|
-
reasoning: 'Fraud detection unavailable',
|
|
246
|
-
recommendations: []
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
async init() {
|
|
251
|
-
const topicId = process.env.VERIFIER_TOPIC_ID;
|
|
252
|
-
if (!topicId) {
|
|
253
|
-
console.log(chalk_1.default.yellow('⚠️ No topic ID - agent will not poll'));
|
|
254
|
-
return;
|
|
255
|
-
}
|
|
256
|
-
console.log(chalk_1.default.green('✅ Intelligent Verifier Agent ready'));
|
|
257
|
-
console.log(chalk_1.default.blue(`📡 Topic ID: ${topicId}`));
|
|
258
|
-
console.log(chalk_1.default.blue(`🤖 LLM Reasoning: ${this.useLLM ? 'Enabled' : 'Disabled'}`));
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
exports.IntelligentVerifierAgent = IntelligentVerifierAgent;
|
|
262
|
-
//# sourceMappingURL=IntelligentVerifierAgent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IntelligentVerifierAgent.js","sourceRoot":"","sources":["../../../src/agents/IntelligentVerifierAgent.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;AAEH,8CAA8C;AAC9C,8EAAkE;AAClE,sCAA8C;AAC9C,kDAAyB;AAEzB,IAAA,qBAAe,GAAE,CAAA;AAEjB,MAAa,wBAAwB;IAC3B,GAAG,CAAa;IAChB,SAAS,CAAc;IACvB,OAAO,CAAQ;IACf,MAAM,CAAS;IAEvB;QACE,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAA;QACzC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAA;QAC9E,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAA;QAErF,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,YAAY,CAAA;QAEtC,0EAA0E;QAC1E,IAAI,OAAO,IAAI,UAAU,EAAE,CAAC;YAC1B,IAAI,CAAC;gBACH,IAAI,CAAC,SAAS,GAAG,IAAI,iCAAW,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,CAAA;YAClE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,2DAA2D;gBAC3D,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,qCAAqC,CAAC,CAAC,CAAA;YAClE,CAAC;QACH,CAAC;QAED,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAA;QAEtB,6CAA6C;QAC7C,IAAI,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R,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC,CAAA;QAC9D,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,gBAAgB,OAAO,EAAE,CAAC,CAAC,CAAA;QAClD,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,qBAAqB,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAA;IACtF,CAAC;CACF;AA5RD,4DA4RC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enhanced Settlement Agent with A2A Protocol, AP2 Payments, and HITL Mode
|
|
3
|
-
*
|
|
4
|
-
* This enhanced agent implements:
|
|
5
|
-
* - A2A protocol for agent-to-agent communication
|
|
6
|
-
* - AP2 payment protocol for autonomous settlements
|
|
7
|
-
* - Human-in-the-Loop mode for approval workflows
|
|
8
|
-
* - Multi-agent negotiation for payment terms
|
|
9
|
-
*/
|
|
10
|
-
export declare class SettlementAgentEnhanced {
|
|
11
|
-
private hcsClient;
|
|
12
|
-
private provider;
|
|
13
|
-
private wallet;
|
|
14
|
-
private hederaClient?;
|
|
15
|
-
private a2a;
|
|
16
|
-
private a2aNegotiation;
|
|
17
|
-
private hitl;
|
|
18
|
-
private facilitator;
|
|
19
|
-
private paymentNetwork;
|
|
20
|
-
constructor();
|
|
21
|
-
init(): Promise<void>;
|
|
22
|
-
private startMessagePolling;
|
|
23
|
-
private handleMessage;
|
|
24
|
-
private handleA2AMessage;
|
|
25
|
-
private handleAP2Payment;
|
|
26
|
-
private executeHederaPayment;
|
|
27
|
-
private executeBasePayment;
|
|
28
|
-
private executeSettlement;
|
|
29
|
-
private executeHederaSettlement;
|
|
30
|
-
private executeX402Settlement;
|
|
31
|
-
triggerSettlement(verification: any): Promise<void>;
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=SettlementAgentEnhanced.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SettlementAgentEnhanced.d.ts","sourceRoot":"","sources":["../../../src/agents/SettlementAgentEnhanced.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAgBH,qBAAa,uBAAuB;IAClC,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,QAAQ,CAAiB;IACjC,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,YAAY,CAAC,CAAQ;IAC7B,OAAO,CAAC,GAAG,CAAa;IACxB,OAAO,CAAC,cAAc,CAAgB;IACtC,OAAO,CAAC,IAAI,CAAoB;IAChC,OAAO,CAAC,WAAW,CAAuB;IAC1C,OAAO,CAAC,cAAc,CAAmC;;IAgEnD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAc3B,OAAO,CAAC,mBAAmB;YAeb,aAAa;YAkBb,gBAAgB;YAgBhB,gBAAgB;YAkChB,oBAAoB;YAMpB,kBAAkB;YAMlB,iBAAiB;YAgCjB,uBAAuB;YAIvB,qBAAqB;IAI7B,iBAAiB,CAAC,YAAY,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;CAG1D"}
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Enhanced Settlement Agent with A2A Protocol, AP2 Payments, and HITL Mode
|
|
4
|
-
*
|
|
5
|
-
* This enhanced agent implements:
|
|
6
|
-
* - A2A protocol for agent-to-agent communication
|
|
7
|
-
* - AP2 payment protocol for autonomous settlements
|
|
8
|
-
* - Human-in-the-Loop mode for approval workflows
|
|
9
|
-
* - Multi-agent negotiation for payment terms
|
|
10
|
-
*/
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.SettlementAgentEnhanced = void 0;
|
|
16
|
-
const standards_agent_kit_1 = require("@hashgraphonline/standards-agent-kit");
|
|
17
|
-
const ethers_1 = require("ethers");
|
|
18
|
-
const sdk_1 = require("@hashgraph/sdk");
|
|
19
|
-
const A2AProtocol_1 = require("../protocols/A2AProtocol");
|
|
20
|
-
const A2ANegotiation_1 = require("../protocols/A2ANegotiation");
|
|
21
|
-
const AP2Protocol_1 = require("../protocols/AP2Protocol");
|
|
22
|
-
const HumanInTheLoopMode_1 = require("../modes/HumanInTheLoopMode");
|
|
23
|
-
const X402FacilitatorServer_1 = require("../facilitator/X402FacilitatorServer");
|
|
24
|
-
const env_1 = require("../utils/env");
|
|
25
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
26
|
-
(0, env_1.loadEnvIfNeeded)();
|
|
27
|
-
class SettlementAgentEnhanced {
|
|
28
|
-
hcsClient;
|
|
29
|
-
provider;
|
|
30
|
-
wallet;
|
|
31
|
-
hederaClient;
|
|
32
|
-
a2a;
|
|
33
|
-
a2aNegotiation;
|
|
34
|
-
hitl;
|
|
35
|
-
facilitator;
|
|
36
|
-
paymentNetwork;
|
|
37
|
-
constructor() {
|
|
38
|
-
// Initialize base components (similar to existing SettlementAgent)
|
|
39
|
-
const agentId = process.env.SETTLEMENT_AGENT_ID;
|
|
40
|
-
const privateKey = process.env.SETTLEMENT_PRIVATE_KEY;
|
|
41
|
-
const baseRpcUrl = process.env.BASE_RPC_URL;
|
|
42
|
-
const walletPrivateKey = process.env.SETTLEMENT_WALLET_PRIVATE_KEY;
|
|
43
|
-
const mainAccountId = process.env.HEDERA_ACCOUNT_ID;
|
|
44
|
-
const mainPrivateKey = process.env.HEDERA_PRIVATE_KEY;
|
|
45
|
-
if (!agentId || !privateKey || !baseRpcUrl || !walletPrivateKey) {
|
|
46
|
-
throw new Error('Missing required environment variables');
|
|
47
|
-
}
|
|
48
|
-
// Initialize HCS client
|
|
49
|
-
if (privateKey.startsWith('placeholder-key-for-')) {
|
|
50
|
-
if (!mainAccountId || !mainPrivateKey) {
|
|
51
|
-
throw new Error('Missing main Hedera credentials');
|
|
52
|
-
}
|
|
53
|
-
this.hcsClient = new standards_agent_kit_1.HCS10Client(mainAccountId, mainPrivateKey, 'testnet');
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
this.hcsClient = new standards_agent_kit_1.HCS10Client(agentId, privateKey, 'testnet');
|
|
57
|
-
}
|
|
58
|
-
// Initialize Ethereum/Base components
|
|
59
|
-
this.provider = new ethers_1.JsonRpcProvider(baseRpcUrl);
|
|
60
|
-
this.wallet = new ethers_1.Wallet(walletPrivateKey, this.provider);
|
|
61
|
-
this.facilitator = new X402FacilitatorServer_1.X402FacilitatorServer();
|
|
62
|
-
this.paymentNetwork = (process.env.PAYMENT_NETWORK || 'base-sepolia');
|
|
63
|
-
// Initialize Hedera client if needed
|
|
64
|
-
if (this.paymentNetwork === 'hedera-testnet') {
|
|
65
|
-
if (!mainAccountId || !mainPrivateKey) {
|
|
66
|
-
throw new Error('Missing required Hedera credentials');
|
|
67
|
-
}
|
|
68
|
-
this.hederaClient = sdk_1.Client.forTestnet();
|
|
69
|
-
const accountId = sdk_1.AccountId.fromString(mainAccountId);
|
|
70
|
-
const privateKeyObj = sdk_1.PrivateKey.fromString(mainPrivateKey);
|
|
71
|
-
this.hederaClient.setOperator(accountId, privateKeyObj);
|
|
72
|
-
}
|
|
73
|
-
// Initialize A2A protocol
|
|
74
|
-
this.a2a = new A2AProtocol_1.A2AProtocol(this.hcsClient, agentId || mainAccountId || "unknown", ['payment', 'settlement', 'negotiation']);
|
|
75
|
-
// Initialize A2A negotiation
|
|
76
|
-
this.a2aNegotiation = new A2ANegotiation_1.A2ANegotiation(this.a2a);
|
|
77
|
-
// Initialize HITL mode
|
|
78
|
-
this.hitl = new HumanInTheLoopMode_1.HumanInTheLoopMode({
|
|
79
|
-
enabled: process.env.HITL_ENABLED === 'true',
|
|
80
|
-
approvalThresholds: {
|
|
81
|
-
payment: parseFloat(process.env.HITL_PAYMENT_THRESHOLD || '100')
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
async init() {
|
|
86
|
-
const topicId = process.env.SETTLEMENT_TOPIC_ID;
|
|
87
|
-
if (!topicId) {
|
|
88
|
-
throw new Error('Missing SETTLEMENT_TOPIC_ID');
|
|
89
|
-
}
|
|
90
|
-
this.startMessagePolling(topicId);
|
|
91
|
-
console.log(chalk_1.default.green('✅ SettlementAgentEnhanced initialized'));
|
|
92
|
-
console.log(chalk_1.default.blue(`📡 A2A Protocol: Enabled`));
|
|
93
|
-
console.log(chalk_1.default.blue(`💬 Negotiation: Enabled`));
|
|
94
|
-
console.log(chalk_1.default.blue(`👤 HITL Mode: ${this.hitl['config'].enabled ? 'Enabled' : 'Disabled'}`));
|
|
95
|
-
}
|
|
96
|
-
startMessagePolling(topicId) {
|
|
97
|
-
setInterval(async () => {
|
|
98
|
-
try {
|
|
99
|
-
const result = await this.hcsClient.getMessages(topicId);
|
|
100
|
-
if (result.messages && result.messages.length > 0) {
|
|
101
|
-
for (const message of result.messages) {
|
|
102
|
-
await this.handleMessage(message);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
catch (error) {
|
|
107
|
-
console.error('Error polling:', error);
|
|
108
|
-
}
|
|
109
|
-
}, 5000);
|
|
110
|
-
}
|
|
111
|
-
async handleMessage(message) {
|
|
112
|
-
try {
|
|
113
|
-
const content = message.contents || message.data || '{}';
|
|
114
|
-
const parsed = JSON.parse(content);
|
|
115
|
-
// Try to parse as A2A message
|
|
116
|
-
const a2aMessage = this.a2a.parseMessage(content);
|
|
117
|
-
if (a2aMessage) {
|
|
118
|
-
await this.handleA2AMessage(a2aMessage);
|
|
119
|
-
}
|
|
120
|
-
else if (parsed.type === 'verification_result' && parsed.approved) {
|
|
121
|
-
await this.executeSettlement(parsed);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
catch (error) {
|
|
125
|
-
console.error('Error handling message:', error);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
async handleA2AMessage(message) {
|
|
129
|
-
console.log(chalk_1.default.blue(`📨 Received A2A ${message.messageType} message`));
|
|
130
|
-
// Handle negotiation messages
|
|
131
|
-
const negotiationResult = await this.a2aNegotiation.processNegotiationMessage(message);
|
|
132
|
-
if (negotiationResult) {
|
|
133
|
-
console.log(chalk_1.default.green(`✅ Negotiation ${negotiationResult.proposalId}: ${negotiationResult.state}`));
|
|
134
|
-
}
|
|
135
|
-
// Handle AP2 payment messages
|
|
136
|
-
const paymentRequest = AP2Protocol_1.AP2Protocol.parseAP2Message(message);
|
|
137
|
-
if (paymentRequest) {
|
|
138
|
-
await this.handleAP2Payment(paymentRequest);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
async handleAP2Payment(paymentRequest) {
|
|
142
|
-
console.log(chalk_1.default.blue(`💳 Processing AP2 payment request: ${paymentRequest.paymentId}`));
|
|
143
|
-
// Validate payment request
|
|
144
|
-
const validation = AP2Protocol_1.AP2Protocol.validatePaymentRequest(paymentRequest);
|
|
145
|
-
if (!validation.valid) {
|
|
146
|
-
console.error(chalk_1.default.red(`❌ Payment validation failed: ${validation.error}`));
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
// Request human approval if threshold exceeded
|
|
150
|
-
if (this.hitl['config'].enabled &&
|
|
151
|
-
this.hitl.requiresApproval("payment", { amount: parseFloat(paymentRequest.amount) })) {
|
|
152
|
-
const approval = await this.hitl.requestApproval({
|
|
153
|
-
action: "payment",
|
|
154
|
-
description: `AP2 payment of ${paymentRequest.amount} ${paymentRequest.currency}`,
|
|
155
|
-
details: paymentRequest
|
|
156
|
-
});
|
|
157
|
-
if (!approval.approved) {
|
|
158
|
-
console.log(chalk_1.default.red('❌ Human approval denied'));
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
// Execute payment based on network
|
|
163
|
-
if (paymentRequest.network === 'hedera-testnet') {
|
|
164
|
-
await this.executeHederaPayment(paymentRequest);
|
|
165
|
-
}
|
|
166
|
-
else {
|
|
167
|
-
await this.executeBasePayment(paymentRequest);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
async executeHederaPayment(paymentRequest) {
|
|
171
|
-
// Implementation for Hedera payments
|
|
172
|
-
console.log(chalk_1.default.blue(`Executing Hedera payment: ${paymentRequest.amount} ${paymentRequest.currency}`));
|
|
173
|
-
// ... implementation
|
|
174
|
-
}
|
|
175
|
-
async executeBasePayment(paymentRequest) {
|
|
176
|
-
// Implementation for Base/USDC payments
|
|
177
|
-
console.log(chalk_1.default.blue(`Executing Base payment: ${paymentRequest.amount} ${paymentRequest.currency}`));
|
|
178
|
-
// ... implementation
|
|
179
|
-
}
|
|
180
|
-
async executeSettlement(verification) {
|
|
181
|
-
try {
|
|
182
|
-
console.log(chalk_1.default.yellow(`Initiating settlement on ${this.paymentNetwork}...`));
|
|
183
|
-
// Check if HITL approval is required
|
|
184
|
-
const amount = verification.paymentDetails?.amount || 0;
|
|
185
|
-
if (this.hitl['config'].enabled && this.hitl.requiresApproval("payment", { amount })) {
|
|
186
|
-
const approval = await this.hitl.requestApproval({
|
|
187
|
-
action: "settlement",
|
|
188
|
-
description: `Settlement payment of ${amount}`,
|
|
189
|
-
details: verification.paymentDetails
|
|
190
|
-
});
|
|
191
|
-
if (!approval.approved) {
|
|
192
|
-
console.log(chalk_1.default.red('❌ Settlement denied by human'));
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
if (this.paymentNetwork === 'hedera-testnet') {
|
|
197
|
-
await this.executeHederaSettlement(verification);
|
|
198
|
-
}
|
|
199
|
-
else {
|
|
200
|
-
await this.executeX402Settlement(verification);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
catch (error) {
|
|
204
|
-
console.error('Error executing settlement:', error);
|
|
205
|
-
throw error;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
async executeHederaSettlement(verification) {
|
|
209
|
-
// Implementation
|
|
210
|
-
}
|
|
211
|
-
async executeX402Settlement(verification) {
|
|
212
|
-
// Implementation
|
|
213
|
-
}
|
|
214
|
-
async triggerSettlement(verification) {
|
|
215
|
-
await this.executeSettlement(verification);
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
exports.SettlementAgentEnhanced = SettlementAgentEnhanced;
|
|
219
|
-
//# sourceMappingURL=SettlementAgentEnhanced.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SettlementAgentEnhanced.js","sourceRoot":"","sources":["../../../src/agents/SettlementAgentEnhanced.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;;AAEH,8EAAkE;AAClE,mCAAgD;AAChD,wCAA8G;AAE9G,0DAAsD;AACtD,gEAA8E;AAC9E,0DAAyE;AACzE,oEAAiF;AACjF,gFAA4E;AAC5E,sCAA8C;AAC9C,kDAAyB;AAEzB,IAAA,qBAAe,GAAE,CAAA;AAEjB,MAAa,uBAAuB;IAC1B,SAAS,CAAa;IACtB,QAAQ,CAAiB;IACzB,MAAM,CAAQ;IACd,YAAY,CAAS;IACrB,GAAG,CAAa;IAChB,cAAc,CAAgB;IAC9B,IAAI,CAAoB;IACxB,WAAW,CAAuB;IAClC,cAAc,CAAmC;IAEzD;QACE,mEAAmE;QACnE,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAA;QAC/C,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAA;QACrD,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAA;QAC3C,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAA;QAClE,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAA;QACnD,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAA;QAErD,IAAI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BAAiB,CAAC,YAAY,CAAC,CAAA;IAC5C,CAAC;CACF;AAjOD,0DAiOC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { HCS10Client } from '@hashgraphonline/standards-agent-kit';
|
|
2
|
-
import { HCS10ConnectionManager } from '../protocols/HCS10ConnectionManager';
|
|
3
|
-
import { HCS10TransactionApproval } from '../protocols/HCS10TransactionApproval';
|
|
4
|
-
export declare class VerifierAgent {
|
|
5
|
-
private hcsClient;
|
|
6
|
-
private messageHandlers;
|
|
7
|
-
private connectionManager?;
|
|
8
|
-
private transactionApproval?;
|
|
9
|
-
constructor();
|
|
10
|
-
init(): Promise<void>;
|
|
11
|
-
private startMessagePolling;
|
|
12
|
-
private handleMessage;
|
|
13
|
-
private validateProposal;
|
|
14
|
-
/**
|
|
15
|
-
* Register custom message handlers for specific message types
|
|
16
|
-
* @param type - The message type to handle
|
|
17
|
-
* @param handler - The handler function to call when this message type is received
|
|
18
|
-
*/
|
|
19
|
-
onMessage(type: string, handler: Function): void;
|
|
20
|
-
/**
|
|
21
|
-
* Get connection manager instance (if initialized)
|
|
22
|
-
*/
|
|
23
|
-
getConnectionManager(): HCS10ConnectionManager | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* Get transaction approval manager instance (if initialized)
|
|
26
|
-
*/
|
|
27
|
-
getTransactionApproval(): HCS10TransactionApproval | undefined;
|
|
28
|
-
getHcsClient(): HCS10Client;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=VerifierAgent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VerifierAgent.d.ts","sourceRoot":"","sources":["../../../src/agents/VerifierAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAA;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAA;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAA;AAOhF,qBAAa,aAAa;IACxB,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,eAAe,CAAuB;IAC9C,OAAO,CAAC,iBAAiB,CAAC,CAAwB;IAClD,OAAO,CAAC,mBAAmB,CAAC,CAA0B;;IAiDhD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAsB3B,OAAO,CAAC,mBAAmB;YAiBb,aAAa;YAyBb,gBAAgB;IAwC9B;;;;OAIG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,IAAI;IAKhD;;OAEG;IACH,oBAAoB,IAAI,sBAAsB,GAAG,SAAS;IAI1D;;OAEG;IACH,sBAAsB,IAAI,wBAAwB,GAAG,SAAS;IAI9D,YAAY,IAAI,WAAW;CAG5B"}
|