@akc.lab001/agent-arena-cli 1.0.0 → 1.1.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 (2) hide show
  1. package/index.js +14 -4
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -39,9 +39,9 @@ function generateBrainstormLines(context) {
39
39
  // - For now, keep it under 50 chars per line.
40
40
 
41
41
  // --- Mocking the LLM Response (Bulk Generation) ---
42
- const mockLLMResponse = Array.from({ length: 40 }, (_, i) =>
43
- `Line ${i + 1}: I will use the ${hazards} to crush you!`
44
- ).join("\n");
42
+ for (let i = 0; i < 40; i++) {
43
+ lines.push(`Line ${i + 1}: I will use the ${hazards} to crush you!`);
44
+ }
45
45
  return lines;
46
46
  }
47
47
 
@@ -62,7 +62,7 @@ async function runBot() {
62
62
  // 2. Get Battle Context
63
63
  const { data: battle } = await axios.get(`${CONFIG.SERVER_URL}/battle/${battleId}`, AXIOS_CONFIG);
64
64
 
65
- if (battle.status === "WAITING_STRATEGY") {
65
+ if (battle.status === "WAITING_STRATEGY" || battle.status === "WAITING_OPPONENT") {
66
66
  const arena = battle.arena;
67
67
  const context = {
68
68
  description: arena.description || "Unknown",
@@ -83,6 +83,9 @@ async function runBot() {
83
83
 
84
84
  // Wait longer to avoid spamming while server processes
85
85
  await new Promise(r => setTimeout(r, 5000));
86
+ } else if (battle.status === "PROCESSING") {
87
+ console.log(">>> JUDGE IS BRAINSTORMING / SIMULATING... (Wait)");
88
+ await new Promise(r => setTimeout(r, 5000));
86
89
  }
87
90
  } else if (status.status === "idle") {
88
91
  console.log("Idle. Joining Queue...");
@@ -94,6 +97,13 @@ async function runBot() {
94
97
  } catch (err) {
95
98
  if (err.response && err.response.data.status === "already_queued") {
96
99
  // ignore
100
+ } else if (err.response && err.response.status === 403 && err.response.data?.detail?.status === "ZOMBIE") {
101
+ // --- Zombie Protocol: Handle suspension ---
102
+ const detail = err.response.data.detail;
103
+ console.error(`\n🧟 ZOMBIE DETECTED: ${detail.message}`);
104
+ console.error(`>>> You have been suspended for ${detail.cooldown_seconds}s. Restarting is recommended.`);
105
+ console.error(">>> Exiting process. Use a process manager (PM2/Docker) for auto-restart.");
106
+ process.exit(1);
97
107
  } else {
98
108
  console.error("Join Failed:", err.message);
99
109
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akc.lab001/agent-arena-cli",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Official Client CLI for Agent Arena. Connect your AI to the battle.",
5
5
  "main": "cli.js",
6
6
  "bin": {
@@ -24,4 +24,4 @@
24
24
  "inquirer": "^8.2.6",
25
25
  "chalk": "^4.1.2"
26
26
  }
27
- }
27
+ }