docs: refresh gateway feature registry mirrors

This commit is contained in:
Peter Steinberger
2026-04-04 21:17:54 +01:00
parent e419989c34
commit 8bc59eceb7
4 changed files with 18 additions and 4 deletions

View File

@@ -82,6 +82,8 @@ sequenceDiagram
- After handshake:
- Requests: `{type:"req", id, method, params}``{type:"res", id, ok, payload|error}`
- Events: `{type:"event", event, payload, seq?, stateVersion?}`
- `hello-ok.features.methods` / `events` are discovery metadata, not a
generated dump of every callable helper route.
- Shared-secret auth uses `connect.params.auth.token` or
`connect.params.auth.password`, depending on the configured gateway auth mode.
- Identity-bearing modes such as Tailscale Serve

View File

@@ -51,14 +51,14 @@ Common methods + events:
| Nodes | `node.list`, `node.invoke`, `node.pair.*` | Gateway WS + node actions |
| Events | `tick`, `presence`, `agent`, `chat`, `health`, `shutdown` | server push |
Authoritative advertised method/event inventory lives in
Authoritative advertised **discovery** inventory lives in
`src/gateway/server-methods-list.ts` (`listGatewayMethods`, `GATEWAY_EVENTS`).
## Where the schemas live
- Source: `src/gateway/protocol/schema.ts`
- Runtime validators (AJV): `src/gateway/protocol/index.ts`
- Advertised method/event registry: `src/gateway/server-methods-list.ts`
- Advertised feature/discovery registry: `src/gateway/server-methods-list.ts`
- Server handshake + method dispatch: `src/gateway/server.impl.ts`
- Node client: `src/gateway/client.ts`
- Generated JSON Schema: `dist/protocol.schema.json`
@@ -79,8 +79,13 @@ Authoritative advertised method/event inventory lives in
accepts a `connect` request whose params match `ConnectParams`.
- **Client side**: the JS client validates event and response frames before
using them.
- **Method surface**: the Gateway advertises the supported `methods` and
`events` in `hello-ok` from `listGatewayMethods()` and `GATEWAY_EVENTS`.
- **Feature discovery**: the Gateway sends a conservative `features.methods`
and `features.events` list in `hello-ok` from `listGatewayMethods()` and
`GATEWAY_EVENTS`.
- That discovery list is not a generated dump of every callable helper in
`coreGatewayHandlers`; some helper RPCs are implemented in
`src/gateway/server-methods/*.ts` without being enumerated in the advertised
feature list.
## Example frames

View File

@@ -305,6 +305,8 @@ Defaults include isolated state/config and base gateway port `19001`.
- First client frame must be `connect`.
- Gateway returns `hello-ok` snapshot (`presence`, `health`, `stateVersion`, `uptimeMs`, limits/policy).
- `hello-ok.features.methods` / `events` are a conservative discovery list, not
a generated dump of every callable helper route.
- Requests: `req(method, params)``res(ok/payload|error)`.
- Common events: `connect.challenge`, `agent`, `chat`, `presence`, `tick`, `health`, `heartbeat`, `shutdown`.

View File

@@ -218,6 +218,11 @@ This page is not a generated full dump, but the public WS surface is broader
than the handshake/auth examples above. These are the main method families the
Gateway exposes today.
`hello-ok.features.methods` is a conservative discovery list built from
`src/gateway/server-methods-list.ts` plus loaded plugin/channel method exports.
Treat it as feature discovery, not as a generated dump of every callable helper
implemented in `src/gateway/server-methods/*.ts`.
### System and identity
- `gateway.identity.get` returns the gateway device identity used by relay and