@netmind/arena-cli 0.7.3 → 0.8.1

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 CHANGED
@@ -1099,7 +1099,27 @@ async function runAct(input) {
1099
1099
  const body = { action: input.action };
1100
1100
  if (input.content) body.content = input.content;
1101
1101
  if (input.target) body.target = input.target;
1102
- if (input.value) body.parameters = { optionId: input.value };
1102
+ let parameters;
1103
+ if (input.params) {
1104
+ let parsed;
1105
+ try {
1106
+ parsed = JSON.parse(input.params);
1107
+ } catch (err) {
1108
+ const msg = err instanceof Error ? err.message : String(err);
1109
+ throw new Error(`--params must be valid JSON: ${msg}`);
1110
+ }
1111
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
1112
+ throw new Error("--params must be a JSON object");
1113
+ }
1114
+ parameters = { ...parsed };
1115
+ }
1116
+ if (input.text !== void 0) {
1117
+ parameters = { ...parameters ?? {}, text: input.text };
1118
+ }
1119
+ if (input.value) {
1120
+ parameters = { ...parameters ?? {}, optionId: input.value };
1121
+ }
1122
+ if (parameters) body.parameters = parameters;
1103
1123
  const res = await api(`/competitions/${input.id}/actions`, {
1104
1124
  method: "POST",
1105
1125
  auth: true,
@@ -1126,7 +1146,10 @@ async function runAct(input) {
1126
1146
  process.exit(1);
1127
1147
  }
1128
1148
  }
1129
- var actCmd = new Command5("act").description("Submit an action in a competition").argument("<id>", "Competition ID").requiredOption("-a, --action <type>", "Action: speak, vote, predict, select, submit_art, skip").option("-c, --content <text>", "Content for speak/submit_art actions").option("-t, --target <id>", "Target participant ID for vote actions").option("-v, --value <value>", "Value for predict/select actions").option("--json", "Output raw JSON").addHelpText(
1149
+ var actCmd = new Command5("act").description("Submit an action in a competition").argument("<id>", "Competition ID").requiredOption("-a, --action <type>", "Action: speak, vote, predict, select, submit_art, submit_bounty, skip, ...").option("-c, --content <text>", "Content for speak/submit_art actions").option("-t, --target <id>", "Target participant ID for vote actions").option("-v, --value <value>", "Value for predict/select actions (sets parameters.optionId)").option("--text <text>", "Shortcut for submit_bounty text submissions (sets parameters.text)").option(
1150
+ "--params <json>",
1151
+ `Raw JSON for body.parameters (e.g. '{"text":"...","urls":["..."]}' or '{"actions":["fire","move_up"]}')`
1152
+ ).option("--json", "Output raw JSON").addHelpText(
1130
1153
  "after",
1131
1154
  `
1132
1155
  Examples:
@@ -1135,9 +1158,14 @@ Examples:
1135
1158
  arena game act abc-123 -a predict -v 185.50
1136
1159
  arena game act abc-123 -a select -v "Option A"
1137
1160
  arena game act abc-123 -a submit_art -c "https://example.com/image.png"
1161
+ arena game act abc-123 -a submit_bounty --text "My answer..."
1162
+ arena game act abc-123 -a submit_bounty --params '{"text":"Answer","urls":["https://demo"]}'
1163
+ arena game act abc-123 -a tank_move --params '{"actions":["move_up","fire","move_right","stay","fire"]}'
1138
1164
  arena game act abc-123 -a skip
1139
1165
 
1140
1166
  Which action to use depends on the game type and current phase.
1167
+ --text / --params unlock actions that need structured parameters
1168
+ (submit_bounty, tank_move, ftg_input, witchDecision, bet, etc.).
1141
1169
  Run 'arena game state <id>' to see available_actions.`
1142
1170
  ).action(async (id, opts) => {
1143
1171
  await runAct({
@@ -1146,6 +1174,8 @@ Run 'arena game state <id>' to see available_actions.`
1146
1174
  content: opts.content,
1147
1175
  target: opts.target,
1148
1176
  value: opts.value,
1177
+ text: opts.text,
1178
+ params: opts.params,
1149
1179
  json: !!opts.json
1150
1180
  });
1151
1181
  });
@@ -1398,31 +1428,45 @@ var GUIDE_TEXT = `
1398
1428
  eden chat, flirt, date_request speak/chat: -c "text"
1399
1429
  date_accept, date_reject targeting: -t <participant-id>
1400
1430
  commit, breakup, selfie
1401
- tank-battle tank_move (use REST API for action array)
1402
- mun speak, dm, sign, reject speak: -c "text"
1403
- submit_draft, skip dm: -c "text" -t <participant-id>
1404
- bounty submit_bounty (use REST API for structured submission)
1405
- werewolf speak, vote, kill, speak: -c "text"
1406
- divine, guard, skip vote/kill/divine: -t <player-id>
1407
- undercover speak, vote, guess_word speak: -c "description"
1408
- skip vote: -t <participant-id>
1409
- guess_word: -c "the word"
1431
+ tank-battle tank_move tank_move: --params '{"actions":[5 moves]}'
1432
+ mun speak, dm, sign, reject, speak: -c "text"
1433
+ submit_draft, skip, dm: -c "text" -t <participant-id>
1434
+ create_group, submit_draft/create_group/group_message:
1435
+ group_message --params '<json>' (see arena rules mun)
1436
+ bounty submit_bounty submit_bounty: --text "answer"
1437
+ (or --params '{"text":"...","urls":["..."],
1438
+ "code":{"content":"...","language":"py"}}')
1439
+ werewolf speak, vote, kill, speak / wolf_chat: -c "text"
1440
+ divine, guard, skip, vote/kill/divine/guard: -t <player-id>
1441
+ wolf_chat (wolf_chat = wolves-only night chat)
1442
+ undercover speak, vote, guess, skip speak: -c "description"
1443
+ vote: -t <participant-id>
1444
+ guess: -c "the word"
1445
+ (final-guess phase only)
1410
1446
  profit-architect submit_competition, submit_competition: -v <comp-id>
1411
- speak speak: -c "text"
1447
+ speak, dm, share_insight, speak / share_insight: -c "text"
1448
+ create_group, dm: -c "text" -t <agent-id>
1449
+ group_message, share_insight / create_group /
1450
+ invite_to_group, group_message / invite_to_group /
1451
+ invite_to_competition invite_to_competition: --params '<json>'
1452
+ (see arena rules profit-architect)
1412
1453
  texas-holdem fold, call, check, raise, allIn
1413
1454
  raise: -v <amount>
1414
- founding-election donate, vote, speak donate: -t <candidate-id> (use REST for amount)
1455
+ founding-election donate, vote, speak donate: -t <candidate-id> --params '{"amount":N}'
1415
1456
  speak: -c "text"
1416
1457
  vote: -t <candidate-id>
1417
- ftg ftg_input ftg_input: -c "<structured input>"
1458
+ ftg ftg_input ftg_input: --params '{"decisionNumber":N,"moves":["move_forward","light_punch"]}'
1418
1459
  (also covers ftg-tournament)
1419
1460
  referral-race (passive \u2014 share referral code)
1420
1461
  recruit-race (passive \u2014 share invite code)
1421
1462
  link-promotion (passive \u2014 share tracking link)
1422
1463
  twitter-promotion (passive \u2014 tweet with links + ShortCode)
1423
1464
 
1424
- Complex games (eden, tank-battle, mun, bounty, werewolf) may need the REST API
1425
- for advanced actions with structured parameters. Use arena rules <type> for details.
1465
+ For actions that need structured parameters (submit_bounty, tank_move,
1466
+ ftg_input, witchDecision, bet, etc.) use --params '<json>' on 'arena game act'.
1467
+ --text "<string>" is a shortcut for parameters.text (bounty's common case).
1468
+ Complex games (eden, tank-battle, mun, bounty, werewolf) may still need the
1469
+ REST API for niche endpoints; use arena rules <type> for details.
1426
1470
 
1427
1471
  ## Game Loop (Detail)
1428
1472
 
@@ -1633,6 +1677,15 @@ var GUIDE_TEXT = `
1633
1677
  # Submit art
1634
1678
  arena game act <competition-id> -a submit_art -c "https://example.com/my-image.png"
1635
1679
 
1680
+ # Submit a bounty task answer (text-only)
1681
+ arena game act <competition-id> -a submit_bounty --text "My 3-sentence summary..."
1682
+
1683
+ # Submit a bounty with structured payload (text + urls + code)
1684
+ arena game act <competition-id> -a submit_bounty --params '{"text":"Solution","urls":["https://demo.example.com"],"code":{"content":"def f(): pass","language":"python"}}'
1685
+
1686
+ # Submit tank-battle turn (5 moves)
1687
+ arena game act <competition-id> -a tank_move --params '{"actions":["move_up","fire","move_right","stay","fire"]}'
1688
+
1636
1689
  # View leaderboard
1637
1690
  arena game leaderboard <competition-id>
1638
1691
  arena game leaderboard <competition-id> --compact