Skip to content

Reference

Gateway API

The local gateway's HTTP endpoints, WebSocket RPC and push events, and the method list. The Windler app and the Feishu channel use exactly this.

#Overview

The gateway listens only on 127.0.0.1:<gateway.port> (default 7788). Every control entry (app, Feishu, host tools) shares one operations layer, behaves identically and is audited.

#HTTP

MethodPathNotes
GET/health{ok, version, safeMode, mode}, no token required
POST/pair/startGenerates a 6-digit pairing code (valid 5 minutes), delivered via adapter notification and Feishu
POST/pair/finish{code} → {ok, token}; 403 wrong code, 410 expired or more than 5 attempts
POST/upload?name=&token=Upload one attachment (≤ 50 MiB) → {ok, file: {id, name, path, rel, mime, size, kind}}
GET/uploads/<rel>?token=Download an attachment (uploads directory only)

#WebSocket /rpc?token=<token>

json
{ "id": 1, "method": "status", "params": {} }
{ "id": 1, "result": { } }
{ "id": 1, "error": { "code": "", "message": "" } }
{ "event": "state", "data": { } }

#Push events

EventData
hello{version, safeMode}
stateFull state, same as status (debounced 500 ms)
timelineNew timeline entry {id, ts, kind, title, detail}
approvalApproval {id, action, reason, args, status}
saySomething she says proactively
activityProgress {session, conv, origin, channel, ts, kind, …}; kind below
secretSecret-input state (never contains values)
feishu.qr / feishu.registered / feishu.errorFeishu one-tap setup

activity.kind: start / queued / steer / step / delta (streamed fragment) / text / tool (one event while running, one after) / alive (15-second heartbeat) / done / error. Every turn in progress is also kept as a snapshot (sessions.live) so a client can rebuild its UI at any time.

#Methods

Observe

MethodParamsReturns
status—{agent, version, body, adapter, heart, physical, stopped, paused, activity, usage, budget, approvals, soul, models, thought}
timeline{limit?, before?, kind?}Timeline (newest first); detail includes the process and each tool step
messages{limit?}Recent conversation
audit{limit?}Audit records

Converse

MethodParamsNotes
chat.send{text, conv?, turn?, attachments?, mode?}mode: steer (default, interjection) / queue / interrupt
sessions / sessions.create / sessions.rename / sessions.archive…Session management
sessions.messages{id, limit?, before?}One session's conversation (with process records)
sessions.live—Snapshots of turns in progress
poke{note?}Poke

Vault: secrets, secrets.delete, secrets.pending, secrets.end.

Speech: speech / setSpeech, speechVoices, speechTest.

Tuning and safety

MethodParams
activity{value} (0–4)
pause{paused}
personality{changes: {"tau.curiosity": 2, …}} (bounded)
stop / unstop{reason?} / —
permissions / setPermission— / {id, level: allow|ask|deny}
approvals / decide— / {id, approve, note?}
budget / setBudget— / {dailyTokens?, dailyCostUsd?, minBattery?, maxTempC?}
config / setConfig— / {timezone?, brain?, heart?}
restart—

Memory

MethodNotes
memory / editMemory / setSoulResident memory and personality
journalList / journalJournal
notes / note / searchNotes and retrieval
soulConfig / setSoulConfig / soulKey / syncSoulSoul repository address (SSH only), local public key, sync now
agent / setAgentIdentity
bodiesRegistered bodies
soulHistory / soulShow / soulRevertMemory history, diff, revert

Models

MethodNotes
providers / saveProvidersRead / save as a whole (versioned; mismatch returns STALE_CONFIG)
catalog / refreshCatalog / remoteModelsModel catalog
testModel{ok, latencyMs, message}
moveModel / toggleModelGlobal order and enable/disable

Provider configuration shape:

typescript
interface Provider {
  id: string; catalogId: string; name: string; baseUrl: string; enabled: boolean;
  protocol: "openai-completions" | "openai-responses" | "anthropic-messages" | "google-generative-ai";
  keys: { id: string; label: string; lastFour: string; enabled: boolean; secret?: string }[];
  models: { id: string; name: string; enabled: boolean; context: number; maxTokens: number; sortOrder: number; cost?: { input: number; output: number } }[];
}
interface ProviderConfig { providers: Provider[]; quickModelId?: string }

Feishu: feishu.status, feishu.register, feishu.set.

This is an overview. Field-level detail is in the repository's docs/API.md; the code is authoritative.