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
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* AP2 (A2A Payment) Protocol
|
|
4
|
+
* Agent-to-Agent Payment Protocol for autonomous transactions
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.AP2PaymentNegotiation = exports.AP2Protocol = void 0;
|
|
8
|
+
class AP2Protocol {
|
|
9
|
+
network;
|
|
10
|
+
currency;
|
|
11
|
+
constructor(network = 'solana-devnet', currency = 'USDC') {
|
|
12
|
+
this.network = network;
|
|
13
|
+
this.currency = currency;
|
|
14
|
+
}
|
|
15
|
+
createPaymentRequest(from, to, amount, description, metadata) {
|
|
16
|
+
const now = Date.now();
|
|
17
|
+
const request = {
|
|
18
|
+
id: `ap2-${now}-${Math.random().toString(36).substr(2, 9)}`,
|
|
19
|
+
from,
|
|
20
|
+
to,
|
|
21
|
+
amount: amount.toString(),
|
|
22
|
+
currency: this.currency,
|
|
23
|
+
network: this.network,
|
|
24
|
+
createdAt: now,
|
|
25
|
+
expiresAt: now + (5 * 60 * 1000)
|
|
26
|
+
};
|
|
27
|
+
if (description !== undefined)
|
|
28
|
+
request.description = description;
|
|
29
|
+
if (metadata !== undefined)
|
|
30
|
+
request.metadata = metadata;
|
|
31
|
+
return request;
|
|
32
|
+
}
|
|
33
|
+
createPaymentResponse(requestId, status, transactionHash, message) {
|
|
34
|
+
const response = {
|
|
35
|
+
requestId,
|
|
36
|
+
status,
|
|
37
|
+
timestamp: Date.now()
|
|
38
|
+
};
|
|
39
|
+
if (transactionHash !== undefined)
|
|
40
|
+
response.transactionHash = transactionHash;
|
|
41
|
+
if (message !== undefined)
|
|
42
|
+
response.message = message;
|
|
43
|
+
return response;
|
|
44
|
+
}
|
|
45
|
+
verifyPayment(requestId, transactionHash, verified, confirmations = 0) {
|
|
46
|
+
return {
|
|
47
|
+
requestId,
|
|
48
|
+
transactionHash,
|
|
49
|
+
network: this.network,
|
|
50
|
+
verified,
|
|
51
|
+
confirmations,
|
|
52
|
+
timestamp: Date.now()
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
isExpired(request) {
|
|
56
|
+
return Date.now() > request.expiresAt;
|
|
57
|
+
}
|
|
58
|
+
validateRequest(request) {
|
|
59
|
+
const errors = [];
|
|
60
|
+
if (!request.id)
|
|
61
|
+
errors.push('Missing request ID');
|
|
62
|
+
if (!request.from)
|
|
63
|
+
errors.push('Missing sender address');
|
|
64
|
+
if (!request.to)
|
|
65
|
+
errors.push('Missing recipient address');
|
|
66
|
+
if (!request.amount || Number(request.amount) <= 0) {
|
|
67
|
+
errors.push('Invalid amount');
|
|
68
|
+
}
|
|
69
|
+
if (!request.currency)
|
|
70
|
+
errors.push('Missing currency');
|
|
71
|
+
if (!request.network)
|
|
72
|
+
errors.push('Missing network');
|
|
73
|
+
if (this.isExpired(request))
|
|
74
|
+
errors.push('Request expired');
|
|
75
|
+
return {
|
|
76
|
+
valid: errors.length === 0,
|
|
77
|
+
errors
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
encodeRequest(request) {
|
|
81
|
+
return Buffer.from(JSON.stringify(request)).toString('base64');
|
|
82
|
+
}
|
|
83
|
+
decodeRequest(encoded) {
|
|
84
|
+
const json = Buffer.from(encoded, 'base64').toString('utf-8');
|
|
85
|
+
return JSON.parse(json);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.AP2Protocol = AP2Protocol;
|
|
89
|
+
class AP2PaymentNegotiation {
|
|
90
|
+
requests;
|
|
91
|
+
responses;
|
|
92
|
+
constructor() {
|
|
93
|
+
this.requests = new Map();
|
|
94
|
+
this.responses = new Map();
|
|
95
|
+
}
|
|
96
|
+
proposePayment(request) {
|
|
97
|
+
this.requests.set(request.id, request);
|
|
98
|
+
}
|
|
99
|
+
respondToPayment(response) {
|
|
100
|
+
this.responses.set(response.requestId, response);
|
|
101
|
+
}
|
|
102
|
+
getRequest(requestId) {
|
|
103
|
+
return this.requests.get(requestId);
|
|
104
|
+
}
|
|
105
|
+
getResponse(requestId) {
|
|
106
|
+
return this.responses.get(requestId);
|
|
107
|
+
}
|
|
108
|
+
clearExpiredRequests() {
|
|
109
|
+
let cleared = 0;
|
|
110
|
+
const now = Date.now();
|
|
111
|
+
for (const [id, request] of this.requests.entries()) {
|
|
112
|
+
if (request.expiresAt < now) {
|
|
113
|
+
this.requests.delete(id);
|
|
114
|
+
cleared++;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return cleared;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.AP2PaymentNegotiation = AP2PaymentNegotiation;
|
|
121
|
+
//# sourceMappingURL=AP2Protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AP2Protocol.js","sourceRoot":"","sources":["../../../src/protocols/AP2Protocol.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAgCH,MAAa,WAAW;IACd,OAAO,CAAQ;IACf,QAAQ,CAAQ;IAExB,YAAY,UAAkB,eAAe,EAAE,WAAmB,MAAM;QACtE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC1B,CAAC;IAED,oBAAoB,CAClB,IAAY,EACZ,EAAU,EACV,MAAc,EACd,WAAoB,EACpB,QAA8B;QAE9B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QAEtB,MAAM,OAAO,GAAsB;YACjC,EAAE,EAAE,OAAO,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,E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,IAAI,GAAG,EAAE,CAAA;QACzB,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,EAAE,CAAA;IAC5B,CAAC;IAED,cAAc,CAAC,OAA0B;QACvC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAA;IACxC,CAAC;IAED,gBAAgB,CAAC,QAA4B;QAC3C,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;IAClD,CAAC;IAED,UAAU,CAAC,SAAiB;QAC1B,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;IACrC,CAAC;IAED,WAAW,CAAC,SAAiB;QAC3B,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;IACtC,CAAC;IAED,oBAAoB;QAClB,IAAI,OAAO,GAAG,CAAC,CAAA;QACf,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QAEtB,KAAK,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;YACpD,IAAI,OAAO,CAAC,SAAS,GAAG,GAAG,EAAE,CAAC;gBAC5B,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;gBACxB,OAAO,EAAE,CAAA;YACX,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAA;IAChB,CAAC;CACF;AAtCD,sDAsCC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aether Agent SDK - Protocols Module
|
|
3
|
+
*
|
|
4
|
+
* Export protocol implementations for agent communication and payments
|
|
5
|
+
*/
|
|
6
|
+
export { A2AProtocol, A2AServer } from './A2AProtocol';
|
|
7
|
+
export type { A2AMessage, A2AResponse, Task } from './A2AProtocol';
|
|
8
|
+
export { AP2Protocol, AP2PaymentNegotiation } from './AP2Protocol';
|
|
9
|
+
export type { AP2PaymentRequest, AP2PaymentResponse, AP2PaymentVerification } from './AP2Protocol';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/protocols/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACtD,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAElE,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAClE,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,eAAe,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Aether Agent SDK - Protocols Module
|
|
4
|
+
*
|
|
5
|
+
* Export protocol implementations for agent communication and payments
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.AP2PaymentNegotiation = exports.AP2Protocol = exports.A2AServer = exports.A2AProtocol = void 0;
|
|
9
|
+
var A2AProtocol_1 = require("./A2AProtocol");
|
|
10
|
+
Object.defineProperty(exports, "A2AProtocol", { enumerable: true, get: function () { return A2AProtocol_1.A2AProtocol; } });
|
|
11
|
+
Object.defineProperty(exports, "A2AServer", { enumerable: true, get: function () { return A2AProtocol_1.A2AServer; } });
|
|
12
|
+
var AP2Protocol_1 = require("./AP2Protocol");
|
|
13
|
+
Object.defineProperty(exports, "AP2Protocol", { enumerable: true, get: function () { return AP2Protocol_1.AP2Protocol; } });
|
|
14
|
+
Object.defineProperty(exports, "AP2PaymentNegotiation", { enumerable: true, get: function () { return AP2Protocol_1.AP2PaymentNegotiation; } });
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/protocols/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,6CAAsD;AAA7C,0GAAA,WAAW,OAAA;AAAE,wGAAA,SAAS,OAAA;AAG/B,6CAAkE;AAAzD,0GAAA,WAAW,OAAA;AAAE,oHAAA,qBAAqB,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Hedron Agent SDK - Services Module
|
|
4
|
+
*
|
|
5
|
+
* Export all service classes and utilities
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.createRoyaltyTokenForNFTs = exports.TokenService = void 0;
|
|
9
|
+
var TokenService_1 = require("./TokenService");
|
|
10
|
+
Object.defineProperty(exports, "TokenService", { enumerable: true, get: function () { return TokenService_1.TokenService; } });
|
|
11
|
+
var TokenService_2 = require("./TokenService");
|
|
12
|
+
Object.defineProperty(exports, "createRoyaltyTokenForNFTs", { enumerable: true, get: function () { return TokenService_2.createRoyaltyTokenForNFTs; } });
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,+CAA6C;AAApC,4GAAA,YAAY,OAAA;AACrB,+CAA0D;AAAjD,yHAAA,yBAAyB,OAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment utility functions
|
|
3
|
+
*
|
|
4
|
+
* Allows optional dotenv loading for SDK usage
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Load environment variables from .env file (if not already loaded)
|
|
8
|
+
* This is optional and only runs once
|
|
9
|
+
*/
|
|
10
|
+
export declare function loadEnvIfNeeded(): void;
|
|
11
|
+
/**
|
|
12
|
+
* Get environment variable with optional default
|
|
13
|
+
*/
|
|
14
|
+
export declare function getEnv(key: string, defaultValue?: string): string | undefined;
|
|
15
|
+
//# sourceMappingURL=env.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../src/utils/env.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;GAGG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAgBtC;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAG7E"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Environment utility functions
|
|
4
|
+
*
|
|
5
|
+
* Allows optional dotenv loading for SDK usage
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.loadEnvIfNeeded = loadEnvIfNeeded;
|
|
9
|
+
exports.getEnv = getEnv;
|
|
10
|
+
let dotenvLoaded = false;
|
|
11
|
+
/**
|
|
12
|
+
* Load environment variables from .env file (if not already loaded)
|
|
13
|
+
* This is optional and only runs once
|
|
14
|
+
*/
|
|
15
|
+
function loadEnvIfNeeded() {
|
|
16
|
+
if (dotenvLoaded) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
// Only load dotenv if it's available (not bundled in SDK)
|
|
21
|
+
const dotenv = require('dotenv');
|
|
22
|
+
if (dotenv && typeof dotenv.config === 'function') {
|
|
23
|
+
dotenv.config();
|
|
24
|
+
dotenvLoaded = true;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
// dotenv is optional - if not available, environment variables
|
|
29
|
+
// should be provided by the user via process.env
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get environment variable with optional default
|
|
34
|
+
*/
|
|
35
|
+
function getEnv(key, defaultValue) {
|
|
36
|
+
loadEnvIfNeeded();
|
|
37
|
+
return process.env[key] || defaultValue;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=env.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../../src/utils/env.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAQH,0CAgBC;AAKD,wBAGC;AA9BD,IAAI,YAAY,GAAG,KAAK,CAAA;AAExB;;;GAGG;AACH,SAAgB,eAAe;IAC7B,IAAI,YAAY,EAAE,CAAC;QACjB,OAAM;IACR,CAAC;IAED,IAAI,CAAC;QACH,0DAA0D;QAC1D,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;QAChC,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;YAClD,MAAM,CAAC,MAAM,EAAE,CAAA;YACf,YAAY,GAAG,IAAI,CAAA;QACrB,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,+DAA+D;QAC/D,iDAAiD;IACnD,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAgB,MAAM,CAAC,GAAW,EAAE,YAAqB;IACvD,eAAe,EAAE,CAAA;IACjB,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,YAAY,CAAA;AACzC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Aether Agent SDK - Utilities Module
|
|
4
|
+
*
|
|
5
|
+
* Export utility functions
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.getEnv = exports.loadEnvIfNeeded = void 0;
|
|
9
|
+
var env_1 = require("./env");
|
|
10
|
+
Object.defineProperty(exports, "loadEnvIfNeeded", { enumerable: true, get: function () { return env_1.loadEnvIfNeeded; } });
|
|
11
|
+
Object.defineProperty(exports, "getEnv", { enumerable: true, get: function () { return env_1.getEnv; } });
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,6BAA+C;AAAtC,sGAAA,eAAe,OAAA;AAAE,6FAAA,MAAM,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aether-agent-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Autonomous Agent Ecosystem SDK for Solana - A2A Protocol, x402 Payment Standard, and Agent-to-Agent Communication",
|
|
5
5
|
"main": "./dist/src/index.js",
|
|
6
6
|
"types": "./dist/src/index.d.ts",
|