@suigar/mcp 0.1.0 → 0.2.0-beta.0

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 (77) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/LICENSE +201 -0
  3. package/README.md +79 -110
  4. package/dist/app/index.html +181 -0
  5. package/dist/bin.mjs +3 -7
  6. package/dist/bin.mjs.map +1 -0
  7. package/dist/client.d.mts +41 -11
  8. package/dist/client.d.mts.map +1 -0
  9. package/dist/client.mjs +107 -34
  10. package/dist/client.mjs.map +1 -0
  11. package/dist/dry-run.mjs +163 -0
  12. package/dist/dry-run.mjs.map +1 -0
  13. package/dist/format.mjs +24 -0
  14. package/dist/format.mjs.map +1 -0
  15. package/dist/index.d.mts +5 -9
  16. package/dist/index.mjs +4 -8
  17. package/dist/schemas.d.mts +642 -0
  18. package/dist/schemas.d.mts.map +1 -0
  19. package/dist/schemas.mjs +113 -0
  20. package/dist/schemas.mjs.map +1 -0
  21. package/dist/server.d.mts +21 -69
  22. package/dist/server.d.mts.map +1 -0
  23. package/dist/server.mjs +172 -411
  24. package/dist/server.mjs.map +1 -0
  25. package/dist/tools.d.mts +14 -155
  26. package/dist/tools.d.mts.map +1 -0
  27. package/dist/tools.mjs +297 -553
  28. package/dist/tools.mjs.map +1 -0
  29. package/dist/types.d.mts +109 -83
  30. package/dist/types.d.mts.map +1 -0
  31. package/package.json +83 -61
  32. package/dist/bin.cjs +0 -11
  33. package/dist/bin.d.cts +0 -1
  34. package/dist/client.cjs +0 -46
  35. package/dist/client.d.cts +0 -17
  36. package/dist/coin.cjs +0 -86
  37. package/dist/coin.d.cts +0 -35
  38. package/dist/coin.d.mts +0 -35
  39. package/dist/coin.mjs +0 -86
  40. package/dist/config.cjs +0 -183
  41. package/dist/config.d.cts +0 -15
  42. package/dist/config.d.mts +0 -15
  43. package/dist/config.mjs +0 -174
  44. package/dist/index.cjs +0 -53
  45. package/dist/index.d.cts +0 -10
  46. package/dist/mcp-support.cjs +0 -62
  47. package/dist/mcp-support.d.cts +0 -16
  48. package/dist/mcp-support.d.mts +0 -16
  49. package/dist/mcp-support.mjs +0 -60
  50. package/dist/metadata.cjs +0 -51
  51. package/dist/metadata.d.cts +0 -52
  52. package/dist/metadata.d.mts +0 -52
  53. package/dist/metadata.mjs +0 -47
  54. package/dist/server.cjs +0 -433
  55. package/dist/server.d.cts +0 -73
  56. package/dist/tools.cjs +0 -617
  57. package/dist/tools.d.cts +0 -158
  58. package/dist/transactions.cjs +0 -294
  59. package/dist/transactions.d.cts +0 -40
  60. package/dist/transactions.d.mts +0 -40
  61. package/dist/transactions.mjs +0 -286
  62. package/dist/types.d.cts +0 -111
  63. package/node_modules/@suigar/currency-registry/dist/index.cjs +0 -121
  64. package/node_modules/@suigar/currency-registry/dist/index.d.cts +0 -50
  65. package/node_modules/@suigar/currency-registry/dist/index.d.mts +0 -50
  66. package/node_modules/@suigar/currency-registry/dist/index.mjs +0 -110
  67. package/node_modules/@suigar/currency-registry/package.json +0 -31
  68. package/node_modules/@suigar/game-registry/dist/index.cjs +0 -310
  69. package/node_modules/@suigar/game-registry/dist/index.d.cts +0 -65
  70. package/node_modules/@suigar/game-registry/dist/index.d.mts +0 -65
  71. package/node_modules/@suigar/game-registry/dist/index.mjs +0 -292
  72. package/node_modules/@suigar/game-registry/package.json +0 -31
  73. package/node_modules/@suigar/sui-rpc-pool/dist/index.cjs +0 -45590
  74. package/node_modules/@suigar/sui-rpc-pool/dist/index.d.cts +0 -465
  75. package/node_modules/@suigar/sui-rpc-pool/dist/index.d.mts +0 -465
  76. package/node_modules/@suigar/sui-rpc-pool/dist/index.mjs +0 -45570
  77. package/node_modules/@suigar/sui-rpc-pool/package.json +0 -31
package/dist/server.cjs DELETED
@@ -1,433 +0,0 @@
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;
package/dist/server.d.cts DELETED
@@ -1,73 +0,0 @@
1
- import { Server } from "@modelcontextprotocol/sdk/server/index.js";
2
-
3
- //#region src/server.d.ts
4
- declare const createSuigarMcpServer: () => Server<{
5
- method: string;
6
- params?: {
7
- [x: string]: unknown;
8
- _meta?: {
9
- [x: string]: unknown;
10
- progressToken?: string | number | undefined;
11
- "io.modelcontextprotocol/related-task"?: {
12
- taskId: string;
13
- } | undefined;
14
- } | undefined;
15
- } | undefined;
16
- }, {
17
- method: string;
18
- params?: {
19
- [x: string]: unknown;
20
- _meta?: {
21
- [x: string]: unknown;
22
- progressToken?: string | number | undefined;
23
- "io.modelcontextprotocol/related-task"?: {
24
- taskId: string;
25
- } | undefined;
26
- } | undefined;
27
- } | undefined;
28
- }, {
29
- [x: string]: unknown;
30
- _meta?: {
31
- [x: string]: unknown;
32
- progressToken?: string | number | undefined;
33
- "io.modelcontextprotocol/related-task"?: {
34
- taskId: string;
35
- } | undefined;
36
- } | undefined;
37
- }>;
38
- declare const startSuigarMcpServer: () => Promise<Server<{
39
- method: string;
40
- params?: {
41
- [x: string]: unknown;
42
- _meta?: {
43
- [x: string]: unknown;
44
- progressToken?: string | number | undefined;
45
- "io.modelcontextprotocol/related-task"?: {
46
- taskId: string;
47
- } | undefined;
48
- } | undefined;
49
- } | undefined;
50
- }, {
51
- method: string;
52
- params?: {
53
- [x: string]: unknown;
54
- _meta?: {
55
- [x: string]: unknown;
56
- progressToken?: string | number | undefined;
57
- "io.modelcontextprotocol/related-task"?: {
58
- taskId: string;
59
- } | undefined;
60
- } | undefined;
61
- } | undefined;
62
- }, {
63
- [x: string]: unknown;
64
- _meta?: {
65
- [x: string]: unknown;
66
- progressToken?: string | number | undefined;
67
- "io.modelcontextprotocol/related-task"?: {
68
- taskId: string;
69
- } | undefined;
70
- } | undefined;
71
- }>>;
72
- //#endregion
73
- export { createSuigarMcpServer, startSuigarMcpServer };