@dimcool/dimclaw 0.1.22 → 0.1.26
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/README.md +1 -1
- package/dist/index.js +2054 -23128
- package/index.ts +3 -2
- package/package.json +5 -2
package/index.ts
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
DimAgentClient,
|
|
12
12
|
TOOL_DEFINITIONS,
|
|
13
13
|
DIM_INSTRUCTIONS,
|
|
14
|
+
executeWithAuthRetry,
|
|
14
15
|
} from '@dimcool/dim-agent-core';
|
|
15
16
|
import type { ToolParam, BufferedEvent } from '@dimcool/dim-agent-core';
|
|
16
17
|
|
|
@@ -275,7 +276,7 @@ export default function register(api: {
|
|
|
275
276
|
const c = await requireClient();
|
|
276
277
|
if ('error' in c) return c.error;
|
|
277
278
|
try {
|
|
278
|
-
const result = await
|
|
279
|
+
const result = await executeWithAuthRetry(c, tool, params);
|
|
279
280
|
if (result.isError || result.error) {
|
|
280
281
|
return textResult(result.error || 'Unknown error', true);
|
|
281
282
|
}
|
|
@@ -303,7 +304,7 @@ export default function register(api: {
|
|
|
303
304
|
return textResult(
|
|
304
305
|
JSON.stringify(
|
|
305
306
|
{
|
|
306
|
-
hint: 'Game flow: dim_create_lobby → dim_join_queue → dim_game_loop (blocks until your turn) → dim_submit_action → dim_game_loop → repeat
|
|
307
|
+
hint: 'Game flow: For paid lobbies, dim_create_lobby → dim_deposit_for_lobby → dim_join_queue. For free lobbies, dim_create_lobby → dim_join_queue. Then dim_game_loop (blocks until your turn) → dim_submit_action → dim_game_loop → repeat. Use dim_leave_lobby to exit a lobby.',
|
|
307
308
|
move_formats: {
|
|
308
309
|
'rock-paper-scissors':
|
|
309
310
|
'action: "play", payload: { action: "rock"|"paper"|"scissors" }',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dimcool/dimclaw",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.26",
|
|
4
4
|
"description": "OpenClaw plugin for DIM — play games, chat, send USDC, and earn on DIM using the SDK directly (no MCP subprocess).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"openclaw": {
|
|
@@ -17,10 +17,13 @@
|
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
19
|
"build": "tsup",
|
|
20
|
-
"dev": "tsup --watch"
|
|
20
|
+
"dev": "tsup --watch",
|
|
21
|
+
"prepack": "cp package.json .package.json.bak && node --input-type=commonjs -e \"const f=require('fs'),p=JSON.parse(f.readFileSync('package.json','utf8'));for(const[k,v]of Object.entries(p.devDependencies||{}))if(String(v).startsWith('workspace:'))delete p.devDependencies[k];f.writeFileSync('package.json',JSON.stringify(p,null,2)+'\\n')\"",
|
|
22
|
+
"postpack": "mv .package.json.bak package.json"
|
|
21
23
|
},
|
|
22
24
|
"dependencies": {},
|
|
23
25
|
"devDependencies": {
|
|
26
|
+
"@dimcool/dim-agent-core": "0.0.1",
|
|
24
27
|
"@types/node": "^20.3.1",
|
|
25
28
|
"typescript": "^5.0.0",
|
|
26
29
|
"tsup": "^8.5.1"
|