aether-agent-sdk 3.1.0 → 3.1.1

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.
@@ -0,0 +1,410 @@
1
+ "use strict";
2
+ /**
3
+ * GraphQL Client for Aether Marketplace
4
+ * Handles all GraphQL queries and mutations
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.GET_MARKETPLACE_INFO = exports.GET_ORDER = exports.GET_ORDERS = exports.GET_MESSAGES = exports.GET_CONVERSATION = exports.GET_CONVERSATIONS = exports.GET_PAID_ORDERS = exports.GET_NEW_MESSAGES = exports.GET_AGENT_STATS = exports.GET_AGENT_BY_WALLET = exports.GET_AGENT = exports.SEARCH_AGENTS = exports.REVIEW_ORDER = exports.COUNTER_OFFER = exports.DECLINE_ORDER = exports.ACCEPT_ORDER = exports.START_CONVERSATION = exports.DELIVER_ORDER = exports.CREATE_ORDER = exports.SEND_MESSAGE = exports.UPDATE_AGENT_PROFILE = exports.CREATE_SERVICE = exports.REGISTER_AGENT = exports.GraphQLClient = void 0;
11
+ const axios_1 = __importDefault(require("axios"));
12
+ /**
13
+ * GraphQL client for marketplace API
14
+ */
15
+ class GraphQLClient {
16
+ endpoint;
17
+ constructor(endpoint) {
18
+ this.endpoint = endpoint;
19
+ }
20
+ /**
21
+ * Execute a GraphQL query or mutation
22
+ */
23
+ async execute(query, variables) {
24
+ const response = await axios_1.default.post(this.endpoint, {
25
+ query,
26
+ variables,
27
+ });
28
+ if (response.data.errors) {
29
+ const errorMessage = response.data.errors
30
+ .map((e) => e.message)
31
+ .join(', ');
32
+ throw new Error(errorMessage);
33
+ }
34
+ return response.data.data;
35
+ }
36
+ }
37
+ exports.GraphQLClient = GraphQLClient;
38
+ // ============ MUTATIONS ============
39
+ exports.REGISTER_AGENT = `
40
+ mutation RegisterAgent($input: RegisterAgentInput!) {
41
+ registerAgent(input: $input) {
42
+ id
43
+ ownerWallet
44
+ name
45
+ tagline
46
+ description
47
+ endpoint
48
+ categories
49
+ basePrice
50
+ skills
51
+ languages
52
+ status
53
+ }
54
+ }
55
+ `;
56
+ exports.CREATE_SERVICE = `
57
+ mutation CreateService($wallet: String!, $input: CreateServiceInput!) {
58
+ createService(wallet: $wallet, input: $input) {
59
+ id
60
+ title
61
+ description
62
+ price
63
+ priceAthr
64
+ deliveryTime
65
+ status
66
+ }
67
+ }
68
+ `;
69
+ exports.UPDATE_AGENT_PROFILE = `
70
+ mutation UpdateAgentProfile($wallet: String!, $input: UpdateAgentInput!) {
71
+ updateAgentProfile(wallet: $wallet, input: $input) {
72
+ id
73
+ name
74
+ tagline
75
+ description
76
+ categories
77
+ basePrice
78
+ skills
79
+ languages
80
+ }
81
+ }
82
+ `;
83
+ exports.SEND_MESSAGE = `
84
+ mutation SendMessage($input: SendMessageInput!) {
85
+ sendMessage(input: $input) {
86
+ id
87
+ conversationId
88
+ fromWallet
89
+ message
90
+ hasOrder
91
+ orderId
92
+ createdAt
93
+ }
94
+ }
95
+ `;
96
+ exports.CREATE_ORDER = `
97
+ mutation CreateOrder($input: CreateOrderInput!) {
98
+ createOrder(input: $input) {
99
+ id
100
+ conversationId
101
+ agentId
102
+ clientWallet
103
+ description
104
+ price
105
+ priceAthr
106
+ deliveryTime
107
+ status
108
+ createdAt
109
+ }
110
+ }
111
+ `;
112
+ exports.DELIVER_ORDER = `
113
+ mutation DeliverOrder($orderId: String!, $input: DeliverOrderInput!) {
114
+ deliverOrder(orderId: $orderId, input: $input) {
115
+ id
116
+ status
117
+ deliveredAt
118
+ }
119
+ }
120
+ `;
121
+ exports.START_CONVERSATION = `
122
+ mutation StartConversation($input: StartConversationInput!) {
123
+ startConversation(input: $input) {
124
+ id
125
+ agentId
126
+ clientWallet
127
+ clientType
128
+ status
129
+ agent {
130
+ id
131
+ name
132
+ ownerWallet
133
+ endpoint
134
+ }
135
+ }
136
+ }
137
+ `;
138
+ exports.ACCEPT_ORDER = `
139
+ mutation AcceptOrder($orderId: String!, $input: AcceptOrderInput!) {
140
+ acceptOrder(orderId: $orderId, input: $input) {
141
+ id
142
+ status
143
+ escrowTx
144
+ paidAt
145
+ }
146
+ }
147
+ `;
148
+ exports.DECLINE_ORDER = `
149
+ mutation DeclineOrder($orderId: String!, $input: DeclineOrderInput!) {
150
+ declineOrder(orderId: $orderId, input: $input) {
151
+ id
152
+ status
153
+ }
154
+ }
155
+ `;
156
+ exports.COUNTER_OFFER = `
157
+ mutation CounterOffer($orderId: String!, $input: CounterOfferInput!) {
158
+ counterOffer(orderId: $orderId, input: $input) {
159
+ id
160
+ price
161
+ priceAthr
162
+ deliveryTime
163
+ status
164
+ }
165
+ }
166
+ `;
167
+ exports.REVIEW_ORDER = `
168
+ mutation ReviewOrder($orderId: String!, $input: ReviewOrderInput!) {
169
+ reviewOrder(orderId: $orderId, input: $input) {
170
+ id
171
+ rating
172
+ comment
173
+ }
174
+ }
175
+ `;
176
+ // ============ QUERIES ============
177
+ exports.SEARCH_AGENTS = `
178
+ query SearchAgents($filter: SearchAgentsInput) {
179
+ agents(filter: $filter) {
180
+ id
181
+ name
182
+ tagline
183
+ description
184
+ categories
185
+ basePrice
186
+ rating
187
+ totalOrders
188
+ responseTime
189
+ avatar
190
+ skills
191
+ languages
192
+ ownerWallet
193
+ endpoint
194
+ }
195
+ }
196
+ `;
197
+ exports.GET_AGENT = `
198
+ query GetAgent($id: String!) {
199
+ agent(id: $id) {
200
+ id
201
+ ownerWallet
202
+ name
203
+ tagline
204
+ description
205
+ endpoint
206
+ categories
207
+ basePrice
208
+ rating
209
+ totalOrders
210
+ responseTime
211
+ completionRate
212
+ avatar
213
+ skills
214
+ languages
215
+ status
216
+ services {
217
+ id
218
+ title
219
+ description
220
+ price
221
+ priceAthr
222
+ deliveryTime
223
+ }
224
+ }
225
+ }
226
+ `;
227
+ exports.GET_AGENT_BY_WALLET = `
228
+ query GetAgentByWallet($wallet: String!, $name: String!) {
229
+ agentByWallet(wallet: $wallet, name: $name) {
230
+ id
231
+ ownerWallet
232
+ name
233
+ endpoint
234
+ }
235
+ }
236
+ `;
237
+ exports.GET_AGENT_STATS = `
238
+ query GetAgentStats($wallet: String!) {
239
+ agentStats(wallet: $wallet) {
240
+ rating
241
+ totalOrders
242
+ responseTime
243
+ completionRate
244
+ }
245
+ }
246
+ `;
247
+ exports.GET_NEW_MESSAGES = `
248
+ query GetNewMessages($wallet: String, $agentId: String) {
249
+ newMessages(wallet: $wallet, agentId: $agentId) {
250
+ messages {
251
+ conversation {
252
+ id
253
+ agentId
254
+ clientWallet
255
+ clientType
256
+ status
257
+ }
258
+ message {
259
+ id
260
+ conversationId
261
+ fromWallet
262
+ message
263
+ hasOrder
264
+ orderId
265
+ createdAt
266
+ }
267
+ }
268
+ }
269
+ }
270
+ `;
271
+ exports.GET_PAID_ORDERS = `
272
+ query GetPaidOrders($wallet: String, $agentId: String) {
273
+ paidOrders(wallet: $wallet, agentId: $agentId) {
274
+ orders {
275
+ id
276
+ conversationId
277
+ agentId
278
+ clientWallet
279
+ description
280
+ originalRequest
281
+ price
282
+ priceAthr
283
+ paymentMethod
284
+ status
285
+ escrowTx
286
+ paidAt
287
+ createdAt
288
+ conversation {
289
+ id
290
+ clientWallet
291
+ }
292
+ }
293
+ }
294
+ }
295
+ `;
296
+ exports.GET_CONVERSATIONS = `
297
+ query GetConversations($wallet: String!) {
298
+ conversations(wallet: $wallet) {
299
+ id
300
+ agentId
301
+ clientWallet
302
+ clientType
303
+ status
304
+ createdAt
305
+ updatedAt
306
+ agent {
307
+ id
308
+ name
309
+ avatar
310
+ ownerWallet
311
+ }
312
+ messages {
313
+ id
314
+ message
315
+ fromWallet
316
+ createdAt
317
+ }
318
+ }
319
+ }
320
+ `;
321
+ exports.GET_CONVERSATION = `
322
+ query GetConversation($id: String!) {
323
+ conversation(id: $id) {
324
+ id
325
+ agentId
326
+ clientWallet
327
+ clientType
328
+ status
329
+ agent {
330
+ id
331
+ name
332
+ ownerWallet
333
+ endpoint
334
+ }
335
+ messages {
336
+ id
337
+ fromWallet
338
+ message
339
+ hasOrder
340
+ orderId
341
+ createdAt
342
+ }
343
+ }
344
+ }
345
+ `;
346
+ exports.GET_MESSAGES = `
347
+ query GetMessages($conversationId: String!, $limit: Int) {
348
+ conversation(id: $conversationId) {
349
+ messages(limit: $limit) {
350
+ id
351
+ fromWallet
352
+ message
353
+ hasOrder
354
+ orderId
355
+ createdAt
356
+ }
357
+ }
358
+ }
359
+ `;
360
+ exports.GET_ORDERS = `
361
+ query GetOrders($wallet: String!) {
362
+ orders(wallet: $wallet) {
363
+ id
364
+ conversationId
365
+ agentId
366
+ clientWallet
367
+ description
368
+ price
369
+ priceAthr
370
+ paymentMethod
371
+ status
372
+ escrowTx
373
+ deliveredAt
374
+ createdAt
375
+ }
376
+ }
377
+ `;
378
+ exports.GET_ORDER = `
379
+ query GetOrder($id: String!) {
380
+ order(id: $id) {
381
+ id
382
+ conversationId
383
+ agentId
384
+ clientWallet
385
+ description
386
+ originalRequest
387
+ price
388
+ priceAthr
389
+ paymentMethod
390
+ status
391
+ escrowTx
392
+ deliveredAt
393
+ createdAt
394
+ agent {
395
+ id
396
+ name
397
+ ownerWallet
398
+ }
399
+ }
400
+ }
401
+ `;
402
+ exports.GET_MARKETPLACE_INFO = `
403
+ query GetMarketplaceInfo {
404
+ marketplaceInfo {
405
+ marketplaceWallet
406
+ commissionRate
407
+ }
408
+ }
409
+ `;
410
+ //# sourceMappingURL=graphql.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphql.js","sourceRoot":"","sources":["../../../src/marketplace/graphql.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,kDAA0B;AAE1B;;GAEG;AACH,MAAa,aAAa;IAChB,QAAQ,CAAS;IAEzB,YAAY,QAAgB;QAC1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED;;OAE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;;;;;;CA6BxB,CAAC;AAEW,QAAA,mBAAmB,GAAG;;;;;;;;;CASlC,CAAC;AAEW,QAAA,eAAe,GAAG;;;;;;;;;CAS9B,CAAC;AAEW,QAAA,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;CAuB/B,CAAC;AAEW,QAAA,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;CAwB9B,CAAC;AAEW,QAAA,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;CAwBhC,CAAC;AAEW,QAAA,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;CAwB/B,CAAC;AAEW,QAAA,YAAY,GAAG;;;;;;;;;;;;;CAa3B,CAAC;AAEW,QAAA,UAAU,GAAG;;;;;;;;;;;;;;;;;CAiBzB,CAAC;AAEW,QAAA,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;CAuBxB,CAAC;AAEW,QAAA,oBAAoB,GAAG;;;;;;;CAOnC,CAAC"}
@@ -1,9 +1,12 @@
1
1
  /**
2
2
  * Aether Marketplace SDK
3
3
  *
4
+ * Uses GraphQL API at https://api.getaether.xyz/graphql
5
+ *
4
6
  * @module marketplace
5
7
  */
6
8
  export * from './types';
9
+ export { GraphQLClient } from './graphql';
7
10
  export { MarketplaceProvider } from './MarketplaceProvider';
8
11
  export { MarketplaceConsumer, ConversationWrapper } from './MarketplaceConsumer';
9
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/marketplace/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/marketplace/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -2,6 +2,8 @@
2
2
  /**
3
3
  * Aether Marketplace SDK
4
4
  *
5
+ * Uses GraphQL API at https://api.getaether.xyz/graphql
6
+ *
5
7
  * @module marketplace
6
8
  */
7
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
@@ -19,8 +21,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
21
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
22
  };
21
23
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.ConversationWrapper = exports.MarketplaceConsumer = exports.MarketplaceProvider = void 0;
24
+ exports.ConversationWrapper = exports.MarketplaceConsumer = exports.MarketplaceProvider = exports.GraphQLClient = void 0;
23
25
  __exportStar(require("./types"), exports);
26
+ var graphql_1 = require("./graphql");
27
+ Object.defineProperty(exports, "GraphQLClient", { enumerable: true, get: function () { return graphql_1.GraphQLClient; } });
24
28
  var MarketplaceProvider_1 = require("./MarketplaceProvider");
25
29
  Object.defineProperty(exports, "MarketplaceProvider", { enumerable: true, get: function () { return MarketplaceProvider_1.MarketplaceProvider; } });
26
30
  var MarketplaceConsumer_1 = require("./MarketplaceConsumer");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/marketplace/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;AAEH,0CAAwB;AACxB,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,6DAAiF;AAAxE,0HAAA,mBAAmB,OAAA;AAAE,0HAAA,mBAAmB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/marketplace/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;AAEH,0CAAwB;AACxB,qCAA0C;AAAjC,wGAAA,aAAa,OAAA;AACtB,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,6DAAiF;AAAxE,0HAAA,mBAAmB,OAAA;AAAE,0HAAA,mBAAmB,OAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aether-agent-sdk",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
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",