-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagent-quickstart.yaml
More file actions
406 lines (387 loc) · 13.7 KB
/
agent-quickstart.yaml
File metadata and controls
406 lines (387 loc) · 13.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
api:
name: Axis CLI API
base_url: http://127.0.0.1:<PORT>
version: "1.0"
description: >
Axis is the Eternum onchain agent CLI. It discovers active worlds, authenticates
with Cartridge Controller, and runs an LLM-driven tick loop that observes game
state and executes on-chain actions. In headless mode it exposes an HTTP API,
SSE event stream, and stdin control interface.
docs_url: https://docs.realms.world/development/axis/overview
source_repo: https://github.com/bibliothecadao/eternum
installation:
method: shell_script
command: "curl -fsSL https://github.com/bibliothecadao/eternum/releases/latest/download/install-axis.sh | bash"
pin_version: "VERSION=v0.1.0 bash"
verify: "axis --version"
prerequisites:
- "One model provider API key (e.g. ANTHROPIC_API_KEY)"
- "For source builds: Node.js 22+, pnpm, Bun"
authentication:
type: none
note: >
The HTTP API runs locally and requires no auth token. Authentication to the
Eternum game is handled separately via Cartridge Controller (browser OAuth
or password method). Session tokens are stored in ~/.eternum-agent/.cartridge/<world>/.
cartridge_auth_methods:
- name: browser_interactive
description: "Opens browser automatically for interactive login"
command: "axis auth <world>"
- name: password
description: "Direct password auth, no browser required"
command: "axis auth <world> --method=password --username=<user> --password=<pass>"
- name: redirect_url
description: "Complete auth with redirect URL captured from browser"
command: "axis auth <world> --redirect-url=<url>"
- name: session_data
description: "Complete auth with raw base64 session data"
command: "axis auth <world> --session-data=<base64>"
configuration:
env_file: "~/.eternum-agent/.env"
variables:
required:
- name: ANTHROPIC_API_KEY
type: string
description: "Required when MODEL_PROVIDER=anthropic (default)"
- name: OPENAI_API_KEY
type: string
description: "Required when MODEL_PROVIDER=openai"
optional:
- name: MODEL_PROVIDER
type: string
default: "anthropic"
options: ["anthropic", "openai", "openrouter", "google"]
description: "LLM provider selection"
- name: MODEL_ID
type: string
default: "claude-sonnet-4-5-20250929"
description: "Model identifier"
- name: CHAIN
type: string
default: "slot"
options: ["slot", "sepolia", "mainnet"]
description: "Blockchain network"
- name: SLOT_NAME
type: string
description: "Auto-select discovered world by name"
- name: GAME_NAME
type: string
default: "eternum"
description: "Session/game namespace"
- name: TICK_INTERVAL_MS
type: integer
default: 60000
description: "Agent tick interval in milliseconds"
- name: LOOP_ENABLED
type: boolean
default: true
description: "Auto-start tick loop on launch"
- name: ETERNUM_AGENT_HOME
type: string
default: "~/.eternum-agent"
description: "Runtime root directory"
- name: RPC_URL
type: string
description: "Manual RPC endpoint override (skips world discovery)"
- name: TORII_URL
type: string
description: "Manual Torii indexer endpoint override"
- name: WORLD_ADDRESS
type: string
description: "Manual world contract address override"
- name: PRIVATE_KEY
type: string
description: "Private key for private-key auth mode"
- name: ACCOUNT_ADDRESS
type: string
description: "Account address for private-key auth mode"
cli_commands:
- name: axis_run_tui
syntax: "axis"
alias: "axis run"
description: "Run Axis in TUI (terminal UI) mode with interactive world picker"
use_when: "Running manually on a laptop with a TTY"
- name: axis_run_headless
syntax: "axis run --headless --world=<name>"
description: "Run Axis in headless server mode, emitting NDJSON to stdout"
use_when: "VPS, CI, fleet orchestration, agent-controlled environments"
required_flags:
- name: "--world"
type: string
required: true
description: "Target world name. Required in headless mode."
optional_flags:
- name: "--api-port"
type: integer
description: "Enable HTTP API on specified port"
- name: "--api-host"
type: string
description: "API bind host (default: 127.0.0.1)"
- name: "--stdin"
type: boolean
description: "Enable stdin JSON command stream"
- name: "--verbosity"
type: string
options: ["quiet", "actions", "decisions", "all"]
description: "Output verbosity filter for NDJSON events"
- name: "--auth"
type: string
options: ["session", "privatekey"]
description: "Auth strategy"
- name: "--json"
type: boolean
description: "JSON output for command responses"
- name: axis_worlds
syntax: "axis worlds"
description: "List all discovered worlds across slot, sepolia, and mainnet"
- name: axis_auth
syntax: "axis auth <world>"
description: "Authenticate with a world via Cartridge Controller"
flags:
- name: "--all"
type: boolean
description: "Target all discovered worlds"
- name: "--status"
type: boolean
description: "Check session status instead of generating auth URL"
- name: "--method"
type: string
options: ["password"]
description: "Auth method (password = no browser required)"
- name: "--username"
type: string
description: "Username for password auth"
- name: "--password"
type: string
description: "Password for password auth"
- name: "--redirect-url"
type: string
description: "Complete auth with the redirect URL captured from browser"
- name: "--session-data"
type: string
description: "Complete auth with raw base64 session data"
- name: "--callback-url"
type: string
description: "Public callback endpoint for headless VPS auth"
- name: "--timeout"
type: integer
description: "Approval wait timeout in ms"
- name: "--json"
type: boolean
description: "Output result as JSON"
- name: axis_doctor
syntax: "axis doctor"
description: "Validate configuration and diagnose common issues"
- name: axis_init
syntax: "axis init [world]"
description: "Manually seed runtime directories and config (optional; all dirs are auto-created on first run)"
endpoints:
- name: queue_prompt
method: POST
path: /prompt
description: "Queue a natural-language prompt for the agent to execute on the next tick"
requires_api_port: true
parameters:
- name: content
type: string
location: body
required: true
description: "Natural language instruction for the agent"
request_content_type: "application/json"
request_example:
content: "Build a farm at your main realm"
response:
type: object
description: "Acknowledgment that the prompt was queued"
errors:
- code: 400
message: "Bad Request"
action: "Check that body is valid JSON with a 'content' field"
- code: 500
message: "Internal Server Error"
action: "Check agent logs; the agent process may have crashed"
- name: get_status
method: GET
path: /status
description: "Get the current agent status including world info, loop state, and session"
requires_api_port: true
parameters: []
response:
type: object
description: "Agent status snapshot"
fields:
- name: world
type: string
description: "Active world name"
- name: loopEnabled
type: boolean
description: "Whether the tick loop is running"
- name: tickIntervalMs
type: integer
description: "Current tick interval in milliseconds"
- name: sessionActive
type: boolean
description: "Whether a valid session exists"
errors:
- code: 500
message: "Internal Server Error"
action: "Agent process may not be running; restart axis"
- name: get_state
method: GET
path: /state
description: "Get a full snapshot of the current world state observed by the agent"
requires_api_port: true
parameters: []
response:
type: object
description: "World state snapshot as observed by agent"
errors:
- code: 500
message: "Internal Server Error"
action: "Agent process may not have loaded world state yet; wait for first tick"
- name: subscribe_events
method: GET
path: /events
description: "Subscribe to the agent's Server-Sent Events (SSE) stream of NDJSON events"
requires_api_port: true
parameters:
- name: verbosity
type: string
location: query
required: false
description: "Filter events: quiet, actions, decisions, all"
response:
type: stream
content_type: "text/event-stream"
description: "SSE stream of NDJSON event objects"
event_types:
- name: startup
description: "Agent started"
- name: session
description: "Session established or changed"
- name: decision
description: "Agent made a strategic decision"
- name: action
description: "Agent executed an on-chain action"
- name: prompt
description: "Prompt was queued or processed"
- name: heartbeat
description: "Periodic heartbeat"
- name: config
description: "Configuration changed"
- name: error
description: "An error occurred"
- name: shutdown
description: "Agent shutting down"
verbosity_filters:
quiet: ["error", "session", "shutdown"]
actions: ["error", "session", "shutdown", "action"]
decisions: ["error", "session", "shutdown", "action", "decision", "heartbeat", "prompt", "startup", "config"]
all: ["error", "session", "shutdown", "action", "decision", "heartbeat", "prompt", "startup", "config", "tick"]
- name: update_config
method: POST
path: /config
description: "Update runtime configuration without restarting the agent"
requires_api_port: true
parameters:
- name: changes
type: array
location: body
required: true
description: "Array of config change objects with 'path' and 'value'"
request_content_type: "application/json"
request_example:
changes:
- path: "tickIntervalMs"
value: 30000
updatable_config_paths:
- tickIntervalMs
- loopEnabled
- modelProvider
- modelId
- dataDir
response:
type: object
description: "Confirmation of applied config changes"
notes:
- "Some backend fields (world connection details) require restart in headless mode"
errors:
- code: 400
message: "Bad Request"
action: "Verify the 'changes' array has valid 'path' and 'value' fields"
- name: shutdown
method: POST
path: /shutdown
description: "Gracefully shut down the axis agent process"
requires_api_port: true
parameters: []
response:
type: object
description: "Shutdown initiated confirmation"
errors:
- code: 500
message: "Internal Server Error"
action: "Process may already be shutting down"
- name: auth_callback
method: GET
path: /auth/callback
alias_method: POST
description: "Cartridge Controller OAuth callback endpoint. Used during browser-based auth flows."
requires_api_port: true
parameters:
- name: code
type: string
location: query
required: false
description: "OAuth authorization code from Cartridge"
- name: state
type: string
location: query
required: false
description: "OAuth state parameter"
response:
type: object
description: "Auth completion result"
stdin_control:
description: >
When --stdin flag is set (or stdin is non-TTY), send one JSON object per line
to control the agent programmatically.
enabled_when: "--stdin flag is passed OR stdin is non-TTY"
message_types:
- type: prompt
schema:
type: "prompt"
content: "<string>"
description: "Queue a prompt for the agent"
example: '{"type":"prompt","content":"Scout north"}'
- type: config
schema:
type: "config"
changes:
- path: "<string>"
value: "<any>"
description: "Update runtime configuration"
example: '{"type":"config","changes":[{"path":"tickIntervalMs","value":45000}]}'
- type: shutdown
schema:
type: "shutdown"
description: "Initiate graceful shutdown"
example: '{"type":"shutdown"}'
ndjson_events:
description: "Headless mode emits newline-delimited JSON objects to stdout"
verbosity_levels:
quiet: "error, session, shutdown"
actions: "quiet + action"
decisions: "actions + decision, heartbeat, prompt, startup, config"
all: "decisions + tick"
agent_notes:
idempotency: "POST /prompt is not idempotent; avoid duplicate submissions"
retry_logic: >
On 500 errors, wait 5s and retry. On connection refused, ensure axis is running
with --api-port and the correct port.
polling: >
If SSE (GET /events) is unavailable, poll GET /status every tickIntervalMs ms.
Default tick interval is 60000ms (60 seconds).
fleet_pattern: >
Use 'axis auth --all --json' to authenticate all worlds, then launch one
axis process per world on separate ports.