docs(gateway): add client-building and embedding guides#111726
Conversation
ce02c73 to
779bacf
Compare
|
ClawSweeper rank-up move addressed: Gateway-contract owner verification is complete on exact head 779bacf. The package manifests and release wiring, capability/version contracts, reconnect and history projection, startup readiness/retry behavior, shutdown/restart semantics, embedding environment flags, and RPC ownership guidance were checked against current main. Review-driven corrections now document the initial npm rollout, resolve the installed OpenClaw entry explicitly, require a real host-managed Node runtime, and prevent unconsumed child output pipes. Proof: the full docs gate passes (747 MDX files; 6,145 links, 0 broken; glossary and docs map current), follow-up autoreview is clean, and exact-head CI run 29727227950 is green through openclaw/ci-gate. No ClawSweeper findings or remaining rank-up moves. |
|
Merged via squash.
|
What Problem This Solves
Three independent third-party clients (ClawX, openclaw-studio, PinchChat) reverse-engineered the Gateway protocol and embedder lifecycle from source because the contracts they needed were undocumented. With
@openclaw/gateway-protocol(#111664) and@openclaw/gateway-client(#111707) shipping to npm at the next train, this adds the docs that make those packages usable without reading our internals.Why This Change Was Made
docs/gateway/clients.md— Building a Gateway client: npm install, scopes + device pairing, the caps registry (incl.tool-eventsgating live tool streaming), the canonical reconnect recipe (chat.history + inFlightRun + per-run seq),__openclawhistory-row metadata and compaction-survivable anchors,sessions.changedpush-not-poll,exec.approval.listbackfill, and the honest version policy (operator exact-v4, node N-1, additive-first,sincevintage).docs/gateway/embedding.md— Embedding OpenClaw: env preset with per-flag effects (incl. the Electronprocess.execPathsnapshot popup), exit code 78 doctor-repair loop instead of stderr scraping,connect.challenge(socket) vshello-ok(application) readiness, 1013 startup-sidecars retry contract,shutdowneventrestartExpectedMsas the real restart-vs-shutdown discriminator (close code 1012 is shared), and RPC-not-state-files guidance.docs/gateway/protocol.md+external-apps.mdlink the npm packages; nav registered indocs/docs.json.User Impact
Docs-only. Third-party client and embedder developers get supported, verified contracts instead of source archaeology.
Evidence
pnpm docs:listshows both pages; MDX 747 files pass; link check 6,145 links 0 broken; formatting clean; docs.json valid;git diff --checkclean. Verification greps included in the internal build report.