@dimcool/mcp 0.1.11 → 0.1.13
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/dist/index.js +31 -18
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -25233,6 +25233,11 @@ function registerAuthTools(server2, client) {
|
|
|
25233
25233
|
"No referrer yet \u2014 call dim_apply_referral_code for 10% fee discount"
|
|
25234
25234
|
);
|
|
25235
25235
|
}
|
|
25236
|
+
if (result.username) {
|
|
25237
|
+
nextSteps.push(
|
|
25238
|
+
`Share your referral code "${result.username}" with other users/agents \u2014 you earn 30% of their game fees (https://dim.cool/?ref=${result.username})`
|
|
25239
|
+
);
|
|
25240
|
+
}
|
|
25236
25241
|
} catch {
|
|
25237
25242
|
}
|
|
25238
25243
|
const response = {
|
|
@@ -25787,7 +25792,7 @@ import { z as z5 } from "zod";
|
|
|
25787
25792
|
function registerGamesTools(server2, client) {
|
|
25788
25793
|
server2.tool(
|
|
25789
25794
|
"dim_list_games",
|
|
25790
|
-
"List all available game types on DIM with player counts and descriptions. Games include: Rock-Paper-Scissors, Chess, Tic-Tac-Toe, Connect Four
|
|
25795
|
+
"List all available game types on DIM with player counts and descriptions. Games include: Rock-Paper-Scissors, Chess, Tic-Tac-Toe, Connect Four.",
|
|
25791
25796
|
{},
|
|
25792
25797
|
async () => {
|
|
25793
25798
|
try {
|
|
@@ -25833,18 +25838,19 @@ function registerGamesTools(server2, client) {
|
|
|
25833
25838
|
);
|
|
25834
25839
|
server2.tool(
|
|
25835
25840
|
"dim_create_lobby",
|
|
25836
|
-
"Create a new game lobby. The agent becomes the lobby creator. Other players can join, or you can join the matchmaking queue to find an opponent. Bet amount is in USDC
|
|
25841
|
+
"Create a new game lobby. The agent becomes the lobby creator. Other players can join, or you can join the matchmaking queue to find an opponent. Bet amount is in USDC dollars (e.g., 1.00 for $1.00). A 1% fee (min 1 cent) is charged per player.",
|
|
25837
25842
|
{
|
|
25838
25843
|
gameType: z5.string().describe(
|
|
25839
|
-
'Game type ID (e.g., "rock-paper-scissors", "chess", "tic-tac-toe", "connect-four"
|
|
25844
|
+
'Game type ID (e.g., "rock-paper-scissors", "chess", "tic-tac-toe", "connect-four")'
|
|
25840
25845
|
),
|
|
25841
25846
|
betAmount: z5.number().optional().describe(
|
|
25842
|
-
"Bet amount in USDC
|
|
25847
|
+
"Bet amount in USDC dollars (e.g., 1.00 for $1.00, 5.00 for $5.00, 10.00 for $10.00)"
|
|
25843
25848
|
)
|
|
25844
25849
|
},
|
|
25845
25850
|
async ({ gameType, betAmount }) => {
|
|
25846
25851
|
try {
|
|
25847
|
-
const
|
|
25852
|
+
const betMinor = betAmount != null ? Math.round(betAmount * 1e6) : void 0;
|
|
25853
|
+
const lobby = await client.sdk.lobbies.createLobby(gameType, betMinor);
|
|
25848
25854
|
return {
|
|
25849
25855
|
content: [
|
|
25850
25856
|
{
|
|
@@ -25881,7 +25887,7 @@ function registerGamesTools(server2, client) {
|
|
|
25881
25887
|
);
|
|
25882
25888
|
server2.tool(
|
|
25883
25889
|
"dim_join_queue",
|
|
25884
|
-
|
|
25890
|
+
'Join the matchmaking queue for a lobby. If matched immediately, returns gameId \u2014 start playing. If not matched, you MUST poll dim_get_lobby every 2-3 seconds until status becomes "active" and gameId appears.',
|
|
25885
25891
|
{
|
|
25886
25892
|
lobbyId: z5.string().describe("The lobby ID to join the queue for")
|
|
25887
25893
|
},
|
|
@@ -25973,24 +25979,23 @@ function registerGamesTools(server2, client) {
|
|
|
25973
25979
|
);
|
|
25974
25980
|
server2.tool(
|
|
25975
25981
|
"dim_submit_action",
|
|
25976
|
-
'Submit a game action. The action format depends on the game type.\n\nRock-Paper-Scissors: gameType="rock-paper-scissors", action="play", payload={ action: "rock"|"paper"|"scissors" }\nChess: gameType="chess", action="move", payload={ from: "e2", to: "e4" }\nTic-Tac-Toe: gameType="tic-tac-toe", action="
|
|
25982
|
+
'Submit a game action. The action format depends on the game type.\n\nRock-Paper-Scissors: gameType="rock-paper-scissors", action="play", payload={ action: "rock"|"paper"|"scissors" }\nChess: gameType="chess", action="move", payload={ from: "e2", to: "e4" }\nTic-Tac-Toe: gameType="tic-tac-toe", action="place_mark", payload={ row: 0-2, col: 0-2 }\nConnect Four: gameType="connect-four", action="drop_disc", payload={ column: 0-6 }',
|
|
25977
25983
|
{
|
|
25978
25984
|
gameId: z5.string().describe("The game ID to submit an action for"),
|
|
25979
25985
|
gameType: z5.string().describe(
|
|
25980
|
-
'Game type (e.g., "rock-paper-scissors", "chess", "tic-tac-toe")'
|
|
25986
|
+
'Game type (e.g., "rock-paper-scissors", "chess", "tic-tac-toe", "connect-four")'
|
|
25987
|
+
),
|
|
25988
|
+
action: z5.string().describe(
|
|
25989
|
+
'Action type (e.g., "play", "move", "place_mark", "drop_disc")'
|
|
25981
25990
|
),
|
|
25982
|
-
action: z5.string().describe('Action type (e.g., "play", "move", "place", "drop")'),
|
|
25983
25991
|
payload: z5.record(z5.unknown()).describe(
|
|
25984
25992
|
"Action payload (game-specific, see tool description for format)"
|
|
25985
25993
|
)
|
|
25986
25994
|
},
|
|
25987
25995
|
async ({ gameId, gameType, action, payload }) => {
|
|
25988
25996
|
try {
|
|
25989
|
-
|
|
25990
|
-
|
|
25991
|
-
action,
|
|
25992
|
-
payload
|
|
25993
|
-
});
|
|
25997
|
+
const gameAction = { gameType, action, payload };
|
|
25998
|
+
await client.sdk.games.submitAction(gameId, gameAction);
|
|
25994
25999
|
return {
|
|
25995
26000
|
content: [
|
|
25996
26001
|
{
|
|
@@ -26869,11 +26874,11 @@ var DIM_INSTRUCTIONS = [
|
|
|
26869
26874
|
},
|
|
26870
26875
|
{
|
|
26871
26876
|
name: "dim_create_lobby",
|
|
26872
|
-
description: "Create a game lobby; bet in USDC
|
|
26877
|
+
description: "Create a game lobby; bet in USDC dollars."
|
|
26873
26878
|
},
|
|
26874
26879
|
{
|
|
26875
26880
|
name: "dim_join_queue",
|
|
26876
|
-
description: "Join matchmaking queue
|
|
26881
|
+
description: "Join matchmaking queue. If not matched immediately, poll dim_get_lobby until gameId appears."
|
|
26877
26882
|
},
|
|
26878
26883
|
{ name: "dim_get_lobby", description: "Get lobby details by ID." },
|
|
26879
26884
|
{
|
|
@@ -26937,11 +26942,19 @@ function registerInstructionsTool(server2) {
|
|
|
26937
26942
|
type: "text",
|
|
26938
26943
|
text: JSON.stringify(
|
|
26939
26944
|
{
|
|
26945
|
+
hint: "Game flow: dim_create_lobby \u2192 dim_join_queue \u2192 poll dim_get_lobby until gameId appears \u2192 dim_get_game_state \u2192 dim_submit_action \u2192 repeat until dim_get_game shows status=completed",
|
|
26946
|
+
move_formats: {
|
|
26947
|
+
"rock-paper-scissors": 'action: "play", payload: { action: "rock"|"paper"|"scissors" }',
|
|
26948
|
+
chess: 'action: "move", payload: { from: "e2", to: "e4" }',
|
|
26949
|
+
"tic-tac-toe": 'action: "place_mark", payload: { row: 0-2, col: 0-2 }',
|
|
26950
|
+
"connect-four": 'action: "drop_disc", payload: { column: 0-6 }'
|
|
26951
|
+
},
|
|
26952
|
+
market_flow: "dim_get_market \u2192 dim_buy_shares (dollars) \u2192 dim_get_positions \u2192 dim_sell_shares or dim_redeem_shares after resolution",
|
|
26953
|
+
fees: "1% game fee (min 1\xA2), 1\xA2 transfer fee, 3% market payout fee",
|
|
26940
26954
|
instructions: DIM_INSTRUCTIONS.map(({ name, description }) => ({
|
|
26941
26955
|
name,
|
|
26942
26956
|
description
|
|
26943
|
-
}))
|
|
26944
|
-
hint: "Call dim_login first if you have not authenticated. Then use any tool above by name."
|
|
26957
|
+
}))
|
|
26945
26958
|
},
|
|
26946
26959
|
null,
|
|
26947
26960
|
2
|