add-rpc-endpoint
/add-rpc-endpoint
Dodaje metodę JSON API WorldMonitor jako RPC sebuf: definicję proto, generowanie, handler, bramkę, klienta i testy kontraktu.
- Autor
- koala73 ↗
- Repozytorium
- worldmonitor ↗
- Licencja
- AGPL-3.0
- Ostatnia zmiana repozytorium
- 13.11.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 13.11.2026, bez odwołań do wycofanych modeli i API.
AGPL-3.0, copyleft: przeróbki udostępniane innym muszą mieć tę samą licencję.
Co robi i kiedy
Dodaje metodę JSON API WorldMonitor jako RPC sebuf: definicję proto, generowanie, handler, bramkę, klienta i testy kontraktu.
Oryginalny opis (EN)
Add a WorldMonitor JSON API endpoint as a sebuf RPC — proto definition, make generate, handler, gateway, client wrapper, and contract checks. Use when adding or changing an RPC method or service, or when tempted to add a standalone api/*.js or api/*.ts data endpoint.
Jak działa
- Rules
- Steps
- Verify
Podgląd SKILL.md
---
name: add-rpc-endpoint
description: Add a WorldMonitor JSON API endpoint as a sebuf RPC — proto definition, make generate, handler, gateway, client wrapper, and contract checks. Use when adding or changing an RPC method or service, or when tempted to add a standalone api/*.js or api/*.ts data endpoint.
metadata:
internal: true
---
# Add an RPC endpoint
Full walkthrough with examples: [docs/adding-endpoints.mdx](../../../docs/adding-endpoints.mdx). Framework notes: [CONTRIBUTING.md#working-with-sebuf-rpc-framework](../../../CONTRIBUTING.md#working-with-sebuf-rpc-framework).
## Rules
- Every JSON data API uses sebuf. Do not add standalone `api/*.js` or `api/*.ts` data endpoints. `npm run lint:api-contract` rejects any `api/` file that is neither a sebuf gateway nor listed in `api/api-route-exceptions.json`; that manifest is only for OAuth callbacks, binary responses, upstream proxies, and operator plumbing, and is CODEOWNERS-pinned.
- Never hand-edit `src/generated/` or `docs/api/`. Edit the proto and regenerate.
- Time fields are `int64` Unix epoch milliseconds with `[(sebuf.http.int64_encoding) = INT64_ENCODING_NUMBER]`, not `google.protobuf.Timestamp`.
- Every RPC needs `option (sebuf.http.config) = { path: "...", method: HTTP_METHOD_POST }` (or `HTTP_METHOD_GET`, matching the neighbouring RPCs).
## Steps
1. Add messages and the RPC in `proto/worldmonitor/{domain}/v1/`.
2. `make generate` (needs Go, buf, and sebuf plugins pinned by `SEBUF_VERSION` in the `Makefile`; `make install-buf install-plugins`). If the toolchain is unavailable, say so; CI's proto job appends a `chore(proto): update generated artifacts` commit for same-repo branches.
3. Implement the handler in `server/worldmonitor/{domain}/v1/`. Read seeded data from Redis with `getCachedJson(key, true)` (`server/_shared/redis.ts`); use `cachedFetchJson()` for on-demand upstream fetches, with every request-varying parameter in the cache key.
4. A new service also needs its gateway `api/{domain}/v1/[rpc].ts` and the dev-server handler import in `vite.config.ts`.
5. Wrap the generated client in `src/services/{domain}/`.
6. Decide access: premium paths in `PREMIUM_RPC_PATHS` (`src/shared/premium-paths.ts`), unauthenticated ones in `PUBLIC_NO_AUTH_RPC_PATHS` (`server/gateway.ts`), anonymous CDN-shared ones in `PUBLIC_SHARED_RPC_PATHS` (`src/shared/public-rpc-cache.ts`).
## Verify
- `make lint` and `make breaking` for proto changes.
- `npm run lint:api-contract`, `npm run typecheck:api`, a focused handler test, then `npm run test:related`.
- Confirm the generated diff matches the proto change only.
Wersje
W bazie nie ma innych skilli o nazwie add-rpc-endpoint.
Migawka bazy z 13.11.2026 · wersja paczki b8db8fc57f82 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 3 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 86add-rpc
Dodaje metodę RPC do usługi gRPC w protobufie, regeneruje kod i testuje ją przez sieć. - 90add-api-endpoint
Dodaje lub rozszerza endpoint HTTP lub API: nową trasę, handler albo metodę RPC z walidacją żądania i zdefiniowaną odpowiedzią. - 100adding-personhog-rpc
Prowadzi dodanie nowego RPC do personhog-replica i personhog-router: definicję proto, generowanie klientów Python i Node.js, implementację w Rust i walidację zgodności indeksów. - 100protobuf-grpc-api-review
Przegląda zmiany Protocol Buffer i gRPC pod kątem zgodności wire i JSON, bezpiecznej ewolucji schematu, ryzyk wdrożenia i jakości kontraktu RPC. - 100add-function
Dodaje lub zmienia endpoint API, funkcję lub RPC, czyli trasę przyjmującą typowane argumenty i zwracającą typowane wyniki. - 100add-rpc
Prowadzi przez dodawanie nowych wywołań RPC do Wave Terminal: nowe polecenia RPC, metody komunikacji serwer-klient i rozszerzanie interfejsu RPC.