M
MERABY LABS Multi-product AI studio
SAMPLE SDK • NO HOSTED ARENA API

Bot SDK sketches

Read sample TypeScript and Python snippets and mint a demo key in this browser. The key does not authenticate anywhere. The WebSocket URL below is a sketch, not a live endpoint, and there is no public Glicko-2 leaderboard.

Agent Credentials

Mint a sample key for the snippet below. It is stored only in this page and does not authenticate to a server.

Assigned Key:

Sample string for the snippet. It is not a production token.

Matchmaking WebSocket Spec

SAMPLE URL (not live):wss://example.invalid/v1/agent/connect
LOCAL DEV SERVER:ws://localhost:8080/v1/agent/connect
PAYLOAD PROTOCOL:MessagePack & JSON RPC 2.0
SDK v1.0.0
$ npm install @meridian/agent-sdk
import { MeridianAgentClient, AgentObservation, AgentAction } from '@meridian/agent-sdk';

const client = new MeridianAgentClient({
  apiKey: 'mrd_sample_key_click_generate_below',
  serverUrl: 'wss://example.invalid/v1/agent/connect',
  botName: 'CyberViper',
});

client.onObservation((obs: AgentObservation): AgentAction => {
  console.log(`Received tick ${obs.tick}. Units alive: ${obs.mySquad.length}`);

  // Target nearest enemy visible in fog-of-war
  const target = obs.visibleEnemies[0];

  return {
    tick: obs.tick,
    plan: [
      { unitId: obs.mySquad[0].id, type: 'MOVE', targetTile: { x: 10, y: 12 } },
      { unitId: obs.mySquad[1].id, type: 'ATTACK', targetUnitId: target?.id },
      { unitId: obs.mySquad[2].id, type: 'DEFEND' },
    ],
  };
});

await client.connect();
Engine Rules Reminder:Each squad turn has an absolute limit of 3 Action Points (AP). Movement costs 1 AP per tile, standard Attacks cost 1 AP, and Signature Ultimates cost 2 AP. Action submissions exceeding 3 AP are rejected by the referee engine.

Architecture Protocol

01 / Observation Vector

Every tick, your agent receives an unrolled bitmask of visible grid coordinates, enemy units within line of sight, and team energy reserves.

02 / 50ms Submission Window

Responses must be returned over WebSocket within 50 milliseconds. Missed turn deadlines trigger automatic pass actions to guarantee 60 FPS spectator flow.

03 / Zero Server Compute Risk

No agent code is ever executed on our simulation servers. This zero-trust architecture guarantees zero jailbreaks and fair, tamper-proof refereeing.