@suigar/mcp 0.1.0 → 0.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.
Files changed (55) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/bin.cjs +1 -1
  3. package/dist/bin.mjs +1 -1
  4. package/dist/index.cjs +43 -50
  5. package/dist/index.d.cts +818 -8
  6. package/dist/index.d.mts +818 -8
  7. package/dist/index.mjs +1 -8
  8. package/{node_modules/@suigar/sui-rpc-pool/dist/index.cjs → dist/server-BD-123-u.mjs} +2084 -671
  9. package/{node_modules/@suigar/sui-rpc-pool/dist/index.mjs → dist/server-Cmo8UaHE.cjs} +2341 -645
  10. package/dist/server.cjs +3 -432
  11. package/dist/server.mjs +1 -430
  12. package/package.json +75 -61
  13. package/dist/client.cjs +0 -46
  14. package/dist/client.d.cts +0 -17
  15. package/dist/client.d.mts +0 -17
  16. package/dist/client.mjs +0 -43
  17. package/dist/coin.cjs +0 -86
  18. package/dist/coin.d.cts +0 -35
  19. package/dist/coin.d.mts +0 -35
  20. package/dist/coin.mjs +0 -86
  21. package/dist/config.cjs +0 -183
  22. package/dist/config.d.cts +0 -15
  23. package/dist/config.d.mts +0 -15
  24. package/dist/config.mjs +0 -174
  25. package/dist/mcp-support.cjs +0 -62
  26. package/dist/mcp-support.d.cts +0 -16
  27. package/dist/mcp-support.d.mts +0 -16
  28. package/dist/mcp-support.mjs +0 -60
  29. package/dist/metadata.cjs +0 -51
  30. package/dist/metadata.d.cts +0 -52
  31. package/dist/metadata.d.mts +0 -52
  32. package/dist/metadata.mjs +0 -47
  33. package/dist/tools.cjs +0 -617
  34. package/dist/tools.d.cts +0 -158
  35. package/dist/tools.d.mts +0 -158
  36. package/dist/tools.mjs +0 -608
  37. package/dist/transactions.cjs +0 -294
  38. package/dist/transactions.d.cts +0 -40
  39. package/dist/transactions.d.mts +0 -40
  40. package/dist/transactions.mjs +0 -286
  41. package/dist/types.d.cts +0 -111
  42. package/dist/types.d.mts +0 -111
  43. package/node_modules/@suigar/currency-registry/dist/index.cjs +0 -121
  44. package/node_modules/@suigar/currency-registry/dist/index.d.cts +0 -50
  45. package/node_modules/@suigar/currency-registry/dist/index.d.mts +0 -50
  46. package/node_modules/@suigar/currency-registry/dist/index.mjs +0 -110
  47. package/node_modules/@suigar/currency-registry/package.json +0 -31
  48. package/node_modules/@suigar/game-registry/dist/index.cjs +0 -310
  49. package/node_modules/@suigar/game-registry/dist/index.d.cts +0 -65
  50. package/node_modules/@suigar/game-registry/dist/index.d.mts +0 -65
  51. package/node_modules/@suigar/game-registry/dist/index.mjs +0 -292
  52. package/node_modules/@suigar/game-registry/package.json +0 -31
  53. package/node_modules/@suigar/sui-rpc-pool/dist/index.d.cts +0 -465
  54. package/node_modules/@suigar/sui-rpc-pool/dist/index.d.mts +0 -465
  55. package/node_modules/@suigar/sui-rpc-pool/package.json +0 -31
package/dist/server.cjs CHANGED
@@ -1,433 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_tools = require("./tools.cjs");
3
- let _modelcontextprotocol_sdk_server_index_js = require("@modelcontextprotocol/sdk/server/index.js");
4
- let _modelcontextprotocol_sdk_server_stdio_js = require("@modelcontextprotocol/sdk/server/stdio.js");
5
- let _modelcontextprotocol_sdk_types_js = require("@modelcontextprotocol/sdk/types.js");
6
- //#region src/server.ts
7
- const json = (value) => JSON.stringify(value, null, 2);
8
- const TOOL_DEFINITIONS = [
9
- {
10
- name: "read_config",
11
- description: "Resolve Suigar config for the target network, defaulting to testnet.",
12
- inputSchema: {
13
- type: "object",
14
- properties: {
15
- network: {
16
- type: "string",
17
- default: "testnet"
18
- },
19
- providerUrl: { type: "string" },
20
- graphqlUrl: { type: "string" },
21
- config: {
22
- type: "object",
23
- additionalProperties: true
24
- }
25
- },
26
- additionalProperties: true
27
- },
28
- handler: require_tools.readConfigTool
29
- },
30
- {
31
- name: "read_game_metadata",
32
- description: "Read Suigar game metadata, on-chain settings metadata, and optional currency metadata.",
33
- inputSchema: {
34
- type: "object",
35
- properties: {
36
- game: { type: "string" },
37
- coinType: { type: "string" },
38
- network: {
39
- type: "string",
40
- default: "testnet"
41
- },
42
- config: {
43
- type: "object",
44
- additionalProperties: true
45
- }
46
- },
47
- additionalProperties: true
48
- },
49
- handler: require_tools.readGameMetadataTool
50
- },
51
- {
52
- name: "build_coinflip_transaction",
53
- description: "Build, dry-run, or inspect a Suigar coinflip transaction on testnet by default.",
54
- inputSchema: {
55
- type: "object",
56
- properties: {
57
- mode: {
58
- type: "string",
59
- enum: [
60
- "build",
61
- "dry-run",
62
- "read-only"
63
- ],
64
- default: "build"
65
- },
66
- network: {
67
- type: "string",
68
- default: "testnet"
69
- },
70
- owner: { type: "string" },
71
- coinType: { type: "string" },
72
- stake: { type: "number" },
73
- cashStake: { type: "number" },
74
- betCount: { type: "number" },
75
- side: {
76
- type: "string",
77
- enum: ["heads", "tails"]
78
- },
79
- coinObjectIds: {
80
- type: "array",
81
- items: { type: "string" }
82
- },
83
- partner: { type: "string" },
84
- metadata: {
85
- type: "object",
86
- additionalProperties: true
87
- },
88
- config: {
89
- type: "object",
90
- additionalProperties: true
91
- }
92
- },
93
- additionalProperties: true
94
- },
95
- handler: require_tools.buildCoinflipTransactionTool
96
- },
97
- {
98
- name: "build_limbo_transaction",
99
- description: "Build, dry-run, or inspect a Suigar limbo transaction.",
100
- inputSchema: {
101
- type: "object",
102
- properties: {
103
- mode: {
104
- type: "string",
105
- enum: [
106
- "build",
107
- "dry-run",
108
- "read-only"
109
- ],
110
- default: "build"
111
- },
112
- network: {
113
- type: "string",
114
- default: "testnet"
115
- },
116
- owner: { type: "string" },
117
- coinType: { type: "string" },
118
- stake: { type: "number" },
119
- cashStake: { type: "number" },
120
- betCount: { type: "number" },
121
- targetMultiplier: { type: "number" },
122
- coinObjectIds: {
123
- type: "array",
124
- items: { type: "string" }
125
- },
126
- partner: { type: "string" },
127
- metadata: {
128
- type: "object",
129
- additionalProperties: true
130
- },
131
- config: {
132
- type: "object",
133
- additionalProperties: true
134
- }
135
- },
136
- additionalProperties: true
137
- },
138
- handler: require_tools.buildLimboTransactionTool
139
- },
140
- {
141
- name: "build_plinko_transaction",
142
- description: "Build, dry-run, or inspect a Suigar plinko transaction.",
143
- inputSchema: {
144
- type: "object",
145
- properties: {
146
- mode: {
147
- type: "string",
148
- enum: [
149
- "build",
150
- "dry-run",
151
- "read-only"
152
- ],
153
- default: "build"
154
- },
155
- network: {
156
- type: "string",
157
- default: "testnet"
158
- },
159
- owner: { type: "string" },
160
- coinType: { type: "string" },
161
- stake: { type: "number" },
162
- cashStake: { type: "number" },
163
- betCount: { type: "number" },
164
- configId: { type: "number" },
165
- coinObjectIds: {
166
- type: "array",
167
- items: { type: "string" }
168
- },
169
- partner: { type: "string" },
170
- metadata: {
171
- type: "object",
172
- additionalProperties: true
173
- },
174
- config: {
175
- type: "object",
176
- additionalProperties: true
177
- }
178
- },
179
- additionalProperties: true
180
- },
181
- handler: require_tools.buildPlinkoTransactionTool
182
- },
183
- {
184
- name: "build_wheel_transaction",
185
- description: "Build, dry-run, or inspect a Suigar wheel transaction.",
186
- inputSchema: {
187
- type: "object",
188
- properties: {
189
- mode: {
190
- type: "string",
191
- enum: [
192
- "build",
193
- "dry-run",
194
- "read-only"
195
- ],
196
- default: "build"
197
- },
198
- network: {
199
- type: "string",
200
- default: "testnet"
201
- },
202
- owner: { type: "string" },
203
- coinType: { type: "string" },
204
- stake: { type: "number" },
205
- cashStake: { type: "number" },
206
- betCount: { type: "number" },
207
- configId: { type: "number" },
208
- coinObjectIds: {
209
- type: "array",
210
- items: { type: "string" }
211
- },
212
- partner: { type: "string" },
213
- metadata: {
214
- type: "object",
215
- additionalProperties: true
216
- },
217
- config: {
218
- type: "object",
219
- additionalProperties: true
220
- }
221
- },
222
- additionalProperties: true
223
- },
224
- handler: require_tools.buildWheelTransactionTool
225
- },
226
- {
227
- name: "build_range_transaction",
228
- description: "Build, dry-run, or inspect a Suigar range transaction.",
229
- inputSchema: {
230
- type: "object",
231
- properties: {
232
- mode: {
233
- type: "string",
234
- enum: [
235
- "build",
236
- "dry-run",
237
- "read-only"
238
- ],
239
- default: "build"
240
- },
241
- network: {
242
- type: "string",
243
- default: "testnet"
244
- },
245
- owner: { type: "string" },
246
- coinType: { type: "string" },
247
- stake: { type: "number" },
248
- cashStake: { type: "number" },
249
- betCount: { type: "number" },
250
- leftPoint: { type: "number" },
251
- rightPoint: { type: "number" },
252
- outOfRange: { type: "boolean" },
253
- coinObjectIds: {
254
- type: "array",
255
- items: { type: "string" }
256
- },
257
- partner: { type: "string" },
258
- metadata: {
259
- type: "object",
260
- additionalProperties: true
261
- },
262
- config: {
263
- type: "object",
264
- additionalProperties: true
265
- }
266
- },
267
- additionalProperties: true
268
- },
269
- handler: require_tools.buildRangeTransactionTool
270
- },
271
- {
272
- name: "build_pvp_coinflip_create_transaction",
273
- description: "Build, dry-run, or inspect a Suigar PvP coinflip create transaction.",
274
- inputSchema: {
275
- type: "object",
276
- properties: {
277
- mode: {
278
- type: "string",
279
- enum: [
280
- "build",
281
- "dry-run",
282
- "read-only"
283
- ],
284
- default: "build"
285
- },
286
- network: {
287
- type: "string",
288
- default: "testnet"
289
- },
290
- owner: { type: "string" },
291
- coinType: { type: "string" },
292
- stake: { type: "number" },
293
- creatorSide: {
294
- type: "string",
295
- enum: ["heads", "tails"]
296
- },
297
- isPrivate: { type: "boolean" },
298
- coinObjectIds: {
299
- type: "array",
300
- items: { type: "string" }
301
- },
302
- partner: { type: "string" },
303
- metadata: {
304
- type: "object",
305
- additionalProperties: true
306
- },
307
- config: {
308
- type: "object",
309
- additionalProperties: true
310
- }
311
- },
312
- additionalProperties: true
313
- },
314
- handler: require_tools.buildPvpCoinflipCreateTransactionTool
315
- },
316
- {
317
- name: "build_pvp_coinflip_join_transaction",
318
- description: "Build, dry-run, or inspect a Suigar PvP coinflip join transaction.",
319
- inputSchema: {
320
- type: "object",
321
- properties: {
322
- mode: {
323
- type: "string",
324
- enum: [
325
- "build",
326
- "dry-run",
327
- "read-only"
328
- ],
329
- default: "build"
330
- },
331
- network: {
332
- type: "string",
333
- default: "testnet"
334
- },
335
- owner: { type: "string" },
336
- gameId: { type: "string" },
337
- coinType: { type: "string" },
338
- stake: { type: "number" },
339
- coinObjectIds: {
340
- type: "array",
341
- items: { type: "string" }
342
- },
343
- partner: { type: "string" },
344
- metadata: {
345
- type: "object",
346
- additionalProperties: true
347
- },
348
- config: {
349
- type: "object",
350
- additionalProperties: true
351
- }
352
- },
353
- additionalProperties: true
354
- },
355
- handler: require_tools.buildPvpCoinflipJoinTransactionTool
356
- },
357
- {
358
- name: "build_pvp_coinflip_cancel_transaction",
359
- description: "Build, dry-run, or inspect a Suigar PvP coinflip cancel transaction.",
360
- inputSchema: {
361
- type: "object",
362
- properties: {
363
- mode: {
364
- type: "string",
365
- enum: [
366
- "build",
367
- "dry-run",
368
- "read-only"
369
- ],
370
- default: "build"
371
- },
372
- network: {
373
- type: "string",
374
- default: "testnet"
375
- },
376
- owner: { type: "string" },
377
- gameId: { type: "string" },
378
- coinType: { type: "string" },
379
- config: {
380
- type: "object",
381
- additionalProperties: true
382
- }
383
- },
384
- additionalProperties: true
385
- },
386
- handler: require_tools.buildPvpCoinflipCancelTransactionTool
387
- }
388
- ];
389
- const createSuigarMcpServer = () => {
390
- const server = new _modelcontextprotocol_sdk_server_index_js.Server({
391
- name: "suigar",
392
- version: "0.0.0"
393
- }, { capabilities: { tools: {} } });
394
- server.setRequestHandler(_modelcontextprotocol_sdk_types_js.ListToolsRequestSchema, async () => ({ tools: TOOL_DEFINITIONS.map(({ name, description, inputSchema }) => ({
395
- name,
396
- description,
397
- inputSchema
398
- })) }));
399
- server.setRequestHandler(_modelcontextprotocol_sdk_types_js.CallToolRequestSchema, async (request) => {
400
- const tool = TOOL_DEFINITIONS.find((entry) => entry.name === request.params.name);
401
- if (!tool) return {
402
- isError: true,
403
- content: [{
404
- type: "text",
405
- text: `Unknown tool: ${request.params.name}`
406
- }]
407
- };
408
- try {
409
- return { content: [{
410
- type: "text",
411
- text: json(await tool.handler(request.params.arguments ?? {}))
412
- }] };
413
- } catch (error) {
414
- return {
415
- isError: true,
416
- content: [{
417
- type: "text",
418
- text: error instanceof Error ? error.message : String(error ?? "Unknown error")
419
- }]
420
- };
421
- }
422
- });
423
- return server;
424
- };
425
- const startSuigarMcpServer = async () => {
426
- const server = createSuigarMcpServer();
427
- const transport = new _modelcontextprotocol_sdk_server_stdio_js.StdioServerTransport();
428
- await server.connect(transport);
429
- return server;
430
- };
431
- //#endregion
432
- exports.createSuigarMcpServer = createSuigarMcpServer;
433
- exports.startSuigarMcpServer = startSuigarMcpServer;
2
+ const require_server = require("./server-Cmo8UaHE.cjs");
3
+ exports.createSuigarMcpServer = require_server.createSuigarMcpServer;
4
+ exports.startSuigarMcpServer = require_server.startSuigarMcpServer;