@clawlabz/clawarena 0.2.6 → 0.2.7

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/index.ts CHANGED
@@ -5,7 +5,7 @@ declare function setTimeout(fn: () => void, ms: number): unknown
5
5
  declare function clearTimeout(id: unknown): void
6
6
  declare function fetch(url: string, init?: Record<string, unknown>): Promise<{ status: number; text: () => Promise<string>; headers: Headers }>
7
7
 
8
- const VERSION = '0.2.6'
8
+ const VERSION = '0.2.7'
9
9
  const PLUGIN_ID = 'clawarena'
10
10
  const DEFAULT_BASE_URL = 'https://arena.clawlabz.xyz'
11
11
  const DEFAULT_HEARTBEAT_SECONDS = 20
@@ -33,6 +33,7 @@ interface CliCommandChain {
33
33
  option: (flags: string, desc: string) => CliCommandChain
34
34
  action: (handler: (...args: unknown[]) => void) => CliCommandChain
35
35
  command: (name: string) => CliCommandChain
36
+ allowExcessArguments: (allow: boolean) => CliCommandChain
36
37
  }
37
38
 
38
39
  interface CliProgram {
@@ -968,29 +969,34 @@ export default function register(api: OpenClawApi) {
968
969
 
969
970
  api.registerCli?.(({ program }) => {
970
971
 
972
+ // Helper: configure a command with allowExcessArguments for robustness
973
+ function cmd(parent: CliCommandChain | CliProgram, name: string) {
974
+ return parent.command(name).allowExcessArguments(true)
975
+ }
976
+
971
977
  // ── Space format: `openclaw clawarena <sub>` ──
972
- const arenaGroup = program.command('clawarena').description('ClawArena agent management')
973
- arenaGroup.command('create').description('Create a new agent').argument('[name]', 'Agent name').action(handleCreate)
974
- arenaGroup.command('connect').description('Connect with existing API key').argument('<api-key>', 'API key').action(handleConnect)
975
- arenaGroup.command('ls').description('Show agent info').action(handleLs)
976
- arenaGroup.command('status').description('Show runner status').action(handleStatus)
977
- arenaGroup.command('start').description('Start runner').action(handleStart)
978
- arenaGroup.command('stop').description('Stop runner').action(handleStop)
979
- arenaGroup.command('pause').description('Pause matchmaking').action(handlePause)
980
- arenaGroup.command('resume').description('Resume matchmaking').action(handleResume)
981
- arenaGroup.command('modes').description('Set preferred game modes').argument('<modes>', 'Comma-separated modes').action(handleModes)
978
+ const arenaGroup = cmd(program, 'clawarena').description('ClawArena agent management')
979
+ cmd(arenaGroup, 'create').description('Create a new agent').argument('[name]', 'Agent name').action(handleCreate)
980
+ cmd(arenaGroup, 'connect').description('Connect with existing API key').argument('[api-key]', 'API key').action(handleConnect)
981
+ cmd(arenaGroup, 'ls').description('Show agent info').action(handleLs)
982
+ cmd(arenaGroup, 'status').description('Show runner status').action(handleStatus)
983
+ cmd(arenaGroup, 'start').description('Start runner').action(handleStart)
984
+ cmd(arenaGroup, 'stop').description('Stop runner').action(handleStop)
985
+ cmd(arenaGroup, 'pause').description('Pause matchmaking').action(handlePause)
986
+ cmd(arenaGroup, 'resume').description('Resume matchmaking').action(handleResume)
987
+ cmd(arenaGroup, 'modes').description('Set preferred game modes').argument('[modes]', 'Comma-separated modes').action(handleModes)
982
988
 
983
989
  // ── Colon format: `openclaw clawarena:ls` (backward compat) ──
984
990
  for (const prefix of ['clawarena', 'clawarena-openclaw']) {
985
- program.command(`${prefix}:create`).description('Create a new agent').argument('[name]', 'Agent name').action(handleCreate)
986
- program.command(`${prefix}:connect`).description('Connect with existing API key').argument('<api-key>', 'API key').action(handleConnect)
987
- program.command(`${prefix}:ls`).description('Show agent info').action(handleLs)
988
- program.command(`${prefix}:status`).description('Show runner status').action(handleStatus)
989
- program.command(`${prefix}:start`).description('Start runner').action(handleStart)
990
- program.command(`${prefix}:stop`).description('Stop runner').action(handleStop)
991
- program.command(`${prefix}:pause`).description('Pause matchmaking').action(handlePause)
992
- program.command(`${prefix}:resume`).description('Resume matchmaking').action(handleResume)
993
- program.command(`${prefix}:modes`).description('Set preferred game modes').argument('<modes>', 'Comma-separated modes').action(handleModes)
991
+ cmd(program, `${prefix}:create`).description('Create a new agent').argument('[name]', 'Agent name').action(handleCreate)
992
+ cmd(program, `${prefix}:connect`).description('Connect with existing API key').argument('[api-key]', 'API key').action(handleConnect)
993
+ cmd(program, `${prefix}:ls`).description('Show agent info').action(handleLs)
994
+ cmd(program, `${prefix}:status`).description('Show runner status').action(handleStatus)
995
+ cmd(program, `${prefix}:start`).description('Start runner').action(handleStart)
996
+ cmd(program, `${prefix}:stop`).description('Stop runner').action(handleStop)
997
+ cmd(program, `${prefix}:pause`).description('Pause matchmaking').action(handlePause)
998
+ cmd(program, `${prefix}:resume`).description('Resume matchmaking').action(handleResume)
999
+ cmd(program, `${prefix}:modes`).description('Set preferred game modes').argument('[modes]', 'Comma-separated modes').action(handleModes)
994
1000
  }
995
1001
 
996
1002
  }, { commands: CLI_COMMANDS })
@@ -2,7 +2,7 @@
2
2
  "id": "clawarena",
3
3
  "name": "ClawArena OpenClaw",
4
4
  "description": "Connect OpenClaw agents to ClawArena — auto-queue, auto-play, always online.",
5
- "version": "0.2.6",
5
+ "version": "0.2.7",
6
6
  "configSchema": {
7
7
  "type": "object",
8
8
  "additionalProperties": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clawlabz/clawarena",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "Official ClawArena plugin for OpenClaw Gateway.",
5
5
  "type": "module",
6
6
  "license": "MIT",